[PATCH 00/27] 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.
Simon Glass (27): 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 eb_cpu5282: Drop STATUS_LED mx23_olinuxino: Drop STATUS_LED pinephone: Drop STATUS_LED socfpga_vining_fpga: Drop STATUS_LED 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 eb_cpu5282: Drop status-LED code igep00x0: Drop unused status_led.h header file mx23_olinuxino: Drop status-LED code vining_fpga: Drop status-LED code 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
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 | 16 - configs/eb_cpu5282_defconfig | 6 - configs/eb_cpu5282_internal_defconfig | 6 - configs/mx23_olinuxino_defconfig | 8 - configs/pinephone_defconfig | 5 - configs/socfpga_vining_fpga_defconfig | 11 - doc/README.LED | 77 ----- 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 | 102 ------ net/bootp.c | 7 - net/net.c | 33 -- 33 files changed, 11 insertions(+), 1336 deletions(-) delete mode 100644 board/st/stm32f429-discovery/led.c delete mode 100644 cmd/legacy_led.c delete mode 100644 doc/README.LED 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

This is not used by any board and there is a driver model version of LEDs. Drop it.
Signed-off-by: Simon Glass sjg@chromium.org ---
cmd/legacy_led.c | 40 ---------------------------------------- drivers/led/Kconfig | 6 ------ include/status_led.h | 13 +------------ 3 files changed, 1 insertion(+), 58 deletions(-)
diff --git a/cmd/legacy_led.c b/cmd/legacy_led.c index 50de7e89d8f..ef2135e0dba 100644 --- a/cmd/legacy_led.c +++ b/cmd/legacy_led.c @@ -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 diff --git a/drivers/led/Kconfig b/drivers/led/Kconfig index bee74b25751..5c401f92080 100644 --- a/drivers/led/Kconfig +++ b/drivers/led/Kconfig @@ -142,12 +142,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 diff --git a/include/status_led.h b/include/status_led.h index 6707ab1d29d..3d118af0d8b 100644 --- a/include/status_led.h +++ b/include/status_led.h @@ -54,23 +54,12 @@ void status_led_set(int led, int state); * 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>
#endif /* CONFIG_LED_STATUS */

This has been replaced with a new LED framework, so drop this old code.
Signed-off-by: Simon Glass sjg@chromium.org ---
arch/arm/lib/crt0.S | 4 ---- 1 file changed, 4 deletions(-)
diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S index a0311438b45..3293e4df63c 100644 --- a/arch/arm/lib/crt0.S +++ b/arch/arm/lib/crt0.S @@ -185,10 +185,6 @@ here: movne r9, r0 # endif
-#if ! defined(CONFIG_SPL_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 */

This has been replaced with a new LED framework, so drop this old code and documentation.
Signed-off-by: Simon Glass sjg@chromium.org ---
common/board_f.c | 22 -------------- doc/README.LED | 77 ------------------------------------------------ 2 files changed, 99 deletions(-) delete mode 100644 doc/README.LED
diff --git a/common/board_f.c b/common/board_f.c index 154675d0e40..f161a690ec0 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -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(sjg@chromium.org): 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? diff --git a/doc/README.LED b/doc/README.LED deleted file mode 100644 index c21c9d53ec3..00000000000 --- a/doc/README.LED +++ /dev/null @@ -1,77 +0,0 @@ -Status LED -======================================== - -This README describes the status LED API. - -The API is defined by the include file include/status_led.h - -The first step is to enable CONFIG_LED_STATUS in menuconfig: -> Device Drivers > LED Support. - -If the LED support is only for specific board, enable -CONFIG_LED_STATUS_BOARD_SPECIFIC in the menuconfig. - -Status LEDS 0 to 5 are enabled by the following configurations at menuconfig: -CONFIG_STATUS_LED0, CONFIG_STATUS_LED1, ... CONFIG_STATUS_LED5 - -The following should be configured for each of the enabled LEDs: -CONFIG_STATUS_LED_BIT<n> -CONFIG_STATUS_LED_STATE<n> -CONFIG_STATUS_LED_FREQ<n> -Where <n> is an integer 1 through 5 (empty for 0). - -CONFIG_STATUS_LED_BIT is passed into the __led_* functions to identify which LED -is being acted on. As such, the value choose must be unique with with respect to -the other CONFIG_STATUS_LED_BIT's. Mapping the value to a physical LED is the -reponsiblity of the __led_* function. - -CONFIG_STATUS_LED_STATE is the initial state of the LED. It should be set to one -of these values: CONFIG_LED_STATUS_OFF or CONFIG_LED_STATUS_ON. - -CONFIG_STATUS_LED_FREQ determines the LED blink frequency. -Values range from 2 to 10. - -Some other LED macros ---------------------- - -CONFIG_STATUS_LED_BOOT is the LED to light when the board is booting. -This must be a valid LED number (0-5). - -CONFIG_STATUS_LED_RED is the red LED. It is used to signal errors. This must be -a valid LED number (0-5). Other similar color LED's macros are -CONFIG_STATUS_LED_GREEN, CONFIG_STATUS_LED_YELLOW and CONFIG_STATUS_LED_BLUE. - -General LED functions ---------------------- -The following functions should be defined: - -__led_init is called once to initialize the LED to CONFIG_STATUS_LED_STATE. -One time start up code should be placed here. - -__led_set is called to change the state of the LED. - -__led_toggle is called to toggle the current state of the LED. - -Colour LED -======================================== - -Colour LED's are at present only used by ARM. - -The functions names explain their purpose. - -coloured_LED_init -red_LED_on -red_LED_off -green_LED_on -green_LED_off -yellow_LED_on -yellow_LED_off -blue_LED_on -blue_LED_off - -These are weakly defined in arch/arm/lib/board.c to noops. Where applicable, define -these functions in the board specific source. - -TBD : Describe older board dependent macros similar to what is done for - -TBD : Describe general support via asm/status_led.h

This predates the LED framework, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org ---
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
diff --git a/board/st/stm32f429-discovery/Makefile b/board/st/stm32f429-discovery/Makefile index 6b02c0fddec..233eafdad3d 100644 --- a/board/st/stm32f429-discovery/Makefile +++ b/board/st/stm32f429-discovery/Makefile @@ -7,4 +7,3 @@ # Kamil Lulko, kamil.lulko@gmail.com
obj-y := stm32f429-discovery.o -obj-y += led.o diff --git a/board/st/stm32f429-discovery/led.c b/board/st/stm32f429-discovery/led.c deleted file mode 100644 index 4b8038341b9..00000000000 --- a/board/st/stm32f429-discovery/led.c +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * (C) Copyright 2015 - * Kamil Lulko, kamil.lulko@gmail.com - */ - -#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); -}

