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 C1760EB64D9 for ; Tue, 4 Jul 2023 08:19:07 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C00A7847A2; Tue, 4 Jul 2023 10:19:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1688458745; bh=m4a6ZGzpl0WpjoKiacnA9YZxPSo9zDVd9yfb+isqfRY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Zyjclp/bmYKFDsmHt1nBbIFDXSx0OcdenAwoLa/hOprVdvnOp9ZPCiLiIxIcULc4n Z35N8Uw7fSA1M9F/J7CDi2ZQV5e2YDc2tscqAKFAmZDlbNxVyae0QWsXhNgB/CQ9oH Sjc3nit7b1vCwfv1CK55a2IItESHEPDTuVQI1GuePYORanURyQWn8Qu1DqJ2brG3XZ iEPvewnwazK0zA0eihiH98RuINfbgNEfQ/cnuzpGl9nbrgje8+geRyAzPZfa5XipFz 6obqpOGtrkDcaLMiD5fYYuPlwBsUNWJCSdA1FPHRIEx8Vy1ZVZ2y+y4ZvgL7tm3QTx ZYXIguR5+Nq0g== Received: from wsk (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 202628478D; Tue, 4 Jul 2023 10:19:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1688458744; bh=m4a6ZGzpl0WpjoKiacnA9YZxPSo9zDVd9yfb+isqfRY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=g3klX+Nkk/bnjKhm9o8edtVsvT0R/Jits2GpvkWeqaXMz2Nwv9kVlcCNO++v2jfwX Kg+bDejivbujVOdJXL/G21C8JuWLPcoLA/nWiIQAO1rJYk9uElNxn4tWZacJvM64CF Zbf08KnKwew9FUFk/vsSQif5KpSeVVSKRiZnMm+Gpny+MA3Ab8hwwuQcsZRb7XDUKz hPVXyEHoCWUGsEjwe+SkeEGFmg4qP6mw1qM5fY/JJF4Qv6qunilOTZAackcIRFHS3F PSPISzwAQsCTeFY0Y8Dm1rlye3GFO6vxAxjm8WF82BflN2A7x8ihT6ZC2qMgkda0Zj bVYoxxj/DoS8g== Date: Tue, 4 Jul 2023 10:18:57 +0200 From: Lukasz Majewski To: Marek Vasut , Cody Green Cc: u-boot@lists.denx.de, Stefano Babic , Fabio Estevam Subject: Re: [PATCH 2/2] mxs: Don't enable 4P2 reg if MXS is powered only from DCDC_BATT Message-ID: <20230704101857.7ca296c7@wsk> In-Reply-To: References: <20230703163340.101490-2-cody@londelec.com> Organization: denx.de X-Mailer: Claws Mail 3.19.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/Y=jwM0MlKaojlZUEh/e.BRH"; protocol="application/pgp-signature"; micalg=pgp-sha512 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.8 at phobos.denx.de X-Virus-Status: Clean --Sig_/Y=jwM0MlKaojlZUEh/e.BRH Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Marek, Cody, > On 7/3/23 18:33, Cody Green wrote: > > 'mxs_power_enable_4p2()' function call was added to > > 'mxs_batt_boot()' in 'commit a0f97610757d' to enable DCDC converter > > when board is powered from 5V and has detected sufficient battery > > voltage. This involves enabling 4P2 regulator and there is a code > > in 'mxs_power_enable_4p2()' that disables VDDIO, VDDA, VDDD outputs > > of the DCDC converter and enables BO for each power rail: > >=20 > > setbits_le32(&power_regs->hw_power_vddioctrl, > > POWER_VDDIOCTRL_DISABLE_FET | POWER_VDDIOCTRL_PWDN_BRNOUT); > >=20 > > There is no issue if the MXS is powered from the 5V source and > > linear regulators are supplying power to the VDDIO, VDDA, VDDD > > rails. However, if the MXS is powered only from the DCDC_BATT > > without 5V, disabling the DCDC converter outputs causes VDDIO, > > VDDA, VDDD rails to lose power. I think that I've also hit the same issue with the XEA board (upstreamed). I've prepared a set of patches: https://patchwork.ozlabs.org/project/uboot/patch/20230509143243.1523791-5-l= ukma@denx.de/ to fix this problem. Those patches are now for some time on the mailing list for review - and I do hope that Stefano will pull them with next PR for u-boot-imx repository. > >=20 > > The proposed solution is not to call the 'mxs_power_enable_4p2()' > > function if the MXS is powered only by the DCDC_BATT, because there > > is no reason to enable 4P2 regulator in this case. I think this patch: https://patchwork.ozlabs.org/project/uboot/patch/20230509143243.1523791-3-l= ukma@denx.de/ address exactly this issue. > > Also 5V brownout > > should not be enabled in 'mxs_power_init()' and linear regulator > > checks should be disabled in 'mxs_power_set_vddx()'. > >=20 I've also added some code to limit the VDD5V current when we intend to use DCDC_BATT input as the _primary_ source of power (AN4199 advises this one for industrial applications as the most reliable). > > Signed-off-by: Cody Green > > Cc: Stefano Babic > > Cc: Marek Vasut > > Cc: Fabio Estevam > > --- > > arch/arm/cpu/arm926ejs/mxs/spl_power_init.c | 7 +++++++ > > 1 file changed, 7 insertions(+) > >=20 > > diff --git a/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c > > b/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c index > > 33b76533e4..72172705f2 100644 --- > > a/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c +++ > > b/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c @@ -752,7 +752,9 @@ > > static void mxs_batt_boot(void) POWER_5VCTRL_CHARGE_4P2_ILIMIT_MASK, > > 0x8 << POWER_5VCTRL_CHARGE_4P2_ILIMIT_OFFSET); > > =20 > > +#ifndef CFG_SPL_MXS_NO_VDD5V_SOURCE > > mxs_power_enable_4p2(); > > +#endif > > } > > =20 > > /** > > @@ -1137,8 +1139,11 @@ static void mxs_power_set_vddx(const struct > > mxs_vddx_cfg *cfg, cur_target +=3D cfg->lowest_mV; > > =20 > > adjust_up =3D new_target > cur_target; > > + > > +#ifndef CFG_SPL_MXS_NO_VDD5V_SOURCE > > if (cfg->powered_by_linreg) > > powered_by_linreg =3D cfg->powered_by_linreg(); > > +#endif > > =20 > > if (adjust_up && cfg->bo_irq) { > > if (powered_by_linreg) { > > @@ -1269,7 +1274,9 @@ void mxs_power_init(void) > > POWER_CTRL_VBUS_VALID_IRQ | > > POWER_CTRL_BATT_BO_IRQ | POWER_CTRL_DCDC4P2_BO_IRQ, > > &power_regs->hw_power_ctrl_clr);=20 > > +#ifndef CFG_SPL_MXS_NO_VDD5V_SOURCE > > writel(POWER_5VCTRL_PWDN_5VBRNOUT, > > &power_regs->hw_power_5vctrl_set); +#endif > > =20 > > early_delay(1000); > > } =20 >=20 > +CC Lukasz Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de --Sig_/Y=jwM0MlKaojlZUEh/e.BRH Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEgAyFJ+N6uu6+XupJAR8vZIA0zr0FAmSj1fEACgkQAR8vZIA0 zr26uggAns4htCS3u9pl8qfCuY44nvjon+zaQAfE5XZCTDIfk6fbCLZk9pRDeGP5 p89MmHly1Z2zCS3VQmFng2fqknQSvQJd3c/kR1Hr8Qol1xYhq/nlkYglPEKfCgS5 yw6i9JyIh4gFyfhjDxCG/MjGkCNv9JbtLQRvB4PkXG7S2aYLwZQwoVj2NvxaqRnw q9UYN8n/4G9YLfCXKHK7G9L1Y9jD5RlEgFuOqlxQAu1Sx97PihIutd8cHVupB7tq 4VVmwQR30NbdfNFeUtVvOUdSRmK/d/8F50jSg5TvDTbRSnY0inubQy+eIYghmcw2 dajCZg4c0uwqZV17dGNvyFYKNBHjbw== =ZVqZ -----END PGP SIGNATURE----- --Sig_/Y=jwM0MlKaojlZUEh/e.BRH--