mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: i.MX8MP-EVK: increase VDD_ARM to OD voltage
@ 2023-02-06 20:59 Lucas Stach
  2023-02-07  9:54 ` Ahmad Fatoum
  2023-02-08  7:55 ` Sascha Hauer
  0 siblings, 2 replies; 4+ messages in thread
From: Lucas Stach @ 2023-02-06 20:59 UTC (permalink / raw)
  To: barebox

The Linux kernel or whatever is started from Barebox might switch the
ARM frequency to OD level, without first reprogramming the PMIC as
required. This might lead to system instability. To avoid this,
increase VDD_ARM to OD level. When the kernel handles the PMIC properly
it will drop the voltage back to ND level when appropriate.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 arch/arm/boards/nxp-imx8mp-evk/lowlevel.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c
index 3cb24df1ca3f..d6fc32e65b61 100644
--- a/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c
+++ b/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c
@@ -61,6 +61,12 @@ static struct pmic_config pca9450_cfg[] = {
 	{ PCA9450_BUCK1OUT_DVS0, 0x1C },
 	{ PCA9450_BUCK1OUT_DVS1, 0x14 },
 	{ PCA9450_BUCK1CTRL, 0x59 },
+	/*
+	 * Increase VDD_ARM to 0.95V to avoid issues in case software after
+	 * Barebox switches to the OD ARM frequency without reprogramming the
+	 * PMIC first.
+	 */
+	{ PCA9450_BUCK2OUT_DVS0, 0x1C },
 	/* set WDOG_B_CFG to cold reset */
 	{ PCA9450_RESET_CTRL, 0xA1 },
 };
-- 
2.39.1




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ARM: i.MX8MP-EVK: increase VDD_ARM to OD voltage
  2023-02-06 20:59 [PATCH] ARM: i.MX8MP-EVK: increase VDD_ARM to OD voltage Lucas Stach
@ 2023-02-07  9:54 ` Ahmad Fatoum
  2023-02-07 19:57   ` Lucas Stach
  2023-02-08  7:55 ` Sascha Hauer
  1 sibling, 1 reply; 4+ messages in thread
From: Ahmad Fatoum @ 2023-02-07  9:54 UTC (permalink / raw)
  To: Lucas Stach, barebox

Hello Lucas,

On 06.02.23 21:59, Lucas Stach wrote:
> The Linux kernel or whatever is started from Barebox might switch the
> ARM frequency to OD level, without first reprogramming the PMIC as
> required. This might lead to system instability. To avoid this,
> increase VDD_ARM to OD level. When the kernel handles the PMIC properly
> it will drop the voltage back to ND level when appropriate.
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  arch/arm/boards/nxp-imx8mp-evk/lowlevel.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c
> index 3cb24df1ca3f..d6fc32e65b61 100644
> --- a/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c
> +++ b/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c
> @@ -61,6 +61,12 @@ static struct pmic_config pca9450_cfg[] = {
>  	{ PCA9450_BUCK1OUT_DVS0, 0x1C },
>  	{ PCA9450_BUCK1OUT_DVS1, 0x14 },
>  	{ PCA9450_BUCK1CTRL, 0x59 },
> +	/*
> +	 * Increase VDD_ARM to 0.95V to avoid issues in case software after
> +	 * Barebox switches to the OD ARM frequency without reprogramming the
> +	 * PMIC first.
> +	 */
> +	{ PCA9450_BUCK2OUT_DVS0, 0x1C },

We use the same PMIC on nxp-imx8mn-evk and newer nxp-imx8mm-evk
as well. Should we do this there too? Do we need to change something
for the i.MX8M boards using Rohm PMICs?

>  	/* set WDOG_B_CFG to cold reset */
>  	{ PCA9450_RESET_CTRL, 0xA1 },
>  };

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ARM: i.MX8MP-EVK: increase VDD_ARM to OD voltage
  2023-02-07  9:54 ` Ahmad Fatoum
