mbox series

[00/26] imx: update for i.MX8M

Message ID 20210319075718.14181-1-peng.fan@oss.nxp.com
Headers show
Series imx: update for i.MX8M | expand

Message

Peng Fan (OSS) March 19, 2021, 7:56 a.m. UTC
From: Peng Fan <peng.fan@nxp.com>


This patchset is to upstream NXP downstream patches targeting
next release: 2021.07.

 - Enviorment cleanup
 - ddr script update for ddr4/lpddr4 boards
 - update fuse path
 - Support i.MX8MQ B2
 - Add i.MX8MN 11*11 variant
 - Change pca9450 API accepting address

Jacky Bai (1):
  imx8mn: Update the DDR4 timing script on imx8mn ddr4 evk

Peng Fan (12):
  tools: imx image: fix write warning
  imx8mm/p: remove boot.cmd
  imx8mm_evk: add/cleanup variable for distro
  imx8mp_evk: add/cleanup variable for distro
  imx8mp_evk: spl: clean up including headers
  imx8mp_evk: Increase VDD_ARM to 0.95v Overdrive voltage
  power: pca9450: add a new parameter for power_pca9450_init
  imx8mn_evk: drop duplicated code
  imx8mn: Add LPDDR4 EVK board support
  imx: logos: use NXP logo
  imx8m: soc: update fuse path
  arch: mach-imx: imx8m: fix unique_id read error for imx8mp

Sherry Sun (1):
  imx8mp: ddr: Add inline ECC feature support

Ye Li (11):
  imx8mm_evk: Update to latest LPDDR4 script
  imx8mm_evk: Switch to new imx8mm evk board
  imx8mp_evk: Update LPDDR4 timing for new FW 202006
  imx8mp_evk: Update LPDDR4 refresh time
  imx8mn: Add low drive mode support for DDR4/LPDDR4 EVK
  imx8mn: Add support for 11x11 UltraLite part number
  imx8m: Update thermal and PMU kernel nodes for dual/single cores
  imx8m: ddr: Disable CA VREF Training for LPDDR4
  iMX8MQ: Recognize the B2 revision
  misc: ocotp: Update OCOTP driver for iMX8MQ B2
  imx8mq_evk: Applying default LPDDR4 script for B2

haidong.zheng (1):
  imx8mp: refine power on imx8mp board

 arch/arm/dts/Makefile                         |    1 +
 arch/arm/dts/imx8mm-evk-u-boot.dtsi           |    4 +-
 arch/arm/dts/imx8mm-evk.dtsi                  |  127 +-
 arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi      |    3 +
 arch/arm/dts/imx8mn-evk-u-boot.dtsi           |   26 +
 arch/arm/dts/imx8mn-evk.dts                   |  128 ++
 arch/arm/include/asm/arch-imx/cpu.h           |   12 +-
 arch/arm/include/asm/arch-imx8m/imx-regs.h    |   11 +
 arch/arm/include/asm/mach-imx/sys_proto.h     |    6 +-
 arch/arm/mach-imx/cpu.c                       |    8 +-
 arch/arm/mach-imx/imx8m/Kconfig               |    6 +
 arch/arm/mach-imx/imx8m/soc.c                 |  183 +-
 board/freescale/imx8mm_evk/boot.cmd           |   35 -
 board/freescale/imx8mm_evk/lpddr4_timing.c    |  692 +++----
 board/freescale/imx8mm_evk/spl.c              |   33 +-
 board/freescale/imx8mn_evk/Kconfig            |    6 +-
 board/freescale/imx8mn_evk/Makefile           |    6 +
 board/freescale/imx8mn_evk/ddr4_timing.c      | 1057 +++++------
 board/freescale/imx8mn_evk/ddr4_timing_ld.c   | 1057 +++++++++++
 board/freescale/imx8mn_evk/lpddr4_timing.c    | 1587 +++++++++++++++++
 board/freescale/imx8mn_evk/lpddr4_timing_ld.c | 1440 +++++++++++++++
 board/freescale/imx8mn_evk/spl.c              |   50 +-
 board/freescale/imx8mp_evk/boot.cmd           |   25 -
 board/freescale/imx8mp_evk/lpddr4_timing.c    |  372 +++-
 board/freescale/imx8mp_evk/spl.c              |   38 +-
 board/freescale/imx8mq_evk/spl.c              |    2 +-
 board/phytec/phycore_imx8mp/spl.c             |    2 +-
 configs/imx8mm_evk_defconfig                  |    2 +-
 configs/imx8mn_evk_defconfig                  |   93 +
 drivers/ddr/imx/imx8m/Kconfig                 |    8 +
 drivers/misc/mxc_ocotp.c                      |    2 +-
 drivers/power/pmic/pmic_pca9450.c             |    4 +-
 include/configs/imx8mm_evk.h                  |    8 +-
 include/configs/imx8mp_evk.h                  |    8 +-
 include/power/pca9450.h                       |    2 +-
 tools/imx8image.c                             |    2 +-
 tools/imx8mimage.c                            |    2 +-
 tools/logos/freescale.bmp                     |  Bin 46738 -> 47670 bytes
 38 files changed, 5745 insertions(+), 1303 deletions(-)
 create mode 100644 arch/arm/dts/imx8mn-evk-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx8mn-evk.dts
 delete mode 100644 board/freescale/imx8mm_evk/boot.cmd
 create mode 100644 board/freescale/imx8mn_evk/ddr4_timing_ld.c
 create mode 100644 board/freescale/imx8mn_evk/lpddr4_timing.c
 create mode 100644 board/freescale/imx8mn_evk/lpddr4_timing_ld.c
 delete mode 100644 board/freescale/imx8mp_evk/boot.cmd
 mode change 100644 => 100755 board/freescale/imx8mp_evk/lpddr4_timing.c
 create mode 100644 configs/imx8mn_evk_defconfig

-- 
2.30.0

Comments

Peng Fan (OSS) March 19, 2021, 7:57 a.m. UTC | #1
From: Peng Fan <peng.fan@nxp.com>


Use NXP logo. The vendor and board dir not changed,
only replace the content of freescale.bmp.

Signed-off-by: Peng Fan <peng.fan@nxp.com>

---
 tools/logos/freescale.bmp | Bin 46738 -> 47670 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/tools/logos/freescale.bmp b/tools/logos/freescale.bmp
