led: remove support for red LED in legacy API

To the exception of red_led_on in the arm-specific assembly code, all
code interacting with the red status LED was guarded by the
CONFIG_LED_STATUS_RED symbol, which is enabled in none of the upstream
defconfigs.

Since the last board which overrode the weak red_led_on function got
migrated to the new LED mechanism, there's also no user of the
arm-specific assembly code anymore, therefore it can be removed along
the other unreachable code sections.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Heiko Schocher <hs@nabladev.com>
This commit is contained in:
Quentin Schulz
2025-11-19 18:01:15 +01:00
committed by Tom Rini
parent b06e52f2ea
commit c4594242aa
7 changed files with 0 additions and 83 deletions

View File

@@ -183,9 +183,6 @@ here:
movne r9, r0
# endif
#if ! defined(CONFIG_XPL_BUILD)
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 */

View File

@@ -44,9 +44,6 @@ static const led_tbl_t led_commands[] = {
#ifdef CONFIG_LED_STATUS5
{ "5", CONFIG_LED_STATUS_BIT5, NULL, NULL, NULL },
#endif
#endif
#ifdef CONFIG_LED_STATUS_RED
{ "red", CONFIG_LED_STATUS_RED, red_led_off, red_led_on, NULL },
#endif
{ NULL, 0, NULL, NULL, NULL }
};
@@ -158,9 +155,6 @@ U_BOOT_CMD(
#ifdef CONFIG_LED_STATUS5
"5|"
#endif
#endif
#ifdef CONFIG_LED_STATUS_RED
"red|"
#endif
"all] [on|off|toggle|blink] [blink-freq in ms]",
"[led_name] [on|off|toggle|blink] sets or clears led(s)"

View File

@@ -54,20 +54,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 red_led_on(void) {}
__weak void red_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?

View File

@@ -57,9 +57,6 @@ 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).
General LED functions
~~~~~~~~~~~~~~~~~~~~~
The following functions should be defined:
@@ -71,19 +68,6 @@ __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.
- red_LED_on
- red_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

View File

@@ -400,20 +400,6 @@ config LED_STATUS_BOOT
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_CMD
bool "Enable status LED commands"

View File

@@ -50,21 +50,3 @@ 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
#endif /* CONFIG_GPIO_LED_STUBS */

View File

@@ -65,16 +65,4 @@ static inline void status_led_set(int led, int state) { }
static inline void status_led_boot_blink(void) { }
#endif /* CONFIG_LED_STATUS */
/*
* Coloured LEDs API
*/
#ifndef __ASSEMBLY__
void red_led_on(void);
void red_led_off(void);
#else
.extern red_led_on
.extern red_led_off
#endif
#endif /* _STATUS_LED_H_ */