[U-Boot] [PATCH V3 2/3] mx6qsabrelite: add resetmode support
Troy Kisky
troy.kisky at boundarydevices.com
Thu Aug 9 03:26:33 CEST 2012
This allows a watchdog reset to start the ROM's
usb downloader, or boot from an sdcard.
Signed-off-by: Troy Kisky <troy.kisky at boundarydevices.com>
---
board/freescale/mx6qsabrelite/mx6qsabrelite.c | 14 ++++++++++++++
include/configs/mx6qsabrelite.h | 3 +++
2 files changed, 17 insertions(+)
diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c b/board/freescale/mx6qsabrelite/mx6qsabrelite.c
index 01e5083..36e6f8f 100644
--- a/board/freescale/mx6qsabrelite/mx6qsabrelite.c
+++ b/board/freescale/mx6qsabrelite/mx6qsabrelite.c
@@ -29,6 +29,7 @@
#include <asm/gpio.h>
#include <asm/imx-common/iomux-v3.h>
#include <asm/imx-common/mxc_i2c.h>
+#include <asm/imx-common/resetmode.h>
#include <mmc.h>
#include <fsl_esdhc.h>
#include <micrel.h>
@@ -487,10 +488,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 0d376ba..8890286 100644
--- a/include/configs/mx6qsabrelite.h
+++ b/include/configs/mx6qsabrelite.h
@@ -117,6 +117,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
--
1.7.9.5
More information about the U-Boot
mailing list