Skip to contentSkip to conversation

IMXRT: Maintnice updates

PATCH In review Jesse Taube 3 participants 10 messages Mar 17, 2022 – Apr 12, 2022

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

v2 cover IMXRT: Maintnice updates

Updates to the imxrt family include:
- Adding missing include in board
- Moving pinctrl binding to dts
- Reducing SYS_MALLOC_LEN
- Using device tree for anatop base address

Jesse Taube (4):
clk: imxrt: Use dts for anatop base address configs/*imxrt10*: SYS_MALLOC_LEN is too large
ARM: dts: imxrt10..-evk: Linux moved pins-imxrt1020 to dts
board: freescale: imxrt10..-evk: Fix missing include of serial.h

 arch/arm/dts/imxrt1020-evk-u-boot.dtsi                       | 4 ++++
 arch/arm/dts/imxrt1020-evk.dts                               | 2 +-
 .../pins-imxrt1020.h => arch/arm/dts/imxrt1020-pinfunc.h     | 0
 arch/arm/dts/imxrt1020.dtsi                                  | 5 +++++
 arch/arm/dts/imxrt1050-evk-u-boot.dtsi                       | 4 ++++
 arch/arm/dts/imxrt1050-evk.dts                               | 2 +-
 .../pins-imxrt1050.h => arch/arm/dts/imxrt1050-pinfunc.h     | 0
 arch/arm/dts/imxrt1050.dtsi                                  | 5 +++++
 arch/arm/include/asm/arch-imxrt/imx-regs.h                   | 2 --
 board/freescale/imxrt1020-evk/imxrt1020-evk.c                | 1 +
 board/freescale/imxrt1050-evk/imxrt1050-evk.c                | 1 +
 configs/imxrt1020-evk_defconfig                              | 2 +-
 configs/imxrt1050-evk_defconfig                              | 2 +-
 drivers/clk/imx/clk-imxrt1020.c                              | 2 +-
 drivers/clk/imx/clk-imxrt1050.c                              | 2 +-
 15 files changed, 26 insertions(+), 8 deletions(-)
 rename include/dt-bindings/pinctrl/pins-imxrt1020.h => arch/arm/dts/imxrt1020-pinfunc.h (100%)
 rename include/dt-bindings/pinctrl/pins-imxrt1050.h => arch/arm/dts/imxrt1050-pinfunc.h (100%)
Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 1/4 clk: imxrt: Use dts for anatop base address

In Linux IMX and IMXRT use the device tree to hold the anatop address. The anatop is used in clock drivers as it controls the internal PLLs This will move the macro from asm/arch-imxrt to the device tree. This presumably should also be done with the other IMX boards as well.

---
 arch/arm/dts/imxrt1020-evk-u-boot.dtsi     | 4 ++++
 arch/arm/dts/imxrt1020.dtsi                | 5 +++++
 arch/arm/dts/imxrt1050-evk-u-boot.dtsi     | 4 ++++
 arch/arm/dts/imxrt1050.dtsi                | 5 +++++
 arch/arm/include/asm/arch-imxrt/imx-regs.h | 2 --
 drivers/clk/imx/clk-imxrt1020.c            | 2 +-
 drivers/clk/imx/clk-imxrt1050.c            | 2 +-
 7 files changed, 20 insertions(+), 4 deletions(-)
arch/arm/dts/imxrt1020-evk-u-boot.dtsi +4 -0
index 121665a2d2..9e1b074d2e 100644
@@ -22,6 +22,10 @@
 	u-boot,dm-spl;
 };
 
+&anatop {
+	u-boot,dm-spl;
+};
+
 &clks {
 	u-boot,dm-spl;
 };
arch/arm/dts/imxrt1020.dtsi +5 -0
index 5ba314f995..13511ebb18 100644
@@ -67,6 +67,11 @@
 			fsl,mux_mask = <0x7>;
 		};
 
+		anatop: anatop@400d8000 {
+			compatible = "fsl,imxrt-anatop";
+			reg = <0x400d8000 0x4000>;
+		};
+
 		clks: ccm@400fc000 {
 			compatible = "fsl,imxrt1020-ccm";
 			reg = <0x400fc000 0x4000>;
arch/arm/dts/imxrt1050-evk-u-boot.dtsi +4 -0
index 3168c2df2c..617cece448 100644
@@ -22,6 +22,10 @@
 	u-boot,dm-spl;
 };
 
+&anatop {
+	u-boot,dm-spl;
+};
+
 &clks {
 	u-boot,dm-spl;
 };
arch/arm/dts/imxrt1050.dtsi +5 -0
index 6560a3827f..09f4712af6 100644
@@ -59,6 +59,11 @@
 			fsl,mux_mask = <0x7>;
 		};
 
+		anatop: anatop@400d8000 {
+			compatible = "fsl,imxrt-anatop";
+			reg = <0x400d8000 0x4000>;
+		};
+
 		clks: ccm@400fc000 {
 			compatible = "fsl,imxrt1050-ccm";
 			reg = <0x400fc000 0x4000>;
arch/arm/include/asm/arch-imxrt/imx-regs.h +0 -2
index d01e6ca2e0..ad739caae9 100644
@@ -15,8 +15,6 @@
 #define GPIO4_BASE_ADDR		0x401C4000
 #define GPIO5_BASE_ADDR		0x400C0000
 
-#define ANATOP_BASE_ADDR	0x400d8000
-
 #define MXS_LCDIF_BASE		0x402b8000
 
 #if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
drivers/clk/imx/clk-imxrt1020.c +1 -1
index 840f783940..14ba6b47c1 100644
@@ -93,7 +93,7 @@ static int imxrt1020_clk_probe(struct udevice *dev)
 	void *base;
 
 	/* Anatop clocks */
