From: Lukasz Majewski <lukma@denx.de>
To: Marek Vasut <marex@denx.de>, Cody Green <cody@londelec.com>
Cc: u-boot@lists.denx.de, Stefano Babic <sbabic@denx.de>,
Fabio Estevam <festevam@gmail.com>
Subject: Re: [PATCH 2/2] mxs: Don't enable 4P2 reg if MXS is powered only from DCDC_BATT
Date: Tue, 4 Jul 2023 10:18:57 +0200 [thread overview]
Message-ID: <20230704101857.7ca296c7@wsk> (raw)
In-Reply-To: <dbae4231-83c6-eb26-5f70-49d0843907bc@denx.de>
[-- Attachment #1: Type: text/plain, Size: 3899 bytes --]
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:
> >
> > setbits_le32(&power_regs->hw_power_vddioctrl,
> > POWER_VDDIOCTRL_DISABLE_FET | POWER_VDDIOCTRL_PWDN_BRNOUT);
> >
> > 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-lukma@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.
> >
> > 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-lukma@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()'.
> >
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 <cody@londelec.com>
> > Cc: Stefano Babic <sbabic@denx.de>
> > Cc: Marek Vasut <marex@denx.de>
> > Cc: Fabio Estevam <festevam@gmail.com>
> > ---
> > arch/arm/cpu/arm926ejs/mxs/spl_power_init.c | 7 +++++++
> > 1 file changed, 7 insertions(+)
> >
> > 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);
> >
> > +#ifndef CFG_SPL_MXS_NO_VDD5V_SOURCE
> > mxs_power_enable_4p2();
> > +#endif
> > }
> >
> > /**
> > @@ -1137,8 +1139,11 @@ static void mxs_power_set_vddx(const struct
> > mxs_vddx_cfg *cfg, cur_target += cfg->lowest_mV;
> >
> > adjust_up = new_target > cur_target;
> > +
> > +#ifndef CFG_SPL_MXS_NO_VDD5V_SOURCE
> > if (cfg->powered_by_linreg)
> > powered_by_linreg = cfg->powered_by_linreg();
> > +#endif
> >
> > 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);
> > +#ifndef CFG_SPL_MXS_NO_VDD5V_SOURCE
> > writel(POWER_5VCTRL_PWDN_5VBRNOUT,
> > &power_regs->hw_power_5vctrl_set); +#endif
> >
> > early_delay(1000);
> > }
>
> +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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2023-07-04 8:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-03 16:33 [PATCH 2/2] mxs: Don't enable 4P2 reg if MXS is powered only from DCDC_BATT Cody Green
2023-07-03 16:41 ` Marek Vasut
2023-07-04 8:18 ` Lukasz Majewski [this message]
2023-07-04 10:05 ` Cody Green
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=20230704101857.7ca296c7@wsk \
--to=lukma@denx.de \
--cc=cody@londelec.com \
--cc=festevam@gmail.com \
--cc=marex@denx.de \
--cc=sbabic@denx.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.