diff options
-rw-r--r-- | board/sunxi/board.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/board/sunxi/board.c b/board/sunxi/board.c index ea0ab736e9..52792bd364 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -453,6 +453,24 @@ void sunxi_board_init(void) int power_failed = 0; unsigned long ramsize; +#ifdef CONFIG_SUNXI_ARMADILLO + /* Enable ATX power supply */ + gpio_request(SUNXI_GPG(7), "SUS3"); + sunxi_gpio_set_cfgpin(SUNXI_GPG(7),SUNXI_GPIO_OUTPUT); + gpio_direction_output(SUNXI_GPG(7),1); + debug("enable SUS3\n"); + /* wait for ATX power to be stable */ + gpio_request(SUNXI_GPD(24),"PWGIN"); + sunxi_gpio_set_cfgpin(SUNXI_GPD(24),SUNXI_GPIO_INPUT); + debug("wait for PWGIN\n"); + while(gpio_get_value(SUNXI_GPD(24))==0) + { + mdelay(100); + } + debug("PWGIN is active\n"); + mdelay(500); /* let the power supply settle */ +#endif + #ifdef CONFIG_SY8106A_POWER power_failed = sy8106a_set_vout1(CONFIG_SY8106A_VOUT1_VOLT); #endif |