forked from Imagelibrary/rtems
bsp/mpc55xx: Add optional EBI configuration
This commit is contained in:
@@ -78,6 +78,7 @@ libbsp_a_SOURCES += startup/reset.c
|
||||
libbsp_a_SOURCES += startup/restart.c
|
||||
libbsp_a_SOURCES += startup/idle-thread.c
|
||||
libbsp_a_SOURCES += startup/start-config-clock.c
|
||||
libbsp_a_SOURCES += startup/start-config-ebi.c
|
||||
libbsp_a_SOURCES += startup/start-config-ebi-cs.c
|
||||
libbsp_a_SOURCES += startup/start-config-ebi-cs-cal.c
|
||||
libbsp_a_SOURCES += startup/start-config-mmu.c
|
||||
|
||||
@@ -93,8 +93,19 @@ extern BSP_START_DATA_SECTION const mpc55xx_clock_config
|
||||
mpc55xx_start_config_clock [];
|
||||
|
||||
#ifdef MPC55XX_HAS_EBI
|
||||
extern BSP_START_DATA_SECTION const struct
|
||||
EBI_CS_tag mpc55xx_start_config_ebi_cs [];
|
||||
typedef struct {
|
||||
union EBI_MCR_tag ebi_mcr;
|
||||
uint32_t siu_eccr_ebdf;
|
||||
} mpc55xx_ebi_config;
|
||||
|
||||
extern BSP_START_DATA_SECTION const mpc55xx_ebi_config
|
||||
mpc55xx_start_config_ebi [];
|
||||
|
||||
extern BSP_START_DATA_SECTION const size_t
|
||||
mpc55xx_start_config_ebi_count [];
|
||||
|
||||
extern BSP_START_DATA_SECTION const struct EBI_CS_tag
|
||||
mpc55xx_start_config_ebi_cs [];
|
||||
|
||||
extern BSP_START_DATA_SECTION const size_t
|
||||
mpc55xx_start_config_ebi_cs_count [];
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @ingroup mpc55xx
|
||||
*
|
||||
* @brief EBI configuration.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012 embedded brains GmbH. All rights reserved.
|
||||
*
|
||||
* embedded brains GmbH
|
||||
* Obere Lagerstr. 30
|
||||
* 82178 Puchheim
|
||||
* Germany
|
||||
* <rtems@embedded-brains.de>
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
#include <bsp/mpc55xx-config.h>
|
||||
|
||||
#ifdef MPC55XX_HAS_EBI
|
||||
|
||||
const mpc55xx_ebi_config mpc55xx_start_config_ebi [] = {
|
||||
#if defined(MPC55XX_BOARD_GWLCFM)
|
||||
{
|
||||
.ebi_mcr = {
|
||||
.B = {
|
||||
.DBM = 1,
|
||||
.AD_MUX = 1, /* use multiplexed bus */
|
||||
.D16_31 = 1 /* use lower AD bus */
|
||||
}
|
||||
},
|
||||
.siu_eccr_ebdf = 4 - 1 /* use CLK/4 as bus clock */
|
||||
}
|
||||
#elif (defined(MPC55XX_BOARD_MPC5674FEVB) \
|
||||
|| defined(MPC55XX_BOARD_MPC5674F_ECU508)) \
|
||||
&& defined(MPC55XX_NEEDS_LOW_LEVEL_INIT)
|
||||
{
|
||||
.ebi_mcr = {
|
||||
.B = {
|
||||
.ACGE = 0,
|
||||
.MDIS = 0,
|
||||
.D16_31 = 1,
|
||||
.AD_MUX = 0,
|
||||
.DBM = 0
|
||||
}
|
||||
},
|
||||
.siu_eccr_ebdf = 2 - 1
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
const size_t mpc55xx_start_config_ebi_count [] = {
|
||||
RTEMS_ARRAY_SIZE(mpc55xx_start_config_ebi)
|
||||
};
|
||||
|
||||
#endif /* MPC55XX_HAS_EBI */
|
||||
@@ -145,7 +145,6 @@ static BSP_START_TEXT_SECTION void mpc55xx_start_siu(void)
|
||||
|
||||
static BSP_START_TEXT_SECTION void mpc55xx_start_ebi_chip_select(void)
|
||||
{
|
||||
#ifdef MPC55XX_NEEDS_LOW_LEVEL_INIT
|
||||
#ifdef MPC55XX_HAS_EBI
|
||||
size_t i = 0;
|
||||
|
||||
@@ -157,35 +156,17 @@ static BSP_START_TEXT_SECTION void mpc55xx_start_ebi_chip_select(void)
|
||||
EBI.CAL_CS [i] = mpc55xx_start_config_ebi_cal_cs [i];
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
static BSP_START_TEXT_SECTION void mpc55xx_start_ebi(void)
|
||||
{
|
||||
#ifdef MPC55XX_NEEDS_LOW_LEVEL_INIT
|
||||
#if defined(MPC55XX_BOARD_GWLCFM)
|
||||
/*
|
||||
* init EBI for Muxed AD bus
|
||||
*/
|
||||
EBI.MCR.B.DBM = 1;
|
||||
EBI.MCR.B.AD_MUX = 1; /* use multiplexed bus */
|
||||
EBI.MCR.B.D16_31 = 1; /* use lower AD bus */
|
||||
#ifdef MPC55XX_HAS_EBI
|
||||
size_t i = 0;
|
||||
|
||||
SIU.ECCR.B.EBDF = 3; /* use CLK/4 as bus clock */
|
||||
#elif defined(MPC55XX_BOARD_MPC5674FEVB) \
|
||||
|| defined(MPC55XX_BOARD_MPC5674F_ECU508)
|
||||
union EBI_MCR_tag mcr = {
|
||||
.B = {
|
||||
.ACGE = 0,
|
||||
.MDIS = 0,
|
||||
.D16_31 = 1,
|
||||
.AD_MUX = 0,
|
||||
.DBM = 0
|
||||
for (i = 0; i < mpc55xx_start_config_ebi_count [0]; ++i) {
|
||||
SIU.ECCR.B.EBDF = mpc55xx_start_config_ebi [i].siu_eccr_ebdf;
|
||||
EBI.MCR.R = mpc55xx_start_config_ebi [i].ebi_mcr.R;
|
||||
}
|
||||
};
|
||||
|
||||
EBI.MCR.R = mcr.R;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user