[U-Boot] [PATCH v3 6/6] mips: ocelot: Enable use of serial gpio for LED

Lars Povlsen lars.povlsen at microchip.com
Wed Jan 2 08:52:26 UTC 2019


This enables the use of the MSCC serial GPIO driver to control the
LEDs on the MSCC VCoreIII 'ocelot' pcb123 and pcb120.

Signed-off-by: Lars Povlsen <lars.povlsen at microchip.com>
---
 board/mscc/ocelot/ocelot.c    | 6 ++++++
 configs/mscc_ocelot_defconfig | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/board/mscc/ocelot/ocelot.c b/board/mscc/ocelot/ocelot.c
index a557cacd1b..a05c308669 100644
--- a/board/mscc/ocelot/ocelot.c
+++ b/board/mscc/ocelot/ocelot.c
@@ -9,6 +9,7 @@
 #include <asm/types.h>
 #include <environment.h>
 #include <spi.h>
+#include <led.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -56,6 +57,11 @@ int board_early_init_r(void)
 
 	/* Address of boot parameters */
 	gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE;
+
+	/* LED setup */
+	if (IS_ENABLED(CONFIG_LED))
+		led_default_state();
+
 	return 0;
 }
 
diff --git a/configs/mscc_ocelot_defconfig b/configs/mscc_ocelot_defconfig
index 66451000d9..fb6a5bdc31 100644
--- a/configs/mscc_ocelot_defconfig
+++ b/configs/mscc_ocelot_defconfig
@@ -48,6 +48,9 @@ CONFIG_CLK=y
 CONFIG_DM_GPIO=y
 CONFIG_MTD=y
 CONFIG_MTD_SPI_NAND=y
+CONFIG_MSCC_SGPIO=y
+CONFIG_LED=y
+CONFIG_LED_GPIO=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
-- 
2.19.2



More information about the U-Boot mailing list