Skip to contentSkip to conversation

imx: imxrt*: Fix binman breaking boot

PATCH In review Jesse Taube 4 participants 7 messages Oct 25, 2024 – Oct 27, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/4 imx: imxrt*: Fix binman breaking boot

The init_r parsing of U-Boot device tree to search the binman information errors. set CONFIG_BINMAN_FDT to no to fix this.

Fixes 7079eeb72fc ("imx: imxrt1050-evk: Add support for SPI flash booting

s")

---
 configs/imxrt1020-evk_defconfig      | 1 +
 configs/imxrt1050-evk_defconfig      | 1 +
 configs/imxrt1050-evk_fspi_defconfig | 1 +
 configs/imxrt1170-evk_defconfig      | 1 +
 4 files changed, 4 insertions(+)
configs/imxrt1020-evk_defconfig +1 -0
index 5865d41a741..58a3e92ce08 100644
@@ -67,6 +67,7 @@ CONFIG_FSL_LPUART=y
 CONFIG_TIMER=y
 CONFIG_SPL_TIMER=y
 CONFIG_IMX_GPT_TIMER=y
+# CONFIG_BINMAN_FDT is not set
 CONFIG_SHA1=y
 CONFIG_SHA256=y
 CONFIG_HEXDUMP=y
configs/imxrt1050-evk_defconfig +1 -0
index f8b85398b79..2653efac148 100644
@@ -84,5 +84,6 @@ CONFIG_VIDEO_MXS=y
 CONFIG_SPLASH_SCREEN=y
 CONFIG_SPLASH_SCREEN_ALIGN=y
 CONFIG_BMP_16BPP=y
+# CONFIG_BINMAN_FDT is not set
 CONFIG_SHA256=y
 CONFIG_HEXDUMP=y
configs/imxrt1050-evk_fspi_defconfig +1 -0
index 73001ffe161..95b5b56ece7 100644
@@ -85,6 +85,7 @@ CONFIG_VIDEO_MXS=y
 CONFIG_SPLASH_SCREEN=y
 CONFIG_SPLASH_SCREEN_ALIGN=y
 CONFIG_BMP_16BPP=y
+# CONFIG_BINMAN_FDT is not set
 CONFIG_SHA256=y
 CONFIG_HEXDUMP=y
 CONFIG_FSPI_CONF_HEADER=y
configs/imxrt1170-evk_defconfig +1 -0
index 5f28c22e66c..487da275c62 100644
@@ -68,3 +68,4 @@ CONFIG_FSL_LPUART=y
 CONFIG_TIMER=y
 CONFIG_SPL_TIMER=y
 CONFIG_IMX_GPT_TIMER=y
+# CONFIG_BINMAN_FDT is not set
Signature · 1 line
2.45.2
#1 lore raw

PATCH 2/4 imx: imxrt1050-evk: Fix missing clocks for mmc

Two of the clocks required by the usdhc1 controller are missing from the clock controller node. A recent change enables all the clocks in the esdhc node, which fails as they are not defined in the clock controller.

Fixes 76332fae769 ("mmc: fsl_esdhc_imx: Enable AHB/IPG clk with clk bulk API")
Cc Peng Fan <[email protected]>
---
 arch/arm/dts/imxrt1050.dtsi     | 2 +-
 drivers/clk/imx/clk-imxrt1050.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
arch/arm/dts/imxrt1050.dtsi +1 -1
index 03e6a858a7b..a25eae9bd38 100644
@@ -87,7 +87,7 @@
 			reg = <0x402c0000 0x4000>;
 			interrupts = <110>;
 			clocks = <&clks IMXRT1050_CLK_IPG_PDOF>,
-				<&clks IMXRT1050_CLK_OSC>,
+				<&clks IMXRT1050_CLK_AHB_PODF>,
 				<&clks IMXRT1050_CLK_USDHC1>;
 			clock-names = "ipg", "ahb", "per";
 			bus-width = <4>;
drivers/clk/imx/clk-imxrt1050.c +3 -0
index 788e0650a92..2c029ec5a6e 100644
@@ -144,6 +144,9 @@ static int imxrt1050_clk_probe(struct udevice *dev)
 	clk_dm(IMXRT1050_CLK_AHB_PODF,
 	       imx_clk_divider("ahb_podf", "periph_sel",
 			       base + 0x14, 10, 3));
+	clk_dm(IMXRT1050_CLK_IPG_PDOF,
+	       imx_clk_divider("ipg_podf", "ahb_podf",
+			       base + 0x14, 8, 2));
 	clk_dm(IMXRT1050_CLK_USDHC1_PODF,
 	       imx_clk_divider("usdhc1_podf", "usdhc1_sel",
 			       base + 0x24, 11, 3));
Signature · 1 line
2.45.2
reviewer Reviewed-by on v1 2/4
#2 lore raw

RE: [PATCH 2/4] imx: imxrt1050-evk: Fix missing clocks for mmc

Quoted 11 lines

Subject: [PATCH 2/4] imx: imxrt1050-evk: Fix missing clocks for mmc

Two of the clocks required by the usdhc1 controller are missing from the clock controller node. A recent change enables all the clocks in the esdhc node, which fails as they are not defined in the clock controller.

Fixes 76332fae769 ("mmc: fsl_esdhc_imx: Enable AHB/IPG clk with clk

bulk API")

---

reviewer
#3 lore raw

Re: [PATCH 2/4] imx: imxrt1050-evk: Fix missing clocks for mmc

In reply to Jesse Taube

Hi Jesse,

Quoted 18 lines · Jesse Taube

Two of the clocks required by the usdhc1 controller are missing from the clock controller node. A recent change enables all the clocks in the esdhc node, which fails as they are not defined in the clock controller.

Fixes 76332fae769 ("mmc: fsl_esdhc_imx: Enable AHB/IPG clk with clk bulk API")
Cc Peng Fan <[email protected]>
---
 arch/arm/dts/imxrt1050.dtsi     | 2 +-
 drivers/clk/imx/clk-imxrt1050.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
arch/arm/dts/imxrt1050.dtsi +0 -0
index 03e6a858a7b..a25eae9bd38 100644

arch/arm/dts/imxrt1050.dtsi line 90

Quoted 5 lines
arch/arm/dts/imxrt1050.dtsi +1 -1
@@ -87,7 +87,7 @@
                        reg = <0x402c0000 0x4000>;
                        interrupts = <110>;
                        clocks = <&clks IMXRT1050_CLK_IPG_PDOF>,
-                               <&clks IMXRT1050_CLK_OSC>,
+                               <&clks IMXRT1050_CLK_AHB_PODF>,

I applied the whole series, but please consider fixing the kernel devicetree and converting it to OF_UPSTREAM.

Thanks

Quoted 20 lines
arch/arm/dts/imxrt1050.dtsi +0 -0
                                <&clks IMXRT1050_CLK_USDHC1>;
                        clock-names = "ipg", "ahb", "per";
                        bus-width = <4>;
drivers/clk/imx/clk-imxrt1050.c +3 -1
index 788e0650a92..2c029ec5a6e 100644
@@ -144,6 +144,9 @@ static int imxrt1050_clk_probe(struct udevice *dev)
        clk_dm(IMXRT1050_CLK_AHB_PODF,
               imx_clk_divider("ahb_podf", "periph_sel",
                               base + 0x14, 10, 3));
+       clk_dm(IMXRT1050_CLK_IPG_PDOF,
+              imx_clk_divider("ipg_podf", "ahb_podf",
+                              base + 0x14, 8, 2));
        clk_dm(IMXRT1050_CLK_USDHC1_PODF,
               imx_clk_divider("usdhc1_podf", "usdhc1_sel",
                               base + 0x24, 11, 3));
--

2.45.2

#4 lore raw

PATCH 3/4 configs: imxrt1050-evk: Enable standard boot

In reply to Jesse Taube

Enable standard boot support and add default environments for the imxrt1050-evk board.

---
 board/freescale/imxrt1050-evk/imxrt1050-evk-nor.env | 13 +++++++++++++
 board/freescale/imxrt1050-evk/imxrt1050-evk.env     | 13 +++++++++++++
 configs/imxrt1050-evk_defconfig                     |  4 ++--
 configs/imxrt1050-evk_fspi_defconfig                |  5 +++--
 include/configs/imxrt1050-evk.h                     |  7 -------
 5 files changed, 31 insertions(+), 11 deletions(-)
 create mode 100644 board/freescale/imxrt1050-evk/imxrt1050-evk-nor.env
 create mode 100644 board/freescale/imxrt1050-evk/imxrt1050-evk.env
board/freescale/imxrt1050-evk/imxrt1050-evk-nor.env new file +13 -0
new file mode 100644
index 00000000000..c61e9e3c00a
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+/* environment for imxrt1050-evk */
+
+#ifdef CONFIG_VIDEO
+stdin=serial
+stdout=serial,vidconsole
+stderr=serial,vidconsole
+#endif
+
+fdt_addr_r=0x80800000
+kernel_addr_r=0x80000000
+boot_targets=nor
board/freescale/imxrt1050-evk/imxrt1050-evk.env new file +13 -0
new file mode 100644
index 00000000000..1c5cbc29d53
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+/* environment for imxrt1050-evk */
+
+#ifdef CONFIG_VIDEO
+stdin=serial
+stdout=serial,vidconsole
+stderr=serial,vidconsole
+#endif
+
+fdt_addr_r=0x80800000
+kernel_addr_r=0x80000000
+boot_targets=mmc
configs/imxrt1050-evk_defconfig +2 -2
index 2653efac148..141303c5a29 100644
@@ -23,10 +23,10 @@ CONFIG_SPL_SIZE_LIMIT=0x20000
 CONFIG_SPL=y
 CONFIG_HAVE_SYS_UBOOT_START=y
 CONFIG_SYS_UBOOT_START=0x800023FD
-CONFIG_DISTRO_DEFAULTS=y
+CONFIG_BOOTSTD_FULL=y
+CONFIG_BOOTSTD_DEFAULTS=y
 CONFIG_SD_BOOT=y
 CONFIG_SPI_BOOT=y
-# CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_SYS_CBSIZE=256
 CONFIG_SYS_PBSIZE=276
 CONFIG_SYS_CONSOLE_ENV_OVERWRITE=y
configs/imxrt1050-evk_fspi_defconfig +3 -2
index 95b5b56ece7..b77dbab7077 100644
@@ -9,6 +9,7 @@ CONFIG_SPL_GPIO=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=1
+CONFIG_ENV_SOURCE_FILE="imxrt1050-evk-nor"
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x20020000
 CONFIG_ENV_OFFSET=0x80000
@@ -24,10 +25,10 @@ CONFIG_SPL_SIZE_LIMIT=0x20000
 CONFIG_SPL=y
 CONFIG_HAVE_SYS_UBOOT_START=y
 CONFIG_SYS_UBOOT_START=0x800023FD
-CONFIG_DISTRO_DEFAULTS=y
+CONFIG_BOOTSTD_FULL=y
+CONFIG_BOOTSTD_DEFAULTS=y
 CONFIG_SD_BOOT=y
 CONFIG_SPI_BOOT=y
-# CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_SYS_CBSIZE=256
 CONFIG_SYS_PBSIZE=276
 CONFIG_SYS_CONSOLE_ENV_OVERWRITE=y
include/configs/imxrt1050-evk.h +0 -7
index b370e25105a..c520c2fc203 100644
@@ -18,13 +18,6 @@
 #define DMAMEM_BASE			(PHYS_SDRAM + PHYS_SDRAM_SIZE - \
 					 DMAMEM_SZ_ALL)
 
-#ifdef CONFIG_VIDEO
-#define CFG_EXTRA_ENV_SETTINGS \
-		"stdin=serial\0" \
-		"stdout=serial,vidconsole\0" \
-		"stderr=serial,vidconsole\0"
-#endif
-
 /*
  * Address of U-Boot for SPI NOR boot
  */
Signature · 1 line
2.45.2
#5 lore raw

PATCH 4/4 ARM: dts: imxrt1170: Fix default cells value warnings

In reply to Jesse Taube

Add #address-cells and #size-cells to the memory node to fix warnings

---
 arch/arm/dts/imxrt1170-evk.dts | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/dts/imxrt1170-evk.dts +2 -0
index c2fd0c0392c..0d8e7016860 100644
@@ -20,6 +20,8 @@
 	};
 
 	memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
 		device_type = "memory";
 		reg = <0x20240000 0xf0000 0x80000000 0x4000000>;
 
