1
0
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:
Ondrej Jirman
2020-01-13 17:23:21 +01:00
parent 65b5b4f2f8
commit be05d9d95b
2 changed files with 20 additions and 0 deletions

View File

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

View File

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