[U-Boot] [PATCH v3 13/19] ARM: SPL: Move gpmc_init() to spl_board_init()
Tom Rini
trini at ti.com
Thu Aug 23 01:19:39 CEST 2012
This is an OMAP/related-specific function, move calling it to
spl_board_init() and turn on CONFIG_SPL_BOARD_INIT on the boards that
enabled NAND and didn't enable this already.
Signed-off-by: Tom Rini <trini at ti.com>
---
arch/arm/cpu/armv7/omap-common/boot-common.c | 7 +++++++
arch/arm/cpu/armv7/omap-common/spl_nand.c | 1 -
arch/arm/cpu/armv7/omap3/board.c | 3 +++
include/configs/am3517_crane.h | 1 +
include/configs/am3517_evm.h | 1 +
include/configs/mcx.h | 1 +
include/configs/tam3517-common.h | 1 +
7 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/arch/arm/cpu/armv7/omap-common/boot-common.c b/arch/arm/cpu/armv7/omap-common/boot-common.c
index 3406cfb..ed398fd 100644
--- a/arch/arm/cpu/armv7/omap-common/boot-common.c
+++ b/arch/arm/cpu/armv7/omap-common/boot-common.c
@@ -49,6 +49,13 @@ u32 spl_boot_mode(void)
return omap_bootmode;
}
+void spl_board_init(void)
+{
+#ifdef CONFIG_SPL_NAND_SUPPORT
+ gpmc_init();
+#endif
+}
+
int board_mmc_init(bd_t *bis)
{
switch (spl_boot_device()) {
diff --git a/arch/arm/cpu/armv7/omap-common/spl_nand.c b/arch/arm/cpu/armv7/omap-common/spl_nand.c
index 3e2f359..1e6b5f0 100644
--- a/arch/arm/cpu/armv7/omap-common/spl_nand.c
+++ b/arch/arm/cpu/armv7/omap-common/spl_nand.c
@@ -35,7 +35,6 @@ void spl_nand_load_image(void)
int *dst __attribute__((unused));
debug("spl: nand - using hw ecc\n");
- gpmc_init();
nand_init();
/*use CONFIG_SYS_TEXT_BASE as temporary storage area */
diff --git a/arch/arm/cpu/armv7/omap3/board.c b/arch/arm/cpu/armv7/omap3/board.c
index 3d74f09..52196c8 100644
--- a/arch/arm/cpu/armv7/omap3/board.c
+++ b/arch/arm/cpu/armv7/omap3/board.c
@@ -106,6 +106,9 @@ int board_mmc_init(bd_t *bis)
void spl_board_init(void)
{
+#ifdef CONFIG_SPL_NAND_SUPPORT
+ gpmc_init();
+#endif
#ifdef CONFIG_SPL_I2C_SUPPORT
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
#endif
diff --git a/include/configs/am3517_crane.h b/include/configs/am3517_crane.h
index 54ab3eb..b312028 100644
--- a/include/configs/am3517_crane.h
+++ b/include/configs/am3517_crane.h
@@ -322,6 +322,7 @@
/* Defines for SPL */
#define CONFIG_SPL
+#define CONFIG_SPL_BOARD_INIT
#define CONFIG_SPL_NAND_SIMPLE
#define CONFIG_SPL_TEXT_BASE 0x40200800
#define CONFIG_SPL_MAX_SIZE (54 * 1024) /* 8 KB for stack */
diff --git a/include/configs/am3517_evm.h b/include/configs/am3517_evm.h
index ed0a601..ab2ddc0 100644
--- a/include/configs/am3517_evm.h
+++ b/include/configs/am3517_evm.h
@@ -321,6 +321,7 @@
/* Defines for SPL */
#define CONFIG_SPL
+#define CONFIG_SPL_BOARD_INIT
#define CONFIG_SPL_NAND_SIMPLE
#define CONFIG_SPL_TEXT_BASE 0x40200800
#define CONFIG_SPL_MAX_SIZE (54 * 1024) /* 8 KB for stack */
diff --git a/include/configs/mcx.h b/include/configs/mcx.h
index 970c882..d9cfc10 100644
--- a/include/configs/mcx.h
+++ b/include/configs/mcx.h
@@ -309,6 +309,7 @@
/* Defines for SPL */
#define CONFIG_SPL
+#define CONFIG_SPL_BOARD_INIT
#define CONFIG_SPL_NAND_SIMPLE
#define CONFIG_SPL_NAND_SOFTECC
diff --git a/include/configs/tam3517-common.h b/include/configs/tam3517-common.h
index 777f77c..e194b46 100644
--- a/include/configs/tam3517-common.h
+++ b/include/configs/tam3517-common.h
@@ -241,6 +241,7 @@
/* Defines for SPL */
#define CONFIG_SPL
+#define CONFIG_SPL_BOARD_INIT
#define CONFIG_SPL_CONSOLE
#define CONFIG_SPL_NAND_SIMPLE
#define CONFIG_SPL_NAND_SOFTECC
--
1.7.9.5
More information about the U-Boot
mailing list