Signature · 1 line
2.45.2
Reviewed-by on v1 1/4
#6 lore raw
In reply to Jesse Taube
Quoted 5 lines · Jesse Taube

The init_r parsing of U-Boot device tree to search the binman information errors. set CONFIG_BINMAN_FDT to no to fix this.

Fixes 7079eeb72fc ("imx: imxrt1050-evk: Add support for SPI flash booting
Quoted 8 lines

s")

---
 configs/imxrt1020-evk_defconfig      | 1 +
 configs/imxrt1050-evk_defconfig      | 1 +
 configs/imxrt1050-evk_fspi_defconfig | 1 +
 configs/imxrt1170-evk_defconfig      | 1 +
 4 files changed, 4 insertions(+)

Hmm, so why is the binman node missing?

Quoted 48 lines
configs/imxrt1020-evk_defconfig +1 -0
index 5865d41a741..58a3e92ce08 100644
@@ -67,6 +67,7 @@ CONFIG_FSL_LPUART=y
 CONFIG_TIMER=y
 CONFIG_SPL_TIMER=y
 CONFIG_IMX_GPT_TIMER=y
+# CONFIG_BINMAN_FDT is not set
 CONFIG_SHA1=y
 CONFIG_SHA256=y
 CONFIG_HEXDUMP=y
configs/imxrt1050-evk_defconfig +1 -0
index f8b85398b79..2653efac148 100644
@@ -84,5 +84,6 @@ CONFIG_VIDEO_MXS=y
 CONFIG_SPLASH_SCREEN=y
 CONFIG_SPLASH_SCREEN_ALIGN=y
 CONFIG_BMP_16BPP=y
+# CONFIG_BINMAN_FDT is not set
 CONFIG_SHA256=y
 CONFIG_HEXDUMP=y
configs/imxrt1050-evk_fspi_defconfig +1 -0
index 73001ffe161..95b5b56ece7 100644
@@ -85,6 +85,7 @@ CONFIG_VIDEO_MXS=y
 CONFIG_SPLASH_SCREEN=y
 CONFIG_SPLASH_SCREEN_ALIGN=y
 CONFIG_BMP_16BPP=y
+# CONFIG_BINMAN_FDT is not set
 CONFIG_SHA256=y
 CONFIG_HEXDUMP=y
 CONFIG_FSPI_CONF_HEADER=y
configs/imxrt1170-evk_defconfig +1 -1
index 5f28c22e66c..487da275c62 100644
@@ -68,3 +68,4 @@ CONFIG_FSL_LPUART=y
 CONFIG_TIMER=y
 CONFIG_SPL_TIMER=y
 CONFIG_IMX_GPT_TIMER=y
+# CONFIG_BINMAN_FDT is not set
--

2.45.2