Skip to contentSkip to conversation

Add imx93-var-som support

PATCH Superseded Mathieu Othacehe 3 participants 6 messages Jan 4, 2024

Subsystems (3)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v4 cover Add imx93-var-som support

From: Mathieu Othacehe <[email protected]>

Hello,

This v4 rebases the series on top of the next branch and fixes Fabio's remarks.

Thanks,

Mathieu

v3: https://lists.denx.de/pipermail/u-boot/2023-December/542111.html

Mathieu Othacehe (3):
spl: binman: Disable u_boot_any symbols for i.MX93 boards
mach-imx: Add i.MX93 binman support.
Add imx93-var-som support

 arch/arm/dts/Makefile                         |    3 +-
 arch/arm/dts/imx93-u-boot.dtsi                |   88 +
 .../dts/imx93-var-som-symphony-u-boot.dtsi    |  266 +++
 arch/arm/dts/imx93-var-som-symphony.dts       |  305 ++++
 arch/arm/dts/imx93-var-som.dtsi               |  111 ++
 arch/arm/include/asm/arch-imx9/clock.h        |    1 +
 arch/arm/mach-imx/Makefile                    |   22 +-
 arch/arm/mach-imx/imx9/Kconfig                |    7 +
 board/variscite/common/eth.c                  |   58 +
 board/variscite/common/eth.h                  |   12 +
 board/variscite/common/imx9_eeprom.c          |  190 +++
 board/variscite/common/imx9_eeprom.h          |   83 +
 board/variscite/common/mmc.c                  |   47 +
 board/variscite/imx93_var_som/Kconfig         |   12 +
 board/variscite/imx93_var_som/MAINTAINERS     |    7 +
 board/variscite/imx93_var_som/Makefile        |   17 +
 board/variscite/imx93_var_som/container.cfg   |   10 +
 board/variscite/imx93_var_som/imx93_var_som.c |  126 ++
 .../variscite/imx93_var_som/imx93_var_som.env |   99 ++
 board/variscite/imx93_var_som/imximage.cfg    |   10 +
 .../variscite/imx93_var_som/lpddr4x_timing.c  | 1488 +++++++++++++++++
 board/variscite/imx93_var_som/spl.c           |  143 ++
 common/spl/Kconfig                            |    2 +-
 common/spl/Kconfig.tpl                        |    2 +-
 common/spl/Kconfig.vpl                        |    2 +-
 configs/imx93_var_som_defconfig               |  156 ++
 doc/board/variscite/imx93_var_som.rst         |   68 +
 doc/board/variscite/index.rst                 |    1 +
 include/configs/imx93_var_som.h               |   48 +
 29 files changed, 3379 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/dts/imx93-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx93-var-som-symphony-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx93-var-som-symphony.dts
 create mode 100644 arch/arm/dts/imx93-var-som.dtsi
 create mode 100644 board/variscite/common/eth.c
 create mode 100644 board/variscite/common/eth.h
 create mode 100644 board/variscite/common/imx9_eeprom.c
 create mode 100644 board/variscite/common/imx9_eeprom.h
 create mode 100644 board/variscite/common/mmc.c
 create mode 100644 board/variscite/imx93_var_som/Kconfig
 create mode 100644 board/variscite/imx93_var_som/MAINTAINERS
 create mode 100644 board/variscite/imx93_var_som/Makefile
 create mode 100644 board/variscite/imx93_var_som/container.cfg
 create mode 100644 board/variscite/imx93_var_som/imx93_var_som.c
 create mode 100644 board/variscite/imx93_var_som/imx93_var_som.env
 create mode 100644 board/variscite/imx93_var_som/imximage.cfg
 create mode 100644 board/variscite/imx93_var_som/lpddr4x_timing.c
 create mode 100644 board/variscite/imx93_var_som/spl.c
 create mode 100644 configs/imx93_var_som_defconfig
 create mode 100644 doc/board/variscite/imx93_var_som.rst
 create mode 100644 include/configs/imx93_var_som.h
Signature · 1 line
2.25.1
#1 lore raw

PATCH v4 1/3 spl: binman: Disable u_boot_any symbols for i.MX93 boards

From: Mathieu Othacehe <[email protected]>

This is extending commit 6516c9b349b3 ("spl: binman: Disable u_boot_any symbols for i.MX8M boards") to i.MX93 boards.

