diff mbox series

board: sunxi: enable status LED in SPL

Message ID 20200422103747.86524-1-arnaud.ferraris@collabora.com
State New
Headers show
Series board: sunxi: enable status LED in SPL | expand

Commit Message

Arnaud Ferraris April 22, 2020, 10:37 a.m. UTC
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 <arnaud.ferraris at collabora.com>
---

 board/sunxi/board.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Jagan Teki May 1, 2020, 4:43 p.m. UTC | #1
On Wed, Apr 22, 2020 at 4:07 PM Arnaud Ferraris
<arnaud.ferraris at collabora.com> wrote:
>
> 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.

Don't you have a splash screen on this device, so that users have a
visibility? generally consumer devices do have.

Jagan.
Arnaud Ferraris May 6, 2020, 11:06 a.m. UTC | #2
Hi Jagan,

Le 01/05/2020 ? 18:43, Jagan Teki a ?crit?:
> On Wed, Apr 22, 2020 at 4:07 PM Arnaud Ferraris
> <arnaud.ferraris at collabora.com> wrote:
>>
>> 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.
> 
> Don't you have a splash screen on this device, so that users have a
> visibility? generally consumer devices do have.

Actually, I would hit the same problem (late visual feedback) with a
splash screen: we would need to wait for u-boot to be fully loaded,
which takes too much time.
(plus, the DE2 video driver only supports HDMI out for now, and I don't
have the skills to add MIPI-DSI support)

Having the status LED set up in the SPL allows almost-instant visual
feedback, which is what I'm looking for here.

Regards,
Arnaud
diff mbox series

Patch

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 <spl.h>
 #include <sy8106a.h>
 #include <asm/setup.h>
+#ifdef CONFIG_LED_STATUS
+#include <status_led.h>
+#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