led: Remove old status-LED code
Subsystems (2)
v3 cover led: Remove old status-LED code
There has been an LED framework in U-Boot which uses driver model for about 9 years now. Recent work is underway to improve it and provide more features. It is probably a good time to drop the old code, which is only used by 5 boards:
./tools/qconfig.py -f LED_STATUS
5 matches
eb_cpu5282 eb_cpu5282_internal mx23_olinuxino pinephone socfpga_vining_fpga
This series attempts that.
The new /options node provides a way to provide U-Boot settings, and LEDs are implemented there. For now I have brought into the options schema from upstream. We can update it once the LED additions land there.
Changes in v3:
- Update commit message
- Combine removal and enable patches
- Combine removal and enable patches
- Combine removal and enable patches
Changes in v2:
- Combine code-removal and defconfig changes
- Add a patch to enable LED and LED_BOOT for these boards
- Enable LED on the 5 affected platforms
- Reorder patches for bisectability
- Add dt-schema bindings for LED
Simon Glass (25):
eb_cpu5282: Drop status-LED code and enable LED
vining_fpga: Drop status-LED code and use LED
mx23_olinuxino: Drop status-LED code and use LED
pinephone: Drop status-LED code and use LED
led: Drop LED_STATUS_BOARD_SPECIFIC
arm: Drop old LED support
common: doc: Drop old LED support
st: stm32f429: Drop old LED code
led: Make the LED config common
led: Drop LED_STATUS from Kconfig
led: Drop the legacy LED command
misc: Drop gpio_led driver
pca9551_led: Delete driver
misc: status_led: Delete driver
m68k: Drop unused status_led.h header file
powerpc: Drop status-LED code
igep00x0: Drop unused status_led.h header file
sunxi: Drop status-LED code
common: Drop status-LED code in board_r
image: Drop unused status_led.h header file
ide: Drop unused status_led.h header file
mpc83xx: Drop status-LED code
net: Drop status-LED code
led: Drop status_led header file
doc: Add devicetree bindings for options
arch/arm/lib/crt0.S | 4 - arch/m68k/lib/bootm.c | 3 - arch/powerpc/lib/interrupts.c | 6 - board/BuS/eb_cpu5282/eb_cpu5282.c | 20 -- board/isee/igep00x0/igep00x0.c | 1 - board/olimex/mx23_olinuxino/mx23_olinuxino.c | 7 - board/softing/vining_fpga/socfpga.c | 4 - board/st/stm32f429-discovery/Makefile | 1 - board/st/stm32f429-discovery/led.c | 39 --- board/sunxi/board.c | 6 - boot/image.c | 4 - cmd/Makefile | 1 - cmd/ide.c | 4 - cmd/legacy_led.c | 185 ---------- common/board_f.c | 22 -- common/board_r.c | 27 -- configs/eb_cpu5282_defconfig | 8 +- configs/eb_cpu5282_internal_defconfig | 8 +- configs/mx23_olinuxino_defconfig | 10 +- configs/pinephone_defconfig | 7 +- configs/socfpga_vining_fpga_defconfig | 13 +- doc/README.LED | 77 ----- doc/device-tree-bindings/options.yaml | 79 +++++ doc/device-tree-bindings/options/u-boot.yaml | 136 ++++++++ drivers/led/Kconfig | 342 +------------------ drivers/misc/Kconfig | 13 - drivers/misc/Makefile | 3 - drivers/misc/gpio_led.c | 106 ------ drivers/misc/pca9551_led.c | 170 --------- drivers/misc/status_led.c | 124 ------- drivers/timer/mpc83xx_timer.c | 5 - include/configs/eb_cpu5282.h | 6 - include/status_led.h | 115 ------- net/bootp.c | 7 - net/net.c | 33 -- 35 files changed, 236 insertions(+), 1360 deletions(-) delete mode 100644 board/st/stm32f429-discovery/led.c delete mode 100644 cmd/legacy_led.c delete mode 100644 doc/README.LED create mode 100644 doc/device-tree-bindings/options.yaml create mode 100644 doc/device-tree-bindings/options/u-boot.yaml delete mode 100644 drivers/misc/gpio_led.c delete mode 100644 drivers/misc/pca9551_led.c delete mode 100644 drivers/misc/status_led.c delete mode 100644 include/status_led.h
Signature · 1 line
2.43.0
PATCH v3 1/25 eb_cpu5282: Drop status-LED code and enable LED
Drop this old code. Swtich the LED options to use the new approach, in the same commit, to maintain build-bisectability.
Both eb_cpu5282 and eb_cpu5282_internal are done together, since they share code.
---
Changes in v3:
- Update commit message
Changes in v2:
- Combine code-removal and defconfig changes
board/BuS/eb_cpu5282/eb_cpu5282.c | 20 -------------------- configs/eb_cpu5282_defconfig | 8 ++------ configs/eb_cpu5282_internal_defconfig | 8 ++------ include/configs/eb_cpu5282.h | 6 ------ 4 files changed, 4 insertions(+), 38 deletions(-)
board/BuS/eb_cpu5282/eb_cpu5282.c +0 -20
@@ -14,7 +14,6 @@#include <bmp_layout.h> #include <env.h> #include <init.h> -#include <status_led.h> #include <bus_vcxk.h> /*---------------------------------------------------------------------------*/
@@ -160,25 +159,6 @@ int misc_init_r(void)return 1 ; } -void __led_toggle (led_id_t mask) -{ -MCFGPTA_GPTPORT ^= (1 <<3 ); -} - -void __led_init (led_id_t mask,int state) -{ -__led_set (mask, state); -MCFGPTA_GPTDDR |= (1 <<3 ); -} - -void __led_set (led_id_t mask,int state) -{ -if (state ==CONFIG_LED_STATUS_ON ) -MCFGPTA_GPTPORT |= (1 <<3 ); -else -MCFGPTA_GPTPORT &= ~(1 <<3 ); -} -/*---------------------------------------------------------------------------*/ /* EOF EB+MCF-EV123.c */
configs/eb_cpu5282_defconfig +2 -6
@@ -35,12 +35,8 @@ CONFIG_SYS_FAULT_ECHO_LINK_DOWN=y CONFIG_SYS_RX_ETH_BUFFER=8 CONFIG_DM_I2C=y CONFIG_SYS_I2C_FSL=y -CONFIG_LED_STATUS=y -CONFIG_LED_STATUS0=y -CONFIG_LED_STATUS_BIT=8 -CONFIG_LED_STATUS_BOOT_ENABLE=y -CONFIG_LED_STATUS_BOOT=0 -CONFIG_LED_STATUS_CMD=y +CONFIG_LED=y +CONFIG_LED_BOOT=y CONFIG_MTD=y CONFIG_MTD_NOR_FLASH=y CONFIG_FLASH_CFI_DRIVER=y
configs/eb_cpu5282_internal_defconfig +2 -6
@@ -33,12 +33,8 @@ CONFIG_SYS_FAULT_ECHO_LINK_DOWN=y CONFIG_SYS_RX_ETH_BUFFER=8 CONFIG_DM_I2C=y CONFIG_SYS_I2C_FSL=y -CONFIG_LED_STATUS=y -CONFIG_LED_STATUS0=y -CONFIG_LED_STATUS_BIT=8 -CONFIG_LED_STATUS_BOOT_ENABLE=y -CONFIG_LED_STATUS_BOOT=0 -CONFIG_LED_STATUS_CMD=y +CONFIG_LED=y +CONFIG_LED_BOOT=y CONFIG_MTD=y CONFIG_MTD_NOR_FLASH=y CONFIG_FLASH_CFI_DRIVER=y
include/configs/eb_cpu5282.h +0 -6
@@ -14,12 +14,6 @@#define CFG_SYS_UART_PORT (0) -/*----------------------------------------------------------------------* -* Options * -*----------------------------------------------------------------------*/ - -#define STATUS_LED_ACTIVE 0 -/*----------------------------------------------------------------------* * Configuration for environment * * Environment is in the second sector of the first 256k of flash *
Signature · 1 line
2.43.0
PATCH v3 2/25 vining_fpga: Drop status-LED code and use LED
In reply to Simon GlassThis is not used anymore, so drop it.
Enable LED and LED_BOOT instead, since this is the new way to access the LED functionality.
---
Changes in v3:
- Combine removal and enable patches
board/softing/vining_fpga/socfpga.c | 4 ---- configs/socfpga_vining_fpga_defconfig | 13 ++----------- 2 files changed, 2 insertions(+), 15 deletions(-)
board/softing/vining_fpga/socfpga.c +0 -4
@@ -8,7 +8,6 @@#include <env.h> #include <init.h> #include <net.h> -#include <status_led.h> #include <asm/arch/reset_manager.h> #include <asm/global_data.h> #include <asm/io.h>
@@ -26,9 +25,6 @@ int board_late_init(void)const unsigned int usb_nrst_gpio =35 ;int ret; -status_led_set (1 ,CONFIG_LED_STATUS_ON ); -status_led_set (2 ,CONFIG_LED_STATUS_ON ); -/* Address of boot parameters for ATAG (if ATAG is used) */ gd->bd->bi_boot_params =CFG_SYS_SDRAM_BASE +0x100 ;
configs/socfpga_vining_fpga_defconfig +2 -11
@@ -77,17 +77,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_BOOT=y CONFIG_MISC=y CONFIG_I2C_EEPROM=y CONFIG_SYS_I2C_EEPROM_ADDR=0x50
Signature · 1 line
2.43.0
PATCH v3 3/25 mx23_olinuxino: Drop status-LED code and use LED
In reply to Simon GlassEnable LED and LED_BOOT instead, since this is the new way to access the LED functionality.
---
Changes in v3:
- Combine removal and enable patches
board/olimex/mx23_olinuxino/mx23_olinuxino.c | 7 ------- configs/mx23_olinuxino_defconfig | 10 ++-------- 2 files changed, 2 insertions(+), 15 deletions(-)
board/olimex/mx23_olinuxino/mx23_olinuxino.c +0 -7
@@ -13,9 +13,6 @@#include <asm/arch/imx-regs.h> #include <asm/arch/clock.h> #include <asm/arch/sys_proto.h> -#ifdef CONFIG_LED_STATUS -#include <status_led.h> -#endif #include <linux/delay.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -61,9 +58,5 @@ int board_init(void)/* Adress of boot parameters */ gd->bd->bi_boot_params =PHYS_SDRAM_1 +0x100 ; -#if defined(CONFIG_LED_STATUS ) && defined(CONFIG_LED_STATUS_BOOT_ENABLE ) -status_led_set (CONFIG_LED_STATUS_BOOT ,CONFIG_LED_STATUS_STATE ); -#endif -return 0 ; }
configs/mx23_olinuxino_defconfig +2 -8
@@ -39,14 +39,8 @@ CONFIG_USE_BOOTFILE=y CONFIG_BOOTFILE="uImage" CONFIG_VERSION_VARIABLE=y CONFIG_MXS_GPIO=y -CONFIG_LED_STATUS=y -CONFIG_LED_STATUS_GPIO=y -CONFIG_LED_STATUS0=y -CONFIG_LED_STATUS_BIT=778 -CONFIG_LED_STATUS_STATE=2 -CONFIG_LED_STATUS_BOOT_ENABLE=y -CONFIG_LED_STATUS_BOOT=0 -CONFIG_LED_STATUS_CMD=y +CONFIG_LED=y +CONFIG_LED_BOOT=y CONFIG_MMC_MXS=y CONFIG_CONS_INDEX=0 CONFIG_DM_SERIAL=y
Signature · 1 line
2.43.0
Simon Glass
AppliedRe: [PATCH v3 03/25] mx23_olinuxino: Drop status-LED code and use LED
Quoted 5 lines · Simon Glass
Enable LED and
LED_BOOTinstead, since this is the new way to access the LED functionality.Signed-off-by Simon Glass <[email protected]>
Quoted 9 lines
---
Changes in v3:
- Combine removal and enable patchesboard/olimex/mx23_olinuxino/mx23_olinuxino.c | 7 ------- configs/mx23_olinuxino_defconfig | 10 ++-------- 2 files changed, 2 insertions(+), 15 deletions(-)
Applied to ci/master, thanks!
PATCH v3 4/25 pinephone: Drop status-LED code and use LED
In reply to Simon GlassDrop the STATUS_LED options and enable LED and LED_BOOT instead, since this is the new way to access the LED functionality.
---
Changes in v3:
- Combine removal and enable patches
Changes in v2:
- Add a patch to enable LED and LED_BOOT for these boards
configs/pinephone_defconfig | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
configs/pinephone_defconfig +2 -5
@@ -11,8 +11,5 @@ CONFIG_MMC_SUNXI_SLOT_EXTRA=2 CONFIG_PINEPHONE_DT_SELECTION=y # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_OF_LIST="sun50i-a64-pinephone-1.1 sun50i-a64-pinephone-1.2" -CONFIG_LED_STATUS=y -CONFIG_LED_STATUS_GPIO=y -CONFIG_LED_STATUS0=y -CONFIG_LED_STATUS_BIT=114 -CONFIG_LED_STATUS_STATE=2 +CONFIG_LED=y +CONFIG_LED_BOOT=y
Signature · 1 line
2.43.0
PATCH v3 5/25 led: Drop LED_STATUS_BOARD_SPECIFIC
In reply to Simon GlassThis is not used by any board and there is a driver model version of LEDs. Drop it.
---
(no changes since v1)
cmd/legacy_led.c | 40 ---------------------------------------- drivers/led/Kconfig | 6 ------ include/status_led.h | 13 +------------ 3 files changed, 1 insertion(+), 58 deletions(-)
cmd/legacy_led.c +0 -40
@@ -24,26 +24,6 @@ struct led_tbl_s {typedef struct led_tbl_s led_tbl_t ;static const led_tbl_t led_commands[] = { -#ifdef CONFIG_LED_STATUS_BOARD_SPECIFIC -#ifdef CONFIG_LED_STATUS0 - {"0" ,CONFIG_LED_STATUS_BIT ,NULL ,NULL ,NULL }, -#endif -#ifdef CONFIG_LED_STATUS1 - {"1" ,CONFIG_LED_STATUS_BIT1 ,NULL ,NULL ,NULL }, -#endif -#ifdef CONFIG_LED_STATUS2 - {"2" ,CONFIG_LED_STATUS_BIT2 ,NULL ,NULL ,NULL }, -#endif -#ifdef CONFIG_LED_STATUS3 - {"3" ,CONFIG_LED_STATUS_BIT3 ,NULL ,NULL ,NULL }, -#endif -#ifdef CONFIG_LED_STATUS4 - {"4" ,CONFIG_LED_STATUS_BIT4 ,NULL ,NULL ,NULL }, -#endif -#ifdef CONFIG_LED_STATUS5 - {"5" ,CONFIG_LED_STATUS_BIT5 ,NULL ,NULL ,NULL }, -#endif -#endif #ifdef CONFIG_LED_STATUS_GREEN {"green" ,CONFIG_LED_STATUS_GREEN , green_led_off, green_led_on,NULL }, #endif
@@ -148,26 +128,6 @@ int do_legacy_led(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) U_BOOT_CMD( led, 4, 1, do_legacy_led, "[" -#ifdef CONFIG_LED_STATUS_BOARD_SPECIFIC -#ifdef CONFIG_LED_STATUS0 - "0|" -#endif -#ifdef CONFIG_LED_STATUS1 - "1|" -#endif -#ifdef CONFIG_LED_STATUS2 - "2|" -#endif -#ifdef CONFIG_LED_STATUS3 - "3|" -#endif -#ifdef CONFIG_LED_STATUS4 - "4|" -#endif -#ifdef CONFIG_LED_STATUS5 - "5|" -#endif -#endif #ifdef CONFIG_LED_STATUS_GREEN "green|" #endif
drivers/led/Kconfig +0 -6
@@ -166,12 +166,6 @@ config LED_STATUS_GPIO The status LED can be connected to a GPIO pin. In such cases, the gpio_led driver can be used as a status LED backend implementation. -config LED_STATUS_BOARD_SPECIFIC - bool "Specific board" - default y - help - LED support is only for a specific board. - comment "LEDs parameters" config LED_STATUS0
include/status_led.h +1 -12
@@ -61,23 +61,12 @@ static inline void status_led_boot_blink(void)* ADVICE: Define in your board configuration file rather than * filling this file up with lots of custom board stuff. */ - -#elif defined(CONFIG_LED_STATUS_BOARD_SPECIFIC ) -/* led_id_t is unsigned long mask */ -typedef unsigned long led_id_t ; - -extern void __led_toggle (led_id_t mask); -extern void __led_init (led_id_t mask,int state); -extern void __led_set (led_id_t mask,int state); -void __led_blink (led_id_t mask,int freq);#else # error Status LED configuration missing#endif /************************************************************************/ -#ifndef CONFIG_LED_STATUS_BOARD_SPECIFIC -# include <asm/status_led.h> -#endif +#include <asm/status_led.h> #else
Signature · 1 line
2.43.0
PATCH v3 6/25 arm: Drop old LED support
In reply to Simon GlassThis has been replaced with a new LED framework, so drop this old code.
---
(no changes since v1)
arch/arm/lib/crt0.S | 4 ---- 1 file changed, 4 deletions(-)
arch/arm/lib/crt0.S +0 -4
@@ -185,10 +185,6 @@ here: movne r9, r0 # endif -#if ! defined(CONFIG_XPL_BUILD) - bl coloured_LED_init - bl red_led_on -#endif /* call board_init_r(gd_t *id, ulong dest_addr) */ mov r0, r9 /* gd_t */ ldr r1, [r9, #GD_RELOCADDR] /* dest_addr */
Signature · 1 line
2.43.0
PATCH v3 7/25 common: doc: Drop old LED support
In reply to Simon GlassThis has been replaced with a new LED framework, so drop this old code and documentation.
---
(no changes since v1)
common/board_f.c | 22 -------------- doc/README.LED | 77 ------------------------------------------------ 2 files changed, 99 deletions(-) delete mode 100644 doc/README.LED
common/board_f.c +0 -22
@@ -36,7 +36,6 @@#include <relocate.h> #include <serial.h> #include <spl.h> -#include <status_led.h> #include <sysreset.h> #include <timer.h> #include <trace.h>
@@ -53,27 +52,6 @@DECLARE_GLOBAL_DATA_PTR ; -/* -* TODO([email protected]): IMO this code should be -* refactored to a single function, something like: -* -* void led_set_state(enum led_colour_t colour, int on); -*/ -/************************************************************************ -* Coloured LED functionality -************************************************************************ -* May be supplied by boards if desired -*/ -__weak void coloured_LED_init (void ) {} -__weak void red_led_on (void ) {} -__weak void red_led_off (void ) {} -__weak void green_led_on (void ) {} -__weak void green_led_off (void ) {} -__weak void yellow_led_on (void ) {} -__weak void yellow_led_off (void ) {} -__weak void blue_led_on (void ) {} -__weak void blue_led_off (void ) {} -/* * Why is gd allocated a register? Prior to reloc it might be better to * just pass it around to each function in this file?
doc/README.LED deleted +0 -77
77 lines not on this page · raw message
Signature · 1 line
2.43.0
Simon Glass
AppliedRe: [PATCH v3 07/25] common: doc: Drop old LED support
Quoted 5 lines · Simon Glass
This has been replaced with a new LED framework, so drop this old code and documentation.
Signed-off-by Simon Glass <[email protected]>
Quoted 9 lines
---
(no changes since v1)
common/board_f.c | 22 -------------- doc/README.LED | 77 ------------------------------------------------ 2 files changed, 99 deletions(-) delete mode 100644 doc/README.LED
Applied to ci/master, thanks!
PATCH v3 8/25 st: stm32f429: Drop old LED code
In reply to Simon GlassThis predates the LED framework, so drop it.
---
(no changes since v1)
board/st/stm32f429-discovery/Makefile | 1 - board/st/stm32f429-discovery/led.c | 39 --------------------------- 2 files changed, 40 deletions(-) delete mode 100644 board/st/stm32f429-discovery/led.c
board/st/stm32f429-discovery/Makefile +0 -1
@@ -7,4 +7,3 @@ # Kamil Lulko, <[email protected]> obj-y := stm32f429-discovery.o -obj-y += led.o
board/st/stm32f429-discovery/led.c deleted +0 -39
@@ -1,39 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* -* (C) Copyright 2015 -* Kamil Lulko, <[email protected]> -*/ - -#include <status_led.h> -#include <asm-generic/gpio.h> - -#define RED_LED 110 -#define GREEN_LED 109 - -void coloured_LED_init (void ) -{ -gpio_request (RED_LED ,"red led" ); -gpio_direction_output (RED_LED ,0 ); -gpio_request (GREEN_LED ,"green led" ); -gpio_direction_output (GREEN_LED ,0 ); -} - -void red_led_off (void ) -{ -gpio_set_value (RED_LED ,0 ); -} - -void green_led_off (void ) -{ -gpio_set_value (GREEN_LED ,0 ); -} - -void red_led_on (void ) -{ -gpio_set_value (RED_LED ,1 ); -} - -void green_led_on (void ) -{ -gpio_set_value (GREEN_LED ,1 ); -}
Signature · 1 line
2.43.0
Re: [PATCH v3 08/25] st: stm32f429: Drop old LED code
Hi,
Quoted 13 lines · Simon Glass
This predates the LED framework, so drop it.
Signed-off-by Simon Glass <[email protected]>---
(no changes since v1)
board/st/stm32f429-discovery/Makefile | 1 - board/st/stm32f429-discovery/led.c | 39 --------------------------- 2 files changed, 40 deletions(-)delete mode 100644
board/st/stm32f429-discovery/led.c
Thanks
for information LEDs are also defined in device tree: arch/arm/dts/stm32f429-disco.dts
leds {
compatible = "gpio-leds";
led-red {
gpios = <&gpiog 14 0>;
};
led-green {
gpios = <&gpiog 13 0>;
linux,default-trigger = "heartbeat";
};
};
but today the CONFIG_LED_GPIO=y is missing in configs/stm32f429-discovery_defconfig
to restore the LED support on this board
Thanks
Patrick
Simon Glass
AppliedRe: [PATCH v3 08/25] st: stm32f429: Drop old LED code
Quoted 34 lines · Patrick DELAUNAY
Hi,
Quoted 13 lines · Simon Glass
This predates the LED framework, so drop it.
Signed-off-by Simon Glass <[email protected]>---
(no changes since v1)
board/st/stm32f429-discovery/Makefile | 1 - board/st/stm32f429-discovery/led.c | 39 --------------------------- 2 files changed, 40 deletions(-)delete mode 100644
board/st/stm32f429-discovery/led.cThanks
for information LEDs are also defined in device tree:
arch/arm/dts/stm32f429-disco.dtsleds { compatible = "gpio-leds"; led-red { gpios = <&gpiog 14 0>; }; led-green { gpios = <&gpiog 13 0>; linux,default-trigger = "heartbeat"; }; };
Quoted 8 lines
but today the
CONFIG_LED_GPIO=yis missing in
configs/stm32f429-discovery_defconfigto restore the LED support on this board
Reviewed-by Patrick Delaunay <[email protected]>
Applied to ci/master, thanks!