[PATCH v1 1/9] toradex: tdx-cfg-clock: add new i.mx 8m mini/plus skus

From: Marcel Ziswiler marcel.ziswiler@toradex.com
Add new i.MX 8M Mini/Plus SKUs to ConfigBlock handling:
0058: Verdin iMX8M Plus Quad 4GB Wi-Fi / BT IT
0059: Verdin iMX8M Mini Quad 2GB IT
0060: Verdin iMX8M Mini DualLite 1GB WB IT
0061: Verdin iMX8M Plus Quad 2GB
Rename existing SKU (use correct one): Verdin iMX8M Nano SoloLite 1GB -> Verdin iMX8M Nano Quad 1GB Wi-Fi
Signed-off-by: Igor Opaniuk igor.opaniuk@toradex.com Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com ---
board/toradex/common/tdx-cfg-block.c | 42 ++++++++++++++++++++-------- board/toradex/common/tdx-cfg-block.h | 8 ++++-- 2 files changed, 36 insertions(+), 14 deletions(-)
diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c index bf27b2fa66..475abf78a7 100644 --- a/board/toradex/common/tdx-cfg-block.c +++ b/board/toradex/common/tdx-cfg-block.c @@ -16,7 +16,8 @@ defined(CONFIG_TARGET_COLIBRI_IMX6) || \ defined(CONFIG_TARGET_COLIBRI_IMX8X) || \ defined(CONFIG_TARGET_VERDIN_IMX8MM) || \ - defined(CONFIG_TARGET_VERDIN_IMX8MN) + defined(CONFIG_TARGET_VERDIN_IMX8MN) || \ + defined(CONFIG_TARGET_VERDIN_IMX8MP) #include <asm/arch/sys_proto.h> #else #define is_cpu_type(cpu) (0) @@ -137,8 +138,12 @@ const char * const toradex_modules[] = { [53] = "Apalis iMX8 QuadXPlus 2GB ECC IT", [54] = "Apalis iMX8 DualXPlus 1GB", [55] = "Verdin iMX8M Mini Quad 2GB Wi-Fi / BT IT", - [56] = "Verdin iMX8M Nano SoloLite 1GB", /* not currently on sale */ + [56] = "Verdin iMX8M Nano Quad 1GB Wi-Fi / BT", /* not currently on sale */ [57] = "Verdin iMX8M Mini DualLite 1GB", + [58] = "Verdin iMX8M Plus Quad 4GB Wi-Fi / BT IT", + [59] = "Verdin iMX8M Mini Quad 2GB IT", + [60] = "Verdin iMX8M Mini DualLite 1GB WB IT", + [61] = "Verdin iMX8M Plus Quad 2GB", };
const char * const toradex_carrier_boards[] = { @@ -361,21 +366,15 @@ static int get_cfgblock_interactive(void)
if (cpu_is_pxa27x()) sprintf(message, "Is the module the 312 MHz version? [y/N] "); -#if !defined(CONFIG_TARGET_VERDIN_IMX8MM) || !defined(CONFIG_TARGET_VERDIN_IMX8MN) - else - sprintf(message, "Is the module an IT version? [y/N] "); - - len = cli_readline(message); - it = console_buffer[0]; -#else else it = 'y'; -#endif
#if defined(CONFIG_TARGET_APALIS_IMX8) || \ defined(CONFIG_TARGET_APALIS_IMX8X) || \ defined(CONFIG_TARGET_COLIBRI_IMX6ULL) || \ - defined(CONFIG_TARGET_COLIBRI_IMX8X) + defined(CONFIG_TARGET_COLIBRI_IMX8X) || \ + defined(CONFIG_TARGET_VERDIN_IMX8MM) || \ + defined(CONFIG_TARGET_VERDIN_IMX8MP) sprintf(message, "Does the module have Wi-Fi / Bluetooth? [y/N] "); len = cli_readline(message); wb = console_buffer[0]; @@ -429,7 +428,7 @@ static int get_cfgblock_interactive(void) else if (is_cpu_type(MXC_CPU_IMX8MMDL)) tdx_hw_tag.prodid = VERDIN_IMX8MMDL; else if (is_cpu_type(MXC_CPU_IMX8MN)) - tdx_hw_tag.prodid = VERDIN_IMX8MNSL; + tdx_hw_tag.prodid = VERDIN_IMX8MNQ_WIFI_BT; else if (is_cpu_type(MXC_CPU_IMX8QM)) { if (it == 'y' || it == 'Y') { if (wb == 'y' || wb == 'Y') @@ -465,6 +464,25 @@ static int get_cfgblock_interactive(void) tdx_hw_tag.prodid = COLIBRI_IMX8DX; } #endif + } else if (is_cpu_type(MXC_CPU_IMX8MM)) { + if (is_cpu_type(MXC_CPU_IMX8MMDL)) { + if (wb == 'y' || wb == 'Y') + tdx_hw_tag.prodid = VERDIN_IMX8MMDL_WIFI_BT_IT; + else + tdx_hw_tag.prodid = VERDIN_IMX8MMDL; + } else { + if (wb == 'y' || wb == 'Y') + tdx_hw_tag.prodid = VERDIN_IMX8MMQ_WIFI_BT_IT; + else + tdx_hw_tag.prodid = VERDIN_IMX8MMQ_IT; + } + } else if (is_cpu_type(MXC_CPU_IMX8MN)) { + tdx_hw_tag.prodid = VERDIN_IMX8MNQ_WIFI_BT; + } else if (is_cpu_type(MXC_CPU_IMX8MP)) { + if (wb == 'y' || wb == 'Y') + tdx_hw_tag.prodid = VERDIN_IMX8MPQ_WIFI_BT_IT; + else + tdx_hw_tag.prodid = VERDIN_IMX8MPQ; } else if (!strcmp("tegra20", soc)) { if (it == 'y' || it == 'Y') if (gd->ram_size == 0x10000000) diff --git a/board/toradex/common/tdx-cfg-block.h b/board/toradex/common/tdx-cfg-block.h index 8f91d9aec6..9debd5f046 100644 --- a/board/toradex/common/tdx-cfg-block.h +++ b/board/toradex/common/tdx-cfg-block.h @@ -75,9 +75,13 @@ enum { COLIBRI_IMX8DX, APALIS_IMX8QXP, APALIS_IMX8DXP, - VERDIN_IMX8MMQ_WIFI_BT_IT, - VERDIN_IMX8MNSL, + VERDIN_IMX8MMQ_WIFI_BT_IT, /* 55 */ + VERDIN_IMX8MNQ_WIFI_BT, VERDIN_IMX8MMDL, + VERDIN_IMX8MPQ_WIFI_BT_IT, + VERDIN_IMX8MMQ_IT, + VERDIN_IMX8MMDL_WIFI_BT_IT, /* 60 */ + VERDIN_IMX8MPQ, };
enum {

From: Max Krummenacher max.krummenacher@toradex.com
The I2C address is 0x25, not 0x35. This according to the datasheet and tests with a PCA9450A.
Signed-off-by: Max Krummenacher max.krummenacher@toradex.com ---
drivers/power/pmic/pca9450.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/pmic/pca9450.c b/drivers/power/pmic/pca9450.c index 0c9d9a366e..c7f8b80954 100644 --- a/drivers/power/pmic/pca9450.c +++ b/drivers/power/pmic/pca9450.c @@ -80,7 +80,7 @@ static struct dm_pmic_ops pca9450_ops = { };
static const struct udevice_id pca9450_ids[] = { - { .compatible = "nxp,pca9450a", .data = 0x35, }, + { .compatible = "nxp,pca9450a", .data = 0x25, }, { .compatible = "nxp,pca9450b", .data = 0x25, }, { } };

On 10/28/20 6:58 PM, Igor Opaniuk wrote:
From: Max Krummenacher max.krummenacher@toradex.com
The I2C address is 0x25, not 0x35. This according to the datasheet and tests with a PCA9450A.
Signed-off-by: Max Krummenacher max.krummenacher@toradex.com
Reviewed-by: Jaehoon Chung jh80.chung@samsung.com
Best Regards, Jaehoon Chung
drivers/power/pmic/pca9450.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/pmic/pca9450.c b/drivers/power/pmic/pca9450.c index 0c9d9a366e..c7f8b80954 100644 --- a/drivers/power/pmic/pca9450.c +++ b/drivers/power/pmic/pca9450.c @@ -80,7 +80,7 @@ static struct dm_pmic_ops pca9450_ops = { };
static const struct udevice_id pca9450_ids[] = {
- { .compatible = "nxp,pca9450a", .data = 0x35, },
- { .compatible = "nxp,pca9450a", .data = 0x25, }, { .compatible = "nxp,pca9450b", .data = 0x25, }, { }
};

From: Max Krummenacher max.krummenacher@toradex.com The I2C address is 0x25, not 0x35. This according to the datasheet and tests with a PCA9450A. Signed-off-by: Max Krummenacher max.krummenacher@toradex.com Reviewed-by: Jaehoon Chung jh80.chung@samsung.com
Applied to u-boot-imx, master, thanks !
Best regards, Stefano Babic

From: Igor Opaniuk igor.opaniuk@toradex.com
Add SPL_DM_PMIC_PCA9450 symbol to Kconfig.
Signed-off-by: Igor Opaniuk igor.opaniuk@toradex.com ---
drivers/power/pmic/Kconfig | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/drivers/power/pmic/Kconfig b/drivers/power/pmic/Kconfig index a62aa38054..7d51510d1b 100644 --- a/drivers/power/pmic/Kconfig +++ b/drivers/power/pmic/Kconfig @@ -98,6 +98,13 @@ config DM_PMIC_PCA9450 This config enables implementation of driver-model pmic uclass features for PMIC PCA9450. The driver implements read/write operations.
+config SPL_DM_PMIC_PCA9450 + bool "Enable Driver Model for PMIC PCA9450" + depends on DM_PMIC + help + This config enables implementation of driver-model pmic uclass features + for PMIC PCA9450 in SPL. The driver implements read/write operations. + config DM_PMIC_PFUZE100 bool "Enable Driver Model for PMIC PFUZE100" depends on DM_PMIC

On 10/28/20 6:58 PM, Igor Opaniuk wrote:
From: Igor Opaniuk igor.opaniuk@toradex.com
Add SPL_DM_PMIC_PCA9450 symbol to Kconfig.
Signed-off-by: Igor Opaniuk igor.opaniuk@toradex.com
Reviewed-by: Jaehoon Chung jh80.chung@samsung.com
Best Regards, Jaehoon Chung
drivers/power/pmic/Kconfig | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/drivers/power/pmic/Kconfig b/drivers/power/pmic/Kconfig index a62aa38054..7d51510d1b 100644 --- a/drivers/power/pmic/Kconfig +++ b/drivers/power/pmic/Kconfig @@ -98,6 +98,13 @@ config DM_PMIC_PCA9450 This config enables implementation of driver-model pmic uclass features for PMIC PCA9450. The driver implements read/write operations.
+config SPL_DM_PMIC_PCA9450
- bool "Enable Driver Model for PMIC PCA9450"
- depends on DM_PMIC
- help
This config enables implementation of driver-model pmic uclass features
for PMIC PCA9450 in SPL. The driver implements read/write operations.
config DM_PMIC_PFUZE100 bool "Enable Driver Model for PMIC PFUZE100" depends on DM_PMIC

From: Igor Opaniuk igor.opaniuk@toradex.com Add SPL_DM_PMIC_PCA9450 symbol to Kconfig. Signed-off-by: Igor Opaniuk igor.opaniuk@toradex.com Reviewed-by: Jaehoon Chung jh80.chung@samsung.com
Applied to u-boot-imx, master, thanks !
Best regards, Stefano Babic

From: Max Krummenacher max.krummenacher@toradex.com
The used PMIC has been changed from RHOM BD71837 to NXP PCA9450A. Adjust the device tree accordingly. Remove the old ADC node as the ADC has been changed and has no longer a separate power rail.
Signed-off-by: Max Krummenacher max.krummenacher@toradex.com Signed-off-by: Igor Opaniuk igor.opaniuk@toradex.com ---
arch/arm/dts/imx8mm-verdin-u-boot.dtsi | 5 +- arch/arm/dts/imx8mm-verdin.dts | 154 +++++++++++++------------ 2 files changed, 80 insertions(+), 79 deletions(-)
diff --git a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi index fe6bb9bf03..249b0f8f66 100644 --- a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi +++ b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi @@ -2,7 +2,6 @@ /* * Copyright 2020 Toradex */ - / { wdt-reboot { compatible = "wdt-reboot"; @@ -90,11 +89,11 @@ u-boot,dm-spl; };
-&{/soc@0/bus@30800000/i2c@30a20000/pmic@4b} { +&{/soc@0/bus@30800000/i2c@30a20000/pmic} { u-boot,dm-spl; };
-&{/soc@0/bus@30800000/i2c@30a20000/pmic@4b/regulators} { +&{/soc@0/bus@30800000/i2c@30a20000/pmic/regulators} { u-boot,dm-spl; };
diff --git a/arch/arm/dts/imx8mm-verdin.dts b/arch/arm/dts/imx8mm-verdin.dts index 1c67c08c88..fb0756d6e1 100644 --- a/arch/arm/dts/imx8mm-verdin.dts +++ b/arch/arm/dts/imx8mm-verdin.dts @@ -203,115 +203,123 @@ pinctrl-0 = <&pinctrl_i2c1>; status = "okay";
- pmic@4b { - compatible = "rohm,bd71840", "rohm,bd71837"; - bd71837,pmic-buck2-uses-i2c-dvs; - bd71837,pmic-buck2-dvs-voltage = <1000000>, <900000>, <0>; /* VDD_ARM: Run-Idle */ - gpio_intr = <&gpio1 3 GPIO_ACTIVE_LOW>; - /* PMIC BD71837 PMIC_nINT GPIO1_IO3 */ + /* Assembled on V1.1 HW and later */ + pmic { + reg = <0x25>; + u-boot,dm-spl; + compatible = "nxp,pca9450a"; + /* PMIC PCA9450 PMIC_nINT GPIO1_IO3 */ pinctrl-0 = <&pinctrl_pmic>; - reg = <0x4b>; - - gpo { - rohm,drv = <0x0C>; /* 0b0000_1100 all gpos with cmos output mode */ - }; + gpio_intr = <&gpio1 3 GPIO_ACTIVE_LOW>;
regulators { - buck1_reg: BUCK1 { - regulator-always-on; - regulator-boot-on; + u-boot,dm-spl; + #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-max-microvolt = <1300000>; - regulator-min-microvolt = <700000>; - regulator-ramp-delay = <1250>; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <2187500>; + regulator-boot-on; + regulator-always-on; + regulator-ramp-delay = <3125>; };
- buck2_reg: BUCK2 { - regulator-always-on; - regulator-boot-on; + buck2_reg: regulator@1 { + reg = <1>; regulator-compatible = "buck2"; - regulator-max-microvolt = <1300000>; - regulator-min-microvolt = <700000>; - regulator-ramp-delay = <1250>; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <2187500>; + regulator-boot-on; + regulator-always-on; + regulator-ramp-delay = <3125>; };
- buck5_reg: BUCK5 { - regulator-always-on; + buck3_reg: regulator@2 { + reg = <2>; + regulator-compatible = "buck3"; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <2187500>; regulator-boot-on; - regulator-compatible = "buck5"; - regulator-max-microvolt = <1350000>; - regulator-min-microvolt = <700000>; + regulator-always-on; };
- buck6_reg: BUCK6 { - regulator-always-on; + buck4_reg: regulator@3 { + reg = <3>; + regulator-compatible = "buck4"; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <3400000>; regulator-boot-on; - regulator-compatible = "buck6"; - regulator-max-microvolt = <3300000>; - regulator-min-microvolt = <3000000>; + regulator-always-on; };
- buck7_reg: BUCK7 { - regulator-always-on; + buck5_reg: regulator@4 { + reg = <4>; + regulator-compatible = "buck5"; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <3400000>; regulator-boot-on; - regulator-compatible = "buck7"; - regulator-max-microvolt = <1995000>; - regulator-min-microvolt = <1605000>; + regulator-always-on; };
- buck8_reg: BUCK8 { - regulator-always-on; + buck6_reg: regulator@5 { + reg = <5>; + regulator-compatible = "buck6"; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <3400000>; regulator-boot-on; - regulator-compatible = "buck8"; - regulator-max-microvolt = <1400000>; - regulator-min-microvolt = <800000>; + regulator-always-on; };
- ldo1_reg: LDO1 { - regulator-always-on; - regulator-boot-on; + ldo1_reg: regulator@6 { + reg = <6>; regulator-compatible = "ldo1"; + regulator-min-microvolt = <1600000>; regulator-max-microvolt = <3300000>; - regulator-min-microvolt = <3000000>; + regulator-boot-on; + regulator-always-on; };
- ldo2_reg: LDO2 { - regulator-always-on; - regulator-boot-on; + ldo2_reg: regulator@7 { + reg = <7>; regulator-compatible = "ldo2"; - regulator-max-microvolt = <900000>; - regulator-min-microvolt = <900000>; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <1150000>; + regulator-boot-on; + regulator-always-on; };
- ldo3_reg: LDO3 { - regulator-always-on; - regulator-boot-on; + ldo3_reg: regulator@8 { + reg = <8>; regulator-compatible = "ldo3"; + regulator-min-microvolt = <800000>; regulator-max-microvolt = <3300000>; - regulator-min-microvolt = <1800000>; + regulator-boot-on; + regulator-always-on; };
- ldo4_reg: LDO4 { - regulator-always-on; - regulator-boot-on; + ldo4_reg: regulator@9 { + reg = <9>; regulator-compatible = "ldo4"; - regulator-max-microvolt = <1800000>; - regulator-min-microvolt = <900000>; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; };
- ldo5_reg: LDO5 { + ldo5_reg: regulator@10 { + reg = <10>; regulator-compatible = "ldo5"; + regulator-min-microvolt = <800000>; regulator-max-microvolt = <3300000>; - regulator-min-microvolt = <3300000>; };
- ldo6_reg: LDO6 { - regulator-always-on; - regulator-boot-on; - regulator-compatible = "ldo6"; - regulator-max-microvolt = <1800000>; - regulator-min-microvolt = <900000>; - }; }; };
@@ -321,12 +329,6 @@ reg = <0x32>; };
- adc@34 { - compatible = "maxim,max11607"; - reg = <0x34>; - vcc-supply = <&ldo5_reg>; - }; - eeprom_module: eeprom@50 { compatible = "st,24c02", "atmel,24c02", "i2c-eeprom"; pagesize = <16>;

On Wed, 2020-10-28 at 11:58 +0200, Igor Opaniuk wrote:
From: Max Krummenacher max.krummenacher@toradex.com
The used PMIC has been changed from RHOM BD71837 to NXP PCA9450A. Adjust the device tree accordingly. Remove the old ADC node as the ADC has been changed and has no longer a separate power rail.
Signed-off-by: Max Krummenacher max.krummenacher@toradex.com Signed-off-by: Igor Opaniuk igor.opaniuk@toradex.com
Acked-by: Marcel Ziswiler marcel.ziswiler@toradex.com
arch/arm/dts/imx8mm-verdin-u-boot.dtsi | 5 +- arch/arm/dts/imx8mm-verdin.dts | 154 +++++++++++++------------ 2 files changed, 80 insertions(+), 79 deletions(-)
diff --git a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi index fe6bb9bf03..249b0f8f66 100644 --- a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi +++ b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi @@ -2,7 +2,6 @@ /* * Copyright 2020 Toradex */
/ { wdt-reboot { compatible = "wdt-reboot"; @@ -90,11 +89,11 @@ u-boot,dm-spl; }; -&{/soc@0/bus@30800000/i2c@30a20000/pmic@4b} { +&{/soc@0/bus@30800000/i2c@30a20000/pmic} { u-boot,dm-spl; }; -&{/soc@0/bus@30800000/i2c@30a20000/pmic@4b/regulators} { +&{/soc@0/bus@30800000/i2c@30a20000/pmic/regulators} { u-boot,dm-spl; }; diff --git a/arch/arm/dts/imx8mm-verdin.dts b/arch/arm/dts/imx8mm-verdin.dts index 1c67c08c88..fb0756d6e1 100644 --- a/arch/arm/dts/imx8mm-verdin.dts +++ b/arch/arm/dts/imx8mm-verdin.dts @@ -203,115 +203,123 @@ pinctrl-0 = <&pinctrl_i2c1>; status = "okay"; - pmic@4b { - compatible = "rohm,bd71840", "rohm,bd71837"; - bd71837,pmic-buck2-uses-i2c-dvs; - bd71837,pmic-buck2-dvs-voltage = <1000000>, <900000>, <0>; /* VDD_ARM: Run-Idle */ - gpio_intr = <&gpio1 3 GPIO_ACTIVE_LOW>; - /* PMIC BD71837 PMIC_nINT GPIO1_IO3 */ + /* Assembled on V1.1 HW and later */ + pmic { + reg = <0x25>; + u-boot,dm-spl; + compatible = "nxp,pca9450a"; + /* PMIC PCA9450 PMIC_nINT GPIO1_IO3 */ pinctrl-0 = <&pinctrl_pmic>; - reg = <0x4b>;
- gpo { - rohm,drv = <0x0C>; /* 0b0000_1100 all gpos with cmos output mode */ - }; + gpio_intr = <&gpio1 3 GPIO_ACTIVE_LOW>; regulators { - buck1_reg: BUCK1 { - regulator-always-on; - regulator-boot-on; + u-boot,dm-spl; + #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-max-microvolt = <1300000>; - regulator-min-microvolt = <700000>; - regulator-ramp-delay = <1250>; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <2187500>; + regulator-boot-on; + regulator-always-on; + regulator-ramp-delay = <3125>; }; - buck2_reg: BUCK2 { - regulator-always-on; - regulator-boot-on; + buck2_reg: regulator@1 { + reg = <1>; regulator-compatible = "buck2"; - regulator-max-microvolt = <1300000>; - regulator-min-microvolt = <700000>; - regulator-ramp-delay = <1250>; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <2187500>; + regulator-boot-on; + regulator-always-on; + regulator-ramp-delay = <3125>; }; - buck5_reg: BUCK5 { - regulator-always-on; + buck3_reg: regulator@2 { + reg = <2>; + regulator-compatible = "buck3"; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <2187500>; regulator-boot-on; - regulator-compatible = "buck5"; - regulator-max-microvolt = <1350000>; - regulator-min-microvolt = <700000>; + regulator-always-on; }; - buck6_reg: BUCK6 { - regulator-always-on; + buck4_reg: regulator@3 { + reg = <3>; + regulator-compatible = "buck4"; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <3400000>; regulator-boot-on; - regulator-compatible = "buck6"; - regulator-max-microvolt = <3300000>; - regulator-min-microvolt = <3000000>; + regulator-always-on; }; - buck7_reg: BUCK7 { - regulator-always-on; + buck5_reg: regulator@4 { + reg = <4>; + regulator-compatible = "buck5"; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <3400000>; regulator-boot-on; - regulator-compatible = "buck7"; - regulator-max-microvolt = <1995000>; - regulator-min-microvolt = <1605000>; + regulator-always-on; }; - buck8_reg: BUCK8 { - regulator-always-on; + buck6_reg: regulator@5 { + reg = <5>; + regulator-compatible = "buck6"; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <3400000>; regulator-boot-on; - regulator-compatible = "buck8"; - regulator-max-microvolt = <1400000>; - regulator-min-microvolt = <800000>; + regulator-always-on; }; - ldo1_reg: LDO1 { - regulator-always-on; - regulator-boot-on; + ldo1_reg: regulator@6 { + reg = <6>; regulator-compatible = "ldo1"; + regulator-min-microvolt = <1600000>; regulator-max-microvolt = <3300000>; - regulator-min-microvolt = <3000000>; + regulator-boot-on; + regulator-always-on; }; - ldo2_reg: LDO2 { - regulator-always-on; - regulator-boot-on; + ldo2_reg: regulator@7 { + reg = <7>; regulator-compatible = "ldo2"; - regulator-max-microvolt = <900000>; - regulator-min-microvolt = <900000>; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <1150000>; + regulator-boot-on; + regulator-always-on; }; - ldo3_reg: LDO3 { - regulator-always-on; - regulator-boot-on; + ldo3_reg: regulator@8 { + reg = <8>; regulator-compatible = "ldo3"; + regulator-min-microvolt = <800000>; regulator-max-microvolt = <3300000>; - regulator-min-microvolt = <1800000>; + regulator-boot-on; + regulator-always-on; }; - ldo4_reg: LDO4 { - regulator-always-on; - regulator-boot-on; + ldo4_reg: regulator@9 { + reg = <9>; regulator-compatible = "ldo4"; - regulator-max-microvolt = <1800000>; - regulator-min-microvolt = <900000>; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; }; - ldo5_reg: LDO5 { + ldo5_reg: regulator@10 { + reg = <10>; regulator-compatible = "ldo5"; + regulator-min-microvolt = <800000>; regulator-max-microvolt = <3300000>; - regulator-min-microvolt = <3300000>; }; - ldo6_reg: LDO6 { - regulator-always-on; - regulator-boot-on; - regulator-compatible = "ldo6"; - regulator-max-microvolt = <1800000>; - regulator-min-microvolt = <900000>; - }; }; }; @@ -321,12 +329,6 @@ reg = <0x32>; }; - adc@34 { - compatible = "maxim,max11607"; - reg = <0x34>; - vcc-supply = <&ldo5_reg>; - };
eeprom_module: eeprom@50 { compatible = "st,24c02", "atmel,24c02", "i2c-eeprom"; pagesize = <16>;

On Thu, Oct 29, 2020 at 4:44 PM Marcel Ziswiler marcel.ziswiler@toradex.com wrote:
On Wed, 2020-10-28 at 11:58 +0200, Igor Opaniuk wrote:
From: Max Krummenacher max.krummenacher@toradex.com
The used PMIC has been changed from RHOM BD71837 to NXP PCA9450A. Adjust the device tree accordingly. Remove the old ADC node as the ADC has been changed and has no longer a separate power rail.
Signed-off-by: Max Krummenacher max.krummenacher@toradex.com Signed-off-by: Igor Opaniuk igor.opaniuk@toradex.com
Acked-by: Marcel Ziswiler marcel.ziswiler@toradex.com
Reviewed-by: Oleksandr Suvorov oleksandr.suvorov@toradex.com
arch/arm/dts/imx8mm-verdin-u-boot.dtsi | 5 +- arch/arm/dts/imx8mm-verdin.dts | 154 +++++++++++++------------ 2 files changed, 80 insertions(+), 79 deletions(-)
diff --git a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi index fe6bb9bf03..249b0f8f66 100644 --- a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi +++ b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi @@ -2,7 +2,6 @@ /*
- Copyright 2020 Toradex
*/
/ { wdt-reboot { compatible = "wdt-reboot"; @@ -90,11 +89,11 @@ u-boot,dm-spl; };
-&{/soc@0/bus@30800000/i2c@30a20000/pmic@4b} { +&{/soc@0/bus@30800000/i2c@30a20000/pmic} { u-boot,dm-spl; };
-&{/soc@0/bus@30800000/i2c@30a20000/pmic@4b/regulators} { +&{/soc@0/bus@30800000/i2c@30a20000/pmic/regulators} { u-boot,dm-spl; };
diff --git a/arch/arm/dts/imx8mm-verdin.dts b/arch/arm/dts/imx8mm-verdin.dts index 1c67c08c88..fb0756d6e1 100644 --- a/arch/arm/dts/imx8mm-verdin.dts +++ b/arch/arm/dts/imx8mm-verdin.dts @@ -203,115 +203,123 @@ pinctrl-0 = <&pinctrl_i2c1>; status = "okay";
pmic@4b {
compatible = "rohm,bd71840", "rohm,bd71837";
bd71837,pmic-buck2-uses-i2c-dvs;
bd71837,pmic-buck2-dvs-voltage = <1000000>, <900000>, <0>; /* VDD_ARM: Run-Idle */
gpio_intr = <&gpio1 3 GPIO_ACTIVE_LOW>;
/* PMIC BD71837 PMIC_nINT GPIO1_IO3 */
/* Assembled on V1.1 HW and later */
pmic {
reg = <0x25>;
u-boot,dm-spl;
compatible = "nxp,pca9450a";
/* PMIC PCA9450 PMIC_nINT GPIO1_IO3 */ pinctrl-0 = <&pinctrl_pmic>;
reg = <0x4b>;
gpo {
rohm,drv = <0x0C>; /* 0b0000_1100 all gpos with cmos output mode */
};
gpio_intr = <&gpio1 3 GPIO_ACTIVE_LOW>; regulators {
buck1_reg: BUCK1 {
regulator-always-on;
regulator-boot-on;
u-boot,dm-spl;
#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-max-microvolt = <1300000>;
regulator-min-microvolt = <700000>;
regulator-ramp-delay = <1250>;
regulator-min-microvolt = <600000>;
regulator-max-microvolt = <2187500>;
regulator-boot-on;
regulator-always-on;
regulator-ramp-delay = <3125>; };
buck2_reg: BUCK2 {
regulator-always-on;
regulator-boot-on;
buck2_reg: regulator@1 {
reg = <1>; regulator-compatible = "buck2";
regulator-max-microvolt = <1300000>;
regulator-min-microvolt = <700000>;
regulator-ramp-delay = <1250>;
regulator-min-microvolt = <600000>;
regulator-max-microvolt = <2187500>;
regulator-boot-on;
regulator-always-on;
regulator-ramp-delay = <3125>; };
buck5_reg: BUCK5 {
regulator-always-on;
buck3_reg: regulator@2 {
reg = <2>;
regulator-compatible = "buck3";
regulator-min-microvolt = <600000>;
regulator-max-microvolt = <2187500>; regulator-boot-on;
regulator-compatible = "buck5";
regulator-max-microvolt = <1350000>;
regulator-min-microvolt = <700000>;
regulator-always-on; };
buck6_reg: BUCK6 {
regulator-always-on;
buck4_reg: regulator@3 {
reg = <3>;
regulator-compatible = "buck4";
regulator-min-microvolt = <600000>;
regulator-max-microvolt = <3400000>; regulator-boot-on;
regulator-compatible = "buck6";
regulator-max-microvolt = <3300000>;
regulator-min-microvolt = <3000000>;
regulator-always-on; };
buck7_reg: BUCK7 {
regulator-always-on;
buck5_reg: regulator@4 {
reg = <4>;
regulator-compatible = "buck5";
regulator-min-microvolt = <600000>;
regulator-max-microvolt = <3400000>; regulator-boot-on;
regulator-compatible = "buck7";
regulator-max-microvolt = <1995000>;
regulator-min-microvolt = <1605000>;
regulator-always-on; };
buck8_reg: BUCK8 {
regulator-always-on;
buck6_reg: regulator@5 {
reg = <5>;
regulator-compatible = "buck6";
regulator-min-microvolt = <600000>;
regulator-max-microvolt = <3400000>; regulator-boot-on;
regulator-compatible = "buck8";
regulator-max-microvolt = <1400000>;
regulator-min-microvolt = <800000>;
regulator-always-on; };
ldo1_reg: LDO1 {
regulator-always-on;
regulator-boot-on;
ldo1_reg: regulator@6 {
reg = <6>; regulator-compatible = "ldo1";
regulator-min-microvolt = <1600000>; regulator-max-microvolt = <3300000>;
regulator-min-microvolt = <3000000>;
regulator-boot-on;
regulator-always-on; };
ldo2_reg: LDO2 {
regulator-always-on;
regulator-boot-on;
ldo2_reg: regulator@7 {
reg = <7>; regulator-compatible = "ldo2";
regulator-max-microvolt = <900000>;
regulator-min-microvolt = <900000>;
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <1150000>;
regulator-boot-on;
regulator-always-on; };
ldo3_reg: LDO3 {
regulator-always-on;
regulator-boot-on;
ldo3_reg: regulator@8 {
reg = <8>; regulator-compatible = "ldo3";
regulator-min-microvolt = <800000>; regulator-max-microvolt = <3300000>;
regulator-min-microvolt = <1800000>;
regulator-boot-on;
regulator-always-on; };
ldo4_reg: LDO4 {
regulator-always-on;
regulator-boot-on;
ldo4_reg: regulator@9 {
reg = <9>; regulator-compatible = "ldo4";
regulator-max-microvolt = <1800000>;
regulator-min-microvolt = <900000>;
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
regulator-always-on; };
ldo5_reg: LDO5 {
ldo5_reg: regulator@10 {
reg = <10>; regulator-compatible = "ldo5";
regulator-min-microvolt = <800000>; regulator-max-microvolt = <3300000>;
regulator-min-microvolt = <3300000>; };
ldo6_reg: LDO6 {
regulator-always-on;
regulator-boot-on;
regulator-compatible = "ldo6";
regulator-max-microvolt = <1800000>;
regulator-min-microvolt = <900000>;
}; }; };
@@ -321,12 +329,6 @@ reg = <0x32>; };
adc@34 {
compatible = "maxim,max11607";
reg = <0x34>;
vcc-supply = <&ldo5_reg>;
};
eeprom_module: eeprom@50 { compatible = "st,24c02", "atmel,24c02", "i2c-eeprom"; pagesize = <16>;

From: Max Krummenacher max.krummenacher@toradex.com The used PMIC has been changed from RHOM BD71837 to NXP PCA9450A. Adjust the device tree accordingly. Remove the old ADC node as the ADC has been changed and has no longer a separate power rail. Signed-off-by: Max Krummenacher max.krummenacher@toradex.com Signed-off-by: Igor Opaniuk igor.opaniuk@toradex.com Acked-by: Marcel Ziswiler marcel.ziswiler@toradex.com Reviewed-by: Oleksandr Suvorov oleksandr.suvorov@toradex.com
Applied to u-boot-imx, master, thanks !
Best regards, Stefano Babic

From: Max Krummenacher max.krummenacher@toradex.com
V1.1A HW switched the PMIC from BD71837 to PCA9450.
- Disable combined DVS in PCA9450_BUCK123_DVS. - Increase DDR Voltage to 0.95V as we use a 1.5GHz RAM. - Configure WDOG_B behaviour.
Signed-off-by: Max Krummenacher max.krummenacher@toradex.com Signed-off-by: Igor Opaniuk igor.opaniuk@toradex.com ---
board/toradex/verdin-imx8mm/spl.c | 42 +++++++++++++++---------------- configs/verdin-imx8mm_defconfig | 2 +- 2 files changed, 21 insertions(+), 23 deletions(-)
diff --git a/board/toradex/verdin-imx8mm/spl.c b/board/toradex/verdin-imx8mm/spl.c index cc78c5666b..9562cdeb35 100644 --- a/board/toradex/verdin-imx8mm/spl.c +++ b/board/toradex/verdin-imx8mm/spl.c @@ -21,12 +21,16 @@ #include <dm/uclass.h> #include <dm/uclass-internal.h> #include <hang.h> +#include <i2c.h> #include <power/bd71837.h> +#include <power/pca9450.h> #include <power/pmic.h> #include <spl.h>
DECLARE_GLOBAL_DATA_PTR;
+#define I2C_PMIC_BUS_ID 1 + int spl_board_boot_device(enum boot_device boot_dev_spl) { switch (boot_dev_spl) { @@ -101,33 +105,27 @@ int power_init_board(void) struct udevice *dev; int ret;
- ret = pmic_get("pmic@4b", &dev); - if (ret == -ENODEV) { - puts("No pmic\n"); - return 0; - } - if (ret != 0) - return ret; + if (IS_ENABLED(CONFIG_SPL_DM_PMIC_PCA9450)) { + ret = pmic_get("pmic", &dev); + if (ret == -ENODEV) { + puts("No pmic found\n"); + return ret; + }
- /* decrease RESET key long push time from the default 10s to 10ms */ - pmic_reg_write(dev, BD718XX_PWRONCONFIG1, 0x0); + if (ret != 0) + return ret;
- /* unlock the PMIC regs */ - pmic_reg_write(dev, BD718XX_REGLOCK, 0x1); + /* BUCKxOUT_DVS0/1 control BUCK123 output, clear PRESET_EN */ + pmic_reg_write(dev, PCA9450_BUCK123_DVS, 0x29);
- /* increase VDD_SOC to typical value 0.85v before first DRAM access */ - pmic_reg_write(dev, BD718XX_BUCK1_VOLT_RUN, 0x0f); + /* increase VDD_DRAM to 0.975v for 1.5Ghz DDR */ + pmic_reg_write(dev, PCA9450_BUCK3OUT_DVS0, 0x1c);
- /* increase VDD_DRAM to 0.975v for 3Ghz DDR */ - pmic_reg_write(dev, BD718XX_1ST_NODVS_BUCK_VOLT, 0x83); + /* set WDOG_B_CFG to cold reset */ + pmic_reg_write(dev, PCA9450_RESET_CTRL, 0xA1);
-#ifndef CONFIG_IMX8M_LPDDR4 - /* increase NVCC_DRAM_1V2 to 1.2v for DDR4 */ - pmic_reg_write(dev, BD718XX_4TH_NODVS_BUCK_VOLT, 0x28); -#endif - - /* lock the PMIC regs */ - pmic_reg_write(dev, BD718XX_REGLOCK, 0x11); + return 0; + }
return 0; } diff --git a/configs/verdin-imx8mm_defconfig b/configs/verdin-imx8mm_defconfig index 7ebfd6792f..d856e3a318 100644 --- a/configs/verdin-imx8mm_defconfig +++ b/configs/verdin-imx8mm_defconfig @@ -91,7 +91,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_PMIC_PFUZE100=y CONFIG_DM_REGULATOR=y CONFIG_DM_REGULATOR_FIXED=y

On Wed, 2020-10-28 at 11:58 +0200, Igor Opaniuk wrote:
From: Max Krummenacher max.krummenacher@toradex.com
V1.1A HW switched the PMIC from BD71837 to PCA9450.
- Disable combined DVS in PCA9450_BUCK123_DVS.
- Increase DDR Voltage to 0.95V as we use a 1.5GHz RAM.
- Configure WDOG_B behaviour.
Signed-off-by: Max Krummenacher max.krummenacher@toradex.com Signed-off-by: Igor Opaniuk igor.opaniuk@toradex.com
Acked-by: Marcel Ziswiler marcel.ziswiler@toradex.com
board/toradex/verdin-imx8mm/spl.c | 42 +++++++++++++++---------------- configs/verdin-imx8mm_defconfig | 2 +- 2 files changed, 21 insertions(+), 23 deletions(-)
diff --git a/board/toradex/verdin-imx8mm/spl.c b/board/toradex/verdin-imx8mm/spl.c index cc78c5666b..9562cdeb35 100644 --- a/board/toradex/verdin-imx8mm/spl.c +++ b/board/toradex/verdin-imx8mm/spl.c @@ -21,12 +21,16 @@ #include <dm/uclass.h> #include <dm/uclass-internal.h> #include <hang.h> +#include <i2c.h> #include <power/bd71837.h> +#include <power/pca9450.h> #include <power/pmic.h> #include <spl.h> DECLARE_GLOBAL_DATA_PTR; +#define I2C_PMIC_BUS_ID 1
int spl_board_boot_device(enum boot_device boot_dev_spl) { switch (boot_dev_spl) { @@ -101,33 +105,27 @@ int power_init_board(void) struct udevice *dev; int ret; - ret = pmic_get("pmic@4b", &dev); - if (ret == -ENODEV) { - puts("No pmic\n"); - return 0; - } - if (ret != 0) - return ret; + if (IS_ENABLED(CONFIG_SPL_DM_PMIC_PCA9450)) { + ret = pmic_get("pmic", &dev); + if (ret == -ENODEV) { + puts("No pmic found\n"); + return ret; + } - /* decrease RESET key long push time from the default 10s to 10ms */ - pmic_reg_write(dev, BD718XX_PWRONCONFIG1, 0x0); + if (ret != 0) + return ret; - /* unlock the PMIC regs */ - pmic_reg_write(dev, BD718XX_REGLOCK, 0x1); + /* BUCKxOUT_DVS0/1 control BUCK123 output, clear PRESET_EN */ + pmic_reg_write(dev, PCA9450_BUCK123_DVS, 0x29); - /* increase VDD_SOC to typical value 0.85v before first DRAM access */ - pmic_reg_write(dev, BD718XX_BUCK1_VOLT_RUN, 0x0f); + /* increase VDD_DRAM to 0.975v for 1.5Ghz DDR */ + pmic_reg_write(dev, PCA9450_BUCK3OUT_DVS0, 0x1c); - /* increase VDD_DRAM to 0.975v for 3Ghz DDR */ - pmic_reg_write(dev, BD718XX_1ST_NODVS_BUCK_VOLT, 0x83); + /* set WDOG_B_CFG to cold reset */ + pmic_reg_write(dev, PCA9450_RESET_CTRL, 0xA1); -#ifndef CONFIG_IMX8M_LPDDR4 - /* increase NVCC_DRAM_1V2 to 1.2v for DDR4 */ - pmic_reg_write(dev, BD718XX_4TH_NODVS_BUCK_VOLT, 0x28); -#endif
- /* lock the PMIC regs */ - pmic_reg_write(dev, BD718XX_REGLOCK, 0x11); + return 0; + } return 0; } diff --git a/configs/verdin-imx8mm_defconfig b/configs/verdin-imx8mm_defconfig index 7ebfd6792f..d856e3a318 100644 --- a/configs/verdin-imx8mm_defconfig +++ b/configs/verdin-imx8mm_defconfig @@ -91,7 +91,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_PMIC_PFUZE100=y CONFIG_DM_REGULATOR=y CONFIG_DM_REGULATOR_FIXED=y

On Thu, Oct 29, 2020 at 4:44 PM Marcel Ziswiler marcel.ziswiler@toradex.com wrote:
On Wed, 2020-10-28 at 11:58 +0200, Igor Opaniuk wrote:
From: Max Krummenacher max.krummenacher@toradex.com
V1.1A HW switched the PMIC from BD71837 to PCA9450.
- Disable combined DVS in PCA9450_BUCK123_DVS.
- Increase DDR Voltage to 0.95V as we use a 1.5GHz RAM.
- Configure WDOG_B behaviour.
Signed-off-by: Max Krummenacher max.krummenacher@toradex.com Signed-off-by: Igor Opaniuk igor.opaniuk@toradex.com
Acked-by: Marcel Ziswiler marcel.ziswiler@toradex.com
Reviewed-by: Oleksandr Suvorov oleksandr.suvorov@toradex.com
board/toradex/verdin-imx8mm/spl.c | 42 +++++++++++++++---------------- configs/verdin-imx8mm_defconfig | 2 +- 2 files changed, 21 insertions(+), 23 deletions(-)
diff --git a/board/toradex/verdin-imx8mm/spl.c b/board/toradex/verdin-imx8mm/spl.c index cc78c5666b..9562cdeb35 100644 --- a/board/toradex/verdin-imx8mm/spl.c +++ b/board/toradex/verdin-imx8mm/spl.c @@ -21,12 +21,16 @@ #include <dm/uclass.h> #include <dm/uclass-internal.h> #include <hang.h> +#include <i2c.h> #include <power/bd71837.h> +#include <power/pca9450.h> #include <power/pmic.h> #include <spl.h>
DECLARE_GLOBAL_DATA_PTR;
+#define I2C_PMIC_BUS_ID 1
int spl_board_boot_device(enum boot_device boot_dev_spl) { switch (boot_dev_spl) { @@ -101,33 +105,27 @@ int power_init_board(void) struct udevice *dev; int ret;
ret = pmic_get("pmic@4b", &dev);
if (ret == -ENODEV) {
puts("No pmic\n");
return 0;
}
if (ret != 0)
return ret;
if (IS_ENABLED(CONFIG_SPL_DM_PMIC_PCA9450)) {
ret = pmic_get("pmic", &dev);
if (ret == -ENODEV) {
puts("No pmic found\n");
return ret;
}
/* decrease RESET key long push time from the default 10s to 10ms */
pmic_reg_write(dev, BD718XX_PWRONCONFIG1, 0x0);
if (ret != 0)
return ret;
/* unlock the PMIC regs */
pmic_reg_write(dev, BD718XX_REGLOCK, 0x1);
/* BUCKxOUT_DVS0/1 control BUCK123 output, clear PRESET_EN */
pmic_reg_write(dev, PCA9450_BUCK123_DVS, 0x29);
/* increase VDD_SOC to typical value 0.85v before first DRAM access */
pmic_reg_write(dev, BD718XX_BUCK1_VOLT_RUN, 0x0f);
/* increase VDD_DRAM to 0.975v for 1.5Ghz DDR */
pmic_reg_write(dev, PCA9450_BUCK3OUT_DVS0, 0x1c);
/* increase VDD_DRAM to 0.975v for 3Ghz DDR */
pmic_reg_write(dev, BD718XX_1ST_NODVS_BUCK_VOLT, 0x83);
/* set WDOG_B_CFG to cold reset */
pmic_reg_write(dev, PCA9450_RESET_CTRL, 0xA1);
-#ifndef CONFIG_IMX8M_LPDDR4
/* increase NVCC_DRAM_1V2 to 1.2v for DDR4 */
pmic_reg_write(dev, BD718XX_4TH_NODVS_BUCK_VOLT, 0x28);
-#endif
/* lock the PMIC regs */
pmic_reg_write(dev, BD718XX_REGLOCK, 0x11);
return 0;
} return 0;
} diff --git a/configs/verdin-imx8mm_defconfig b/configs/verdin-imx8mm_defconfig index 7ebfd6792f..d856e3a318 100644 --- a/configs/verdin-imx8mm_defconfig +++ b/configs/verdin-imx8mm_defconfig @@ -91,7 +91,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_PMIC_PFUZE100=y CONFIG_DM_REGULATOR=y CONFIG_DM_REGULATOR_FIXED=y
-- Best regards Oleksandr Suvorov
Toradex AG Ebenaustrasse 10 | 6048 Horw | Switzerland | T: +41 41 500 48 00

From: Max Krummenacher max.krummenacher@toradex.com V1.1A HW switched the PMIC from BD71837 to PCA9450.
- Disable combined DVS in PCA9450_BUCK123_DVS.
- Increase DDR Voltage to 0.95V as we use a 1.5GHz RAM.
- Configure WDOG_B behaviour.
Signed-off-by: Max Krummenacher max.krummenacher@toradex.com Signed-off-by: Igor Opaniuk igor.opaniuk@toradex.com Acked-by: Marcel Ziswiler marcel.ziswiler@toradex.com Reviewed-by: Oleksandr Suvorov oleksandr.suvorov@toradex.com
Applied to u-boot-imx, master, thanks !
Best regards, Stefano Babic

From: Max Krummenacher max.krummenacher@toradex.com
And select the correct devicetree accordingly by setting the variant environment variable.
Signed-off-by: Igor Opaniuk igor.opaniuk@toradex.com Signed-off-by: Max Krummenacher max.krummenacher@toradex.com ---
board/toradex/verdin-imx8mm/verdin-imx8mm.c | 71 +++++++++++++++++++++ 1 file changed, 71 insertions(+)
diff --git a/board/toradex/verdin-imx8mm/verdin-imx8mm.c b/board/toradex/verdin-imx8mm/verdin-imx8mm.c index 66950ed218..9c6f35e778 100644 --- a/board/toradex/verdin-imx8mm/verdin-imx8mm.c +++ b/board/toradex/verdin-imx8mm/verdin-imx8mm.c @@ -8,12 +8,22 @@ #include <asm/arch/clock.h> #include <asm/arch/sys_proto.h> #include <asm/io.h> +#include <i2c.h> #include <miiphy.h> #include <netdev.h> #include <micrel.h>
+#include "../common/tdx-cfg-block.h" + DECLARE_GLOBAL_DATA_PTR;
+#define I2C_PMIC 0 + +enum pcb_rev_t { + PCB_VERSION_1_0, + PCB_VERSION_1_1 +}; + #if IS_ENABLED(CONFIG_FEC_MXC) static int setup_fec(void) { @@ -104,8 +114,69 @@ int board_mmc_get_env_dev(int devno) return devno; }
+static enum pcb_rev_t get_pcb_revision(void) +{ + struct udevice *bus; + struct udevice *i2c_dev = NULL; + int ret; + u8 is_bd71837 = 0; + + ret = uclass_get_device_by_seq(UCLASS_I2C, I2C_PMIC, &bus); + if (!ret) + ret = dm_i2c_probe(bus, 0x4b, 0, &i2c_dev); + if (!ret) + ret = dm_i2c_read(i2c_dev, 0x0, &is_bd71837, 1); + + /* BD71837_REV, High Nibble is major version, fix 1010 */ + is_bd71837 = !ret && ((is_bd71837 & 0xf0) == 0xa0); + return is_bd71837 ? PCB_VERSION_1_0 : PCB_VERSION_1_1; +} + +static void select_dt_from_module_version(void) +{ + char variant[32]; + char *env_variant = env_get("variant"); + int is_wifi = 0; + + if (IS_ENABLED(CONFIG_TDX_CFG_BLOCK)) { + /* + * If we have a valid config block and it says we are a + * module with Wi-Fi/Bluetooth make sure we use the -wifi + * device tree. + */ + is_wifi = (tdx_hw_tag.prodid == VERDIN_IMX8MMQ_WIFI_BT_IT) || + (tdx_hw_tag.prodid == VERDIN_IMX8MMDL_WIFI_BT_IT); + } + + switch (get_pcb_revision()) { + case PCB_VERSION_1_0: + printf("Detected a V1.0 module\n"); + if (is_wifi) + strncpy(&variant[0], "wifi", sizeof(variant)); + else + strncpy(&variant[0], "nonwifi", sizeof(variant)); + break; + default: + if (is_wifi) + strncpy(&variant[0], "wifi-v1.1", sizeof(variant)); + else + strncpy(&variant[0], "nonwifi-v1.1", sizeof(variant)); + break; + } + + if (strcmp(variant, env_variant)) { + printf("Setting variant to %s\n", variant); + env_set("variant", variant); + + if (IS_ENABLED(CONFIG_ENV_IS_NOWHERE)) + env_save(); + } +} + int board_late_init(void) { + select_dt_from_module_version(); + return 0; }

Besides a monor nitpick further below.
On Wed, 2020-10-28 at 11:58 +0200, Igor Opaniuk wrote:
From: Max Krummenacher max.krummenacher@toradex.com
And select the correct devicetree accordingly by setting the variant environment variable.
Signed-off-by: Igor Opaniuk igor.opaniuk@toradex.com Signed-off-by: Max Krummenacher max.krummenacher@toradex.com
Acked-by: Marcel Ziswiler marcel.ziswiler@toradex.com
board/toradex/verdin-imx8mm/verdin-imx8mm.c | 71 +++++++++++++++++++++ 1 file changed, 71 insertions(+)
diff --git a/board/toradex/verdin-imx8mm/verdin-imx8mm.c b/board/toradex/verdin-imx8mm/verdin-imx8mm.c index 66950ed218..9c6f35e778 100644 --- a/board/toradex/verdin-imx8mm/verdin-imx8mm.c +++ b/board/toradex/verdin-imx8mm/verdin-imx8mm.c @@ -8,12 +8,22 @@ #include <asm/arch/clock.h> #include <asm/arch/sys_proto.h> #include <asm/io.h> +#include <i2c.h> #include <miiphy.h> #include <netdev.h> #include <micrel.h>
Above something with the include order seems messed up.
+#include "../common/tdx-cfg-block.h"
DECLARE_GLOBAL_DATA_PTR; +#define I2C_PMIC 0
+enum pcb_rev_t { + PCB_VERSION_1_0, + PCB_VERSION_1_1 +};
#if IS_ENABLED(CONFIG_FEC_MXC) static int setup_fec(void) { @@ -104,8 +114,69 @@ int board_mmc_get_env_dev(int devno) return devno; } +static enum pcb_rev_t get_pcb_revision(void) +{ + struct udevice *bus; + struct udevice *i2c_dev = NULL; + int ret; + u8 is_bd71837 = 0;
+ ret = uclass_get_device_by_seq(UCLASS_I2C, I2C_PMIC, &bus); + if (!ret) + ret = dm_i2c_probe(bus, 0x4b, 0, &i2c_dev); + if (!ret) + ret = dm_i2c_read(i2c_dev, 0x0, &is_bd71837, 1);
+ /* BD71837_REV, High Nibble is major version, fix 1010 */ + is_bd71837 = !ret && ((is_bd71837 & 0xf0) == 0xa0); + return is_bd71837 ? PCB_VERSION_1_0 : PCB_VERSION_1_1; +}
+static void select_dt_from_module_version(void) +{ + char variant[32]; + char *env_variant = env_get("variant"); + int is_wifi = 0;
+ if (IS_ENABLED(CONFIG_TDX_CFG_BLOCK)) { + /* + * If we have a valid config block and it says we are a + * module with Wi-Fi/Bluetooth make sure we use the -wifi + * device tree. + */ + is_wifi = (tdx_hw_tag.prodid == VERDIN_IMX8MMQ_WIFI_BT_IT) || + (tdx_hw_tag.prodid == VERDIN_IMX8MMDL_WIFI_BT_IT); + }
+ switch (get_pcb_revision()) { + case PCB_VERSION_1_0: + printf("Detected a V1.0 module\n"); + if (is_wifi) + strncpy(&variant[0], "wifi", sizeof(variant)); + else + strncpy(&variant[0], "nonwifi", sizeof(variant)); + break; + default: + if (is_wifi) + strncpy(&variant[0], "wifi-v1.1", sizeof(variant)); + else + strncpy(&variant[0], "nonwifi-v1.1", sizeof(variant)); + break; + }
+ if (strcmp(variant, env_variant)) { + printf("Setting variant to %s\n", variant); + env_set("variant", variant);
+ if (IS_ENABLED(CONFIG_ENV_IS_NOWHERE)) + env_save(); + } +}
int board_late_init(void) { + select_dt_from_module_version();
return 0; }

From: Max Krummenacher max.krummenacher@toradex.com And select the correct devicetree accordingly by setting the variant environment variable. Signed-off-by: Igor Opaniuk igor.opaniuk@toradex.com Signed-off-by: Max Krummenacher max.krummenacher@toradex.com Acked-by: Marcel Ziswiler marcel.ziswiler@toradex.com
Applied to u-boot-imx, master, thanks !
Best regards, Stefano Babic

From: Max Krummenacher max.krummenacher@toradex.com
Enable PCA9450 i2c level translator, as this is used for the on module ADC.
Signed-off-by: Max Krummenacher max.krummenacher@toradex.com ---
board/toradex/verdin-imx8mm/spl.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/board/toradex/verdin-imx8mm/spl.c b/board/toradex/verdin-imx8mm/spl.c index 9562cdeb35..72e2e09e25 100644 --- a/board/toradex/verdin-imx8mm/spl.c +++ b/board/toradex/verdin-imx8mm/spl.c @@ -124,6 +124,8 @@ int power_init_board(void) /* set WDOG_B_CFG to cold reset */ pmic_reg_write(dev, PCA9450_RESET_CTRL, 0xA1);
+ pmic_reg_write(dev, PCA9450_CONFIG2, 0x1); + return 0; }

On Wed, 2020-10-28 at 11:58 +0200, Igor Opaniuk wrote:
From: Max Krummenacher max.krummenacher@toradex.com
Enable PCA9450 i2c level translator, as this is used for the on module ADC.
Signed-off-by: Max Krummenacher max.krummenacher@toradex.com
Acked-by: Marcel Ziswiler marcel.ziswiler@toradex.com
board/toradex/verdin-imx8mm/spl.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/board/toradex/verdin-imx8mm/spl.c b/board/toradex/verdin-imx8mm/spl.c index 9562cdeb35..72e2e09e25 100644 --- a/board/toradex/verdin-imx8mm/spl.c +++ b/board/toradex/verdin-imx8mm/spl.c @@ -124,6 +124,8 @@ int power_init_board(void) /* set WDOG_B_CFG to cold reset */ pmic_reg_write(dev, PCA9450_RESET_CTRL, 0xA1); + pmic_reg_write(dev, PCA9450_CONFIG2, 0x1);
return 0; }

On Thu, Oct 29, 2020 at 4:49 PM Marcel Ziswiler marcel.ziswiler@toradex.com wrote:
On Wed, 2020-10-28 at 11:58 +0200, Igor Opaniuk wrote:
From: Max Krummenacher max.krummenacher@toradex.com
Enable PCA9450 i2c level translator, as this is used for the on module ADC.
Signed-off-by: Max Krummenacher max.krummenacher@toradex.com
Acked-by: Marcel Ziswiler marcel.ziswiler@toradex.com
Reviewed-by: Oleksandr Suvorov oleksandr.suvorov@toradex.com
board/toradex/verdin-imx8mm/spl.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/board/toradex/verdin-imx8mm/spl.c b/board/toradex/verdin-imx8mm/spl.c index 9562cdeb35..72e2e09e25 100644 --- a/board/toradex/verdin-imx8mm/spl.c +++ b/board/toradex/verdin-imx8mm/spl.c @@ -124,6 +124,8 @@ int power_init_board(void) /* set WDOG_B_CFG to cold reset */ pmic_reg_write(dev, PCA9450_RESET_CTRL, 0xA1);
pmic_reg_write(dev, PCA9450_CONFIG2, 0x1);
return 0; }

From: Max Krummenacher max.krummenacher@toradex.com Enable PCA9450 i2c level translator, as this is used for the on module ADC. Signed-off-by: Max Krummenacher max.krummenacher@toradex.com Acked-by: Marcel Ziswiler marcel.ziswiler@toradex.com Reviewed-by: Oleksandr Suvorov oleksandr.suvorov@toradex.com
Applied to u-boot-imx, master, thanks !
Best regards, Stefano Babic

From: Marcel Ziswiler marcel.ziswiler@toradex.com
Now with them first Verdin iMX8M Mini DualLite modules in for bring-up we got clarity how is_cpu_type() actually behaves.
Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com ---
board/toradex/common/tdx-cfg-block.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-)
diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c index 475abf78a7..adab0a0802 100644 --- a/board/toradex/common/tdx-cfg-block.c +++ b/board/toradex/common/tdx-cfg-block.c @@ -423,12 +423,6 @@ static int get_cfgblock_interactive(void) tdx_hw_tag.prodid = COLIBRI_IMX7D; else if (!strcmp("imx7s", soc)) tdx_hw_tag.prodid = COLIBRI_IMX7S; - else if (is_cpu_type(MXC_CPU_IMX8MM)) - tdx_hw_tag.prodid = VERDIN_IMX8MMQ_WIFI_BT_IT; - else if (is_cpu_type(MXC_CPU_IMX8MMDL)) - tdx_hw_tag.prodid = VERDIN_IMX8MMDL; - else if (is_cpu_type(MXC_CPU_IMX8MN)) - tdx_hw_tag.prodid = VERDIN_IMX8MNQ_WIFI_BT; else if (is_cpu_type(MXC_CPU_IMX8QM)) { if (it == 'y' || it == 'Y') { if (wb == 'y' || wb == 'Y') @@ -464,18 +458,16 @@ static int get_cfgblock_interactive(void) tdx_hw_tag.prodid = COLIBRI_IMX8DX; } #endif + } else if (is_cpu_type(MXC_CPU_IMX8MMDL)) { + if (wb == 'y' || wb == 'Y') + tdx_hw_tag.prodid = VERDIN_IMX8MMDL_WIFI_BT_IT; + else + tdx_hw_tag.prodid = VERDIN_IMX8MMDL; } else if (is_cpu_type(MXC_CPU_IMX8MM)) { - if (is_cpu_type(MXC_CPU_IMX8MMDL)) { - if (wb == 'y' || wb == 'Y') - tdx_hw_tag.prodid = VERDIN_IMX8MMDL_WIFI_BT_IT; - else - tdx_hw_tag.prodid = VERDIN_IMX8MMDL; - } else { - if (wb == 'y' || wb == 'Y') - tdx_hw_tag.prodid = VERDIN_IMX8MMQ_WIFI_BT_IT; - else - tdx_hw_tag.prodid = VERDIN_IMX8MMQ_IT; - } + if (wb == 'y' || wb == 'Y') + tdx_hw_tag.prodid = VERDIN_IMX8MMQ_WIFI_BT_IT; + else + tdx_hw_tag.prodid = VERDIN_IMX8MMQ_IT; } else if (is_cpu_type(MXC_CPU_IMX8MN)) { tdx_hw_tag.prodid = VERDIN_IMX8MNQ_WIFI_BT; } else if (is_cpu_type(MXC_CPU_IMX8MP)) {

On Wed, Oct 28, 2020 at 11:59 AM Igor Opaniuk igor.opaniuk@gmail.com wrote:
From: Marcel Ziswiler marcel.ziswiler@toradex.com
Now with them first Verdin iMX8M Mini DualLite modules in for bring-up we got clarity how is_cpu_type() actually behaves.
Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com
Reviewed-by: Oleksandr Suvorov oleksandr.suvorov@toradex.com
with a note: the commit message seems to have a typo s/them/the/, isn't it?
board/toradex/common/tdx-cfg-block.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-)
diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c index 475abf78a7..adab0a0802 100644 --- a/board/toradex/common/tdx-cfg-block.c +++ b/board/toradex/common/tdx-cfg-block.c @@ -423,12 +423,6 @@ static int get_cfgblock_interactive(void) tdx_hw_tag.prodid = COLIBRI_IMX7D; else if (!strcmp("imx7s", soc)) tdx_hw_tag.prodid = COLIBRI_IMX7S;
else if (is_cpu_type(MXC_CPU_IMX8MM))
tdx_hw_tag.prodid = VERDIN_IMX8MMQ_WIFI_BT_IT;
else if (is_cpu_type(MXC_CPU_IMX8MMDL))
tdx_hw_tag.prodid = VERDIN_IMX8MMDL;
else if (is_cpu_type(MXC_CPU_IMX8MN))
tdx_hw_tag.prodid = VERDIN_IMX8MNQ_WIFI_BT; else if (is_cpu_type(MXC_CPU_IMX8QM)) { if (it == 'y' || it == 'Y') { if (wb == 'y' || wb == 'Y')
@@ -464,18 +458,16 @@ static int get_cfgblock_interactive(void) tdx_hw_tag.prodid = COLIBRI_IMX8DX; } #endif
} else if (is_cpu_type(MXC_CPU_IMX8MMDL)) {
if (wb == 'y' || wb == 'Y')
tdx_hw_tag.prodid = VERDIN_IMX8MMDL_WIFI_BT_IT;
else
tdx_hw_tag.prodid = VERDIN_IMX8MMDL; } else if (is_cpu_type(MXC_CPU_IMX8MM)) {
if (is_cpu_type(MXC_CPU_IMX8MMDL)) {
if (wb == 'y' || wb == 'Y')
tdx_hw_tag.prodid = VERDIN_IMX8MMDL_WIFI_BT_IT;
else
tdx_hw_tag.prodid = VERDIN_IMX8MMDL;
} else {
if (wb == 'y' || wb == 'Y')
tdx_hw_tag.prodid = VERDIN_IMX8MMQ_WIFI_BT_IT;
else
tdx_hw_tag.prodid = VERDIN_IMX8MMQ_IT;
}
if (wb == 'y' || wb == 'Y')
tdx_hw_tag.prodid = VERDIN_IMX8MMQ_WIFI_BT_IT;
else
tdx_hw_tag.prodid = VERDIN_IMX8MMQ_IT; } else if (is_cpu_type(MXC_CPU_IMX8MN)) { tdx_hw_tag.prodid = VERDIN_IMX8MNQ_WIFI_BT; } else if (is_cpu_type(MXC_CPU_IMX8MP)) {
-- 2.17.1

From: Marcel Ziswiler marcel.ziswiler@toradex.com Now with them first Verdin iMX8M Mini DualLite modules in for bring-up we got clarity how is_cpu_type() actually behaves. Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com Reviewed-by: Oleksandr Suvorov oleksandr.suvorov@toradex.com
Applied to u-boot-imx, master, thanks !
Best regards, Stefano Babic

From: Marcel Ziswiler marcel.ziswiler@toradex.com
Implement board_phys_sdram_size() to automatically detect Verdin iMX8M Mini DualLite 1GB vs. Verdin iMX8M Mini Quad 2GB.
Note: This only works if we keep using similar RAM chips!
Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com ---
board/toradex/verdin-imx8mm/verdin-imx8mm.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/board/toradex/verdin-imx8mm/verdin-imx8mm.c b/board/toradex/verdin-imx8mm/verdin-imx8mm.c index 9c6f35e778..7cfae8767c 100644 --- a/board/toradex/verdin-imx8mm/verdin-imx8mm.c +++ b/board/toradex/verdin-imx8mm/verdin-imx8mm.c @@ -180,6 +180,16 @@ int board_late_init(void) return 0; }
+int board_phys_sdram_size(phys_size_t *size) +{ + if (!size) + return -EINVAL; + + *size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE); + + return 0; +} + #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) int ft_board_setup(void *blob, struct bd_info *bd) {

On Wed, Oct 28, 2020 at 11:59 AM Igor Opaniuk igor.opaniuk@gmail.com wrote:
From: Marcel Ziswiler marcel.ziswiler@toradex.com
Implement board_phys_sdram_size() to automatically detect Verdin iMX8M Mini DualLite 1GB vs. Verdin iMX8M Mini Quad 2GB.
Note: This only works if we keep using similar RAM chips!
Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com
Acked-by: Oleksandr Suvorov oleksandr.suvorov@toradex.com
board/toradex/verdin-imx8mm/verdin-imx8mm.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/board/toradex/verdin-imx8mm/verdin-imx8mm.c b/board/toradex/verdin-imx8mm/verdin-imx8mm.c index 9c6f35e778..7cfae8767c 100644 --- a/board/toradex/verdin-imx8mm/verdin-imx8mm.c +++ b/board/toradex/verdin-imx8mm/verdin-imx8mm.c @@ -180,6 +180,16 @@ int board_late_init(void) return 0; }
+int board_phys_sdram_size(phys_size_t *size) +{
if (!size)
return -EINVAL;
*size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE);
return 0;
+}
#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) int ft_board_setup(void *blob, struct bd_info *bd) { -- 2.17.1
-- Best regards Oleksandr Suvorov
Toradex AG Ebenaustrasse 10 | 6048 Horw | Switzerland | T: +41 41 500 48 00

From: Marcel Ziswiler marcel.ziswiler@toradex.com Implement board_phys_sdram_size() to automatically detect Verdin iMX8M Mini DualLite 1GB vs. Verdin iMX8M Mini Quad 2GB. Note: This only works if we keep using similar RAM chips! Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com Acked-by: Oleksandr Suvorov oleksandr.suvorov@toradex.com
Applied to u-boot-imx, master, thanks !
Best regards, Stefano Babic

And Igor, don't forget to drop:
# CONFIG_CMD_IMPORTENV is not set
And add:
CONFIG_OF_LIBFDT_OVERLAY=y
That way our regular distro boot scripts will work out-of-the-box. Thanks!
BTW: With such series a cover letter aka [PATCH 0/0] might make sense. Good oldé patman can do all of that and more...
On Wed, 2020-10-28 at 11:58 +0200, Igor Opaniuk wrote:
From: Marcel Ziswiler marcel.ziswiler@toradex.com
Add new i.MX 8M Mini/Plus SKUs to ConfigBlock handling:
0058: Verdin iMX8M Plus Quad 4GB Wi-Fi / BT IT
0059: Verdin iMX8M Mini Quad 2GB IT
0060: Verdin iMX8M Mini DualLite 1GB WB IT
0061: Verdin iMX8M Plus Quad 2GB
Rename existing SKU (use correct one): Verdin iMX8M Nano SoloLite 1GB -> Verdin iMX8M Nano Quad 1GB Wi-Fi
Signed-off-by: Igor Opaniuk igor.opaniuk@toradex.com Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com
board/toradex/common/tdx-cfg-block.c | 42 ++++++++++++++++++++-------- board/toradex/common/tdx-cfg-block.h | 8 ++++-- 2 files changed, 36 insertions(+), 14 deletions(-)
diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c index bf27b2fa66..475abf78a7 100644 --- a/board/toradex/common/tdx-cfg-block.c +++ b/board/toradex/common/tdx-cfg-block.c @@ -16,7 +16,8 @@ defined(CONFIG_TARGET_COLIBRI_IMX6) || \ defined(CONFIG_TARGET_COLIBRI_IMX8X) || \ defined(CONFIG_TARGET_VERDIN_IMX8MM) || \ - defined(CONFIG_TARGET_VERDIN_IMX8MN) + defined(CONFIG_TARGET_VERDIN_IMX8MN) || \ + defined(CONFIG_TARGET_VERDIN_IMX8MP) #include <asm/arch/sys_proto.h> #else #define is_cpu_type(cpu) (0) @@ -137,8 +138,12 @@ const char * const toradex_modules[] = { [53] = "Apalis iMX8 QuadXPlus 2GB ECC IT", [54] = "Apalis iMX8 DualXPlus 1GB", [55] = "Verdin iMX8M Mini Quad 2GB Wi-Fi / BT IT", - [56] = "Verdin iMX8M Nano SoloLite 1GB", /* not currently on sale */ + [56] = "Verdin iMX8M Nano Quad 1GB Wi-Fi / BT", /* not currently on sale */ [57] = "Verdin iMX8M Mini DualLite 1GB", + [58] = "Verdin iMX8M Plus Quad 4GB Wi-Fi / BT IT", + [59] = "Verdin iMX8M Mini Quad 2GB IT", + [60] = "Verdin iMX8M Mini DualLite 1GB WB IT", + [61] = "Verdin iMX8M Plus Quad 2GB", }; const char * const toradex_carrier_boards[] = { @@ -361,21 +366,15 @@ static int get_cfgblock_interactive(void) if (cpu_is_pxa27x()) sprintf(message, "Is the module the 312 MHz version? [y/N] "); -#if !defined(CONFIG_TARGET_VERDIN_IMX8MM) || !defined(CONFIG_TARGET_VERDIN_IMX8MN) - else - sprintf(message, "Is the module an IT version? [y/N] ");
- len = cli_readline(message); - it = console_buffer[0]; -#else else it = 'y'; -#endif #if defined(CONFIG_TARGET_APALIS_IMX8) || \ defined(CONFIG_TARGET_APALIS_IMX8X) || \ defined(CONFIG_TARGET_COLIBRI_IMX6ULL) || \ - defined(CONFIG_TARGET_COLIBRI_IMX8X) + defined(CONFIG_TARGET_COLIBRI_IMX8X) || \ + defined(CONFIG_TARGET_VERDIN_IMX8MM) || \ + defined(CONFIG_TARGET_VERDIN_IMX8MP) sprintf(message, "Does the module have Wi-Fi / Bluetooth? [y/N] "); len = cli_readline(message); wb = console_buffer[0]; @@ -429,7 +428,7 @@ static int get_cfgblock_interactive(void) else if (is_cpu_type(MXC_CPU_IMX8MMDL)) tdx_hw_tag.prodid = VERDIN_IMX8MMDL; else if (is_cpu_type(MXC_CPU_IMX8MN)) - tdx_hw_tag.prodid = VERDIN_IMX8MNSL; + tdx_hw_tag.prodid = VERDIN_IMX8MNQ_WIFI_BT; else if (is_cpu_type(MXC_CPU_IMX8QM)) { if (it == 'y' || it == 'Y') { if (wb == 'y' || wb == 'Y') @@ -465,6 +464,25 @@ static int get_cfgblock_interactive(void) tdx_hw_tag.prodid = COLIBRI_IMX8DX; } #endif + } else if (is_cpu_type(MXC_CPU_IMX8MM)) { + if (is_cpu_type(MXC_CPU_IMX8MMDL)) { + if (wb == 'y' || wb == 'Y') + tdx_hw_tag.prodid = VERDIN_IMX8MMDL_WIFI_BT_IT; + else + tdx_hw_tag.prodid = VERDIN_IMX8MMDL; + } else { + if (wb == 'y' || wb == 'Y') + tdx_hw_tag.prodid = VERDIN_IMX8MMQ_WIFI_BT_IT; + else + tdx_hw_tag.prodid = VERDIN_IMX8MMQ_IT; + } + } else if (is_cpu_type(MXC_CPU_IMX8MN)) { + tdx_hw_tag.prodid = VERDIN_IMX8MNQ_WIFI_BT; + } else if (is_cpu_type(MXC_CPU_IMX8MP)) { + if (wb == 'y' || wb == 'Y') + tdx_hw_tag.prodid = VERDIN_IMX8MPQ_WIFI_BT_IT; + else + tdx_hw_tag.prodid = VERDIN_IMX8MPQ; } else if (!strcmp("tegra20", soc)) { if (it == 'y' || it == 'Y') if (gd->ram_size == 0x10000000) diff --git a/board/toradex/common/tdx-cfg-block.h b/board/toradex/common/tdx-cfg-block.h index 8f91d9aec6..9debd5f046 100644 --- a/board/toradex/common/tdx-cfg-block.h +++ b/board/toradex/common/tdx-cfg-block.h @@ -75,9 +75,13 @@ enum { COLIBRI_IMX8DX, APALIS_IMX8QXP, APALIS_IMX8DXP, - VERDIN_IMX8MMQ_WIFI_BT_IT, - VERDIN_IMX8MNSL, + VERDIN_IMX8MMQ_WIFI_BT_IT, /* 55 */ + VERDIN_IMX8MNQ_WIFI_BT, VERDIN_IMX8MMDL, + VERDIN_IMX8MPQ_WIFI_BT_IT, + VERDIN_IMX8MMQ_IT, + VERDIN_IMX8MMDL_WIFI_BT_IT, /* 60 */ + VERDIN_IMX8MPQ, }; enum {

From: Marcel Ziswiler marcel.ziswiler@toradex.com Add new i.MX 8M Mini/Plus SKUs to ConfigBlock handling: 0058: Verdin iMX8M Plus Quad 4GB Wi-Fi / BT IT 0059: Verdin iMX8M Mini Quad 2GB IT 0060: Verdin iMX8M Mini DualLite 1GB WB IT 0061: Verdin iMX8M Plus Quad 2GB Rename existing SKU (use correct one): Verdin iMX8M Nano SoloLite 1GB -> Verdin iMX8M Nano Quad 1GB Wi-Fi Signed-off-by: Igor Opaniuk igor.opaniuk@toradex.com Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com
Applied to u-boot-imx, master, thanks !
Best regards, Stefano Babic
participants (5)
-
Igor Opaniuk
-
Jaehoon Chung
-
Marcel Ziswiler
-
Oleksandr Suvorov
-
sbabic@denx.de