Use an if...endif construct to avoid needing to make everything depend on LED. Make SPL_LED depend on LED since that seems reasonable.
Signed-off-by: Simon Glass sjg@chromium.org ---
drivers/led/Kconfig | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/drivers/led/Kconfig b/drivers/led/Kconfig index 5c401f92080..32f0eade710 100644 --- a/drivers/led/Kconfig +++ b/drivers/led/Kconfig @@ -9,9 +9,11 @@ config LED can provide access to board-specific LEDs. Use of the device tree for configuration is encouraged.
+if LED + config LED_BCM6328 bool "LED Support for BCM6328" - depends on LED && ARCH_BMIPS + depends on ARCH_BMIPS help This option enables support for LEDs connected to the BCM6328 LED HW controller accessed via MMIO registers. @@ -22,7 +24,7 @@ config LED_BCM6328
config LED_BCM6358 bool "LED Support for BCM6358" - depends on LED && ARCH_BMIPS + depends on ARCH_BMIPS help This option enables support for LEDs connected to the BCM6358 LED HW controller accessed via MMIO registers. @@ -30,28 +32,28 @@ config LED_BCM6358
config LED_BCM6753 bool "LED Support for BCM6753" - depends on LED && BCM6855 + depends on BCM6855 help This option enables support for LEDs connected to the BCM6753 HW has blinking and fading capabilities and up to 32 LEDs can be controlled.
config LED_BCM6858 bool "LED Support for BCM6858" - depends on LED && (BCM6856 || BCM6858 || BCM63158) + depends on BCM6856 || BCM6858 || BCM63158 help This option enables support for LEDs connected to the BCM6858 HW has blinking capabilities and up to 32 LEDs can be controlled.
config LED_CORTINA bool "LED Support for Cortina Access CAxxxx SoCs" - depends on LED && (CORTINA_PLATFORM) + depends on CORTINA_PLATFORM help This option enables support for LEDs connected to the Cortina Access CAxxxx SOCs.
config LED_LP5562 bool "LED Support for LP5562" - depends on LED && DM_I2C + depends on DM_I2C help This option enables support for LEDs connected to the TI LP5562 4 channel I2C LED controller. Driver fully supports blink on the @@ -59,14 +61,13 @@ config LED_LP5562
config LED_PWM bool "LED PWM" - depends on LED && DM_PWM + depends on DM_PWM help Enable support for LEDs connected to PWM. Linux compatible ofdata.
config LED_BLINK bool "Support hardware LED blinking" - depends on LED help Some drivers can support automatic blinking of LEDs with a given period, without needing timers or extra code to handle the timing. @@ -75,7 +76,6 @@ config LED_BLINK
config LED_SW_BLINK bool "Support software LED blinking" - depends on LED select CYCLIC help Turns on led blinking implemented in the software, useful when @@ -98,7 +98,7 @@ config SPL_LED
config LED_GPIO bool "LED support for GPIO-connected LEDs" - depends on LED && DM_GPIO + depends on DM_GPIO help Enable support for LEDs which are connected to GPIO lines. These GPIOs may be on the SoC or some other device which provides GPIOs. @@ -112,6 +112,8 @@ config SPL_LED_GPIO This option is an SPL-variant of the LED_GPIO option. See the help of LED_GPIO for details.
+endif # LED + config LED_STATUS bool "Enable status LED API" help

This feature is very old and does not use the LED framework. Drop it from this board.
Signed-off-by: Simon Glass sjg@chromium.org ---
configs/eb_cpu5282_defconfig | 6 ------ configs/eb_cpu5282_internal_defconfig | 6 ------ 2 files changed, 12 deletions(-)
diff --git a/configs/eb_cpu5282_defconfig b/configs/eb_cpu5282_defconfig index 271dbdf4dbb..82d28e5cf34 100644 --- a/configs/eb_cpu5282_defconfig +++ b/configs/eb_cpu5282_defconfig @@ -35,12 +35,6 @@ 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_MTD=y CONFIG_MTD_NOR_FLASH=y CONFIG_FLASH_CFI_DRIVER=y diff --git a/configs/eb_cpu5282_internal_defconfig b/configs/eb_cpu5282_internal_defconfig index 89a7925dffa..d37127757a5 100644 --- a/configs/eb_cpu5282_internal_defconfig +++ b/configs/eb_cpu5282_internal_defconfig @@ -33,12 +33,6 @@ 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_MTD=y CONFIG_MTD_NOR_FLASH=y CONFIG_FLASH_CFI_DRIVER=y

This feature is very old and does not use the LED framework. Drop it from this board.
Signed-off-by: Simon Glass sjg@chromium.org ---
configs/mx23_olinuxino_defconfig | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/configs/mx23_olinuxino_defconfig b/configs/mx23_olinuxino_defconfig index 335de62e84b..febf7f544b3 100644 --- a/configs/mx23_olinuxino_defconfig +++ b/configs/mx23_olinuxino_defconfig @@ -39,14 +39,6 @@ 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_MMC_MXS=y CONFIG_CONS_INDEX=0 CONFIG_DM_SERIAL=y

This feature is very old and does not use the LED framework. Drop it from this board.
Signed-off-by: Simon Glass sjg@chromium.org ---
configs/pinephone_defconfig | 5 ----- 1 file changed, 5 deletions(-)
diff --git a/configs/pinephone_defconfig b/configs/pinephone_defconfig index 9d39204a439..1956eca8815 100644 --- a/configs/pinephone_defconfig +++ b/configs/pinephone_defconfig @@ -11,8 +11,3 @@ 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

This feature is very old and does not use the LED framework. Drop it from this board.
Signed-off-by: Simon Glass sjg@chromium.org ---
configs/socfpga_vining_fpga_defconfig | 11 ----------- 1 file changed, 11 deletions(-)
diff --git a/configs/socfpga_vining_fpga_defconfig b/configs/socfpga_vining_fpga_defconfig index f64efcff6bd..1a90e129101 100644 --- a/configs/socfpga_vining_fpga_defconfig +++ b/configs/socfpga_vining_fpga_defconfig @@ -77,17 +77,6 @@ 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_MISC=y CONFIG_I2C_EEPROM=y CONFIG_SYS_I2C_EEPROM_ADDR=0x50