---
 common/spl/Kconfig     | 2 +-
 common/spl/Kconfig.tpl | 2 +-
 common/spl/Kconfig.vpl | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
common/spl/Kconfig +1 -1
index cf7ffc9b112..e7b84fc1fa6 100644
@@ -207,7 +207,7 @@ config SPL_BINMAN_SYMBOLS
 config SPL_BINMAN_UBOOT_SYMBOLS
 	bool "Declare binman symbols for U-Boot phases in SPL"
 	depends on SPL_BINMAN_SYMBOLS
-	default n if ARCH_IMX8M
+	default n if ARCH_IMX8M || ARCH_IMX9
 	default y
 	help
 	  This enables use of symbols in SPL which refer to U-Boot phases,
common/spl/Kconfig.tpl +1 -1
index cc71578f646..4ee3b9b826d 100644
@@ -23,7 +23,7 @@ config TPL_BINMAN_SYMBOLS
 config TPL_BINMAN_UBOOT_SYMBOLS
 	bool "Declare binman symbols for U-Boot phases in TPL"
 	depends on TPL_BINMAN_SYMBOLS
-	default n if ARCH_IMX8M
+	default n if ARCH_IMX8M || ARCH_IMX9
 	default y
 	help
 	  This enables use of symbols in TPL which refer to U-Boot phases,
common/spl/Kconfig.vpl +1 -1
index ae1a3c724f3..f1993026bba 100644
@@ -243,7 +243,7 @@ config VPL_BINMAN_SYMBOLS
 config VPL_BINMAN_UBOOT_SYMBOLS
 	bool "Declare binman symbols for U-Boot phases in VPL"
 	depends on VPL_BINMAN_SYMBOLS
-	default n if ARCH_IMX8M
+	default n if ARCH_IMX8M || ARCH_IMX9
 	default y
 	help
 	  This enables use of symbols in VPL which refer to U-Boot phases,
Signature · 1 line
2.25.1
#2 lore raw

PATCH v4 2/3 mach-imx: Add i.MX93 binman support.

In reply to Mathieu Othacehe

From: Mathieu Othacehe <[email protected]>

Add dedicated Makefile targets for the i.MX93 and a new imx93-u-boot.dtsi device-tree to create binman images.

---
 arch/arm/dts/imx93-u-boot.dtsi | 88 ++++++++++++++++++++++++++++++++++
 arch/arm/mach-imx/Makefile     | 22 ++++++++-
 2 files changed, 109 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/imx93-u-boot.dtsi