@ 2023-02-07 19:57   ` Lucas Stach
  0 siblings, 0 replies; 4+ messages in thread
From: Lucas Stach @ 2023-02-07 19:57 UTC (permalink / raw)
  To: Ahmad Fatoum, barebox

Am Dienstag, dem 07.02.2023 um 10:54 +0100 schrieb Ahmad Fatoum:
> Hello Lucas,
> 
> On 06.02.23 21:59, Lucas Stach wrote:
> > The Linux kernel or whatever is started from Barebox might switch the
> > ARM frequency to OD level, without first reprogramming the PMIC as
> > required. This might lead to system instability. To avoid this,
> > increase VDD_ARM to OD level. When the kernel handles the PMIC properly
> > it will drop the voltage back to ND level when appropriate.
> > 
> > Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> > ---
> >  arch/arm/boards/nxp-imx8mp-evk/lowlevel.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c
> > index 3cb24df1ca3f..d6fc32e65b61 100644
> > --- a/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c
> > +++ b/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c
> > @@ -61,6 +61,12 @@ static struct pmic_config pca9450_cfg[] = {
> >  	{ PCA9450_BUCK1OUT_DVS0, 0x1C },
> >  	{ PCA9450_BUCK1OUT_DVS1, 0x14 },
> >  	{ PCA9450_BUCK1CTRL, 0x59 },
> > +	/*
> > +	 * Increase VDD_ARM to 0.95V to avoid issues in case software after
> > +	 * Barebox switches to the OD ARM frequency without reprogramming the
> > +	 * PMIC first.
> > +	 */
> > +	{ PCA9450_BUCK2OUT_DVS0, 0x1C },
> 
> We use the same PMIC on nxp-imx8mn-evk and newer nxp-imx8mm-evk
> as well. Should we do this there too? Do we need to change something
> for the i.MX8M boards using Rohm PMICs?
> 
Yep, I just checked: both 8MM and 8MN use the same 0.95V ARM voltage
for the OD mode. While I think it's not much a problem in practice as
the kernel does handle the PMIC before trying to switch ARM frequency
in all usual setups, better safe than sorry and put the ARM voltage
into OD on all system.

I'll send separate patches for that.

Regards,
Lucas



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ARM: i.MX8MP-EVK: increase VDD_ARM to OD voltage
  2023-02-06 20:59 [PATCH] ARM: i.MX8MP-EVK: increase VDD_ARM to OD voltage Lucas Stach
  2023-02-07  9:54 ` Ahmad Fatoum
@ 2023-02-08  7:55 ` Sascha Hauer
  1 sibling, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2023-02-08  7:55 UTC (permalink / raw)
  To: Lucas Stach; +Cc: barebox

On Mon, Feb 06, 2023 at 09:59:28PM +0100, Lucas Stach wrote:
> The Linux kernel or whatever is started from Barebox might switch the
> ARM frequency to OD level, without first reprogramming the PMIC as
> required. This might lead to system instability. To avoid this,
> increase VDD_ARM to OD level. When the kernel handles the PMIC properly
> it will drop the voltage back to ND level when appropriate.
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  arch/arm/boards/nxp-imx8mp-evk/lowlevel.c | 6 ++++++
>  1 file changed, 6 insertions(+)

Applied, thanks

Sascha

> 
> diff --git a/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c
> index 3cb24df1ca3f..d6fc32e65b61 100644
> --- a/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c
> +++ b/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c
> @@ -61,6 +61,12 @@ static struct pmic_config pca9450_cfg[] = {
>  	{ PCA9450_BUCK1OUT_DVS0, 0x1C },
>  	{ PCA9450_BUCK1OUT_DVS1, 0x14 },
>  	{ PCA9450_BUCK1CTRL, 0x59 },
> +	/*
> +	 * Increase VDD_ARM to 0.95V to avoid issues in case software after
> +	 * Barebox switches to the OD ARM frequency without reprogramming the
> +	 * PMIC first.
> +	 */
> +	{ PCA9450_BUCK2OUT_DVS0, 0x1C },
>  	/* set WDOG_B_CFG to cold reset */
>  	{ PCA9450_RESET_CTRL, 0xA1 },
>  };
> -- 
> 2.39.1
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-08  7:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-06 20:59 [PATCH] ARM: i.MX8MP-EVK: increase VDD_ARM to OD voltage Lucas Stach
2023-02-07  9:54 ` Ahmad Fatoum
2023-02-07 19:57   ` Lucas Stach
2023-02-08  7:55 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox