mirror of
https://xff.cz/git/u-boot/
synced 2025-09-03 17:52:07 +02:00
sunxi: pinephone: Add support for optional LED feedback during boot
Signed-off-by: Ondrej Jirman <megous@megous.com>
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
if ARCH_SUNXI
|
||||
|
||||
config PINEPHONE_LEDS
|
||||
bool "Notify boot status via LEDs on PinePhone"
|
||||
---help---
|
||||
LED boot notification.
|
||||
|
||||
config SPL_LDSCRIPT
|
||||
default "arch/arm/cpu/armv7/sunxi/u-boot-spl.lds" if !ARM64
|
||||
|
||||
|
@@ -653,6 +653,12 @@ void sunxi_board_init(void)
|
||||
{
|
||||
int power_failed = 0;
|
||||
|
||||
#ifdef CONFIG_PINEPHONE_LEDS
|
||||
/* PD18:G PD19:R PD20:B */
|
||||
gpio_request(SUNXI_GPD(18), "led:green");
|
||||
gpio_direction_output(SUNXI_GPD(18), 1);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SY8106A_POWER
|
||||
power_failed = sy8106a_set_vout1(CONFIG_SY8106A_VOUT1_VOLT);
|
||||
#endif
|
||||
@@ -994,6 +1000,15 @@ int ft_board_setup(void *blob, struct bd_info *bd)
|
||||
if (r)
|
||||
return r;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PINEPHONE_LEDS
|
||||
gpio_request(SUNXI_GPD(18), "led:green");
|
||||
gpio_direction_output(SUNXI_GPD(18), 0);
|
||||
|
||||
gpio_request(SUNXI_GPD(19), "led:blue");
|
||||
gpio_direction_output(SUNXI_GPD(19), 1);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user