From patchwork Wed Apr 22 10:37:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Ferraris X-Patchwork-Id: 238273 List-Id: U-Boot discussion From: arnaud.ferraris at collabora.com (Arnaud Ferraris) Date: Wed, 22 Apr 2020 12:37:47 +0200 Subject: [PATCH] board: sunxi: enable status LED in SPL Message-ID: <20200422103747.86524-1-arnaud.ferraris@collabora.com> For some systems, such as the PinePhone, there is no way for the end user to make sure the system is indeed booting before the boot script is executed, which takes several seconds. Therefore, it can be useful to provide early visual feedback as soon as possible. In order achieve this goal, this patch initializes the status LED (if configured) in the SPL. Signed-off-by: Arnaud Ferraris --- board/sunxi/board.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 6afea6ef42..e0424a56ba 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -40,6 +40,9 @@ #include #include #include +#ifdef CONFIG_LED_STATUS +#include +#endif #if defined CONFIG_VIDEO_LCD_PANEL_I2C && !(defined CONFIG_SPL_BUILD) /* So that we can use pin names in Kconfig and sunxi_name_to_gpio() */ @@ -610,6 +613,10 @@ void sunxi_board_init(void) { int power_failed = 0; +#ifdef CONFIG_LED_STATUS + status_led_init(); +#endif + #ifdef CONFIG_SY8106A_POWER power_failed = sy8106a_set_vout1(CONFIG_SY8106A_VOUT1_VOLT); #endif