Patchwork [U-Boot,v5,8/8] add software usbboot

login
register
mail settings
Submitter Xiangfu Liu
Date Jan. 9, 2011, 4:18 p.m.
Message ID <1294589925-32639-9-git-send-email-xiangfu@openmobilefree.net>
Download mbox | patch
Permalink /patch/78030/
State Changes Requested
Headers show

Comments

Xiangfu Liu - Jan. 9, 2011, 4:18 p.m.
Signed-off-by: Xiangfu Liu <xiangfu@openmobilefree.net>
Acked-by: Daniel <zpxu@ingenic.cn>
Acked-by: ChangWei Jia <cwjia@ingenic.cn>
---
 drivers/mtd/nand/jz4740_nand.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

Patch

diff --git a/drivers/mtd/nand/jz4740_nand.c b/drivers/mtd/nand/jz4740_nand.c
index 32b41ef..b15c4ea 100644
--- a/drivers/mtd/nand/jz4740_nand.c
+++ b/drivers/mtd/nand/jz4740_nand.c
@@ -285,6 +285,18 @@  extern int serial_init(void);
 	pll_init();
 	serial_init();
 	sdram_init();
+
+#if defined(CONFIG_NANONOTE)
+#define KEY_U_OUT       (32 * 2 + 16)
+#define KEY_U_IN        (32 * 3 + 19)
+	__gpio_as_input(KEY_U_IN);
+	__gpio_enable_pull(KEY_U_IN);
+	__gpio_as_output(KEY_U_OUT);
+	__gpio_clear_pin(KEY_U_OUT);
+
+	if (__gpio_get_pin(KEY_U_IN) == 0)
+		usb_boot();
+#endif
 #endif
 	uint32_t reg;