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

Pali Rohár pali.rohar at gmail.com
Thu Sep 1 13:34:30 CEST 2011


From: Matan Ziv-Av <matan at svgalib.org>

---
 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



More information about the U-Boot mailing list