public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Nicolas Boulenguez <nicolas@debian.org>
To: u-boot@lists.denx.de
Subject: [PATCH 20/20] Enable led on boot to notify user of boot status
Date: Sat, 20 Feb 2021 13:14:13 +0100	[thread overview]
Message-ID: <20210220121416.15215-2-nicolas@debian.org> (raw)
In-Reply-To: <20210220121416.15215-1-nicolas@debian.org>

From: Marius Gripsgard <marius@ubports.com>

---
 arch/arm/mach-sunxi/Kconfig | 5 +++++
 board/sunxi/board.c         | 4 ++--
 configs/pinephone_defconfig | 1 +
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index 8421f3b685..2bfdf7738b 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -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
 
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index abd7e390b2..a117b89ba2 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -637,6 +638,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
diff --git a/configs/pinephone_defconfig b/configs/pinephone_defconfig
index ff5da42ce0..9de6ab2316 100644
--- a/configs/pinephone_defconfig
+++ b/configs/pinephone_defconfig
@@ -1,6 +21,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_SUNXI=y
 CONFIG_SPL=y
+CONFIG_PINEPHONE_LEDS=y
 CONFIG_MACH_SUN50I=y
 CONFIG_SUNXI_DRAM_LPDDR3_STOCK=y
 CONFIG_DRAM_CLK=552
-- 
2.26.2

  reply	other threads:[~2021-02-20 12:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-20 12:14 [PATCH 2/4] pinephone_defconfig: reduce boot delay Nicolas Boulenguez
2021-02-20 12:14 ` Nicolas Boulenguez [this message]
2021-02-25 15:15   ` [PATCH 20/20] Enable led on boot to notify user of boot status André Przywara
2021-02-25 17:19     ` Peter Robinson
2021-02-20 12:14 ` [PATCH] sunxi: support asymmetric dual rank DRAM on A64/R40 Nicolas Boulenguez
2021-02-25 17:08   ` André Przywara
2021-02-20 12:14 ` [PATCH] sunxi-common: support loading compressed kernel images on ARMv8 Nicolas Boulenguez
2021-02-25 15:20   ` André Przywara
2021-03-31 15:39   ` Andre Przywara
2021-04-17 17:47     ` Samuel Holland
2021-04-17 18:23       ` Andre Przywara
2021-04-18  7:21         ` Samuel Holland
2021-06-03 10:10         ` Arnaud Ferraris
2021-02-20 12:14 ` [PATCH] arm: dts: sun50i-a64-pinephone: fix random wifi mac address Nicolas Boulenguez
2021-02-25 14:34   ` André Przywara
2021-02-25 17:02 ` [PATCH 2/4] pinephone_defconfig: reduce boot delay André Przywara
2021-02-25 20:58   ` Maxime Ripard
2021-02-28 15:22     ` Andre Przywara
2021-03-01 10:53       ` Nicolas Boulenguez
2021-03-13 14:56     ` Arnaud Ferraris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210220121416.15215-2-nicolas@debian.org \
    --to=nicolas@debian.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox