[PATCH] imx8mp_evk: Simplify FEC initialization

2023-10-19 Thread Fabio Estevam
From: Fabio Estevam 

With DM enabled, there is no need for board code to initialize
the FEC interface.

The RTL8211FDI Ethernet PHYs have 25MHz oscillator, so there is no
need to enable the RGMII TX clk output.

Also, there is no need for describing the deprecated phy-reset properties
in u-boot.dtsi.

Remove all these uneeded pieces.

Signed-off-by: Fabio Estevam 
---
 arch/arm/dts/imx8mp-evk-u-boot.dtsi |  8 
 board/freescale/imx8mp_evk/imx8mp_evk.c | 26 +
 2 files changed, 1 insertion(+), 33 deletions(-)

diff --git a/arch/arm/dts/imx8mp-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
index 43f13a9c22f7..db6bc6a11883 100644
--- a/arch/arm/dts/imx8mp-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
@@ -150,11 +150,3 @@
reset-delay-us = <15000>;
reset-post-delay-us = <10>;
 };
-
- {
-   phy-reset-gpios = < 2 GPIO_ACTIVE_LOW>;
-   phy-reset-duration = <15>;
-   phy-reset-post-delay = <100>;
-};
-
-
diff --git a/board/freescale/imx8mp_evk/imx8mp_evk.c 
b/board/freescale/imx8mp_evk/imx8mp_evk.c
index a24b8c1d8608..2c2b8383c8dc 100644
--- a/board/freescale/imx8mp_evk/imx8mp_evk.c
+++ b/board/freescale/imx8mp_evk/imx8mp_evk.c
@@ -20,33 +20,9 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static void setup_fec(void)
-{
-   struct iomuxc_gpr_base_regs *gpr =
-   (struct iomuxc_gpr_base_regs *)IOMUXC_GPR_BASE_ADDR;
-
-   /* Enable RGMII TX clk output */
-   setbits_le32(>gpr[1], BIT(22));
-}
-
-#if CONFIG_IS_ENABLED(NET)
-int board_phy_config(struct phy_device *phydev)
-{
-   if (phydev->drv->config)
-   phydev->drv->config(phydev);
-   return 0;
-}
-#endif
-
 int board_init(void)
 {
-   int ret = 0;
-
-   if (IS_ENABLED(CONFIG_FEC_MXC)) {
-   setup_fec();
-   }
-
-   return ret;
+   return 0;
 }
 
 int board_late_init(void)
-- 
2.34.1



[PATCH] phy: phy-imx8mq-usb: Remove .exit operation

2023-10-19 Thread Fabio Estevam
From: Fabio Estevam 

Currently, when running "ums 0 mmc 2" and breaking it via
CTRL + C, the following message is seen:

u-boot=> ums 0 mmc 1
UMS: LUN 0, dev mmc 1, hwpart 0, sector 0x0, count 0x1dacc00
CTRL+C - Operation aborted
clk usb_phy_root_clk already disabled

The USB PHY clock is disabled twice: first it gets disabled
inside imx8mq_usb_phy_power_off(), then it is disabled again
inside imx8mq_usb_phy_exit().

Let the USB PHY clock be disabled only once inside
imx8mq_usb_phy_power_off() by removing the .exit operation.

Signed-off-by: Fabio Estevam 
---
 drivers/phy/phy-imx8mq-usb.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/phy/phy-imx8mq-usb.c b/drivers/phy/phy-imx8mq-usb.c
index b660eadecf1c..e5e96e77a681 100644
--- a/drivers/phy/phy-imx8mq-usb.c
+++ b/drivers/phy/phy-imx8mq-usb.c
@@ -231,16 +231,10 @@ static int imx8mq_usb_phy_power_off(struct phy *usb_phy)
return 0;
 }
 
-static int imx8mq_usb_phy_exit(struct phy *usb_phy)
-{
-   return imx8mq_usb_phy_power_off(usb_phy);
-}
-
 struct phy_ops imx8mq_usb_phy_ops = {
.init = imx8mpq_usb_phy_init,
.power_on = imx8mq_usb_phy_power_on,
.power_off = imx8mq_usb_phy_power_off,
-   .exit = imx8mq_usb_phy_exit,
 };
 
 int imx8mq_usb_phy_probe(struct udevice *dev)
-- 
2.34.1



[PATCH v2 3/3] arm: dts: imx8mp: Sync with linux-next 20231019

2023-10-19 Thread Fabio Estevam
From: Fabio Estevam 

Sync imx8mp.dtsi and imx8mp-clock.h with linux-next 20231019.

Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Rebased against latest U-Boot and synced with linux-next 20231019

 arch/arm/dts/imx8mp.dtsi | 542 ++-
 include/dt-bindings/clock/imx8mp-clock.h |   3 +-
 2 files changed, 526 insertions(+), 19 deletions(-)

diff --git a/arch/arm/dts/imx8mp.dtsi b/arch/arm/dts/imx8mp.dtsi
index 428c60462e3d..c9a610ba4836 100644
--- a/arch/arm/dts/imx8mp.dtsi
+++ b/arch/arm/dts/imx8mp.dtsi
@@ -202,6 +202,60 @@
clock-output-names = "clk_ext4";
};
 
+   funnel {
+   /*
+* non-configurable funnel don't show up on the AMBA
+* bus.  As such no need to add "arm,primecell".
+*/
+   compatible = "arm,coresight-static-funnel";
+
+   in-ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   port@0 {
+   reg = <0>;
+
+   ca_funnel_in_port0: endpoint {
+   remote-endpoint = <_out_port>;
+   };
+   };
+
+   port@1 {
+   reg = <1>;
+
+   ca_funnel_in_port1: endpoint {
+   remote-endpoint = <_out_port>;
+   };
+   };
+
+   port@2 {
+   reg = <2>;
+
+   ca_funnel_in_port2: endpoint {
+   remote-endpoint = <_out_port>;
+   };
+   };
+
+   port@3 {
+   reg = <3>;
+
+   ca_funnel_in_port3: endpoint {
+   remote-endpoint = <_out_port>;
+   };
+   };
+   };
+
+   out-ports {
+   port {
+
+   ca_funnel_out_port0: endpoint {
+   remote-endpoint = 
<_funnel_in_port0>;
+   };
+   };
+   };
+   };
+
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
@@ -304,6 +358,153 @@
nvmem-cells = <_uid>;
nvmem-cell-names = "soc_unique_id";
 