index 1589e8073d133b61d5dedb99ff393ef9aa68a07f..43e0591c8ead8641e0fa8de3f13fcca5f55b3a69 100644
GIT binary patch
literal 47670
zcmeI5JC9^X6~}A3=l1ktd%Jt4AJdPCLEaE)$sJg7KtM_c84^N58zEuI!T}Lv7$Hl1
z080)mIk6)GkZ|C@PT@=V6Tmt3ew?aXJ&U|u<5SX3-+tWb?%(~-|NL(~?!Nt#mtP3k
zUS13FL)iM&l@Ra4?UfkI$8$ga{ps(-f8gKXtAC1@zxbKBefwP@1_L2J`>(kA=3n9;
zfBUr%Uw<jqKmCpP@dtkv;s<Yummhp6y1#!eu0Q@(Y+k$&Kl;ln@#;^15UWrAD)zts
zL`*;YMhu=m7cV~gtvGHMV*mah#s0lt3b9;?S3iFz_fhz9Ccp%k025#WOn?b60Vco%
zm;e)C0!)AjFaajO1egF5U;<2l2`~XBzyz286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oss.nxp.com> wrote:
>

> From: Ye Li <ye.li@nxp.com>

>

> Update LPDDR4 script to sync with v2020.04 u-boot

>

> Signed-off-by: Ye Li <ye.li@nxp.com>


Peng,

The commit log does not make sense. I believe you want to say
something like 'Update LPDDR4 script to sync with <xyz> version of the
NXP MX8M_DDR_tool'.

> ---

>  board/freescale/imx8mm_evk/lpddr4_timing.c | 692 +++++++++------------

>  1 file changed, 280 insertions(+), 412 deletions(-)

>

> diff --git a/board/freescale/imx8mm_evk/lpddr4_timing.c b/board/freescale/imx8mm_evk/lpddr4_timing.c

> index 8e48b9d81b..4373ca624e 100644

> --- a/board/freescale/imx8mm_evk/lpddr4_timing.c

> +++ b/board/freescale/imx8mm_evk/lpddr4_timing.c

> @@ -1,129 +1,162 @@

>  // SPDX-License-Identifier: GPL-2.0+

>  /*

> - * Copyright 2019 NXP

> + * Copyright 2018-2019 NXP

> + *

> + * Generated code from MX8M_DDR_tool

>   */


I understand that this file is a direct output of the NXP MX8M_DDR
tool but it would be nice to see you add to the comment above what
version of the tool you used to produce this what functional
differences it makes. If you knew what version of the tool produced
the original file one could compare versions.

As I am the maintainer of an IMX8M Mini board also, I try to pay
attention to NXP's updates to the DDR timing config files to let me
know if something important has changed.

Best Regards,

Tim
Tim Harvey March 24, 2021, 9:25 p.m. UTC | #3
On Fri, Mar 19, 2021 at 12:31 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
>

> From: Ye Li <ye.li@nxp.com>

>

> Users reported LPDDR4 MR12 value is set to 0 during PHY training,

> not the value from FSP timing structure, which cause compliance test failed.

> The root cause is the CATrainOpt[0] is set to 1 in 2D FSP timing

> but not set in 1D.  According to PHY training application node,

> to enable the feature both 1D and 2D need set this field to 1,

> otherwise the training result will be incorrect.

> The PHY training doc also recommends to set CATrainOpt[0] to 0 to use

> MR12 value from message block (FSP structure). So update the LPDDR4

> scripts of all mscale to clear CATrainOpt[0].


Peng,

Is this issue being addressed by an update of the NXP i.MX 8M Family
DDR Tools app that generates this code? Is there a reference to this
issue online anywhere?

A bit unrelated but I would love to see NXP step up and replace the
silly NXP i.MX 8M Family DDR Tools windows app with code that could be
enabled in the SPL to do the same thing. Personally it's a bit of a
joke to require having a Windows PC around to bring up an ARM
processor board and I would hope there are folks at NXP that are
utterly ashamed at this as well. One could easily use the opensource
imx-usb-loader to load an SPL that performed this calibration and
training code.

Tim
Peng Fan (OSS) March 25, 2021, 1:15 a.m. UTC | #4
> Subject: Re: [PATCH 02/26] imx8mm_evk: Update to latest LPDDR4 script

> 

> On Fri, Mar 19, 2021 at 12:26 AM Peng Fan (OSS) <peng.fan@oss.nxp.com>

> wrote:

> >

> > From: Ye Li <ye.li@nxp.com>

> >

> > Update LPDDR4 script to sync with v2020.04 u-boot

> >

> > Signed-off-by: Ye Li <ye.li@nxp.com>

> 

> Peng,

> 

> The commit log does not make sense. I believe you want to say something like

> 'Update LPDDR4 script to sync with <xyz> version of the NXP

> MX8M_DDR_tool'.


I directly cherry-pick this patch from downstream tree,
Ye could comment more here.

Regards,
Peng.

> 

> > ---

> >  board/freescale/imx8mm_evk/lpddr4_timing.c | 692

> > +++++++++------------

> >  1 file changed, 280 insertions(+), 412 deletions(-)

> >

> > diff --git a/board/freescale/imx8mm_evk/lpddr4_timing.c

> > b/board/freescale/imx8mm_evk/lpddr4_timing.c

> > index 8e48b9d81b..4373ca624e 100644

> > --- a/board/freescale/imx8mm_evk/lpddr4_timing.c

> > +++ b/board/freescale/imx8mm_evk/lpddr4_timing.c

> > @@ -1,129 +1,162 @@

> >  // SPDX-License-Identifier: GPL-2.0+

> >  /*

> > - * Copyright 2019 NXP

> > + * Copyright 2018-2019 NXP

> > + *

> > + * Generated code from MX8M_DDR_tool

> >   */

> 

> I understand that this file is a direct output of the NXP MX8M_DDR tool but it

> would be nice to see you add to the comment above what version of the tool

> you used to produce this what functional differences it makes. If you knew

> what version of the tool produced the original file one could compare versions.

> 

> As I am the maintainer of an IMX8M Mini board also, I try to pay attention to

> NXP's updates to the DDR timing config files to let me know if something

> important has changed.

> 

> Best Regards,

> 

> Tim
Stefano Babic March 25, 2021, 8:14 a.m. UTC | #5
Hi Tim,

On 24.03.21 22:25, Tim Harvey wrote:
> On Fri, Mar 19, 2021 at 12:31 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:

>>

>> From: Ye Li <ye.li@nxp.com>

>>

>> Users reported LPDDR4 MR12 value is set to 0 during PHY training,

>> not the value from FSP timing structure, which cause compliance test failed.

>> The root cause is the CATrainOpt[0] is set to 1 in 2D FSP timing

>> but not set in 1D.  According to PHY training application node,

>> to enable the feature both 1D and 2D need set this field to 1,

>> otherwise the training result will be incorrect.

>> The PHY training doc also recommends to set CATrainOpt[0] to 0 to use

>> MR12 value from message block (FSP structure). So update the LPDDR4

>> scripts of all mscale to clear CATrainOpt[0].

> 

> Peng,

> 

> Is this issue being addressed by an update of the NXP i.MX 8M Family

> DDR Tools app that generates this code? Is there a reference to this

> issue online anywhere?

> 

> A bit unrelated but I would love to see NXP step up and replace the

> silly NXP i.MX 8M Family DDR Tools windows app with code that could be

> enabled in the SPL to do the same thing. Personally it's a bit of a

> joke to require having a Windows PC around to bring up an ARM

> processor board and I would hope there are folks at NXP that are

> utterly ashamed at this as well. One could easily use the opensource

> imx-usb-loader to load an SPL that performed this calibration and

> training code.


You find a lot of friends here....most of us will frankly be glad if 
there will be such as tool, or at least if some code is published to 
help to port to Linux. NXP story did not show a big interest in the past 
with the Windows-based MFGTools, but I hoped this was changed with 
"uuu". Such as tool will really help to improve i.MX support and enlarge 
NXP community (just a couple of notes: I do not expect Peng can decide 
this, but he can report our thought internally to NXP).

Best regards,
Stefano

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
=====================================================================
Peng Fan (OSS) March 25, 2021, 8:35 a.m. UTC | #6
On 2021/3/25 16:14, Stefano Babic wrote:
> Hi Tim,

> 

> On 24.03.21 22:25, Tim Harvey wrote:

>> On Fri, Mar 19, 2021 at 12:31 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> 

>> wrote:

>>>

>>> From: Ye Li <ye.li@nxp.com>

>>>

>>> Users reported LPDDR4 MR12 value is set to 0 during PHY training,

>>> not the value from FSP timing structure, which cause compliance test 

>>> failed.

>>> The root cause is the CATrainOpt[0] is set to 1 in 2D FSP timing

>>> but not set in 1D.  According to PHY training application node,

>>> to enable the feature both 1D and 2D need set this field to 1,

>>> otherwise the training result will be incorrect.

>>> The PHY training doc also recommends to set CATrainOpt[0] to 0 to use

>>> MR12 value from message block (FSP structure). So update the LPDDR4

>>> scripts of all mscale to clear CATrainOpt[0].

>>

>> Peng,

>>

>> Is this issue being addressed by an update of the NXP i.MX 8M Family

>> DDR Tools app that generates this code? Is there a reference to this

>> issue online anywhere?

>>

>> A bit unrelated but I would love to see NXP step up and replace the

>> silly NXP i.MX 8M Family DDR Tools windows app with code that could be

>> enabled in the SPL to do the same thing. Personally it's a bit of a

>> joke to require having a Windows PC around to bring up an ARM

>> processor board and I would hope there are folks at NXP that are

>> utterly ashamed at this as well. One could easily use the opensource

>> imx-usb-loader to load an SPL that performed this calibration and

>> training code.

> 

> You find a lot of friends here....most of us will frankly be glad if 

> there will be such as tool, or at least if some code is published to 

> help to port to Linux. NXP story did not show a big interest in the past 

> with the Windows-based MFGTools, but I hoped this was changed with 

> "uuu". Such as tool will really help to improve i.MX support and enlarge 

> NXP community (just a couple of notes: I do not expect Peng can decide 

> this, but he can report our thought internally to NXP).


I have forwarded Tim's to NXP internal. And will also add yours' 
comments about this DDR tool.

I am not the DDR guy, it is out of my power to do the convert, but I'll
try to sell your ideas.

Thanks,
Peng.

> 

> Best regards,

> Stefano

>
Andrey Zhizhikin May 12, 2021, 9:47 p.m. UTC | #7
Hello Peng,

> -----Original Message-----

> From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Peng Fan (OSS)

> Sent: Friday, March 19, 2021 8:57 AM

> To: sbabic@denx.de; festevam@gmail.com

> Cc: u-boot@lists.denx.de; uboot-imx@nxp.com; Ye Li <ye.li@nxp.com>

> Subject: [PATCH 03/26] imx8mm_evk: Switch to new imx8mm evk board

> 

> From: Ye Li <ye.li@nxp.com>

> 

> Update PMIC to use PCA9540, the legacy board not supported by NXP


This commit seems rather a "nuclear" to me, as de-facto it drops the initialization of ROMH PMIC in
favor of PCA one, leaving all the previous board revisions not to be properly sourced.

I know that there might be no intention to provide a support for earlier revisions of i.MX8M Mini
EVKs from NXP, but providing no backward compatibility to those boards which are still in use by
a lot of people for development purposes is highly undesirable either.

TBH, I've tested this patch on the old EVK where ROMH PMIC is present, and apart from having some
error messages in SPL regarding the register writes - it does boots. What worries me the most though
is that DTS changes some voltage settings, which I'm not sure how the SOC would react on.

To my opinion, this patch should either be complemented with the mechanism to provide a
level of backward compatibility (where the PMIC can be dynamically identified and instantiated),
or the separate implementation should be presented which would make the old board type not to
be bootable at all if it is considered not to be supported any longer. Or this patch should be reverted
in an effort to come up with a solution which covers new revision without "damaging" the currently
integrated one.

Fabio / Stefano,
Do you have any thoughts here on how this should be handled further, considering the fact that the
backward compatibility of 2021.07 release is not kept for this board type across multiple revisions?

I'd really like to get your opinion here as I do have those boards in development and would need to
come up with the idea on what to do with them.

Also, this should be taken care of in the Yocto, since there is only one definition of the i.MX8MM EVK
machine which does not make any distinction regarding the revision.

Thanks a lot!

> 

> Signed-off-by: Ye Li <ye.li@nxp.com>

> ---

>  arch/arm/dts/imx8mm-evk-u-boot.dtsi |   4 +-

>  arch/arm/dts/imx8mm-evk.dtsi        | 127 +++++++++++++++-------------

>  board/freescale/imx8mm_evk/spl.c    |  33 ++++----

>  configs/imx8mm_evk_defconfig        |   2 +-

>  4 files changed, 86 insertions(+), 80 deletions(-)

> 

> diff --git a/arch/arm/dts/imx8mm-evk-u-boot.dtsi b/arch/arm/dts/imx8mm-evk-

> u-boot.dtsi

> index e843a5648e..7f48912b49 100644

> --- a/arch/arm/dts/imx8mm-evk-u-boot.dtsi

> +++ b/arch/arm/dts/imx8mm-evk-u-boot.dtsi

> @@ -114,11 +114,11 @@

>         u-boot,dm-spl;

>  };

> 

> -&{/soc@0/bus@30800000/i2c@30a20000/pmic@4b} {

> +&{/soc@0/bus@30800000/i2c@30a20000/pca9450@25} {

>         u-boot,dm-spl;

>  };

> 

> -&{/soc@0/bus@30800000/i2c@30a20000/pmic@4b/regulators} {

> +&{/soc@0/bus@30800000/i2c@30a20000/pca9450@25/regulators} {

>         u-boot,dm-spl;

>  };

> 

> diff --git a/arch/arm/dts/imx8mm-evk.dtsi b/arch/arm/dts/imx8mm-evk.dtsi

> index 6518f088b2..60179e006d 100644

> --- a/arch/arm/dts/imx8mm-evk.dtsi

> +++ b/arch/arm/dts/imx8mm-evk.dtsi

> @@ -126,115 +126,120 @@

>         pinctrl-0 = <&pinctrl_i2c1>;

>         status = "okay";

> 

> -       pmic@4b {

> -               compatible = "rohm,bd71847";

> -               reg = <0x4b>;

> -               pinctrl-names = "default";

> +       pmic: pca9450@25 {

> +               reg = <0x25>;

> +               compatible = "nxp,pca9450a";

> +               /* PMIC PCA9450 PMIC_nINT GPIO1_IO3 */

>                 pinctrl-0 = <&pinctrl_pmic>;

> -               interrupt-parent = <&gpio1>;

> -               interrupts = <3 IRQ_TYPE_LEVEL_LOW>;

> -               rohm,reset-snvs-powered;

> -

> -               #clock-cells = <0>;

> -               clocks = <&osc_32k 0>;

> -               clock-output-names = "clk-32k-out";

> +               gpio_intr = <&gpio1 3 GPIO_ACTIVE_LOW>;

> 

>                 regulators {

> -                       buck1_reg: BUCK1 {

> -                               regulator-name = "buck1";

> -                               regulator-min-microvolt = <700000>;

> -                               regulator-max-microvolt = <1300000>;

> +                       #address-cells = <1>;

> +                       #size-cells = <0>;

> +

> +                       pca9450,pmic-buck2-uses-i2c-dvs;

> +                       /* Run/Standby voltage */

> +                       pca9450,pmic-buck2-dvs-voltage = <950000>,

> + <850000>;

> +

> +                       buck1_reg: regulator@0 {

> +                               reg = <0>;

> +                               regulator-compatible = "buck1";

> +                               regulator-min-microvolt = <600000>;

> +                               regulator-max-microvolt = <2187500>;

>                                 regulator-boot-on;

>                                 regulator-always-on;

> -                               regulator-ramp-delay = <1250>;

> +                               regulator-ramp-delay = <3125>;

>                         };

> 

> -                       buck2_reg: BUCK2 {

> -                               regulator-name = "buck2";

> -                               regulator-min-microvolt = <700000>;

> -                               regulator-max-microvolt = <1300000>;

> +                       buck2_reg: regulator@1 {

> +                               reg = <1>;

> +                               regulator-compatible = "buck2";

> +                               regulator-min-microvolt = <600000>;

> +                               regulator-max-microvolt = <2187500>;

>                                 regulator-boot-on;

>                                 regulator-always-on;

> -                               regulator-ramp-delay = <1250>;

> -                               rohm,dvs-run-voltage = <1000000>;

> -                               rohm,dvs-idle-voltage = <900000>;

> +                               regulator-ramp-delay = <3125>;

>                         };

> 

> -                       buck3_reg: BUCK3 {

> -                               // BUCK5 in datasheet

> -                               regulator-name = "buck3";

> -                               regulator-min-microvolt = <700000>;

> -                               regulator-max-microvolt = <1350000>;

> +                       buck3_reg: regulator@2 {

> +                               reg = <2>;

> +                               regulator-compatible = "buck3";

> +                               regulator-min-microvolt = <600000>;

> +                               regulator-max-microvolt = <2187500>;

>                                 regulator-boot-on;

>                                 regulator-always-on;

>                         };

> 

> -                       buck4_reg: BUCK4 {

> -                               // BUCK6 in datasheet

> -                               regulator-name = "buck4";

> -                               regulator-min-microvolt = <3000000>;

> -                               regulator-max-microvolt = <3300000>;

> +                       buck4_reg: regulator@3 {

> +                               reg = <3>;

> +                               regulator-compatible = "buck4";

> +                               regulator-min-microvolt = <600000>;

> +                               regulator-max-microvolt = <3400000>;

>                                 regulator-boot-on;

>                                 regulator-always-on;

>                         };

> 

> -                       buck5_reg: BUCK5 {

> -                               // BUCK7 in datasheet

> -                               regulator-name = "buck5";

> -                               regulator-min-microvolt = <1605000>;

> -                               regulator-max-microvolt = <1995000>;

> +                       buck5_reg: regulator@4 {

> +                               reg = <4>;

> +                               regulator-compatible = "buck5";

> +                               regulator-min-microvolt = <600000>;

> +                               regulator-max-microvolt = <3400000>;

>                                 regulator-boot-on;

>                                 regulator-always-on;

>                         };

> 

> -                       buck6_reg: BUCK6 {

> -                               // BUCK8 in datasheet

> -                               regulator-name = "buck6";

> -                               regulator-min-microvolt = <800000>;

> -                               regulator-max-microvolt = <1400000>;

> +                       buck6_reg: regulator@5 {

> +                               reg = <5>;

> +                               regulator-compatible = "buck6";

> +                               regulator-min-microvolt = <600000>;

> +                               regulator-max-microvolt = <3400000>;

>                                 regulator-boot-on;

>                                 regulator-always-on;

>                         };

> 

> -                       ldo1_reg: LDO1 {

> -                               regulator-name = "ldo1";

> +                       ldo1_reg: regulator@6 {

> +                               reg = <6>;

> +                               regulator-compatible = "ldo1";

>                                 regulator-min-microvolt = <1600000>;

>                                 regulator-max-microvolt = <3300000>;

>                                 regulator-boot-on;

>                                 regulator-always-on;

>                         };

> 

> -                       ldo2_reg: LDO2 {

> -                               regulator-name = "ldo2";

> +                       ldo2_reg: regulator@7 {

> +                               reg = <7>;

> +                               regulator-compatible = "ldo2";

>                                 regulator-min-microvolt = <800000>;

> -                               regulator-max-microvolt = <900000>;

> +                               regulator-max-microvolt = <1150000>;

>                                 regulator-boot-on;

>                                 regulator-always-on;

>                         };

> 

> -                       ldo3_reg: LDO3 {

> -                               regulator-name = "ldo3";

> -                               regulator-min-microvolt = <1800000>;

> +                       ldo3_reg: regulator@8 {

> +                               reg = <8>;

> +                               regulator-compatible = "ldo3";

> +                               regulator-min-microvolt = <800000>;

>                                 regulator-max-microvolt = <3300000>;

>                                 regulator-boot-on;

>                                 regulator-always-on;

>                         };

> 

> -                       ldo4_reg: LDO4 {

> -                               regulator-name = "ldo4";

> -                               regulator-min-microvolt = <900000>;

> -                               regulator-max-microvolt = <1800000>;

> +                       ldo4_reg: regulator@9 {

> +                               reg = <9>;

> +                               regulator-compatible = "ldo4";

> +                               regulator-min-microvolt = <800000>;

> +                               regulator-max-microvolt = <3300000>;

>                                 regulator-boot-on;

>                                 regulator-always-on;

>                         };

> 

> -                       ldo6_reg: LDO6 {

> -                               regulator-name = "ldo6";

> -                               regulator-min-microvolt = <900000>;

> -                               regulator-max-microvolt = <1800000>;

> -                               regulator-boot-on;

> -                               regulator-always-on;

> +                       ldo5_reg: regulator@10 {

> +                               reg = <10>;

> +                               regulator-compatible = "ldo5";

> +                               regulator-min-microvolt = <1800000>;

> +                               regulator-max-microvolt = <3300000>;

>                         };

> +

>                 };

>         };

>  };

> diff --git a/board/freescale/imx8mm_evk/spl.c

> b/board/freescale/imx8mm_evk/spl.c

> index 64bc60651d..4ef7f6f180 100644

> --- a/board/freescale/imx8mm_evk/spl.c

> +++ b/board/freescale/imx8mm_evk/spl.c

> @@ -26,7 +26,7 @@

>  #include <dm/device-internal.h>

> 

>  #include <power/pmic.h>

> -#include <power/bd71837.h>

> +#include <power/pca9450.h>

> 

>  DECLARE_GLOBAL_DATA_PTR;

> 

> @@ -94,7 +94,7 @@ static int power_init_board(void)

>         struct udevice *dev;

>         int ret;

> 

> -       ret = pmic_get("pmic@4b", &dev);

> +       ret = pmic_get("pca9450@25", &dev);

>         if (ret == -ENODEV) {

>                 puts("No pmic\n");

>                 return 0;

> @@ -102,25 +102,26 @@ static int power_init_board(void)

>         if (ret != 0)

>                 return ret;

> 

> -       /* decrease RESET key long push time from the default 10s to 10ms */

> -       pmic_reg_write(dev, BD718XX_PWRONCONFIG1, 0x0);

> +       /* BUCKxOUT_DVS0/1 control BUCK123 output */

> +       pmic_reg_write(dev, PCA9450_BUCK123_DVS, 0x29);

> 

> -       /* unlock the PMIC regs */

> -       pmic_reg_write(dev, BD718XX_REGLOCK, 0x1);

> +       /* Buck 1 DVS control through PMIC_STBY_REQ */

> +       pmic_reg_write(dev, PCA9450_BUCK1CTRL, 0x59);

> 

> -       /* increase VDD_SOC to typical value 0.85v before first DRAM access */

> -       pmic_reg_write(dev, BD718XX_BUCK1_VOLT_RUN, 0x0f);

> +       /* Set DVS1 to 0.8v for suspend */

> +       pmic_reg_write(dev, PCA9450_BUCK1OUT_DVS1, 0x10);

> 

> -       /* increase VDD_DRAM to 0.975v for 3Ghz DDR */

> -       pmic_reg_write(dev, BD718XX_1ST_NODVS_BUCK_VOLT, 0x83);

> +       /* increase VDD_DRAM to 0.95v for 3Ghz DDR */

> +       pmic_reg_write(dev, PCA9450_BUCK3OUT_DVS0, 0x1C);

> 

> -#ifndef CONFIG_IMX8M_LPDDR4

> -       /* increase NVCC_DRAM_1V2 to 1.2v for DDR4 */

> -       pmic_reg_write(dev, BD718XX_4TH_NODVS_BUCK_VOLT, 0x28);

> -#endif

> +       /* VDD_DRAM needs off in suspend, set B1_ENMODE=10 (ON by

> PMIC_ON_REQ = H && PMIC_STBY_REQ = L) */

> +       pmic_reg_write(dev, PCA9450_BUCK3CTRL, 0x4a);

> +

> +       /* set VDD_SNVS_0V8 from default 0.85V */

> +       pmic_reg_write(dev, PCA9450_LDO2CTRL, 0xC0);

> 

> -       /* lock the PMIC regs */

> -       pmic_reg_write(dev, BD718XX_REGLOCK, 0x11);

> +       /* set WDOG_B_CFG to cold reset */

> +       pmic_reg_write(dev, PCA9450_RESET_CTRL, 0xA1);

> 

>         return 0;

>  }

> diff --git a/configs/imx8mm_evk_defconfig b/configs/imx8mm_evk_defconfig

> index e22b7de56f..ae9e0626dd 100644

> --- a/configs/imx8mm_evk_defconfig

> +++ b/configs/imx8mm_evk_defconfig

> @@ -83,7 +83,7 @@ CONFIG_PINCTRL=y

>  CONFIG_SPL_PINCTRL=y

>  CONFIG_PINCTRL_IMX8M=y

>  CONFIG_DM_PMIC=y

> -CONFIG_SPL_DM_PMIC_BD71837=y

> +CONFIG_SPL_DM_PMIC_PCA9450=y

>  CONFIG_DM_REGULATOR=y

>  CONFIG_DM_REGULATOR_FIXED=y

>  CONFIG_DM_REGULATOR_GPIO=y

> --

> 2.30.0


-- andrey
Fabio Estevam May 14, 2021, 12:30 p.m. UTC | #8
Hi Andrey,

On Wed, May 12, 2021 at 6:47 PM ZHIZHIKIN Andrey
<andrey.zhizhikin@leica-geosystems.com> wrote:

> > Update PMIC to use PCA9540, the legacy board not supported by NXP

>

> This commit seems rather a "nuclear" to me, as de-facto it drops the initialization of ROMH PMIC in

> favor of PCA one, leaving all the previous board revisions not to be properly sourced.

>

> I know that there might be no intention to provide a support for earlier revisions of i.MX8M Mini

> EVKs from NXP, but providing no backward compatibility to those boards which are still in use by

> a lot of people for development purposes is highly undesirable either.

>

> TBH, I've tested this patch on the old EVK where ROMH PMIC is present, and apart from having some

> error messages in SPL regarding the register writes - it does boots. What worries me the most though

> is that DTS changes some voltage settings, which I'm not sure how the SOC would react on.

>

> To my opinion, this patch should either be complemented with the mechanism to provide a

> level of backward compatibility (where the PMIC can be dynamically identified and instantiated),

> or the separate implementation should be presented which would make the old board type not to

> be bootable at all if it is considered not to be supported any longer. Or this patch should be reverted

> in an effort to come up with a solution which covers new revision without "damaging" the currently

> integrated one.

>

> Fabio / Stefano,

> Do you have any thoughts here on how this should be handled further, considering the fact that the

> backward compatibility of 2021.07 release is not kept for this board type across multiple revisions?

>

> I'd really like to get your opinion here as I do have those boards in development and would need to

> come up with the idea on what to do with them.

>

> Also, this should be taken care of in the Yocto, since there is only one definition of the i.MX8MM EVK

> machine which does not make any distinction regarding the revision.


You bring a good point.

What about adding a new defconfig to support the old imx8mm-evk with
the Rohm PMIC?

Then we could have imx8mm_evk_defconfig for the new version and
imx8mm_evk_rohm_defconfig for the old one.

What do you think?

Thanks
Ricardo Salveti May 14, 2021, 3:29 p.m. UTC | #9
Hi Fabio,

On Fri, May 14, 2021 at 9:30 AM Fabio Estevam <festevam@gmail.com> wrote:
>

> Hi Andrey,

>

> On Wed, May 12, 2021 at 6:47 PM ZHIZHIKIN Andrey

> <andrey.zhizhikin@leica-geosystems.com> wrote:

>

> > > Update PMIC to use PCA9540, the legacy board not supported by NXP

> >

> > This commit seems rather a "nuclear" to me, as de-facto it drops the initialization of ROMH PMIC in

> > favor of PCA one, leaving all the previous board revisions not to be properly sourced.

> >

> > I know that there might be no intention to provide a support for earlier revisions of i.MX8M Mini

> > EVKs from NXP, but providing no backward compatibility to those boards which are still in use by

> > a lot of people for development purposes is highly undesirable either.

> >

> > TBH, I've tested this patch on the old EVK where ROMH PMIC is present, and apart from having some

> > error messages in SPL regarding the register writes - it does boots. What worries me the most though

> > is that DTS changes some voltage settings, which I'm not sure how the SOC would react on.

> >

> > To my opinion, this patch should either be complemented with the mechanism to provide a

> > level of backward compatibility (where the PMIC can be dynamically identified and instantiated),

> > or the separate implementation should be presented which would make the old board type not to

> > be bootable at all if it is considered not to be supported any longer. Or this patch should be reverted

> > in an effort to come up with a solution which covers new revision without "damaging" the currently

> > integrated one.

> >

> > Fabio / Stefano,

> > Do you have any thoughts here on how this should be handled further, considering the fact that the

> > backward compatibility of 2021.07 release is not kept for this board type across multiple revisions?

> >

> > I'd really like to get your opinion here as I do have those boards in development and would need to

> > come up with the idea on what to do with them.

> >

> > Also, this should be taken care of in the Yocto, since there is only one definition of the i.MX8MM EVK

> > machine which does not make any distinction regarding the revision.

>

> You bring a good point.

>

> What about adding a new defconfig to support the old imx8mm-evk with

> the Rohm PMIC?

>

> Then we could have imx8mm_evk_defconfig for the new version and

> imx8mm_evk_rohm_defconfig for the old one.

>

> What do you think?


Maybe a dynamic way to identify if BD71837 or PCA9450 (by probing i2c)
would work better?

Different configs would imply different builds and binaries, which is
a problem when trying to support a single build for both the old EVK
and EVKB (and the main difference is the PMIC, nothing really major).

I also share Andrey's concerns, as we do have several EVKs in hands,
and having one single build would facilitate quite a bit.

Cheers,
-- 
Ricardo Salveti de Araujo
Fabio Estevam May 14, 2021, 3:59 p.m. UTC | #10
Hi Ricardo,

On Fri, May 14, 2021 at 12:29 PM Ricardo Salveti <rsalveti@rsalveti.net> wrote:

> Maybe a dynamic way to identify if BD71837 or PCA9450 (by probing i2c)

> would work better?


Yes, agreed.

On imx53-qsb we support both Dialog and NXP PMICs in the same defconfig.

> Different configs would imply different builds and binaries, which is

> a problem when trying to support a single build for both the old EVK

> and EVKB (and the main difference is the PMIC, nothing really major).

>

> I also share Andrey's concerns, as we do have several EVKs in hands,

> and having one single build would facilitate quite a bit.


Agreed.

Thanks
Andrey Zhizhikin May 16, 2021, 2:21 p.m. UTC | #11
Hello Fabio,

> -----Original Message-----

> From: Fabio Estevam <festevam@gmail.com>

> Sent: Friday, May 14, 2021 2:31 PM

> To: ZHIZHIKIN Andrey <andrey.zhizhikin@leica-geosystems.com>

> Cc: Peng Fan (OSS) <peng.fan@oss.nxp.com>; sbabic@denx.de; u-

> boot@lists.denx.de; uboot-imx@nxp.com; Ye Li <ye.li@nxp.com>

> Subject: Re: [PATCH 03/26] imx8mm_evk: Switch to new imx8mm evk board

> 

> 

> Hi Andrey,

> 

> On Wed, May 12, 2021 at 6:47 PM ZHIZHIKIN Andrey <andrey.zhizhikin@leica-

> geosystems.com> wrote:

> 

> > > Update PMIC to use PCA9540, the legacy board not supported by NXP

> >

> > This commit seems rather a "nuclear" to me, as de-facto it drops the

> > initialization of ROMH PMIC in favor of PCA one, leaving all the previous board

> revisions not to be properly sourced.

> >

> > I know that there might be no intention to provide a support for

> > earlier revisions of i.MX8M Mini EVKs from NXP, but providing no

> > backward compatibility to those boards which are still in use by a lot of people

> for development purposes is highly undesirable either.

> >

> > TBH, I've tested this patch on the old EVK where ROMH PMIC is present,

> > and apart from having some error messages in SPL regarding the

> > register writes - it does boots. What worries me the most though is that DTS

> changes some voltage settings, which I'm not sure how the SOC would react on.

> >

> > To my opinion, this patch should either be complemented with the

> > mechanism to provide a level of backward compatibility (where the PMIC

> > can be dynamically identified and instantiated), or the separate

> > implementation should be presented which would make the old board type

> > not to be bootable at all if it is considered not to be supported any

> > longer. Or this patch should be reverted in an effort to come up with a solution

> which covers new revision without "damaging" the currently integrated one.

> >

> > Fabio / Stefano,

> > Do you have any thoughts here on how this should be handled further,

> > considering the fact that the backward compatibility of 2021.07 release is not

> kept for this board type across multiple revisions?

> >

> > I'd really like to get your opinion here as I do have those boards in

> > development and would need to come up with the idea on what to do with

> them.

> >

> > Also, this should be taken care of in the Yocto, since there is only

> > one definition of the i.MX8MM EVK machine which does not make any

> distinction regarding the revision.

> 

> You bring a good point.

> 

> What about adding a new defconfig to support the old imx8mm-evk with the

> Rohm PMIC?


This would not be the only change that is necessary to provide support for both
ROMH and PCA PMIC ICs. From the commit, it seems that also the "duplication"
should be done in DTS and SPL PMIC code in power_init_board(void) should also
be adapted to get PMIC based on the config option.

I'm not saying it is not feasible - it is perfectly doable, but would require some
verification afterwards.

I can try to come up with the patch set for this but cannot commit to test the
change since I do not own a updated EVK board.

I guess an ideal situation would be that NXP can step in here to provide the better
version of this patch where both revisions are supported, and they can verify the
change on both EVK revisions.

> 

> Then we could have imx8mm_evk_defconfig for the new version and

> imx8mm_evk_rohm_defconfig for the old one.


Yes, ultimately this would be possible provided that both DTS and SPL code are
made in a way to provide implementation for both PMIC types.

> 

> What do you think?

> 

> Thanks


-- andrey
Andrey Zhizhikin May 16, 2021, 2:31 p.m. UTC | #12
Hello Ricardo,

> -----Original Message-----

> From: Ricardo Salveti <rsalveti@rsalveti.net>

> Sent: Friday, May 14, 2021 5:29 PM

> To: Fabio Estevam <festevam@gmail.com>

> Cc: ZHIZHIKIN Andrey <andrey.zhizhikin@leica-geosystems.com>; Peng Fan

> (OSS) <peng.fan@oss.nxp.com>; sbabic@denx.de; u-boot@lists.denx.de; uboot-

> imx@nxp.com; Ye Li <ye.li@nxp.com>; vanessa.maegima@foundries.io;

> igor.opaniuk@foundries.io

> Subject: Re: [PATCH 03/26] imx8mm_evk: Switch to new imx8mm evk board

> 

> 

> Hi Fabio,

> 

> On Fri, May 14, 2021 at 9:30 AM Fabio Estevam <festevam@gmail.com> wrote:

> >

> > Hi Andrey,

> >

> > On Wed, May 12, 2021 at 6:47 PM ZHIZHIKIN Andrey

> > <andrey.zhizhikin@leica-geosystems.com> wrote:

> >

> > > > Update PMIC to use PCA9540, the legacy board not supported by NXP

> > >

> > > This commit seems rather a "nuclear" to me, as de-facto it drops the

> initialization of ROMH PMIC in

> > > favor of PCA one, leaving all the previous board revisions not to be properly

> sourced.

> > >

> > > I know that there might be no intention to provide a support for earlier

> revisions of i.MX8M Mini

> > > EVKs from NXP, but providing no backward compatibility to those boards

> which are still in use by

> > > a lot of people for development purposes is highly undesirable either.

> > >

> > > TBH, I've tested this patch on the old EVK where ROMH PMIC is present, and

> apart from having some

> > > error messages in SPL regarding the register writes - it does boots. What

> worries me the most though

> > > is that DTS changes some voltage settings, which I'm not sure how the SOC

> would react on.

> > >

> > > To my opinion, this patch should either be complemented with the

> mechanism to provide a

> > > level of backward compatibility (where the PMIC can be dynamically

> identified and instantiated),

> > > or the separate implementation should be presented which would make the

> old board type not to

> > > be bootable at all if it is considered not to be supported any longer. Or this

> patch should be reverted

> > > in an effort to come up with a solution which covers new revision without

> "damaging" the currently

> > > integrated one.

> > >

> > > Fabio / Stefano,

> > > Do you have any thoughts here on how this should be handled further,

> considering the fact that the

> > > backward compatibility of 2021.07 release is not kept for this board type

> across multiple revisions?

> > >

> > > I'd really like to get your opinion here as I do have those boards in

> development and would need to

> > > come up with the idea on what to do with them.

> > >

> > > Also, this should be taken care of in the Yocto, since there is only one

> definition of the i.MX8MM EVK

> > > machine which does not make any distinction regarding the revision.

> >

> > You bring a good point.

> >

> > What about adding a new defconfig to support the old imx8mm-evk with

> > the Rohm PMIC?

> >

> > Then we could have imx8mm_evk_defconfig for the new version and

> > imx8mm_evk_rohm_defconfig for the old one.

> >

> > What do you think?

> 

> Maybe a dynamic way to identify if BD71837 or PCA9450 (by probing i2c)

> would work better?


This might be solution given that there is an implementation in SPL which
can be used to query I2C to determine the PMIC type and get it dynamically.

I'm not aware if this functionality exist, I would need to search for the reference
in the U-Boot tree for this.

But still, as I previously replied to Fabio, it would still need to have 2 separate
entries in DTS for both PMICs, and SPL power_init_board(void) code should be
extended to request the PMIC based on the type detected.

I guess this can be done in 2 steps: first make the PMIC selection based on the
config option in SPL, and then - replace it with dynamic query (if possible).

> 

> Different configs would imply different builds and binaries, which is

> a problem when trying to support a single build for both the old EVK

> and EVKB (and the main difference is the PMIC, nothing really major).


This is especially true for Yocto builds, but there would be a way to define
separate U-Boot config based on the type, so having 2 separate config files
would not be technically impossible to achieve.

However, I totally agree with you - one build for both revisions would be the
best solution here.

> 

> I also share Andrey's concerns, as we do have several EVKs in hands,

> and having one single build would facilitate quite a bit.

> 

> Cheers,

> --

> Ricardo Salveti de Araujo


-- andrey
Peng Fan (OSS) May 17, 2021, 12:34 a.m. UTC | #13
On 2021/5/13 5:47, ZHIZHIKIN Andrey wrote:
> Hello Peng,

> 

>> -----Original Message-----

>> From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Peng Fan (OSS)

>> Sent: Friday, March 19, 2021 8:57 AM

>> To: sbabic@denx.de; festevam@gmail.com

>> Cc: u-boot@lists.denx.de; uboot-imx@nxp.com; Ye Li <ye.li@nxp.com>

>> Subject: [PATCH 03/26] imx8mm_evk: Switch to new imx8mm evk board

>>

>> From: Ye Li <ye.li@nxp.com>

>>

>> Update PMIC to use PCA9540, the legacy board not supported by NXP

> 

> This commit seems rather a "nuclear" to me, as de-facto it drops the initialization of ROMH PMIC in

> favor of PCA one, leaving all the previous board revisions not to be properly sourced.

> 

> I know that there might be no intention to provide a support for earlier revisions of i.MX8M Mini

> EVKs from NXP, but providing no backward compatibility to those boards which are still in use by

> a lot of people for development purposes is highly undesirable either.

> 

> TBH, I've tested this patch on the old EVK where ROMH PMIC is present, and apart from having some

> error messages in SPL regarding the register writes - it does boots. What worries me the most though

> is that DTS changes some voltage settings, which I'm not sure how the SOC would react on.

> 

> To my opinion, this patch should either be complemented with the mechanism to provide a

> level of backward compatibility (where the PMIC can be dynamically identified and instantiated),

> or the separate implementation should be presented which would make the old board type not to

> be bootable at all if it is considered not to be supported any longer. Or this patch should be reverted

> in an effort to come up with a solution which covers new revision without "damaging" the currently

> integrated one.


The old evk board was no longer supported by NXP, all new boards using 
new PMIC. No damage, just some default voltage settings different.

It is ok to add back the old pmic, but it finally will retire and no one 
will use it in production I think.

Regards,
Peng.

> 

> Fabio / Stefano,

> Do you have any thoughts here on how this should be handled further, considering the fact that the

> backward compatibility of 2021.07 release is not kept for this board type across multiple revisions?

> 

> I'd really like to get your opinion here as I do have those boards in development and would need to

> come up with the idea on what to do with them.

> 

> Also, this should be taken care of in the Yocto, since there is only one definition of the i.MX8MM EVK

> machine which does not make any distinction regarding the revision.

> 

> Thanks a lot!

> 

>>

>> Signed-off-by: Ye Li <ye.li@nxp.com>

>> ---

>>   arch/arm/dts/imx8mm-evk-u-boot.dtsi |   4 +-

>>   arch/arm/dts/imx8mm-evk.dtsi        | 127 +++++++++++++++-------------

>>   board/freescale/imx8mm_evk/spl.c    |  33 ++++----

>>   configs/imx8mm_evk_defconfig        |   2 +-

>>   4 files changed, 86 insertions(+), 80 deletions(-)

>>

>> diff --git a/arch/arm/dts/imx8mm-evk-u-boot.dtsi b/arch/arm/dts/imx8mm-evk-

>> u-boot.dtsi

>> index e843a5648e..7f48912b49 100644

>> --- a/arch/arm/dts/imx8mm-evk-u-boot.dtsi

>> +++ b/arch/arm/dts/imx8mm-evk-u-boot.dtsi

>> @@ -114,11 +114,11 @@

>>          u-boot,dm-spl;

>>   };

>>

>> -&{/soc@0/bus@30800000/i2c@30a20000/pmic@4b} {

>> +&{/soc@0/bus@30800000/i2c@30a20000/pca9450@25} {

>>          u-boot,dm-spl;

>>   };

>>

>> -&{/soc@0/bus@30800000/i2c@30a20000/pmic@4b/regulators} {

>> +&{/soc@0/bus@30800000/i2c@30a20000/pca9450@25/regulators} {

>>          u-boot,dm-spl;

>>   };

>>

>> diff --git a/arch/arm/dts/imx8mm-evk.dtsi b/arch/arm/dts/imx8mm-evk.dtsi

>> index 6518f088b2..60179e006d 100644

>> --- a/arch/arm/dts/imx8mm-evk.dtsi

>> +++ b/arch/arm/dts/imx8mm-evk.dtsi

>> @@ -126,115 +126,120 @@

>>          pinctrl-0 = <&pinctrl_i2c1>;

>>          status = "okay";

>>

>> -       pmic@4b {

>> -               compatible = "rohm,bd71847";

>> -               reg = <0x4b>;

>> -               pinctrl-names = "default";

>> +       pmic: pca9450@25 {

>> +               reg = <0x25>;

>> +               compatible = "nxp,pca9450a";

>> +               /* PMIC PCA9450 PMIC_nINT GPIO1_IO3 */

>>                  pinctrl-0 = <&pinctrl_pmic>;

>> -               interrupt-parent = <&gpio1>;

>> -               interrupts = <3 IRQ_TYPE_LEVEL_LOW>;

>> -               rohm,reset-snvs-powered;

>> -

>> -               #clock-cells = <0>;

>> -               clocks = <&osc_32k 0>;

>> -               clock-output-names = "clk-32k-out";

>> +               gpio_intr = <&gpio1 3 GPIO_ACTIVE_LOW>;

>>

>>                  regulators {

>> -                       buck1_reg: BUCK1 {

>> -                               regulator-name = "buck1";

>> -                               regulator-min-microvolt = <700000>;

>> -                               regulator-max-microvolt = <1300000>;

>> +                       #address-cells = <1>;

>> +                       #size-cells = <0>;

>> +

>> +                       pca9450,pmic-buck2-uses-i2c-dvs;

>> +                       /* Run/Standby voltage */

>> +                       pca9450,pmic-buck2-dvs-voltage = <950000>,

>> + <850000>;

>> +

>> +                       buck1_reg: regulator@0 {

>> +                               reg = <0>;

>> +                               regulator-compatible = "buck1";

>> +                               regulator-min-microvolt = <600000>;

>> +                               regulator-max-microvolt = <2187500>;

>>                                  regulator-boot-on;

>>                                  regulator-always-on;

>> -                               regulator-ramp-delay = <1250>;

>> +                               regulator-ramp-delay = <3125>;

>>                          };

>>

>> -                       buck2_reg: BUCK2 {

>> -                               regulator-name = "buck2";

>> -                               regulator-min-microvolt = <700000>;

>> -                               regulator-max-microvolt = <1300000>;

>> +                       buck2_reg: regulator@1 {

>> +                               reg = <1>;

>> +                               regulator-compatible = "buck2";

>> +                               regulator-min-microvolt = <600000>;

>> +                               regulator-max-microvolt = <2187500>;

>>                                  regulator-boot-on;

>>                                  regulator-always-on;

>> -                               regulator-ramp-delay = <1250>;

>> -                               rohm,dvs-run-voltage = <1000000>;

>> -                               rohm,dvs-idle-voltage = <900000>;

>> +                               regulator-ramp-delay = <3125>;

>>                          };

>>

>> -                       buck3_reg: BUCK3 {

>> -                               // BUCK5 in datasheet

>> -                               regulator-name = "buck3";

>> -                               regulator-min-microvolt = <700000>;

>> -                               regulator-max-microvolt = <1350000>;

>> +                       buck3_reg: regulator@2 {

>> +                               reg = <2>;

>> +                               regulator-compatible = "buck3";

>> +                               regulator-min-microvolt = <600000>;

>> +                               regulator-max-microvolt = <2187500>;

>>                                  regulator-boot-on;

>>                                  regulator-always-on;

>>                          };

>>

>> -                       buck4_reg: BUCK4 {

>> -                               // BUCK6 in datasheet

>> -                               regulator-name = "buck4";

>> -                               regulator-min-microvolt = <3000000>;

>> -                               regulator-max-microvolt = <3300000>;

>> +                       buck4_reg: regulator@3 {

>> +                               reg = <3>;

>> +                               regulator-compatible = "buck4";

>> +                               regulator-min-microvolt = <600000>;

>> +                               regulator-max-microvolt = <3400000>;

>>                                  regulator-boot-on;

>>                                  regulator-always-on;

>>                          };

>>

>> -                       buck5_reg: BUCK5 {

>> -                               // BUCK7 in datasheet

>> -                               regulator-name = "buck5";

>> -                               regulator-min-microvolt = <1605000>;

>> -                               regulator-max-microvolt = <1995000>;

>> +                       buck5_reg: regulator@4 {

>> +                               reg = <4>;

>> +                               regulator-compatible = "buck5";

>> +                               regulator-min-microvolt = <600000>;

>> +                               regulator-max-microvolt = <3400000>;

>>                                  regulator-boot-on;

>>                                  regulator-always-on;

>>                          };

>>

>> -                       buck6_reg: BUCK6 {

>> -                               // BUCK8 in datasheet

>> -                               regulator-name = "buck6";

>> -                               regulator-min-microvolt = <800000>;

>> -                               regulator-max-microvolt = <1400000>;

>> +                       buck6_reg: regulator@5 {

>> +                               reg = <5>;

>> +                               regulator-compatible = "buck6";

>> +                               regulator-min-microvolt = <600000>;

>> +                               regulator-max-microvolt = <3400000>;

>>                                  regulator-boot-on;

>>                                  regulator-always-on;

>>                          };

>>

>> -                       ldo1_reg: LDO1 {

>> -                               regulator-name = "ldo1";

>> +                       ldo1_reg: regulator@6 {

>> +                               reg = <6>;

>> +                               regulator-compatible = "ldo1";

>>                                  regulator-min-microvolt = <1600000>;

>>                                  regulator-max-microvolt = <3300000>;

>>                                  regulator-boot-on;

>>                                  regulator-always-on;

>>                          };

>>

>> -                       ldo2_reg: LDO2 {

>> -                               regulator-name = "ldo2";

>> +                       ldo2_reg: regulator@7 {

>> +                               reg = <7>;

>> +                               regulator-compatible = "ldo2";

>>                                  regulator-min-microvolt = <800000>;

>> -                               regulator-max-microvolt = <900000>;

>> +                               regulator-max-microvolt = <1150000>;

>>                                  regulator-boot-on;

>>                                  regulator-always-on;

>>                          };

>>

>> -                       ldo3_reg: LDO3 {

>> -                               regulator-name = "ldo3";

>> -                               regulator-min-microvolt = <1800000>;

>> +                       ldo3_reg: regulator@8 {

>> +                               reg = <8>;

>> +                               regulator-compatible = "ldo3";

>> +                               regulator-min-microvolt = <800000>;

>>                                  regulator-max-microvolt = <3300000>;

>>                                  regulator-boot-on;

>>                                  regulator-always-on;

>>                          };

>>

>> -                       ldo4_reg: LDO4 {

>> -                               regulator-name = "ldo4";

>> -                               regulator-min-microvolt = <900000>;

>> -                               regulator-max-microvolt = <1800000>;

>> +                       ldo4_reg: regulator@9 {

>> +                               reg = <9>;

>> +                               regulator-compatible = "ldo4";

>> +                               regulator-min-microvolt = <800000>;

>> +                               regulator-max-microvolt = <3300000>;

>>                                  regulator-boot-on;

>>                                  regulator-always-on;

>>                          };

>>

>> -                       ldo6_reg: LDO6 {

>> -                               regulator-name = "ldo6";

>> -                               regulator-min-microvolt = <900000>;

>> -                               regulator-max-microvolt = <1800000>;

>> -                               regulator-boot-on;

>> -                               regulator-always-on;

>> +                       ldo5_reg: regulator@10 {

>> +                               reg = <10>;

>> +                               regulator-compatible = "ldo5";

>> +                               regulator-min-microvolt = <1800000>;

>> +                               regulator-max-microvolt = <3300000>;

>>                          };

>> +

>>                  };

>>          };

>>   };

>> diff --git a/board/freescale/imx8mm_evk/spl.c

>> b/board/freescale/imx8mm_evk/spl.c

>> index 64bc60651d..4ef7f6f180 100644

>> --- a/board/freescale/imx8mm_evk/spl.c

>> +++ b/board/freescale/imx8mm_evk/spl.c

>> @@ -26,7 +26,7 @@

>>   #include <dm/device-internal.h>

>>

>>   #include <power/pmic.h>

>> -#include <power/bd71837.h>

>> +#include <power/pca9450.h>

>>

>>   DECLARE_GLOBAL_DATA_PTR;

>>

>> @@ -94,7 +94,7 @@ static int power_init_board(void)

>>          struct udevice *dev;

>>          int ret;

>>

>> -       ret = pmic_get("pmic@4b", &dev);

>> +       ret = pmic_get("pca9450@25", &dev);

>>          if (ret == -ENODEV) {

>>                  puts("No pmic\n");

>>                  return 0;

>> @@ -102,25 +102,26 @@ static int power_init_board(void)

>>          if (ret != 0)

>>                  return ret;

>>

>> -       /* decrease RESET key long push time from the default 10s to 10ms */

>> -       pmic_reg_write(dev, BD718XX_PWRONCONFIG1, 0x0);

>> +       /* BUCKxOUT_DVS0/1 control BUCK123 output */

>> +       pmic_reg_write(dev, PCA9450_BUCK123_DVS, 0x29);

>>

>> -       /* unlock the PMIC regs */

>> -       pmic_reg_write(dev, BD718XX_REGLOCK, 0x1);

>> +       /* Buck 1 DVS control through PMIC_STBY_REQ */

>> +       pmic_reg_write(dev, PCA9450_BUCK1CTRL, 0x59);

>>

>> -       /* increase VDD_SOC to typical value 0.85v before first DRAM access */

>> -       pmic_reg_write(dev, BD718XX_BUCK1_VOLT_RUN, 0x0f);

>> +       /* Set DVS1 to 0.8v for suspend */

>> +       pmic_reg_write(dev, PCA9450_BUCK1OUT_DVS1, 0x10);

>>

>> -       /* increase VDD_DRAM to 0.975v for 3Ghz DDR */

>> -       pmic_reg_write(dev, BD718XX_1ST_NODVS_BUCK_VOLT, 0x83);

>> +       /* increase VDD_DRAM to 0.95v for 3Ghz DDR */

>> +       pmic_reg_write(dev, PCA9450_BUCK3OUT_DVS0, 0x1C);

>>

>> -#ifndef CONFIG_IMX8M_LPDDR4

>> -       /* increase NVCC_DRAM_1V2 to 1.2v for DDR4 */

>> -       pmic_reg_write(dev, BD718XX_4TH_NODVS_BUCK_VOLT, 0x28);

>> -#endif

>> +       /* VDD_DRAM needs off in suspend, set B1_ENMODE=10 (ON by

>> PMIC_ON_REQ = H && PMIC_STBY_REQ = L) */

>> +       pmic_reg_write(dev, PCA9450_BUCK3CTRL, 0x4a);

>> +

>> +       /* set VDD_SNVS_0V8 from default 0.85V */

>> +       pmic_reg_write(dev, PCA9450_LDO2CTRL, 0xC0);

>>

>> -       /* lock the PMIC regs */

>> -       pmic_reg_write(dev, BD718XX_REGLOCK, 0x11);

>> +       /* set WDOG_B_CFG to cold reset */

>> +       pmic_reg_write(dev, PCA9450_RESET_CTRL, 0xA1);

>>

>>          return 0;

>>   }

>> diff --git a/configs/imx8mm_evk_defconfig b/configs/imx8mm_evk_defconfig

>> index e22b7de56f..ae9e0626dd 100644

>> --- a/configs/imx8mm_evk_defconfig

>> +++ b/configs/imx8mm_evk_defconfig

>> @@ -83,7 +83,7 @@ CONFIG_PINCTRL=y

>>   CONFIG_SPL_PINCTRL=y

>>   CONFIG_PINCTRL_IMX8M=y

>>   CONFIG_DM_PMIC=y

>> -CONFIG_SPL_DM_PMIC_BD71837=y

>> +CONFIG_SPL_DM_PMIC_PCA9450=y

>>   CONFIG_DM_REGULATOR=y

>>   CONFIG_DM_REGULATOR_FIXED=y

>>   CONFIG_DM_REGULATOR_GPIO=y

>> --

>> 2.30.0

> 

> -- andrey

>
Vanessa Maegima May 18, 2021, 1:14 p.m. UTC | #14
Hi Andrey,

On Sun, May 16, 2021 at 11:31 AM ZHIZHIKIN Andrey
<andrey.zhizhikin@leica-geosystems.com> wrote:
>

> Hello Ricardo,

>

> > -----Original Message-----

> > From: Ricardo Salveti <rsalveti@rsalveti.net>

> > Sent: Friday, May 14, 2021 5:29 PM

> > To: Fabio Estevam <festevam@gmail.com>

> > Cc: ZHIZHIKIN Andrey <andrey.zhizhikin@leica-geosystems.com>; Peng Fan

> > (OSS) <peng.fan@oss.nxp.com>; sbabic@denx.de; u-boot@lists.denx.de; uboot-

> > imx@nxp.com; Ye Li <ye.li@nxp.com>; vanessa.maegima@foundries.io;

> > igor.opaniuk@foundries.io

> > Subject: Re: [PATCH 03/26] imx8mm_evk: Switch to new imx8mm evk board

> >

> >

> > Hi Fabio,

> >

> > On Fri, May 14, 2021 at 9:30 AM Fabio Estevam <festevam@gmail.com> wrote:

> > >

> > > Hi Andrey,

> > >

> > > On Wed, May 12, 2021 at 6:47 PM ZHIZHIKIN Andrey

> > > <andrey.zhizhikin@leica-geosystems.com> wrote:

> > >

> > > > > Update PMIC to use PCA9540, the legacy board not supported by NXP

> > > >

> > > > This commit seems rather a "nuclear" to me, as de-facto it drops the

> > initialization of ROMH PMIC in

> > > > favor of PCA one, leaving all the previous board revisions not to be properly

> > sourced.

> > > >

> > > > I know that there might be no intention to provide a support for earlier

> > revisions of i.MX8M Mini

> > > > EVKs from NXP, but providing no backward compatibility to those boards

> > which are still in use by

> > > > a lot of people for development purposes is highly undesirable either.

> > > >

> > > > TBH, I've tested this patch on the old EVK where ROMH PMIC is present, and

> > apart from having some

> > > > error messages in SPL regarding the register writes - it does boots. What

> > worries me the most though

> > > > is that DTS changes some voltage settings, which I'm not sure how the SOC

> > would react on.

> > > >

> > > > To my opinion, this patch should either be complemented with the

> > mechanism to provide a

> > > > level of backward compatibility (where the PMIC can be dynamically

> > identified and instantiated),

> > > > or the separate implementation should be presented which would make the

> > old board type not to

> > > > be bootable at all if it is considered not to be supported any longer. Or this

> > patch should be reverted

> > > > in an effort to come up with a solution which covers new revision without

> > "damaging" the currently

> > > > integrated one.

> > > >

> > > > Fabio / Stefano,

> > > > Do you have any thoughts here on how this should be handled further,

> > considering the fact that the

> > > > backward compatibility of 2021.07 release is not kept for this board type

> > across multiple revisions?

> > > >

> > > > I'd really like to get your opinion here as I do have those boards in

> > development and would need to

> > > > come up with the idea on what to do with them.

> > > >

> > > > Also, this should be taken care of in the Yocto, since there is only one

> > definition of the i.MX8MM EVK

> > > > machine which does not make any distinction regarding the revision.

> > >

> > > You bring a good point.

> > >

> > > What about adding a new defconfig to support the old imx8mm-evk with

> > > the Rohm PMIC?

> > >

> > > Then we could have imx8mm_evk_defconfig for the new version and

> > > imx8mm_evk_rohm_defconfig for the old one.

> > >

> > > What do you think?

> >

> > Maybe a dynamic way to identify if BD71837 or PCA9450 (by probing i2c)

> > would work better?

>

> This might be solution given that there is an implementation in SPL which

> can be used to query I2C to determine the PMIC type and get it dynamically.

>

> I'm not aware if this functionality exist, I would need to search for the reference

> in the U-Boot tree for this.

>

> But still, as I previously replied to Fabio, it would still need to have 2 separate

> entries in DTS for both PMICs, and SPL power_init_board(void) code should be

> extended to request the PMIC based on the type detected.

>

> I guess this can be done in 2 steps: first make the PMIC selection based on the

> config option in SPL, and then - replace it with dynamic query (if possible).

>

> >

> > Different configs would imply different builds and binaries, which is

> > a problem when trying to support a single build for both the old EVK

> > and EVKB (and the main difference is the PMIC, nothing really major).

>

> This is especially true for Yocto builds, but there would be a way to define

> separate U-Boot config based on the type, so having 2 separate config files

> would not be technically impossible to achieve.

>

> However, I totally agree with you - one build for both revisions would be the

> best solution here.


Just as a reference, Toradex has worked around this issue for their
imx8mmevk-based design by implementing the dynamic board rev selection in their
tree ("verdin-imx8mm: implement hardware version detection"). With this patch,
they use the same Uboot defconfig with two different dtbs being selected
at runtime in board.c.

We have implemented a similar logic in our tree and it worked for both EVK and
EVKB versions.

>

> >

> > I also share Andrey's concerns, as we do have several EVKs in hands,

> > and having one single build would facilitate quite a bit.

> >

> > Cheers,

> > --

> > Ricardo Salveti de Araujo

>

> -- andrey


Regards,
Vanessa
Andrey Zhizhikin May 18, 2021, 7:51 p.m. UTC | #15
Hello Vanessa,

> -----Original Message-----

> From: Vanessa Maegima <vanessa.maegima@foundries.io>

> Sent: Tuesday, May 18, 2021 3:15 PM

> To: ZHIZHIKIN Andrey <andrey.zhizhikin@leica-geosystems.com>

> Cc: Ricardo Salveti <rsalveti@rsalveti.net>; Fabio Estevam

> <festevam@gmail.com>; Peng Fan (OSS) <peng.fan@oss.nxp.com>;

> sbabic@denx.de; u-boot@lists.denx.de; uboot-imx@nxp.com; Ye Li

> <ye.li@nxp.com>; igor.opaniuk@foundries.io

> Subject: Re: [PATCH 03/26] imx8mm_evk: Switch to new imx8mm evk board

> 

> 

> Hi Andrey,

> 

> On Sun, May 16, 2021 at 11:31 AM ZHIZHIKIN Andrey <andrey.zhizhikin@leica-

> geosystems.com> wrote:

> >

> > Hello Ricardo,

> >

> > > -----Original Message-----

> > > From: Ricardo Salveti <rsalveti@rsalveti.net>

> > > Sent: Friday, May 14, 2021 5:29 PM

> > > To: Fabio Estevam <festevam@gmail.com>

> > > Cc: ZHIZHIKIN Andrey <andrey.zhizhikin@leica-geosystems.com>; Peng

> > > Fan

> > > (OSS) <peng.fan@oss.nxp.com>; sbabic@denx.de; u-boot@lists.denx.de;

> > > uboot- imx@nxp.com; Ye Li <ye.li@nxp.com>;

> > > vanessa.maegima@foundries.io; igor.opaniuk@foundries.io

> > > Subject: Re: [PATCH 03/26] imx8mm_evk: Switch to new imx8mm evk

> > > board

> > >

> > >

> > > Hi Fabio,

> > >

> > > On Fri, May 14, 2021 at 9:30 AM Fabio Estevam <festevam@gmail.com>

> wrote:

> > > >

> > > > Hi Andrey,

> > > >

> > > > On Wed, May 12, 2021 at 6:47 PM ZHIZHIKIN Andrey

> > > > <andrey.zhizhikin@leica-geosystems.com> wrote:

> > > >

> > > > > > Update PMIC to use PCA9540, the legacy board not supported by

> > > > > > NXP

> > > > >

> > > > > This commit seems rather a "nuclear" to me, as de-facto it drops

> > > > > the

> > > initialization of ROMH PMIC in

> > > > > favor of PCA one, leaving all the previous board revisions not

> > > > > to be properly

> > > sourced.

> > > > >

> > > > > I know that there might be no intention to provide a support for

> > > > > earlier

> > > revisions of i.MX8M Mini

> > > > > EVKs from NXP, but providing no backward compatibility to those

> > > > > boards

> > > which are still in use by

> > > > > a lot of people for development purposes is highly undesirable either.

> > > > >

> > > > > TBH, I've tested this patch on the old EVK where ROMH PMIC is

> > > > > present, and

> > > apart from having some

> > > > > error messages in SPL regarding the register writes - it does

> > > > > boots. What

> > > worries me the most though

> > > > > is that DTS changes some voltage settings, which I'm not sure

> > > > > how the SOC

> > > would react on.

> > > > >

> > > > > To my opinion, this patch should either be complemented with the

> > > mechanism to provide a

> > > > > level of backward compatibility (where the PMIC can be

> > > > > dynamically

> > > identified and instantiated),

> > > > > or the separate implementation should be presented which would

> > > > > make the

> > > old board type not to

> > > > > be bootable at all if it is considered not to be supported any

> > > > > longer. Or this

> > > patch should be reverted

> > > > > in an effort to come up with a solution which covers new

> > > > > revision without

> > > "damaging" the currently

> > > > > integrated one.

> > > > >

> > > > > Fabio / Stefano,

> > > > > Do you have any thoughts here on how this should be handled

> > > > > further,

> > > considering the fact that the

> > > > > backward compatibility of 2021.07 release is not kept for this

> > > > > board type

> > > across multiple revisions?

> > > > >

> > > > > I'd really like to get your opinion here as I do have those

> > > > > boards in

> > > development and would need to

> > > > > come up with the idea on what to do with them.

> > > > >

> > > > > Also, this should be taken care of in the Yocto, since there is

> > > > > only one

> > > definition of the i.MX8MM EVK

> > > > > machine which does not make any distinction regarding the revision.

> > > >

> > > > You bring a good point.

> > > >

> > > > What about adding a new defconfig to support the old imx8mm-evk

> > > > with the Rohm PMIC?

> > > >

> > > > Then we could have imx8mm_evk_defconfig for the new version and

> > > > imx8mm_evk_rohm_defconfig for the old one.

> > > >

> > > > What do you think?

> > >

> > > Maybe a dynamic way to identify if BD71837 or PCA9450 (by probing

> > > i2c) would work better?

> >

> > This might be solution given that there is an implementation in SPL

> > which can be used to query I2C to determine the PMIC type and get it

> dynamically.

> >

> > I'm not aware if this functionality exist, I would need to search for

> > the reference in the U-Boot tree for this.

> >

> > But still, as I previously replied to Fabio, it would still need to

> > have 2 separate entries in DTS for both PMICs, and SPL

> > power_init_board(void) code should be extended to request the PMIC based

> on the type detected.

> >

> > I guess this can be done in 2 steps: first make the PMIC selection

> > based on the config option in SPL, and then - replace it with dynamic query (if

> possible).

> >

> > >

> > > Different configs would imply different builds and binaries, which

> > > is a problem when trying to support a single build for both the old

> > > EVK and EVKB (and the main difference is the PMIC, nothing really major).

> >

> > This is especially true for Yocto builds, but there would be a way to

> > define separate U-Boot config based on the type, so having 2 separate

> > config files would not be technically impossible to achieve.

> >

> > However, I totally agree with you - one build for both revisions would

> > be the best solution here.

> 

> Just as a reference, Toradex has worked around this issue for their imx8mmevk-

> based design by implementing the dynamic board rev selection in their tree

> ("verdin-imx8mm: implement hardware version detection"). With this patch,

> they use the same Uboot defconfig with two different dtbs being selected at

> runtime in board.c.


I've also found this implementation for Toradex Verdin CoM, but did not track
which commit brought it.

Thanks for pointing out the commit message - I would certainly have a look
at it further!

> 

> We have implemented a similar logic in our tree and it worked for both EVK and

> EVKB versions.


I was thinking that this would be done by NXP as well for the EVK they
distribute, but the statement was rather clear: No backward compatibility
is provided as the old EVK is not supported any longer.

> 

> >

> > >

> > > I also share Andrey's concerns, as we do have several EVKs in hands,

> > > and having one single build would facilitate quite a bit.

> > >

> > > Cheers,

> > > --

> > > Ricardo Salveti de Araujo

> >

> > -- andrey

> 

> Regards,

> Vanessa


-- andrey