summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorKlaus Goger <klaus.goger@theobroma-systems.com>2016-09-18 11:15:41 +0200
committerKlaus Goger <klaus.goger@theobroma-systems.com>2016-09-18 20:22:03 +0200
commitc14577d2e7c3b56172bb8c8d810b52e54f55f1c4 (patch)
tree984c87c0ac99fc5021725b19b4714cfb1d915de1 /board
parent019fac62d480990262b700a05717194a9623af7b (diff)
ARM: sunxi: armadillo: enable ATX power supply
when powered by ATX the SUS3 line must be HIGH to enable the ATX power supply.
Diffstat (limited to 'board')
-rw-r--r--board/sunxi/board.c18
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