From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C384DC433F5 for ; Mon, 6 Sep 2021 23:47:17 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C643B601FF for ; Mon, 6 Sep 2021 23:47:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C643B601FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E5B6083251; Tue, 7 Sep 2021 01:47:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id BFF1C83244; Tue, 7 Sep 2021 01:47:07 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 927C083200 for ; Tue, 7 Sep 2021 01:47:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andre.przywara@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E992C31B; Mon, 6 Sep 2021 16:47:00 -0700 (PDT) Received: from slackpad.fritz.box (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0588F3F766; Mon, 6 Sep 2021 16:46:59 -0700 (PDT) Date: Tue, 7 Sep 2021 00:46:44 +0100 From: Andre Przywara To: Arnaud Ferraris Cc: u-boot@lists.denx.de, Jagan Teki , Samuel Holland , Maxime Ripard Subject: Re: [PATCH 1/2] board: sunxi: enable status LED early Message-ID: <20210907004644.290710e8@slackpad.fritz.box> In-Reply-To: <20210906205753.176175-2-arnaud.ferraris@collabora.com> References: <20210906205753.176175-1-arnaud.ferraris@collabora.com> <20210906205753.176175-2-arnaud.ferraris@collabora.com> Organization: Arm Ltd. X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.31; x86_64-slackware-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On Mon, 6 Sep 2021 22:57:52 +0200 Arnaud Ferraris wrote: Hi Arnaud, > 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. Thanks for sending this, it looks much better than the previous attempt on the list from earlier this year. > 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 1a46100e40..6e0bf5fbf9 100644 > --- a/board/sunxi/board.c > +++ b/board/sunxi/board.c > @@ -46,6 +46,9 @@ > #include > #include > #include > +#if defined(CONFIG_LED_STATUS) && defined(CONFIG_SPL_DRIVERS_MISC) > +#include status_led.h already guards for CONFIG_LED_STATUS, so you can just unconditionally include this here, no #ifdefs needed. > +#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() */ > @@ -672,6 +675,10 @@ void sunxi_board_init(void) > { > int power_failed = 0; > > +#if defined(CONFIG_LED_STATUS) && defined(CONFIG_SPL_DRIVERS_MISC) Unfortunately status_led.h doesn't define a dummy prototype for this, so we need the #ifdef CONFIG_LED_STATUS. But I don't think you need CONFIG_SPL_DRIVERS_MISC here. If that should only trigger in the SPL, use: if (IS_ENABLED(CONFIG_SPL_BUILD)) status_led_init(); Cheers, Andre > + status_led_init(); > +#endif > + > #ifdef CONFIG_SY8106A_POWER > power_failed = sy8106a_set_vout1(CONFIG_SY8106A_VOUT1_VOLT); > #endif