Drop all of these configs, which are now unused.
Signed-off-by: Simon Glass sjg@chromium.org ---
drivers/led/Kconfig | 316 -------------------------------------------- 1 file changed, 316 deletions(-)
diff --git a/drivers/led/Kconfig b/drivers/led/Kconfig index 32f0eade710..f4d47d0f327 100644 --- a/drivers/led/Kconfig +++ b/drivers/led/Kconfig @@ -114,320 +114,4 @@ config SPL_LED_GPIO
endif # LED
-config LED_STATUS - bool "Enable status LED API" - help - Allows common u-boot commands to use a board's leds to - provide status for activities like booting and downloading files. - -if LED_STATUS - -# Hidden constants - -config LED_STATUS_OFF - int - default 0 - -config LED_STATUS_BLINKING - int - default 1 - -config LED_STATUS_ON - int - default 2 - -# Hidden constants end - -config LED_STATUS_GPIO - bool "GPIO status LED implementation" - help - 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. - -comment "LEDs parameters" - -config LED_STATUS0 - bool "Enable status LED 0" - -if LED_STATUS0 - -config LED_STATUS_BIT - int "identification" - help - CONFIG_LED_STATUS_BIT is passed into the __led_* functions to identify - which LED is being acted on. As such, the chosen value must be unique - with respect to the other CONFIG_LED_STATUS_BIT's. Mapping the value - to a physical LED is the responsibility of the __led_* function. - -config LED_STATUS_STATE - int "initial state" - range LED_STATUS_OFF LED_STATUS_ON - default LED_STATUS_OFF - help - Should be set one of the following: - 0 - off - 1 - blinking - 2 - on - -config LED_STATUS_FREQ - int "blink frequency" - range 2 10 - default 2 - help - The LED blink period calculated from LED_STATUS_FREQ: - LED_STATUS_PERIOD = CONFIG_SYS_HZ/LED_STATUS_FREQ - Values range: 2 - 10 - -endif # LED_STATUS0 - -config LED_STATUS1 - bool "Enable status LED 1" - -if LED_STATUS1 - -config LED_STATUS_BIT1 - int "identification" - help - CONFIG_LED_STATUS_BIT1 is passed into the __led_* functions to - identify which LED is being acted on. As such, the chosen value must - be unique with respect to the other CONFIG_LED_STATUS_BIT's. Mapping - the value to a physical LED is the responsibility of the __led_* - function. - -config LED_STATUS_STATE1 - int "initial state" - range LED_STATUS_OFF LED_STATUS_ON - default LED_STATUS_OFF - help - Should be set one of the following: - 0 - off - 1 - blinking - 2 - on - -config LED_STATUS_FREQ1 - int "blink frequency" - range 2 10 - default 2 - help - The LED blink period calculated from LED_STATUS_FREQ1: - LED_STATUS_PERIOD1 = CONFIG_SYS_HZ/LED_STATUS_FREQ1 - Values range: 2 - 10 - -endif # LED_STATUS1 - -config LED_STATUS2 - bool "Enable status LED 2" - -if LED_STATUS2 - -config LED_STATUS_BIT2 - int "identification" - help - CONFIG_LED_STATUS_BIT2 is passed into the __led_* functions to - identify which LED is being acted on. As such, the chosen value must - be unique with respect to the other CONFIG_LED_STATUS_BIT's. Mapping - the value to a physical LED is the responsibility of the __led_* - function. - -config LED_STATUS_STATE2 - int "initial state" - range LED_STATUS_OFF LED_STATUS_ON - default LED_STATUS_OFF - help - Should be set one of the following: - 0 - off - 1 - blinking - 2 - on - -config LED_STATUS_FREQ2 - int "blink frequency" - range 2 10 - default 2 - help - The LED blink period calculated from LED_STATUS_FREQ2: - LED_STATUS_PERIOD2 = CONFIG_SYS_HZ/LED_STATUS_FREQ2 - Values range: 2 - 10 - -endif # LED_STATUS2 - -config LED_STATUS3 - bool "Enable status LED 3" - -if LED_STATUS3 - -config LED_STATUS_BIT3 - int "identification" - help - CONFIG_LED_STATUS_BIT3 is passed into the __led_* functions to - identify which LED is being acted on. As such, the chosen value must - be unique with respect to the other CONFIG_LED_STATUS_BIT's. Mapping - the value to a physical LED is the responsibility of the __led_* - function. - -config LED_STATUS_STATE3 - int "initial state" - range LED_STATUS_OFF LED_STATUS_ON - default LED_STATUS_OFF - help - Should be set one of the following: - 0 - off - 1 - blinking - 2 - on - -config LED_STATUS_FREQ3 - int "blink frequency" - range 2 10 - default 2 - help - The LED blink period calculated from LED_STATUS_FREQ3: - LED_STATUS_PERIOD3 = CONFIG_SYS_HZ/LED_STATUS_FREQ3 - Values range: 2 - 10 - -endif # LED_STATUS3 - -config LED_STATUS4 - bool "Enable status LED 4" - -if LED_STATUS4 - -config LED_STATUS_BIT4 - int "identification" - help - CONFIG_LED_STATUS_BIT4 is passed into the __led_* functions to - identify which LED is being acted on. As such, the chosen value must - be unique with respect to the other CONFIG_LED_STATUS_BIT's. Mapping - the value to a physical LED is the responsibility of the __led_* - function. - -config LED_STATUS_STATE4 - int "initial state" - range LED_STATUS_OFF LED_STATUS_ON - default LED_STATUS_OFF - help - Should be set one of the following: - 0 - off - 1 - blinking - 2 - on - -config LED_STATUS_FREQ4 - int "blink frequency" - range 2 10 - default 2 - help - The LED blink period calculated from LED_STATUS_FREQ4: - LED_STATUS_PERIOD4 = CONFIG_SYS_HZ/LED_STATUS_FREQ4 - Values range: 2 - 10 - -endif # LED_STATUS4 - -config LED_STATUS5 - bool "Enable status LED 5" - -if LED_STATUS5 - -config LED_STATUS_BIT5 - int "identification" - help - CONFIG_LED_STATUS_BIT5 is passed into the __led_* functions to - identify which LED is being acted on. As such, the chosen value must - be unique with respect to the other CONFIG_LED_STATUS_BIT's. Mapping - the value to a physical LED is the responsibility of the __led_* - function. - -config LED_STATUS_STATE5 - int "initial state" - range LED_STATUS_OFF LED_STATUS_ON - default LED_STATUS_OFF - help - Should be set one of the following: - 0 - off - 1 - blinking - 2 - on - -config LED_STATUS_FREQ5 - int "blink frequency" - range 2 10 - default 2 - help - The LED blink period calculated from LED_STATUS_FREQ5: - LED_STATUS_PERIOD5 = CONFIG_SYS_HZ/LED_STATUS_FREQ5 - Values range: 2 - 10 - -endif # LED_STATUS5 - -config LED_STATUS_BOOT_ENABLE - bool "Enable BOOT LED" - help - Enable to turn an LED on when the board is booting. - -if LED_STATUS_BOOT_ENABLE - -config LED_STATUS_BOOT - int "LED to light when the board is booting" - help - Valid enabled LED device number. - -endif # LED_STATUS_BOOT_ENABLE - -config LED_STATUS_RED_ENABLE - bool "Enable red LED" - help - Enable red status LED. - -if LED_STATUS_RED_ENABLE - -config LED_STATUS_RED - int "Red LED identification" - help - Valid enabled LED device number. - -endif # LED_STATUS_RED_ENABLE - -config LED_STATUS_YELLOW_ENABLE - bool "Enable yellow LED" - help - Enable yellow status LED. - -if LED_STATUS_YELLOW_ENABLE - -config LED_STATUS_YELLOW - int "Yellow LED identification" - help - Valid enabled LED device number. - -endif # LED_STATUS_YELLOW_ENABLE - -config LED_STATUS_BLUE_ENABLE - bool "Enable blue LED" - help - Enable blue status LED. - -if LED_STATUS_BLUE_ENABLE - -config LED_STATUS_BLUE - int "Blue LED identification" - help - Valid enabled LED device number. - -endif # LED_STATUS_BLUE_ENABLE - -config LED_STATUS_GREEN_ENABLE - bool "Enable green LED" - help - Enable green status LED. - -if LED_STATUS_GREEN_ENABLE - -config LED_STATUS_GREEN - int "Green LED identification" - help - Valid enabled LED device number (0-5). - -endif # LED_STATUS_GREEN_ENABLE - -config LED_STATUS_CMD - bool "Enable status LED commands" - -endif # LED_STATUS - endmenu

