diff options
author | Bastian Ruppert <Bastian.Ruppert@Sewerin.de> | 2011-10-04 23:43:33 +0000 |
---|---|---|
committer | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2011-11-03 22:56:26 +0100 |
commit | e5ee9125ecff23f337f26834c07a1f0252378818 (patch) | |
tree | 7fc29541ac6195c5820a73feb5c6a1bec0be4a22 | |
parent | 2084f21b05fe5b6254239fc8b1ad2f3fb259c49d (diff) |
Davinci: ea20: add gpio for keeping power on in board_late_init
The pin called HALTEN drives a transistor to operate the supply
voltage. After HALTEN is high, the user can release the power
switch button and the device will stay powered on.
Signed-off-by: Bastian Ruppert <Bastian.Ruppert@Sewerin.de>
CC: sbabic@denx.de
CC: dzu@denx.de
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
-rw-r--r-- | board/davinci/ea20/ea20.c | 25 | ||||
-rw-r--r-- | include/configs/ea20.h | 1 |
2 files changed, 26 insertions, 0 deletions
diff --git a/board/davinci/ea20/ea20.c b/board/davinci/ea20/ea20.c index da9086a527..1a57baf4e2 100644 --- a/board/davinci/ea20/ea20.c +++ b/board/davinci/ea20/ea20.c @@ -98,6 +98,10 @@ const struct pinmux_config gpio_pins[] = { { pinmux(13), 8, 3 } /* GPIO6[12] U0_SW1 on EA20-00101_2*/ }; +const struct pinmux_config halten_pin[] = { + { pinmux(3), 4, 2 } /* GPIO8[6] HALTEN */ +}; + static const struct pinmux_resource pinmuxes[] = { #ifdef CONFIG_SPI_FLASH PINMUX_ITEM(spi1_pins), @@ -205,6 +209,27 @@ int board_init(void) return 0; } + +#ifdef BOARD_LATE_INIT + +int board_late_init(void) +{ + struct davinci_gpio *gpio8_base = + (struct davinci_gpio *)DAVINCI_GPIO_BANK8; + + /* PinMux for HALTEN */ + if (davinci_configure_pin_mux(halten_pin, ARRAY_SIZE(halten_pin)) != 0) + return 1; + + /* Set HALTEN to high */ + writel((readl(&gpio8_base->set_data) | (1 << 6)), + &gpio8_base->set_data); + writel((readl(&gpio8_base->dir) & ~(1 << 6)), &gpio8_base->dir); + + return 0; +} +#endif /* BOARD_LATE_INIT */ + #ifdef CONFIG_DRIVER_TI_EMAC /* diff --git a/include/configs/ea20.h b/include/configs/ea20.h index d86207a3b2..916ad00541 100644 --- a/include/configs/ea20.h +++ b/include/configs/ea20.h @@ -31,6 +31,7 @@ #define CONFIG_SYS_USE_NAND #define CONFIG_DRIVER_TI_EMAC_USE_RMII #define CONFIG_BOARD_EARLY_INIT_F +#define BOARD_LATE_INIT /* * SoC Configuration |