summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Schulz <[email protected]>2025-11-19 18:19:55 +0100
committerTien Fong Chee <[email protected]>2025-12-01 14:29:37 +0800
commitda09bb6a6c1f40dd5fec18ee5c946ebf5722b7ad (patch)
tree36a352564297e5f3fd5bb19c4b235eb5ce34cde2
parent0af9efa7c1873b2d52eaa82d67a8c67351a7f8ca (diff)
board: softing: vining: migrate to modern LED framework
This migrates from the legacy LED API to use the modern LED framework which makes use of the FDT. Signed-off-by: Quentin Schulz <[email protected]> Acked-by: Tien Fong Chee <[email protected]>
-rw-r--r--arch/arm/dts/socfpga_cyclone5_vining_fpga-u-boot.dtsi26
-rw-r--r--board/softing/vining_fpga/socfpga.c12
-rw-r--r--configs/socfpga_vining_fpga_defconfig13
3 files changed, 37 insertions, 14 deletions
diff --git a/arch/arm/dts/socfpga_cyclone5_vining_fpga-u-boot.dtsi b/arch/arm/dts/socfpga_cyclone5_vining_fpga-u-boot.dtsi
index 330949c0184..bf5e12ec90c 100644
--- a/arch/arm/dts/socfpga_cyclone5_vining_fpga-u-boot.dtsi
+++ b/arch/arm/dts/socfpga_cyclone5_vining_fpga-u-boot.dtsi
@@ -13,6 +13,32 @@
spi0 = "/soc/spi@ff705000";
udc0 = &usb1;
};
+
+ leds {
+ compatible = "gpio-leds";
+
+ led-0 {
+ default-state = "off";
+ gpios = <&portb 20 GPIO_ACTIVE_HIGH>;
+ };
+
+ led-1 {
+ default-state = "off";
+ gpios = <&portb 25 GPIO_ACTIVE_HIGH>;
+ label = "status_1";
+ };
+
+ led-2 {
+ default-state = "off";
+ gpios = <&portb 26 GPIO_ACTIVE_HIGH>;
+ label = "status_2";
+ };
+
+ led-3 {
+ default-state = "off";
+ gpios = <&portc 7 GPIO_ACTIVE_HIGH>;
+ };
+ };
};
&mmc {
diff --git a/board/softing/vining_fpga/socfpga.c b/board/softing/vining_fpga/socfpga.c
index ec2c7ea3631..475c19f2781 100644
--- a/board/softing/vining_fpga/socfpga.c
+++ b/board/softing/vining_fpga/socfpga.c
@@ -8,7 +8,7 @@
#include <env.h>
#include <init.h>
#include <net.h>
-#include <status_led.h>
+#include <led.h>
#include <asm/arch/reset_manager.h>
#include <asm/global_data.h>
#include <asm/io.h>
@@ -24,10 +24,16 @@ DECLARE_GLOBAL_DATA_PTR;
int board_late_init(void)
{
const unsigned int usb_nrst_gpio = 35;
+ struct udevice *dev;
int ret;
- status_led_set(1, CONFIG_LED_STATUS_ON);
- status_led_set(2, CONFIG_LED_STATUS_ON);
+ ret = led_get_by_label("status_1", &dev);
+ if (!ret)
+ led_set_state(dev, LEDST_ON);
+
+ ret = led_get_by_label("status_2", &dev);
+ if (!ret)
+ led_set_state(dev, LEDST_ON);
/* Address of boot parameters for ATAG (if ATAG is used) */
gd->bd->bi_boot_params = CFG_SYS_SDRAM_BASE + 0x100;
diff --git a/configs/socfpga_vining_fpga_defconfig b/configs/socfpga_vining_fpga_defconfig
index f3b6cb717b3..396b7a9715d 100644
--- a/configs/socfpga_vining_fpga_defconfig
+++ b/configs/socfpga_vining_fpga_defconfig
@@ -78,17 +78,8 @@ CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
CONFIG_DWAPB_GPIO=y
CONFIG_DM_I2C=y
CONFIG_SYS_I2C_DW=y
-CONFIG_LED_STATUS=y
-CONFIG_LED_STATUS_GPIO=y
-CONFIG_LED_STATUS0=y
-CONFIG_LED_STATUS_BIT=48
-CONFIG_LED_STATUS1=y
-CONFIG_LED_STATUS_BIT1=53
-CONFIG_LED_STATUS2=y
-CONFIG_LED_STATUS_BIT2=54
-CONFIG_LED_STATUS3=y
-CONFIG_LED_STATUS_BIT3=65
-CONFIG_LED_STATUS_CMD=y
+CONFIG_LED=y
+CONFIG_LED_GPIO=y
CONFIG_MISC=y
CONFIG_I2C_EEPROM=y
CONFIG_SYS_I2C_EEPROM_ADDR=0x50