This is not used by any board. Drop it.
Signed-off-by: Simon Glass sjg@chromium.org ---
cmd/Makefile | 1 - cmd/legacy_led.c | 145 ----------------------------------------------- 2 files changed, 146 deletions(-) delete mode 100644 cmd/legacy_led.c
diff --git a/cmd/Makefile b/cmd/Makefile index 91227f1249c..ca57ac86b79 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -102,7 +102,6 @@ obj-$(CONFIG_CMD_IRQ) += irq.o obj-$(CONFIG_CMD_ITEST) += itest.o obj-$(CONFIG_CMD_JFFS2) += jffs2.o obj-$(CONFIG_CMD_CRAMFS) += cramfs.o -obj-$(CONFIG_LED_STATUS_CMD) += legacy_led.o obj-$(CONFIG_CMD_LED) += led.o obj-$(CONFIG_CMD_LICENSE) += license.o obj-y += load.o diff --git a/cmd/legacy_led.c b/cmd/legacy_led.c deleted file mode 100644 index ef2135e0dba..00000000000 --- a/cmd/legacy_led.c +++ /dev/null @@ -1,145 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * (C) Copyright 2010 - * Jason Kridner jkridner@beagleboard.org - * - * Based on cmd_led.c patch from: - * http://www.mail-archive.com/u-boot@lists.denx.de/msg06873.html - * (C) Copyright 2008 - * Ulf Samuelsson ulf.samuelsson@atmel.com - */ - -#include <command.h> -#include <status_led.h> -#include <vsprintf.h> - -struct led_tbl_s { - char *string; /* String for use in the command */ - led_id_t mask; /* Mask used for calling __led_set() */ - void (*off)(void); /* Optional function for turning LED off */ - void (*on)(void); /* Optional function for turning LED on */ - void (*toggle)(void);/* Optional function for toggling LED */ -}; - -typedef struct led_tbl_s led_tbl_t; - -static const led_tbl_t led_commands[] = { -#ifdef CONFIG_LED_STATUS_GREEN - { "green", CONFIG_LED_STATUS_GREEN, green_led_off, green_led_on, NULL }, -#endif -#ifdef CONFIG_LED_STATUS_YELLOW - { "yellow", CONFIG_LED_STATUS_YELLOW, yellow_led_off, yellow_led_on, - NULL }, -#endif -#ifdef CONFIG_LED_STATUS_RED - { "red", CONFIG_LED_STATUS_RED, red_led_off, red_led_on, NULL }, -#endif -#ifdef CONFIG_LED_STATUS_BLUE - { "blue", CONFIG_LED_STATUS_BLUE, blue_led_off, blue_led_on, NULL }, -#endif - { NULL, 0, NULL, NULL, NULL } -}; - -enum led_cmd { LED_ON, LED_OFF, LED_TOGGLE, LED_BLINK }; - -enum led_cmd get_led_cmd(char *var) -{ - if (strcmp(var, "off") == 0) - return LED_OFF; - if (strcmp(var, "on") == 0) - return LED_ON; - if (strcmp(var, "toggle") == 0) - return LED_TOGGLE; - if (strcmp(var, "blink") == 0) - return LED_BLINK; - - return -1; -} - -/* - * LED drivers providing a blinking LED functionality, like the - * PCA9551, can override this empty weak function - */ -void __weak __led_blink(led_id_t mask, int freq) -{ -} - -int do_legacy_led(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) -{ - int i, match = 0; - enum led_cmd cmd; - int freq; - - /* Validate arguments */ - if ((argc < 3) || (argc > 4)) - return CMD_RET_USAGE; - - cmd = get_led_cmd(argv[2]); - if (cmd < 0) { - return CMD_RET_USAGE; - } - - for (i = 0; led_commands[i].string; i++) { - if ((strcmp("all", argv[1]) == 0) || - (strcmp(led_commands[i].string, argv[1]) == 0)) { - match = 1; - switch (cmd) { - case LED_ON: - if (led_commands[i].on) - led_commands[i].on(); - else - __led_set(led_commands[i].mask, - CONFIG_LED_STATUS_ON); - break; - case LED_OFF: - if (led_commands[i].off) - led_commands[i].off(); - else - __led_set(led_commands[i].mask, - CONFIG_LED_STATUS_OFF); - break; - case LED_TOGGLE: - if (led_commands[i].toggle) - led_commands[i].toggle(); - else - __led_toggle(led_commands[i].mask); - break; - case LED_BLINK: - if (argc != 4) - return CMD_RET_USAGE; - - freq = dectoul(argv[3], NULL); - __led_blink(led_commands[i].mask, freq); - } - /* Need to set only 1 led if led_name wasn't 'all' */ - if (strcmp("all", argv[1]) != 0) - break; - } - } - - /* If we ran out of matches, print Usage */ - if (!match) { - return CMD_RET_USAGE; - } - - return 0; -} - -U_BOOT_CMD( - led, 4, 1, do_legacy_led, - "[" -#ifdef CONFIG_LED_STATUS_GREEN - "green|" -#endif -#ifdef CONFIG_LED_STATUS_YELLOW - "yellow|" -#endif -#ifdef CONFIG_LED_STATUS_RED - "red|" -#endif -#ifdef CONFIG_LED_STATUS_BLUE - "blue|" -#endif - "all] [on|off|toggle|blink] [blink-freq in ms]", - "[led_name] [on|off|toggle|blink] sets or clears led(s)" -);

This is not used anymore, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org ---
drivers/misc/Makefile | 1 - drivers/misc/gpio_led.c | 106 ---------------------------------------- 2 files changed, 107 deletions(-) delete mode 100644 drivers/misc/gpio_led.c
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile index e53d52c47b3..c4941377b7d 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@ -49,7 +49,6 @@ obj-$(CONFIG_IHS_FPGA) += ihs_fpga.o obj-$(CONFIG_IMX8) += imx8/ obj-$(CONFIG_IMX_ELE) += imx_ele/ obj-$(CONFIG_LED_STATUS) += status_led.o -obj-$(CONFIG_LED_STATUS_GPIO) += gpio_led.o obj-$(CONFIG_MPC83XX_SERDES) += mpc83xx_serdes.o obj-$(CONFIG_$(SPL_TPL_)LS2_SFP) += ls2_sfp.o obj-$(CONFIG_$(SPL_)MXC_OCOTP) += mxc_ocotp.o diff --git a/drivers/misc/gpio_led.c b/drivers/misc/gpio_led.c deleted file mode 100644 index e63689967a7..00000000000 --- a/drivers/misc/gpio_led.c +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Status LED driver based on GPIO access conventions of Linux - * - * Copyright (C) 2010 Thomas Chou thomas@wytron.com.tw - * Licensed under the GPL-2 or later. - */ - -#include <status_led.h> -#include <asm/gpio.h> - -#ifndef CFG_GPIO_LED_INVERTED_TABLE -#define CFG_GPIO_LED_INVERTED_TABLE {} -#endif - -static led_id_t gpio_led_inv[] = CFG_GPIO_LED_INVERTED_TABLE; - -static int gpio_led_gpio_value(led_id_t mask, int state) -{ - int i, gpio_value = (state == CONFIG_LED_STATUS_ON); - - for (i = 0; i < ARRAY_SIZE(gpio_led_inv); i++) { - if (gpio_led_inv[i] == mask) - gpio_value = !gpio_value; - } - - return gpio_value; -} - -void __led_init(led_id_t mask, int state) -{ - int gpio_value; - - if (gpio_request(mask, "gpio_led") != 0) { - printf("%s: failed requesting GPIO%lu!\n", __func__, mask); - return; - } - - gpio_value = gpio_led_gpio_value(mask, state); - gpio_direction_output(mask, gpio_value); -} - -void __led_set(led_id_t mask, int state) -{ - int gpio_value = gpio_led_gpio_value(mask, state); - - gpio_set_value(mask, gpio_value); -} - -void __led_toggle(led_id_t mask) -{ - gpio_set_value(mask, !gpio_get_value(mask)); -} - -#ifdef CONFIG_GPIO_LED_STUBS - -/* 'generic' override of colored LED stubs, to use GPIO functions instead */ - -#ifdef CONFIG_LED_STATUS_RED -void red_led_on(void) -{ - __led_set(CONFIG_LED_STATUS_RED, CONFIG_LED_STATUS_ON); -} - -void red_led_off(void) -{ - __led_set(CONFIG_LED_STATUS_RED, CONFIG_LED_STATUS_OFF); -} -#endif - -#ifdef CONFIG_LED_STATUS_GREEN -void green_led_on(void) -{ - __led_set(CONFIG_LED_STATUS_GREEN, CONFIG_LED_STATUS_ON); -} - -void green_led_off(void) -{ - __led_set(CONFIG_LED_STATUS_GREEN, CONFIG_LED_STATUS_OFF); -} -#endif - -#ifdef CONFIG_LED_STATUS_YELLOW -void yellow_led_on(void) -{ - __led_set(CONFIG_LED_STATUS_YELLOW, CONFIG_LED_STATUS_ON); -} - -void yellow_led_off(void) -{ - __led_set(CONFIG_LED_STATUS_YELLOW, CONFIG_LED_STATUS_OFF); -} -#endif - -#ifdef CONFIG_LED_STATUS_BLUE -void blue_led_on(void) -{ - __led_set(CONFIG_LED_STATUS_BLUE, CONFIG_LED_STATUS_ON); -} - -void blue_led_off(void) -{ - __led_set(CONFIG_LED_STATUS_BLUE, CONFIG_LED_STATUS_OFF); -} -#endif - -#endif /* CONFIG_GPIO_LED_STUBS */

