public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Yannic Moog <Y.Moog@phytec.de>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>,
	NXP i.MX U-Boot Team <uboot-imx@nxp.com>,
	"upstream@lists.phytec.de" <upstream@lists.phytec.de>,
	"u-boot@lists.denx.de" <u-boot@lists.denx.de>,
	Stefano Babic <sbabic@nabladev.com>,
	Fabio Estevam <festevam@gmail.com>, Tom Rini <trini@konsulko.com>
Cc: Teresa Remmet <T.Remmet@phytec.de>,
	Benjamin Hahn <B.Hahn@phytec.de>,
	Marek Vasut <marek.vasut+renesas@mailbox.org>,
	Leonard Anderweit <L.Anderweit@phytec.de>,
	Francesco Dolcini <francesco.dolcini@toradex.com>,
	Emanuele Ghidoli <emanuele.ghidoli@toradex.com>,
	Manoj Sai <abbaraju.manojsai@amarulasolutions.com>,
	Matteo Lisi <matteo.lisi@engicam.com>,
	Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH 1/4] imx8mp: phyboard-pollux-rdk: Convert to DM_PMIC
Date: Tue, 24 Mar 2026 12:47:21 +0000	[thread overview]
Message-ID: <0c16dfd0d1cedc87bbac071030bbb4d6f04ff4af.camel@phytec.de> (raw)
In-Reply-To: <20260324-power-legacy-v1-1-ed432367817c@nxp.com>

Hi Peng,

On Tue, 2026-03-24 at 18:30 +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> Convert the board to use DM_PMIC instead of the legacy SPL I2C/PMIC
> handling.
> 
> Changes include:
> - Enable DM_PMIC, DM_PMIC_PCA9450, and SPL_DM_PMIC_PCA9450 in defconfig.
> - Drop legacy SPL I2C and PMIC options.
> - Remove manual I2C1 pad setup and legacy power_pca9450_init() usage.
> - Use DM-based pmic_get() with the DT node "pmic@25".
> - Update PMIC register programming to use struct udevice API.

these changes break something.

Getting

Loading Environment from MMC... Card did not respond to voltage select! : -110
*** Warning - No block device, using default environment

and SD card is not accessible as a result. I also worked on this modernization and got the same
result as with your commit. Have not had time to investigate the cause, yet.

Yannic

> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  .../arm/dts/imx8mp-phyboard-pollux-rdk-u-boot.dtsi | 16 +++++++-
>  board/phytec/phycore_imx8mp/spl.c                  | 43 +++++++---------------
>  configs/phycore-imx8mp_defconfig                   | 10 ++---
>  3 files changed, 32 insertions(+), 37 deletions(-)
> 
> diff --git a/arch/arm/dts/imx8mp-phyboard-pollux-rdk-u-boot.dtsi b/arch/arm/dts/imx8mp-phyboard-
> pollux-rdk-u-boot.dtsi
> index 4804a204e92..871e7fd674d 100644
> --- a/arch/arm/dts/imx8mp-phyboard-pollux-rdk-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mp-phyboard-pollux-rdk-u-boot.dtsi
> @@ -34,6 +34,18 @@
>  	};
>  };
>  
> +&pinctrl_i2c1 {
> +	bootph-all;
> +};
> +
> +&pinctrl_pmic {
> +	bootph-all;
> +};
> +
> +&{/soc@0/bus@30800000/i2c@30a20000/pmic@25/regulators} {
> +	bootph-all;
> +};
> +
>  &reg_usdhc2_vmmc {
>  	bootph-pre-ram;
>  };
> @@ -83,11 +95,11 @@
>  };
>  
>  &i2c1 {
> -	bootph-pre-ram;
> +	bootph-all;
>  };
>  
>  &pmic {
> -	bootph-pre-ram;
> +	bootph-all;
>  };
>  
>  &usb_dwc3_0 {
> diff --git a/board/phytec/phycore_imx8mp/spl.c b/board/phytec/phycore_imx8mp/spl.c
> index fc7aefd0073..fc6f5104925 100644
> --- a/board/phytec/phycore_imx8mp/spl.c
> +++ b/board/phytec/phycore_imx8mp/spl.c
> @@ -117,45 +117,32 @@ out:
>  	ddr_init(&dram_timing);
>  }
>  
> -#define I2C_PAD_CTRL (PAD_CTL_DSE6 | PAD_CTL_HYS | PAD_CTL_PUE | PAD_CTL_PE)
> -#define PC MUX_PAD_CTRL(I2C_PAD_CTRL)
> -struct i2c_pads_info i2c_pad_info1 = {
> -	.scl = {
> -		.i2c_mode = MX8MP_PAD_I2C1_SCL__I2C1_SCL | PC,
> -		.gpio_mode = MX8MP_PAD_I2C1_SCL__GPIO5_IO14 | PC,
> -		.gp = IMX_GPIO_NR(5, 14),
> -	},
> -	.sda = {
> -		.i2c_mode = MX8MP_PAD_I2C1_SDA__I2C1_SDA | PC,
> -		.gpio_mode = MX8MP_PAD_I2C1_SDA__GPIO5_IO15 | PC,
> -		.gp = IMX_GPIO_NR(5, 15),
> -	},
> -};
> -
>  int power_init_board(void)
>  {
> -	struct pmic *p;
> +	struct udevice *dev;
>  	int ret;
>  
> -	ret = power_pca9450_init(0, 0x25);
> -	if (ret)
> -		printf("power init failed");
> -	p = pmic_get("PCA9450");
> -	pmic_probe(p);
> +	ret = pmic_get("pmic@25", &dev);
> +	if (ret == -ENODEV) {
> +		puts("No pmic@25\n");
> +		return 0;
> +	}
> +	if (ret < 0)
> +		return ret;
>  
>  	/* BUCKxOUT_DVS0/1 control BUCK123 output */
> -	pmic_reg_write(p, PCA9450_BUCK123_DVS, 0x29);
> +	pmic_reg_write(dev, PCA9450_BUCK123_DVS, 0x29);
>  
>  	/* Increase VDD_SOC and VDD_ARM to OD voltage 0.95V */
> -	pmic_reg_write(p, PCA9450_BUCK1OUT_DVS0, 0x1C);
> -	pmic_reg_write(p, PCA9450_BUCK2OUT_DVS0, 0x1C);
> +	pmic_reg_write(dev, PCA9450_BUCK1OUT_DVS0, 0x1C);
> +	pmic_reg_write(dev, PCA9450_BUCK2OUT_DVS0, 0x1C);
>  
>  	/* Set BUCK1 DVS1 to suspend controlled through PMIC_STBY_REQ */
> -	pmic_reg_write(p, PCA9450_BUCK1OUT_DVS1, 0x14);
> -	pmic_reg_write(p, PCA9450_BUCK1CTRL, 0x59);
> +	pmic_reg_write(dev, PCA9450_BUCK1OUT_DVS1, 0x14);
> +	pmic_reg_write(dev, PCA9450_BUCK1CTRL, 0x59);
>  
>  	/* Set WDOG_B_CFG to cold reset */
> -	pmic_reg_write(p, PCA9450_RESET_CTRL, 0xA1);
> +	pmic_reg_write(dev, PCA9450_RESET_CTRL, 0xA1);
>  
>  	return 0;
>  }
> @@ -193,8 +180,6 @@ void board_init_f(ulong dummy)
>  
>  	enable_tzc380();
>  
> -	setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1);
> -
>  	power_init_board();
>  
>  	/* DDR initialization */
> diff --git a/configs/phycore-imx8mp_defconfig b/configs/phycore-imx8mp_defconfig
> index 2fcf7db9e5c..51d9737afb3 100644
> --- a/configs/phycore-imx8mp_defconfig
> +++ b/configs/phycore-imx8mp_defconfig
> @@ -10,7 +10,6 @@ CONFIG_SF_DEFAULT_SPEED=80000000
>  CONFIG_ENV_SIZE=0x10000
>  CONFIG_ENV_OFFSET=0x3C0000
>  CONFIG_ENV_SECT_SIZE=0x10000
> -CONFIG_SYS_I2C_MXC_I2C1=y
>  CONFIG_DM_GPIO=y
>  CONFIG_DEFAULT_DEVICE_TREE="freescale/imx8mp-phyboard-pollux-rdk"
>  CONFIG_IMX8M_OPTEE_LOAD_ADDR=0x7e000000
> @@ -113,8 +112,6 @@ CONFIG_FASTBOOT_MMC_USER_SUPPORT=y
>  CONFIG_FASTBOOT_MMC_USER_NAME="mmc2"
>  CONFIG_MXC_GPIO=y
>  CONFIG_DM_I2C=y
> -# CONFIG_SPL_DM_I2C is not set
> -CONFIG_SPL_SYS_I2C_LEGACY=y
>  CONFIG_I2C_EEPROM=y
>  CONFIG_SYS_I2C_EEPROM_ADDR=0x51
>  CONFIG_SUPPORT_EMMC_BOOT=y
> @@ -144,15 +141,16 @@ CONFIG_PHY_IMX8MQ_USB=y
>  CONFIG_PINCTRL=y
>  CONFIG_SPL_PINCTRL=y
>  CONFIG_PINCTRL_IMX8M=y
> -CONFIG_SPL_POWER_LEGACY=y
>  CONFIG_POWER_DOMAIN=y
>  CONFIG_IMX8M_POWER_DOMAIN=y
>  CONFIG_IMX8MP_HSIOMIX_BLKCTRL=y
> -CONFIG_POWER_PCA9450=y
> +CONFIG_DM_PMIC=y
> +CONFIG_DM_PMIC_PCA9450=y
> +CONFIG_SPL_DM_PMIC_PCA9450=y
>  CONFIG_DM_REGULATOR=y
> +CONFIG_DM_REGULATOR_PCA9450=y
>  CONFIG_DM_REGULATOR_FIXED=y
>  CONFIG_DM_REGULATOR_GPIO=y
> -CONFIG_SPL_POWER_I2C=y
>  CONFIG_DM_RNG=y
>  CONFIG_DM_SERIAL=y
>  CONFIG_MXC_UART=y

  reply	other threads:[~2026-03-24 12:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24 10:30 [PATCH 0/4] i.MX8MP: Convert to DM_PMIC for a few boards Peng Fan (OSS)
2026-03-24 10:30 ` [PATCH 1/4] imx8mp: phyboard-pollux-rdk: Convert to DM_PMIC Peng Fan (OSS)
2026-03-24 12:47   ` Yannic Moog [this message]
2026-03-24 13:33     ` Peng Fan
2026-03-24 14:25       ` Teresa Remmet
2026-03-25  3:50         ` Peng Fan
2026-03-25  7:40           ` Frieder Schrempf
2026-03-25  9:43             ` Teresa Remmet
2026-03-25 11:12             ` Peng Fan
2026-03-25 11:35               ` Frieder Schrempf
2026-03-26  8:05                 ` Peng Fan
2026-03-26  8:44                   ` Teresa Remmet
2026-03-26 10:09                     ` Peng Fan
2026-03-26  9:03                   ` Frieder Schrempf
2026-03-30  2:23             ` Peng Fan
2026-04-01  8:00               ` Frieder Schrempf
2026-04-01  9:30                 ` Peng Fan
2026-03-24 10:30 ` [PATCH 2/4] imx8mp: verdin: " Peng Fan (OSS)
2026-03-24 10:30 ` [PATCH 3/4] imx8mp: libra-fpsc: " Peng Fan (OSS)
2026-03-24 10:30 ` [PATCH 4/4] imx8mp: icore-edimm2.2: " Peng Fan (OSS)

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=0c16dfd0d1cedc87bbac071030bbb4d6f04ff4af.camel@phytec.de \
    --to=y.moog@phytec.de \
    --cc=B.Hahn@phytec.de \
    --cc=L.Anderweit@phytec.de \
    --cc=T.Remmet@phytec.de \
    --cc=abbaraju.manojsai@amarulasolutions.com \
    --cc=emanuele.ghidoli@toradex.com \
    --cc=festevam@gmail.com \
    --cc=francesco.dolcini@toradex.com \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=matteo.lisi@engicam.com \
    --cc=peng.fan@nxp.com \
    --cc=peng.fan@oss.nxp.com \
    --cc=sbabic@nabladev.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.com \
    --cc=upstream@lists.phytec.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox