From 0e1c9ce73883ab684d10e381c807e69ce0ec7839 Mon Sep 17 00:00:00 2001 From: "Ye.Li" Date: Thu, 12 Jun 2014 17:32:32 +0800 Subject: ENGR00315894-73 iMX6SX:SABRESD/ARM2 Add "bmode" command support Enable the "CONFIG_CMD_BMODE" and add BSP support. "bmode" supports to reboot: SD4, QSPI2 (SABRESD) SD2, SD3, eMMC, QSPI2, NAND, SPINOR (17x17 ARM2) SD1, QSPI2, SPINOR, EIMNOR (19x19 ARM2) BTW: Board rework is needed on ARM2 for NAND, SPINOR or EIMNOR boot. Signed-off-by: Ye.Li --- board/freescale/mx6sx_17x17_arm2/mx6sx_17x17_arm2.c | 18 ++++++++++++++++++ board/freescale/mx6sx_19x19_arm2/mx6sx_19x19_arm2.c | 16 ++++++++++++++++ board/freescale/mx6sxsabresd/mx6sxsabresd.c | 13 +++++++++++++ include/configs/mx6sx_arm2.h | 2 ++ include/configs/mx6sxsabresd.h | 2 ++ 5 files changed, 51 insertions(+) diff --git a/board/freescale/mx6sx_17x17_arm2/mx6sx_17x17_arm2.c b/board/freescale/mx6sx_17x17_arm2/mx6sx_17x17_arm2.c index 6e90909..6a9788b 100644 --- a/board/freescale/mx6sx_17x17_arm2/mx6sx_17x17_arm2.c +++ b/board/freescale/mx6sx_17x17_arm2/mx6sx_17x17_arm2.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -639,8 +640,25 @@ int board_init(void) return 0; } +#ifdef CONFIG_CMD_BMODE +static const struct boot_mode board_boot_modes[] = { + /* 4 bit bus width */ + {"sd2", MAKE_CFGVAL(0x40, 0x28, 0x00, 0x00)}, + {"sd3", MAKE_CFGVAL(0x40, 0x30, 0x00, 0x00)}, + {"emmc", MAKE_CFGVAL(0x60, 0x38, 0x00, 0x00)}, + {"qspi2", MAKE_CFGVAL(0x18, 0x00, 0x00, 0x00)}, + {"spinor", MAKE_CFGVAL(0x30, 0x00, 0x00, 0x0B)}, + {"nand", MAKE_CFGVAL(0x80, 0x00, 0x00, 0x00)}, + {NULL, 0}, +}; +#endif + int board_late_init(void) { +#ifdef CONFIG_CMD_BMODE + add_board_boot_modes(board_boot_modes); +#endif + #ifdef CONFIG_PFUZE100_PMIC_I2C int ret = 0; diff --git a/board/freescale/mx6sx_19x19_arm2/mx6sx_19x19_arm2.c b/board/freescale/mx6sx_19x19_arm2/mx6sx_19x19_arm2.c index 574f054..1e4f322 100644 --- a/board/freescale/mx6sx_19x19_arm2/mx6sx_19x19_arm2.c +++ b/board/freescale/mx6sx_19x19_arm2/mx6sx_19x19_arm2.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -760,8 +761,23 @@ int board_init(void) return 0; } +#ifdef CONFIG_CMD_BMODE +static const struct boot_mode board_boot_modes[] = { + /* 4 bit bus width */ + {"sd1", MAKE_CFGVAL(0x40, 0x20, 0x00, 0x00)}, + {"qspi2", MAKE_CFGVAL(0x18, 0x00, 0x00, 0x00)}, + {"spinor", MAKE_CFGVAL(0x30, 0x00, 0x00, 0x0B)}, + {"eimnor", MAKE_CFGVAL(0x00, 0x80, 0x00, 0x00)}, + {NULL, 0}, +}; +#endif + int board_late_init(void) { +#ifdef CONFIG_CMD_BMODE + add_board_boot_modes(board_boot_modes); +#endif + #ifdef CONFIG_PFUZE100_PMIC_I2C int ret = 0; diff --git a/board/freescale/mx6sxsabresd/mx6sxsabresd.c b/board/freescale/mx6sxsabresd/mx6sxsabresd.c index 6a4311b..73f77b1 100644 --- a/board/freescale/mx6sxsabresd/mx6sxsabresd.c +++ b/board/freescale/mx6sxsabresd/mx6sxsabresd.c @@ -763,8 +763,21 @@ int board_init(void) return 0; } +#ifdef CONFIG_CMD_BMODE +static const struct boot_mode board_boot_modes[] = { + /* 4 bit bus width */ + {"sd4", MAKE_CFGVAL(0x40, 0x38, 0x00, 0x00)}, + {"qspi2", MAKE_CFGVAL(0x18, 0x00, 0x00, 0x00)}, + {NULL, 0}, +}; +#endif + int board_late_init(void) { +#ifdef CONFIG_CMD_BMODE + add_board_boot_modes(board_boot_modes); +#endif + #ifdef CONFIG_PFUZE100_PMIC_I2C int ret = 0; diff --git a/include/configs/mx6sx_arm2.h b/include/configs/mx6sx_arm2.h index 1fd1d5f..6e9df51 100644 --- a/include/configs/mx6sx_arm2.h +++ b/include/configs/mx6sx_arm2.h @@ -409,6 +409,8 @@ #define CONFIG_OF_LIBFDT #define CONFIG_CMD_BOOTZ +#define CONFIG_CMD_BMODE + #ifndef CONFIG_SYS_DCACHE_OFF #define CONFIG_CMD_CACHE #endif diff --git a/include/configs/mx6sxsabresd.h b/include/configs/mx6sxsabresd.h index 1e9e2cc..23c83ec 100644 --- a/include/configs/mx6sxsabresd.h +++ b/include/configs/mx6sxsabresd.h @@ -330,6 +330,8 @@ #define CONFIG_OF_LIBFDT #define CONFIG_CMD_BOOTZ +#define CONFIG_CMD_BMODE + #ifndef CONFIG_SYS_DCACHE_OFF #define CONFIG_CMD_CACHE #endif -- cgit v1.1