-	base = (void *)ANATOP_BASE_ADDR;
+	base = (void *)ofnode_get_addr(ofnode_by_compatible(ofnode_null(), "fsl,imxrt-anatop"));
 
 	clk_dm(IMXRT1020_CLK_PLL2_SYS,
 	       imx_clk_pllv3(IMX_PLLV3_GENERIC, "pll2_sys", "osc",
drivers/clk/imx/clk-imxrt1050.c +1 -1
index 3e17161002..514516a3a3 100644
@@ -117,7 +117,7 @@ static int imxrt1050_clk_probe(struct udevice *dev)
 	void *base;
 
 	/* Anatop clocks */
-	base = (void *)ANATOP_BASE_ADDR;
+	base = (void *)ofnode_get_addr(ofnode_by_compatible(ofnode_null(), "fsl,imxrt-anatop"));
 
 	clk_dm(IMXRT1050_CLK_PLL1_REF_SEL,
 	       imx_clk_mux("pll1_arm_ref_sel", base + 0x0, 14, 2,
Signature · 1 line
2.34.1
#2 lore raw

PATCH v2 1/4 clk: imxrt: Use dts for anatop base address

Quoted 5 lines

In Linux IMX and IMXRT use the device tree to hold the anatop address. The anatop is used in clock drivers as it controls the internal PLLs This will move the macro from asm/arch-imxrt to the device tree. This presumably should also be done with the other IMX boards as well.

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
#3 lore raw

PATCH v2 2/4 configs/*imxrt10*: SYS_MALLOC_LEN is too large

In reply to Jesse Taube

1M of heap is more than internal ram making booting without SDRAM not possible now it is 256k

---
 configs/imxrt1020-evk_defconfig | 2 +-
 configs/imxrt1050-evk_defconfig | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
configs/imxrt1020-evk_defconfig +1 -1
index dafa4a505a..362f2e3bb0 100644
@@ -1,7 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_IMXRT=y
 CONFIG_SYS_TEXT_BASE=0x80002000
-CONFIG_SYS_MALLOC_LEN=0x100000
+CONFIG_SYS_MALLOC_LEN=0x40000
 CONFIG_SYS_MALLOC_F_LEN=0x8000
 CONFIG_SPL_GPIO=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
configs/imxrt1050-evk_defconfig +1 -1
index 09dcc9e6e3..aa4faacca0 100644
@@ -3,7 +3,7 @@ CONFIG_SYS_DCACHE_OFF=y
 # CONFIG_SPL_SYS_DCACHE_OFF is not set
 CONFIG_ARCH_IMXRT=y
 CONFIG_SYS_TEXT_BASE=0x80002000
-CONFIG_SYS_MALLOC_LEN=0x100000
+CONFIG_SYS_MALLOC_LEN=0x40000
 CONFIG_SYS_MALLOC_F_LEN=0x8000
 CONFIG_SPL_GPIO=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
Signature · 1 line
2.34.1
#4 lore raw

PATCH v2 2/4 configs/*imxrt10*: SYS_MALLOC_LEN is too large

Quoted 3 lines

1M of heap is more than internal ram making booting without SDRAM not possible now it is 256k

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
#5 lore raw

PATCH v2 3/4 ARM: dts: imxrt10..-evk: Linux moved pins-imxrt1020 to dts

In reply to Jesse Taube

The Linux kernel moved dt-bindings/pinctrl/pins-imxrt to the device tree This patch move it in U-Boot as well.

---
 arch/arm/dts/imxrt1020-evk.dts                                  | 2 +-
 .../pins-imxrt1020.h => arch/arm/dts/imxrt1020-pinfunc.h        | 0
 arch/arm/dts/imxrt1050-evk.dts                                  | 2 +-
 .../pins-imxrt1050.h => arch/arm/dts/imxrt1050-pinfunc.h        | 0
 4 files changed, 2 insertions(+), 2 deletions(-)
 rename include/dt-bindings/pinctrl/pins-imxrt1020.h => arch/arm/dts/imxrt1020-pinfunc.h (100%)
 rename include/dt-bindings/pinctrl/pins-imxrt1050.h => arch/arm/dts/imxrt1050-pinfunc.h (100%)
arch/arm/dts/imxrt1020-evk.dts +1 -1
index 2da79e5c20..22ae5ed735 100644
@@ -7,7 +7,7 @@
 /dts-v1/;
 #include "imxrt1020.dtsi"
 #include "imxrt1020-evk-u-boot.dtsi"
-#include <dt-bindings/pinctrl/pins-imxrt1020.h>
+#include "imxrt1020-pinfunc.h"
 
 / {
 	model = "NXP IMXRT1020-evk board";
arch/arm/dts/imxrt1020-pinfunc.h renamed from include/dt-bindings/pinctrl/pins-imxrt1020.h +0 -0
similarity index 100%
rename from include/dt-bindings/pinctrl/pins-imxrt1020.h
rename to arch/arm/dts/imxrt1020-pinfunc.h
arch/arm/dts/imxrt1050-evk.dts +1 -1
index 324cf7af96..fb2da3adfc 100644
@@ -7,7 +7,7 @@
 /dts-v1/;
 #include "imxrt1050.dtsi"
 #include "imxrt1050-evk-u-boot.dtsi"
-#include <dt-bindings/pinctrl/pins-imxrt1050.h>
+#include "imxrt1050-pinfunc.h"
 
 / {
 	model = "NXP IMXRT1050-evk board";
arch/arm/dts/imxrt1050-pinfunc.h renamed from include/dt-bindings/pinctrl/pins-imxrt1050.h +0 -0
similarity index 100%
rename from include/dt-bindings/pinctrl/pins-imxrt1050.h
rename to arch/arm/dts/imxrt1050-pinfunc.h
Signature · 1 line
2.34.1
#6 lore raw

PATCH v2 3/4 ARM: dts: imxrt10..-evk: Linux moved pins-imxrt1020 to dts

Quoted 3 lines

The Linux kernel moved dt-bindings/pinctrl/pins-imxrt to the device tree This patch move it in U-Boot as well.

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
#7 lore raw

PATCH v2 4/4 board: freescale: imxrt10..-evk: Fix missing include of serial.h

In reply to Jesse Taube

If FALCON mode is enabled we have a missing include in spl_start_uboot.

---
 board/freescale/imxrt1020-evk/imxrt1020-evk.c | 1 +
 board/freescale/imxrt1050-evk/imxrt1050-evk.c | 1 +
 2 files changed, 2 insertions(+)
board/freescale/imxrt1020-evk/imxrt1020-evk.c +1 -0
index 54a733b12c..785da604b9 100644
@@ -13,6 +13,7 @@
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <asm/armv7m.h>
+#include <serial.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
board/freescale/imxrt1050-evk/imxrt1050-evk.c +1 -0
index 6132916578..4b82ee5e9c 100644
@@ -13,6 +13,7 @@
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <asm/armv7m.h>
+#include <serial.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
Signature · 1 line
2.34.1
#8 lore raw

PATCH v2 4/4 board: freescale: imxrt10..-evk: Fix missing include of serial.h

Quoted 2 lines

If FALCON mode is enabled we have a missing include in spl_start_uboot.

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
Reviewed-by Peng Fan on the v2 series
#9 lore raw
In reply to Jesse Taube
Quoted 11 lines · Jesse Taube

Updates to the imxrt family include:
- Adding missing include in board
- Moving pinctrl binding to dts
- Reducing SYS_MALLOC_LEN
- Using device tree for anatop base address

Jesse Taube (4):
clk: imxrt: Use dts for anatop base address configs/*imxrt10*: SYS_MALLOC_LEN is too large
ARM: dts: imxrt10..-evk: Linux moved pins-imxrt1020 to dts
board: freescale: imxrt10..-evk: Fix missing include of serial.h

Quoted 20 lines
  arch/arm/dts/imxrt1020-evk-u-boot.dtsi                       | 4 ++++
  arch/arm/dts/imxrt1020-evk.dts                               | 2 +-
  .../pins-imxrt1020.h => arch/arm/dts/imxrt1020-pinfunc.h     | 0
  arch/arm/dts/imxrt1020.dtsi                                  | 5 +++++
  arch/arm/dts/imxrt1050-evk-u-boot.dtsi                       | 4 ++++
  arch/arm/dts/imxrt1050-evk.dts                               | 2 +-
  .../pins-imxrt1050.h => arch/arm/dts/imxrt1050-pinfunc.h     | 0
  arch/arm/dts/imxrt1050.dtsi                                  | 5 +++++
  arch/arm/include/asm/arch-imxrt/imx-regs.h                   | 2 --
  board/freescale/imxrt1020-evk/imxrt1020-evk.c                | 1 +
  board/freescale/imxrt1050-evk/imxrt1050-evk.c                | 1 +
  configs/imxrt1020-evk_defconfig                              | 2 +-
  configs/imxrt1050-evk_defconfig                              | 2 +-
  drivers/clk/imx/clk-imxrt1020.c                              | 2 +-
  drivers/clk/imx/clk-imxrt1050.c                              | 2 +-
  15 files changed, 26 insertions(+), 8 deletions(-)

rename include/dt-bindings/pinctrl/pins-imxrt1020.h => arch/arm/dts/imxrt1020-pinfunc.h (100%) rename include/dt-bindings/pinctrl/pins-imxrt1050.h => arch/arm/dts/imxrt1050-pinfunc.h (100%)