+   etm0: etm@2844 {
+   compatible = "arm,coresight-etm4x", "arm,primecell";
+   reg = <0x2844 0x1000>;
+   cpu = <_0>;
+   clocks = < IMX8MP_CLK_MAIN_AXI>;
+   clock-names = "apb_pclk";
+
+   out-ports {
+   port {
+   etm0_out_port: endpoint {
+   remote-endpoint = 
<_funnel_in_port0>;
+   };
+   };
+   };
+   };
+
+   etm1: etm@2854 {
+   compatible = "arm,coresight-etm4x", "arm,primecell";
+   reg = <0x2854 0x1000>;
+   cpu = <_1>;
+   clocks = < IMX8MP_CLK_MAIN_AXI>;
+   clock-names = "apb_pclk";
+
+   out-ports {
+   port {
+   etm1_out_port: endpoint {
+   remote-endpoint = 
<_funnel_in_port1>;
+   };
+   };
+   };
+   };
+
+   etm2: etm@2864 {
+   compatible = "arm,coresight-etm4x", "arm,primecell";
+   reg = <0x2864 0x1000>;
+   cpu = <_2>;
+   clocks = < IMX8MP_CLK_MAIN_AXI>;
+   clock-names = "apb_pclk";
+
+   out-ports {
+   port {
+   etm2_out_port: endpoint {
+   remote-endpoint = 
<_funnel_in_port2>;
+   };
+   };
+   };
+   };
+
+   etm3: etm@2874 {
+   

[PATCH v2 2/3] arm: dts: imx8mn: Sync with linux-next 20231019

2023-10-19 Thread Fabio Estevam
From: Fabio Estevam 

Sync imx8mn.dtsi with linux-next 20231019.

Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Rebased against latest U-Boot and synced with linux-next 20231019

 arch/arm/dts/imx8mn.dtsi | 167 ---
 1 file changed, 154 insertions(+), 13 deletions(-)

diff --git a/arch/arm/dts/imx8mn.dtsi b/arch/arm/dts/imx8mn.dtsi
index cb2836bfbd95..1bb1d0c1bae4 100644
--- a/arch/arm/dts/imx8mn.dtsi
+++ b/arch/arm/dts/imx8mn.dtsi
@@ -139,6 +139,7 @@
A53_L2: l2-cache0 {
compatible = "cache";
cache-level = <2>;
+   cache-unified;
cache-size = <0x8>;
cache-line-size = <64>;
cache-sets = <512>;
@@ -295,6 +296,7 @@
sai2: sai@3002 {
compatible = "fsl,imx8mn-sai", 
"fsl,imx8mq-sai";
reg = <0x3002 0x1>;
+   #sound-dai-cells = <0>;
interrupts = ;
clocks = < IMX8MN_CLK_SAI2_IPG>,
< IMX8MN_CLK_DUMMY>,
@@ -309,6 +311,7 @@
sai3: sai@3003 {
compatible = "fsl,imx8mn-sai", 
"fsl,imx8mq-sai";
reg = <0x3003 0x1>;
+   #sound-dai-cells = <0>;
interrupts = ;
clocks = < IMX8MN_CLK_SAI3_IPG>,
 < IMX8MN_CLK_DUMMY>,
@@ -323,6 +326,7 @@
sai5: sai@3005 {
compatible = "fsl,imx8mn-sai", 
"fsl,imx8mq-sai";
reg = <0x3005 0x1>;
+   #sound-dai-cells = <0>;
interrupts = ;
clocks = < IMX8MN_CLK_SAI5_IPG>,
 < IMX8MN_CLK_DUMMY>,
@@ -339,6 +343,7 @@
sai6: sai@3006 {
compatible = "fsl,imx8mn-sai", 
"fsl,imx8mq-sai";
reg = <0x3006  0x1>;
+   #sound-dai-cells = <0>;
interrupts = ;
clocks = < IMX8MN_CLK_SAI6_IPG>,
 < IMX8MN_CLK_DUMMY>,
@@ -366,6 +371,7 @@
  "pll8k", "pll11k", 
"clkext3";
dmas = < 24 25 0x8000>;
dma-names = "rx";
+   #sound-dai-cells = <0>;
status = "disabled";
};
 
@@ -396,6 +402,7 @@
sai7: sai@300b {
compatible = "fsl,imx8mn-sai", 
"fsl,imx8mq-sai";
reg = <0x300b 0x1>;
+   #sound-dai-cells = <0>;
interrupts = ;
clocks = < IMX8MN_CLK_SAI7_IPG>,
 < IMX8MN_CLK_DUMMY>,
@@ -497,6 +504,8 @@
compatible = "fsl,imx8mn-tmu", "fsl,imx8mm-tmu";
reg = <0x3026 0x1>;
clocks = < IMX8MN_CLK_TMU_ROOT>;
+   nvmem-cells = <_calib>;
+   nvmem-cell-names = "calib";
#thermal-sensor-cells = <0>;
};
 
@@ -551,7 +560,7 @@
reg = <0x3033 0x1>;
};
 
-   gpr: iomuxc-gpr@3034 {
+   gpr: syscon@3034 {
compatible = "fsl,imx8mn-iomuxc-gpr", "syscon";
reg = <0x3034 0x1>;
};
@@ -563,23 +572,40 @@
#address-c

[PATCH v2 1/3] arm: dts: imx8mm: Sync with linux-next 20231019

2023-10-19 Thread Fabio Estevam
From: Fabio Estevam 

Sync imx8mm.dtsi with linux-next 20231019.

The motivation for doing this sync was a bug when doing "ums 0 mmc 1"
on imx8mm-evk. It worked well for the first time, but after doing 
a CTRL+C and launching the ums again, the command did not work.

Adam Ford suggested to sync imx8mm.dtsi with the Linux dts, as there was
a recent USB power domain reorganization there.

After syncing the imx8mm.dtsi with Linux, the ums command works without
problem after a CTRL+C.

Suggested-by: Adam Ford 
Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Rebased against latest U-Boot and synced with linux-next 20231019.

 arch/arm/dts/imx8mm.dtsi | 153 +--
 1 file changed, 129 insertions(+), 24 deletions(-)

diff --git a/arch/arm/dts/imx8mm.dtsi b/arch/arm/dts/imx8mm.dtsi
index afb90f59c83c..738024baaa57 100644
--- a/arch/arm/dts/imx8mm.dtsi
+++ b/arch/arm/dts/imx8mm.dtsi
@@ -139,6 +139,7 @@
A53_L2: l2-cache0 {
compatible = "cache";
cache-level = <2>;
+   cache-unified;
cache-size = <0x8>;
cache-line-size = <64>;
cache-sets = <512>;
@@ -276,6 +277,7 @@
assigned-clocks = < IMX8MM_CLK_USB_PHY_REF>;
assigned-clock-parents = < IMX8MM_SYS_PLL1_100M>;
clock-names = "main_clk";
+   power-domains = <_otg1>;
};
 
usbphynop2: usbphynop2 {
@@ -285,6 +287,7 @@
assigned-clocks = < IMX8MM_CLK_USB_PHY_REF>;
assigned-clock-parents = < IMX8MM_SYS_PLL1_100M>;
clock-names = "main_clk";
+   power-domains = <_otg2>;
};
 
soc: soc@0 {
@@ -396,6 +399,7 @@
  "pll8k", "pll11k", 
"clkext3";
dmas = < 24 25 0x8000>;
dma-names = "rx";
+   #sound-dai-cells = <0>;
status = "disabled";
};
 
@@ -493,6 +497,8 @@
compatible = "fsl,imx8mm-tmu";
reg = <0x3026 0x1>;
clocks = < IMX8MM_CLK_TMU_ROOT>;
+   nvmem-cells = <_calib>;
+   nvmem-cell-names = "calib";
#thermal-sensor-cells = <0>;
};
 
@@ -547,8 +553,8 @@
reg = <0x3033 0x1>;
};
 
-   gpr: iomuxc-gpr@3034 {
-   compatible = "fsl,imx8mm-iomuxc-gpr", 
"fsl,imx6q-iomuxc-gpr", "syscon";
+   gpr: syscon@3034 {
+   compatible = "fsl,imx8mm-iomuxc-gpr", "syscon";
reg = <0x3034 0x1>;
};
 
@@ -560,22 +566,40 @@
#address-cells = <1>;
#size-cells = <1>;
 
-   imx8mm_uid: unique-id@410 {
+   /*
+* The register address below maps to the MX8M
+* Fusemap Description Table entries this way.
+* Assuming
+*   reg = ;
+* then
+*   Fuse Address = (ADDR * 4) + 0x400
+* Note that if SIZE is greater than 4, then
+* each subsequent fuse is located at offset
+* +0x10 in Fusemap Description Table (e.g.
+* reg = <0x4 0x8> describes fuses 0x410 and
+* 0x420).
+*/
+   imx8mm_uid: unique-id@4 { /* 0x410-0x420 */
reg = <0x4 0x8>;
};
 
-   cpu_speed_grade: speed-grade@10 {
+   cpu_speed_grade: speed-grade@10 { /* 0x440 */
reg = <0x10 4>;
};
 
-   fec_mac_address: mac-address@90 {
+   tmu_calib: calib@3c { /* 0x4f0 */
+   reg = <0x3c 4>;
+   };
+
+  

[PATCH 2/2] imx8mp_evk: Add myself to MAINTAINERS

2023-10-18 Thread Fabio Estevam
From: Fabio Estevam 

I would like to help maintaining the imx8mp_evk board.

Add myself to MAINTAINERS.

Signed-off-by: Fabio Estevam 
---
 board/freescale/imx8mp_evk/MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/board/freescale/imx8mp_evk/MAINTAINERS 
b/board/freescale/imx8mp_evk/MAINTAINERS
index 2759652cc425..c2c7c830b5d2 100644
--- a/board/freescale/imx8mp_evk/MAINTAINERS
+++ b/board/freescale/imx8mp_evk/MAINTAINERS
@@ -1,4 +1,5 @@
 i.MX8MP EVK BOARD
+M: Fabio Estevm 
 M: Peng Fan 
 S: Maintained
 F: board/freescale/imx8mp_evk/
-- 
2.34.1



[PATCH 1/2] imx8mp_evk: Convert to DM_PMIC

2023-10-18 Thread Fabio Estevam
From: Fabio Estevam 

Currently, the imx8mp_evk uses the non-DM code to initialize the PMIC.

Convert to DM_PMIC, which is the recommended way to access the PMIC.

While at it, fix multi-line comments style.

Signed-off-by: Fabio Estevam 
---
 arch/arm/dts/imx8mp-evk-u-boot.dtsi | 18 ++-
 board/freescale/imx8mp_evk/spl.c| 50 +++--
 configs/imx8mp_evk_defconfig| 12 +++
 3 files changed, 47 insertions(+), 33 deletions(-)

diff --git a/arch/arm/dts/imx8mp-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
index 9ed62f1bb02d..0bf489b46248 100644
--- a/arch/arm/dts/imx8mp-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
@@ -13,6 +13,22 @@
};
 };
 
+_i2c1 {
+   bootph-all;
+};
+
+_pmic {
+   bootph-all;
+};
+
+&{/soc@0/bus@3080/i2c@30a2/pmic@25} {
+   bootph-all;
+};
+
+&{/soc@0/bus@3080/i2c@30a2/pmic@25/regulators} {
+   bootph-all;
+};
+
 _usdhc2_vmmc {
u-boot,off-on-delay-us = <2>;
 };
@@ -66,7 +82,7 @@
 };
 
  {
-   bootph-pre-ram;
+   bootph-all;
 };
 
  {
diff --git a/board/freescale/imx8mp_evk/spl.c b/board/freescale/imx8mp_evk/spl.c
index 246826a0d482..9dd2cbc799c3 100644
--- a/board/freescale/imx8mp_evk/spl.c
+++ b/board/freescale/imx8mp_evk/spl.c
@@ -67,40 +67,44 @@ struct i2c_pads_info i2c_pad_info1 = {
},
 };
 
-#if CONFIG_IS_ENABLED(POWER_LEGACY)
-#define I2C_PMIC   0
+#if CONFIG_IS_ENABLED(DM_PMIC_PCA9450)
 int power_init_board(void)
 {
-   struct pmic *p;
+   struct udevice *dev;
int ret;
 
-   ret = power_pca9450_init(I2C_PMIC, 0x25);
-   if (ret)
-   printf("power init failed");
-   p = pmic_get("PCA9450");
-   pmic_probe(p);
+   ret = pmic_get("pmic@25", );
+   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 to typical value 0.95V before first
-* DRAM access, set DVS1 to 0.85v for suspend.
+* Increase VDD_SOC to typical value 0.95V before first
+* DRAM access, set DVS1 to 0.85V for suspend.
 * Enable DVS control through PMIC_STBY_REQ and
 * set B1_ENMODE=1 (ON by PMIC_ON_REQ=H)
 */
-#ifdef CONFIG_IMX8M_VDD_SOC_850MV
-   /* set DVS0 to 0.85v for special case*/
-   pmic_reg_write(p, PCA9450_BUCK1OUT_DVS0, 0x14);
-#else
-   pmic_reg_write(p, PCA9450_BUCK1OUT_DVS0, 0x1C);
-#endif
-   pmic_reg_write(p, PCA9450_BUCK1OUT_DVS1, 0x14);
-   pmic_reg_write(p, PCA9450_BUCK1CTRL, 0x59);
+   if (CONFIG_IS_ENABLED(IMX8M_VDD_SOC_850MV))
+   pmic_reg_write(dev, PCA9450_BUCK1OUT_DVS0, 0x14);
+   else
+   pmic_reg_write(dev, PCA9450_BUCK1OUT_DVS0, 0x1C);
 
-   /* Kernel uses OD/OD freq for SOC */
-   /* To avoid timing risk from SOC to ARM,increase VDD_ARM to OD voltage 
0.95v */
-   pmic_reg_write(p, PCA9450_BUCK2OUT_DVS0, 0x1C);
+   pmic_reg_write(dev, PCA9450_BUCK1OUT_DVS1, 0x14);
+   pmic_reg_write(dev, PCA9450_BUCK1CTRL, 0x59);
+
+   /*
+* Kernel uses OD/OD freq for SOC.
+* To avoid timing risk from SOC to ARM,increase VDD_ARM to OD
+* voltage 0.95V.
+*/
+
+   pmic_reg_write(dev, PCA9450_BUCK2OUT_DVS0, 0x1C);
 
return 0;
 }
@@ -135,8 +139,6 @@ void board_init_f(ulong dummy)
 
enable_tzc380();
 
-   setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, _pad_info1);
-
power_init_board();
 
/* DDR initialization */
diff --git a/configs/imx8mp_evk_defconfig b/configs/imx8mp_evk_defconfig
index 820dc36e9cdd..0675f0f4f41b 100644
--- a/configs/imx8mp_evk_defconfig
+++ b/configs/imx8mp_evk_defconfig
@@ -7,9 +7,6 @@ CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_ENV_SIZE=0x1000
 CONFIG_ENV_OFFSET=0x40
-CONFIG_SYS_I2C_MXC_I2C1=y
-CONFIG_SYS_I2C_MXC_I2C2=y
-CONFIG_SYS_I2C_MXC_I2C3=y
 CONFIG_DM_GPIO=y
 CONFIG_DEFAULT_DEVICE_TREE="imx8mp-evk"
 CONFIG_SPL_TEXT_BASE=0x92
@@ -88,8 +85,6 @@ CONFIG_FASTBOOT_MMC_USER_SUPPORT=y
 CONFIG_MXC_GPIO=y
 CONFIG_DM_PCA953X=y
 CONFIG_DM_I2C=y
-# CONFIG_SPL_DM_I2C is not set
-CONFIG_SPL_SYS_I2C_LEGACY=y
 CONFIG_LED=y
 CONFIG_LED_GPIO=y
 CONFIG_SUPPORT_EMMC_BOOT=y
@@ -110,15 +105,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_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_SYSRESET=y
-- 
2.34.1



[PATCH v4] imx8mp-dhcom-pdk3-overlay-rev100: Pass #address-cells/size-cells

2023-10-18 Thread Fabio Estevam
From: Fabio Estevam 

Pass #address-cells/size-cells in the mdio node to avoid the following
DTC warning:

  DTCOarch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dtbo
Warning (reg_format): /fragment@0/__overlay__:reg: property has invalid length 
(4 bytes) (#address-cells == 2, #size-cells == 1)
Warning (avoid_default_addr_size): /fragment@0/__overlay__: Relying on default 
#address-cells value
Warning (avoid_default_addr_size): /fragment@0/__overlay__: Relying on default 
#size-cells value

Also change the Ethernet PHY address to 5, as per Marek's feedback.

Signed-off-by: Fabio Estevam 
---
Changes since v3:
- Change the Ethernet PHY address to 5 for good :-). (Marek)

 arch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dts | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dts 
b/arch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dts
index f27e6429abe4..bad015536166 100644
--- a/arch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dts
+++ b/arch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dts
@@ -5,6 +5,13 @@
 /dts-v1/;
 /plugin/;
 
- {
-   reg = <7>;
+ {
+   mdio {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   ethernet-phy@5 {
+   reg = <5>;
+   };
+   };
 };
-- 
2.34.1



[PATCH v3] imx8mp-dhcom-pdk3-overlay-rev100: Pass #address-cells/size-cells

2023-10-18 Thread Fabio Estevam
From: Fabio Estevam 

Pass #address-cells/size-cells in the mdio node to avoid the following
DTC warning:

  DTCOarch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dtbo
Warning (reg_format): /fragment@0/__overlay__:reg: property has invalid length 
(4 bytes) (#address-cells == 2, #size-cells == 1)
Warning (avoid_default_addr_size): /fragment@0/__overlay__: Relying on default 
#address-cells value
Warning (avoid_default_addr_size): /fragment@0/__overlay__: Relying on default 
#size-cells value

Also change the Ethernet PHY address to 5, as per Marek's feedback.

Signed-off-by: Fabio Estevam 
---
Changes since v2:
- Change the Ethernet PHY address to 5. (Marek)

 arch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dts | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dts 
b/arch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dts
index f27e6429abe4..bad015536166 100644
--- a/arch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dts
+++ b/arch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dts
@@ -5,6 +5,13 @@
 /dts-v1/;
 /plugin/;
 
- {
-   reg = <7>;
+ {
+   mdio {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   ethernet-phy@7 {
+   reg = <7>;
+   };
+   };
 };
-- 
2.34.1



[PATCH v2] imx8mp-dhcom-pdk3-overlay-rev100: Pass #address-cells/size-cells

2023-10-18 Thread Fabio Estevam
From: Fabio Estevam 

Pass #address-cells/size-cells in the mdio node to avoid the following
DTC warning:

  DTCOarch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dtbo
Warning (reg_format): /fragment@0/__overlay__:reg: property has invalid length 
(4 bytes) (#address-cells == 2, #size-cells == 1)
Warning (avoid_default_addr_size): /fragment@0/__overlay__: Relying on default 
#address-cells value
Warning (avoid_default_addr_size): /fragment@0/__overlay__: Relying on default 
#size-cells value

Signed-off-by: Fabio Estevam 
Reviewed-by: Marek Vasut 
---
Changes since v1:
- Remove the ethphy0g label. (Marek)

 arch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dts | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dts 
b/arch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dts
index f27e6429abe4..bad015536166 100644
--- a/arch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dts
+++ b/arch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dts
@@ -5,6 +5,13 @@
 /dts-v1/;
 /plugin/;
 
- {
-   reg = <7>;
+ {
+   mdio {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   ethernet-phy@7 {
+   reg = <7>;
+   };
+   };
 };
-- 
2.34.1



[PATCH] imx8mp-dhcom-pdk3-overlay-rev100: Pass #address-cells/size-cells

2023-10-18 Thread Fabio Estevam
From: Fabio Estevam 

Pass #address-cells/size-cells in the mdio node to avoid the following
DTC warning:

  DTCOarch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dtbo
Warning (reg_format): /fragment@0/__overlay__:reg: property has invalid length 
(4 bytes) (#address-cells == 2, #size-cells == 1)
Warning (avoid_default_addr_size): /fragment@0/__overlay__: Relying on default 
#address-cells value
Warning (avoid_default_addr_size): /fragment@0/__overlay__: Relying on default 
#size-cells value

Signed-off-by: Fabio Estevam 
---
 arch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dts | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dts 
b/arch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dts
index f27e6429ab..94bee3c508 100644
--- a/arch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dts
+++ b/arch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dts
@@ -5,6 +5,13 @@
 /dts-v1/;
 /plugin/;
 
- {
-   reg = <7>;
+ {
+   mdio {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   ethphy0g: ethernet-phy@7 {
+   reg = <7>;
+   };
+   };
 };
-- 
2.34.1



Re: failed to build u-boot mt7621_rfb_defconfig

2023-10-17 Thread Fabio Estevam
[Please keep the list on Cc]

On Mon, Oct 16, 2023 at 11:14 PM Xiaobo Liu  wrote:
>
> Hi
>
> I found the nand rfb u-boot mt7621_stage_sram.bin, no spi-nor version was 
> found.
>
> https://u-boot.readthedocs.io/en/latest/board/mediatek/mt7621.html
>
> Where can I find a version of the mt7621 spi-nor?

I am not familiar with the Mediatek chips, but mt7621_stage_sram.bin
seems to be generic, independent of the boot medium.

https://u-boot.readthedocs.io/en/latest/board/mediatek/mt7621.html
shows the same procedure for generating the binary.

Then the last line says: "Burn the u-boot-mt7621.bin to the SPI-NOR or
NAND flash."

Adding the Mediatek maintainers on Cc.


Re: failed to build u-boot mt7621_rfb_defconfig

2023-10-16 Thread Fabio Estevam
Hi Xiaobo,

On Mon, Oct 16, 2023 at 8:49 AM Xiaobo Liu  wrote:

> Image 'u-boot-spl-ddr' is missing external blobs and is non-functional:
> stage_bin
>
> /binman/u-boot-spl-ddr/stage_bin (mt7621_stage_sram.bin):
>Missing blob
>
> Some images are invalid
> make: *** [Makefile:1115: .binman_stamp] Error 103
> ```
>
> Is there a step I'm missing that's causing this?

Yes, you need to provide mt7621_stage_sram.bin.

Please follow the instructions from doc/board/mediatek/mt7621.rst


[PATCH v4] imx8mp-evk: Add USB0 OTG support

2023-10-15 Thread Fabio Estevam
From: Fabio Estevam 

Add USB0 OTG support.

Currently, the USB0 OTG nodes are not enabled in the Linux kernel
devicetree.

For this reason, enable the USB0 OTG nodes inside imx8mp-evk-u-boot.dtsi
for now.

Also select several useful options such as USB gadget and fastboot.

Tested by running "ums 0 mmc 2".

Signed-off-by: Fabio Estevam 
Reviewed-by: Marek Vasut 
---
Changes since v3:
- Fixed the alphabetical order once again.

 arch/arm/dts/imx8mp-evk-u-boot.dtsi | 13 
 configs/imx8mp_evk_defconfig| 31 +
 2 files changed, 44 insertions(+)

diff --git a/arch/arm/dts/imx8mp-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
index 6784ed2e7c92..f4fd2432ca8f 100644
--- a/arch/arm/dts/imx8mp-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
@@ -111,6 +111,19 @@
bootph-pre-ram;
 };
 
+_dwc3_0 {
+   dr_mode = "peripheral";
+   status = "okay";
+};
+
+_0 {
+   status = "okay";
+};
+
+_phy0 {
+   status = "okay";
+};
+
  {
bootph-pre-ram;
 };
diff --git a/configs/imx8mp_evk_defconfig b/configs/imx8mp_evk_defconfig
index 14c749f44308..820dc36e9cdd 100644
--- a/configs/imx8mp_evk_defconfig
+++ b/configs/imx8mp_evk_defconfig
@@ -59,6 +59,9 @@ CONFIG_CMD_FUSE=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_USB_SDP=y
+CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_REGULATOR=y
 CONFIG_CMD_EXT4_WRITE=y
@@ -74,6 +77,14 @@ CONFIG_ETHPRIME="eth1"
 CONFIG_SPL_DM=y
 CONFIG_CLK_COMPOSITE_CCF=y
 CONFIG_CLK_IMX8MP=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
+CONFIG_FASTBOOT_BUF_ADDR=0x4280
+CONFIG_FASTBOOT_BUF_SIZE=0x2000
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_UUU_SUPPORT=y
+CONFIG_FASTBOOT_FLASH_MMC_DEV=2
+CONFIG_FASTBOOT_MMC_BOOT_SUPPORT=y
+CONFIG_FASTBOOT_MMC_USER_SUPPORT=y
 CONFIG_MXC_GPIO=y
 CONFIG_DM_PCA953X=y
 CONFIG_DM_I2C=y
@@ -94,10 +105,15 @@ CONFIG_DWC_ETH_QOS=y
 CONFIG_DWC_ETH_QOS_IMX=y
 CONFIG_FEC_MXC=y
 CONFIG_MII=y
+CONFIG_PHY=y
+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_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
@@ -109,4 +125,19 @@ CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
 CONFIG_SYSRESET_PSCI=y
 CONFIG_SYSRESET_WATCHDOG=y
+CONFIG_USB=y
+# CONFIG_SPL_DM_USB is not set
+CONFIG_DM_USB_GADGET=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_XHCI_DWC3_OF_SIMPLE=y
+CONFIG_USB_EHCI_HCD=y
+# CONFIG_USB_EHCI_MX7 is not set
+CONFIG_USB_DWC3=y
+CONFIG_USB_DWC3_GENERIC=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="FSL"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
+CONFIG_SDP_LOADADDR=0x0
 CONFIG_IMX_WATCHDOG=y
-- 
2.34.1



[PATCH v3] imx8mp-evk: Add USB0 OTG support

2023-10-15 Thread Fabio Estevam
From: Fabio Estevam 

Add USB0 OTG support.

Currently, the USB0 OTG nodes are not enabled in the Linux kernel
devicetree.

For this reason, enable the USB0 OTG nodes inside imx8mp-evk-u-boot.dtsi
for now.

Also select several useful options such as USB gadget and fastboot.

Tested by running "ums 0 mmc 2".

Signed-off-by: Fabio Estevam 
Reviewed-by: Marek Vasut 
---
Changes since v2:
- Put the USB nodes in alphabetical order. (Marek)
- Remove unneeded pinctrl entry. (Marek)

 arch/arm/dts/imx8mp-evk-u-boot.dtsi | 13 
 configs/imx8mp_evk_defconfig| 31 +
 2 files changed, 44 insertions(+)

diff --git a/arch/arm/dts/imx8mp-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
index 6784ed2e7c..0d2c9a83db 100644
--- a/arch/arm/dts/imx8mp-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
@@ -111,6 +111,19 @@
bootph-pre-ram;
 };
 
+_0 {
+   status = "okay";
+};
+
+_dwc3_0 {
+   dr_mode = "peripheral";
+   status = "okay";
+};
+
+_phy0 {
+   status = "okay";
+};
+
  {
bootph-pre-ram;
 };
diff --git a/configs/imx8mp_evk_defconfig b/configs/imx8mp_evk_defconfig
index 14c749f443..820dc36e9c 100644
--- a/configs/imx8mp_evk_defconfig
+++ b/configs/imx8mp_evk_defconfig
@@ -59,6 +59,9 @@ CONFIG_CMD_FUSE=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_USB_SDP=y
+CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_REGULATOR=y
 CONFIG_CMD_EXT4_WRITE=y
@@ -74,6 +77,14 @@ CONFIG_ETHPRIME="eth1"
 CONFIG_SPL_DM=y
 CONFIG_CLK_COMPOSITE_CCF=y
 CONFIG_CLK_IMX8MP=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
+CONFIG_FASTBOOT_BUF_ADDR=0x4280
+CONFIG_FASTBOOT_BUF_SIZE=0x2000
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_UUU_SUPPORT=y
+CONFIG_FASTBOOT_FLASH_MMC_DEV=2
+CONFIG_FASTBOOT_MMC_BOOT_SUPPORT=y
+CONFIG_FASTBOOT_MMC_USER_SUPPORT=y
 CONFIG_MXC_GPIO=y
 CONFIG_DM_PCA953X=y
 CONFIG_DM_I2C=y
@@ -94,10 +105,15 @@ CONFIG_DWC_ETH_QOS=y
 CONFIG_DWC_ETH_QOS_IMX=y
 CONFIG_FEC_MXC=y
 CONFIG_MII=y
+CONFIG_PHY=y
+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_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
@@ -109,4 +125,19 @@ CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
 CONFIG_SYSRESET_PSCI=y
 CONFIG_SYSRESET_WATCHDOG=y
+CONFIG_USB=y
+# CONFIG_SPL_DM_USB is not set
+CONFIG_DM_USB_GADGET=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_XHCI_DWC3_OF_SIMPLE=y
+CONFIG_USB_EHCI_HCD=y
+# CONFIG_USB_EHCI_MX7 is not set
+CONFIG_USB_DWC3=y
+CONFIG_USB_DWC3_GENERIC=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="FSL"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
+CONFIG_SDP_LOADADDR=0x0
 CONFIG_IMX_WATCHDOG=y
-- 
2.34.1



[PATCH v2] imx8mp-evk: Add USB0 OTG support

2023-10-15 Thread Fabio Estevam
From: Fabio Estevam 

Add USB0 OTG support.

Currently, the USB0 OTG nodes are not enabled in the Linux kernel
devicetree.

For this reason, enable the USB0 OTG nodes inside imx8mp-evk-u-boot.dtsi
for now.

Also select several useful options such as USB gadget and fastboot.

Tested by running "ums 0 mmc 2".

Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Selected CONFIG_PHY=y and CONFIG_PHY_IMX8MQ_USB=y. Previously the ums
command was working only after booting via USB serial download mode.
Now it also works after booting from SD card.

 arch/arm/dts/imx8mp-evk-u-boot.dtsi | 14 +
 configs/imx8mp_evk_defconfig| 31 +
 2 files changed, 45 insertions(+)

diff --git a/arch/arm/dts/imx8mp-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
index 6784ed2e7c92..43f13a9c22f7 100644
--- a/arch/arm/dts/imx8mp-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
@@ -111,6 +111,20 @@
bootph-pre-ram;
 };
 
+_phy0 {
+   status = "okay";
+};
+
+_0 {
+   status = "okay";
+};
+
+_dwc3_0 {
+   pinctrl-names = "default";
+   dr_mode = "peripheral";
+   status = "okay";
+};
+
  {
bootph-pre-ram;
 };
diff --git a/configs/imx8mp_evk_defconfig b/configs/imx8mp_evk_defconfig
index da1f5d1ad2e0..c129170bf83d 100644
--- a/configs/imx8mp_evk_defconfig
+++ b/configs/imx8mp_evk_defconfig
@@ -59,6 +59,9 @@ CONFIG_CMD_FUSE=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_USB_SDP=y
+CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_REGULATOR=y
 CONFIG_CMD_EXT4_WRITE=y
@@ -74,6 +77,14 @@ CONFIG_ETHPRIME="eth1"
 CONFIG_SPL_DM=y
 CONFIG_CLK_COMPOSITE_CCF=y
 CONFIG_CLK_IMX8MP=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
+CONFIG_FASTBOOT_BUF_ADDR=0x4280
+CONFIG_FASTBOOT_BUF_SIZE=0x2000
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_UUU_SUPPORT=y
+CONFIG_FASTBOOT_FLASH_MMC_DEV=2
+CONFIG_FASTBOOT_MMC_BOOT_SUPPORT=y
+CONFIG_FASTBOOT_MMC_USER_SUPPORT=y
 CONFIG_MXC_GPIO=y
 CONFIG_DM_PCA953X=y
 CONFIG_DM_I2C=y
@@ -94,10 +105,15 @@ CONFIG_DWC_ETH_QOS=y
 CONFIG_DWC_ETH_QOS_IMX=y
 CONFIG_FEC_MXC=y
 CONFIG_MII=y
+CONFIG_PHY=y
+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_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
@@ -109,4 +125,19 @@ CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
 CONFIG_SYSRESET_PSCI=y
 CONFIG_SYSRESET_WATCHDOG=y
+CONFIG_USB=y
+# CONFIG_SPL_DM_USB is not set
+CONFIG_DM_USB_GADGET=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_XHCI_DWC3_OF_SIMPLE=y
+CONFIG_USB_EHCI_HCD=y
+# CONFIG_USB_EHCI_MX7 is not set
+CONFIG_USB_DWC3=y
+CONFIG_USB_DWC3_GENERIC=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="FSL"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
+CONFIG_SDP_LOADADDR=0x0
 CONFIG_IMX_WATCHDOG=y
-- 
2.34.1



[PATCH] imx8mp-evk: Add USB0 OTG support

2023-10-15 Thread Fabio Estevam
From: Fabio Estevam 

Add USB0 OTG support.

Currently, the USB0 OTG nodes are not enabled in the Linux kernel
devicetree.

For this reason, enable the USB0 OTG nodes inside imx8mp-evk-u-boot.dtsi
for now.

Also select several useful options such as USB gadget and fastboot.

Tested by running "ums 0 mmc 2".

Signed-off-by: Fabio Estevam 
---
 arch/arm/dts/imx8mp-evk-u-boot.dtsi | 14 ++
 configs/imx8mp_evk_defconfig| 29 +
 2 files changed, 43 insertions(+)

diff --git a/arch/arm/dts/imx8mp-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
index 6784ed2e7c..43f13a9c22 100644
--- a/arch/arm/dts/imx8mp-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
@@ -111,6 +111,20 @@
bootph-pre-ram;
 };
 
+_phy0 {
+   status = "okay";
+};
+
+_0 {
+   status = "okay";
+};
+
+_dwc3_0 {
+   pinctrl-names = "default";
+   dr_mode = "peripheral";
+   status = "okay";
+};
+
  {
bootph-pre-ram;
 };
diff --git a/configs/imx8mp_evk_defconfig b/configs/imx8mp_evk_defconfig
index da1f5d1ad2..88ec41a196 100644
--- a/configs/imx8mp_evk_defconfig
+++ b/configs/imx8mp_evk_defconfig
@@ -59,6 +59,9 @@ CONFIG_CMD_FUSE=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_USB_SDP=y
+CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_REGULATOR=y
 CONFIG_CMD_EXT4_WRITE=y
@@ -74,6 +77,14 @@ CONFIG_ETHPRIME="eth1"
 CONFIG_SPL_DM=y
 CONFIG_CLK_COMPOSITE_CCF=y
 CONFIG_CLK_IMX8MP=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
+CONFIG_FASTBOOT_BUF_ADDR=0x4280
+CONFIG_FASTBOOT_BUF_SIZE=0x2000
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_UUU_SUPPORT=y
+CONFIG_FASTBOOT_FLASH_MMC_DEV=2
+CONFIG_FASTBOOT_MMC_BOOT_SUPPORT=y
+CONFIG_FASTBOOT_MMC_USER_SUPPORT=y
 CONFIG_MXC_GPIO=y
 CONFIG_DM_PCA953X=y
 CONFIG_DM_I2C=y
@@ -98,6 +109,9 @@ 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_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
@@ -109,4 +123,19 @@ CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
 CONFIG_SYSRESET_PSCI=y
 CONFIG_SYSRESET_WATCHDOG=y
+CONFIG_USB=y
+# CONFIG_SPL_DM_USB is not set
+CONFIG_DM_USB_GADGET=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_XHCI_DWC3_OF_SIMPLE=y
+CONFIG_USB_EHCI_HCD=y
+# CONFIG_USB_EHCI_MX7 is not set
+CONFIG_USB_DWC3=y
+CONFIG_USB_DWC3_GENERIC=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="FSL"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
+CONFIG_SDP_LOADADDR=0x0
 CONFIG_IMX_WATCHDOG=y
-- 
2.34.1



[PATCH] smegw01: Remove misuse of CONFIG_ENV_IS_NOWHERE

2023-10-10 Thread Fabio Estevam
From: Eduard Strehlau 

When using a list of writeable variables, the initial values come
from the built-in default environment since commit 5ab81058364b ("env:
Complete generic support for writable list").

Remove unnecessary misuse of CONFIG_ENV_IS_NOWHERE as default environment.

Based on the fix done by commit b16fd7f75f6d ("imx6q: acc: Remove misuse
of env is nowhere driver").

Signed-off-by: Eduard Strehlau 
Signed-off-by: Fabio Estevam 
---
 board/storopack/smegw01/smegw01.c | 15 ---
 configs/smegw01_defconfig |  1 -
 2 files changed, 16 deletions(-)

diff --git a/board/storopack/smegw01/smegw01.c 
b/board/storopack/smegw01/smegw01.c
index 7b2c50a61e..345191b31c 100644
--- a/board/storopack/smegw01/smegw01.c
+++ b/board/storopack/smegw01/smegw01.c
@@ -111,18 +111,3 @@ uint mmc_get_env_part(struct mmc *mmc)
return part;
 }
 
-enum env_location env_get_location(enum env_operation op, int prio)
-{
-   if (op == ENVOP_SAVE || op == ENVOP_ERASE)
-   return ENVL_MMC;
-
-   switch (prio) {
-   case 0:
-   return ENVL_NOWHERE;
-
-   case 1:
-   return ENVL_MMC;
-   }
-
-   return ENVL_UNKNOWN;
-}
diff --git a/configs/smegw01_defconfig b/configs/smegw01_defconfig
index 5cfd3d2715..13665ecfd3 100644
--- a/configs/smegw01_defconfig
+++ b/configs/smegw01_defconfig
@@ -48,7 +48,6 @@ CONFIG_CMD_SQUASHFS=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
-CONFIG_ENV_IS_NOWHERE=y
 CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_SYS_MMC_ENV_DEV=1
-- 
2.41.0



[PATCH v3 3/3] mx28evk: Add USB Mass Storage support

2023-10-09 Thread Fabio Estevam
From: Fabio Estevam 

Select the USB options to allow running "ums 0 mmc 0".

Signed-off-by: Fabio Estevam 
---
Changes since v2:
- Removed further unrelated options. (Marek)
Changes since v1:
- Remove unrelated config options. (Marek)

 configs/mx28evk_defconfig | 12 
 1 file changed, 12 insertions(+)

diff --git a/configs/mx28evk_defconfig b/configs/mx28evk_defconfig
index df0cceaea719..4058d08f961a 100644
--- a/configs/mx28evk_defconfig
+++ b/configs/mx28evk_defconfig
@@ -32,6 +32,7 @@ CONFIG_CMD_DM=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND_TRIMFFS=y
+CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_DATE=y
 CONFIG_CMD_EXT4=y
@@ -65,3 +66,11 @@ CONFIG_RTC_MXS=y
 CONFIG_DM_SERIAL=y
 CONFIG_SPI=y
 CONFIG_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="FSL"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
+CONFIG_CI_UDC=y
+CONFIG_USB_GADGET_DOWNLOAD=y
-- 
2.34.1



[PATCH v3 2/3] usb: ehci: mxs: Use regulator_set_enable_if_allowed()

2023-10-09 Thread Fabio Estevam
From: Fabio Estevam 

Since commit 4fcba5d556b4 ("regulator: implement basic reference
counter") the return value of regulator_set_enable() may be EALREADY or
EBUSY for fixed/GPIO regulators.

Switch to using the more relaxed regulator_set_enable_if_allowed() to
continue if regulator already was enabled or disabled.

This fixes the following error when running the 'ums' command:

=> ums 0 mmc 0
UMS: LUN 0, dev mmc 0, hwpart 0, sector 0x0, count 0xece000
Error enabling VBUS supply
g_dnl_register: failed!, error: -114
g_dnl_register failed

Signed-off-by: Fabio Estevam 
Reviewed-by: Marek Vasut 
---
Changes since v2:
- None
Changes since v1:
- Only collected Marek's Reviewed-by tag.

 drivers/usb/host/ehci-mxs.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/host/ehci-mxs.c b/drivers/usb/host/ehci-mxs.c
index 092c79fd4bc5..ddf7cc2d00a7 100644
--- a/drivers/usb/host/ehci-mxs.c
+++ b/drivers/usb/host/ehci-mxs.c
@@ -236,9 +236,9 @@ static int ehci_usb_probe(struct udevice *dev)
debug("%s: No vbus supply\n", dev->name);
 
if (!ret && priv->vbus_supply) {
-   ret = regulator_set_enable(priv->vbus_supply,
-  (type == USB_INIT_DEVICE) ?
-  false : true);
+   ret = regulator_set_enable_if_allowed(priv->vbus_supply,
+ (type == USB_INIT_DEVICE) 
?
+ false : true);
if (ret) {
puts("Error enabling VBUS supply\n");
return ret;
@@ -265,7 +265,7 @@ static int ehci_usb_remove(struct udevice *dev)
 
 #if CONFIG_IS_ENABLED(DM_REGULATOR)
if (priv->vbus_supply) {
-   ret = regulator_set_enable(priv->vbus_supply, false);
+   ret = regulator_set_enable_if_allowed(priv->vbus_supply, false);
if (ret) {
puts("Error disabling VBUS supply\n");
return ret;
-- 
2.34.1



[PATCH v3 1/3] usb: ehci: mxs: Fix the USB node pointer retrieval

2023-10-09 Thread Fabio Estevam
From: Fabio Estevam 

Use dev_ofnode() to retrieve the USB node pointer from the udevice
structure.

This fixes the following build error:

drivers/usb/host/ehci-mxs.c:143:38: error: 'struct udevice' has no member named 
'node_'

Signed-off-by: Fabio Estevam 
Reviewed-by: Marek Vasut 
---
Changes since v2:
- None
Changes since v1:
- Only collected Marek's Reviewed-by tag.

 drivers/usb/host/ehci-mxs.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/ehci-mxs.c b/drivers/usb/host/ehci-mxs.c
index 147b2fa145d6..092c79fd4bc5 100644
--- a/drivers/usb/host/ehci-mxs.c
+++ b/drivers/usb/host/ehci-mxs.c
@@ -136,11 +136,12 @@ static int ehci_usb_ofdata_to_platdata(struct udevice 
*dev)
struct usb_plat *plat = dev_get_plat(dev);
struct ehci_mxs_port *port = >port;
u32 phandle, phy_reg, clk_reg, clk_id;
+   ofnode np = dev_ofnode(dev);
ofnode phy_node, clk_node;
const char *mode;
int ret;
 
-   mode = ofnode_read_string(dev->node_, "dr_mode");
+   mode = ofnode_read_string(np, "dr_mode");
if (mode) {
if (strcmp(mode, "peripheral") == 0)
plat->init_type = USB_INIT_DEVICE;
@@ -151,12 +152,12 @@ static int ehci_usb_ofdata_to_platdata(struct udevice 
*dev)
}
 
/* Read base address of the USB IP block */
-   ret = ofnode_read_u32(dev->node_, "reg", >usb_regs);
+   ret = ofnode_read_u32(np, "reg", >usb_regs);
if (ret)
return ret;
 
/* Read base address of the USB PHY IP block */
-   ret = ofnode_read_u32(dev->node_, "fsl,usbphy", );
+   ret = ofnode_read_u32(np, "fsl,usbphy", );
if (ret)
return ret;
 
-- 
2.34.1



[PATCH v2 3/3] mx28evk: Add USB Mass Storage support

2023-10-08 Thread Fabio Estevam
From: Fabio Estevam 

Select the USB options to allow running "ums 0 mmc 0".

Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Remove unrelated config options. (Marek)

 configs/mx28evk_defconfig | 12 
 1 file changed, 12 insertions(+)

diff --git a/configs/mx28evk_defconfig b/configs/mx28evk_defconfig
index df0cceaea719..0b7c4b252ff0 100644
--- a/configs/mx28evk_defconfig
+++ b/configs/mx28evk_defconfig
@@ -32,6 +32,8 @@ CONFIG_CMD_DM=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND_TRIMFFS=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_DATE=y
 CONFIG_CMD_EXT4=y
@@ -65,3 +67,13 @@ CONFIG_RTC_MXS=y
 CONFIG_DM_SERIAL=y
 CONFIG_SPI=y
 CONFIG_USB=y
+CONFIG_SPL_USB_HOST=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="FSL"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
+CONFIG_CI_UDC=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_SPL_USB_SDP_SUPPORT=y
-- 
2.34.1



[PATCH v2 2/3] usb: ehci: mxs: Use regulator_set_enable_if_allowed()

2023-10-08 Thread Fabio Estevam
From: Fabio Estevam 

Since commit 4fcba5d556b4 ("regulator: implement basic reference
counter") the return value of regulator_set_enable() may be EALREADY or
EBUSY for fixed/GPIO regulators.

Switch to using the more relaxed regulator_set_enable_if_allowed() to
continue if regulator already was enabled or disabled.

This fixes the following error when running the 'ums' command:

=> ums 0 mmc 0
UMS: LUN 0, dev mmc 0, hwpart 0, sector 0x0, count 0xece000
Error enabling VBUS supply
g_dnl_register: failed!, error: -114
g_dnl_register failed

Signed-off-by: Fabio Estevam 
Reviewed-by: Marek Vasut 
---
Changes since v1:
- Only collected Marek's Reviewed-by tag.

 drivers/usb/host/ehci-mxs.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/host/ehci-mxs.c b/drivers/usb/host/ehci-mxs.c
index 092c79fd4bc5..ddf7cc2d00a7 100644
--- a/drivers/usb/host/ehci-mxs.c
+++ b/drivers/usb/host/ehci-mxs.c
@@ -236,9 +236,9 @@ static int ehci_usb_probe(struct udevice *dev)
debug("%s: No vbus supply\n", dev->name);
 
if (!ret && priv->vbus_supply) {
-   ret = regulator_set_enable(priv->vbus_supply,
-  (type == USB_INIT_DEVICE) ?
-  false : true);
+   ret = regulator_set_enable_if_allowed(priv->vbus_supply,
+ (type == USB_INIT_DEVICE) 
?
+ false : true);
if (ret) {
puts("Error enabling VBUS supply\n");
return ret;
@@ -265,7 +265,7 @@ static int ehci_usb_remove(struct udevice *dev)
 
 #if CONFIG_IS_ENABLED(DM_REGULATOR)
if (priv->vbus_supply) {
-   ret = regulator_set_enable(priv->vbus_supply, false);
+   ret = regulator_set_enable_if_allowed(priv->vbus_supply, false);
if (ret) {
puts("Error disabling VBUS supply\n");
return ret;
-- 
2.34.1



[PATCH v2 1/3] usb: ehci: mxs: Fix the USB node pointer retrieval

2023-10-08 Thread Fabio Estevam
From: Fabio Estevam 

Use dev_ofnode() to retrieve the USB node pointer from the udevice
structure.

This fixes the following build error:

drivers/usb/host/ehci-mxs.c:143:38: error: 'struct udevice' has no member named 
'node_'

Signed-off-by: Fabio Estevam 
Reviewed-by: Marek Vasut 
---
Changes since v1:
- Only collected Marek's Reviewed-by tag.

 drivers/usb/host/ehci-mxs.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/ehci-mxs.c b/drivers/usb/host/ehci-mxs.c
index 147b2fa145d6..092c79fd4bc5 100644
--- a/drivers/usb/host/ehci-mxs.c
+++ b/drivers/usb/host/ehci-mxs.c
@@ -136,11 +136,12 @@ static int ehci_usb_ofdata_to_platdata(struct udevice 
*dev)
struct usb_plat *plat = dev_get_plat(dev);
struct ehci_mxs_port *port = >port;
u32 phandle, phy_reg, clk_reg, clk_id;
+   ofnode np = dev_ofnode(dev);
ofnode phy_node, clk_node;
const char *mode;
int ret;
 
-   mode = ofnode_read_string(dev->node_, "dr_mode");
+   mode = ofnode_read_string(np, "dr_mode");
if (mode) {
if (strcmp(mode, "peripheral") == 0)
plat->init_type = USB_INIT_DEVICE;
@@ -151,12 +152,12 @@ static int ehci_usb_ofdata_to_platdata(struct udevice 
*dev)
}
 
/* Read base address of the USB IP block */
-   ret = ofnode_read_u32(dev->node_, "reg", >usb_regs);
+   ret = ofnode_read_u32(np, "reg", >usb_regs);
if (ret)
return ret;
 
/* Read base address of the USB PHY IP block */
-   ret = ofnode_read_u32(dev->node_, "fsl,usbphy", );
+   ret = ofnode_read_u32(np, "fsl,usbphy", );
if (ret)
return ret;
 
-- 
2.34.1



[PATCH 2/3] usb: ehci: mxs: Use regulator_set_enable_if_allowed()

2023-10-07 Thread Fabio Estevam
From: Fabio Estevam 

Since commit 4fcba5d556b4 ("regulator: implement basic reference
counter") the return value of regulator_set_enable() may be EALREADY or
EBUSY for fixed/GPIO regulators.

Swict to using the more relaxed regulator_set_enable_if_allowed() to
continue if regulator already was enabled or disabled.

This fixes the following error when running the 'ums' command:

=> ums 0 mmc 0
UMS: LUN 0, dev mmc 0, hwpart 0, sector 0x0, count 0xece000
Error enabling VBUS supply
g_dnl_register: failed!, error: -114
g_dnl_register failed

Signed-off-by: Fabio Estevam 
---
 drivers/usb/host/ehci-mxs.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/host/ehci-mxs.c b/drivers/usb/host/ehci-mxs.c
index 092c79fd4bc5..ddf7cc2d00a7 100644
--- a/drivers/usb/host/ehci-mxs.c
+++ b/drivers/usb/host/ehci-mxs.c
@@ -236,9 +236,9 @@ static int ehci_usb_probe(struct udevice *dev)
debug("%s: No vbus supply\n", dev->name);
 
if (!ret && priv->vbus_supply) {
-   ret = regulator_set_enable(priv->vbus_supply,
-  (type == USB_INIT_DEVICE) ?
-  false : true);
+   ret = regulator_set_enable_if_allowed(priv->vbus_supply,
+ (type == USB_INIT_DEVICE) 
?
+ false : true);
if (ret) {
puts("Error enabling VBUS supply\n");
return ret;
@@ -265,7 +265,7 @@ static int ehci_usb_remove(struct udevice *dev)
 
 #if CONFIG_IS_ENABLED(DM_REGULATOR)
if (priv->vbus_supply) {
-   ret = regulator_set_enable(priv->vbus_supply, false);
+   ret = regulator_set_enable_if_allowed(priv->vbus_supply, false);
if (ret) {
puts("Error disabling VBUS supply\n");
return ret;
-- 
2.34.1



[PATCH 3/3] mx28evk: Add USB Mass Storage support

2023-10-07 Thread Fabio Estevam
From: Fabio Estevam 

Select the USB options to allow running "ums 0 mmc 0".

Signed-off-by: Fabio Estevam 
---
 configs/mx28evk_defconfig | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/configs/mx28evk_defconfig b/configs/mx28evk_defconfig
index df0cceaea719..15cc99684c05 100644
--- a/configs/mx28evk_defconfig
+++ b/configs/mx28evk_defconfig
@@ -32,6 +32,9 @@ CONFIG_CMD_DM=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND_TRIMFFS=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_USB_SDP=y
+CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_DATE=y
 CONFIG_CMD_EXT4=y
@@ -65,3 +68,14 @@ CONFIG_RTC_MXS=y
 CONFIG_DM_SERIAL=y
 CONFIG_SPI=y
 CONFIG_USB=y
+CONFIG_SPL_USB_HOST=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
+CONFIG_USB_GADGET=y
+CONFIG_SPL_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="FSL"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
+CONFIG_CI_UDC=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_SPL_USB_SDP_SUPPORT=y
-- 
2.34.1



[PATCH 1/3] usb: ehci: mxs: Fix the USB node pointer retrieval

2023-10-07 Thread Fabio Estevam
From: Fabio Estevam 

Use dev_ofnode() to retrieve the USB node pointer from the udevice
structure.

This fixes the following build error:

drivers/usb/host/ehci-mxs.c:143:38: error: 'struct udevice' has no member named 
'node_'

Signed-off-by: Fabio Estevam 
---
 drivers/usb/host/ehci-mxs.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/ehci-mxs.c b/drivers/usb/host/ehci-mxs.c
index 147b2fa145d6..092c79fd4bc5 100644
--- a/drivers/usb/host/ehci-mxs.c
+++ b/drivers/usb/host/ehci-mxs.c
@@ -136,11 +136,12 @@ static int ehci_usb_ofdata_to_platdata(struct udevice 
*dev)
struct usb_plat *plat = dev_get_plat(dev);
struct ehci_mxs_port *port = >port;
u32 phandle, phy_reg, clk_reg, clk_id;
+   ofnode np = dev_ofnode(dev);
ofnode phy_node, clk_node;
const char *mode;
int ret;
 
-   mode = ofnode_read_string(dev->node_, "dr_mode");
+   mode = ofnode_read_string(np, "dr_mode");
if (mode) {
if (strcmp(mode, "peripheral") == 0)
plat->init_type = USB_INIT_DEVICE;
@@ -151,12 +152,12 @@ static int ehci_usb_ofdata_to_platdata(struct udevice 
*dev)
}
 
/* Read base address of the USB IP block */
-   ret = ofnode_read_u32(dev->node_, "reg", >usb_regs);
+   ret = ofnode_read_u32(np, "reg", >usb_regs);
if (ret)
return ret;
 
/* Read base address of the USB PHY IP block */
-   ret = ofnode_read_u32(dev->node_, "fsl,usbphy", );
+   ret = ofnode_read_u32(np, "fsl,usbphy", );
if (ret)
return ret;
 
-- 
2.34.1



Re: [RFC PATCH] mxs: Don't enable 4P2 reg if mx28 is powered only from DCDC_BATT without 5V

2023-10-07 Thread Fabio Estevam
Hi Alan,

[Adding Lukasz and Cody]

On Tue, Aug 30, 2022 at 2:49 PM Alan Kay  wrote:
>
> mxs_power_enable_4p2() was added to mxs_batt_boot() in
> 'commit a0f97610757d ("ARM: mxs: Enable DCDC converter for battery boot")'
> to enable DCDC converter when board is powered from 5V and has
> detected sufficient battery voltage.
> This involves enabling 4P2 regulator and there is a code
> in mxs_power_enable_4p2() that disables VDDIO, VDDA, VDDD outputs of
> the DCDC converter and enables BO for each power rail e.g.
>
> setbits_le32(_regs->hw_power_vddioctrl,
> POWER_VDDIOCTRL_DISABLE_FET | POWER_VDDIOCTRL_PWDN_BRNOUT);
>
> In case the mx28 is powered by the 5V source and linear regulators are
> supplying power to the VDDIO, VDDA, VDDD rails there is no issue.
>
> However if the mx28 is powered by the DCDC_BATT source only without 5V,
> disabling the DCDC converter outputs causes brownout power down.
>
> The proposed solution is not to call mxs_power_enable_4p2() at all
> if the mx28 is powered by the DCDC_BATT source only. There is no
> reason to enable 4P2 regulator in this case and setup of all registers
> is done in mxs_batt_boot().
>
> Also there is no need to enable 5V brownout in
> mxs_power_init() in this case.
>
> Please consider if this is acceptable and I will submit a proper patch.
>
> Signed-off-by: Alan Kay 

Cody also sent a fix for this issue:

https://patchwork.ozlabs.org/project/uboot/patch/20230703163340.101490-2-c...@londelec.com/


Re: [PATCH v5] imx: imx8mm: Add support for Mettler-Toledo snowflake board.

2023-10-07 Thread Fabio Estevam
On Fri, Sep 29, 2023 at 9:13 AM Manuel Traut  wrote:
>
> This patch probably got somehow lost. Rebased against latest master.
>
> It is originally based on:
>
> From patchwork Fri Mar 31 14:18:41 2023
> X-Patchwork-Submitter: Sebastian Andrzej Siewior 
> X-Patchwork-Id: 1763795
> X-Patchwork-Delegate: sba...@denx.de
> Return-Path: 
> X-Original-To: incom...@patchwork.ozlabs.org
> Delivered-To: patchwork-incom...@legolas.ozlabs.org
> Authentication-Results: legolas.ozlabs.org;
>  spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de
>  (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;
>  envelope-from=u-boot-boun...@lists.denx.de; receiver=)
> Authentication-Results: legolas.ozlabs.org;
>
> The board is similar to "Kontron SL i.MX 8M Mini" SoM. There are two variants.
> Snowflake_v2 has an external SDCard Interface. LEIG is the same, but without
> display and without external SDCard Interface. Both variants support
> only 1GiB of main memory.
>
> [ bigeasy: porting and a bit of cleanup ]
>
> Signed-off-by: Manuel Traut 
> Signed-off-by: Sebastian Andrzej Siewior 
> Reviewed-by: Frieder Schrempf 
>
> v4?v5:
>  - Rebased on top of todays master
> v3?v4:
>  - Added Frieder's tag
>  - Rebased on top of v2023.07-rc5.
> v2?v3:
>  Addressing Frieder's comments:
>  - Add "kontron,imx8mm-sl" to the compatible string.
>  - Remove pca9450 node and pinctrl_i2c1. The included
>imx8mm-kontron-sl.dtsi already provides this.
>  - Merge the overwritten values in dram_timing.ddrc_cfg/fsp_msg directly
>into lpddr4_timing.c.
>  - Simplify the init in spl_dram_init() and panic() if the init failed.
>  - Replace a reference to SMARC with the current product name of the
>SoM.
>
> v1?v2:
>  - Clarify details about the board and whether or not there is an
>external SD-card interface.

The changelog should go below the --- line.

Reviewed-by: Fabio Estevam 


Re: [PATCH v1] board: toradex: verdin-imx8mm: set fixed LPDDR4 refresh rate as per errata ERR050805

2023-10-07 Thread Fabio Estevam
On Thu, Sep 28, 2023 at 11:57 AM Andrejs Cainikovs
 wrote:
>
> From: Andrejs Cainikovs 
>
> Update lpddr4 configuration and training using updated spreadsheet and
> tools from NXP using data from previous spreadsheet and verified
> toward datasheet:
>
> - MX8M_Mini_LPDDR4_RPA_v22.xlsx
> - mscale_ddr_tool_v3.31_setup.exe
>
> The most relevant update is related to errata ERR050805:
> "DRAM: Controller automatic derating logic may not work when
> the LPDDR4 memory temperature is above 85 °C at initialization"
>
> Other relevant fixes:
> - DRAMTMG7 register: corrected calculation of T_CKPDX parameter
>   (equal to tCKCKEH for LPDDR4)
> - RANKCTL register: corrected calculations for ODTLon and ODTLoff
>   to follow the JEDEC specification
> - ADDRMAP7 register: added support for 17-row devices
>
> As per errata ERR050805:
>
> An issue exists with the automatic derating logic of the DDR
> controller that only samples the LPDDR4 MR4 register when the
> Temperature Update Flag (TUF) field (MR4[7] ) is 1’b1. If the
> LPDDR4 memory is initialized and starts operation above 85 °C
> (MR4[2:0] > 3’b011), the MR4 Temperature Update Flag (TUF) will
> not be set. The DDR Controller will therefore not automatically
> adjust the memory refresh rate or de-rate memory timings based
> on the LPDDR4 memory temperature. This may cause the controller
> incorrectly setting the refresh period, potentially cause the
> LPDDR4 memory losing data contents and lead to possible data
> integrity issues above 85 °C.
>
> Errata provides three possible workaround options, while option 2
> is the most reasonable:
>
> Disable the automatic derating logic of the DDR controller and
> apply fixed x2 refresh rate (0.5x refresh). This option is
> suitable for designs that are expected to boot at or above 85 °C
> and memory’s MR4[2:0] (Refresh Rate) DOES NOT report the following
> conditions:
> 3b101: 0.25x refresh, no de-rating
> 3b110: 0.25x refresh, with de-rating
> 3b111: SDRAM High temperature operating limit exceeded
>
> [1]: https://www.nxp.com/docs/en/errata/IMX8MM_0N87W.pdf
>
> Signed-off-by: Andrejs Cainikovs 

Reviewed-by: Fabio Estevam 


Re: [PATCH v2 1/6] board: phytec: Add common PHYTEC SoM detection

2023-10-07 Thread Fabio Estevam
On Mon, Aug 28, 2023 at 9:32 AM Yannic Moog  wrote:
>
> On Thu, 2023-08-17 at 10:57 +0200, Teresa Remmet wrote:
> > Recent shipped PHYTEC SoMs come with an i2c  EEPROM containing
> > information about the hardware such as board revision and variant.
> > This can be used for RAM detection and loading device tree overlays
> > during kernel start.
> >
> > Signed-off-by: Teresa Remmet 
>
> Reviewed-by: Yannic Moog 
> Tested-by: Yannic Moog 

For the series:

Reviewed-by: Fabio Estevam 


Re: [PATCH] usbarmory: Add DM_I2C and DM_SERIAL support

2023-10-07 Thread Fabio Estevam
On Thu, Sep 21, 2023 at 8:27 AM Andrej Rosano
 wrote:
>
> From: Andrej Rosano 
>
> Use DM_I2C and DM_SERIAL as it is now mandatory.
>
> Signed-off-by: Andrej Rosano 

Reviewed-by: Fabio Estevam 


Re: [PATCH 2/2] dm: adc: imx93-adc depends on ADC (fix boot)

2023-10-07 Thread Fabio Estevam
On Wed, Oct 4, 2023 at 6:09 AM Sébastien Szymanski
 wrote:
>
> The i.MX93 11x11 EVK fails to boot with following error:
>
>  Model: NXP i.MX93 11X11 EVK board
>  DRAM:  2 GiB
>  Error binding driver 'imx93-adc': -96
>  Some drivers failed to bind
>  Error binding driver 'simple_bus': -96
>  Some drivers failed to bind
>  Error binding driver 'simple_bus': -96
>  Some drivers failed to bind
>  initcall sequence fffb8f28 failed at call 8021e0d4 (err=-96)
>  ### ERROR ### Please RESET the board ###
>
> That's because since commit e7ff54d96303 ("imx93_evk: defconfig: add adc
> support") CONFIG_ADC_IMX93 is enabled but CONFIG_ADC is not.
> Fix this by enabling CONFIG_ADC in imx93_11x11_evk_defconfig.
>
> Make sure this situation won't happen again in future i.MX93 defconfig by
> making CONFIG_ADC_IMX93 depend on CONFIG_ADC.
>
> Signed-off-by: Sébastien Szymanski 

Reviewed-by: Fabio Estevam 


Re: [PATCH 1/2] arm: dts: imx93-11x11-evk: add bootph-some-ram property

2023-10-07 Thread Fabio Estevam
On Wed, Oct 4, 2023 at 6:09 AM Sébastien Szymanski
 wrote:
>
> i.MX93 11x11 EVK fails to boot:
>
> U-Boot SPL 2023.10-00558-g65b9b3462bec-dirty (Oct 03 2023 - 17:40:10 +0200)
> SOC: 0xa0009300
> LC: 0x40010
> M33 prepare ok
> Normal Boot
> Trying to boot from BOOTROM
> Boot Stage: Primary boot
> image offset 0x8000, pagesize 0x200, ivt offset 0x0
> Load image from 0x44400 by ROM_API
> NOTICE:  BL31: v2.8(release):android-13.0.0_2.0.0-0-ge4b2dbfa52f5
> NOTICE:  BL31: Built : 17:52:46, Sep 28 2023
>
> That's because commit 9e644284ab81 ("dm: core: Report
> bootph-pre-ram/sram node as pre-reloc after relocation"):
>
> "[This] changes behavior of what nodes are bound in the U-Boot
> proper pre-relocation phase. Change to bootph-all or add
> bootph-some-ram prop to restore prior behavior."
>
> Fix this by adding bootph-some-ram prop as suggested by the commit
> above.
>
> Fixes: 9e644284ab81 ("dm: core: Report bootph-pre-ram/sram node as pre-reloc 
> after relocation")
> Signed-off-by: Sébastien Szymanski 

Yes, it is getting harder and harder to keep track of all these boot properties.

Thanks for fixing it:

Reviewed-by: Fabio Estevam 


Re: [PATCH] toradex: verdin-imx8mm/imx8mp: Remove bootcmd_mfg

2023-10-07 Thread Fabio Estevam
On Wed, Oct 4, 2023 at 4:14 PM Francesco Dolcini  wrote:
>
> From: Joao Paulo Goncalves 
>
> The bootcmd_mfg env variable is legacy from IMX downstream u-boot branch
> and is not needed on mainline.
>
> Signed-off-by: Joao Paulo Goncalves 
> Signed-off-by: Francesco Dolcini 

Reviewed-by: Fabio Estevam 


Re: [PATCH] arm: mach-imx: Makefile: Extend u-boot-nand.imx padding

2023-10-07 Thread Fabio Estevam
On Tue, Oct 3, 2023 at 6:27 PM Hiago De Franco  wrote:
>
> From: Hiago De Franco 
>
> Extend the padding process of u-boot-nand.imx target by adding 10k bytes
> of zeros to the end of the binary using the 'dd' command.
>
> The existing padding method did not generate a functional binary,
> as discussed in more detail in this thread [1]. Instead, we adopt the
> end-padding calculation method documented in 'board/doc/colibri_imx7.rst'
> as a reference, which is relevant for iMX7 with NAND storage.
>
> Adding 10k bytes of zeros provides an approximate value that makes the
> proper padding for these NAND devices.
>
> [1] 
> https://lore.kernel.org/all/cac4tdfuqffqzrqfv5age_xtbfy1agr2sepn_fzedexhwjdr...@mail.gmail.com/
>
> Signed-off-by: Hiago De Franco 

Reviewed-by: Fabio Estevam 


Re: [PATCH] toradex: colibri_imx7: Enable nand/emmc detection and set boot variant

2023-10-07 Thread Fabio Estevam
On Mon, Oct 2, 2023 at 10:08 AM Hiago De Franco  wrote:
>
> From: Hiago De Franco 
>
> Add detection of eMMC vs NAND devices on the Colibri iMX7
> board. A GPIO is configured to detect the presence of an on-board resistor
> that is configured differently based on the flash memory used. Depending on
> the detection result, the 'variant' environment variable is set to '-emmc'
> or cleared, indicating the type of storage device.
>
> This enhancement improves variant detection during system initialization
> through USB recovery mode, where U-Boot is loaded directly to RAM. This
> allows variant detection for an accurate device tree selection.
>
> Signed-off-by: Hiago De Franco 

Reviewed-by: Fabio Estevam 


Re: [PATCH 1/1] [u-boot][master][PATCH v5] pico-imx7d: add baseboard SD card boot detect

2023-10-07 Thread Fabio Estevam
On Fri, Oct 6, 2023 at 6:37 PM  wrote:
>
> From: Benjamin Szőke 
>
> Take over codes from Techenxion to support

Typo in Technexion.

> mmc autodetect boot for pico-imx7d.

Please explain better in the commit log that you are adding support
for the SD card in variants like the nymph baseboard.

>  int board_mmc_getcd(struct mmc *mmc)
>  {
> -   /* Assume uSDHC3 emmc is always present */
> -   return 1;
> +   struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
> +   int ret = 0;
> +
> +   switch (cfg->esdhc_base) {
> +   case USDHC1_BASE_ADDR:
> +   ret = !gpio_get_value(USDHC1_CD_GPIO); /* Assume uSDHC1 sd is 
> always present */

Remove the comment as this is no longer true. You are reading a GPIO
to decide that.

> +   break;
> +   case USDHC3_BASE_ADDR:
> +   ret = !gpio_get_value(USDHC3_CD_GPIO); /* Assume uSDHC3 emmc 
> is always present */

Remove the comment as this is no longer true. You are reading a GPIO
to decide that.

>  int board_mmc_init(struct bd_info *bis)
>  {
> -   imx_iomux_v3_setup_multiple_pads(usdhc3_pads, 
> ARRAY_SIZE(usdhc3_pads));
> -   usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
> -   return fsl_esdhc_initialize(bis, _cfg[0]);
> +   int ret;
> +   u32 index = 0;

No need to initialize 'index' with 0.

I tested it here on an imx7d-pico-pi. Prior to your patch, I got:

U-Boot 2023.10-00559-g931b7c36604b (Oct 07 2023 - 09:17:25 -0300)

CPU:   Freescale i.MX7D rev1.2 1000 MHz (running at 792 MHz)
CPU:   Commercial temperature grade (0C to 95C) at 55C
Reset cause: POR
Model: TechNexion PICO-IMX7D Board and PI baseboard
Board: i.MX7D PICOSOM
DRAM:  512 MiB
Core:  75 devices, 16 uclasses, devicetree: separate
PMIC: PFUZE3000 DEV_ID=0x30 REV_ID=0x11
MMC:   FSL_SDHC: 3, FSL_SDHC: 1, FSL_SDHC: 0
Loading Environment from MMC... OK
In:serial@30a7
Out:   serial
Err:   serial
Net:   eth0: ethernet@30be
Hit any key to stop autoboot:  0

After your patch:

U-Boot 2023.10-00560-g9bf37c401a1d-dirty (Oct 07 2023 - 09:23:54 -0300)

CPU:   Freescale i.MX7D rev1.2 1000 MHz (running at 792 MHz)
CPU:   Commercial temperature grade (0C to 95C) at 54C
Reset cause: POR
Model: TechNexion PICO-IMX7D Board and PI baseboard
Board: i.MX7D PICOSOM
DRAM:  512 MiB
Core:  72 devices, 16 uclasses, devicetree: separate
PMIC: PFUZE3000 DEV_ID=0x30 REV_ID=0x11
MMC:   FSL_SDHC: 1, FSL_SDHC: 0
Loading Environment from MMC... OK
In:serial@30a7
Out:   serial
Err:   serial
MMC Device 2 not found
no mmc device at slot 2
Net:   eth0: ethernet@30be

The messages:

MMC Device 2 not found
no mmc device at slot 2

are a bit annoying as there is no SD card in the imx7d-pico-pi.

I would prefer if these messages were not shown.

Can you try to get rid of it on the  imx7d-pico-pi?

Tested-by: Fabio Estevam 


Re: [PATCH 1/1] [u-boot][master][PATCH v4] pico-imx7d: add baseboard SD card boot detect

2023-10-05 Thread Fabio Estevam
On Thu, Oct 5, 2023 at 6:40 PM  wrote:
>
> From: Benjamin Szőke 
>
> Take over codes from Techenxion to support mmc autodetect boot for pico-imx7d.
>
> Signed-off-by: Benjamin Szőke 

Still not good:

WARNING: Possible unwrapped commit description (prefer a maximum 75
chars per line)
#57:
Take over codes from Techenxion to support mmc autodetect boot for pico-imx7d.

WARNING: Use 'if (IS_ENABLED(CONFIG...))' instead of '#if or #ifdef'
where possible
#90: FILE: board/technexion/pico-imx7d/pico-imx7d.c:134:
+#if CONFIG_IS_ENABLED(FSL_ESDHC_IMX)

CHECK: Unnecessary parentheses around 'autodetect_str != NULL'
#95: FILE: board/technexion/pico-imx7d/pico-imx7d.c:139:
+ if ((autodetect_str != NULL) &&
+ (strcmp(autodetect_str, "yes") == 0)) {

CHECK: Comparison to NULL could be written "autodetect_str"
#95: FILE: board/technexion/pico-imx7d/pico-imx7d.c:139:
+ if ((autodetect_str != NULL) &&

CHECK: Alignment should match open parenthesis
#96: FILE: board/technexion/pico-imx7d/pico-imx7d.c:140:
+ if ((autodetect_str != NULL) &&
+ (strcmp(autodetect_str, "yes") == 0)) {

ERROR: switch and case should be at the same indent
#111: FILE: board/technexion/pico-imx7d/pico-imx7d.c:155:
+ switch (get_boot_device()) {
+ case SD3_BOOT:
+ case MMC3_BOOT:
[...]
+ case SD1_BOOT:
[...]
+ default:

ERROR: trailing whitespace
#127: FILE: board/technexion/pico-imx7d/pico-imx7d.c:171:
+^I$

WARNING: Use 'if (IS_ENABLED(CONFIG...))' instead of '#if or #ifdef'
where possible
#140: FILE: board/technexion/pico-imx7d/pico-imx7d.c:224:
+#if CONFIG_IS_ENABLED(FSL_ESDHC_IMX)

WARNING: Use 'if (IS_ENABLED(CONFIG...))' instead of '#if or #ifdef'
where possible
#141: FILE: board/technexion/pico-imx7d/pico-imx7d.c:225:
+#if defined(CONFIG_ENV_IS_IN_MMC) || defined(CONFIG_ENV_IS_NOWHERE)

WARNING: Move const after static - use 'static const iomux_v3_cfg_t'
#178: FILE: board/technexion/pico-imx7d/spl.c:165:
+static iomux_v3_cfg_t const usdhc1_pads[] = {

WARNING: Move const after static - use 'static const iomux_v3_cfg_t'
#189: FILE: board/technexion/pico-imx7d/spl.c:176:
+static iomux_v3_cfg_t const usdhc3_emmc_pads[] = {

CHECK: Lines should not end with a '('
#238: FILE: board/technexion/pico-imx7d/spl.c:225:
+ imx_iomux_v3_setup_multiple_pads(

CHECK: Lines should not end with a '('
#242: FILE: board/technexion/pico-imx7d/spl.c:229:
+ imx_iomux_v3_setup_multiple_pads(

ERROR: switch and case should be at the same indent
#246: FILE: board/technexion/pico-imx7d/spl.c:233:
+ switch (get_boot_device()) {
+ case SD1_BOOT:
[...]
+ case MMC3_BOOT:
[...]
+ case SD3_BOOT:
+ default:

total: 3 errors, 6 warnings, 5 checks, 220 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
  mechanically convert to the typical style using --fix or --fix-inplace.

NOTE: Whitespace errors detected.
  You may wish to use scripts/cleanpatch or scripts/cleanfile


Re: [PATCH 1/1] [u-boot][master][PATCH v3] pico-imx7d: add baseboard SD card boot detect

2023-10-04 Thread Fabio Estevam
On Wed, Oct 4, 2023 at 8:35 PM  wrote:
>
> From: Benjamin Szőke 
>
> Take over codes from Techenxion to support mmc autodetect boot for pico-imx7d.
>
> Signed-off-by: Benjamin Szőke 

I wanted to test your patch, but there are several issues:

checkpatch complains:
total: 5 errors, 7 warnings, 5 checks, 214 lines checked

git am complains:

Applying: pico-imx7d: add baseboard SD card boot detect
.git/rebase-apply/patch:41: trailing whitespace.
.git/rebase-apply/patch:58: trailing whitespace.
.git/rebase-apply/patch:61: trailing whitespace.
warning: 3 lines add whitespace errors.

Then when I try to build:

board/technexion/pico-imx7d/pico-imx7d.c: In function ‘board_late_mmc_init’:
board/technexion/pico-imx7d/pico-imx7d.c:173:9: warning: implicit
declaration of function ‘run_command’
[-Wimplicit-function-declaration]
  173 | run_command(cmd, 0);
  | ^~~
board/technexion/pico-imx7d/pico-imx7d.c:150:14: warning: unused
variable ‘mmcblk’ [-Wunused-variable]
  150 | char mmcblk[32];
  |  ^~

board/technexion/pico-imx7d/spl.c: In function ‘board_mmc_init’:
board/technexion/pico-imx7d/spl.c:261:33: error:
‘CONFIG_SYS_FSL_USDHC_NUM’ undeclared (first use in this function);
did you mean ‘CFG_SYS_FSL_USDHC_NUM’?
  261 | for (index = 0; index < CONFIG_SYS_FSL_USDHC_NUM; ++index) {
  | ^~~~
  | CFG_SYS_FSL_USDHC_NUM
board/technexion/pico-imx7d/spl.c:261:33: note: each undeclared
identifier is reported only once for each function it appears in
make[2]: *** [scripts/Makefile.build:256:
spl/board/technexion/pico-imx7d/spl.o] Error 1
make[1]: *** [scripts/Makefile.spl:533: spl/board/technexion/pico-imx7d] Error 2

You clearly haven't tested your patch.


[PATCH v2] pico-pi-imx7d: Unselect CONFIG_CONSOLE_MUX

2023-10-03 Thread Fabio Estevam
From: Fabio Estevam 

Unselect CONFIG_CONSOLE_MUX to fix the following
error for the input, output and error interfaces:

U-Boot 2023.10 (Oct 03 2023 - 21:23:18 -0300)
...
In:No input devices available!
Out:   No output devices available!
Err:   No error devices available!
Net:   eth0: ethernet@30be
Hit any key to stop autoboot:  0 

Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Apply for all pico-imx7 defconfigs.

 configs/pico-dwarf-imx7d_defconfig  | 1 +
 configs/pico-hobbit-imx7d_defconfig | 1 +
 configs/pico-imx7d_bl33_defconfig   | 1 +
 configs/pico-imx7d_defconfig| 1 +
 configs/pico-nymph-imx7d_defconfig  | 1 +
 configs/pico-pi-imx7d_defconfig | 1 +
 6 files changed, 6 insertions(+)

diff --git a/configs/pico-dwarf-imx7d_defconfig 
b/configs/pico-dwarf-imx7d_defconfig
index 2cd906a63da0..8a99b813daee 100644
--- a/configs/pico-dwarf-imx7d_defconfig
+++ b/configs/pico-dwarf-imx7d_defconfig
@@ -22,6 +22,7 @@ CONFIG_BOARD_SIZE_LIMIT=715776
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTCOMMAND="run findfdt; run finduuid; run distro_bootcmd"
 CONFIG_DEFAULT_FDT_FILE="imx7d-pico-dwarf.dtb"
+# CONFIG_CONSOLE_MUX is not set
 CONFIG_SPL_MAX_SIZE=0xe000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_MAX_SIZE=0x10
diff --git a/configs/pico-hobbit-imx7d_defconfig 
b/configs/pico-hobbit-imx7d_defconfig
index b63281e53322..9a51a958a686 100644
--- a/configs/pico-hobbit-imx7d_defconfig
+++ b/configs/pico-hobbit-imx7d_defconfig
@@ -22,6 +22,7 @@ CONFIG_BOARD_SIZE_LIMIT=715776
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTCOMMAND="run findfdt; run finduuid; run distro_bootcmd"
 CONFIG_DEFAULT_FDT_FILE="imx7d-pico-hobbit.dtb"
+# CONFIG_CONSOLE_MUX is not set
 CONFIG_SPL_MAX_SIZE=0xe000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_MAX_SIZE=0x10
diff --git a/configs/pico-imx7d_bl33_defconfig 
b/configs/pico-imx7d_bl33_defconfig
index 546e1e6545d3..b5eedec82757 100644
--- a/configs/pico-imx7d_bl33_defconfig
+++ b/configs/pico-imx7d_bl33_defconfig
@@ -24,6 +24,7 @@ CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="run distro_bootcmd"
+# CONFIG_CONSOLE_MUX is not set
 CONFIG_SPL_MAX_SIZE=0xe000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_MAX_SIZE=0x10
diff --git a/configs/pico-imx7d_defconfig b/configs/pico-imx7d_defconfig
index f11e1f4ef413..02af6533e37a 100644
--- a/configs/pico-imx7d_defconfig
+++ b/configs/pico-imx7d_defconfig
@@ -22,6 +22,7 @@ CONFIG_BOARD_SIZE_LIMIT=715776
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTCOMMAND="run findfdt; run finduuid; run distro_bootcmd"
 CONFIG_DEFAULT_FDT_FILE="ask"
+# CONFIG_CONSOLE_MUX is not set
 CONFIG_SPL_MAX_SIZE=0xe000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_MAX_SIZE=0x10
diff --git a/configs/pico-nymph-imx7d_defconfig 
b/configs/pico-nymph-imx7d_defconfig
index 2cd906a63da0..8a99b813daee 100644
--- a/configs/pico-nymph-imx7d_defconfig
+++ b/configs/pico-nymph-imx7d_defconfig
@@ -22,6 +22,7 @@ CONFIG_BOARD_SIZE_LIMIT=715776
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTCOMMAND="run findfdt; run finduuid; run distro_bootcmd"
 CONFIG_DEFAULT_FDT_FILE="imx7d-pico-dwarf.dtb"
+# CONFIG_CONSOLE_MUX is not set
 CONFIG_SPL_MAX_SIZE=0xe000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_MAX_SIZE=0x10
diff --git a/configs/pico-pi-imx7d_defconfig b/configs/pico-pi-imx7d_defconfig
index 3e26aae40053..5b479818d88e 100644
--- a/configs/pico-pi-imx7d_defconfig
+++ b/configs/pico-pi-imx7d_defconfig
@@ -22,6 +22,7 @@ CONFIG_BOARD_SIZE_LIMIT=715776
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTCOMMAND="run findfdt; run finduuid; run distro_bootcmd"
 CONFIG_DEFAULT_FDT_FILE="imx7d-pico-pi.dtb"
+# CONFIG_CONSOLE_MUX is not set
 CONFIG_SPL_MAX_SIZE=0xe000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_MAX_SIZE=0x10
-- 
2.34.1



[PATCH] pico-pi-imx7d: Unselect CONFIG_CONSOLE_MUX

2023-10-03 Thread Fabio Estevam
From: Fabio Estevam 

Unselect CONFIG_CONSOLE_MUX to fix the following
error for the input, output and error interfaces:

U-Boot 2023.10 (Oct 03 2023 - 21:23:18 -0300)

CPU:   Freescale i.MX7D rev1.2 1000 MHz (running at 792 MHz)
CPU:   Commercial temperature grade (0C to 95C) at 42C
Reset cause: POR
Model: TechNexion PICO-IMX7D Board and PI baseboard
Board: i.MX7D PICOSOM
DRAM:  512 MiB
Core:  75 devices, 16 uclasses, devicetree: separate
PMIC: PFUZE3000 DEV_ID=0x30 REV_ID=0x11
MMC:   FSL_SDHC: 3, FSL_SDHC: 1, FSL_SDHC: 0
Loading Environment from MMC... OK
In:No input devices available!
Out:   No output devices available!
Err:   No error devices available!
Net:   eth0: ethernet@30be
Hit any key to stop autoboot:  0 

Signed-off-by: Fabio Estevam 
---
 configs/pico-pi-imx7d_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/pico-pi-imx7d_defconfig b/configs/pico-pi-imx7d_defconfig
index 3e26aae40053..5b479818d88e 100644
--- a/configs/pico-pi-imx7d_defconfig
+++ b/configs/pico-pi-imx7d_defconfig
@@ -22,6 +22,7 @@ CONFIG_BOARD_SIZE_LIMIT=715776
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTCOMMAND="run findfdt; run finduuid; run distro_bootcmd"
 CONFIG_DEFAULT_FDT_FILE="imx7d-pico-pi.dtb"
+# CONFIG_CONSOLE_MUX is not set
 CONFIG_SPL_MAX_SIZE=0xe000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_MAX_SIZE=0x10
-- 
2.34.1



Re: Trying to boot custom kernel on Wink Hub (i.MX28)

2023-09-26 Thread Fabio Estevam
Hi Rogan,

On Tue, Sep 26, 2023 at 1:01 AM Rogan Dawes  wrote:
>
> Hi Fabio,
>
> That prints "LLC", but does not print "Pref".

What happens if you unselect DM_SERIAL like this:

--- a/configs/imx28-wink-hub_defconfig
+++ b/configs/imx28-wink-hub_defconfig
@@ -58,4 +58,3 @@ CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_RTC_MXS=y
-CONFIG_DM_SERIAL=y


Re: Trying to boot custom kernel on Wink Hub (i.MX28)

2023-09-25 Thread Fabio Estevam
Hi Rogan,

On Mon, Sep 25, 2023 at 4:27 PM Rogan Dawes  wrote:
>
> That outputs LLC about a second after the mxsldr terminates (kinda slowly, 
> the individual characters can be seen being emitted one at a time), and then 
> about 5 seconds later, "Pref". But nothing after that point.
>
> At least it looks like there is something happening, which is excellent!

I pushed a change in my branch. Please give it a try.


[PATCH] smegw01: Fix inverted CONFIG_SYS_BOOT_LOCKED logic

2023-09-25 Thread Fabio Estevam
From: Eduard Strehlau 

CONFIG_SYS_BOOT_LOCKED means that a restricted boot environment will
be used. In this case, hab_auth_img_or_fail should be called to prevent
U-Boot to continue running when the fitImage authentication fails.

Fix the logic accordingly.

Additionally, select CONFIG_SYS_BOOT_LOCKED by default.

Signed-off-by: Eduard Strehlau 
Signed-off-by: Fabio Estevam 
---
Hi Tom,

We have just identified this bug.

Could you please pick this one directly for U-Boot 2023.10?

Thanks

 board/storopack/smegw01/smegw01.env | 4 ++--
 configs/smegw01_defconfig   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/board/storopack/smegw01/smegw01.env 
b/board/storopack/smegw01/smegw01.env
index 528310dd81..93de866910 100644
--- a/board/storopack/smegw01/smegw01.env
+++ b/board/storopack/smegw01/smegw01.env
@@ -67,9 +67,9 @@ mmcboot=
run altbootcmd;
fi;
 #ifdef CONFIG_SYS_BOOT_LOCKED
-   hab_auth_img ${fileaddr} ${filesize};
-#else
hab_auth_img_or_fail ${fileaddr} ${filesize};
+#else
+   hab_auth_img ${fileaddr} ${filesize};
 #endif
run mmcargs;
if bootm; then
diff --git a/configs/smegw01_defconfig b/configs/smegw01_defconfig
index 616038387e..03d403ddc8 100644
--- a/configs/smegw01_defconfig
+++ b/configs/smegw01_defconfig
@@ -7,7 +7,7 @@ CONFIG_ENV_OFFSET=0x10
 CONFIG_DM_GPIO=y
 CONFIG_DEFAULT_DEVICE_TREE="imx7d-smegw01"
 CONFIG_TARGET_SMEGW01=y
-# CONFIG_SYS_BOOT_LOCKED is not set
+CONFIG_SYS_BOOT_LOCKED=y
 CONFIG_ENV_OFFSET_REDUND=0x11
 CONFIG_ARMV7_BOOT_SEC_DEFAULT=y
 # CONFIG_ARMV7_VIRT is not set
-- 
2.41.0



Re: Trying to boot custom kernel on Wink Hub (i.MX28)

2023-09-25 Thread Fabio Estevam
On Mon, Sep 25, 2023 at 11:00 AM Rogan Dawes  wrote:

> I see absolutely nothing in the console.
>
> I’m wondering whether I can possibly execute the vendor SPL with a modern 
> u-boot?

The old U-Boot vendor does not use SPL. It uses an old mechanism
called bootlets.

I suggest that we start from scratch with this imx28-wink-hub support
that I have just added:
https://github.com/fabioestevam/u-boot/commits/wink

To build it:

make imx28-wink-hub_defconfig
make u-boot.sb

Then try to load u-boot.sb via mxsldr.

If it still fails, then I suspect that the power management unit (PMU)
may be incorrectly configured causing the board to not power up.

Try playing with the CONFIG_SPL_MXS_PMU_ options.

>From configs/imx28_xea_defconfig, for example:

CONFIG_SPL_MXS_PMU_MINIMAL_VDD5V_CURRENT=y
CONFIG_SPL_MXS_PMU_DISABLE_BATT_CHARGE=y
# CONFIG_SPL_MXS_PMU_ENABLE_4P2_LINEAR_REGULATOR is not set


Re: Trying to boot custom kernel on Wink Hub (i.MX28)

2023-09-25 Thread Fabio Estevam
Hi Rogan,

On Mon, Sep 25, 2023 at 6:52 AM Rogan Dawes  wrote:
>
> Hi Fabio,
>
> I used the following diff with "make mx28evk_defconfig", but unfortunately 
> still get absolutely nothing on the DUART when running "mxsloader u-boot.sb". 
> In fact, mxsloader returns immediately on trying to load my own u-boot.sb, 
> whereas it hangs when running the vendor u-boot.sb, I assume because the CALL 
> never returns. Additionally, there is no need to reset the board between 
> attempting a custom u-boot and the vendor u-boot, indicating that the 
> ROM-based SDP protocol handler is still running. This suggests that there is 
> something wrong with the format of the u-boot.sb file which the ROM-based SDP 
> protocol handler is rejecting, I would think?

I just tested loading u-boot.sb via mxsldr on my imx28-evk.

I configured the boot jumpers to USB boot, turned on the board and
then saw that it gets recognized by the host PC:

$ dmesg

[1710347.828895] usb 1-1: new high-speed USB device number 96 using xhci_hcd
[1710347.977657] usb 1-1: New USB device found, idVendor=15a2,
idProduct=004f, bcdDevice= 0.01
[1710347.977672] usb 1-1: New USB device strings: Mfr=1, Product=2,
SerialNumber=0
[1710347.977678] usb 1-1: Product: ROM Recovery
[1710347.977682] usb 1-1: Manufacturer: Freescale,Inc.
[1710347.979708] hid-generic 0003:15A2:004F.0014: hiddev0,hidraw1: USB
HID v1.10 Device [Freescale,Inc. ROM Recovery] on
usb-:00:14.0-1/input0

After that, I loaded the u-boot.sb via mxsldr:

$ sudo ./mxsldr u-boot.sb
Detected: i.MX28
Chip ID:  0x2800
Chip Revision:0x0001
ROM Version:  0x0101
Protocol Version: 0x0100

Do you get these messages above (both the dmesg as well the messages
after running mxsldr)?

And in the console, I do see the U-Boot messages coming up:

HTLLCLLC

U-Boot 2023.10-rc4-00057-g4cb31a9f3560 (Sep 25 2023 - 09:49:04 -0300)

CPU:   Freescale i.MX28 rev1.2 at 454 MHz
BOOT:  USB #0
DRAM:  128 MiB
Core:  89 devices, 12 uclasses, devicetree: separate
NAND:  0 MiB
MMC:   MXS MMC: 0
Loading Environment from MMC... *** Warning - No block device, using
default environment

In:serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  0


Re: Trying to boot custom kernel on Wink Hub (i.MX28)

2023-09-24 Thread Fabio Estevam
Hi Rogan,

On Sun, Sep 24, 2023 at 5:16 PM Rogan Dawes  wrote:
>
> Hi folks,
>
> I eventually decided that I did need to figure out the DRAM timings for the 
> Micron chip on my board, but I found an easier way than actually 
> "understanding what I'm doing"! :-)
>
> I pulled the vendor U-Boot image off the flash, skipped the appropriate 
> number of bytes until I was actually dealing with a u-boot.sb formatted image 
> (looking for the STMP signature I found in the compiled mainline u-boot), 
> then used the Rockbox project's sbtoelf tool to convert the SB back to two 
> ELF files, the SPL.elf and the u-boot.elf. From there I loaded the SPL.elf 
> into ghidra, then went looking for byte sequences found in 
> arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c to see if I could locate them in 
> the vendor blob. I did, right at the end of the binary, then converted bytes 
> into uint32 sequences so that I could compare with the mxs_dram_vals for 
> CONFIG_MX28.
>
> Did the compare and found a single bit that is different between the two 
> sequences of initialisation values. Literally a 1 to a 0, and that is all. So 
> I built mainline with that change, and an updated iomux_setup because the 
> Wink Hub v1 uses MX28_PAD_I2C0_SCL__DUART_RX and MX28_PAD_I2C0_SDA__DUART_TX 
> for its console pins. i was hoping to see it boot via mxsldr, but 
> unfortunately, I got nothing.

Ideally, you should create a new imx28-wink_defconfig.

For a quick test, besides changing iomux_setup, please make sure that
arch/arm/dts/imx28-evk.dts also has the duart pins changed.

> How can I get the SPL to emit something on the console to confirm it is 
> running? i.e. before the DRAM initialisation?

SPL runs from the internal RAM, and should print something to the
console prior to the DRAM init.


Re: [PATCH] verdin-imx8mp: drop unused tdx easy installer ifdef

2023-09-20 Thread Fabio Estevam
On Mon, Sep 4, 2023 at 11:09 AM Hiago De Franco  wrote:
>
> From: Hiago De Franco 
>
> Drop unused code related to CONFIG_TDX_EASY_INSTALLER, that existed only on
> toradex downstream branch.
>
> Signed-off-by: Hiago De Franco 

Reviewed-by: Fabio Estevam 


Re: [PATCH] imx8mp: binman: rename spl and u-boot nodes

2023-09-20 Thread Fabio Estevam
On Tue, Sep 19, 2023 at 6:29 AM Rasmus Villemoes
 wrote:
>
> The hab signing script doc/imx/habv4/csf_examples/mx8m/csf.sh does
>
>   fdtget -t x u-boot.dtb /binman/imx-boot/uboot offset
>
> to figure out the offset of u-boot.itb inside flash.bin. That works
> fine for imx8mm, imx8mn, imx8mq, but fails for imx8mp because in that
> case 'uboot' is merely a label and not actually the node name.
>
> Homogenize these cases and make imx8mp the same as the other imx8m*
> variants. The binman type is explicitly given and no longer derived
> from the node name, and the csf.sh script will work for all four SOCs.
>
> Signed-off-by: Rasmus Villemoes 

Reviewed-by: Fabio Estevam 


Re: [PATCH v2] mx8m: csf.sh: pad csf blob for u-boot.itb to CSF_SIZE minus IVT header

2023-09-20 Thread Fabio Estevam
On Wed, Sep 20, 2023 at 7:34 AM Rasmus Villemoes
 wrote:
>
> When built with CONFIG_IMX_HAB, the full FIT image, including stuff
> tacked on beyond the end of the fdt structure, is expected to be (fdt
> size rounded up to 0x1000 boundary)+CONFIG_CSF_SIZE.
>
> Now, when the FIT image is loaded from a storage device, it doesn't
> really matter that the flash.bin that gets written to target isn't
> quite that big - we will just load some garbage bytes that are never
> read or used for anything. But when flash.bin is uploaded via uuu,
> it's important that we actually serve at least as many bytes as the
> target expects, or we will hang in rom_api_download_image().
>
> Extend the logic in the csf.sh script so that the csf blob is padded
> to CONFIG_CSF_SIZE minus the size of the IVT header.
>
> Signed-off-by: Rasmus Villemoes 
> ---
> v2: use dd instead of truncate.

Reviewed-by: Fabio Estevam 


Re: [PATCH resend 2/2] imx: spl_imx_romapi.c: remove dead code

2023-09-20 Thread Fabio Estevam
On Tue, Sep 19, 2023 at 10:49 AM Rasmus Villemoes
 wrote:
>
> These IS_ENABLED(CONFIG_SPL_LOAD_FIT) cases can no longer be reached,
> and thus get_fit_image_size() is also redundant.
>
> Signed-off-by: Rasmus Villemoes 

Reviewed-by: Fabio Estevam 


Re: [PATCH resend 1/2] imx: spl_imx_romapi: avoid tricky use of spl_load_simple_fit() to get full FIT size

2023-09-20 Thread Fabio Estevam
On Tue, Sep 19, 2023 at 10:49 AM Rasmus Villemoes
 wrote:
>
> Currently, spl_imx_romapi uses a somewhat tricky workaround for the
> fact that a FIT image with external data doesn't directly allow one to
> know the full size of the file: It does a dummy spl_load_simple_fit(),
> having the ->read callback remember the largest offset requested, and
> then does a last call to rom_api_download_image() to fetch the
> remaining part of the full FIT image.
>
> We can avoid that by just keeping track of how much we have downloaded
> already, and if the ->read() requests something outside the current
> valid buffer, fetch up to the end of the current request.
>
> The current method also suffers from not working when CONFIG_IMX_HAB
> is enabled: While in that case u-boot.itb is not built with external
> data, so the fdt header does contain the full size of the dtb
> structure. However, it does not account for the extra CONFIG_CSF_SIZE
> added by board_spl_fit_size_align(). And also, the data it hands out
> during the first dummy spl_load_simple_fit() is of course garbage, and
> wouldn't pass the verification.
>
> So we really need to call spl_load_simple_fit() only once, let that
> figure out just how big the FIT image is (including whatever data, CSF
> or "ordinary" external data, has been tacked on beyond the fdt
> structure), and always provide valid data from the ->read callback.
>
> This only affects the CONFIG_SPL_LOAD_FIT case - I don't have any
> hardware or experience with the CONFIG_SPL_LOAD_IMX_CONTAINER case, so
> I leave that alone for now.
>
> Signed-off-by: Rasmus Villemoes 

Reviewed-by: Fabio Estevam 


[PATCH] smegw01: Use CONFIG_SYS_LOAD_ADDR for loading fitImage

2023-09-20 Thread Fabio Estevam
From: Eduard Strehlau 

Set CONFIG_SYS_LOAD_ADDR=0x8800 and use this address for
loading fitImage.

Also pass the standard CONFIG_BOOTFILE option to indicate
the fitImage file.

Signed-off-by: Eduard Strehlau 
Signed-off-by: Fabio Estevam 
---
 board/storopack/smegw01/smegw01.env | 14 +++---
 configs/smegw01_defconfig   |  3 +++
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/board/storopack/smegw01/smegw01.env 
b/board/storopack/smegw01/smegw01.env
index 1263ddac8ed0..528310dd810f 100644
--- a/board/storopack/smegw01/smegw01.env
+++ b/board/storopack/smegw01/smegw01.env
@@ -48,13 +48,8 @@ commit_mmc=
saveenv;
fi;
 console=ttymxc0
-fdt_addr=0x8300
-fdtfile=imx7d-smegw01.dtb
-fit_addr=0x8800
-image=fitImage
-loadaddr=0x8080
 loadbootpart=mmc partconf 1 boot_part
-loadimage=load mmc ${mmcdev}:${gpt_partition_entry} ${fit_addr} boot/${image}
+loadimage=load mmc ${mmcdev}:${gpt_partition_entry}
 loadpart=gpt setenv mmc ${mmcdev} rootfs-${mmcpart_committed}
 mmcargs=
setenv bootargs console=${console},${baudrate} 
root=/dev/mmcblk${mmcdev}p${gpt_partition_entry} rootwait rw 
SM_ROOT_DEV=${mmcdev} SM_ROOT_PART=${gpt_partition_entry} 
SM_BOOT_PART=${boot_part}
@@ -71,8 +66,13 @@ mmcboot=
else
run altbootcmd;
fi;
+#ifdef CONFIG_SYS_BOOT_LOCKED
+   hab_auth_img ${fileaddr} ${filesize};
+#else
+   hab_auth_img_or_fail ${fileaddr} ${filesize};
+#endif
run mmcargs;
-   if bootm ${fit_addr}; then
+   if bootm; then
;
else
run altbootcmd;
diff --git a/configs/smegw01_defconfig b/configs/smegw01_defconfig
index 7f1b2bee8e16..616038387e27 100644
--- a/configs/smegw01_defconfig
+++ b/configs/smegw01_defconfig
@@ -14,6 +14,7 @@ CONFIG_ARMV7_BOOT_SEC_DEFAULT=y
 CONFIG_IMX_RDC=y
 CONFIG_IMX_BOOTAUX=y
 CONFIG_IMX_HAB=y
+CONFIG_SYS_LOAD_ADDR=0x8800
 CONFIG_SYS_MEMTEST_START=0x8000
 CONFIG_SYS_MEMTEST_END=0xa000
 CONFIG_FIT=y
@@ -54,6 +55,8 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_SYS_MMC_ENV_DEV=1
 CONFIG_ENV_WRITEABLE_LIST=y
 CONFIG_ENV_ACCESS_IGNORE_FORCE=y
+CONFIG_USE_BOOTFILE=y
+CONFIG_BOOTFILE="boot/fitImage"
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_BOUNCE_BUFFER=y
 CONFIG_BOOTCOUNT_LIMIT=y
-- 
2.34.1



[PATCH] pico-imx7d: Remove Vanessa from MAINTAINERS

2023-09-19 Thread Fabio Estevam
From: Fabio Estevam 

Vanessa's NXP e-mail is no longer active.

Contacted her offline and she told me that she does not have
access to the board anymore and it is OK to remove her
from MAINTAINERS.

Signed-off-by: Fabio Estevam 
---
 board/technexion/pico-imx7d/MAINTAINERS | 1 -
 1 file changed, 1 deletion(-)

diff --git a/board/technexion/pico-imx7d/MAINTAINERS 
b/board/technexion/pico-imx7d/MAINTAINERS
index 325e1735c39a..5dccac4d55b4 100644
--- a/board/technexion/pico-imx7d/MAINTAINERS
+++ b/board/technexion/pico-imx7d/MAINTAINERS
@@ -1,5 +1,4 @@
 TechNexion PICO-IMX7D board
-M: Vanessa Maegima 
 M: Otavio Salvador 
 S: Maintained
 F: board/technexion/pico-imx7d/
-- 
2.34.1



[PATCH] imx7: Disable CAAM Job Ring 0

2023-09-12 Thread Fabio Estevam
From: Fabio Estevam 

Trying to boot a fitImage after a successful hab_auth_img operation
causes the following error:

 ## Loading kernel from FIT Image at 8800 ...
   Using 'conf-imx7d-smegw01.dtb' configuration
   Trying 'kernel-1' kernel subimage
 Description:  Linux kernel
 Type: Kernel Image
 Compression:  uncompressed
 Data Start:   0x8800010c
 Data Size:9901752 Bytes = 9.4 MiB
 Architecture: ARM
 OS:   Linux
 Load Address: 0x8080
 Entry Point:  0x8080
 Hash algo:sha256
 Hash value:   
28f8779bbf010780f16dd3d84ecb9b604c44c5c2cf7acd098c264a2d3f68e969
   Verifying Hash Integrity ... sha256Error in SEC deq
   CAAM was not setup properly or it is faulty error!

The reason for this error is that the BootROM uses the CAAM Job Ring 0,
so disable its node in U-Boot to avoid the resource conflict.

imx8m dtsi files also have the Job Ring 0 disable since the following
kernel commit:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch?h=v6.5=dc9c1ceb555ff661e6fc1081434600771f29657c

For a temporary solution, disable the Job Ring 0 in imx7s-u-boot.dtsi.

Reported-by: Eduard Strehlau 
Signed-off-by: Fabio Estevam 
---
 arch/arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi | 2 ++
 arch/arm/dts/imx7d-pico-pi-u-boot.dtsi | 2 ++
 arch/arm/dts/imx7d-sdb-qspi-u-boot.dtsi| 2 ++
 arch/arm/dts/imx7d-sdb-u-boot.dtsi | 2 ++
 arch/arm/dts/imx7d-smegw01-u-boot.dtsi | 3 +++
 arch/arm/dts/imx7s-u-boot.dtsi | 7 +++
 6 files changed, 18 insertions(+)
 create mode 100644 arch/arm/dts/imx7d-smegw01-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx7s-u-boot.dtsi

diff --git a/arch/arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi 
b/arch/arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi
index 52aa8758701f..57ca28edb70d 100644
--- a/arch/arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi
+++ b/arch/arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi
@@ -3,6 +3,8 @@
  * Copyright 2020-2022 Toradex
  */
 
+#include "imx7s-u-boot.dtsi"
+
 &{/aliases} {
/* SDHCI instance order: eMMC, SD/MMC */
mmc0 = 
diff --git a/arch/arm/dts/imx7d-pico-pi-u-boot.dtsi 
b/arch/arm/dts/imx7d-pico-pi-u-boot.dtsi
index 67b41ae1129c..843b4583e53a 100644
--- a/arch/arm/dts/imx7d-pico-pi-u-boot.dtsi
+++ b/arch/arm/dts/imx7d-pico-pi-u-boot.dtsi
@@ -1,3 +1,5 @@
+#include "imx7s-u-boot.dtsi"
+
 /{
 aliases {
 mmc0 = 
diff --git a/arch/arm/dts/imx7d-sdb-qspi-u-boot.dtsi 
b/arch/arm/dts/imx7d-sdb-qspi-u-boot.dtsi
index 62cdcbaeb67d..896c8bcaa5ad 100644
--- a/arch/arm/dts/imx7d-sdb-qspi-u-boot.dtsi
+++ b/arch/arm/dts/imx7d-sdb-qspi-u-boot.dtsi
@@ -3,6 +3,8 @@
  * Copyright 2018 NXP
  */
 
+#include "imx7s-u-boot.dtsi"
+
  {
flash0: mx25l51245g@0 {
compatible = "jedec,spi-nor";
diff --git a/arch/arm/dts/imx7d-sdb-u-boot.dtsi 
b/arch/arm/dts/imx7d-sdb-u-boot.dtsi
index ac1d6e2e6480..e4a27b8dd5aa 100644
--- a/arch/arm/dts/imx7d-sdb-u-boot.dtsi
+++ b/arch/arm/dts/imx7d-sdb-u-boot.dtsi
@@ -1,3 +1,5 @@
+#include "imx7s-u-boot.dtsi"
+
  {
status = "disable";
 };
diff --git a/arch/arm/dts/imx7d-smegw01-u-boot.dtsi 
b/arch/arm/dts/imx7d-smegw01-u-boot.dtsi
new file mode 100644
index ..90f7500ee34c
--- /dev/null
+++ b/arch/arm/dts/imx7d-smegw01-u-boot.dtsi
@@ -0,0 +1,3 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+#include "imx7s-u-boot.dtsi"
diff --git a/arch/arm/dts/imx7s-u-boot.dtsi b/arch/arm/dts/imx7s-u-boot.dtsi
new file mode 100644
index ..c4c1da3c64f1
--- /dev/null
+++ b/arch/arm/dts/imx7s-u-boot.dtsi
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+ OR MIT
+
+ {
+   sec_jr0: jr@1000 {
+   status = "disabled";
+   };
+};
-- 
2.34.1



[PATCH 3/3] imx: hab: Explain that ivt_offset is optional

2023-09-06 Thread Fabio Estevam
From: Fabio Estevam 

The ivt_offset parameter is optional for both hab_auth_img_or_fail
and hab_auth_img commands.

Document it in their usage texts to make it clearer.

Signed-off-by: Fabio Estevam 
---
 arch/arm/mach-imx/hab.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-imx/hab.c b/arch/arm/mach-imx/hab.c
index ea9c5d3c9fd4..41121d575734 100644
--- a/arch/arm/mach-imx/hab.c
+++ b/arch/arm/mach-imx/hab.c
@@ -700,7 +700,7 @@ U_BOOT_CMD(
"addr length ivt_offset\n"
"addr - image hex address\n"
"length - image hex length\n"
-   "ivt_offset - hex offset of IVT in the image"
+   "ivt_offset - hex offset of IVT in the image (optional)"
  );
 
 U_BOOT_CMD(
@@ -716,7 +716,7 @@ U_BOOT_CMD(
"addr length ivt_offset\n"
"addr - image hex address\n"
"length - image hex length\n"
-   "ivt_offset - hex offset of IVT in the image"
+   "ivt_offset - hex offset of IVT in the image (optional)"
  );
 
 U_BOOT_CMD(
-- 
2.34.1



[PATCH 2/3] imx: hab: Improve the hab_auth_img_or_fail usage text

2023-09-06 Thread Fabio Estevam
From: Fabio Estevam 

Split the hab_auth_img_or_fail usage text in two sentences to make it
clearer.

Signed-off-by: Fabio Estevam 
---
 arch/arm/mach-imx/hab.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/hab.c b/arch/arm/mach-imx/hab.c
index 6cacca069d9f..ea9c5d3c9fd4 100644
--- a/arch/arm/mach-imx/hab.c
+++ b/arch/arm/mach-imx/hab.c
@@ -712,7 +712,7 @@ U_BOOT_CMD(
 U_BOOT_CMD(
hab_auth_img_or_fail, 4, 0,
do_authenticate_image_or_failover,
-   "authenticate image via HAB on failure drop to USB BootROM 
mode",
+   "authenticate image via HAB. Switch to USB BootROM mode on 
failure",
"addr length ivt_offset\n"
"addr - image hex address\n"
"length - image hex length\n"
-- 
2.34.1



[PATCH 1/3] imx: hab: Allow hab_auth_img_or_fail to be called without ivt_offset

2023-09-06 Thread Fabio Estevam
From: Eduard Strehlau 

Since commit ea91031b2232 ("imx: hab: extend hab_auth_img to calculate
ivt_offset"), it is possible to call the hab_auth_img command without the 
last ivt_offset argument.

Currently, calling hab_auth_img_or_fail without the last
ivt_offset parameter causes a failure and the command usage text is shown.

Fix this problem by adjusting the argc logic to allow
calling hab_auth_img_or_fail with only the address and size parameters.

This way, both hab_auth_img and hab_auth_img_or_fail have the same
behavior with respect to the allowed number of command parameters.
 
Signed-off-by: Eduard Strehlau 
Signed-off-by: Fabio Estevam 
---
 arch/arm/mach-imx/hab.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/hab.c b/arch/arm/mach-imx/hab.c
index 439cdaf07a7c..6cacca069d9f 100644
--- a/arch/arm/mach-imx/hab.c
+++ b/arch/arm/mach-imx/hab.c
@@ -659,7 +659,7 @@ static int do_authenticate_image_or_failover(struct cmd_tbl 
*cmdtp, int flag,
 {
int ret = CMD_RET_FAILURE;
 
-   if (argc != 4) {
+   if (argc < 3) {
ret = CMD_RET_USAGE;
goto error;
}
-- 
2.34.1




Re: [RFC 0/6] firmware: scmi: add SCMI pinctrl protocol support

2023-09-05 Thread Fabio Estevam
Adding Peng Fan, who is working on scmi/pinctrl support for i.MX9:

https://lore.kernel.org/all/ZO9GLG5tQynYyAvR@pluto/T/

On Tue, Sep 5, 2023 at 11:41 PM AKASHI Takahiro
 wrote:
>
> This is an RFC and meant to get feedback from other developers as
> - the specification (pinctrl part) is still in a draft
> - the upstream patch for linux, including dt bindings, is still WIP
> - I'm not confident the drivers are generic enough to cover most HWs
> - The tests ("ut") doesn't cover all the features yet
>
>
> This patch series allows users to access SCMI pin control protocol provided
> by SCMI server (platform). See SCMI specification document v3.2 beta 2[1]
> for more details about SCMI pin control protocol.
>
> The implementation consists of two layers:
> - basic helper functions for SCMI pin control protocol
>   in drivers/firmware/scmi/pinctrl.c (patch#2)
> - DM-compliant pinctrl/gpio drivers, which utilizes the helper functions,
>   in drivers/pinctrl/pinctrl-scmi.c (patch#3,#4)
>
> [1] https://developer.arm.com/documentation/den0056/e/?lang=en
>
> DT bindings
> ===
> Upstream pinctrl patch for linux defines the bindings in [2] though
> it doesn't say much.
> I expect that my implementation basically complies with U-Boot's generic
> bindings described in [3], but not all the features are verified.
>
> As for gpio, unless you hard-code pin assignments directly in a device
> driver, my implementation allows the following alternatives in DT.
> Either way, we may need an additional binding description for gpio.
>
> (A)
> scmi {
> ... // other protocols
> scmi_pinctrl: protocol@19 { // Pin control protocol
> ...
> {pinmux definitions}... // if any, including GPIO?
> }
> }
> scmi_gpio: scmi_gpio {
> compatible = "arm,scmi-gpio-generic";
> gpio-controller;
> #gpio-cells = <2>;
> gpio-ranges = <_pinctrl 0 5 4>,
>   <_pinctrl 4 0 0>;
> gpio-ranges-group-names = "",
>   "ANOTHER_GPIO_GROUP";
> }
> some_device {
> ...
> reset-gpios = <_gpio 0 GPIO_ACTIVE_HIGH>;
> }
> (B)
> scmi {
> ... // other protocols
> scmi_pinctrl: protocol@19 { // Pin control protocol
> ...
> {pinmux definitions}... // if any, including GPIO?
>
> scmi_gpio: scmi_gpio {
> // no need for "compatible"
> gpio-controller;
> #gpio-cells = <2>;
> gpio-ranges = <_pinctrl 0 5 4>,
>   <_pinctrl 4 0 0>;
> gpio-ranges-group-names = "",
>   "ANOTHER_GPIO_GROUP";
> }
> }
> }
> some_device {
> ...
> reset-gpios = <_gpio 0 GPIO_ACTIVE_HIGH>;
> }
> (C)
> if "gpio-ranges" is missing in gpio definition, assume 1:1 mapping,
> i.e. use a native pinctrl pin number (5).
> some_device {
> ...
> reset-gpios = <_gpio 5 GPIO_ACTIVE_HIGH>;
> }
>
>
> [2] https://lkml.iu.edu/hypermail/linux/kernel/2308.1/01084.html
> [3] /doc/device-tree-bindings/pinctrl/pinctrl-bindings.txt
> /doc/device-tree-bindings/gpio/gpio.txt
>
> Test
> 
> The patch series was tested on the following platforms:
> * sandbox ("ut dm pinmux" and manually using gpio command)
>
>
> Prerequisite:
> =
> * This patch series is based on my WIP "Base protocol support" patches
>   on v2023.10-rc3. You can fetch the whole code from [4].
>
> [4] https://git.linaro.org/people/takahiro.akashi/u-boot.git
> branch:scmi/pinctrl
>
>
> Patches:
> 
> Patch#1: Add SCMI base protocol driver
> Patch#2-#4: Add drivers
> Patch#5-#6: Test related
>
>
> Change history:
> ===
> RFC (Sep 6, 2023)
> * initial release as RFC
>
> AKASHI Takahiro (6):
>   firmware: scmi: fix protocol enumeration logic
>   firmware: scmi: add pinctrl protocol support
>   pinctrl: add scmi driver
>   gpio: add scmi driver based on pinctrl
>   firmware: scmi: add pseudo pinctrl protocol support on sandbox
>   test: dm: add SCMI pinctrl test
>
>  arch/sandbox/dts/test.dts  |  115 +++
>  cmd/scmi.c |1 +
>  drivers/firmware/scmi/Kconfig  |3 +
>  drivers/firmware/scmi/Makefile |1 +
>  drivers/firmware/scmi/pinctrl.c|  412 
>  drivers/firmware/scmi/sandbox-scmi_agent.c |  722 +
>  drivers/firmware/scmi/scmi_agent-uclass.c  |   18 +-
>  drivers/pinctrl/Kconfig|   11 +
>  drivers/pinctrl/Makefile   |1 +
>  drivers/pinctrl/pinctrl-scmi.c | 1071 
>  include/scmi_agent-uclass.h|2 +
>  include/scmi_protocols.h   |  435 
>  test/dm/scmi.c |   62 ++
>  13 files changed, 2852 insertions(+), 2 deletions(-)

Re: [PATCH] imx: hab: Use CONFIG_SPL_LOAD_FIT_ADDRESS in the CSF example

2023-08-31 Thread Fabio Estevam

On 31/08/2023 11:56, Marek Vasut wrote:

The SPL authenticates image starting from CONFIG_SPL_LOAD_FIT_ADDRESS
address, update the csf_fit.txt to match.

Signed-off-by: Marek Vasut 
---
Cc: "NXP i.MX U-Boot Team" 
Cc: Fabio Estevam 
Cc: Peng Fan 
Cc: Rasmus Villemoes 
Cc: Stefano Babic 
Cc: Tim Harvey 
---
 doc/imx/habv4/csf_examples/mx8m/csf_fit.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/imx/habv4/csf_examples/mx8m/csf_fit.txt
b/doc/imx/habv4/csf_examples/mx8m/csf_fit.txt
index 3d79edf2813..97f3eea573b 100644
--- a/doc/imx/habv4/csf_examples/mx8m/csf_fit.txt
+++ b/doc/imx/habv4/csf_examples/mx8m/csf_fit.txt
@@ -27,4 +27,4 @@
   Verification index = 2
   # FIXME:
   # Line 1 -- fitImage
-  Blocks = 0x401fcdc0 0x57c00 0x "flash.bin"
+  Blocks = CONFIG_SPL_LOAD_FIT_ADDRESS 0x57c00 0x "flash.bin"


Reviewed-by: Fabio Estevam 

Thanks


Re: [PATCH v1] board: toradex: verdin-imx8mp: enable usb device and fastboot support

2023-08-28 Thread Fabio Estevam
Hi Marcel,

On Mon, Aug 28, 2023 at 6:38 PM Marcel Ziswiler  wrote:
>
> From: Marcel Ziswiler 
>
> Enable USB device and fastboot support which may be used to load the
> Toradex Easy Installer FIT image.
>
> While at it also enable USB mass storage aka UMS support.
>
> Note that the i.MX 8M Plus recovery mode support is based on the USB
> boot stage of the BOOTROM and does NOT require USB SDP SPL aka serial
> downloader support.
>
> Signed-off-by: Marcel Ziswiler 

Reviewed-by: Fabio Estevam 


Re: [PATCH v2 0/6] PHYTEC SoM detection for phyCORE-i.MX8MP

2023-08-24 Thread Fabio Estevam
Hi Yannic,

On Thu, Aug 17, 2023 at 5:57 AM Teresa Remmet  wrote:
>
> second version of the series to add support for EEPROM SoM detection used
> by different PHYTEC SoMs. The EEPROM data consist of 32 bytes containing
> information like PCB revision, RAM size and other SoM specific
> configuration.
>
> For SoMs of the i.MX8M family the data is written to two areas of the
> used i2c EEPROM.
>
> We initally add the detection support for phyCORE-i.MX8MP. Due to layout
> constraints phyCORE-i.MX8MP SoMs with PCB revision 2 and older can only
> make use of a lower RAM frequency. This changes with the use of newer PCB
> revisions. We make use of the factory flashed EEPROM data to detect the
> PCB revision and select the fitting RAM settings.
>
> Changes in v2:
> - fix wrong RAM Timing values as pointed out by Yannic
> - removed superfluous goto
> - removed blank line at EOF
> - fix string conversion to integer
> - fix typo s/revsions/revisions

Could you please help review v2?

Thanks


Re: [PATCH v1] board: toradex: verdin-imx8mm: enable usb sdp spl recovery support

2023-08-24 Thread Fabio Estevam
Hi Marcel,

On Tue, Aug 22, 2023 at 7:17 PM Marcel Ziswiler  wrote:
>
> From: Marcel Ziswiler 
>
> Enable USB SDP SPL aka serial downloader recovery mode support.
>
> While at it also enable fastboot support which may be used to
> subsequently load further stages like a Toradex Easy Installer FIT
> image.
>
> Signed-off-by: Marcel Ziswiler 

Yes, this is helpful:

Reviewed-by: Fabio Estevam 


[PATCH v2 5/5] thermal: imx_tmu: Increase the polling interval

2023-08-23 Thread Fabio Estevam
From: Fabio Estevam 

Polling every second to check whether the CPU has cooled down is
too frequent.

Allow more time for the CPU to cool down by increasing the polling
interval to 5 seconds by defaut.

This value is used in the absence of the 'polling-delay' devicetree
property.

Signed-off-by: Fabio Estevam 
---
Changes since v1:
- None

 drivers/thermal/imx_tmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/imx_tmu.c b/drivers/thermal/imx_tmu.c
index f79b583811..15e01b6166 100644
--- a/drivers/thermal/imx_tmu.c
+++ b/drivers/thermal/imx_tmu.c
@@ -37,7 +37,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #define TER_ADC_PD 0x4000
 #define TER_ALPF   0x3
 
-#define IMX_TMU_POLLING_DELAY_MS   1000
+#define IMX_TMU_POLLING_DELAY_MS   5000
 /*
  * i.MX TMU Registers
  */
-- 
2.34.1



[PATCH v2 4/5] thermal: imx_tmu: Fix the temperature unit

2023-08-23 Thread Fabio Estevam
From: Fabio Estevam 

The temperature unit is millidegree Celsius, so divide by 1000 to correctly
print the temperature values in Celsius.

While at it, also change a typo: "has beyond" to "is beyond".

Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Rebased.

 drivers/thermal/imx_tmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/thermal/imx_tmu.c b/drivers/thermal/imx_tmu.c
index d2ea084d2d2f..b877ee36878f 100644
--- a/drivers/thermal/imx_tmu.c
+++ b/drivers/thermal/imx_tmu.c
@@ -238,8 +238,8 @@ int imx_tmu_get_temp(struct udevice *dev, int *temp)
return ret;
 
while (cpu_tmp >= pdata->alert) {
-   dev_crit(dev, "CPU Temperature (%dC) has beyond alert (%dC), 
close to critical (%dC) waiting...\n",
-cpu_tmp, pdata->alert, pdata->critical);
+   dev_crit(dev, "CPU Temperature (%dC) is beyond alert (%dC), 
close to critical (%dC) waiting...\n",
+cpu_tmp / 1000, pdata->alert / 1000, pdata->critical / 
1000);
mdelay(pdata->polling_delay);
ret = read_temperature(dev, _tmp);
if (ret)
-- 
2.34.1



[PATCH v2 3/5] thermal: imx_tmu: Increase the log level for high temperatures

2023-08-23 Thread Fabio Estevam
From: Fabio Estevam 

dev_info() message is not printed by default. Increase the log level
to dev_crit(). This allows the critical messages related to the temperature
getting beyong the alert threshold to be displayed.

Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Use dev_crit() instead of selecting LOG via Kconfig. (Tom)

 drivers/thermal/imx_tmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/imx_tmu.c b/drivers/thermal/imx_tmu.c
index d9a04eaf79fb..d2ea084d2d2f 100644
--- a/drivers/thermal/imx_tmu.c
+++ b/drivers/thermal/imx_tmu.c
@@ -238,7 +238,7 @@ int imx_tmu_get_temp(struct udevice *dev, int *temp)
return ret;
 
while (cpu_tmp >= pdata->alert) {
-   dev_info(dev, "CPU Temperature (%dC) has beyond alert (%dC), 
close to critical (%dC) waiting...\n",
+   dev_crit(dev, "CPU Temperature (%dC) has beyond alert (%dC), 
close to critical (%dC) waiting...\n",
 cpu_tmp, pdata->alert, pdata->critical);
mdelay(pdata->polling_delay);
ret = read_temperature(dev, _tmp);
-- 
2.34.1



[PATCH v2 2/5] thermal: imx_tmu: Fix the polling default

2023-08-23 Thread Fabio Estevam
From: Fabio Estevam 

When the 'polling-delay' property is not passed via devicetree,
pdata->polling_delay keeps at 0. This causes the imx_tmu driver to get
stuck inside the busy while() loop when the CPU temperature is above
the alert point.

Fix this problem by passing a one second polling interval, which provides
a proper delay to let the system to cool down and exit the while() loop
when the temperature is below the alert point.

Signed-off-by: Fabio Estevam 
---
Changes since v1:
- None

 drivers/thermal/imx_tmu.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/thermal/imx_tmu.c b/drivers/thermal/imx_tmu.c
index 97efc55044..d9a04eaf79 100644
--- a/drivers/thermal/imx_tmu.c
+++ b/drivers/thermal/imx_tmu.c
@@ -37,6 +37,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #define TER_ADC_PD 0x4000
 #define TER_ALPF   0x3
 
+#define IMX_TMU_POLLING_DELAY_MS   1000
 /*
  * i.MX TMU Registers
  */
@@ -574,6 +575,8 @@ static int imx_tmu_parse_fdt(struct udevice *dev)
 
dev_dbg(dev, "%s\n", __func__);
 
+   pdata->polling_delay = IMX_TMU_POLLING_DELAY_MS;
+
if (pdata->zone_node) {
pdata->regs = (union tmu_regs *)dev_read_addr_ptr(dev);
 
@@ -602,7 +605,8 @@ static int imx_tmu_parse_fdt(struct udevice *dev)
 
dev_dbg(dev, "args.args_count %d, id %d\n", args.args_count, pdata->id);
 
-   pdata->polling_delay = dev_read_u32_default(dev, "polling-delay", 1000);
+   pdata->polling_delay = dev_read_u32_default(dev, "polling-delay",
+   IMX_TMU_POLLING_DELAY_MS);
 
trips_np = ofnode_path("/thermal-zones/cpu-thermal/trips");
ofnode_for_each_subnode(trips_np, trips_np) {
-- 
2.34.1



[PATCH v2 1/5] imx8mm_evk_defconfig: Select CONFIG_IMX_TMU

2023-08-23 Thread Fabio Estevam
From: Fabio Estevam 

Select the i.MX8MM thermal driver as it is useful for displaying
the CPU temperature and its grading:

CPU:   Commercial temperature grade (0C to 95C) at 38C

It also prevents booting when the temperature is above the alert
point.

Signed-off-by: Fabio Estevam 
---
Changes since v1:
- None

 configs/imx8mm_evk_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/imx8mm_evk_defconfig b/configs/imx8mm_evk_defconfig
index ac9810fe1b..822c2fbfab 100644
--- a/configs/imx8mm_evk_defconfig
+++ b/configs/imx8mm_evk_defconfig
@@ -104,6 +104,7 @@ CONFIG_SPL_SYSRESET=y
 CONFIG_SYSRESET_PSCI=y
 CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_DM_THERMAL=y
+CONFIG_IMX_TMU=y
 CONFIG_USB=y
 CONFIG_SPL_USB_HOST=y
 CONFIG_USB_EHCI_HCD=y
-- 
2.34.1



[PATCH 5/5] thermal: imx_tmu: Increase the polling interval

2023-08-23 Thread Fabio Estevam
From: Fabio Estevam 

Polling every second to check whether the CPU has cooled down is
too frequent.

Allow more time for the CPU to cool down by increasing the polling
interval to 5 seconds by defaut.

This value is used in the absence of the 'polling-delay' devicetree
property.

Signed-off-by: Fabio Estevam 
---
 drivers/thermal/imx_tmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/imx_tmu.c b/drivers/thermal/imx_tmu.c
index f79b583811..15e01b6166 100644
--- a/drivers/thermal/imx_tmu.c
+++ b/drivers/thermal/imx_tmu.c
@@ -37,7 +37,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #define TER_ADC_PD 0x4000
 #define TER_ALPF   0x3
 
-#define IMX_TMU_POLLING_DELAY_MS   1000
+#define IMX_TMU_POLLING_DELAY_MS   5000
 /*
  * i.MX TMU Registers
  */
-- 
2.34.1



[PATCH 4/5] thermal: imx_tmu: Fix th temperature unit

2023-08-23 Thread Fabio Estevam
From: Fabio Estevam 

The temperature unit is millidegree Celsius, so divide by 1000 to correctly
print the temperature values in Celsius.

While at it, also change a typo: "has beyond" to "is beyond".

Signed-off-by: Fabio Estevam 
---
 drivers/thermal/imx_tmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/thermal/imx_tmu.c b/drivers/thermal/imx_tmu.c
index d9a04eaf79..f79b583811 100644
--- a/drivers/thermal/imx_tmu.c
+++ b/drivers/thermal/imx_tmu.c
@@ -238,8 +238,8 @@ int imx_tmu_get_temp(struct udevice *dev, int *temp)
return ret;
 
while (cpu_tmp >= pdata->alert) {
-   dev_info(dev, "CPU Temperature (%dC) has beyond alert (%dC), 
close to critical (%dC) waiting...\n",
-cpu_tmp, pdata->alert, pdata->critical);
+   dev_info(dev, "CPU Temperature (%dC) is beyond alert (%dC), 
close to critical (%dC) waiting...\n",
+cpu_tmp / 1000, pdata->alert / 1000, pdata->critical / 
1000);
mdelay(pdata->polling_delay);
ret = read_temperature(dev, _tmp);
if (ret)
-- 
2.34.1



[PATCH 3/5] thermal: imx_tmu: Select LOG

2023-08-23 Thread Fabio Estevam
From: Fabio Estevam 

Without LOG being selected, the dev_info() information
from the imx_tmu driver cannot be printed.

Select the LOG option, so that no dev_info() messages are lost.

Signed-off-by: Fabio Estevam 
---
 drivers/thermal/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
index 681b621760..0a1d11e216 100644
--- a/drivers/thermal/Kconfig
+++ b/drivers/thermal/Kconfig
@@ -29,6 +29,7 @@ config IMX_SCU_THERMAL
 config IMX_TMU
 bool "Thermal Management Unit driver for NXP i.MX8M and iMX93"
 depends on ARCH_IMX8M || IMX93
+select LOG
 help
   Support for Temperature sensors on NXP i.MX8M and iMX93.
   It supports one critical trip point and one passive trip point.
-- 
2.34.1



[PATCH 2/5] thermal: imx_tmu: Fix the polling default

2023-08-23 Thread Fabio Estevam
From: Fabio Estevam 

When the 'polling-delay' property is not passed via devicetree,
pdata->polling_delay keeps at 0. This causes the imx_tmu driver to get
stuck inside the busy while() loop when the CPU temperature is above
the alert point.

Fix this problem by passing a one second polling interval, which provides
a proper delay to let the system to cool down and exit the while() loop
when the temperature is below the alert point.

Signed-off-by: Fabio Estevam 
---
 drivers/thermal/imx_tmu.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/thermal/imx_tmu.c b/drivers/thermal/imx_tmu.c
index 97efc55044..d9a04eaf79 100644
--- a/drivers/thermal/imx_tmu.c
+++ b/drivers/thermal/imx_tmu.c
@@ -37,6 +37,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #define TER_ADC_PD 0x4000
 #define TER_ALPF   0x3
 
+#define IMX_TMU_POLLING_DELAY_MS   1000
 /*
  * i.MX TMU Registers
  */
@@ -574,6 +575,8 @@ static int imx_tmu_parse_fdt(struct udevice *dev)
 
dev_dbg(dev, "%s\n", __func__);
 
+   pdata->polling_delay = IMX_TMU_POLLING_DELAY_MS;
+
if (pdata->zone_node) {
pdata->regs = (union tmu_regs *)dev_read_addr_ptr(dev);
 
@@ -602,7 +605,8 @@ static int imx_tmu_parse_fdt(struct udevice *dev)
 
dev_dbg(dev, "args.args_count %d, id %d\n", args.args_count, pdata->id);
 
-   pdata->polling_delay = dev_read_u32_default(dev, "polling-delay", 1000);
+   pdata->polling_delay = dev_read_u32_default(dev, "polling-delay",
+   IMX_TMU_POLLING_DELAY_MS);
 
trips_np = ofnode_path("/thermal-zones/cpu-thermal/trips");
ofnode_for_each_subnode(trips_np, trips_np) {
-- 
2.34.1



[PATCH 1/5] imx8mm_evk_defconfig: Select CONFIG_IMX_TMU

2023-08-23 Thread Fabio Estevam
From: Fabio Estevam 

Select the i.MX8MM thermal driver as it is useful for displaying
the CPU temperature and its grading:

CPU:   Commercial temperature grade (0C to 95C) at 38C

It also prevents booting when the temperature is above the alert
point.

Signed-off-by: Fabio Estevam 
---
 configs/imx8mm_evk_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/imx8mm_evk_defconfig b/configs/imx8mm_evk_defconfig
index ac9810fe1b..822c2fbfab 100644
--- a/configs/imx8mm_evk_defconfig
+++ b/configs/imx8mm_evk_defconfig
@@ -104,6 +104,7 @@ CONFIG_SPL_SYSRESET=y
 CONFIG_SYSRESET_PSCI=y
 CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_DM_THERMAL=y
+CONFIG_IMX_TMU=y
 CONFIG_USB=y
 CONFIG_SPL_USB_HOST=y
 CONFIG_USB_EHCI_HCD=y
-- 
2.34.1



Re: [PATCH] spl: watchdog: introduce SPL_HW_WATCHDOG

2023-08-22 Thread Fabio Estevam
Hi Oleksandr,

On Tue, Aug 22, 2023 at 12:53 PM Oleksandr Suvorov
 wrote:

> ddr-1d-imem-fw {
> -   filename = "lpddr4_pmu_train_1d_imem_202006.bin";
> +   filename = "lpddr4_pmu_train_1d_imem.bin";
> type = "blob-ext";
> align-end = <4>;
> };
>
> ddr-1d-dmem-fw {
> -   filename = "lpddr4_pmu_train_1d_dmem_202006.bin";
> +   filename = "lpddr4_pmu_train_1d_dmem.bin";
> type = "blob-ext";
> align-end = <4>;
> };
>
> ddr-2d-imem-fw {
> -   filename = "lpddr4_pmu_train_2d_imem_202006.bin";
> +   filename = "lpddr4_pmu_train_2d_imem.bin";

Unrelated changes?


Re: Trying to boot custom kernel on Wink Hub (i.MX28)

2023-08-22 Thread Fabio Estevam
Hi Rogan,

On Tue, Aug 22, 2023 at 6:42 AM Rogan Dawes  wrote:
>
> Hi Fabio,
>
> As far as I am aware, the U-boot source for the Wink hub has not been
> made available anywhere. That said, the RAM chip in use on the board

Was there a formal request for the U-Boot source code to Wink?

As per the GPL license, they have to share the U-Boot source code.

> is marked D9LPX, which apparently corresponds to the following item:
> https://media-www.micron.com/-/media/client/global/documents/products/data-sheet/dram/ddr2/512mbddr2.pdf?rev=2c70f8a2b207452584b2bf040de8d771

There is a tool from NXP that helps with the i.MX28 DDR2 controller
initialization for a specific DDR model:

https://community.nxp.com/pwmxy87654/attachments/pwmxy87654/imx-processors/9552/1/MX28_DDR2_register_programming_aid_v0.2.xlsx

The DDR initialization values obtained from this tool are then used in
U-Boot inside the 'mxs_dram_vals' array.

There is a common DDR configuration at
arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c.

Most likely, in your case, it will require a custom mxs_dram_vals
initialization, like it is done at board/liebherr/xea/spl_xea.c.

> I did try to change the iomux_cfg_t as suggested above, built using
> make mx28evk_defconfig && make u-boot.sb, and used mxsldr to try load
> it, to no avail. There was no output on the serial port at all, or any
> other suggestion that anything was running.

It has been a long time since I used the mxsldr tool.

When time permits, I can try to load a recent U-Boot over USB using
this tool on a imx28-evk.

Cheers


Re: Trying to boot custom kernel on Wink Hub (i.MX28)

2023-08-21 Thread Fabio Estevam
Hi Rogan,

On Fri, Aug 18, 2023 at 10:45 AM Rogan Dawes  wrote:
>
> Circling back to this, I wanted to get a modern u-boot running on the
> Wink Hub v1 as well. Since it is possible to invoke SDP over USB
> (having soldered on a suitable microUSB connector), I have no concern
> about bricking it now. It's also a LOT easier than JTAG!
>
> I tried to build and flash the mx28evk_defconfig, but failed to get
> any output on the serial console. This is likely to be unsurprising,
> due to the already established alternative configuration of the UART
> identified by Fabio.
>
> I then patched imx28.dtsi to add duart_pins_c as per Fabio's previous
> patch for the Linux kernel:
>
> + duart_pins_c: duart@2 {
> + reg = <2>;
> + fsl,pinmux-ids = <
> + MX28_PAD_I2C0_SCL__DUART_RX
> + MX28_PAD_I2C0_SDA__DUART_TX
> + >;
> + fsl,drive-strength = ;
> + fsl,voltage = ;
> + fsl,pull-up = ;
> + };
> +
>
> And updated mx28evk_defconfig to use duart_pins_c instead of
> duart_pins_a. However, I still got no output after using:
>
> sudo $(which snagrecover) --soc imx28 -f
> src/snagrecover/templates/imx28-evk.yaml

I am not familiar with this tool. I was only aware of the one below:

https://source.denx.de/denx/mxsldr

Are you able to load the original vendor U-Boot with it?

Also, is the original vendor U-Boot source code available?

It is important to re-use the same DDR initialization from the original U-Boot.

> with u-boot.sb in the current directory.
>
> I also tried using the complete imx28-wink-hub-v1.dts as created by
> Fabio, and updated the .config to reference that instead of the
> imx28-evk, but I suspect that I may not have made the updates
> sufficiently well, if the name of the board needs to correspond with
> any details of the device tree? Neither of these resulted in any
> output.
>
> Any other suggestions?

Please check board/freescale/mx28evk/iomux.c:

const iomux_cfg_t iomux_setup[] = {
/* DUART */
MX28_PAD_PWM0__DUART_RX,
MX28_PAD_PWM1__DUART_TX,

The DUART pins need to be changed here as well.


[PATCH] doc: csf_examples: csf.sh: Remove unneeded export ATF_LOAD_ADDR line

2023-08-15 Thread Fabio Estevam
From: Fabio Estevam 

Originally, exporting the ATF_LOAD_ADDR was required, but since binman has
been used to generate the flash.bin, it is no longer needed to do
such manual export.

The ATF address is now passed via binman.

Remove the unneeded export ATF_LOAD_ADDR line.

Signed-off-by: Fabio Estevam 
---
 doc/imx/habv4/csf_examples/mx8m/csf.sh | 1 -
 1 file changed, 1 deletion(-)

diff --git a/doc/imx/habv4/csf_examples/mx8m/csf.sh 
b/doc/imx/habv4/csf_examples/mx8m/csf.sh
index d87015f6c4e2..65c143073cbe 100644
--- a/doc/imx/habv4/csf_examples/mx8m/csf.sh
+++ b/doc/imx/habv4/csf_examples/mx8m/csf.sh
@@ -11,7 +11,6 @@
 
 # 1) Build U-Boot (e.g. for i.MX8MM)
 #
-# export ATF_LOAD_ADDR=0x92
 # cp -Lv /path/to/arm-trusted-firmware/build/imx8mm/release/bl31.bin .
 # cp -Lv /path/to/firmware-imx-8.14/firmware/ddr/synopsys/ddr3* .
 # make -j imx8mm_board_defconfig
-- 
2.34.1



Re: [PATCH v2] arm: imx: imx8m: imx9: Fix DRAM size calculation due to rom_pointer

2023-08-08 Thread Fabio Estevam

Hi Elena,

On 08/08/2023 08:58, Elena Popa wrote:

If dram_init_banksize() is called from SPL, the rom_pointer, at that
point, is not correctly initialized. This causes wrong calculation of
DRAM start and size in dram_init_banksize(). The issue became apparent
only in Falcon Mode. Added an extra condition to prevent using
rom_pointer in SPL.

Signed-off-by: Elena Popa 
---
V2: Added the extra condition also in dram_init() and
get_effective_memsize() for consistency.


Thanks for the fix.

Reviewed-by: Fabio Estevam 


[PATCH 3/3] smegw01: Convert to watchdog driver model

2023-08-08 Thread Fabio Estevam
From: Fabio Estevam 

Commit 68dcbdd594d4 ("ARM: imx: Add weak default reset_cpu()") caused
the 'reset' command in U-Boot to not cause a board reset.

Fix it by switching to the watchdog driver model via sysreset, which
is the preferred method for implementing the watchdog reset.

Signed-off-by: Fabio Estevam 
---
 arch/arm/dts/imx7d-smegw01-u-boot.dtsi | 13 +
 configs/smegw01_defconfig  |  3 +++
 2 files changed, 16 insertions(+)
 create mode 100644 arch/arm/dts/imx7d-smegw01-u-boot.dtsi

diff --git a/arch/arm/dts/imx7d-smegw01-u-boot.dtsi 
b/arch/arm/dts/imx7d-smegw01-u-boot.dtsi
new file mode 100644
index ..cf7ba3a95817
--- /dev/null
+++ b/arch/arm/dts/imx7d-smegw01-u-boot.dtsi
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+/ {
+   wdt-reboot {
+   compatible = "wdt-reboot";
+   wdt = <>;
+   bootph-pre-ram;
+   };
+};
+
+ {
+   bootph-pre-ram;
+};
diff --git a/configs/smegw01_defconfig b/configs/smegw01_defconfig
index 7f1b2bee8e16..a3d289eeca1a 100644
--- a/configs/smegw01_defconfig
+++ b/configs/smegw01_defconfig
@@ -80,5 +80,8 @@ CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_SPECIFY_CONSOLE_INDEX=y
 CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_IMX_THERMAL=y
+CONFIG_IMX_WATCHDOG=y
 # CONFIG_CMD_BOOTEFI_BOOTMGR is not set
-- 
2.34.1



[PATCH 2/3] mx7dsabresd: Convert to watchdog driver model

2023-08-08 Thread Fabio Estevam
From: Fabio Estevam 

Commit 68dcbdd594d4 ("ARM: imx: Add weak default reset_cpu()") caused
the 'reset' command in U-Boot to not cause a board reset.

Fix it by switching to the watchdog driver model via sysreset, which
is the preferred method for implementing the watchdog reset.

Signed-off-by: Fabio Estevam 
---
 arch/arm/dts/imx7d-sdb-u-boot.dtsi | 12 
 configs/mx7dsabresd_defconfig  |  3 +++
 2 files changed, 15 insertions(+)

diff --git a/arch/arm/dts/imx7d-sdb-u-boot.dtsi 
b/arch/arm/dts/imx7d-sdb-u-boot.dtsi
index 818528c418f5..2e234b6b5828 100644
--- a/arch/arm/dts/imx7d-sdb-u-boot.dtsi
+++ b/arch/arm/dts/imx7d-sdb-u-boot.dtsi
@@ -1,5 +1,13 @@
 // SPDX-License-Identifier: GPL-2.0+ OR MIT
 
+/ {
+   wdt-reboot {
+   compatible = "wdt-reboot";
+   wdt = <>;
+   bootph-pre-ram;
+   };
+};
+
  {
status = "disable";
 };
@@ -58,3 +66,7 @@
>;
};
 };
+
+ {
+   bootph-pre-ram;
+};
diff --git a/configs/mx7dsabresd_defconfig b/configs/mx7dsabresd_defconfig
index 26e68d30d267..1c8105f44f28 100644
--- a/configs/mx7dsabresd_defconfig
+++ b/configs/mx7dsabresd_defconfig
@@ -73,6 +73,8 @@ CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_SOFT_SPI=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
@@ -85,4 +87,5 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_IMX_WATCHDOG=y
 CONFIG_ERRNO_STR=y
-- 
2.34.1



[PATCH 1/3] imx7d-sdb-u-boot: Pass SPDX-License tag

2023-08-08 Thread Fabio Estevam
From: Fabio Estevam 

SPDX-License tag is missing and checkpatch complains about it.

Add the SPDX-License tag using the same one from imx7d-sdb.dts.

Signed-off-by: Fabio Estevam 
---
 arch/arm/dts/imx7d-sdb-u-boot.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/dts/imx7d-sdb-u-boot.dtsi 
b/arch/arm/dts/imx7d-sdb-u-boot.dtsi
index ac1d6e2e6480..818528c418f5 100644
--- a/arch/arm/dts/imx7d-sdb-u-boot.dtsi
+++ b/arch/arm/dts/imx7d-sdb-u-boot.dtsi
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: GPL-2.0+ OR MIT
+
  {
status = "disable";
 };
-- 
2.34.1



Re: [PATCH 3/6] ARM: imx: Add weak default reset_cpu()

2023-08-08 Thread Fabio Estevam
Hi Marek,

On Mon, Jun 26, 2023 at 5:53 AM Marek Vasut  wrote:
>
> Add weak default reset_cpu() implementation needed by e.g. panic().
>
> Signed-off-by: Marek Vasut 
> ---
> Cc: "NXP i.MX U-Boot Team" 
> Cc: Fabio Estevam 
> Cc: Stefano Babic 
> ---
>  arch/arm/mach-imx/cpu.c | 4 
>  1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm/mach-imx/cpu.c b/arch/arm/mach-imx/cpu.c
> index 702cfc33275..488638c9058 100644
> --- a/arch/arm/mach-imx/cpu.c
> +++ b/arch/arm/mach-imx/cpu.c
> @@ -510,3 +510,7 @@ char nxp_board_rev_string(void)
> return (*rev + nxp_board_rev() - 1);
>  }
>  #endif
> +
> +__weak void reset_cpu(void)
> +{
> +}

This patch causes the 'reset' command to not reset the imx7d-sdb and
smegw01 boards anymore.

If I do the change below, the board resets again:

diff --git a/drivers/watchdog/imx_watchdog.c b/drivers/watchdog/imx_watchdog.c
index 894158b304a7..709e437c8bd0 100644
--- a/drivers/watchdog/imx_watchdog.c
+++ b/drivers/watchdog/imx_watchdog.c
@@ -44,7 +44,7 @@ static void imx_watchdog_expire_now(struct
watchdog_regs *wdog, bool ext_reset)

 #if !defined(CONFIG_IMX_WATCHDOG) || \
 (defined(CONFIG_IMX_WATCHDOG) && !CONFIG_IS_ENABLED(WDT))
-void __attribute__((weak)) reset_cpu(void)
+void reset_cpu(void)
 {
  struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;

Is this a correct fix?

Thanks


[PATCH 2/2] doc: imx8mp_evk: Use in-tree build in the example

2023-08-07 Thread Fabio Estevam
From: Fabio Estevam 

To make it consistent with the instructions from other NXP imx8m boards,
such as imx8mm-evk and imx8mn-evk, use U-Boot in-tree build in the
examples.

Signed-off-by: Fabio Estevam 
---
 doc/board/nxp/imx8mp_evk.rst | 16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/doc/board/nxp/imx8mp_evk.rst b/doc/board/nxp/imx8mp_evk.rst
index e106c3c71872..0297cc8ffc16 100644
--- a/doc/board/nxp/imx8mp_evk.rst
+++ b/doc/board/nxp/imx8mp_evk.rst
@@ -37,20 +37,22 @@ Build U-Boot
 
 .. code-block:: bash
 
+Note: builddir is U-Boot build directory (source directory for in-tree builds).
+
$ export CROSS_COMPILE=aarch64-poky-linux-
$ make O=build imx8mp_evk_defconfig
-   $ cp ../imx-atf/build/imx8mp/release/bl31.bin ./build/bl31.bin
-   $ cp 
../firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_1d_dmem_202006.bin 
./build/
-   $ cp 
../firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_1d_imem_202006.bin 
./build/
-   $ cp 
../firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_2d_dmem_202006.bin 
./build/
-   $ cp 
../firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_2d_imem_202006.bin 
./build/
-   $ make O=build
+   $ cp ../imx-atf/build/imx8mp/release/bl31.bin $(builddir)
+   $ cp 
../firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_1d_dmem_202006.bin 
$(builddir)
+   $ cp 
../firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_1d_imem_202006.bin 
$(builddir)
+   $ cp 
../firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_2d_dmem_202006.bin 
$(builddir)
+   $ cp 
../firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_2d_imem_202006.bin 
$(builddir)
+   $ make
 
 Burn the flash.bin to the MicroSD card at offset 32KB:
 
 .. code-block:: bash
 
-   $sudo dd if=build/flash.bin of=/dev/sd[x] bs=1K seek=32 conv=notrunc; sync
+   $ sudo dd if=flash.bin of=/dev/sd[x] bs=1K seek=32 conv=notrunc; sync
 
 Boot
 
-- 
2.34.1



[PATCH 1/2] doc: imx8mp_evk: Remove unneeded export ATF_LOAD_ADDR line

2023-08-07 Thread Fabio Estevam
From: Fabio Estevam 

Originally, exporting the ATF_LOAD_ADDR was required, but since binman has
been used to generate the flash.bin, it is no longer needed to do
such manual export.

The ATF address is now passed via binman in imx8mp-u-boot.dtsi:

atf {
description = "ARM Trusted Firmware";
type = "firmware";
arch = "arm64";
compression = "none";
load = <0x97>;
entry = <0x97>;

atf_blob: atf-blob {
filename = "bl31.bin";
type = "atf-bl31";
};
};

Remove the  unneeded export ATF_LOAD_ADDR line.

Signed-off-by: Fabio Estevam 
---
 doc/board/nxp/imx8mp_evk.rst | 1 -
 1 file changed, 1 deletion(-)

diff --git a/doc/board/nxp/imx8mp_evk.rst b/doc/board/nxp/imx8mp_evk.rst
index e7cc7b396b57..e106c3c71872 100644
--- a/doc/board/nxp/imx8mp_evk.rst
+++ b/doc/board/nxp/imx8mp_evk.rst
@@ -44,7 +44,6 @@ Build U-Boot
$ cp 
../firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_1d_imem_202006.bin 
./build/
$ cp 
../firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_2d_dmem_202006.bin 
./build/
$ cp 
../firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_2d_imem_202006.bin 
./build/
-   $ export ATF_LOAD_ADDR=0x97
$ make O=build
 
 Burn the flash.bin to the MicroSD card at offset 32KB:
-- 
2.34.1



Re: [PATCH 0/4] imx93: add DWC EQoS MAC driver support

2023-08-01 Thread Fabio Estevam
Hi Sébastien,

On Thu, Jul 27, 2023 at 5:33 AM Sébastien Szymanski
 wrote:
>
> This series makes the DWC EQos MAC work on i.MX93.
> It depends on the i.MX93 CCF driver:
> https://lore.kernel.org/u-boot/20230725080856.26567-1-sebastien.szyman...@armadeus.com/
>
> Tested on i.MX93 EVK board:
> u-boot=> dhcp
> ethernet@428a Waiting for PHY auto negotiation to complete done
> BOOTP broadcast 1
> *** Unhandled DHCP Option in OFFER/ACK: 125
> *** Unhandled DHCP Option in OFFER/ACK: 125
> DHCP client bound to address 192.168.1.50 (35 ms)
>
> u-boot=> ping 192.168.1.51
> Using ethernet@428a device
> host 192.168.1.51 is alive
> u-boot=>

Thanks for the series:

Reviewed-by: Fabio Estevam 


Re: [PATCH] clk: also return NULL for -ENOENT in devm_clk_get_optional functions

2023-07-24 Thread Fabio Estevam
On Mon, Jul 24, 2023 at 2:32 PM Yang Xiwen via B4 Relay
 wrote:
>
> From: Yang Xiwen 
>
> As described by the doc.

Which doc? Please mention the details in the commit log.


Re: [PATCH 1/1] dm: adc: imx93-adc depends on ADC (fix boot)

2023-07-24 Thread Fabio Estevam
On Mon, Jul 24, 2023 at 12:18 PM Sébastien Szymanski
 wrote:
>
> The i.MX93 11x11 EVK fails to boot with following error:
>
>  Model: NXP i.MX93 11X11 EVK board
>  DRAM:  2 GiB
>  Error binding driver 'imx93-adc': -96
>  Some drivers failed to bind
>  Error binding driver 'simple_bus': -96
>  Some drivers failed to bind
>  Error binding driver 'simple_bus': -96
>  Some drivers failed to bind
>  initcall sequence fffb8f28 failed at call 8021e0d4 (err=-96)
>  ### ERROR ### Please RESET the board ###
>
> That's because since commit e7ff54d96303 ("imx93_evk: defconfig: add adc
> support") CONFIG_ADC_IMX93 is enabled but CONFIG_ADC is not.
> Fix this by making CONFIG_ADC_IMX93 depend on CONFIG_ADC.
>
> Signed-off-by: Sébastien Szymanski 

Reviewed-by: Fabio Estevam 


Re: patch to submit

2023-07-20 Thread Fabio Estevam
Hi Mark,

On Thu, Jul 20, 2023 at 1:55 PM mark roths  wrote:
>
> Avalanche Technology has developed a new MRAM device (MTD).  We would like
> to submit a patch to u-boot including the Avalanche jedec memory identifier
> and some code to allow boot from this device.
>
> Please point me to the instructions for submitting such a patch for
> inclusion in u-boot.

Here it goes:
https://u-boot.readthedocs.io/en/latest/develop/sending_patches.html


[PATCH] mxs: Kconfig: Remove TARGET_XFI3 symbol

2023-07-18 Thread Fabio Estevam
From: Fabio Estevam 

The xfi3 target has been removed by commit 539fba2c10e7 ("arm:
Remove xfi3 board"), but it missed to remove an entry from the
mxs Kconfig.

Remove it.

Signed-off-by: Fabio Estevam 
---
 arch/arm/mach-imx/mxs/Kconfig | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/arm/mach-imx/mxs/Kconfig b/arch/arm/mach-imx/mxs/Kconfig
index d3233d8d14f3..ccce6a78caa2 100644
--- a/arch/arm/mach-imx/mxs/Kconfig
+++ b/arch/arm/mach-imx/mxs/Kconfig
@@ -18,9 +18,6 @@ config TARGET_MX23EVK
select PL01X_SERIAL
select BOARD_EARLY_INIT_F
 
-config TARGET_XFI3
-   bool "Support xfi3"
-
 endchoice
 
 config SYS_SOC
-- 
2.34.1



[PATCH] mx7dsabresd: Retrieve the second MAC address from fuses

2023-07-11 Thread Fabio Estevam
From: Fabio Estevam 

Currently, a random MAC address is assigned to eth1 in Linux.

Fix this behavor by retrieving the second MAC address from the fuses.

Signed-off-by: Fabio Estevam 
---
 board/freescale/mx7dsabresd/mx7dsabresd.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/board/freescale/mx7dsabresd/mx7dsabresd.c 
b/board/freescale/mx7dsabresd/mx7dsabresd.c
index 2777ae13bce0..cff2e6a87171 100644
--- a/board/freescale/mx7dsabresd/mx7dsabresd.c
+++ b/board/freescale/mx7dsabresd/mx7dsabresd.c
@@ -292,6 +292,7 @@ int power_init_board(void)
 int board_late_init(void)
 {
struct wdog_regs *wdog = (struct wdog_regs *)WDOG1_BASE_ADDR;
+   unsigned char eth1addr[6];
 
imx_iomux_v3_setup_multiple_pads(wdog_pads, ARRAY_SIZE(wdog_pads));
 
@@ -303,6 +304,11 @@ int board_late_init(void)
 */
clrsetbits_le16(>wcr, 0, 0x10);
 
+   /* Get the second MAC address */
+   imx_get_mac_from_fuse(1, eth1addr);
+   if (!env_get("eth1addr") && is_valid_ethaddr(eth1addr))
+   eth_env_set_enetaddr("eth1addr", eth1addr);
+
return 0;
 }
 
-- 
2.34.1



[PATCH 3/3] mx23_olinuxino: Convert to CONFIG_DM_SERIAL

2023-07-11 Thread Fabio Estevam
From: Fabio Estevam 

The conversion to CONFIG_DM_SERIAL is mandatory, so select this option.

Signed-off-by: Fabio Estevam 
---
 arch/arm/Kconfig | 1 -
 arch/arm/mach-imx/mxs/Kconfig| 1 +
 configs/mx23_olinuxino_defconfig | 1 +
 3 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index ac079da7527a..b3115b054c8c 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -912,7 +912,6 @@ config ARCH_MX23
select CPU_ARM926EJS
select GPIO_EXTRA_HEADER
select MACH_IMX
-   select PL011_SERIAL if !TARGET_MX23EVK
select SUPPORT_SPL
 
 config ARCH_MX28
diff --git a/arch/arm/mach-imx/mxs/Kconfig b/arch/arm/mach-imx/mxs/Kconfig
index 6b9d5c956971..d3233d8d14f3 100644
--- a/arch/arm/mach-imx/mxs/Kconfig
+++ b/arch/arm/mach-imx/mxs/Kconfig
@@ -10,6 +10,7 @@ choice
 
 config TARGET_MX23_OLINUXINO
bool "Support mx23_olinuxino"
+   select PL01X_SERIAL
select BOARD_EARLY_INIT_F
 
 config TARGET_MX23EVK
diff --git a/configs/mx23_olinuxino_defconfig b/configs/mx23_olinuxino_defconfig
index 89b69fb32366..24968e18710f 100644
--- a/configs/mx23_olinuxino_defconfig
+++ b/configs/mx23_olinuxino_defconfig
@@ -50,6 +50,7 @@ CONFIG_LED_STATUS_BOOT=0
 CONFIG_LED_STATUS_CMD=y
 CONFIG_MMC_MXS=y
 CONFIG_CONS_INDEX=0
+CONFIG_DM_SERIAL=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_HOST_ETHER=y
-- 
2.34.1



[PATCH 2/3] mx23evk: Convert to CONFIG_DM_SERIAL

2023-07-11 Thread Fabio Estevam
From: Fabio Estevam 

The conversion to CONFIG_DM_SERIAL is mandatory, so select this option.

Signed-off-by: Fabio Estevam 
---
 arch/arm/Kconfig  | 2 +-
 arch/arm/mach-imx/mxs/Kconfig | 1 +
 configs/mx23evk_defconfig | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index e00c9ee4543f..ac079da7527a 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -912,7 +912,7 @@ config ARCH_MX23
select CPU_ARM926EJS
select GPIO_EXTRA_HEADER
select MACH_IMX
-   select PL011_SERIAL
+   select PL011_SERIAL if !TARGET_MX23EVK
select SUPPORT_SPL
 
 config ARCH_MX28
diff --git a/arch/arm/mach-imx/mxs/Kconfig b/arch/arm/mach-imx/mxs/Kconfig
index 0fd4758cc67c..6b9d5c956971 100644
--- a/arch/arm/mach-imx/mxs/Kconfig
+++ b/arch/arm/mach-imx/mxs/Kconfig
@@ -14,6 +14,7 @@ config TARGET_MX23_OLINUXINO
 
 config TARGET_MX23EVK
bool "Support mx23evk"
+   select PL01X_SERIAL
select BOARD_EARLY_INIT_F
 
 config TARGET_XFI3
diff --git a/configs/mx23evk_defconfig b/configs/mx23evk_defconfig
index 3602ead86358..7d0e7cc1e007 100644
--- a/configs/mx23evk_defconfig
+++ b/configs/mx23evk_defconfig
@@ -49,6 +49,7 @@ CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_CONS_INDEX=0
+CONFIG_DM_SERIAL=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
-- 
2.34.1



[PATCH 1/3] mx28evk: Convert to CONFIG_DM_SERIAL

2023-07-11 Thread Fabio Estevam
From: Fabio Estevam 

The conversion to CONFIG_DM_SERIAL is mandatory, so select this option. 

Signed-off-by: Fabio Estevam 
---
 arch/arm/Kconfig  | 1 -
 arch/arm/mach-imx/mxs/Kconfig | 1 +
 configs/mx28evk_defconfig | 2 +-
 3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 17d69d272622..e00c9ee4543f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -919,7 +919,6 @@ config ARCH_MX28
bool "NXP i.MX28 family"
select CPU_ARM926EJS
select GPIO_EXTRA_HEADER
-   select PL011_SERIAL if !TARGET_XEA
select MACH_IMX
select SUPPORT_SPL
 
diff --git a/arch/arm/mach-imx/mxs/Kconfig b/arch/arm/mach-imx/mxs/Kconfig
index b4a281e82d41..0fd4758cc67c 100644
--- a/arch/arm/mach-imx/mxs/Kconfig
+++ b/arch/arm/mach-imx/mxs/Kconfig
@@ -41,6 +41,7 @@ choice
 
 config TARGET_MX28EVK
bool "Support mx28evk"
+   select PL01X_SERIAL
select BOARD_EARLY_INIT_F
 
 config TARGET_XEA
diff --git a/configs/mx28evk_defconfig b/configs/mx28evk_defconfig
index dad8839a6c10..df0cceaea719 100644
--- a/configs/mx28evk_defconfig
+++ b/configs/mx28evk_defconfig
@@ -62,6 +62,6 @@ CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_RTC_MXS=y
-CONFIG_CONS_INDEX=0
+CONFIG_DM_SERIAL=y
 CONFIG_SPI=y
 CONFIG_USB=y
-- 
2.34.1



Re: R: [RFC] rockchip: rk3308: fix "same-as-spl" bug in boot devices order

2023-07-11 Thread Fabio Estevam
On Tue, Jul 11, 2023 at 5:04 PM Tom Rini  wrote:

> $ git grep -l bootph arch/arm64/
> arch/arm64/boot/dts/xilinx/zynqmp-clk-ccf.dtsi
> arch/arm64/boot/dts/xilinx/zynqmp-sm-k26-revA.dts
> arch/arm64/boot/dts/xilinx/zynqmp.dtsi
> $ git describe HEAD
> v6.5-rc1-6-g3f01e9fed845

but where is bootph documented?


Re: R: [RFC] rockchip: rk3308: fix "same-as-spl" bug in boot devices order

2023-07-11 Thread Fabio Estevam
On Tue, Jul 11, 2023 at 2:14 PM Tom Rini  wrote:

> One thing I would say is that the bootph changes can go to the upstream
> kernel dts files, so that they aren't lost in the future, and we can

Are you sure? I don't see bootph devicetree properties being supported
in 6.5-rc1.


[PATCH] imx7d-sdb: Sync devicetree with kernel 6.5-rc1

2023-07-11 Thread Fabio Estevam
From: Fabio Estevam 

Commit 0aea5dda2928 ("ARM: dts: imx7d-sdb-u-boot: Fix usdhc1 UHS
operation") did a temporary workaround by addng the usdhc1 fix
inside the -u-boot.dtsi file.

The imx7d-sdb.dts from kernel 6.5-rc1 contains the proper UHS
fix, so sync the devicetree tree and remove the previous fix
from -u-boot.dtsi.

Also, adjust the PMIC node name inside pmic_get() to match
the devicetree update.

Signed-off-by: Fabio Estevam 
---
 arch/arm/dts/imx7d-sdb-u-boot.dtsi| 51 
 arch/arm/dts/imx7d-sdb.dts| 73 +--
 board/freescale/mx7dsabresd/mx7dsabresd.c |  2 +-
 3 files changed, 56 insertions(+), 70 deletions(-)

diff --git a/arch/arm/dts/imx7d-sdb-u-boot.dtsi 
b/arch/arm/dts/imx7d-sdb-u-boot.dtsi
index ac1d6e2e6480..b78358fa1397 100644
--- a/arch/arm/dts/imx7d-sdb-u-boot.dtsi
+++ b/arch/arm/dts/imx7d-sdb-u-boot.dtsi
@@ -5,54 +5,3 @@
  {
dr_mode = "peripheral";
 };
-
- {
-   pinctrl-names = "default", "state_100mhz", "state_200mhz";
-   pinctrl-0 = <_usdhc1>, <_usdhc1_gpio>;
-   pinctrl-1 = <_usdhc1_100mhz>, <_usdhc1_gpio>;
-   pinctrl-2 = <_usdhc1_200mhz>, <_usdhc1_gpio>;
-};
-
-_usdhc1 {
-   fsl,pins = <
-   MX7D_PAD_SD1_CMD__SD1_CMD   0x59
-   MX7D_PAD_SD1_CLK__SD1_CLK   0x19
-   MX7D_PAD_SD1_DATA0__SD1_DATA0   0x59
-   MX7D_PAD_SD1_DATA1__SD1_DATA1   0x59
-   MX7D_PAD_SD1_DATA2__SD1_DATA2   0x59
-   MX7D_PAD_SD1_DATA3__SD1_DATA3   0x59
-   >;
-};
-
- {
-   pinctrl_usdhc1_gpio: usdhc1gpiogrp {
-   fsl,pins = <
-   MX7D_PAD_SD1_CD_B__GPIO5_IO00x59 /* CD */
-   MX7D_PAD_SD1_WP__GPIO5_IO1  0x59 /* WP */
-   MX7D_PAD_SD1_RESET_B__GPIO5_IO2 0x59 /* vmmc */
-   MX7D_PAD_GPIO1_IO08__SD1_VSELECT0x59 /* VSELECT 
*/
-   >;
-   };
-
-   pinctrl_usdhc1_100mhz: usdhc1100mhzgrp {
-   fsl,pins = <
-   MX7D_PAD_SD1_CMD__SD1_CMD   0x5a
-   MX7D_PAD_SD1_CLK__SD1_CLK   0x1a
-   MX7D_PAD_SD1_DATA0__SD1_DATA0   0x5a
-   MX7D_PAD_SD1_DATA1__SD1_DATA1   0x5a
-   MX7D_PAD_SD1_DATA2__SD1_DATA2   0x5a
-   MX7D_PAD_SD1_DATA3__SD1_DATA3   0x5a
-   >;
-   };
-
-   pinctrl_usdhc1_200mhz: usdhc1200mhzgrp {
-   fsl,pins = <
-   MX7D_PAD_SD1_CMD__SD1_CMD   0x5b
-   MX7D_PAD_SD1_CLK__SD1_CLK   0x1b
-   MX7D_PAD_SD1_DATA0__SD1_DATA0   0x5b
-   MX7D_PAD_SD1_DATA1__SD1_DATA1   0x5b
-   MX7D_PAD_SD1_DATA2__SD1_DATA2   0x5b
-   MX7D_PAD_SD1_DATA3__SD1_DATA3   0x5b
-   >;
-   };
-};
diff --git a/arch/arm/dts/imx7d-sdb.dts b/arch/arm/dts/imx7d-sdb.dts
index 78f4224a9bf4..75f1cd14bea1 100644
--- a/arch/arm/dts/imx7d-sdb.dts
+++ b/arch/arm/dts/imx7d-sdb.dts
@@ -24,14 +24,14 @@
pinctrl-names = "default";
pinctrl-0 = <_gpio_keys>;
 
-   volume-up {
+   key-volume-up {
label = "Volume Up";
gpios = < 11 GPIO_ACTIVE_LOW>;
linux,code = ;
wakeup-source;
};
 
-   volume-down {
+   key-volume-down {
label = "Volume Down";
gpios = < 10 GPIO_ACTIVE_LOW>;
linux,code = ;
@@ -39,12 +39,12 @@
};
};
 
-   spi4 {
+   spi-4 {
compatible = "spi-gpio";
pinctrl-names = "default";
pinctrl-0 = <_spi4>;
-   gpio-sck = < 13 GPIO_ACTIVE_HIGH>;
-   gpio-mosi = < 9 GPIO_ACTIVE_HIGH>;
+   sck-gpios = < 13 GPIO_ACTIVE_HIGH>;
+   mosi-gpios = < 9 GPIO_ACTIVE_HIGH>;
cs-gpios = < 12 GPIO_ACTIVE_LOW>;
num-chipselects = <1>;
#address-cells = <1>;
@@ -60,6 +60,17 @@
};
};
 
+   reg_sd1_vmmc: regulator-sd1-vmmc {
+   compatible = "regulator-fixed";
+   regulator-name = "VDD_SD1";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   gpio = 

Re: imx8mp: issues getting dtb with pcie enabled to boot

2023-07-09 Thread Fabio Estevam
On Fri, Jul 7, 2023 at 8:48 PM Sahaj Sarup  wrote:

> For now the fix seems to be `clocks = <_blk_ctrl 0>;`

Please submit the fix to Linux.

> this gets pcie working under linux but not under u-boot, i'm guessing pcie 
> for imx8 is not yet implemented?

That's correct.


Re: imx8mp: issues getting dtb with pcie enabled to boot

2023-07-07 Thread Fabio Estevam
Adding Marcel and Francesco.

On Fri, Jul 7, 2023 at 5:30 PM Sahaj Sarup  wrote:
>
> Hi,
> I am working on the imxmp-verdin platform. One of the quirks with
> this particular som is that it uses an internal pcie_phy clock instead of
> an external one like most imx8mp boards do.
> To get this working on mainline linux, the way clocks are defined for the
> pcie_phy is
> `clocks = <_blk_ctrl>;`
> However this causes u-boot to completely fail to boot with this
> error `Device tree error at node '__symbols__'` .
>
> My end goal is to boot a generic arm image over pcie nvme, I don't know if
> this would be possible but atleast a compatible device tree would be a good
> starting point.
>
> Thanks.


Re: [bug report] sunxi: H6: no ethernet on Orange Pi One Plus

2023-07-07 Thread Fabio Estevam
On Fri, Jul 7, 2023 at 10:46 AM Anne Macedo  wrote:

> On u-boot shell:
>
> gpio set pd6

Good point. You should pass the following options:

CONFIG_DM_REGULATOR=y
CONFIG_DM_REGULATOR_FIXED=y

so that the GPIO3_6 turns on by default and then you would not need to
run the "gpio set pd6" command.

> then dhcp command works :). However, it doesn't get an IP and with
> static IP pinging doesn't work.


<    1   2   3   4   5   6   7   8   9   10   >