[PATCH 04/15] Only delay boot if keyboard open

Matan Ziv-Av matan at svgalib.org
Tue Dec 7 12:01:34 CET 2010


---
 board/nokia/rx51/rx51.c      |    7 +++++++
 include/configs/nokia_rx51.h |    1 +
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c
index 3149a79..347d08a 100644
--- a/board/nokia/rx51/rx51.c
+++ b/board/nokia/rx51/rx51.c
@@ -104,6 +104,13 @@ int misc_init_r(void)
 	setenv("nolo_atagaddr", buf);
 #endif
 
+	// set environment variable slide_sw
+	// if keyboard slide is open/close
+	omap_set_gpio_direction(71, 1);
+	unsigned val = omap_get_gpio_datain(71);
+	omap_free_gpio(71);
+	setenv("slide_sw", val ? "close" : "open");
+
 	dieid_num_r();
 
 	return 0;
diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h
index 45b942a..5c3b068 100644
--- a/include/configs/nokia_rx51.h
+++ b/include/configs/nokia_rx51.h
@@ -200,6 +200,7 @@ int rx51_kp_getc(void);
 		"bootm ${nolo_kernaddr}\0"
 
 #define CONFIG_PREBOOT \
+	"if test $slide_sw != open ; then run noloboot; fi ;" \
 	"echo Extra commands:;" \
 	"echo run sercon - Use serial port for control.;" \
 	"echo run usbcon - Use usbtty for control.;" \
-- 
1.7.4.1


--nextPart1511561.nRVgJThL9n
Content-Disposition: attachment; filename="0005-Change-Wireless-LAN-mode-from-M4-to-M0.patch"
Content-Transfer-Encoding: 7Bit
Content-Type: text/x-patch; charset="UTF-8"; name="0005-Change-Wireless-LAN-mode-from-M4-to-M0.patch"



More information about the U-Boot mailing list