arch/arm/dts/imx93-u-boot.dtsi new file +88 -0
new file mode 100644
index 00000000000..40e17bbc5ae
@@ -0,0 +1,88 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2023 Mathieu Othacehe <[email protected]>
+ */
+
+/ {
+	binman: binman {
+		multiple-images;
+	};
+};
+
+&binman {
+	u-boot-spl-ddr {
+		align = <4>;
+		align-size = <4>;
+		filename = "u-boot-spl-ddr.bin";
+		pad-byte = <0xff>;
+
+		u-boot-spl {
+			align-end = <4>;
+			filename = "u-boot-spl.bin";
+		};
+
+		ddr-1d-imem-fw {
+			filename = "lpddr4_imem_1d_v202201.bin";
+			align-end = <4>;
+			type = "blob-ext";
+		};
+
+		ddr-1d-dmem-fw {
+			filename = "lpddr4_dmem_1d_v202201.bin";
+			align-end = <4>;
+			type = "blob-ext";
+		};
+
+		ddr-2d-imem-fw {
+			filename = "lpddr4_imem_2d_v202201.bin";
+			align-end = <4>;
+			type = "blob-ext";
+		};
+
+		ddr-2d-dmem-fw {
+			filename = "lpddr4_dmem_2d_v202201.bin";
+			align-end = <4>;
+			type = "blob-ext";
+		};
+	};
+
+	spl {
+		filename = "spl.bin";
+
+		mkimage {
+			args = "-n spl/u-boot-spl.cfgout -T imx8image -e 0x2049A000";
+
+			blob {
+				filename = "u-boot-spl-ddr.bin";
+			};
+		};
+	};
+
+	u-boot-container {
+		filename = "u-boot-container.bin";
+
+		mkimage {
+			args = "-n u-boot-container.cfgout -T imx8image -e 0x0";
+
+			blob {
+				filename = "u-boot.bin";
+			};
+		};
+	};
+
+	imx-boot {
+		filename = "flash.bin";
+		pad-byte = <0x00>;
+
+		spl: blob-ext@1 {
+			filename = "spl.bin";
+			offset = <0x0>;
+			align-size = <0x400>;
+			align = <0x400>;
+		};
+
+		uboot: blob-ext@2 {
+			filename = "u-boot-container.bin";
+		};
+	};
+};
arch/arm/mach-imx/Makefile +21 -1
index a3b44c93e3d..b87f44193c3 100644
@@ -129,6 +129,9 @@ DEPFILE_EXISTS := $(shell $(CPP) $(cpp_flags) -x c -o u-boot-dtb.cfgout $(srctre
 else ifeq ($(CONFIG_ARCH_IMX8M), y)
 IMAGE_TYPE := imx8mimage
 DEPFILE_EXISTS := 0
+else ifeq ($(CONFIG_ARCH_IMX9), y)
+IMAGE_TYPE := imx8image
+DEPFILE_EXISTS := 0
 else
 IMAGE_TYPE := imximage
 DEPFILE_EXISTS := 0
@@ -213,7 +216,24 @@ endif
 endif
 
 ifeq ($(CONFIG_ARCH_IMX9), y)
-SPL:
+
+SPL: spl/u-boot-spl.bin spl/u-boot-spl.cfgout u-boot-container.cfgout FORCE
+
+MKIMAGEFLAGS_flash.bin = -n spl/u-boot-spl.cfgout -T $(IMAGE_TYPE) -e $(CONFIG_SPL_TEXT_BASE)
+flash.bin: MKIMAGEOUTPUT = flash.log
+
+spl/u-boot-spl.cfgout: $(IMX_CONFIG) FORCE
+	$(Q)mkdir -p $(dir $@)
+	$(call if_changed_dep,cpp_cfg)
+
+spl/u-boot-spl-ddr.bin: spl/u-boot-spl.bin spl/u-boot-spl.cfgout FORCE
+
+u-boot-container.cfgout: $(IMX_CONTAINER_CFG) FORCE
+	$(Q)mkdir -p $(dir $@)
+	$(call if_changed_dep,cpp_cfg)
+
+flash.bin: spl/u-boot-spl-ddr.bin container.cfgout FORCE
+	$(call if_changed,mkimage)
 endif
 
 else
Signature · 1 line
2.25.1
#3 lore raw

PATCH v4 3/3 Add imx93-var-som support

In reply to Mathieu Othacehe

From: Mathieu Othacehe <[email protected]>

Add support for the Variscite VAR-SOM-IMX93 evaluation kit. The SoM consists of an NXP iMX93 dual A55 CPU. The SoM is mounted on a Variscite Symphony SBC.

---
 arch/arm/dts/Makefile                         |    3 +-
 .../dts/imx93-var-som-symphony-u-boot.dtsi    |  266 +++
 arch/arm/dts/imx93-var-som-symphony.dts       |  305 ++++
 arch/arm/dts/imx93-var-som.dtsi               |  111 ++
 arch/arm/include/asm/arch-imx9/clock.h        |    1 +
 arch/arm/mach-imx/imx9/Kconfig                |    7 +
 board/variscite/common/eth.c                  |   58 +
 board/variscite/common/eth.h                  |   12 +
 board/variscite/common/imx9_eeprom.c          |  190 +++
 board/variscite/common/imx9_eeprom.h          |   83 +
 board/variscite/common/mmc.c                  |   47 +
 board/variscite/imx93_var_som/Kconfig         |   12 +
 board/variscite/imx93_var_som/MAINTAINERS     |    7 +
 board/variscite/imx93_var_som/Makefile        |   17 +
 board/variscite/imx93_var_som/container.cfg   |   10 +
 board/variscite/imx93_var_som/imx93_var_som.c |  126 ++
 .../variscite/imx93_var_som/imx93_var_som.env |   99 ++
 board/variscite/imx93_var_som/imximage.cfg    |   10 +
 .../variscite/imx93_var_som/lpddr4x_timing.c  | 1488 +++++++++++++++++
 board/variscite/imx93_var_som/spl.c           |  143 ++
 configs/imx93_var_som_defconfig               |  156 ++
 doc/board/variscite/imx93_var_som.rst         |   68 +
 doc/board/variscite/index.rst                 |    1 +
 include/configs/imx93_var_som.h               |   48 +
 24 files changed, 3267 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/imx93-var-som-symphony-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx93-var-som-symphony.dts
 create mode 100644 arch/arm/dts/imx93-var-som.dtsi
 create mode 100644 board/variscite/common/eth.c
 create mode 100644 board/variscite/common/eth.h
 create mode 100644 board/variscite/common/imx9_eeprom.c
 create mode 100644 board/variscite/common/imx9_eeprom.h
 create mode 100644 board/variscite/common/mmc.c
 create mode 100644 board/variscite/imx93_var_som/Kconfig
 create mode 100644 board/variscite/imx93_var_som/MAINTAINERS
 create mode 100644 board/variscite/imx93_var_som/Makefile
 create mode 100644 board/variscite/imx93_var_som/container.cfg
 create mode 100644 board/variscite/imx93_var_som/imx93_var_som.c
 create mode 100644 board/variscite/imx93_var_som/imx93_var_som.env
 create mode 100644 board/variscite/imx93_var_som/imximage.cfg
 create mode 100644 board/variscite/imx93_var_som/lpddr4x_timing.c
 create mode 100644 board/variscite/imx93_var_som/spl.c
 create mode 100644 configs/imx93_var_som_defconfig
 create mode 100644 doc/board/variscite/imx93_var_som.rst
 create mode 100644 include/configs/imx93_var_som.h
arch/arm/dts/Makefile +2 -1
index e9e58c5478d..773c2546131 100644
@@ -1125,7 +1125,8 @@ dtb-$(CONFIG_ARCH_IMX8M) += \
 	imx8mq-librem5-r4.dtb
 
 dtb-$(CONFIG_ARCH_IMX9) += \
-	imx93-11x11-evk.dtb
+	imx93-11x11-evk.dtb \
+	imx93-var-som-symphony.dtb
 
 dtb-$(CONFIG_ARCH_IMXRT) += imxrt1050-evk.dtb \
 	imxrt1020-evk.dtb \
arch/arm/dts/imx93-var-som-symphony-u-boot.dtsi new file +266 -0

266 lines not on this page · raw message

arch/arm/dts/imx93-var-som-symphony.dts new file +305 -0

305 lines not on this page · raw message

arch/arm/dts/imx93-var-som.dtsi new file +111 -0

111 lines not on this page · raw message

arch/arm/include/asm/arch-imx9/clock.h +1 -0
index 1169ffd74d3..1ce6ac4c3a8 100644
@@ -222,6 +222,7 @@ u32 mxc_get_clock(enum mxc_clock clk);
 void dram_pll_init(ulong pll_val);
 void dram_enable_bypass(ulong clk_val);
 void dram_disable_bypass(void);
+void set_arm_core_max_clk(void);
 
 int configure_intpll(enum ccm_clk_src pll, u32 freq);
 
arch/arm/mach-imx/imx9/Kconfig +7 -0
index c51f80f311a..57e332a1958 100644
@@ -31,9 +31,16 @@ config TARGET_IMX93_11X11_EVK
 	bool "imx93_11x11_evk"
 	select IMX93
 
+config TARGET_IMX93_VAR_SOM
+	bool "imx93_var_som"
+        select BINMAN
+	select IMX93
+	select IMX9_LPDDR4X
+
 endchoice
 
 source "board/freescale/imx93_evk/Kconfig"
+source "board/variscite/imx93_var_som/Kconfig"
 
 endif
 
board/variscite/common/eth.c new file +58 -0

58 lines not on this page · raw message

board/variscite/common/eth.h new file +12 -0
new file mode 100644
index 00000000000..a335c08b8ce
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2023 Variscite Ltd.
+ *
+ */
+
+#ifndef _MX9_ETH_H_
+#define _MX9_ETH_H_
+
+int var_setup_mac(struct var_eeprom *eeprom);
+
+#endif /* _MX9_ETH_H_ */
board/variscite/common/imx9_eeprom.c new file +190 -0

190 lines not on this page · raw message

board/variscite/common/imx9_eeprom.h new file +83 -0

83 lines not on this page · raw message

board/variscite/common/mmc.c new file +47 -0

47 lines not on this page · raw message

board/variscite/imx93_var_som/Kconfig new file +12 -0
new file mode 100644
index 00000000000..f02e48d8959
@@ -0,0 +1,12 @@
+if TARGET_IMX93_VAR_SOM
+
+config SYS_BOARD
+	default "imx93_var_som"
+
+config SYS_VENDOR
+	default "variscite"
+
+config SYS_CONFIG_NAME
+	default "imx93_var_som"
+
+endif
board/variscite/imx93_var_som/MAINTAINERS new file +7 -0
new file mode 100644
index 00000000000..7ddaaac14b2
@@ -0,0 +1,7 @@
+ARM i.MX93 VARISCITE VAR-SOM-MX93 MODULE
+M:	Mathieu Othacehe <[email protected]>
+S:	Maintained
+F:	arch/arm/dts/imx93-var-som*
+F:	board/variscite/imx93_var_som/
+F:	configs/imx93_var_som_defconfig
+F:	include/configs/imx93_var_som.h
board/variscite/imx93_var_som/Makefile new file +17 -0
new file mode 100644
index 00000000000..b63883901bd
@@ -0,0 +1,17 @@
+#
+# Copyright 2022 NXP
+# Copyright 2023 Variscite Ltd.
+#
+# SPDX-License-Identifier:      GPL-2.0+
+#
+
+obj-y += imx93_var_som.o
+obj-$(CONFIG_TARGET_IMX93_VAR_SOM) += ../common/imx9_eeprom.o
+
+ifdef CONFIG_SPL_BUILD
+obj-y += spl.o
+obj-$(CONFIG_TARGET_IMX93_VAR_SOM) += lpddr4x_timing.o
+else
+obj-y += ../common/eth.o
+obj-y += ../common/mmc.o
+endif
board/variscite/imx93_var_som/container.cfg new file +10 -0
new file mode 100644
index 00000000000..f268bc9eb2c
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2023 Mathieu Othacehe <[email protected]>
+ */
+
+BOOT_FROM SD 0x400
+SOC_TYPE IMX9
+CONTAINER
+IMAGE A55 bl31.bin 0x204E0000
+IMAGE A55 u-boot.bin CONFIG_TEXT_BASE
\ No newline at end of file
board/variscite/imx93_var_som/imx93_var_som.c new file +126 -0

126 lines not on this page · raw message

board/variscite/imx93_var_som/imx93_var_som.env new file +99 -0

99 lines not on this page · raw message

board/variscite/imx93_var_som/imximage.cfg new file +10 -0
new file mode 100644
index 00000000000..3e440465b23
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2023 Mathieu Othacehe <[email protected]>
+ */
+
+BOOT_FROM SD 0x400
+SOC_TYPE IMX9
+APPEND mx93a0-ahab-container.img
+CONTAINER
+IMAGE A55 u-boot-spl-ddr.bin 0x2049A000
\ No newline at end of file
board/variscite/imx93_var_som/lpddr4x_timing.c new file +1488 -0

1,488 lines not on this page · raw message

board/variscite/imx93_var_som/spl.c new file +143 -0

125 lines not on this page · raw message

configs/imx93_var_som_defconfig new file +156 -0

156 lines not on this page · raw message

doc/board/variscite/imx93_var_som.rst new file +68 -0

68 lines not on this page · raw message

doc/board/variscite/index.rst +1 -0
index 4186896b66d..f84ebe7eb62 100644

Lines of this file are not shown. View the raw message.

include/configs/imx93_var_som.h new file +48 -0

48 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.25.1

Part of the diff is not shown here. View the raw message.

#5 lore raw

Hello,

Quoted 4 lines

https://source.denx.de/u-boot/custodians/u-boot-imx/-/jobs/764727

Take a look at the xilinx_zynqmp_virt and imx8mm-cl-iot-gate errors, for example.

Due to multi-threaded testing the output is a bit hard to read but I think that those configs are working fine.

The faulty config seems to be imx93_11x11_[ld]_evk and I can reproduce the issue locally.

The problem is the following line in mach-imx Makefile:

--8<---------------cut here---------------start------------->8--- u-boot-container.cfgout: $(IMX_CONTAINER_CFG) FORCE

	$(Q)mkdir -p $(dir $@)

--8<---------------cut here---------------end--------------->8---

We are expecting CONFIG_IMX_CONTAINER_CFG to be set for all the IMX9 boards which is not the case for the existing IMX9 boards:
imx93_11x11_[ld]_evk.

In v5, I propose to fix that by adding binman support for the imx93_11x11_[ld]_evk boards. I cannot test that but I expect those boards to behave the same way as the imx93_var_som.

Thanks,

Mathieu