All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Cooper <ecc@cmu.edu>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/5] DockStar: LED support
Date: Tue,  7 Sep 2010 10:28:16 -0400	[thread overview]
Message-ID: <1283869696-10077-6-git-send-email-ecc@cmu.edu> (raw)
In-Reply-To: <1283869696-10077-1-git-send-email-ecc@cmu.edu>

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

Signed-off-by: Eric Cooper <ecc@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

  parent reply	other threads:[~2010-09-07 14:28 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-07 14:28 [U-Boot] [PATCH 0/5] Add support for Seagate FreeAgent DockStar Eric Cooper
2010-09-07 14:28 ` [U-Boot] [PATCH 1/5] add DOCKSTAR machine type Eric Cooper
2010-09-07 15:07   ` Wolfgang Denk
2010-09-07 14:28 ` [U-Boot] [PATCH 2/5] DockStar: board support (derived from sheevaplug) Eric Cooper
2010-09-07 15:11   ` Wolfgang Denk
     [not found]     ` <20100908010601.GG8903@localhost>
2010-09-08 10:19       ` Wolfgang Denk
2010-09-07 14:28 ` [U-Boot] [PATCH 3/5] DockStar: change RAM definitions to one bank (128 MB) Eric Cooper
2010-09-07 15:12   ` Wolfgang Denk
2010-09-07 14:28 ` [U-Boot] [PATCH 4/5] DockStar: config Eric Cooper
2010-09-07 15:52   ` Wolfgang Denk
2010-09-07 14:28 ` Eric Cooper [this message]
2010-09-07 15:53   ` [U-Boot] [PATCH 5/5] DockStar: LED support Wolfgang Denk
2010-09-08 10:24   ` Sergei Shtylyov
2010-09-27  9:07 ` [U-Boot] [PATCH 0/5] Add support for Seagate FreeAgent DockStar Thomas Weber
2010-09-27  9:36   ` [U-Boot] How to debug u-boot with GDB & BDI3000 sywang
2010-09-27 10:08     ` Wolfgang Denk
2010-09-28  4:20       ` sywang
2010-09-27 11:03   ` [U-Boot] [PATCH 0/5] Add support for Seagate FreeAgent DockStar Eric Cooper
2010-10-20 14:54   ` [U-Boot] [PATCH v2] Seagate FreeAgent DockStar support Eric Cooper
2010-10-21  4:52     ` Prafulla Wadaskar
2010-10-21 15:01       ` Eric Cooper
2010-10-21 15:07         ` Wolfgang Denk
2010-10-21  6:17     ` Wolfgang Denk
2010-10-21  6:26       ` Prafulla Wadaskar
2010-10-21  6:35         ` Wolfgang Denk
2010-10-21  6:38         ` [U-Boot] [RFC] [PATCH] kirkwood: get rid of config.mk files Wolfgang Denk
2010-10-21  7:43           ` Prafulla Wadaskar
2010-10-21  8:21             ` Wolfgang Denk
2010-10-21  8:37               ` Prafulla Wadaskar
2010-10-21  9:34                 ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1283869696-10077-6-git-send-email-ecc@cmu.edu \
    --to=ecc@cmu.edu \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.