summaryrefslogtreecommitdiffstats
path: root/board/htkw
diff options
context:
space:
mode:
authorStefano Babic <sbabic@denx.de>2012-06-13 22:34:44 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2012-09-01 14:58:09 +0200
commit3ae6abb697b85516975443ca7eac44d18ed4c53f (patch)
tree9a20f10085f111fa4e46199cec618e9f03f60ea7 /board/htkw
parentf89a8b6a7653e66f6685563fe8da1265338ea4a7 (diff)
downloadblackbird-obmc-uboot-3ae6abb697b85516975443ca7eac44d18ed4c53f.tar.gz
blackbird-obmc-uboot-3ae6abb697b85516975443ca7eac44d18ed4c53f.zip
OMAP3: mcx: read hot-water-button after reset
Detect hot-water-button to start a differnt image. Signed-off-by: Stefano Babic <sbabic@denx.de> CC: Tom Rini <trini@ti.com>
Diffstat (limited to 'board/htkw')
-rw-r--r--board/htkw/mcx/mcx.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/board/htkw/mcx/mcx.c b/board/htkw/mcx/mcx.c
index 8f75af19d4..454ff0a846 100644
--- a/board/htkw/mcx/mcx.c
+++ b/board/htkw/mcx/mcx.c
@@ -37,6 +37,8 @@
DECLARE_GLOBAL_DATA_PTR;
+#define HOT_WATER_BUTTON 38
+
#ifdef CONFIG_USB_EHCI
static struct omap_usbhs_board_data usbhs_bdata = {
.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
@@ -68,6 +70,27 @@ int board_init(void)
return 0;
}
+#ifdef CONFIG_BOARD_LATE_INIT
+int board_late_init(void)
+{
+ if (gpio_request(HOT_WATER_BUTTON, "hot-water-button") < 0) {
+ puts("Failed to get hot-water-button pin\n");
+ return -ENODEV;
+ }
+ gpio_direction_input(HOT_WATER_BUTTON);
+
+ /*
+ * if hot-water-button is pressed
+ * change bootcmd
+ */
+ if (gpio_get_value(HOT_WATER_BUTTON))
+ return 0;
+
+ setenv("bootcmd", "run swupdate");
+ return 0;
+}
+#endif
+
/*
* Routine: set_muxconf_regs
* Description: Setting up the configuration Mux registers specific to the
OpenPOWER on IntegriCloud