This driver is not used anymore. Drop it.
Signed-off-by: Simon Glass sjg@chromium.org ---
drivers/misc/Kconfig | 13 --- drivers/misc/Makefile | 1 - drivers/misc/pca9551_led.c | 170 ------------------------------------- 3 files changed, 184 deletions(-) delete mode 100644 drivers/misc/pca9551_led.c
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 6009d55f400..23eb509d974 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -446,19 +446,6 @@ config SPL_PWRSEQ device. When the device is started up, its power sequence can be initiated.
-config PCA9551_LED - bool "Enable PCA9551 LED driver" - help - Enable driver for PCA9551 LED controller. This controller - is connected via I2C. So I2C needs to be enabled. - -config PCA9551_I2C_ADDR - hex "I2C address of PCA9551 LED controller" - depends on PCA9551_LED - default 0x60 - help - The I2C address of the PCA9551 LED controller. - config STM32MP_FUSE bool "Enable STM32MP fuse wrapper providing the fuse API" depends on ARCH_STM32MP && MISC diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile index c4941377b7d..03d87ef8a0e 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@ -57,7 +57,6 @@ obj-$(CONFIG_NPCM_OTP) += npcm_otp.o obj-$(CONFIG_NPCM_HOST) += npcm_host_intf.o obj-$(CONFIG_NUVOTON_NCT6102D) += nuvoton_nct6102d.o obj-$(CONFIG_P2SB) += p2sb-uclass.o -obj-$(CONFIG_PCA9551_LED) += pca9551_led.o obj-$(CONFIG_$(SPL_)PWRSEQ) += pwrseq-uclass.o ifdef CONFIG_QFW obj-y += qfw.o diff --git a/drivers/misc/pca9551_led.c b/drivers/misc/pca9551_led.c deleted file mode 100644 index 040d0d5cf48..00000000000 --- a/drivers/misc/pca9551_led.c +++ /dev/null @@ -1,170 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * Copyright (C) 2015 Stefan Roese sr@denx.de - */ - -#include <errno.h> -#include <i2c.h> -#include <status_led.h> - -#ifndef CONFIG_PCA9551_I2C_ADDR -#error "CONFIG_PCA9551_I2C_ADDR not defined!" -#endif - -#define PCA9551_REG_INPUT 0x00 /* Input register (read only) */ -#define PCA9551_REG_PSC0 0x01 /* Frequency prescaler 0 */ -#define PCA9551_REG_PWM0 0x02 /* PWM0 */ -#define PCA9551_REG_PSC1 0x03 /* Frequency prescaler 1 */ -#define PCA9551_REG_PWM1 0x04 /* PWM1 */ -#define PCA9551_REG_LS0 0x05 /* LED0 to LED3 selector */ -#define PCA9551_REG_LS1 0x06 /* LED4 to LED7 selector */ - -#define PCA9551_CTRL_AI (1 << 4) /* Auto-increment flag */ - -#define PCA9551_LED_STATE_ON 0x00 -#define PCA9551_LED_STATE_OFF 0x01 -#define PCA9551_LED_STATE_BLINK0 0x02 -#define PCA9551_LED_STATE_BLINK1 0x03 - -struct pca9551_blink_rate { - u8 psc; /* Frequency preescaler, see PCA9551_7.pdf p. 6 */ - u8 pwm; /* Pulse width modulation, see PCA9551_7.pdf p. 6 */ -}; - -static int freq_last = -1; -static int mask_last = -1; -static int idx_last = -1; -static int mode_last; - -static int pca9551_led_get_state(int led, int *state) -{ - unsigned int reg; - u8 shift, buf; - int ret; - - if (led < 0 || led > 7) { - return -EINVAL; - } else if (led < 4) { - reg = PCA9551_REG_LS0; - shift = led << 1; - } else { - reg = PCA9551_REG_LS1; - shift = (led - 4) << 1; - } - - ret = i2c_read(CONFIG_PCA9551_I2C_ADDR, reg, 1, &buf, 1); - if (ret) - return ret; - - *state = (buf >> shift) & 0x03; - return 0; -} - -static int pca9551_led_set_state(int led, int state) -{ - unsigned int reg; - u8 shift, buf, mask; - int ret; - - if (led < 0 || led > 7) { - return -EINVAL; - } else if (led < 4) { - reg = PCA9551_REG_LS0; - shift = led << 1; - } else { - reg = PCA9551_REG_LS1; - shift = (led - 4) << 1; - } - mask = 0x03 << shift; - - ret = i2c_read(CONFIG_PCA9551_I2C_ADDR, reg, 1, &buf, 1); - if (ret) - return ret; - - buf = (buf & ~mask) | ((state & 0x03) << shift); - - ret = i2c_write(CONFIG_PCA9551_I2C_ADDR, reg, 1, &buf, 1); - if (ret) - return ret; - - return 0; -} - -static int pca9551_led_set_blink_rate(int idx, struct pca9551_blink_rate rate) -{ - unsigned int reg; - int ret; - - switch (idx) { - case 0: - reg = PCA9551_REG_PSC0; - break; - case 1: - reg = PCA9551_REG_PSC1; - break; - default: - return -EINVAL; - } - reg |= PCA9551_CTRL_AI; - - ret = i2c_write(CONFIG_PCA9551_I2C_ADDR, reg, 1, (u8 *)&rate, 2); - if (ret) - return ret; - - return 0; -} - -/* - * Functions referenced by cmd_led.c or status_led.c - */ -void __led_init(led_id_t id, int state) -{ -} - -void __led_set(led_id_t mask, int state) -{ - if (state == CONFIG_LED_STATUS_OFF) - pca9551_led_set_state(mask, PCA9551_LED_STATE_OFF); - else - pca9551_led_set_state(mask, PCA9551_LED_STATE_ON); -} - -void __led_toggle(led_id_t mask) -{ - int state = 0; - - pca9551_led_get_state(mask, &state); - pca9551_led_set_state(mask, !state); -} - -void __led_blink(led_id_t mask, int freq) -{ - struct pca9551_blink_rate rate; - int mode; - int idx; - - if ((freq == freq_last) || (mask == mask_last)) { - idx = idx_last; - mode = mode_last; - } else { - /* Toggle blink index */ - if (idx_last == 0) { - idx = 1; - mode = PCA9551_LED_STATE_BLINK1; - } else { - idx = 0; - mode = PCA9551_LED_STATE_BLINK0; - } - - idx_last = idx; - mode_last = mode; - } - freq_last = freq; - mask_last = mask; - - rate.psc = ((freq * 38) / 1000) - 1; - rate.pwm = 128; /* 50% duty cycle */ - - pca9551_led_set_blink_rate(idx, rate); - pca9551_led_set_state(mask, mode); -}

This driver is not used anymore. Drop it.
Signed-off-by: Simon Glass sjg@chromium.org ---
drivers/misc/Makefile | 1 - drivers/misc/status_led.c | 124 -------------------------------------- 2 files changed, 125 deletions(-) delete mode 100644 drivers/misc/status_led.c
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile index 03d87ef8a0e..cf6ece919bc 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@ -48,7 +48,6 @@ obj-$(CONFIG_$(SPL_)I2C_EEPROM) += i2c_eeprom.o obj-$(CONFIG_IHS_FPGA) += ihs_fpga.o obj-$(CONFIG_IMX8) += imx8/ obj-$(CONFIG_IMX_ELE) += imx_ele/ -obj-$(CONFIG_LED_STATUS) += status_led.o obj-$(CONFIG_MPC83XX_SERDES) += mpc83xx_serdes.o obj-$(CONFIG_$(SPL_TPL_)LS2_SFP) += ls2_sfp.o obj-$(CONFIG_$(SPL_)MXC_OCOTP) += mxc_ocotp.o diff --git a/drivers/misc/status_led.c b/drivers/misc/status_led.c deleted file mode 100644 index 3b1baa4f840..00000000000 --- a/drivers/misc/status_led.c +++ /dev/null @@ -1,124 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * (C) Copyright 2000-2003 - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. - */ - -#include <status_led.h> -#include <linux/types.h> - -/* - * The purpose of this code is to signal the operational status of a - * target which usually boots over the network; while running in - * U-Boot, a status LED is blinking. As soon as a valid BOOTP reply - * message has been received, the LED is turned off. The Linux - * kernel, once it is running, will start blinking the LED again, - * with another frequency. - */ - -/* ------------------------------------------------------------------------- */ - -typedef struct { - led_id_t mask; - int state; - int period; - int cnt; -} led_dev_t; - -led_dev_t led_dev[] = { - { CONFIG_LED_STATUS_BIT, - CONFIG_LED_STATUS_STATE, - LED_STATUS_PERIOD, - 0, - }, -#if defined(CONFIG_LED_STATUS1) - { CONFIG_LED_STATUS_BIT1, - CONFIG_LED_STATUS_STATE1, - LED_STATUS_PERIOD1, - 0, - }, -#endif -#if defined(CONFIG_LED_STATUS2) - { CONFIG_LED_STATUS_BIT2, - CONFIG_LED_STATUS_STATE2, - LED_STATUS_PERIOD2, - 0, - }, -#endif -#if defined(CONFIG_LED_STATUS3) - { CONFIG_LED_STATUS_BIT3, - CONFIG_LED_STATUS_STATE3, - LED_STATUS_PERIOD3, - 0, - }, -#endif -#if defined(CONFIG_LED_STATUS4) - { CONFIG_LED_STATUS_BIT4, - CONFIG_LED_STATUS_STATE4, - LED_STATUS_PERIOD4, - 0, - }, -#endif -#if defined(CONFIG_LED_STATUS5) - { CONFIG_LED_STATUS_BIT5, - CONFIG_LED_STATUS_STATE5, - LED_STATUS_PERIOD5, - 0, - }, -#endif -}; - -#define MAX_LED_DEV (sizeof(led_dev)/sizeof(led_dev_t)) - -static int status_led_init_done = 0; - -void status_led_init(void) -{ - led_dev_t *ld; - int i; - - for (i = 0, ld = led_dev; i < MAX_LED_DEV; i++, ld++) - __led_init (ld->mask, ld->state); - status_led_init_done = 1; -} - -void status_led_tick(ulong timestamp) -{ - led_dev_t *ld; - int i; - - if (!status_led_init_done) - status_led_init(); - - for (i = 0, ld = led_dev; i < MAX_LED_DEV; i++, ld++) { - - if (ld->state != CONFIG_LED_STATUS_BLINKING) - continue; - - if (++ld->cnt >= ld->period) { - __led_toggle (ld->mask); - ld->cnt -= ld->period; - } - - } -} - -void status_led_set(int led, int state) -{ - led_dev_t *ld; - - if (led < 0 || led >= MAX_LED_DEV) - return; - - if (!status_led_init_done) - status_led_init(); - - ld = &led_dev[led]; - - ld->state = state; - if (state == CONFIG_LED_STATUS_BLINKING) { - ld->cnt = 0; /* always start with full period */ - state = CONFIG_LED_STATUS_ON; /* always start with LED _ON_ */ - } - __led_set (ld->mask, state); -}

