All of lore.kernel.org
 help / color / mirror / Atom feed
From: Valentin Longchamp <valentin.longchamp@keymile.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/8] kmp204x: Add support for the unit LEDs
Date: Wed, 30 Apr 2014 15:01:42 +0200	[thread overview]
Message-ID: <1398862909-17580-2-git-send-email-valentin.longchamp@keymile.com> (raw)
In-Reply-To: <1398862909-17580-1-git-send-email-valentin.longchamp@keymile.com>

From: Stefan Bigler <stefan.bigler@keymile.com>

The unit LEDs are managed by the QRIO CPLD. This patch adds support for
accessing these LEDs in the QRIO.

The LEDs then are set to a correct boot state:
- UNIT-LED is red
- BOOT-LED is on.

Signed-off-by: Stefan Bigler <stefan.bigler@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
---

 board/keymile/kmp204x/kmp204x.c |  3 +++
 board/keymile/kmp204x/kmp204x.h |  1 +
 board/keymile/kmp204x/qrio.c    | 14 ++++++++++++++
 3 files changed, 18 insertions(+)

diff --git a/board/keymile/kmp204x/kmp204x.c b/board/keymile/kmp204x/kmp204x.c
index 95a19cd..5fceedd 100644
--- a/board/keymile/kmp204x/kmp204x.c
+++ b/board/keymile/kmp204x/kmp204x.c
@@ -113,6 +113,9 @@ int board_early_init_r(void)
 	if (ret)
 		printf("error triggering PCIe FPGA config\n");
 
+	/* enable the Unit LED (red) & Boot LED (on) */
+	qrio_set_leds();
+
 	return ret;
 }
 
diff --git a/board/keymile/kmp204x/kmp204x.h b/board/keymile/kmp204x/kmp204x.h
index 0267596..34de27e 100644
--- a/board/keymile/kmp204x/kmp204x.h
+++ b/board/keymile/kmp204x/kmp204x.h
@@ -21,5 +21,6 @@ void qrio_gpio_direction_input(u8 port_off, u8 gpio_nr);
 
 void qrio_prst(u8 bit, bool en, bool wden);
 void qrio_prstcfg(u8 bit, u8 mode);
+void qrio_set_leds(void);
 
 void pci_of_setup(void *blob, bd_t *bd);
diff --git a/board/keymile/kmp204x/qrio.c b/board/keymile/kmp204x/qrio.c
index 49f9aa2..11949f4 100644
--- a/board/keymile/kmp204x/qrio.c
+++ b/board/keymile/kmp204x/qrio.c
@@ -144,3 +144,17 @@ void qrio_prstcfg(u8 bit, u8 mode)
 
 	out_be32(qrio_base + PRSTCFG_OFF, prstcfg);
 }
+
+#define CTRLH_OFF		0x02
+#define CTRLH_WRL_BOOT		0x01
+#define CTRLH_WRL_UNITRUN	0x02
+
+void qrio_set_leds(void)
+{
+	u8 ctrlh;
+	void __iomem *qrio_base = (void *)CONFIG_SYS_QRIO_BASE;
+	/* set UNIT LED to RED and BOOT LED to ON */
+	ctrlh = in_8(qrio_base + CTRLH_OFF);
+	ctrlh |= (CTRLH_WRL_BOOT | CTRLH_WRL_UNITRUN);
+	out_8(qrio_base + CTRLH_OFF, ctrlh);
+}
-- 
1.8.0.1

  reply	other threads:[~2014-04-30 13:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-30 13:01 [U-Boot] [PATCH 0/8] kmp204x patches for 2014.07 Valentin Longchamp
2014-04-30 13:01 ` Valentin Longchamp [this message]
2014-04-30 17:04   ` [U-Boot] [PATCH 1/8] kmp204x: Add support for the unit LEDs York Sun
2014-05-01 14:00     ` Valentin Longchamp
2014-05-01 15:47       ` York Sun
2014-05-02  8:48   ` [U-Boot] [PATCH v2 " Valentin Longchamp
2014-04-30 13:01 ` [U-Boot] [PATCH 2/8] kmp204x: handle dip-switch for factory settings Valentin Longchamp
2014-04-30 17:04   ` York Sun
2014-05-02  8:49   ` [U-Boot] [PATCH v2 " Valentin Longchamp
2014-04-30 13:01 ` [U-Boot] [PATCH 3/8] kmp204x: selftest/factory test pin support Valentin Longchamp
2014-04-30 13:01 ` [U-Boot] [PATCH 4/8] kmp204x: update the CONFIG_PRAM and CONFIG_KM_RESERVED_PRAM defines Valentin Longchamp
2014-04-30 13:01 ` [U-Boot] [PATCH 5/8] kmp204x: complete the reset sequence and PRST configuration Valentin Longchamp
2014-04-30 13:01 ` [U-Boot] [PATCH 6/8] kmp204x: update the RCW Valentin Longchamp
2014-04-30 13:01 ` [U-Boot] [PATCH 7/8] kmp204x: add workaround for A-004849 Valentin Longchamp
2014-04-30 13:01 ` [U-Boot] [PATCH 8/8] kmp204x: enable the errata command Valentin Longchamp
2014-05-13 16:38 ` [U-Boot] [PATCH 0/8] kmp204x patches for 2014.07 York Sun

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=1398862909-17580-2-git-send-email-valentin.longchamp@keymile.com \
    --to=valentin.longchamp@keymile.com \
    --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.