]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
kmp204x: Add support for the unit LEDs
authorStefan Bigler <stefan.bigler@keymile.com>
Fri, 2 May 2014 08:48:41 +0000 (10:48 +0200)
committerYork Sun <yorksun@freescale.com>
Tue, 13 May 2014 15:26:54 +0000 (08:26 -0700)
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
board/keymile/kmp204x/kmp204x.h
board/keymile/kmp204x/qrio.c

index 95a19cdb2c1869c880e850b25648339530010c85..5fceedd7c35bdf3022e19fb2d1efef206695f7e7 100644 (file)
@@ -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;
 }
 
index 0267596e4e5eef26eabafa211a06d95e94a25334..34de27eafe4f4ee2f6aa8a37122111f0167979c5 100644 (file)
@@ -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);
index 49f9aa2546242d421d45d5ec47af1ab05f38260d..86df2c7ca98a12beb0a82418c928c2841b75381c 100644 (file)
@@ -144,3 +144,18 @@ 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);
+}