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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 3B207C43334 for ; Mon, 18 Jul 2022 08:35:05 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3EDEA83FF5; Mon, 18 Jul 2022 10:35:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=tinet.cat 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 3CBBA84012; Mon, 18 Jul 2022 10:35:01 +0200 (CEST) Received: from mx1.tinet.cat (mx1.tinet.org [195.77.216.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BBE8283F97 for ; Mon, 18 Jul 2022 10:34:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=tinet.cat Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xdrudis@tinet.cat X-ASG-Debug-ID: 1658133296-163e7b70c575d010001-4l7tJC Received: from smtp01.tinet.cat (smtp.tinet.cat [195.77.216.131]) by mx1.tinet.cat with ESMTP id rkAVZeFOFU2Dhpwh; Mon, 18 Jul 2022 10:34:56 +0200 (CEST) X-Barracuda-Envelope-From: xdrudis@tinet.cat X-Barracuda-Effective-Source-IP: smtp.tinet.cat[195.77.216.131] X-Barracuda-Apparent-Source-IP: 195.77.216.131 Received: from begut (99.red-79-152-185.dynamicip.rima-tde.net [79.152.185.99]) by smtp01.tinet.cat (Postfix) with ESMTPSA id 1C806605E0C4; Mon, 18 Jul 2022 10:34:56 +0200 (CEST) Date: Mon, 18 Jul 2022 10:34:54 +0200 From: Xavier Drudis Ferran To: Quentin Schulz Cc: sjg@chromium.org, philipp.tomsich@vrull.eu, kever.yang@rock-chips.com, alpernebiyasak@gmail.com, email2tema@gmail.com, u-boot@lists.denx.de, Quentin Schulz Subject: Re: [SPAM] [RFC PATCH 1/2] spl: enable regulator-boot-on and disable regulator-force-boot-off Message-ID: <20220718083454.GB1824@begut> X-ASG-Orig-Subj: Re: [SPAM] [RFC PATCH 1/2] spl: enable regulator-boot-on and disable regulator-force-boot-off References: <20220715151426.953412-1-foss+uboot@0leil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220715151426.953412-1-foss+uboot@0leil.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-Barracuda-Connect: smtp.tinet.cat[195.77.216.131] X-Barracuda-Start-Time: 1658133296 X-Barracuda-URL: https://webmail.tinet.cat:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 2227 X-Barracuda-BRTS-Status: 1 X-Barracuda-Bayes: INNOCENT GLOBAL 0.8419 1.0000 2.6266 X-Barracuda-Spam-Score: 3.13 X-Barracuda-Spam-Status: No, SCORE=3.13 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=6.0 KILL_LEVEL=8.0 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.99458 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean Hello, and thanks for you work El Fri, Jul 15, 2022 at 05:14:25PM +0200, Quentin Schulz deia: > From: Quentin Schulz > > This makes sure regulators that need to be turned on or off at boot are > turned on or off in the SPL. > > This may be required for the SPL to do some operations, such as finding > possible loading media for U-Boot proper. > > Cc: Quentin Schulz > Signed-off-by: Quentin Schulz > --- > > - RFC because only tested on Puma Haikou RK3399 > > common/spl/spl.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/common/spl/spl.c b/common/spl/spl.c > index c8c463f80b..762e9918c7 100644 > --- a/common/spl/spl.c > +++ b/common/spl/spl.c > @@ -37,6 +37,9 @@ > #include > #include > #include > +#if CONFIG_IS_ENABLED(DM_REGULATOR) > +#include > +#endif > Can we remove the #if ? Otherwise I get 2 compilation warnings in tpl, because I miss the dummy regulators_enable_boot_on (and _off) in include/power/regulator.h When compiling tpl for Rock-pi-4 I have CONFIG_DM_REGULATOR=y, but not CONFIG_TPL_DM_REGULATOR or CONFIG_SPL_DM_REGULATOR. > DECLARE_GLOBAL_DATA_PTR; > > @@ -766,6 +769,15 @@ void board_init_r(gd_t *dummy1, ulong dummy2) > if (CONFIG_IS_ENABLED(GPIO_HOG)) > gpio_hog_probe_all(); > > + if (CONFIG_IS_ENABLED(DM_REGULATOR)) { > + if (regulators_enable_boot_on(false)) > + debug("%s: Cannot enable boot on regulator\n", > + __func__); > + if (regulators_enable_boot_off(false)) > + debug("%s: Cannot enable boot off regulator\n", > + __func__); > + } > + This still introduces a warning for me. warning: implicit declaration of function 'regulators_enable_boot_off' So maybe the dummy function must be added to include/power/regulator.h commit 16cc5ad0b439 ("power: regulator: add dummy helper") introduced the dummy regulators_enable_boot_on but missed the regulators_enable_boot_off. Alternatively one could replace the if with an #if, but I think that'd be against U-Boot policy.