diff options
Diffstat (limited to 'board/htkw/mcx')
-rw-r--r-- | board/htkw/mcx/mcx.c | 23 | ||||
-rw-r--r-- | board/htkw/mcx/mcx.h | 11 |
2 files changed, 31 insertions, 3 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 diff --git a/board/htkw/mcx/mcx.h b/board/htkw/mcx/mcx.h index d675a48310..867cc9e88d 100644 --- a/board/htkw/mcx/mcx.h +++ b/board/htkw/mcx/mcx.h @@ -284,9 +284,14 @@ const omap3_sysinfo sysinfo = { /* HSUSB2_dat3 */\ /* CCDC */\ MUX_VAL(CP(CCDC_PCLK), (IEN | PTD | EN | M4)) \ - MUX_VAL(CP(CCDC_FIELD), (IEN | PTD | EN | M4)) \ - MUX_VAL(CP(CCDC_HD), (IEN | PTD | EN | M4)) \ - MUX_VAL(CP(CCDC_VD), (IEN | PTD | EN | M4)) \ + /* CCDC_FIELD: gpio_95, uP-TXD4 */ \ + MUX_VAL(CP(CCDC_FIELD), (IDIS | PTD | DIS | M2)) \ + /* CCDC_HD: gpio_96, uP-RTS4# */ \ + MUX_VAL(CP(CCDC_HD), (IDIS | PTD | DIS | M2)) \ + /* CCDC_VD: gpio_97, uP-CTS4# */ \ + MUX_VAL(CP(CCDC_VD), (IEN | PTD | EN | M2)) \ + /* CCDC_WEN: gpio_98, uP-RXD4 */ \ + MUX_VAL(CP(CCDC_WEN), (IEN | PTD | DIS | M2)) \ MUX_VAL(CP(CCDC_WEN), (IEN | PTD | EN | M4)) \ MUX_VAL(CP(CCDC_DATA0), (IEN | PTD | EN | M4)) \ MUX_VAL(CP(CCDC_DATA1), (IEN | PTD | EN | M4)) \ |