From: Quentin Schulz Date: Wed, 19 Nov 2025 17:19:55 +0000 (+0100) Subject: board: softing: vining: migrate to modern LED framework X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da09bb6a6c1f40dd5fec18ee5c946ebf5722b7ad;p=pandora-u-boot.git 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 Acked-by: Tien Fong Chee --- 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 #include #include -#include +#include #include #include #include @@ -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