bsp/mpc55xx: Add and use MPC55XX_CHIP_FAMILY

This commit is contained in:
Sebastian Huber
2012-10-01 15:02:57 +02:00
parent 29b1bbfdb6
commit 94102775e0
19 changed files with 44 additions and 40 deletions

View File

@@ -28,11 +28,11 @@
#include <bsp/irq.h>
#if MPC55XX_CHIP_TYPE / 10 == 551
#if MPC55XX_CHIP_FAMILY == 551
#define EDMA_CHANNEL_COUNT 16U
#elif MPC55XX_CHIP_TYPE / 10 == 564
#elif MPC55XX_CHIP_FAMILY == 564
#define EDMA_CHANNEL_COUNT 16U
#elif MPC55XX_CHIP_TYPE / 10 == 567
#elif MPC55XX_CHIP_FAMILY == 567
#define EDMA_CHANNEL_COUNT 96U
#else
#define EDMA_CHANNEL_COUNT 64U

View File

@@ -168,7 +168,7 @@ extern "C" {
/** @} */
#if MPC55XX_CHIP_TYPE / 10 == 567
#if MPC55XX_CHIP_FAMILY == 567
#define MPC55XX_EMIOS_CHANNEL_NUMBER 32U
#else
#define MPC55XX_EMIOS_CHANNEL_NUMBER 24U

View File

@@ -46,7 +46,7 @@ extern "C" {
#define MPC55XX_IRQ_SOFTWARE_GET_REQUEST(i) (i)
#define MPC55XX_IRQ_SOFTWARE_NUMBER (MPC55XX_IRQ_SOFTWARE_MAX + 1U)
#if MPC55XX_CHIP_TYPE / 10 == 551
#if MPC55XX_CHIP_FAMILY == 551
#define MPC55XX_IRQ_MAX 293U
/* eDMA */
@@ -111,7 +111,7 @@ extern "C" {
/* FlexRay */
#define MPC55XX_IRQ_FLEXRAY_BASE(mod) \
((mod) == 0 ? 284U : MPC55XX_IRQ_INVALID)
#elif MPC55XX_CHIP_TYPE / 10 == 564
#elif MPC55XX_CHIP_FAMILY == 564
#define MPC55XX_IRQ_MAX 255U
/* eDMA */
@@ -211,11 +211,11 @@ extern "C" {
/* SWG */
#define MPC55XX_IRQ_SWG 255U
#else
#if MPC55XX_CHIP_TYPE / 10 == 555
#if MPC55XX_CHIP_FAMILY == 555
#define MPC55XX_IRQ_MAX 307U
#elif MPC55XX_CHIP_TYPE / 10 == 556
#elif MPC55XX_CHIP_FAMILY == 556
#define MPC55XX_IRQ_MAX 360U
#elif MPC55XX_CHIP_TYPE / 10 == 567
#elif MPC55XX_CHIP_FAMILY == 567
#define MPC55XX_IRQ_MAX 479U
#else
#error "unsupported chip type"
@@ -336,7 +336,7 @@ extern "C" {
#define MPC55XX_IRQ_ESCI(mod) (MPC55XX_IRQ_ESCI_BASE(mod) + 0U)
/* FlexCAN */
#if MPC55XX_CHIP_TYPE / 10 == 564
#if MPC55XX_CHIP_FAMILY == 564
#define MPC55XX_IRQ_CAN_ERR(mod) (MPC55XX_IRQ_CAN_BASE(mod) + 0U)
#define MPC55XX_IRQ_CAN_BOFF_TWRN_RWRN(mod) (MPC55XX_IRQ_CAN_BASE(mod) + 1U)
#define MPC55XX_IRQ_CAN_BUF_0_3(mod) (MPC55XX_IRQ_CAN_BASE(mod) + 3U)
@@ -375,7 +375,7 @@ extern "C" {
#define MPC55XX_IRQ_FLEXPWM_REF(mod) (MPC55XX_IRQ_FLEXPWM_BASE(mod) + 13U)
/* FlexRay */
#if MPC55XX_CHIP_TYPE / 10 == 564
#if MPC55XX_CHIP_FAMILY == 564
#define MPC55XX_IRQ_FLEXRAY_LRNEIF_DRNEIF(mod) (MPC55XX_IRQ_FLEXRAY_BASE(mod) + 0U)
#define MPC55XX_IRQ_FLEXRAY_LRCEIF_DRCEIF(mod) (MPC55XX_IRQ_FLEXRAY_BASE(mod) + 1U)
#define MPC55XX_IRQ_FLEXRAY_FAFAIF(mod) (MPC55XX_IRQ_FLEXRAY_BASE(mod) + 2U)

View File

@@ -25,7 +25,7 @@
#include <bspopts.h>
#if MPC55XX_CHIP_TYPE / 10 == 551
#if MPC55XX_CHIP_FAMILY == 551
#define FLASH_BIUCR 0xFFFF801C
#else
#define FLASH_BIUCR 0xC3F8801C

View File

@@ -67,7 +67,7 @@ extern "C" {
union EDMA_CR_tag {
uint32_t R;
struct {
#if MPC55XX_CHIP_TYPE / 10 == 567
#if MPC55XX_CHIP_FAMILY == 567
uint32_t:14;
uint32_t CX:1;
uint32_t ECX:1;
@@ -78,7 +78,7 @@ extern "C" {
uint32_t GRP2PRI:2;
uint32_t GRP1PRI:2;
uint32_t GRP0PRI:2;
#if MPC55XX_CHIP_TYPE / 10 == 567
#if MPC55XX_CHIP_FAMILY == 567
uint32_t EMLM:1;
uint32_t CLM:1;
uint32_t HALT:1;
@@ -97,7 +97,7 @@ extern "C" {
uint32_t R;
struct {
uint32_t VLD:1;
#if MPC55XX_CHIP_TYPE / 10 == 567
#if MPC55XX_CHIP_FAMILY == 567
uint32_t:14;
uint32_t ECX:1;
#else
@@ -485,7 +485,7 @@ extern "C" {
} B;
} ERL; /* DMA Error Low */
#if MPC55XX_CHIP_TYPE / 10 == 567
#if MPC55XX_CHIP_FAMILY == 567
union { /* hardware request status high */
uint32_t R;
struct {
@@ -571,7 +571,7 @@ extern "C" {
uint8_t R;
struct {
uint8_t ECP:1;
#if MPC55XX_CHIP_TYPE / 10 == 567
#if MPC55XX_CHIP_FAMILY == 567
uint8_t DPA:1;
#else
uint8_t:1;

View File

@@ -26,14 +26,14 @@
#include <bspopts.h>
#if MPC55XX_CHIP_TYPE / 10 == 551
#if MPC55XX_CHIP_FAMILY == 551
#include <mpc55xx/fsl-mpc551x.h>
#define MPC55XX_HAS_EBI
#define MPC55XX_HAS_ESCI
#define MPC55XX_HAS_EMIOS
#define MPC55XX_HAS_FMPLL_ENHANCED
#define MPC55XX_HAS_SIU
#elif MPC55XX_CHIP_TYPE / 10 == 555
#elif MPC55XX_CHIP_FAMILY == 555
#include <mpc55xx/fsl-mpc555x.h>
#define MPC55XX_HAS_EBI
#define MPC55XX_HAS_ESCI
@@ -41,7 +41,7 @@
#define MPC55XX_HAS_FMPLL
#define MPC55XX_HAS_UNIFIED_CACHE
#define MPC55XX_HAS_SIU
#elif MPC55XX_CHIP_TYPE / 10 == 556
#elif MPC55XX_CHIP_FAMILY == 556
#include <mpc55xx/fsl-mpc556x.h>
#define MPC55XX_HAS_EBI
#define MPC55XX_HAS_ESCI
@@ -49,7 +49,7 @@
#define MPC55XX_HAS_FMPLL
#define MPC55XX_HAS_UNIFIED_CACHE
#define MPC55XX_HAS_SIU
#elif MPC55XX_CHIP_TYPE / 10 == 564
#elif MPC55XX_CHIP_FAMILY == 564
#include <mpc55xx/fsl-mpc564xL.h>
#define MPC55XX_HAS_STM
#define MPC55XX_HAS_SWT
@@ -58,7 +58,7 @@
#define MPC55XX_HAS_LINFLEX
#define MPC55XX_HAS_SECOND_INTERNAL_RAM_AREA
#define MPC55XX_HAS_SIU_LITE
#elif MPC55XX_CHIP_TYPE / 10 == 567
#elif MPC55XX_CHIP_FAMILY == 567
#include <mpc55xx/fsl-mpc567x.h>
#define MPC55XX_HAS_EBI
#define MPC55XX_HAS_ESCI