This header file is not used, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org ---
arch/m68k/lib/bootm.c | 3 --- 1 file changed, 3 deletions(-)
diff --git a/arch/m68k/lib/bootm.c b/arch/m68k/lib/bootm.c index 3dcff8076e3..1fa112f8dbf 100644 --- a/arch/m68k/lib/bootm.c +++ b/arch/m68k/lib/bootm.c @@ -15,9 +15,6 @@ #include <bzlib.h> #include <watchdog.h> #include <asm/byteorder.h> -#ifdef CONFIG_SHOW_BOOT_PROGRESS -# include <status_led.h> -#endif
DECLARE_GLOBAL_DATA_PTR;

Acked-by: Angelo Dureghello angelo@kernel-space.org
Thanks !
On 26/09/24 10:44 PM, Simon Glass wrote:
This header file is not used, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org
arch/m68k/lib/bootm.c | 3 --- 1 file changed, 3 deletions(-)
diff --git a/arch/m68k/lib/bootm.c b/arch/m68k/lib/bootm.c index 3dcff8076e3..1fa112f8dbf 100644 --- a/arch/m68k/lib/bootm.c +++ b/arch/m68k/lib/bootm.c @@ -15,9 +15,6 @@ #include <bzlib.h> #include <watchdog.h> #include <asm/byteorder.h> -#ifdef CONFIG_SHOW_BOOT_PROGRESS -# include <status_led.h> -#endif
DECLARE_GLOBAL_DATA_PTR;

This is not used anymore, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org ---
arch/powerpc/lib/interrupts.c | 6 ------ 1 file changed, 6 deletions(-)
diff --git a/arch/powerpc/lib/interrupts.c b/arch/powerpc/lib/interrupts.c index 46208ae4c71..a2e7101a9d1 100644 --- a/arch/powerpc/lib/interrupts.c +++ b/arch/powerpc/lib/interrupts.c @@ -11,9 +11,6 @@ #include <irq_func.h> #include <asm/processor.h> #include <watchdog.h> -#ifdef CONFIG_LED_STATUS -#include <status_led.h> -#endif #include <asm/ptrace.h>
#ifndef CONFIG_MPC83XX_TIMER @@ -83,9 +80,6 @@ void timer_interrupt(struct pt_regs *regs) schedule(); #endif /* CONFIG_WATCHDOG || CONFIG_HW_WATCHDOG */
-#ifdef CONFIG_LED_STATUS - status_led_tick(timestamp); -#endif /* CONFIG_LED_STATUS */ }
ulong get_timer (ulong base)

This is not used anymore, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org ---
board/BuS/eb_cpu5282/eb_cpu5282.c | 20 -------------------- include/configs/eb_cpu5282.h | 6 ------ 2 files changed, 26 deletions(-)
diff --git a/board/BuS/eb_cpu5282/eb_cpu5282.c b/board/BuS/eb_cpu5282/eb_cpu5282.c index c254da62bf4..cdd862c57d2 100644 --- a/board/BuS/eb_cpu5282/eb_cpu5282.c +++ b/board/BuS/eb_cpu5282/eb_cpu5282.c @@ -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 */ diff --git a/include/configs/eb_cpu5282.h b/include/configs/eb_cpu5282.h index 26e4ade34ee..a4d1338c8fa 100644 --- a/include/configs/eb_cpu5282.h +++ b/include/configs/eb_cpu5282.h @@ -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 *

This header file is not used, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org ---
board/isee/igep00x0/igep00x0.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/board/isee/igep00x0/igep00x0.c b/board/isee/igep00x0/igep00x0.c index a35a7cd3b1f..35bb8c55806 100644 --- a/board/isee/igep00x0/igep00x0.c +++ b/board/isee/igep00x0/igep00x0.c @@ -8,7 +8,6 @@ #include <init.h> #include <malloc.h> #include <net.h> -#include <status_led.h> #include <dm.h> #include <ns16550.h> #include <twl4030.h>

Simon Glass sjg@chromium.org writes:
Hello Simon,
This header file is not used, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org
Reviewed-by: Javier Martinez Canillas javierm@redhat.com

This is not used anymore, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org ---
board/olimex/mx23_olinuxino/mx23_olinuxino.c | 7 ------- 1 file changed, 7 deletions(-)
diff --git a/board/olimex/mx23_olinuxino/mx23_olinuxino.c b/board/olimex/mx23_olinuxino/mx23_olinuxino.c index b2bb6678c23..78136c1620a 100644 --- a/board/olimex/mx23_olinuxino/mx23_olinuxino.c +++ b/board/olimex/mx23_olinuxino/mx23_olinuxino.c @@ -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; }

On 9/26/24 10:44 PM, Simon Glass wrote:
This is not used anymore, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org
board/olimex/mx23_olinuxino/mx23_olinuxino.c | 7 ------- 1 file changed, 7 deletions(-)
diff --git a/board/olimex/mx23_olinuxino/mx23_olinuxino.c b/board/olimex/mx23_olinuxino/mx23_olinuxino.c index b2bb6678c23..78136c1620a 100644 --- a/board/olimex/mx23_olinuxino/mx23_olinuxino.c +++ b/board/olimex/mx23_olinuxino/mx23_olinuxino.c @@ -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
Why not define the GPIO LED in DT, it might even already be defined there.

Hi Marek,
On Thu, 26 Sept 2024 at 23:40, Marek Vasut marex@denx.de wrote:
On 9/26/24 10:44 PM, Simon Glass wrote:
This is not used anymore, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org
board/olimex/mx23_olinuxino/mx23_olinuxino.c | 7 ------- 1 file changed, 7 deletions(-)
diff --git a/board/olimex/mx23_olinuxino/mx23_olinuxino.c b/board/olimex/mx23_olinuxino/mx23_olinuxino.c index b2bb6678c23..78136c1620a 100644 --- a/board/olimex/mx23_olinuxino/mx23_olinuxino.c +++ b/board/olimex/mx23_olinuxino/mx23_olinuxino.c @@ -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
Why not define the GPIO LED in DT, it might even already be defined there.
Yes I see it in the DT for quite a few boards, so that's what we should use.
Regards, Simon

