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 <quentin.schulz@cherry.de>
Acked-by: Tien Fong Chee <tien.fong.chee@altera.com>
This commit is contained in:
Quentin Schulz
2025-11-19 18:19:55 +01:00
committed by Tien Fong Chee
parent 0af9efa7c1
commit da09bb6a6c
3 changed files with 37 additions and 14 deletions

View File

@@ -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 {

View File

@@ -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;

View File

@@ -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