[U-Boot] [RFC v2 2/3] mx6qsabrelite: add resetmode support

This allows a watchdog reset to start the ROM's usb downloader, or boot from an sdcard.
Signed-off-by: Troy Kisky troy.kisky@boundarydevices.com
squash sabrelite --- board/freescale/mx6qsabrelite/mx6qsabrelite.c | 14 ++++++++++++++ include/configs/mx6qsabrelite.h | 3 +++ 2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c b/board/freescale/mx6qsabrelite/mx6qsabrelite.c index 29cbfed..ae2dc95 100644 --- a/board/freescale/mx6qsabrelite/mx6qsabrelite.c +++ b/board/freescale/mx6qsabrelite/mx6qsabrelite.c @@ -28,6 +28,7 @@ #include <asm/arch/clock.h> #include <asm/errno.h> #include <asm/gpio.h> +#include <asm/imx-common/resetmode.h> #include <mmc.h> #include <fsl_esdhc.h> #include <micrel.h> @@ -434,10 +435,23 @@ static void preboot_keys(void) } #endif
+#ifdef CONFIG_CMD_RESETMODE +static const struct reset_mode board_reset_modes[] = { + /* 4 bit bus width */ + {"mmc0", MAKE_CFGVAL(0x40, 0x30, 0x00, 0x00)}, + {"mmc1", MAKE_CFGVAL(0x40, 0x38, 0x00, 0x00)}, + {NULL, 0}, +}; +#endif + int misc_init_r(void) { #ifdef CONFIG_PREBOOT preboot_keys(); #endif + +#ifdef CONFIG_CMD_RESETMODE + add_board_resetmodes(board_reset_modes); +#endif return 0; } diff --git a/include/configs/mx6qsabrelite.h b/include/configs/mx6qsabrelite.h index feabc05..5165843 100644 --- a/include/configs/mx6qsabrelite.h +++ b/include/configs/mx6qsabrelite.h @@ -111,6 +111,9 @@ #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) #define CONFIG_MXC_USB_FLAGS 0
+/* Miscellaneous commands */ +#define CONFIG_CMD_RESETMODE + /* allow to overwrite serial and ethaddr */ #define CONFIG_ENV_OVERWRITE #define CONFIG_CONS_INDEX 1

This allows a watchdog reset to start the ROM's usb/serial downloader, or boot from an sdcard.
Signed-off-by: Troy Kisky troy.kisky@boundarydevices.com
Compile tested only, I don't have a mx53evk. --- board/freescale/mx53evk/mx53evk.c | 13 +++++++++++++ include/configs/mx53evk.h | 3 +++ 2 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/board/freescale/mx53evk/mx53evk.c b/board/freescale/mx53evk/mx53evk.c index 8a6e31d..48499d6 100644 --- a/board/freescale/mx53evk/mx53evk.c +++ b/board/freescale/mx53evk/mx53evk.c @@ -28,6 +28,7 @@ #include <asm/arch/crm_regs.h> #include <asm/arch/iomux.h> #include <asm/errno.h> +#include <asm/imx-common/resetmode.h> #include <netdev.h> #include <i2c.h> #include <mmc.h> @@ -367,11 +368,23 @@ int board_init(void) return 0; }
+#ifdef CONFIG_CMD_RESETMODE +static const struct reset_mode board_reset_modes[] = { + /* 4 bit bus width */ + {"mmc0", MAKE_CFGVAL(0x40, 0x20, 0x00, 0x12)}, + {"mmc1", MAKE_CFGVAL(0x40, 0x20, 0x08, 0x12)}, + {NULL, 0}, +}; +#endif + int board_late_init(void) { setup_i2c(1); power_init();
+#ifdef CONFIG_CMD_RESETMODE + add_board_resetmodes(board_reset_modes); +#endif return 0; }
diff --git a/include/configs/mx53evk.h b/include/configs/mx53evk.h index a77e5b2..7be469c 100644 --- a/include/configs/mx53evk.h +++ b/include/configs/mx53evk.h @@ -90,6 +90,9 @@ #define CONFIG_CMD_NET #define CONFIG_CMD_DATE
+/* Miscellaneous commands */ +#define CONFIG_CMD_RESETMODE + /* allow to overwrite serial and ethaddr */ #define CONFIG_ENV_OVERWRITE #define CONFIG_CONS_INDEX 1
participants (1)
-
Troy Kisky