summaryrefslogtreecommitdiffstats
path: root/board/buffalo
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2012-09-21 14:53:13 -0700
committerTom Rini <trini@ti.com>2012-09-21 14:53:13 -0700
commit495dbd72dd1172de866ba323263a5b62cf454972 (patch)
tree3ecfb8ae44c871055115941890fd93f175f8761d /board/buffalo
parent50d924b45911b24eeb7623bed11b9297d99b840a (diff)
parentd193c1b6eb05041c94ad9aacd8c94189d1dbc5f8 (diff)
downloadtalos-obmc-uboot-495dbd72dd1172de866ba323263a5b62cf454972.tar.gz
talos-obmc-uboot-495dbd72dd1172de866ba323263a5b62cf454972.zip
Merge branch 'master' of git://git.denx.de/u-boot-arm
Diffstat (limited to 'board/buffalo')
-rw-r--r--board/buffalo/lsxl/lsxl.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/board/buffalo/lsxl/lsxl.c b/board/buffalo/lsxl/lsxl.c
index fe155112c9..b3f31d6b69 100644
--- a/board/buffalo/lsxl/lsxl.c
+++ b/board/buffalo/lsxl/lsxl.c
@@ -158,7 +158,7 @@ static void set_led(int state)
{
switch (state) {
case LED_OFF:
- __set_led(0, 0, 0, 0, 0, 0);
+ __set_led(0, 0, 0, 1, 1, 1);
break;
case LED_ALARM_ON:
__set_led(0, 0, 0, 0, 1, 1);
@@ -192,6 +192,25 @@ int board_init(void)
}
#ifdef CONFIG_MISC_INIT_R
+static void check_power_switch(void)
+{
+ if (kw_gpio_get_value(GPIO_POWER_SWITCH)) {
+ /* turn off HDD and USB power */
+ kw_gpio_set_value(GPIO_HDD_POWER, 0);
+ kw_gpio_set_value(GPIO_USB_VBUS, 0);
+ set_led(LED_OFF);
+
+ /* loop until released */
+ while (kw_gpio_get_value(GPIO_POWER_SWITCH))
+ ;
+
+ /* turn power on again */
+ kw_gpio_set_value(GPIO_HDD_POWER, 1);
+ kw_gpio_set_value(GPIO_USB_VBUS, 1);
+ set_led(LED_POWER_BLINKING);
+ }
+}
+
void check_enetaddr(void)
{
uchar enetaddr[6];
@@ -261,6 +280,7 @@ static void check_push_button(void)
int misc_init_r(void)
{
+ check_power_switch();
check_enetaddr();
check_push_button();
OpenPOWER on IntegriCloud