From patchwork Tue Mar 31 16:04:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 244654 List-Id: U-Boot discussion From: patrick.delaunay at st.com (Patrick Delaunay) Date: Tue, 31 Mar 2020 18:04:25 +0200 Subject: [PATCH 08/16] board: stm32mp1: update management of boot-led In-Reply-To: <20200331180330.1.Ied6708bad5048382a57618f95d67c549aae49f42@changeid> References: <20200331180330.1.Ied6708bad5048382a57618f95d67c549aae49f42@changeid> Message-ID: <20200331180330.8.I15cb0a6245fb4cd5d23371683c2697f794adf306@changeid> Force boot-led ON and no more rely on default-state. This patch avoid device-tree modification for U-Boot. Signed-off-by: Patrick Delaunay --- arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi | 4 ---- arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi | 4 ---- board/st/stm32mp1/stm32mp1.c | 10 ++++++++-- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi b/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi index 5844d41c53..c52abeb1e7 100644 --- a/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi @@ -27,10 +27,6 @@ default-state = "off"; status = "okay"; }; - - blue { - default-state = "on"; - }; }; }; diff --git a/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi b/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi index ed2f024be9..84af7fa47b 100644 --- a/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi @@ -28,10 +28,6 @@ default-state = "off"; status = "okay"; }; - - blue { - default-state = "on"; - }; }; }; diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c index 8ed09ae24a..6ca47509b3 100644 --- a/board/st/stm32mp1/stm32mp1.c +++ b/board/st/stm32mp1/stm32mp1.c @@ -280,9 +280,11 @@ static int get_led(struct udevice **dev, char *led_string) return 0; } +#endif static int setup_led(enum led_state_t cmd) { +#ifdef CONFIG_LED struct udevice *dev; int ret; @@ -292,8 +294,10 @@ static int setup_led(enum led_state_t cmd) ret = led_set_state(dev, cmd); return ret; -} +#else + return 0; #endif +} static void __maybe_unused led_error_blink(u32 nb_blink) { @@ -648,8 +652,10 @@ int board_init(void) sysconf_init(); - if (CONFIG_IS_ENABLED(CONFIG_LED)) + if (CONFIG_IS_ENABLED(CONFIG_LED)) { led_default_state(); + setup_led(LEDST_ON); + } return 0; }