On 9/27/24 12:10 AM, Simon Glass wrote:
Hi Marek,
Hello Simon,
On Thu, 26 Sept 2024 at 23:40, Marek Vasut marex@denx.de wrote:
On 9/26/24 10:44 PM, Simon Glass wrote:
This is not used anymore, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org
board/olimex/mx23_olinuxino/mx23_olinuxino.c | 7 ------- 1 file changed, 7 deletions(-)
diff --git a/board/olimex/mx23_olinuxino/mx23_olinuxino.c b/board/olimex/mx23_olinuxino/mx23_olinuxino.c index b2bb6678c23..78136c1620a 100644 --- a/board/olimex/mx23_olinuxino/mx23_olinuxino.c +++ b/board/olimex/mx23_olinuxino/mx23_olinuxino.c @@ -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
Why not define the GPIO LED in DT, it might even already be defined there.
Yes I see it in the DT for quite a few boards, so that's what we should use.
Since LED uclass already uses well established DM_FLAG_PROBE_AFTER_BIND flag, the update here should be only a matter of enabling DM LED and GPIO LED driver.

Hi Marek,
On Fri, 27 Sept 2024 at 00:20, Marek Vasut marex@denx.de wrote:
On 9/27/24 12:10 AM, Simon Glass wrote:
Hi Marek,
Hello Simon,
On Thu, 26 Sept 2024 at 23:40, Marek Vasut marex@denx.de wrote:
On 9/26/24 10:44 PM, Simon Glass wrote:
This is not used anymore, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org
board/olimex/mx23_olinuxino/mx23_olinuxino.c | 7 ------- 1 file changed, 7 deletions(-)
diff --git a/board/olimex/mx23_olinuxino/mx23_olinuxino.c b/board/olimex/mx23_olinuxino/mx23_olinuxino.c index b2bb6678c23..78136c1620a 100644 --- a/board/olimex/mx23_olinuxino/mx23_olinuxino.c +++ b/board/olimex/mx23_olinuxino/mx23_olinuxino.c @@ -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
Why not define the GPIO LED in DT, it might even already be defined there.
Yes I see it in the DT for quite a few boards, so that's what we should use.
Since LED uclass already uses well established DM_FLAG_PROBE_AFTER_BIND flag, the update here should be only a matter of enabling DM LED and GPIO LED driver.
Yes, fair enough, but I hope you are not suggesting I try and do it?
I'm OK with that flag with LEDs. It is regulators where I get nervous.
Regards, Simon

On 9/27/24 12:43 PM, Simon Glass wrote:
Hi Marek,
Hi,
On Fri, 27 Sept 2024 at 00:20, Marek Vasut marex@denx.de wrote:
On 9/27/24 12:10 AM, Simon Glass wrote:
Hi Marek,
Hello Simon,
On Thu, 26 Sept 2024 at 23:40, Marek Vasut marex@denx.de wrote:
On 9/26/24 10:44 PM, Simon Glass wrote:
This is not used anymore, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org
board/olimex/mx23_olinuxino/mx23_olinuxino.c | 7 ------- 1 file changed, 7 deletions(-)
diff --git a/board/olimex/mx23_olinuxino/mx23_olinuxino.c b/board/olimex/mx23_olinuxino/mx23_olinuxino.c index b2bb6678c23..78136c1620a 100644 --- a/board/olimex/mx23_olinuxino/mx23_olinuxino.c +++ b/board/olimex/mx23_olinuxino/mx23_olinuxino.c @@ -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
Why not define the GPIO LED in DT, it might even already be defined there.
Yes I see it in the DT for quite a few boards, so that's what we should use.
Since LED uclass already uses well established DM_FLAG_PROBE_AFTER_BIND flag, the update here should be only a matter of enabling DM LED and GPIO LED driver.
Yes, fair enough, but I hope you are not suggesting I try and do it?
Turn on the Kconfig options , that's all I am asking .
I'm OK with that flag with LEDs. It is regulators where I get nervous.
OK

This is not used anymore, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org ---
board/softing/vining_fpga/socfpga.c | 4 ---- 1 file changed, 4 deletions(-)
diff --git a/board/softing/vining_fpga/socfpga.c b/board/softing/vining_fpga/socfpga.c index 2483fbcf263..50f2ca7ec61 100644 --- a/board/softing/vining_fpga/socfpga.c +++ b/board/softing/vining_fpga/socfpga.c @@ -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;

This is not used anymore, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org ---
board/sunxi/board.c | 6 ------ 1 file changed, 6 deletions(-)
diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 961cdcde74d..090a619386d 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -49,7 +49,6 @@ #include <spl.h> #include <sy8106a.h> #include <asm/setup.h> -#include <status_led.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -550,11 +549,6 @@ void sunxi_board_init(void) { int power_failed = 0;
-#ifdef CONFIG_LED_STATUS - if (IS_ENABLED(CONFIG_SPL_DRIVERS_MISC)) - status_led_init(); -#endif - #ifdef CONFIG_SY8106A_POWER power_failed = sy8106a_set_vout1(CONFIG_SY8106A_VOUT1_VOLT); #endif

This is not used anymore, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org ---
common/board_r.c | 16 ---------------- 1 file changed, 16 deletions(-)
diff --git a/common/board_r.c b/common/board_r.c index 4faaa202421..b207c04e4d4 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -51,7 +51,6 @@ #include <pvblock.h> #include <scsi.h> #include <serial.h> -#include <status_led.h> #include <stdio_dev.h> #include <timer.h> #include <trace.h> @@ -460,18 +459,6 @@ static int initr_malloc_bootparams(void) } #endif
-#if defined(CONFIG_LED_STATUS) -static int initr_status_led(void) -{ -#if defined(CONFIG_LED_STATUS_BOOT) - status_led_set(CONFIG_LED_STATUS_BOOT, CONFIG_LED_STATUS_BLINKING); -#else - status_led_init(); -#endif - return 0; -} -#endif - #ifdef CONFIG_CMD_NET static int initr_net(void) { @@ -724,9 +711,6 @@ static init_fnc_t init_sequence_r[] = { interrupt_init, #if defined(CONFIG_MICROBLAZE) || defined(CONFIG_M68K) timer_init, /* initialize timer */ -#endif -#if defined(CONFIG_LED_STATUS) - initr_status_led, #endif /* PPC has a udelay(20) here dating from 2002. Why? */ #ifdef CONFIG_BOARD_LATE_INIT

This header file is not used, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org ---
boot/image.c | 4 ---- 1 file changed, 4 deletions(-)
diff --git a/boot/image.c b/boot/image.c index abac254e026..7bed8ba4b1f 100644 --- a/boot/image.c +++ b/boot/image.c @@ -15,10 +15,6 @@ #include <malloc.h> #include <u-boot/crc.h>
-#ifdef CONFIG_SHOW_BOOT_PROGRESS -#include <status_led.h> -#endif - #if CONFIG_IS_ENABLED(FIT) || CONFIG_IS_ENABLED(OF_LIBFDT) #include <linux/libfdt.h> #include <fdt_support.h>

This header file is not used, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org ---
cmd/ide.c | 4 ---- 1 file changed, 4 deletions(-)
diff --git a/cmd/ide.c b/cmd/ide.c index 036489fda97..be3078ae88b 100644 --- a/cmd/ide.c +++ b/cmd/ide.c @@ -22,10 +22,6 @@ #include <ide.h> #include <ata.h>
-#ifdef CONFIG_LED_STATUS -# include <status_led.h> -#endif - /* Current I/O Device */ static int curr_device;

