derived from patches posted by Jeff Doozan
in the uBoot forum at http://forum.doozan.com

Signed-off-by: Eric Cooper <e...@cmu.edu>
---
 board/Marvell/dockstar/dockstar.c |   30 ++++++++++++++++++++++++++++++
 include/configs/dockstar.h        |    1 -
 2 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/board/Marvell/dockstar/dockstar.c 
b/board/Marvell/dockstar/dockstar.c
index 13cd347..7788837 100644
--- a/board/Marvell/dockstar/dockstar.c
+++ b/board/Marvell/dockstar/dockstar.c
@@ -153,3 +153,33 @@ void reset_phy(void)
        printf("88E1116 Initialized on %s\n", name);
 }
 #endif /* CONFIG_RESET_PHY_R */
+
+#define GREEN_LED      (1 << 14)
+#define ORANGE_LED     (1 << 15)
+#define BOTH_LEDS      (GREEN_LED | ORANGE_LED)
+#define NEITHER_LED    0
+
+static void set_leds(u32 leds, u32 blinking)
+{
+       struct kwgpio_registers *r = (struct kwgpio_registers *)KW_GPIO1_BASE;
+       u32 oe = readl(&r->oe) | BOTH_LEDS;
+       writel(oe & ~leds, &r->oe);     /* active low */
+       u32 bl = readl(&r->blink_en) & ~BOTH_LEDS;
+       writel(bl | blinking, &r->blink_en);
+}
+
+void show_boot_progress(int val)
+{
+       switch (val) {
+           case 15:    /* booting Linux */
+               set_leds(BOTH_LEDS, NEITHER_LED);
+               break;
+           case 64:    /* Ethernet initialization */
+               set_leds(GREEN_LED, GREEN_LED);
+               break;
+           default:
+               if (val < 0)    /* error */
+                       set_leds(ORANGE_LED, ORANGE_LED);
+               break;
+       }
+}
diff --git a/include/configs/dockstar.h b/include/configs/dockstar.h
index a1a97a3..ecd5f27 100644
--- a/include/configs/dockstar.h
+++ b/include/configs/dockstar.h
@@ -181,7 +181,6 @@
 #define CONFIG_NET_MULTI       /* specify more that one ports available */
 #define        CONFIG_MII              /* expose smi ove miiphy interface */
 #define CONFIG_MVGBE           /* Enable Marvell Gbe Controller Driver */
-#define CONFIG_SYS_FAULT_ECHO_LINK_DOWN        /* detect link using phy */
 #define CONFIG_MVGBE_PORTS     {1, 0}  /* enable port 0 only */
 #define CONFIG_PHY_BASE_ADR    0
 #define CONFIG_ENV_OVERWRITE   /* ethaddr can be reprogrammed */
-- 
1.7.1

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to