This is not used anymore, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org ---
drivers/timer/mpc83xx_timer.c | 5 ----- 1 file changed, 5 deletions(-)
diff --git a/drivers/timer/mpc83xx_timer.c b/drivers/timer/mpc83xx_timer.c index 9da74479aaa..aefc18898e9 100644 --- a/drivers/timer/mpc83xx_timer.c +++ b/drivers/timer/mpc83xx_timer.c @@ -9,7 +9,6 @@ #include <dm.h> #include <irq_func.h> #include <log.h> -#include <status_led.h> #include <sysinfo.h> #include <time.h> #include <timer.h> @@ -178,10 +177,6 @@ void timer_interrupt(struct pt_regs *regs) if (CFG_SYS_WATCHDOG_FREQ && (priv->timestamp % (CFG_SYS_WATCHDOG_FREQ)) == 0) schedule(); #endif /* CONFIG_WATCHDOG || CONFIG_HW_WATCHDOG */ - -#ifdef CONFIG_LED_STATUS - status_led_tick(priv->timestamp); -#endif /* CONFIG_LED_STATUS */ }
void wait_ticks(ulong ticks)

This is not used anymore, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org ---
net/bootp.c | 7 ------- net/net.c | 33 --------------------------------- 2 files changed, 40 deletions(-)
diff --git a/net/bootp.c b/net/bootp.c index 512ab2ed7c8..8a7806f3efc 100644 --- a/net/bootp.c +++ b/net/bootp.c @@ -19,9 +19,6 @@ #include <linux/delay.h> #include <net/tftp.h> #include "bootp.h" -#ifdef CONFIG_LED_STATUS -#include <status_led.h> -#endif #ifdef CONFIG_BOOTP_RANDOM_DELAY #include "net_rand.h" #endif @@ -370,10 +367,6 @@ static void bootp_handler(uchar *pkt, unsigned dest, struct in_addr sip, /* * Got a good BOOTP reply. Copy the data into our variables. */ -#if defined(CONFIG_LED_STATUS) && defined(CONFIG_LED_STATUS_BOOT_ENABLE) - status_led_set(CONFIG_LED_STATUS_BOOT, CONFIG_LED_STATUS_OFF); -#endif - store_net_params(bp); /* Store net parameters from reply */
/* Retrieve extended information (we must parse the vendor area) */ diff --git a/net/net.c b/net/net.c index 1e0b7c85624..fef214f2ebe 100644 --- a/net/net.c +++ b/net/net.c @@ -99,10 +99,6 @@ #include <net/pcap.h> #endif #include <net/udp.h> -#if defined(CONFIG_LED_STATUS) -#include <miiphy.h> -#include <status_led.h> -#endif #include <watchdog.h> #include <linux/compiler.h> #include <test/test.h> @@ -613,19 +609,6 @@ restart: break; }
-#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) -#if defined(CONFIG_SYS_FAULT_ECHO_LINK_DOWN) && \ - defined(CONFIG_LED_STATUS) && \ - defined(CONFIG_LED_STATUS_RED) - /* - * Echo the inverted link state to the fault LED. - */ - if (miiphy_link(eth_get_dev()->name, CONFIG_SYS_FAULT_MII_ADDR)) - status_led_set(CONFIG_LED_STATUS_RED, CONFIG_LED_STATUS_OFF); - else - status_led_set(CONFIG_LED_STATUS_RED, CONFIG_LED_STATUS_ON); -#endif /* CONFIG_SYS_FAULT_ECHO_LINK_DOWN, ... */ -#endif /* CONFIG_MII, ... */ #ifdef CONFIG_USB_KEYBOARD net_busy_flag = 1; #endif @@ -680,22 +663,6 @@ restart: ((get_timer(0) - time_start) > time_delta)) { thand_f *x;
-#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) -#if defined(CONFIG_SYS_FAULT_ECHO_LINK_DOWN) && \ - defined(CONFIG_LED_STATUS) && \ - defined(CONFIG_LED_STATUS_RED) - /* - * Echo the inverted link state to the fault LED. - */ - if (miiphy_link(eth_get_dev()->name, - CONFIG_SYS_FAULT_MII_ADDR)) - status_led_set(CONFIG_LED_STATUS_RED, - CONFIG_LED_STATUS_OFF); - else - status_led_set(CONFIG_LED_STATUS_RED, - CONFIG_LED_STATUS_ON); -#endif /* CONFIG_SYS_FAULT_ECHO_LINK_DOWN, ... */ -#endif /* CONFIG_MII, ... */ debug_cond(DEBUG_INT_STATE, "--- net_loop timeout\n"); x = time_handler; time_handler = (thand_f *)0;

This is not needed anymore. Drop it.
Signed-off-by: Simon Glass sjg@chromium.org ---
include/status_led.h | 91 -------------------------------------------- 1 file changed, 91 deletions(-) delete mode 100644 include/status_led.h
diff --git a/include/status_led.h b/include/status_led.h deleted file mode 100644 index 3d118af0d8b..00000000000 --- a/include/status_led.h +++ /dev/null @@ -1,91 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * (C) Copyright 2000-2004 - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. - */ - -/* - * The purpose of this code is to signal the operational status of a - * target which usually boots over the network; while running in - * PCBoot, a status LED is blinking. As soon as a valid BOOTP reply - * message has been received, the LED is turned off. The Linux - * kernel, once it is running, will start blinking the LED again, - * with another frequency. - */ - -#ifndef _STATUS_LED_H_ -#define _STATUS_LED_H_ - -#ifdef CONFIG_LED_STATUS - -#define LED_STATUS_PERIOD (CONFIG_SYS_HZ / CONFIG_LED_STATUS_FREQ) -#ifdef CONFIG_LED_STATUS1 -#define LED_STATUS_PERIOD1 (CONFIG_SYS_HZ / CONFIG_LED_STATUS_FREQ1) -#endif /* CONFIG_LED_STATUS1 */ -#ifdef CONFIG_LED_STATUS2 -#define LED_STATUS_PERIOD2 (CONFIG_SYS_HZ / CONFIG_LED_STATUS_FREQ2) -#endif /* CONFIG_LED_STATUS2 */ -#ifdef CONFIG_LED_STATUS3 -#define LED_STATUS_PERIOD3 (CONFIG_SYS_HZ / CONFIG_LED_STATUS_FREQ3) -#endif /* CONFIG_LED_STATUS3 */ -#ifdef CONFIG_LED_STATUS4 -#define LED_STATUS_PERIOD4 (CONFIG_SYS_HZ / CONFIG_LED_STATUS_FREQ4) -#endif /* CONFIG_LED_STATUS4 */ -#ifdef CONFIG_LED_STATUS5 -#define LED_STATUS_PERIOD5 (CONFIG_SYS_HZ / CONFIG_LED_STATUS_FREQ5) -#endif /* CONFIG_LED_STATUS5 */ - -void status_led_init(void); -void status_led_tick(unsigned long timestamp); -void status_led_set(int led, int state); - -/***** MVS v1 **********************************************************/ -#if (defined(CONFIG_MVS) && CONFIG_MVS < 2) -# define STATUS_LED_PAR im_ioport.iop_pdpar -# define STATUS_LED_DIR im_ioport.iop_pddir -# undef STATUS_LED_ODR -# define STATUS_LED_DAT im_ioport.iop_pddat - -# define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ - -/***** Someone else defines these *************************************/ -#elif defined(STATUS_LED_PAR) - /* - * ADVICE: Define in your board configuration file rather than - * filling this file up with lots of custom board stuff. - */ -#else -# error Status LED configuration missing -#endif -/************************************************************************/ - -#include <asm/status_led.h> - -#endif /* CONFIG_LED_STATUS */ - -/* - * Coloured LEDs API - */ -#ifndef __ASSEMBLY__ -void coloured_LED_init(void); -void red_led_on(void); -void red_led_off(void); -void green_led_on(void); -void green_led_off(void); -void yellow_led_on(void); -void yellow_led_off(void); -void blue_led_on(void); -void blue_led_off(void); -#else - .extern LED_init - .extern red_led_on - .extern red_led_off - .extern yellow_led_on - .extern yellow_led_off - .extern green_led_on - .extern green_led_off - .extern blue_led_on - .extern blue_led_off -#endif - -#endif /* _STATUS_LED_H_ */
participants (4)
-
Angelo Dureghello
-
Javier Martinez Canillas
-
Marek Vasut
-
Simon Glass