Re: [PATCH] imx93: Move SoC and lifeclycle information to debug level

2024-04-16 Thread Mathieu Othacehe


Hello,

> The following information printed on every boot is not very
> helpful for the users:
>
> SOC: 0xa0009300
> LC: 0x40040
>
> Move them to debug() level.
>
> Signed-off-by: Fabio Estevam 

Reviewed-by: Mathieu Othacehe 

Thanks,

Mathieu


Re: [PATCH v6 0/5] imx93: Conver to OF_UPSTREAM

2024-04-15 Thread Mathieu Othacehe


Hey,

> Do I need to switch back to only convert i.MX93 11x11 EVK to
> OF_UPSTREM? 

That could be an idea. I can take over the switch for the other devices
when I have some time to perform the debugging.

Mathieu


Re: [PATCH v6 5/5] imx93: convert to OF_UPSTREAM

2024-04-14 Thread Mathieu Othacehe


Hello,

> Which dts upstream tag are u using?

You will find it in my previous email.

The command I use is:
./dts/update-dts-subtree.sh pull 2639a0e2fdbdb7f2dd351d06afe54c895adf9d9d

> Do you have time to debug the issue? I not have the board, so not sure what
> happens here.

Not at the moment sorry.

Mathieu


Re: [PATCH v6 5/5] imx93: convert to OF_UPSTREAM

2024-04-14 Thread Mathieu Othacehe


Hello,

I was able to test this series on the imx93-phyboard-segin. Up to that
specific commit no issue to report.

That specific commit however, using an updated dts subtree at
2639a0e2fd, fails to boot.

There is no more garbage on the UART, but the boot stops after BL31 is
started:

U-Boot SPL 2024.04-rc5-00388-gf81e4e85fd6-dirty (Apr 14 2024 - 12:15:51 +0200)
SOC: 0xa0009300
LC: 0x40040
M33 prepare ok
Normal Boot
WDT:   Started wdog@4249 with servicing every 1000ms (40s timeout)
Trying to boot from BOOTROM
Boot Stage: Primary boot
image offset 0x8000, pagesize 0x200, ivt offset 0x0
Load image from 0x45c00 by ROM_API
NOTICE:  BL31: v2.8(release):lf-6.1.36-2.1.0-0-g1a3beeab6-dirty
NOTICE:  BL31: Built : 11:39:38, Aug  7 2023

Not sure where that could come from.

Mathieu


Re: [PATCH v4 0/5] imx93: Conver to OF_UPSTREAM

2024-04-07 Thread Mathieu Othacehe


> Any comments?

Yes, see: https://lists.denx.de/pipermail/u-boot/2024-March/549531.html

Thanks,

Mathieu


Re: [PATCH v4 0/5] imx93: Conver to OF_UPSTREAM

2024-03-28 Thread Mathieu Othacehe


Hello,

>  Mathieu: please help test the boards you maintain when you have time.

I have tried both imx93_var_som and imx93-phyboard-segin
configurations. Compilation works but I only get garbage on the UART on
those two different boards.

I will try to conduct further investigations later on, but the booting
test is KO here.

Thanks,

Mathieu


[PATCH v3 2/3] configs: imx93-phyboard-segin: Add USB support

2024-03-21 Thread Mathieu Othacehe
Add USB support by enabling `usb` command and required USB drivers.

Signed-off-by: Mathieu Othacehe 
---
 configs/imx93-phyboard-segin_defconfig | 8 
 1 file changed, 8 insertions(+)

diff --git a/configs/imx93-phyboard-segin_defconfig 
b/configs/imx93-phyboard-segin_defconfig
index 24f9bd553aa..0345e7deeab 100644
--- a/configs/imx93-phyboard-segin_defconfig
+++ b/configs/imx93-phyboard-segin_defconfig
@@ -67,6 +67,7 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_POWEROFF=y
+CONFIG_CMD_USB=y
 CONFIG_CMD_SNTP=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EFIDEBUG=y
@@ -132,6 +133,13 @@ CONFIG_SPL_SYSRESET=y
 CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_DM_THERMAL=y
 CONFIG_IMX_TMU=y
+CONFIG_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="PHYTEC"
+CONFIG_USB_GADGET_VENDOR_NUM=0x1fc9
+CONFIG_USB_GADGET_PRODUCT_NUM=0x0152
+CONFIG_CI_UDC=y
 CONFIG_ULP_WATCHDOG=y
 CONFIG_LZO=y
 CONFIG_BZIP2=y
-- 
2.41.0



[PATCH v3 1/3] arm: dts: imx93-phyboard-segin: Add USB support

2024-03-21 Thread Mathieu Othacehe
Enable both usbotg1 and usbotg2 ports. Disable over-current as OC pins are
not connected to the SoC.

This is temporary, until USB support is added to imx93-phyboard-segin.dts
in Linux.

Signed-off-by: Mathieu Othacehe 
---
 arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi 
b/arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi
index 8bf28c2de87..6897c91f4d9 100644
--- a/arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi
+++ b/arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi
@@ -121,6 +121,21 @@
bootph-some-ram;
 };
 
+/*
+ * Remove once USB support is added to imx93-phyboard-segin.dts upstream.
+ */
+ {
+   disable-over-current;
+   dr_mode = "otg";
+   status = "okay";
+};
+
+ {
+   disable-over-current;
+   dr_mode = "host";
+   status = "okay";
+};
+
  {
bootph-pre-ram;
bootph-some-ram;
-- 
2.41.0



[PATCH v3 3/3] configs: imx93-phyboard-segin: Add fastboot support

2024-03-21 Thread Mathieu Othacehe
Enable the `fastboot` command.

Reviewed-by: Marek Vasut 
Signed-off-by: Mathieu Othacehe 
---
 configs/imx93-phyboard-segin_defconfig | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/configs/imx93-phyboard-segin_defconfig 
b/configs/imx93-phyboard-segin_defconfig
index 0345e7deeab..54215c51c08 100644
--- a/configs/imx93-phyboard-segin_defconfig
+++ b/configs/imx93-phyboard-segin_defconfig
@@ -94,6 +94,12 @@ CONFIG_SPL_CLK_IMX93=y
 CONFIG_CLK_IMX93=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
+CONFIG_FASTBOOT_BUF_ADDR=0x8280
+CONFIG_FASTBOOT_BUF_SIZE=0x2000
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_UUU_SUPPORT=y
+CONFIG_FASTBOOT_FLASH_MMC_DEV=0
 CONFIG_GPIO_HOG=y
 CONFIG_IMX_RGPIO2P=y
 CONFIG_DM_I2C=y
-- 
2.41.0



[PATCH v3 0/3] imx93-phyboard-segin: Add USB support.

2024-03-21 Thread Mathieu Othacehe
Hello,

This series adds USB support to imx93-phyboard-segin, in the same way as it
has been done for imx93_var_som here:

https://lists.denx.de/pipermail/u-boot/2024-February/546301.html

Thanks,

Mathieu

Changelog:

v1: https://lists.denx.de/pipermail/u-boot/2024-March/548613.html

Mathieu Othacehe (3):
  arm: dts: imx93-phyboard-segin: Add USB support
  configs: imx93-phyboard-segin: Add USB support
  configs: imx93-phyboard-segin: Add fastboot support

 arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi | 15 +++
 configs/imx93-phyboard-segin_defconfig| 14 ++
 2 files changed, 29 insertions(+)

-- 
2.41.0



[PATCH] imx: ele_ahab: Add ahab_commit command support

2024-03-21 Thread Mathieu Othacehe
This message is used to commit into the fuses any new SRK revocation and
FW version information that have been found into the NXP (ELE FW) and
OEM containers.

Signed-off-by: Mathieu Othacehe 
---
 arch/arm/include/asm/mach-imx/ele_api.h |  2 ++
 arch/arm/mach-imx/ele_ahab.c| 29 ++
 drivers/misc/imx_ele/ele_api.c  | 32 +
 3 files changed, 63 insertions(+)

diff --git a/arch/arm/include/asm/mach-imx/ele_api.h 
b/arch/arm/include/asm/mach-imx/ele_api.h
index cfd4ecebb62..a29b849d903 100644
--- a/arch/arm/include/asm/mach-imx/ele_api.h
+++ b/arch/arm/include/asm/mach-imx/ele_api.h
@@ -24,6 +24,7 @@
 #define ELE_GET_FW_VERSION_REQ (0x9D)
 #define ELE_RET_LIFECYCLE_UP_REQ (0xA0)
 #define ELE_GET_EVENTS_REQ (0xA2)
+#define ELE_COMMIT_REQ (0xA8)
 #define ELE_START_RNG (0xA3)
 #define ELE_GENERATE_DEK_BLOB (0xAF)
 #define ELE_ENABLE_PATCH_REQ (0xC3)
@@ -142,6 +143,7 @@ int ele_read_common_fuse(u16 fuse_id, u32 *fuse_words, u32 
fuse_num, u32 *respon
 int ele_release_caam(u32 core_did, u32 *response);
 int ele_get_fw_version(u32 *fw_version, u32 *sha1, u32 *response);
 int ele_get_events(u32 *events, u32 *events_cnt, u32 *response);
+int ele_commit(u16 fuse_id, u32 *response, u32 *info_type);
 int ele_generate_dek_blob(u32 key_id, u32 src_paddr, u32 dst_paddr, u32 
max_output_size);
 int ele_dump_buffer(u32 *buffer, u32 buffer_length);
 int ele_get_info(struct ele_get_info_data *info, u32 *response);
diff --git a/arch/arm/mach-imx/ele_ahab.c b/arch/arm/mach-imx/ele_ahab.c
index 295c055ad0a..d02316ed6cb 100644
--- a/arch/arm/mach-imx/ele_ahab.c
+++ b/arch/arm/mach-imx/ele_ahab.c
@@ -625,6 +625,29 @@ static int do_ahab_return_lifecycle(struct cmd_tbl *cmdtp, 
int flag, int argc, c
return CMD_RET_SUCCESS;
 }
 
+static int do_ahab_commit(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
+{
+   u32 index;
+   u32 resp;
+   u32 info_type;
+
+   if (argc < 2)
+   return CMD_RET_USAGE;
+
+   index = simple_strtoul(argv[1], NULL, 16);
+   printf("Commit index is 0x%x\n", index);
+
+   if (ele_commit(index, , _type)) {
+   printf("Error in AHAB commit\n");
+   return -EIO;
+   }
+
+   printf("Ahab commit succeeded. Information type is 0x%x\n", info_type);
+
+   return 0;
+}
+
 U_BOOT_CMD(auth_cntr, CONFIG_SYS_MAXARGS, 1, do_authenticate,
   "autenticate OS container via AHAB",
   "addr\n"
@@ -657,3 +680,9 @@ U_BOOT_CMD(ahab_return_lifecycle, CONFIG_SYS_MAXARGS, 1, 
do_ahab_return_lifecycl
   "addr\n"
   "addr - Return lifecycle message block signed by OEM SRK\n"
 );
+
+U_BOOT_CMD(ahab_commit, CONFIG_SYS_MAXARGS, 1, do_ahab_commit,
+  "commit into the fuses any new SRK revocation and FW version 
information\n"
+  "that have been found into the NXP (ELE FW) and OEM containers",
+  ""
+);
diff --git a/drivers/misc/imx_ele/ele_api.c b/drivers/misc/imx_ele/ele_api.c
index 0c017734a49..e0ec22c7abf 100644
--- a/drivers/misc/imx_ele/ele_api.c
+++ b/drivers/misc/imx_ele/ele_api.c
@@ -528,6 +528,38 @@ int ele_start_rng(void)
return ret;
 }
 
+int ele_commit(u16 fuse_id, u32 *response, u32 *info_type)
+{
+   struct udevice *dev = gd->arch.ele_dev;
+   int size = sizeof(struct ele_msg);
+   struct ele_msg msg;
+   int ret = 0;
+
+   if (!dev) {
+   printf("ele dev is not initialized\n");
+   return -ENODEV;
+   }
+
+   msg.version = ELE_VERSION;
+   msg.tag = ELE_CMD_TAG;
+   msg.size = 2;
+   msg.command = ELE_COMMIT_REQ;
+   msg.data[0] = fuse_id;
+
+   ret = misc_call(dev, false, , size, , size);
+   if (ret)
+   printf("Error: %s: ret %d, fuse_id 0x%x, response 0x%x\n",
+  __func__, ret, fuse_id, msg.data[0]);
+
+   if (response)
+   *response = msg.data[0];
+
+   if (info_type)
+   *info_type = msg.data[1];
+
+   return ret;
+}
+
 int ele_write_secure_fuse(ulong signed_msg_blk, u32 *response)
 {
struct udevice *dev = gd->arch.ele_dev;
-- 
2.41.0



[PATCH v2 3/3] configs: imx93-phyboard-segin: Add fastboot support

2024-03-21 Thread Mathieu Othacehe
Enable the `fastboot` command.

Reviewed-by: Marek Vasut 
Signed-off-by: Mathieu Othacehe 
---
 configs/imx93-phyboard-segin_defconfig | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/configs/imx93-phyboard-segin_defconfig 
b/configs/imx93-phyboard-segin_defconfig
index 0345e7deeab..54215c51c08 100644
--- a/configs/imx93-phyboard-segin_defconfig
+++ b/configs/imx93-phyboard-segin_defconfig
@@ -94,6 +94,12 @@ CONFIG_SPL_CLK_IMX93=y
 CONFIG_CLK_IMX93=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
+CONFIG_FASTBOOT_BUF_ADDR=0x8280
+CONFIG_FASTBOOT_BUF_SIZE=0x2000
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_UUU_SUPPORT=y
+CONFIG_FASTBOOT_FLASH_MMC_DEV=0
 CONFIG_GPIO_HOG=y
 CONFIG_IMX_RGPIO2P=y
 CONFIG_DM_I2C=y
-- 
2.41.0



[PATCH v2 2/3] configs: imx93-phyboard-segin: Add USB support

2024-03-21 Thread Mathieu Othacehe
Add USB support by enabling `usb` command and required USB drivers.

Signed-off-by: Mathieu Othacehe 
---
 configs/imx93-phyboard-segin_defconfig | 8 
 1 file changed, 8 insertions(+)

diff --git a/configs/imx93-phyboard-segin_defconfig 
b/configs/imx93-phyboard-segin_defconfig
index 24f9bd553aa..0345e7deeab 100644
--- a/configs/imx93-phyboard-segin_defconfig
+++ b/configs/imx93-phyboard-segin_defconfig
@@ -67,6 +67,7 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_POWEROFF=y
+CONFIG_CMD_USB=y
 CONFIG_CMD_SNTP=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EFIDEBUG=y
@@ -132,6 +133,13 @@ CONFIG_SPL_SYSRESET=y
 CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_DM_THERMAL=y
 CONFIG_IMX_TMU=y
+CONFIG_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="PHYTEC"
+CONFIG_USB_GADGET_VENDOR_NUM=0x1fc9
+CONFIG_USB_GADGET_PRODUCT_NUM=0x0152
+CONFIG_CI_UDC=y
 CONFIG_ULP_WATCHDOG=y
 CONFIG_LZO=y
 CONFIG_BZIP2=y
-- 
2.41.0



[PATCH v2 1/3] arm: dts: imx93-phyboard-segin: Add USB support

2024-03-21 Thread Mathieu Othacehe
Enable both usbotg1 and usbotg2 ports. Disable over-current as OC pins are
not connected to the SoC.

Signed-off-by: Mathieu Othacehe 
---
 arch/arm/dts/imx93-phyboard-segin.dts | 13 +
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/dts/imx93-phyboard-segin.dts 
b/arch/arm/dts/imx93-phyboard-segin.dts
index 85fb188b057..acf307a3192 100644
--- a/arch/arm/dts/imx93-phyboard-segin.dts
+++ b/arch/arm/dts/imx93-phyboard-segin.dts
@@ -40,6 +40,19 @@
status = "okay";
 };
 
+/* USB  */
+ {
+   disable-over-current;
+   dr_mode = "otg";
+   status = "okay";
+};
+
+ {
+   disable-over-current;
+   dr_mode = "host";
+   status = "okay";
+};
+
 /* eMMC */
  {
no-1-8-v;
-- 
2.41.0



[PATCH v2 0/3] imx93-phyboard-segin: Add USB support.

2024-03-21 Thread Mathieu Othacehe
Hello,

This series adds USB support to imx93-phyboard-segin, in the same way as it
has been done for imx93_var_som here:

https://lists.denx.de/pipermail/u-boot/2024-February/546301.html

Thanks,

Mathieu

Changelog:

v1: https://lists.denx.de/pipermail/u-boot/2024-March/548613.html

Mathieu Othacehe (3):
  arm: dts: imx93-phyboard-segin: Add USB support
  configs: imx93-phyboard-segin: Add USB support
  configs: imx93-phyboard-segin: Add fastboot support

 arch/arm/dts/imx93-phyboard-segin.dts  | 13 +
 configs/imx93-phyboard-segin_defconfig | 14 ++
 2 files changed, 27 insertions(+)

-- 
2.41.0



[PATCH 2/3] configs: imx93-phyboard-segin: Add USB support.

2024-03-18 Thread Mathieu Othacehe
Enable the `usb` command and some USB drivers.

Signed-off-by: Mathieu Othacehe 
---
 configs/imx93-phyboard-segin_defconfig | 8 
 1 file changed, 8 insertions(+)

diff --git a/configs/imx93-phyboard-segin_defconfig 
b/configs/imx93-phyboard-segin_defconfig
index 24f9bd553aa..5acb987b817 100644
--- a/configs/imx93-phyboard-segin_defconfig
+++ b/configs/imx93-phyboard-segin_defconfig
@@ -23,6 +23,7 @@ CONFIG_SPL_STACK=0x20519dd0
 CONFIG_SPL=y
 CONFIG_ENV_OFFSET_REDUND=0x72
 CONFIG_CMD_DEKBLOB=y
+CONFIG_CMD_USB=y
 CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x8800
 CONFIG_SYS_LOAD_ADDR=0x8040
 CONFIG_SYS_MEMTEST_START=0x8000
@@ -132,6 +133,13 @@ CONFIG_SPL_SYSRESET=y
 CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_DM_THERMAL=y
 CONFIG_IMX_TMU=y
+CONFIG_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="FSL"
+CONFIG_USB_GADGET_VENDOR_NUM=0x1fc9
+CONFIG_USB_GADGET_PRODUCT_NUM=0x0152
+CONFIG_CI_UDC=y
 CONFIG_ULP_WATCHDOG=y
 CONFIG_LZO=y
 CONFIG_BZIP2=y
-- 
2.41.0



[PATCH 0/3] imx93-phyboard-segin: Add USB support.

2024-03-18 Thread Mathieu Othacehe
Hello,

This series adds USB support to imx93-phyboard-segin, in the same way as it
has been done for imx93_var_som here:

https://lists.denx.de/pipermail/u-boot/2024-February/546301.html

Thanks,

Mathieu

Mathieu Othacehe (3):
  arm: dts: imx93-phyboard-segin: Add USB support.
  configs: imx93-phyboard-segin: Add USB support.
  configs: imx93-phyboard-segin: Add fastboot support.

 arch/arm/dts/imx93-phyboard-segin.dts  | 13 +
 configs/imx93-phyboard-segin_defconfig | 14 ++
 2 files changed, 27 insertions(+)

-- 
2.41.0



[PATCH 1/3] arm: dts: imx93-phyboard-segin: Add USB support.

2024-03-18 Thread Mathieu Othacehe
Enable both usbotg1 and usbotg2 ports.

Signed-off-by: Mathieu Othacehe 
---
 arch/arm/dts/imx93-phyboard-segin.dts | 13 +
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/dts/imx93-phyboard-segin.dts 
b/arch/arm/dts/imx93-phyboard-segin.dts
index 85fb188b057..acf307a3192 100644
--- a/arch/arm/dts/imx93-phyboard-segin.dts
+++ b/arch/arm/dts/imx93-phyboard-segin.dts
@@ -40,6 +40,19 @@
status = "okay";
 };
 
+/* USB  */
+ {
+   disable-over-current;
+   dr_mode = "otg";
+   status = "okay";
+};
+
+ {
+   disable-over-current;
+   dr_mode = "host";
+   status = "okay";
+};
+
 /* eMMC */
  {
no-1-8-v;
-- 
2.41.0



[PATCH 3/3] configs: imx93-phyboard-segin: Add fastboot support.

2024-03-18 Thread Mathieu Othacehe
Enable the `fastboot` command.

Signed-off-by: Mathieu Othacehe 
---
 configs/imx93-phyboard-segin_defconfig | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/configs/imx93-phyboard-segin_defconfig 
b/configs/imx93-phyboard-segin_defconfig
index 5acb987b817..44ab6f7073b 100644
--- a/configs/imx93-phyboard-segin_defconfig
+++ b/configs/imx93-phyboard-segin_defconfig
@@ -94,6 +94,12 @@ CONFIG_SPL_CLK_IMX93=y
 CONFIG_CLK_IMX93=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
+CONFIG_FASTBOOT_BUF_ADDR=0x8280
+CONFIG_FASTBOOT_BUF_SIZE=0x2000
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_UUU_SUPPORT=y
+CONFIG_FASTBOOT_FLASH_MMC_DEV=0
 CONFIG_GPIO_HOG=y
 CONFIG_IMX_RGPIO2P=y
 CONFIG_DM_I2C=y
-- 
2.41.0



[PATCH] imx9: Update to mx93 A1 chip revision.

2024-02-26 Thread Mathieu Othacehe
Use the latest, mx93a1-ahab-container.img that is compatible with the
i.MX93 A1 revision.

Using mx93a1-ahab-container.img on an A0 chip and conversely causes a boot
failure without any traces on the UART.

Signed-off-by: Mathieu Othacehe 
---
 arch/arm/mach-imx/imx9/imximage.cfg   | 2 +-
 doc/board/nxp/imx93_11x11_evk.rst | 8 
 doc/board/phytec/imx93-phyboard-segin.rst | 8 
 doc/board/variscite/imx93_var_som.rst | 8 
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-imx/imx9/imximage.cfg 
b/arch/arm/mach-imx/imx9/imximage.cfg
index 3e440465b23..d327d6a6ef4 100644
--- a/arch/arm/mach-imx/imx9/imximage.cfg
+++ b/arch/arm/mach-imx/imx9/imximage.cfg
@@ -5,6 +5,6 @@
 
 BOOT_FROM SD 0x400
 SOC_TYPE IMX9
-APPEND mx93a0-ahab-container.img
+APPEND mx93a1-ahab-container.img
 CONTAINER
 IMAGE A55 u-boot-spl-ddr.bin 0x2049A000
\ No newline at end of file
diff --git a/doc/board/nxp/imx93_11x11_evk.rst 
b/doc/board/nxp/imx93_11x11_evk.rst
index fb0ecf8af58..171645ad06c 100644
--- a/doc/board/nxp/imx93_11x11_evk.rst
+++ b/doc/board/nxp/imx93_11x11_evk.rst
@@ -42,10 +42,10 @@ Get ahab-container.img
 
 .. code-block:: bash
 
-   $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-sentinel-0.10.bin
-   $ chmod +x firmware-sentinel-0.10.bin
-   $ ./firmware-sentinel-0.10.bin
-   $ cp firmware-sentinel-0.10/mx93a0-ahab-container.img $(srctree)
+   $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-sentinel-0.11.bin
+   $ chmod +x firmware-sentinel-0.11.bin
+   $ ./firmware-sentinel-0.11.bin
+   $ cp firmware-sentinel-0.11/mx93a1-ahab-container.img $(srctree)
 
 Build U-Boot
 
diff --git a/doc/board/phytec/imx93-phyboard-segin.rst 
b/doc/board/phytec/imx93-phyboard-segin.rst
index da8772ecd5c..ce17fbec78d 100644
--- a/doc/board/phytec/imx93-phyboard-segin.rst
+++ b/doc/board/phytec/imx93-phyboard-segin.rst
@@ -41,10 +41,10 @@ Get ahab-container.img
 
 .. code-block:: bash
 
-   $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-sentinel-0.10.bin
-   $ chmod +x firmware-sentinel-0.10.bin
-   $ ./firmware-sentinel-0.10.bin
-   $ cp firmware-sentinel-0.10/mx93a0-ahab-container.img $(srctree)
+   $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-sentinel-0.11.bin
+   $ chmod +x firmware-sentinel-0.11.bin
+   $ ./firmware-sentinel-0.11.bin
+   $ cp firmware-sentinel-0.11/mx93a1-ahab-container.img $(srctree)
 
 Build U-Boot
 
diff --git a/doc/board/variscite/imx93_var_som.rst 
b/doc/board/variscite/imx93_var_som.rst
index 4951afd2dad..02309f2ad87 100644
--- a/doc/board/variscite/imx93_var_som.rst
+++ b/doc/board/variscite/imx93_var_som.rst
@@ -42,10 +42,10 @@ Get ahab-container.img
 
 .. code-block:: bash
 
-   $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-sentinel-0.10.bin
-   $ chmod +x firmware-sentinel-0.10.bin
-   $ ./firmware-sentinel-0.10.bin
-   $ cp firmware-sentinel-0.10/mx93a0-ahab-container.img $(srctree)
+   $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-sentinel-0.11.bin
+   $ chmod +x firmware-sentinel-0.11.bin
+   $ ./firmware-sentinel-0.11.bin
+   $ cp firmware-sentinel-0.11/mx93a1-ahab-container.img $(srctree)
 
 Build U-Boot
 
-- 
2.41.0



[PATCH 2/2] tools: imx9_image: Reword warning message.

2024-02-26 Thread Mathieu Othacehe
If the optional `tee.bin` OP-TEE binary is missing, the image will still be
functional. Adapt the warning message accordingly.

Signed-off-by: Mathieu Othacehe 
---
 tools/imx9_image.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/imx9_image.sh b/tools/imx9_image.sh
index 88dfcfe606c..ca78a57a19a 100755
--- a/tools/imx9_image.sh
+++ b/tools/imx9_image.sh
@@ -19,7 +19,7 @@ for f in $blobs; do
fi
 
if [ ! -f $tmp ]; then
-   echo "WARNING '$tmp' not found, resulting binary is 
not-functional" >&2
+   echo "WARNING '$tmp' not found, resulting binary may be 
not-functional" >&2
 
 # Comment-out the lines for un-existing files. This way,
 # mkimage can keep working. This allows CI tests to pass even
-- 
2.41.0



[PATCH 1/2] imx9: Fix OP-TEE support

2024-02-26 Thread Mathieu Othacehe
This fixes OP-TEE support by:

- Adding tee.bin to container.cfg
- Starting ELE RNG in SPL

Signed-off-by: Mathieu Othacehe 
---
 arch/arm/mach-imx/imx9/container.cfg | 3 ++-
 board/freescale/imx93_evk/spl.c  | 7 +++
 board/phytec/phycore_imx93/spl.c | 7 +++
 board/variscite/imx93_var_som/spl.c  | 6 ++
 4 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/imx9/container.cfg 
b/arch/arm/mach-imx/imx9/container.cfg
index f268bc9eb2c..72fe791eae6 100644
--- a/arch/arm/mach-imx/imx9/container.cfg
+++ b/arch/arm/mach-imx/imx9/container.cfg
@@ -7,4 +7,5 @@ BOOT_FROM SD 0x400
 SOC_TYPE IMX9
 CONTAINER
 IMAGE A55 bl31.bin 0x204E
-IMAGE A55 u-boot.bin CONFIG_TEXT_BASE
\ No newline at end of file
+IMAGE A55 u-boot.bin CONFIG_TEXT_BASE
+IMAGE A55 tee.bin 0x9600
\ No newline at end of file
diff --git a/board/freescale/imx93_evk/spl.c b/board/freescale/imx93_evk/spl.c
index a98ed69db88..2fd5559195e 100644
--- a/board/freescale/imx93_evk/spl.c
+++ b/board/freescale/imx93_evk/spl.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -43,6 +44,12 @@ int spl_board_boot_device(enum boot_device boot_dev_spl)
 
 void spl_board_init(void)
 {
+   int ret;
+
+   ret = ele_start_rng();
+   if (ret)
+   printf("Fail to start RNG: %d\n", ret);
+
puts("Normal Boot\n");
 }
 
diff --git a/board/phytec/phycore_imx93/spl.c b/board/phytec/phycore_imx93/spl.c
index dabc5316f33..16303fc187a 100644
--- a/board/phytec/phycore_imx93/spl.c
+++ b/board/phytec/phycore_imx93/spl.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -34,6 +35,12 @@ int spl_board_boot_device(enum boot_device boot_dev_spl)
 
 void spl_board_init(void)
 {
+   int ret;
+
+   ret = ele_start_rng();
+   if (ret)
+   printf("Fail to start RNG: %d\n", ret);
+
puts("Normal Boot\n");
 }
 
diff --git a/board/variscite/imx93_var_som/spl.c 
b/board/variscite/imx93_var_som/spl.c
index e6db4eb562b..36e17219d63 100644
--- a/board/variscite/imx93_var_som/spl.c
+++ b/board/variscite/imx93_var_som/spl.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -47,9 +48,14 @@ int spl_board_boot_device(enum boot_device boot_dev_spl)
 void spl_board_init(void)
 {
struct var_eeprom *ep = VAR_EEPROM_DATA;
+   int ret;
 
puts("Normal Boot\n");
 
+   ret = ele_start_rng();
+   if (ret)
+   printf("Fail to start RNG: %d\n", ret);
+
/* Copy EEPROM contents to DRAM */
memcpy(ep, , sizeof(*ep));
 }
-- 
2.41.0



[PATCH 0/2] Fix OP-TEE support

2024-02-26 Thread Mathieu Othacehe
Hello,

This series fixes OP-TEE support on all imx9 boards by starting the ELE RNG
and adding the optional tee.bin binary to the ATF container.

Thanks,

Mathieu

Mathieu Othacehe (2):
  imx9: Fix OP-TEE support
  tools: imx9_image: Reword warning message.

 arch/arm/mach-imx/imx9/container.cfg | 3 ++-
 board/freescale/imx93_evk/spl.c  | 7 +++
 board/phytec/phycore_imx93/spl.c | 7 +++
 board/variscite/imx93_var_som/spl.c  | 6 ++
 tools/imx9_image.sh  | 2 +-
 5 files changed, 23 insertions(+), 2 deletions(-)

-- 
2.41.0



[PATCH 0/5] imx93_var_som: Add USB support.

2024-02-20 Thread Mathieu Othacehe
Hello,

This series adds USB support for the imx93_var_som board.  It depends on:
https://lists.denx.de/pipermail/u-boot/2024-February/546203.html

It also adds support for fastboot and EFI partitions.

Thanks,

Mathieu

Mathieu Othacehe (5):
  arm: dts: imx93: Add USB support.
  arm: dts: imx93-var-som-symphony: Add USB support.
  configs: imx93_var_som: Add USB support.
  configs: imx93_var_som: Add fastboot support.
  configs: imx93_var_som: Add EFI support.

 arch/arm/dts/imx93-var-som-symphony.dts | 18 
 arch/arm/dts/imx93.dtsi | 58 +
 configs/imx93_var_som_defconfig | 19 +++-
 3 files changed, 94 insertions(+), 1 deletion(-)

-- 
2.41.0



[PATCH 4/5] configs: imx93_var_som: Add fastboot support.

2024-02-20 Thread Mathieu Othacehe
Enable the `fastboot` command.

Signed-off-by: Mathieu Othacehe 
---
 configs/imx93_var_som_defconfig | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/configs/imx93_var_som_defconfig b/configs/imx93_var_som_defconfig
index 0aab222c7c1..60751a77037 100644
--- a/configs/imx93_var_som_defconfig
+++ b/configs/imx93_var_som_defconfig
@@ -97,6 +97,12 @@ CONFIG_SPL_CLK_IMX93=y
 CONFIG_CLK_IMX93=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
+CONFIG_FASTBOOT_BUF_ADDR=0x8280
+CONFIG_FASTBOOT_BUF_SIZE=0x2000
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_UUU_SUPPORT=y
+CONFIG_FASTBOOT_FLASH_MMC_DEV=0
 CONFIG_GPIO_HOG=y
 CONFIG_IMX_RGPIO2P=y
 CONFIG_DM_PCA953X=y
-- 
2.41.0



[PATCH 1/5] arm: dts: imx93: Add USB support.

2024-02-20 Thread Mathieu Othacehe
Copied from:
https://lore.kernel.org/linux-devicetree/20240131114324.3722428-6-xu.yan...@nxp.com/

Signed-off-by: Mathieu Othacehe 
---
 arch/arm/dts/imx93.dtsi | 58 +
 1 file changed, 58 insertions(+)

diff --git a/arch/arm/dts/imx93.dtsi b/arch/arm/dts/imx93.dtsi
index 90de635481f..d6964714ea0 100644
--- a/arch/arm/dts/imx93.dtsi
+++ b/arch/arm/dts/imx93.dtsi
@@ -149,6 +149,20 @@
};
};
 
+   usbphynop1: usbphynop1 {
+   compatible = "usb-nop-xceiv";
+   #phy-cells = <0>;
+   clocks = < IMX93_CLK_USB_PHY_BURUNIN>;
+   clock-names = "main_clk";
+   };
+
+   usbphynop2: usbphynop2 {
+   compatible = "usb-nop-xceiv";
+   #phy-cells = <0>;
+   clocks = < IMX93_CLK_USB_PHY_BURUNIN>;
+   clock-names = "main_clk";
+   };
+
soc@0 {
compatible = "simple-bus";
#address-cells = <1>;
@@ -844,5 +858,49 @@
#power-domain-cells = <1>;
status = "disabled";
};
+
+   usbotg1: usb@4c10 {
+   compatible = "fsl,imx93-usb", "fsl,imx7d-usb", 
"fsl,imx27-usb";
+   reg = <0x4c10 0x200>;
+   interrupts = ;
+   clocks = < IMX93_CLK_USB_CONTROLLER_GATE>,
+< IMX93_CLK_HSIO_32K_GATE>;
+   clock-names = "usb_ctrl_root_clk", "usb_wakeup";
+   assigned-clocks = < IMX93_CLK_HSIO>;
+   assigned-clock-parents = < 
IMX93_CLK_SYS_PLL_PFD1_DIV2>;
+   assigned-clock-rates = <13300>;
+   phys = <>;
+   fsl,usbmisc = < 0>;
+   status = "disabled";
+   };
+
+   usbmisc1: usbmisc@4c100200 {
+   compatible = "fsl,imx8mm-usbmisc", "fsl,imx7d-usbmisc",
+"fsl,imx6q-usbmisc";
+   reg = <0x4c100200 0x200>;
+   #index-cells = <1>;
+   };
+
+   usbotg2: usb@4c20 {
+   compatible = "fsl,imx93-usb", "fsl,imx7d-usb", 
"fsl,imx27-usb";
+   reg = <0x4c20 0x200>;
+   interrupts = ;
+   clocks = < IMX93_CLK_USB_CONTROLLER_GATE>,
+< IMX93_CLK_HSIO_32K_GATE>;
+   clock-names = "usb_ctrl_root_clk", "usb_wakeup";
+   assigned-clocks = < IMX93_CLK_HSIO>;
+   assigned-clock-parents = < 
IMX93_CLK_SYS_PLL_PFD1_DIV2>;
+   assigned-clock-rates = <13300>;
+   phys = <>;
+   fsl,usbmisc = < 0>;
+   status = "disabled";
+   };
+
+   usbmisc2: usbmisc@4c200200 {
+   compatible = "fsl,imx8mm-usbmisc", "fsl,imx7d-usbmisc",
+"fsl,imx6q-usbmisc";
+   reg = <0x4c200200 0x200>;
+   #index-cells = <1>;
+   };
};
 };
-- 
2.41.0



[PATCH 3/5] configs: imx93_var_som: Add USB support.

2024-02-20 Thread Mathieu Othacehe
Enable the `usb` command and some USB drivers.

Signed-off-by: Mathieu Othacehe 
---
 configs/imx93_var_som_defconfig | 9 +
 1 file changed, 9 insertions(+)

diff --git a/configs/imx93_var_som_defconfig b/configs/imx93_var_som_defconfig
index 71cd016d332..0aab222c7c1 100644
--- a/configs/imx93_var_som_defconfig
+++ b/configs/imx93_var_som_defconfig
@@ -70,6 +70,7 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_POWEROFF=y
 CONFIG_CMD_READ=y
+CONFIG_CMD_USB=y
 CONFIG_CMD_WDT=y
 CONFIG_BOOTP_PREFER_SERVERIP=y
 CONFIG_CMD_SNTP=y
@@ -132,6 +133,14 @@ CONFIG_DM_SERIAL=y
 CONFIG_FSL_LPUART=y
 CONFIG_DM_THERMAL=y
 CONFIG_IMX_TMU=y
+CONFIG_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="FSL"
+CONFIG_USB_GADGET_VENDOR_NUM=0x1fc9
+CONFIG_USB_GADGET_PRODUCT_NUM=0x0152
+CONFIG_CI_UDC=y
+CONFIG_USB_PORT_AUTO=y
 CONFIG_ULP_WATCHDOG=y
 CONFIG_WDT=y
 CONFIG_LZO=y
-- 
2.41.0



[PATCH 2/5] arm: dts: imx93-var-som-symphony: Add USB support.

2024-02-20 Thread Mathieu Othacehe
Enable both usbotg1 and usbotg2 ports.

Signed-off-by: Mathieu Othacehe 
---
 arch/arm/dts/imx93-var-som-symphony.dts | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm/dts/imx93-var-som-symphony.dts 
b/arch/arm/dts/imx93-var-som-symphony.dts
index a67bd005e54..1bc61942716 100644
--- a/arch/arm/dts/imx93-var-som-symphony.dts
+++ b/arch/arm/dts/imx93-var-som-symphony.dts
@@ -285,6 +285,24 @@
status = "okay";
 };
 
+ {
+   dr_mode = "otg";
+   hnp-disable;
+   srp-disable;
+   adp-disable;
+   disable-over-current;
+   status = "okay";
+};
+
+ {
+   dr_mode = "host";
+   hnp-disable;
+   srp-disable;
+   adp-disable;
+   disable-over-current;
+   status = "okay";
+};
+
 /* SD */
  {
pinctrl-names = "default", "state_100mhz", "state_200mhz";
-- 
2.41.0



[PATCH 5/5] configs: imx93_var_som: Add EFI support.

2024-02-20 Thread Mathieu Othacehe
Enable the `gpt` command and EFI partitions support.

Signed-off-by: Mathieu Othacehe 
---
 configs/imx93_var_som_defconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/configs/imx93_var_som_defconfig b/configs/imx93_var_som_defconfig
index 60751a77037..a3f98abc161 100644
--- a/configs/imx93_var_som_defconfig
+++ b/configs/imx93_var_som_defconfig
@@ -78,6 +78,7 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_EFIDEBUG=y
 CONFIG_CMD_RTC=y
 CONFIG_CMD_TIME=y
+CONFIG_CMD_GPT=y
 CONFIG_CMD_GETTIME=y
 CONFIG_CMD_TIMER=y
 CONFIG_CMD_REGULATOR=y
@@ -151,4 +152,5 @@ CONFIG_ULP_WATCHDOG=y
 CONFIG_WDT=y
 CONFIG_LZO=y
 CONFIG_BZIP2=y
-CONFIG_RSA=y
\ No newline at end of file
+CONFIG_RSA=y
+CONFIG_EFI_PARTITION=y
\ No newline at end of file
-- 
2.41.0



Re: [PATCH v2] usb: ehci-mx6: Add i.MX93 support

2024-02-19 Thread Mathieu Othacehe


Hello Fabio,

Thanks for having a look.

> I assume you will add USB support to some i.MX93 boards later.

Yes that's the plan for the boards that I own: imx93_var_som and
imx93-phyboard-segin :)

Mathieu


[PATCH v2] usb: ehci-mx6: Add i.MX93 support

2024-02-19 Thread Mathieu Othacehe
i.MX93 uses the same USB IP as i.MX8MM. It can then reuse the ehci-mx6
driver.

Reviewed-by: Marek Vasut 
Signed-off-by: Mathieu Othacehe 
---
 drivers/usb/host/Kconfig| 6 +++---
 drivers/usb/host/ehci-mx6.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 0dd5736433c..f96027d7bd2 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -210,10 +210,10 @@ config USB_EHCI_MX6
 
 config USB_EHCI_MX7
bool "Support for i.MX7 on-chip EHCI USB controller"
-   depends on ARCH_MX7 || IMX8M
+   depends on ARCH_MX7 || IMX8M || IMX93
select EHCI_HCD_INIT_AFTER_RESET if ARCH_MX7
-   select PHY if IMX8M
-   select NOP_PHY if IMX8M
+   select PHY if IMX8M || IMX93
+   select NOP_PHY if IMX8M || IMX93
default y
---help---
  Enables support for the on-chip EHCI controller on i.MX7 SoCs.
diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c
index a9ed5e7a0d5..a35fcca43a2 100644
--- a/drivers/usb/host/ehci-mx6.c
+++ b/drivers/usb/host/ehci-mx6.c
@@ -538,7 +538,7 @@ static int ehci_usb_phy_mode(struct udevice *dev)
plat->init_type = USB_INIT_DEVICE;
else
plat->init_type = USB_INIT_HOST;
-   } else if (is_mx7() || is_imx8mm() || is_imx8mn()) {
+   } else if (is_mx7() || is_imx8mm() || is_imx8mn() || is_imx93()) {
phy_status = (void __iomem *)(addr +
  USBNC_PHY_STATUS_OFFSET);
val = readl(phy_status);
-- 
2.41.0



[PATCH] usb: ehci-mx6: Add i.MX93 support

2024-02-19 Thread Mathieu Othacehe
i.MX93 uses the same USB IP as i.MX8MM. It can then reuse the ehci-mx6
driver.

Signed-off-by: Mathieu Othacehe 
---
 drivers/usb/host/Kconfig| 6 +++---
 drivers/usb/host/ehci-mx6.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 0dd5736433c..f96027d7bd2 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -210,10 +210,10 @@ config USB_EHCI_MX6
 
 config USB_EHCI_MX7
bool "Support for i.MX7 on-chip EHCI USB controller"
-   depends on ARCH_MX7 || IMX8M
+   depends on ARCH_MX7 || IMX8M || IMX93
select EHCI_HCD_INIT_AFTER_RESET if ARCH_MX7
-   select PHY if IMX8M
-   select NOP_PHY if IMX8M
+   select PHY if IMX8M || IMX93
+   select NOP_PHY if IMX8M || IMX93
default y
---help---
  Enables support for the on-chip EHCI controller on i.MX7 SoCs.
diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c
index a9ed5e7a0d5..a35fcca43a2 100644
--- a/drivers/usb/host/ehci-mx6.c
+++ b/drivers/usb/host/ehci-mx6.c
@@ -538,7 +538,7 @@ static int ehci_usb_phy_mode(struct udevice *dev)
plat->init_type = USB_INIT_DEVICE;
else
plat->init_type = USB_INIT_HOST;
-   } else if (is_mx7() || is_imx8mm() || is_imx8mn()) {
+   } else if (is_mx7() || is_imx8mm() || is_imx8mn() || is_imx93()) {
phy_status = (void __iomem *)(addr +
  USBNC_PHY_STATUS_OFFSET);
val = readl(phy_status);
-- 
2.41.0



Re: [PATCH 0/2] imx93_var_som: Enable AHAB support

2024-02-09 Thread Mathieu Othacehe


> This is what I am concerned about: this hang causes the board to brick
> and can no
> longer be recovered since it has the fuse programmed to close the device, 
> right?

Once the board is closed you can only boot from signed images. If the
signed image is not working (hanging during relocation for instance),
then you can always boot from a new one. All the interfaces: SD-card,
UART, USB are still usable.

I have tried many u-boot versions on my closed board until I had
something working. So, no you do not end-up with a brick unless you
cannot sign your image properly anymore.

Or maybe I missed your point?

Thanks,

Mathieu



Re: [PATCH 1/2] board: imx93_var_som: Probe ELE MU

2024-02-09 Thread Mathieu Othacehe


Hello,

> Please put this prototype into a header file.
>
> Currently, it appears in 3 imx93 spl.c files.

Fixed in the v2 :)

Thanks,

Mathieu


[PATCH v2 3/3] configs: imx93_var_som: Enable AHAB support

2024-02-09 Thread Mathieu Othacehe
Enable AHAB support in the imx93_var_som configuration.

Signed-off-by: Mathieu Othacehe 
---
 configs/imx93_var_som_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/imx93_var_som_defconfig b/configs/imx93_var_som_defconfig
index cc0c5a79bc1..14922f2a3e2 100644
--- a/configs/imx93_var_som_defconfig
+++ b/configs/imx93_var_som_defconfig
@@ -12,6 +12,7 @@ CONFIG_IMX_CONFIG="arch/arm/mach-imx/imx9/imximage.cfg"
 CONFIG_DM_GPIO=y
 CONFIG_DEFAULT_DEVICE_TREE="imx93-var-som-symphony"
 CONFIG_SPL_TEXT_BASE=0x2049A000
+CONFIG_AHAB_BOOT=y
 CONFIG_TARGET_IMX93_VAR_SOM=y
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_SPL_SERIAL=y
-- 
2.41.0



[PATCH v2 2/3] board: imx93_var_som: Probe ELE MU

2024-02-09 Thread Mathieu Othacehe
Probing the MU is needed to prevent this error in the SPL:

ele dev is not initialized
Authenticate container hdr failed, return -19, resp 0x0
IND = INVALID

ele dev is not initialized
Error: release container failed, resp 0x0!
IND = INVALID

SPL: failed to boot from all boot devices

Signed-off-by: Mathieu Othacehe 
---
 board/variscite/imx93_var_som/spl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/board/variscite/imx93_var_som/spl.c 
b/board/variscite/imx93_var_som/spl.c
index 502e599b91a..e6db4eb562b 100644
--- a/board/variscite/imx93_var_som/spl.c
+++ b/board/variscite/imx93_var_som/spl.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -114,9 +115,9 @@ void board_init_f(ulong dummy)
 
preloader_console_init();
 
-   ret = arch_cpu_init();
+   ret = imx9_probe_mu(NULL, NULL);
if (ret) {
-   printf("Fail to init Sentinel API\n");
+   printf("Fail to init ELE API\n");
} else {
printf("SOC: 0x%x\n", gd->arch.soc_rev);
printf("LC: 0x%x\n", gd->arch.lifecycle);
-- 
2.41.0



[PATCH v2 1/3] imx93: Use a header for imx9_probe_mu declaration

2024-02-09 Thread Mathieu Othacehe
Put imx9_probe_mu declaration in a new mu.h header file.

Signed-off-by: Mathieu Othacehe 
---
 arch/arm/include/asm/arch-imx9/mu.h | 13 +
 board/freescale/imx93_evk/spl.c |  2 +-
 board/phytec/phycore_imx93/spl.c|  2 +-
 3 files changed, 15 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-imx9/mu.h

diff --git a/arch/arm/include/asm/arch-imx9/mu.h 
b/arch/arm/include/asm/arch-imx9/mu.h
new file mode 100644
index 000..b8604992914
--- /dev/null
+++ b/arch/arm/include/asm/arch-imx9/mu.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2024 Mathieu Othacehe 
+ */
+
+#ifndef __ARCH_IMX9_MU_H
+#define __ARCH_IMX9_MU_H
+
+#include 
+
+int imx9_probe_mu(void *ctx, struct event *event);
+
+#endif
diff --git a/board/freescale/imx93_evk/spl.c b/board/freescale/imx93_evk/spl.c
index be9c24fc0d9..a98ed69db88 100644
--- a/board/freescale/imx93_evk/spl.c
+++ b/board/freescale/imx93_evk/spl.c
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -91,7 +92,6 @@ int power_init_board(void)
 }
 #endif
 
-extern int imx9_probe_mu(void *ctx, struct event *event);
 void board_init_f(ulong dummy)
 {
int ret;
diff --git a/board/phytec/phycore_imx93/spl.c b/board/phytec/phycore_imx93/spl.c
index da4b9e53594..dabc5316f33 100644
--- a/board/phytec/phycore_imx93/spl.c
+++ b/board/phytec/phycore_imx93/spl.c
@@ -7,6 +7,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -99,7 +100,6 @@ int power_init_board(void)
return 0;
 }
 
-extern int imx9_probe_mu(void *ctx, struct event *event);
 void board_init_f(ulong dummy)
 {
int ret;
-- 
2.41.0



[PATCH v2 0/3] imx93_var_som: Enable AHAB support

2024-02-09 Thread Mathieu Othacehe
Hello,

In this v2, I moved imx93_probe_mu to a dedicated header.

Thanks,

Mathieu

Changelog:
v2: Move imx93_probe_mu declaration to a header file

Link to the previous revision:
v1: https://lists.denx.de/pipermail/u-boot/2024-February/545528.html

Mathieu Othacehe (3):
  imx93: Use a header for imx9_probe_mu declaration
  board: imx93_var_som: Probe ELE MU
  configs: imx93_var_som: Enable AHAB support

 arch/arm/include/asm/arch-imx9/mu.h | 13 +
 board/freescale/imx93_evk/spl.c |  2 +-
 board/phytec/phycore_imx93/spl.c|  2 +-
 board/variscite/imx93_var_som/spl.c |  5 +++--
 configs/imx93_var_som_defconfig |  1 +
 5 files changed, 19 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-imx9/mu.h

-- 
2.41.0



Re: [PATCH 0/2] imx93_var_som: Enable AHAB support

2024-02-09 Thread Mathieu Othacehe


Hello Fabio,

> Just wanted to make sure I understand: if someone programs the fuse to
> close the board,
> it will fail to boot U-Boot proper and this means that the board is
> bricked. Is this correct?

No. I fused the board and with this series applied and the three HAFDBS
commits reverted, I can boot just fine on that board.

Without reverting those commits, the SPL is working fine and u-boot
hangs at relocation. It is 100% reproducible on my board.

> Is the boot failure related to some malloc size needing to be increased?

I tried that it has no influence.

Thanks,

Mathieu


[PATCH 2/2] configs: imx93_var_som: Enable AHAB support

2024-02-08 Thread Mathieu Othacehe
Enable AHAB support in the imx93_var_som configuration.

Signed-off-by: Mathieu Othacehe 
---
 configs/imx93_var_som_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/imx93_var_som_defconfig b/configs/imx93_var_som_defconfig
index cc0c5a79bc1..14922f2a3e2 100644
--- a/configs/imx93_var_som_defconfig
+++ b/configs/imx93_var_som_defconfig
@@ -12,6 +12,7 @@ CONFIG_IMX_CONFIG="arch/arm/mach-imx/imx9/imximage.cfg"
 CONFIG_DM_GPIO=y
 CONFIG_DEFAULT_DEVICE_TREE="imx93-var-som-symphony"
 CONFIG_SPL_TEXT_BASE=0x2049A000
+CONFIG_AHAB_BOOT=y
 CONFIG_TARGET_IMX93_VAR_SOM=y
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_SPL_SERIAL=y
-- 
2.41.0



[PATCH 1/2] board: imx93_var_som: Probe ELE MU

2024-02-08 Thread Mathieu Othacehe
Probing the MU is needed to prevent this error in the SPL:

ele dev is not initialized
Authenticate container hdr failed, return -19, resp 0x0
IND = INVALID

ele dev is not initialized
Error: release container failed, resp 0x0!
IND = INVALID

SPL: failed to boot from all boot devices

Signed-off-by: Mathieu Othacehe 
---
 board/variscite/imx93_var_som/spl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/board/variscite/imx93_var_som/spl.c 
b/board/variscite/imx93_var_som/spl.c
index 502e599b91a..0965a2de996 100644
--- a/board/variscite/imx93_var_som/spl.c
+++ b/board/variscite/imx93_var_som/spl.c
@@ -97,6 +97,7 @@ int power_init_board(void)
return 0;
 }
 
+extern int imx9_probe_mu(void *ctx, struct event *event);
 void board_init_f(ulong dummy)
 {
int ret;
@@ -114,9 +115,9 @@ void board_init_f(ulong dummy)
 
preloader_console_init();
 
-   ret = arch_cpu_init();
+   ret = imx9_probe_mu(NULL, NULL);
if (ret) {
-   printf("Fail to init Sentinel API\n");
+   printf("Fail to init ELE API\n");
} else {
printf("SOC: 0x%x\n", gd->arch.soc_rev);
printf("LC: 0x%x\n", gd->arch.lifecycle);
-- 
2.41.0



[PATCH 0/2] imx93_var_som: Enable AHAB support

2024-02-08 Thread Mathieu Othacehe
Hello,

This enables AHAB support on the imx93_var_som.
I was able to test that I can boot from signed images on a closed board.

There is one issue that has been discovered and that is discussed here:
https://lists.denx.de/pipermail/u-boot/2024-February/545404.html

This series can still be applied in the meantime I guess.

Thanks,

Mathieu

Mathieu Othacehe (2):
  board: imx93_var_som: Probe ELE MU
  configs: imx93_var_som: Enable AHAB support

 board/variscite/imx93_var_som/spl.c | 5 +++--
 configs/imx93_var_som_defconfig | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

-- 
2.41.0



Re: imx93-var-som: ahab: U-boot is hanging

2024-02-07 Thread Mathieu Othacehe


Hello,

I performed a bisection and was able to fix that issue by reverting
three commits on v2024.04-rc1:

0585c28fda1007e4a90dea5f70723cff0b63dd98
eed8294b75a5908a486945ff6655d4dc9aae5fed
ee23d7466c77d01ee63efb76db2c5fd3b7cdd6f7

It is still unclear to me how those FEAT_HAFDBS related commits can be
linked to my issue. 

Possibly my issue is a race condition and the timing shifts introduced
by those three commits are enough to make the issue go away.

To be continued...

Thanks,

Mathieu


imx93-var-som: ahab: U-boot is hanging

2024-02-06 Thread Mathieu Othacehe


Hello,

I am using the imx93-var-som_defconfig configuration on commit
v2024.04-rc1. When producing signed or unsigned images on an unclosed
board everything works fine.

However, once the board is closed (ahab_close command is issued), u-boot
hangs this way:

--8<---cut here---start->8---
U-Boot SPL 2024.04-rc1-4-g8494a62b246-dirty (Feb 06 2024 - 15:24:49 +0100)
SOC: 0xa0009300
LC: 0x40040
M33 prepare ok
Normal Boot
Trying to boot from BOOTROM
Boot Stage: USB boot
NOTICE:  BL31: v2.6(release):d8bc791fb
NOTICE:  BL31: Built : 18:11:44, Mar 15 2023


U-Boot 2024.04-rc1-4-g8494a62b246-dirty (Feb 06 2024 - 15:24:49 +0100)

U-Boot code: 8020 -> 802B4328  BSS: -> 802BA420
CPU:   i.MX93 rev1.0
Model: Variscite VAR-SOM-MX93 on Symphony evaluation board
DRAM:  Monitor len: 000BA420
Ram size: 8000
Ram top: 1
Reserving 745k for U-Boot at: fff25000
Reserving 32784k for malloc() at: fdf21000
Reserving 152 Bytes for Board Info at: fdf20f60
Reserving 480 Bytes for Global Data at: fdf20d80
Reserving 24832 Bytes for FDT at: fdf1ac80

RAM Configuration:
Bank #0: 8000 2 GiB
Bank #1: 0 0 Bytes

DRAM:  2 GiB
New Stack Pointer is: fdf1ac70
Relocation Offset is: 7fd25000
Relocating to fff25000, new gd at fdf20d80, sp at fdf1ac70
Added memory mapping (5): 8000 8000
Pre-reloc malloc() used 0x17478 bytes (93 KB)
before mem_malloc_init
--8<---cut here---end--->8---

It seems that signature checking is OK because both the SPL and regular
u-boot are started. However, something seems to cause u-boot to hang.

Here I am hanging in initr_malloc function, right in the
mem_malloc_init call:

--8<---cut here---start->8---
static int initr_malloc(void)
{
ulong start;

#if CONFIG_IS_ENABLED(SYS_MALLOC_F)
debug("Pre-reloc malloc() used %#lx bytes (%ld KB)\n", gd->malloc_ptr,
  gd->malloc_ptr / 1024);
#endif
/* The malloc area is immediately below the monitor copy in DRAM */
/*
 * This value MUST match the value of gd->start_addr_sp in board_f.c:
 * reserve_noncached().
 */
start = gd->relocaddr - TOTAL_MALLOC_LEN;
gd_set_malloc_start(start);
debug("before mem_malloc_init\n");
mem_malloc_init((ulong)map_sysmem(start, TOTAL_MALLOC_LEN),
TOTAL_MALLOC_LEN);

debug("after mem_malloc_init\n");
return 0;
}
--8<---cut here---end--->8---

If I add initcall traces, then I'm not going that far:

--8<---cut here---start->8---
U-Boot SPL 2024.04-rc1-4-g8494a62b246-dirty (Feb 06 2024 - 15:06:54 +0100)
SOC: 0xa0009300
LC: 0x40040
M33 prepare ok
Normal Boot
Trying to boot from BOOTROM
Boot Stage: USB boot
NOTICE:  BL31: v2.6(release):d8bc791fb
NOTICE:  BL31: Built : 18:11:44, Mar 15 2023
initcall: 8027189c

U-Boot 2024.04-rc1-4-g8494a62b246-dirty (Feb 06 2024 - 15:06:54 +0100)

initcall: 8022481c
U-Boot code: 8020 -> 802B43C0  BSS: -> 802BA4A0
initcall: 80224654
initcall: 80203844
CPU:   i.MX93 rev1.0
initcall: 80224fdc
Model: Variscite VAR-SOM-MX93 on Symphony evaluation board
initcall: event 8/(unknown)
initcall: 80224850
DRAM:  initcall: 802035a8
initcall: 80224bb8
Monitor len: 000BA4A0
Ram size: 8000
Ram top: 1
initcall: 80224640
initcall: 802248b8
initcall: 80202e24
initcall: 802248c0
initcall: 802248c8
initcall: 802247b4
Reserving 745k for U-Boot at: fff25000
initcall: 80224968
Reserving 32784k for malloc() at: fdf21000
initcall: 80224908
Reserving 152 Bytes for Board Info at: fdf20f60
initcall: 802249a8
Reserving 480 Bytes for Global Data at: fdf20d80
initcall: 80224744
Reserving 24832 Bytes for FDT at: fdf1ac80
initcall: 802248d0
initcall: 802248d8
initcall: 802248f8
initcall: 80224c30
initcall: 802035e0
initcall: 802249ec

RAM Configuration:
Bank #0: 8000 2 GiB
Bank #1: 0 0 Bytes

DRAM:  2 GiB
initcall: 80224c44
initcall: 80224720
New Stack Pointer is: fdf1ac70
initcall: 8022465c
initcall: 802248e0
initcall: 802248e8
initcall: 802246a0
Relocation Offset is: 7fd25000
Relocating to fff25000, new gd at fdf20d80, sp at fdf1ac70
initcall: 80224900
initcall: 80227704
initcall: fff49c8c
initcall: fff49c94
initcall: fff4c8c0
initcall: fff49f54
Added memory mapping (5): 8000 8000
initcall: fff49f04
initcall: fff49f74
initcall: fff49ea4
Pre-r
--8<---cut here---end--->8---

and I am stopping in the process of writing the "Pre-reloc ..." trace.

All-in-all, fusing the board seems to change something causing the
previously working 

[PATCH v4] board: phytec: phycore-imx93: Add phyBOARD-Segin-i.MX93 support

2024-01-30 Thread Mathieu Othacehe
Add initial support for the PHYTEC phyBOARD-Segin-i.MX93 board based on
the PHYTEC phyCORE-i.MX93 SoM.

Supported features:
- 1GB LPDDR4 RAM
- eMMC
- external SD
- FEC Ethernet
- debug UART
- watchdog

Signed-off-by: Mathieu Othacehe 
---
Hello,

This new revision fixes the remarks of Primoz. The configuration is now
aligned on the savedefconfig output. The FEC Ethernet is also tested to be
working if this patch is in:

https://patchwork.ozlabs.org/project/uboot/patch/20240130124337.497748-1-primoz.fi...@norik.com/

The proposed patch has been rebased on top of 6faba41.

Thanks,

Mathieu

v3: https://lists.denx.de/pipermail/u-boot/2024-January/544493.html

 arch/arm/dts/Makefile |3 +-
 arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi |  293 
 arch/arm/dts/imx93-phyboard-segin.dts |  117 ++
 arch/arm/dts/imx93-phycore-som.dtsi   |  126 ++
 arch/arm/mach-imx/imx9/Kconfig|6 +
 board/phytec/phycore_imx93/Kconfig|   13 +
 board/phytec/phycore_imx93/MAINTAINERS|   10 +
 board/phytec/phycore_imx93/Makefile   |   14 +
 board/phytec/phycore_imx93/lpddr4_timing.c| 1546 +
 board/phytec/phycore_imx93/phycore-imx93.c|   42 +
 board/phytec/phycore_imx93/phycore_imx93.env  |   73 +
 board/phytec/phycore_imx93/spl.c  |  148 ++
 configs/imx93-phyboard-segin_defconfig|  138 ++
 doc/board/phytec/imx93-phyboard-segin.rst |   61 +
 doc/board/phytec/index.rst|1 +
 include/configs/phycore_imx93.h   |   28 +
 16 files changed, 2618 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx93-phyboard-segin.dts
 create mode 100644 arch/arm/dts/imx93-phycore-som.dtsi
 create mode 100644 board/phytec/phycore_imx93/Kconfig
 create mode 100644 board/phytec/phycore_imx93/MAINTAINERS
 create mode 100644 board/phytec/phycore_imx93/Makefile
 create mode 100644 board/phytec/phycore_imx93/lpddr4_timing.c
 create mode 100644 board/phytec/phycore_imx93/phycore-imx93.c
 create mode 100644 board/phytec/phycore_imx93/phycore_imx93.env
 create mode 100644 board/phytec/phycore_imx93/spl.c
 create mode 100644 configs/imx93-phyboard-segin_defconfig
 create mode 100644 doc/board/phytec/imx93-phyboard-segin.rst
 create mode 100644 include/configs/phycore_imx93.h

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 50f35e3db3f..1a20031b063 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1130,7 +1130,8 @@ dtb-$(CONFIG_ARCH_IMX8M) += \
 
 dtb-$(CONFIG_ARCH_IMX9) += \
imx93-11x11-evk.dtb \
-   imx93-var-som-symphony.dtb
+   imx93-var-som-symphony.dtb \
+   imx93-phyboard-segin.dtb
 
 dtb-$(CONFIG_ARCH_IMXRT) += imxrt1050-evk.dtb \
imxrt1020-evk.dtb \
diff --git a/arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi 
b/arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi
new file mode 100644
index 000..8bf28c2de87
--- /dev/null
+++ b/arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi
@@ -0,0 +1,293 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2023 PHYTEC Messtechnik GmbH
+ * Christoph Stoidner 
+ *
+ * Product homepage:
+ * phyBOARD-Segin carrier board is reused for the i.MX93 design.
+ * 
https://www.phytec.eu/en/produkte/single-board-computer/phyboard-segin-imx6ul/
+ */
+
+#include "imx93-u-boot.dtsi"
+
+/ {
+   wdt-reboot {
+   compatible = "wdt-reboot";
+   wdt = <>;
+   bootph-pre-ram;
+   bootph-some-ram;
+   };
+
+   aliases {
+   ethernet0 = 
+   ethernet1 = 
+   };
+
+   firmware {
+   optee {
+   compatible = "linaro,optee-tz";
+   method = "smc";
+   };
+   };
+};
+
+&{/soc@0} {
+   bootph-all;
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-all;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_usdhc2_vmmc {
+   u-boot,off-on-delay-us = <2>;
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_reg_usdhc2_vmmc {
+   bootph-pre-ram;
+};
+
+_uart1 {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_usdhc1 {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_usdhc2_cd {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_usdhc2_default {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_usdhc2_100mhz {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_usdhc2_200mhz {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+

Re: [PATCH v3] board: phytec: phycore-imx93: Add phyBOARD-Segin-i.MX93 support

2024-01-30 Thread Mathieu Othacehe


Hey,

> And see if it fixes Ethernet on the board?

Yes, it works! That allowed me to check that netboot was working as well
on my patch.

Thanks,

Mathieu


Re: [PATCH] imx9: clock: Fix board_interface_eth_init for FEC

2024-01-30 Thread Mathieu Othacehe


Hello,

> Fixes: d5eae216d833 ("net: dwc_eth_qos: Add board_interface_eth_init() for 
> i.MX93")
> Signed-off-by: Primoz Fiser 

I confirm that it fixes Ethernet connection when using FEC as a primary
port on the phyBOARD-Segin-i.MX93.

Tested-by: Mathieu Othacehe 

Mathieu


Re: [PATCH v3] board: phytec: phycore-imx93: Add phyBOARD-Segin-i.MX93 support

2024-01-30 Thread Mathieu Othacehe


> I am based on latest master 6faba41927bd (tag: v2024.04-rc1)

That was it. I rebased from 043ca8c8a9b to 6faba41927bd and I now have
the same behaviour as you. I cannot find which commit fixed the
situation in that interval though.

Preparing the v4,

Thanks,

Mathieu


Re: [PATCH v3] board: phytec: phycore-imx93: Add phyBOARD-Segin-i.MX93 support

2024-01-30 Thread Mathieu Othacehe


> And what awk do you both have? environment.h is generated via
> scripts/env2string.awk

On my side:

mathieu@meije ~/u-boot [env]$ awk --version 
GNU Awk 5.2.1, API 3.2, PMA Avon 8-g1

and I have a similar result with:

mathieu@FRMONPC1176:~$ awk --version
GNU Awk 5.0.1, API: 2.0 (GNU MPFR 4.0.2, GNU MP 6.2.0)

Mathieu


Re: [PATCH v3] board: phytec: phycore-imx93: Add phyBOARD-Segin-i.MX93 support

2024-01-30 Thread Mathieu Othacehe


Hey,

> Can you re-check, please?
>
> Maybe check your include/generated/environment.h?

Thanks for checking. It is strange that you do not reproduce that one.

My include/generated/environment.h looks like:

--8<---cut here---start->8---
#define CONFIG_EXTRA_ENV_TEXT 
"bootenv=bootenv.txt\0bootenv_addr=0x8350\0console=ttyLP0\0fdt_addr=0x8300\0fdt_file=\"oftree\"\0fdto_addr=0x830c\0image=Image\0ip_dyn=yes\0loadfdt=fatload
 mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0loadimage=fatload mmc 
${mmcdev}:${mmcpart} ${loadaddr} ${image}\0mmc_apply_overlays=fdt address 
${fdt_addr}; for overlay in ${overlays}; do; if run mmc_load_overlay; then fdt 
resize ${filesize}; fdt apply ${fdto_addr}; fi; done;\0mmc_load_bootenv=fatload 
mmc ${mmcdev}:${mmcpart} ${bootenv_addr} ${bootenv}\0mmc_load_overlay=fatload 
mmc ${mmcdev}:${mmcpart} ${fdto_addr} ${overlay}\0mmcargs=setenv bootargs 
console=${console},${baudrate} earlycon root=/dev/mmcblk${mmcdev}p${mmcroot} 
${raucargs} rootwait rw\0mmcautodetect=yes\0mmcboot=echo Booting from mmc ...; 
if run mmc_load_bootenv; then env import -t ${bootenv_addr} ${filesize}; fi; 
run mmcargs; if run loadfdt; then run mmc_apply_overlays; booti ${loadaddr} - 
${fdt_addr}; else echo WARN: Cannot load the DT; 
fi;\0mmcdev=1\0mmcpart=1\0mmcroot=2\0net_apply_overlays=fdt address 
${fdt_addr}; for overlay in ${overlays}; do; if run net_load_overlay; then fdt 
resize ${filesize}; fdt apply ${fdto_addr}; fi; 
done;\0net_load_bootenv=${get_cmd} ${bootenv_addr} 
${bootenv}\0net_load_overlay=${get_cmd} ${fdto_addr} ${overlay}\0netargs=setenv 
bootargs console=${console},${baudrate} earlycon root=/dev/nfs ip=${nfsip} 
nfsroot=${serverip}:${nfsroot},v3,tcp\0netboot=echo Booting from net ...; run 
netargs; if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd 
tftp; fi; if run net_load_bootenv; then env import -t ${bootenv_addr} 
${filesize}; fi; ${get_cmd} ${loadaddr} ${image}; if ${get_cmd} ${fdt_addr} 
${fdt_file}; then run net_apply_overlays; booti ${loadaddr} - ${fdt_addr}; else 
echo WARN: Cannot load the DT; fi;\0nfsroot=/nfs\0"
--8<---cut here---end--->8---

Note that fdt_file=\"oftree\" which explains the issue on my side. Do
you have a similar environment.h?

What u-boot commit are you based on?

Mathieu


Re: [PATCH v3] board: phytec: phycore-imx93: Add phyBOARD-Segin-i.MX93 support

2024-01-30 Thread Mathieu Othacehe


Hello,

> Please remove findfdt script.
>
> Not needed when you set fdt_file to CONFIG_DEFAULT_FDT_FILE above.

The reason I used findfdt is that CONFIG_DEFAULT_FDT_FILE is a string
so, we end up with:

--8<---cut here---start->8---
fdt_file="oftree"
--8<---cut here---end--->8---

which gives:

--8<---cut here---start->8---
u-boot=> run loadfdt
Failed to load '"oftree"'
--8<---cut here---end--->8---

whereas, if I set:

--8<---cut here---start->8---
u-boot=> setenv fdt_file oftree
u-boot=> run loadfdt   
24579 bytes read in 5 ms (4.7 MiB/s)
--8<---cut here---end--->8---

I then see three options: introduce an unstrigify macro, hardcode
fdt_file=oftree in the env file, or use the findfdt hack.

I'm not sure which one is the better?

I will fix all the other remarks in the v4.

Thanks,

Mathieu


[PATCH v3] board: phytec: phycore-imx93: Add phyBOARD-Segin-i.MX93 support

2024-01-25 Thread Mathieu Othacehe
Add initial support for the PHYTEC phyBOARD-Segin-i.MX93 board based on
the PHYTEC phyCORE-i.MX93 SoM.

Supported features:
- 1GB LPDDR4 RAM
- eMMC
- external SD
- debug UART
- watchdog

Signed-off-by: Mathieu Othacehe 
---
Hello,

This new revision fixes the remarks of Primoz. It uses configuration and an
environment files closer to what's inside the downstream project.

Thanks,

Mathieu

v2: https://lists.denx.de/pipermail/u-boot/2024-January/544396.html

 arch/arm/dts/Makefile |3 +-
 arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi |  293 
 arch/arm/dts/imx93-phyboard-segin.dts |  117 ++
 arch/arm/dts/imx93-phycore-som.dtsi   |  126 ++
 arch/arm/mach-imx/imx9/Kconfig|6 +
 board/phytec/phycore_imx93/Kconfig|   13 +
 board/phytec/phycore_imx93/MAINTAINERS|   10 +
 board/phytec/phycore_imx93/Makefile   |   14 +
 board/phytec/phycore_imx93/lpddr4_timing.c| 1546 +
 board/phytec/phycore_imx93/phycore-imx93.c|   42 +
 board/phytec/phycore_imx93/phycore_imx93.env  |   85 +
 board/phytec/phycore_imx93/spl.c  |  150 ++
 configs/imx93-phyboard-segin_defconfig|  149 ++
 doc/board/phytec/imx93-phyboard-segin.rst |   61 +
 doc/board/phytec/index.rst|1 +
 include/configs/phycore_imx93.h   |   28 +
 16 files changed, 2643 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx93-phyboard-segin.dts
 create mode 100644 arch/arm/dts/imx93-phycore-som.dtsi
 create mode 100644 board/phytec/phycore_imx93/Kconfig
 create mode 100644 board/phytec/phycore_imx93/MAINTAINERS
 create mode 100644 board/phytec/phycore_imx93/Makefile
 create mode 100644 board/phytec/phycore_imx93/lpddr4_timing.c
 create mode 100644 board/phytec/phycore_imx93/phycore-imx93.c
 create mode 100644 board/phytec/phycore_imx93/phycore_imx93.env
 create mode 100644 board/phytec/phycore_imx93/spl.c
 create mode 100644 configs/imx93-phyboard-segin_defconfig
 create mode 100644 doc/board/phytec/imx93-phyboard-segin.rst
 create mode 100644 include/configs/phycore_imx93.h

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index d456a524b36..e7687a1b57d 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1127,7 +1127,8 @@ dtb-$(CONFIG_ARCH_IMX8M) += \
 
 dtb-$(CONFIG_ARCH_IMX9) += \
imx93-11x11-evk.dtb \
-   imx93-var-som-symphony.dtb
+   imx93-var-som-symphony.dtb \
+   imx93-phyboard-segin.dtb
 
 dtb-$(CONFIG_ARCH_IMXRT) += imxrt1050-evk.dtb \
imxrt1020-evk.dtb \
diff --git a/arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi 
b/arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi
new file mode 100644
index 000..c194b009274
--- /dev/null
+++ b/arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi
@@ -0,0 +1,293 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2023 PHYTEC Messtechnik GmbH
+ * Christoph Stoidner 
+ *
+ * Product homepage:
+ * phyBOARD-Segin carrier board is reused for the i.MX93 design.
+ * 
https://www.phytec.eu/en/produkte/single-board-computer/phyboard-segin-imx6ul/
+ */
+
+#include "imx93-u-boot.dtsi"
+
+/ {
+   wdt-reboot {
+   compatible = "wdt-reboot";
+   wdt = <>;
+   bootph-pre-ram;
+   bootph-some-ram;
+   };
+
+   aliases {
+   ethernet0 = 
+   ethernet1 = 
+   };
+
+   firmware {
+   optee {
+   compatible = "linaro,optee-tz";
+   method = "smc";
+   };
+   };
+};
+
+&{/soc@0} {
+   bootph-all;
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-all;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_usdhc2_vmmc {
+   u-boot,off-on-delay-us = <2>;
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_reg_usdhc2_vmmc {
+   bootph-pre-ram;
+};
+
+_uart1 {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_usdhc1 {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_usdhc2_cd {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_usdhc2_default {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_usdhc2_100mhz {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_usdhc2_200mhz {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   

Re: [PATCH v2] Add Phytec i.MX93 support

2024-01-25 Thread Mathieu Othacehe


Hello,

Thanks for having a look!

> Here are my findings:
>
> - FEC ethernet doesn't work
> - distroboot doesn't work
>
> Did you expirience the same?

I have not tested Ethernet ports on u-boot yet. I removed distroboot
support as you proposed later in the review.

Note that my evaluation board has a hardware issue on the eMMC module. I
am testing this patch my flashing the bootloader on the SD card using
the commands in the proposed documentation, and booting on the SD card.

> Can you rework you commit msg + title please?

Done.

> Can you rename to match other?

Sure.

> Can you add:
>
>  {
>   bootph-all;
>   bootph-pre-ram;
> };
>
> here to also enable WDT in SPL, please.

OK.

> I don't think this is necessary?
>
> You are using CONFIG_DM_SERIAL.

It is not necessary indeed.

> IMHO I would disable distroboot and sync with downstream.

Done.

I synced the configuration and environment files to be closer to the
downstream versions.

I will send a v3 soon.

Thanks,

Mathieu


[PATCH v2] Add Phytec i.MX93 support

2024-01-24 Thread Mathieu Othacehe
Add support for the Phytec i.MX93 Segin evaluation kit. The SoM consists
of an NXP i.MX93 dual A55 CPU. The SoM is mounted on a Phytec Segin SBC.

Signed-off-by: Mathieu Othacehe 
---
Hello,

This new revision takes Yannic and Primoz comments into account.  I went
for a configuration file that is named imx93-phyboard-segin_defconfig,
which is inline with the imx8mm-phygate-tauri-l_defconfig, as discussed
with Yannic.

This way, the device tree and the configuration files are matching. I
restored the original phycore_imx93 directory in board/phytec/. The
documentation is updated accordingly.

I aligned the device trees with the v5 revision of the matching kernel
patch.

I removed the initialization of fec and eqos Ethernet ports that is not
tested yet.

Thanks,

Mathieu

v1: https://lists.denx.de/pipermail/u-boot/2024-January/543599.html

 arch/arm/dts/Makefile |3 +-
 arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi |  287 +++
 arch/arm/dts/imx93-phyboard-segin.dts |  117 ++
 arch/arm/dts/imx93-phycore-som.dtsi   |  126 ++
 arch/arm/mach-imx/imx9/Kconfig|6 +
 board/phytec/phycore_imx93/Kconfig|   13 +
 board/phytec/phycore_imx93/MAINTAINERS|   10 +
 board/phytec/phycore_imx93/Makefile   |   14 +
 board/phytec/phycore_imx93/lpddr4_timing.c| 1546 +
 board/phytec/phycore_imx93/phycore_imx93.c|   61 +
 board/phytec/phycore_imx93/phycore_imx93.env  |   96 +
 board/phytec/phycore_imx93/spl.c  |  182 ++
 configs/imx93-phyboard-segin_defconfig|  147 ++
 doc/board/phytec/imx93-phyboard-segin.rst |   61 +
 doc/board/phytec/index.rst|1 +
 include/configs/phycore_imx93.h   |   47 +
 16 files changed, 2716 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx93-phyboard-segin.dts
 create mode 100644 arch/arm/dts/imx93-phycore-som.dtsi
 create mode 100644 board/phytec/phycore_imx93/Kconfig
 create mode 100644 board/phytec/phycore_imx93/MAINTAINERS
 create mode 100644 board/phytec/phycore_imx93/Makefile
 create mode 100644 board/phytec/phycore_imx93/lpddr4_timing.c
 create mode 100644 board/phytec/phycore_imx93/phycore_imx93.c
 create mode 100644 board/phytec/phycore_imx93/phycore_imx93.env
 create mode 100644 board/phytec/phycore_imx93/spl.c
 create mode 100644 configs/imx93-phyboard-segin_defconfig
 create mode 100644 doc/board/phytec/imx93-phyboard-segin.rst
 create mode 100644 include/configs/phycore_imx93.h

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index d456a524b36..e7687a1b57d 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1127,7 +1127,8 @@ dtb-$(CONFIG_ARCH_IMX8M) += \
 
 dtb-$(CONFIG_ARCH_IMX9) += \
imx93-11x11-evk.dtb \
-   imx93-var-som-symphony.dtb
+   imx93-var-som-symphony.dtb \
+   imx93-phyboard-segin.dtb
 
 dtb-$(CONFIG_ARCH_IMXRT) += imxrt1050-evk.dtb \
imxrt1020-evk.dtb \
diff --git a/arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi 
b/arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi
new file mode 100644
index 000..3d4c851b0d0
--- /dev/null
+++ b/arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi
@@ -0,0 +1,287 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2023 PHYTEC Messtechnik GmbH
+ * Christoph Stoidner 
+ *
+ * Product homepage:
+ * phyBOARD-Segin carrier board is reused for the i.MX93 design.
+ * 
https://www.phytec.eu/en/produkte/single-board-computer/phyboard-segin-imx6ul/
+ */
+
+#include "imx93-u-boot.dtsi"
+
+/ {
+   wdt-reboot {
+   compatible = "wdt-reboot";
+   wdt = <>;
+   bootph-pre-ram;
+   bootph-some-ram;
+   };
+
+   aliases {
+   ethernet0 = 
+   ethernet1 = 
+   };
+
+   firmware {
+   optee {
+   compatible = "linaro,optee-tz";
+   method = "smc";
+   };
+   };
+};
+
+&{/soc@0} {
+   bootph-all;
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-all;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_usdhc2_vmmc {
+   u-boot,off-on-delay-us = <2>;
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_reg_usdhc2_vmmc {
+   bootph-pre-ram;
+};
+
+_uart1 {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_usdhc1 {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_usdhc2_cd {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_usdhc2_default {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_usdhc2_100mhz {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_usdhc2_200mhz {
+   bootph-pre-ram;
+   bootph-some-ram;
+

Re: [PATCH] Add Phytec i.MX93 support

2024-01-24 Thread Mathieu Othacehe


Hello Yannic,

> As a heads-up: you need to rebase as am62 (doc) got applied by Tom.

Noted.

> Is the trusted-firmware-a upstream version working? If so, please use that 
> instead.

It is but only on the master branch, so it might be better to stick to
the nxp-imx repository until a lts release is created.

>> +#include 
>
> I don't see a specific reason to have this include separate?! Group it with 
> the others, please.

Many other include files place it here, right after the
BOOT_TARGET_DEVICES macro, so I guess there must be a reason, even
though I am unsure why :).

Thanks,

Mathieu


Re: [PATCH] Add Phytec i.MX93 support

2024-01-18 Thread Mathieu Othacehe


Hi,

Thanks for the review!

> s/imx93_phycore/phycore_imx93
>
> To fit into existing PHYTEC boards already in tree.

I deliberately picked that order so that it is aligned with most imx
boards already supported by u-boot.

The supported imx93 boards follow that pattern:

- imx93_var_som
- imx93_evk

So it felt natural to have:

- imx93_phycore

Plus the kernel device-trees are also following that order:

- imx93-phycore-xxx

On the other hand, it is true that the existing phycore boards use the
phytec_* pattern:

- phycore_am335x_r2
- phycore_imx8mm
- phycore_imx8mp
- phycore_rk3288/

So that will be confusing no matter the option that we choose.

I will come up with a v2 fixing your other remarks, but I think that
this should be addressed beforehand.

Thanks,

Mathieu


[PATCH] Add Phytec i.MX93 support

2024-01-17 Thread Mathieu Othacehe
Add support for the Phytec i.MX93 Segin evaluation kit. The SoM consists
of an NXP i.MX93 dual A55 CPU. The SoM is mounted on a Phytec Segin SBC.

Signed-off-by: Mathieu Othacehe 
---
 arch/arm/dts/Makefile |3 +-
 arch/arm/dts/imx93-phycore-segin-u-boot.dtsi  |  274 +++
 arch/arm/dts/imx93-phycore-segin.dts  |   95 +
 arch/arm/dts/imx93-phycore-som.dtsi   |   64 +
 arch/arm/mach-imx/imx9/Kconfig|6 +
 board/phytec/common/mmc.c |   49 +
 board/phytec/imx93_phycore/Kconfig|   21 +
 board/phytec/imx93_phycore/MAINTAINERS|   10 +
 board/phytec/imx93_phycore/Makefile   |   16 +
 board/phytec/imx93_phycore/imx93_phycore.c|   89 +
 board/phytec/imx93_phycore/imx93_phycore.env  |   96 +
 .../phytec/imx93_phycore/lpddr4_timing_1GB.c  | 1546 +
 board/phytec/imx93_phycore/spl.c  |  181 ++
 configs/imx93_phycore_defconfig   |  147 ++
 doc/board/phytec/imx93_phycore.rst|   68 +
 doc/board/phytec/index.rst|1 +
 include/configs/imx93_phycore.h   |   47 +
 17 files changed, 2712 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/imx93-phycore-segin-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx93-phycore-segin.dts
 create mode 100644 arch/arm/dts/imx93-phycore-som.dtsi
 create mode 100644 board/phytec/common/mmc.c
 create mode 100644 board/phytec/imx93_phycore/Kconfig
 create mode 100644 board/phytec/imx93_phycore/MAINTAINERS
 create mode 100644 board/phytec/imx93_phycore/Makefile
 create mode 100644 board/phytec/imx93_phycore/imx93_phycore.c
 create mode 100644 board/phytec/imx93_phycore/imx93_phycore.env
 create mode 100644 board/phytec/imx93_phycore/lpddr4_timing_1GB.c
 create mode 100644 board/phytec/imx93_phycore/spl.c
 create mode 100644 configs/imx93_phycore_defconfig
 create mode 100644 doc/board/phytec/imx93_phycore.rst
 create mode 100644 include/configs/imx93_phycore.h

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index d456a524b36..4a23e2a2f49 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1127,7 +1127,8 @@ dtb-$(CONFIG_ARCH_IMX8M) += \
 
 dtb-$(CONFIG_ARCH_IMX9) += \
imx93-11x11-evk.dtb \
-   imx93-var-som-symphony.dtb
+   imx93-var-som-symphony.dtb \
+   imx93-phycore-segin.dtb
 
 dtb-$(CONFIG_ARCH_IMXRT) += imxrt1050-evk.dtb \
imxrt1020-evk.dtb \
diff --git a/arch/arm/dts/imx93-phycore-segin-u-boot.dtsi 
b/arch/arm/dts/imx93-phycore-segin-u-boot.dtsi
new file mode 100644
index 000..6d75f1985aa
--- /dev/null
+++ b/arch/arm/dts/imx93-phycore-segin-u-boot.dtsi
@@ -0,0 +1,274 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2023 PHYTEC Messtechnik GmbH
+ * Christoph Stoidner 
+ *
+ * Product homepage:
+ * phyBOARD-Segin carrier board is reused for the i.MX93 design.
+ * https://www.phytec.de/produkte/single-board-computer/phyboard-segin-imx6ul/
+ */
+
+#include "imx93-u-boot.dtsi"
+
+/ {
+   wdt-reboot {
+   compatible = "wdt-reboot";
+   wdt = <>;
+   bootph-pre-ram;
+   bootph-some-ram;
+   };
+
+   aliases {
+   ethernet0 = 
+   ethernet1 = 
+   };
+
+   firmware {
+   optee {
+   compatible = "linaro,optee-tz";
+   method = "smc";
+   };
+   };
+};
+
+&{/soc@0} {
+   bootph-all;
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-all;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_usdhc2_vmmc {
+   u-boot,off-on-delay-us = <2>;
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_reg_usdhc2_vmmc {
+   bootph-pre-ram;
+};
+
+_uart1 {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_usdhc2 {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+   fsl,signal-voltage-switch-extra-delay-ms = <8>;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+   status = "okay";
+};
+
+ {
+   bootph-all;
+   bootph-pre-ram;
+   /delete-property/ assigned-clocks;
+   /delete-property/ assigned-cl

Re: [PATCH v5 0/3] Add imx93-var-som support

2024-01-08 Thread Mathieu Othacehe


Hello,

> I will also wait for the Gitbug CI job to finish:
> https://github.com/u-boot/u-boot/pull/457
>
> Also, it seems you generated v6 against U-Boot master instead of U-Boot next?

Right, because I wasn't sure CI was working for pull requests on the
`next` branch of Github. It looks like it is so I also created a PR on
top of the `next` branch: https://github.com/u-boot/u-boot/pull/459.

I should have done that in the first place, sorry about that.

Thanks,

Mathieu


Re: [PATCH v5 0/3] Add imx93-var-som support

2024-01-08 Thread Mathieu Othacehe


Hello,

> Please run a CI job for your series at https://github.com/u-boot/u-boot/pulls
>
> After it passes, then please submit a v6.

This issue was that we are expecting binman to keep working on the CI
even though the binary blobs are not present. I fixed that, had a green
Github build and submitted a v6.

Thanks,

Mathieu


[PATCH v6 4/4] Add imx93-var-som support

2024-01-08 Thread Mathieu Othacehe
From: Mathieu Othacehe 

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.

Signed-off-by: Mathieu Othacehe 
---
 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/imx93_var_som.c |  126 ++
 .../variscite/imx93_var_som/imx93_var_som.env |   99 ++
 .../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 +
 22 files changed, 3247 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/imx93_var_som.c
 create mode 100644 board/variscite/imx93_var_som/imx93_var_som.env
 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

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 9d28a485bec..b32b949f80c 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1124,7 +1124,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 \
diff --git a/arch/arm/dts/imx93-var-som-symphony-u-boot.dtsi 
b/arch/arm/dts/imx93-var-som-symphony-u-boot.dtsi
new file mode 100644
index 000..1193fc0ca19
--- /dev/null
+++ b/arch/arm/dts/imx93-var-som-symphony-u-boot.dtsi
@@ -0,0 +1,266 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2022 NXP
+ * Copyright 2023 Variscite Ltd.
+ */
+
+#include "imx93-u-boot.dtsi"
+
+/ {
+   wdt-reboot {
+   compatible = "wdt-reboot";
+   wdt = <>;
+   bootph-pre-ram;
+   bootph-some-ram;
+   };
+
+   aliases {
+   ethernet0 = 
+   ethernet1 = 
+   };
+
+   firmware {
+   optee {
+   compatible = "linaro,optee-tz";
+   method = "smc";
+   };
+   };
+};
+
+&{/soc@0} {
+   bootph-all;
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-all;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_usdhc2_vmmc {
+   u-boot,off-on-delay-us = <2>;
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_reg_usdhc2_vmmc {
+   bootph-pre-ram;
+};
+
+_uart1 {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_usdhc2 {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+   fsl,signal-voltage-switch-extra-delay-ms = <8>;
+};
+
+ {
+   reset-gpios = < 7 GPIO_ACTIV

[PATCH v6 3/4] imx9: imx93_evk: Add binman support.

2024-01-08 Thread Mathieu Othacehe
From: Mathieu Othacehe 

Signed-off-by: Mathieu Othacehe 
---
 arch/arm/dts/imx93-11x11-evk-u-boot.dtsi |  2 +
 arch/arm/mach-imx/imx9/Kconfig   |  1 +
 configs/imx93_11x11_evk_defconfig|  2 +
 configs/imx93_11x11_evk_ld_defconfig |  2 +
 doc/board/nxp/imx93_11x11_evk.rst| 68 
 doc/board/nxp/index.rst  |  1 +
 6 files changed, 76 insertions(+)
 create mode 100644 doc/board/nxp/imx93_11x11_evk.rst

diff --git a/arch/arm/dts/imx93-11x11-evk-u-boot.dtsi 
b/arch/arm/dts/imx93-11x11-evk-u-boot.dtsi
index a9dffa5a71e..eec1abcf287 100644
--- a/arch/arm/dts/imx93-11x11-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx93-11x11-evk-u-boot.dtsi
@@ -3,6 +3,8 @@
  * Copyright 2022 NXP
  */
 
+#include "imx93-u-boot.dtsi"
+
 / {
wdt-reboot {
compatible = "wdt-reboot";
diff --git a/arch/arm/mach-imx/imx9/Kconfig b/arch/arm/mach-imx/imx9/Kconfig
index c51f80f311a..7ba38355398 100644
--- a/arch/arm/mach-imx/imx9/Kconfig
+++ b/arch/arm/mach-imx/imx9/Kconfig
@@ -29,6 +29,7 @@ choice
 
 config TARGET_IMX93_11X11_EVK
bool "imx93_11x11_evk"
+select BINMAN
select IMX93
 
 endchoice
diff --git a/configs/imx93_11x11_evk_defconfig 
b/configs/imx93_11x11_evk_defconfig
index 9ced5ed0f65..46ddc52c122 100644
--- a/configs/imx93_11x11_evk_defconfig
+++ b/configs/imx93_11x11_evk_defconfig
@@ -8,6 +8,8 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_ENV_SIZE=0x4000
 CONFIG_ENV_OFFSET=0x70
+CONFIG_IMX_CONFIG="arch/arm/mach-imx/imx9/imximage.cfg"
+CONFIG_IMX_CONTAINER_CFG="arch/arm/mach-imx/imx9/container.cfg"
 CONFIG_DM_GPIO=y
 CONFIG_DEFAULT_DEVICE_TREE="imx93-11x11-evk"
 CONFIG_SPL_TEXT_BASE=0x2049A000
diff --git a/configs/imx93_11x11_evk_ld_defconfig 
b/configs/imx93_11x11_evk_ld_defconfig
index abd646b6855..20f83045fa0 100644
--- a/configs/imx93_11x11_evk_ld_defconfig
+++ b/configs/imx93_11x11_evk_ld_defconfig
@@ -8,6 +8,8 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_ENV_SIZE=0x4000
 CONFIG_ENV_OFFSET=0x40
+CONFIG_IMX_CONFIG="arch/arm/mach-imx/imx9/imximage.cfg"
+CONFIG_IMX_CONTAINER_CFG="arch/arm/mach-imx/imx9/container.cfg"
 CONFIG_DM_GPIO=y
 CONFIG_DEFAULT_DEVICE_TREE="imx93-11x11-evk"
 CONFIG_SPL_TEXT_BASE=0x2049A000
diff --git a/doc/board/nxp/imx93_11x11_evk.rst 
b/doc/board/nxp/imx93_11x11_evk.rst
new file mode 100644
index 000..fb0ecf8af58
--- /dev/null
+++ b/doc/board/nxp/imx93_11x11_evk.rst
@@ -0,0 +1,68 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+imx93_11x11_evk
+===
+
+U-Boot for the NXP i.MX93 EVK on the 11x11mm board
+
+Quick Start
+---
+
+- Get and Build the ARM Trusted firmware
+- Get the DDR firmware
+- Get ahab-container.img
+- Build U-Boot
+- Boot
+
+Get and Build the ARM Trusted firmware
+--
+
+Note: srctree is U-Boot source directory
+Get ATF from: https://github.com/nxp-imx/imx-atf/
+branch: lf_v2.8
+
+.. code-block:: bash
+
+   $ unset LDFLAGS
+   $ make PLAT=imx93 bl31
+   $ cp build/imx93/release/bl31.bin $(srctree)
+
+Get the DDR firmware
+
+
+.. code-block:: bash
+
+   $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.21.bin
+   $ chmod +x firmware-imx-8.21.bin
+   $ ./firmware-imx-8.21.bin
+   $ cp firmware-imx-8.21/firmware/ddr/synopsys/lpddr4*.bin $(srctree)
+
+Get ahab-container.img
+---
+
+.. code-block:: bash
+
+   $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-sentinel-0.10.bin
+   $ chmod +x firmware-sentinel-0.10.bin
+   $ ./firmware-sentinel-0.10.bin
+   $ cp firmware-sentinel-0.10/mx93a0-ahab-container.img $(srctree)
+
+Build U-Boot
+
+
+.. code-block:: bash
+
+   $ export CROSS_COMPILE=aarch64-poky-linux-
+   $ make imx93_11x11_evk_defconfig
+   $ make
+
+Burn the flash.bin to MicroSD card offset 32KB:
+
+.. code-block:: bash
+
+   $ dd if=flash.bin of=/dev/sd[x] bs=1024 seek=32 conv=notrunc
+
+Boot
+
+
+Set Boot switch to SD boot
diff --git a/doc/board/nxp/index.rst b/doc/board/nxp/index.rst
index 4514b8951ba..3bd9ed3c873 100644
--- a/doc/board/nxp/index.rst
+++ b/doc/board/nxp/index.rst
@@ -11,6 +11,7 @@ NXP Semiconductors
imx8mp_evk
imx8mq_evk
imx8qxp_mek
+   imx93_11x11_evk
imxrt1020-evk
imxrt1050-evk
ls1046ardb
-- 
2.41.0



[PATCH v6 2/4] mach-imx: Add i.MX93 binman support.

2024-01-08 Thread Mathieu Othacehe
From: Mathieu Othacehe 

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

Signed-off-by: Mathieu Othacehe 
---
 arch/arm/dts/imx93-u-boot.dtsi   | 88 
 arch/arm/mach-imx/Makefile   | 27 -
 arch/arm/mach-imx/imx9/container.cfg | 10 
 arch/arm/mach-imx/imx9/imximage.cfg  | 10 
 tools/imx9_image.sh  | 31 ++
 5 files changed, 165 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/imx93-u-boot.dtsi
 create mode 100644 arch/arm/mach-imx/imx9/container.cfg
 create mode 100644 arch/arm/mach-imx/imx9/imximage.cfg
 create mode 100755 tools/imx9_image.sh

diff --git a/arch/arm/dts/imx93-u-boot.dtsi b/arch/arm/dts/imx93-u-boot.dtsi
new file mode 100644
index 000..40e17bbc5ae
--- /dev/null
+++ b/arch/arm/dts/imx93-u-boot.dtsi
@@ -0,0 +1,88 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2023 Mathieu Othacehe 
+ */
+
+/ {
+   binman: binman {
+   multiple-images;
+   };
+};
+
+ {
+   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";
+   };
+   };
+};
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index a3b44c93e3d..ef0caed3f7f 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -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,29 @@ endif
 endif
 
 ifeq ($(CONFIG_ARCH_IMX9), y)
-SPL:
+
+quiet_cmd_imx9_check = CHECK$@
+cmd_imx9_check = $(srctree)/tools/imx9_image.sh $@
+
+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)
+   $(call if_changed,imx9_check)
+
+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)
+   $(call if_changed,imx9_check)
+
+flash.bin: spl/u-boot-spl-ddr.bin container.cfgout FORCE
+   $(call if_changed,mkimage)
 endif
 
 else
diff --git a/arch/arm/mach-imx/imx

[PATCH v6 1/4] spl: binman: Disable u_boot_any symbols for i.MX93 boards

2024-01-08 Thread Mathieu Othacehe
From: Mathieu Othacehe 

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

Signed-off-by: Mathieu Othacehe 
---
 common/spl/Kconfig | 2 +-
 common/spl/Kconfig.tpl | 2 +-
 common/spl/Kconfig.vpl | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index c521b02f4a3..c4a04fd9ffd 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -206,7 +206,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,
diff --git a/common/spl/Kconfig.tpl b/common/spl/Kconfig.tpl
index cc71578f646..4ee3b9b826d 100644
--- a/common/spl/Kconfig.tpl
+++ b/common/spl/Kconfig.tpl
@@ -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,
diff --git a/common/spl/Kconfig.vpl b/common/spl/Kconfig.vpl
index ae1a3c724f3..f1993026bba 100644
--- a/common/spl/Kconfig.vpl
+++ b/common/spl/Kconfig.vpl
@@ -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,
-- 
2.41.0



[PATCH v6 0/4] Add imx93-var-som support

2024-01-08 Thread Mathieu Othacehe
Hello,

This v6 fixes CI checks on IMX9 by allowing binman to keep working even though
some binary blobs are absent.

Thanks,

Mathieu

v5: https://lists.denx.de/pipermail/u-boot/2024-January/542579.html

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

 arch/arm/dts/Makefile |3 +-
 arch/arm/dts/imx93-11x11-evk-u-boot.dtsi  |2 +
 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|   27 +-
 arch/arm/mach-imx/imx9/Kconfig|8 +
 arch/arm/mach-imx/imx9/container.cfg  |   10 +
 arch/arm/mach-imx/imx9/imximage.cfg   |   10 +
 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/imx93_var_som.c |  126 ++
 .../variscite/imx93_var_som/imx93_var_som.env |   99 ++
 .../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_11x11_evk_defconfig |2 +
 configs/imx93_11x11_evk_ld_defconfig  |2 +
 configs/imx93_var_som_defconfig   |  156 ++
 doc/board/nxp/imx93_11x11_evk.rst |   68 +
 doc/board/nxp/index.rst   |1 +
 doc/board/variscite/imx93_var_som.rst |   68 +
 doc/board/variscite/index.rst |1 +
 include/configs/imx93_var_som.h   |   48 +
 tools/imx9_image.sh   |   31 +
 35 files changed, 3491 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 arch/arm/mach-imx/imx9/container.cfg
 create mode 100644 arch/arm/mach-imx/imx9/imximage.cfg
 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/imx93_var_som.c
 create mode 100644 board/variscite/imx93_var_som/imx93_var_som.env
 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/nxp/imx93_11x11_evk.rst
 create mode 100644 doc/board/variscite/imx93_var_som.rst
 create mode 100644 include/configs/imx93_var_som.h
 create mode 100755 tools/imx9_image.sh

-- 
2.41.0



[PATCH v5 4/4] Add imx93-var-som support

2024-01-04 Thread Mathieu Othacehe
From: Mathieu Othacehe 

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.

Signed-off-by: Mathieu Othacehe 
---
 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/imx93_var_som.c |  126 ++
 .../variscite/imx93_var_som/imx93_var_som.env |   99 ++
 .../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 +
 22 files changed, 3247 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/imx93_var_som.c
 create mode 100644 board/variscite/imx93_var_som/imx93_var_som.env
 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

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index e9e58c5478d..773c2546131 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -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 \
diff --git a/arch/arm/dts/imx93-var-som-symphony-u-boot.dtsi 
b/arch/arm/dts/imx93-var-som-symphony-u-boot.dtsi
new file mode 100644
index 000..1193fc0ca19
--- /dev/null
+++ b/arch/arm/dts/imx93-var-som-symphony-u-boot.dtsi
@@ -0,0 +1,266 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2022 NXP
+ * Copyright 2023 Variscite Ltd.
+ */
+
+#include "imx93-u-boot.dtsi"
+
+/ {
+   wdt-reboot {
+   compatible = "wdt-reboot";
+   wdt = <>;
+   bootph-pre-ram;
+   bootph-some-ram;
+   };
+
+   aliases {
+   ethernet0 = 
+   ethernet1 = 
+   };
+
+   firmware {
+   optee {
+   compatible = "linaro,optee-tz";
+   method = "smc";
+   };
+   };
+};
+
+&{/soc@0} {
+   bootph-all;
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-all;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_usdhc2_vmmc {
+   u-boot,off-on-delay-us = <2>;
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_reg_usdhc2_vmmc {
+   bootph-pre-ram;
+};
+
+_uart1 {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_usdhc2 {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+   fsl,signal-voltage-switch-extra-delay-ms = <8>;
+};
+
+ {
+   reset-gpios = < 7 GPIO_ACTIV

[PATCH v5 3/4] imx9: imx93_evk: Add binman support.

2024-01-04 Thread Mathieu Othacehe
From: Mathieu Othacehe 

Signed-off-by: Mathieu Othacehe 
---
 arch/arm/dts/imx93-11x11-evk-u-boot.dtsi |  2 +
 arch/arm/mach-imx/imx9/Kconfig   |  1 +
 configs/imx93_11x11_evk_defconfig|  2 +
 configs/imx93_11x11_evk_ld_defconfig |  2 +
 doc/board/nxp/imx93_11x11_evk.rst| 68 
 doc/board/nxp/index.rst  |  1 +
 6 files changed, 76 insertions(+)
 create mode 100644 doc/board/nxp/imx93_11x11_evk.rst

diff --git a/arch/arm/dts/imx93-11x11-evk-u-boot.dtsi 
b/arch/arm/dts/imx93-11x11-evk-u-boot.dtsi
index 4ecb53ed8be..a99ba99bfb4 100644
--- a/arch/arm/dts/imx93-11x11-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx93-11x11-evk-u-boot.dtsi
@@ -3,6 +3,8 @@
  * Copyright 2022 NXP
  */
 
+#include "imx93-u-boot.dtsi"
+
 / {
wdt-reboot {
compatible = "wdt-reboot";
diff --git a/arch/arm/mach-imx/imx9/Kconfig b/arch/arm/mach-imx/imx9/Kconfig
index c51f80f311a..7ba38355398 100644
--- a/arch/arm/mach-imx/imx9/Kconfig
+++ b/arch/arm/mach-imx/imx9/Kconfig
@@ -29,6 +29,7 @@ choice
 
 config TARGET_IMX93_11X11_EVK
bool "imx93_11x11_evk"
+select BINMAN
select IMX93
 
 endchoice
diff --git a/configs/imx93_11x11_evk_defconfig 
b/configs/imx93_11x11_evk_defconfig
index 3c9b09eec7a..e53eea120d7 100644
--- a/configs/imx93_11x11_evk_defconfig
+++ b/configs/imx93_11x11_evk_defconfig
@@ -8,6 +8,8 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_ENV_SIZE=0x4000
 CONFIG_ENV_OFFSET=0x70
+CONFIG_IMX_CONFIG="arch/arm/mach-imx/imx9/imximage.cfg"
+CONFIG_IMX_CONTAINER_CFG="arch/arm/mach-imx/imx9/container.cfg"
 CONFIG_DM_GPIO=y
 CONFIG_DEFAULT_DEVICE_TREE="imx93-11x11-evk"
 CONFIG_SPL_TEXT_BASE=0x2049A000
diff --git a/configs/imx93_11x11_evk_ld_defconfig 
b/configs/imx93_11x11_evk_ld_defconfig
index 37aa1efa7fd..c24b722600c 100644
--- a/configs/imx93_11x11_evk_ld_defconfig
+++ b/configs/imx93_11x11_evk_ld_defconfig
@@ -8,6 +8,8 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_ENV_SIZE=0x4000
 CONFIG_ENV_OFFSET=0x40
+CONFIG_IMX_CONFIG="arch/arm/mach-imx/imx9/imximage.cfg"
+CONFIG_IMX_CONTAINER_CFG="arch/arm/mach-imx/imx9/container.cfg"
 CONFIG_DM_GPIO=y
 CONFIG_DEFAULT_DEVICE_TREE="imx93-11x11-evk"
 CONFIG_SPL_TEXT_BASE=0x2049A000
diff --git a/doc/board/nxp/imx93_11x11_evk.rst 
b/doc/board/nxp/imx93_11x11_evk.rst
new file mode 100644
index 000..fb0ecf8af58
--- /dev/null
+++ b/doc/board/nxp/imx93_11x11_evk.rst
@@ -0,0 +1,68 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+imx93_11x11_evk
+===
+
+U-Boot for the NXP i.MX93 EVK on the 11x11mm board
+
+Quick Start
+---
+
+- Get and Build the ARM Trusted firmware
+- Get the DDR firmware
+- Get ahab-container.img
+- Build U-Boot
+- Boot
+
+Get and Build the ARM Trusted firmware
+--
+
+Note: srctree is U-Boot source directory
+Get ATF from: https://github.com/nxp-imx/imx-atf/
+branch: lf_v2.8
+
+.. code-block:: bash
+
+   $ unset LDFLAGS
+   $ make PLAT=imx93 bl31
+   $ cp build/imx93/release/bl31.bin $(srctree)
+
+Get the DDR firmware
+
+
+.. code-block:: bash
+
+   $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.21.bin
+   $ chmod +x firmware-imx-8.21.bin
+   $ ./firmware-imx-8.21.bin
+   $ cp firmware-imx-8.21/firmware/ddr/synopsys/lpddr4*.bin $(srctree)
+
+Get ahab-container.img
+---
+
+.. code-block:: bash
+
+   $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-sentinel-0.10.bin
+   $ chmod +x firmware-sentinel-0.10.bin
+   $ ./firmware-sentinel-0.10.bin
+   $ cp firmware-sentinel-0.10/mx93a0-ahab-container.img $(srctree)
+
+Build U-Boot
+
+
+.. code-block:: bash
+
+   $ export CROSS_COMPILE=aarch64-poky-linux-
+   $ make imx93_11x11_evk_defconfig
+   $ make
+
+Burn the flash.bin to MicroSD card offset 32KB:
+
+.. code-block:: bash
+
+   $ dd if=flash.bin of=/dev/sd[x] bs=1024 seek=32 conv=notrunc
+
+Boot
+
+
+Set Boot switch to SD boot
diff --git a/doc/board/nxp/index.rst b/doc/board/nxp/index.rst
index 4514b8951ba..3bd9ed3c873 100644
--- a/doc/board/nxp/index.rst
+++ b/doc/board/nxp/index.rst
@@ -11,6 +11,7 @@ NXP Semiconductors
imx8mp_evk
imx8mq_evk
imx8qxp_mek
+   imx93_11x11_evk
imxrt1020-evk
imxrt1050-evk
ls1046ardb
-- 
2.25.1



[PATCH v5 2/4] mach-imx: Add i.MX93 binman support.

2024-01-04 Thread Mathieu Othacehe
From: Mathieu Othacehe 

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

Signed-off-by: Mathieu Othacehe 
---
 arch/arm/dts/imx93-u-boot.dtsi   | 88 
 arch/arm/mach-imx/Makefile   | 22 ++-
 arch/arm/mach-imx/imx9/container.cfg | 10 
 arch/arm/mach-imx/imx9/imximage.cfg  | 10 
 4 files changed, 129 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/imx93-u-boot.dtsi
 create mode 100644 arch/arm/mach-imx/imx9/container.cfg
 create mode 100644 arch/arm/mach-imx/imx9/imximage.cfg

diff --git a/arch/arm/dts/imx93-u-boot.dtsi b/arch/arm/dts/imx93-u-boot.dtsi
new file mode 100644
index 000..40e17bbc5ae
--- /dev/null
+++ b/arch/arm/dts/imx93-u-boot.dtsi
@@ -0,0 +1,88 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2023 Mathieu Othacehe 
+ */
+
+/ {
+   binman: binman {
+   multiple-images;
+   };
+};
+
+ {
+   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";
+   };
+   };
+};
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index a3b44c93e3d..b87f44193c3 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -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
diff --git a/arch/arm/mach-imx/imx9/container.cfg 
b/arch/arm/mach-imx/imx9/container.cfg
new file mode 100644
index 000..f268bc9eb2c
--- /dev/null
+++ b/arch/arm/mach-imx/imx9/container.cfg
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2023 Mathieu Othaceh

[PATCH v5 1/4] spl: binman: Disable u_boot_any symbols for i.MX93 boards

2024-01-04 Thread Mathieu Othacehe
From: Mathieu Othacehe 

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

Signed-off-by: Mathieu Othacehe 
---
 common/spl/Kconfig | 2 +-
 common/spl/Kconfig.tpl | 2 +-
 common/spl/Kconfig.vpl | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index cf7ffc9b112..e7b84fc1fa6 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -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,
diff --git a/common/spl/Kconfig.tpl b/common/spl/Kconfig.tpl
index cc71578f646..4ee3b9b826d 100644
--- a/common/spl/Kconfig.tpl
+++ b/common/spl/Kconfig.tpl
@@ -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,
diff --git a/common/spl/Kconfig.vpl b/common/spl/Kconfig.vpl
index ae1a3c724f3..f1993026bba 100644
--- a/common/spl/Kconfig.vpl
+++ b/common/spl/Kconfig.vpl
@@ -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,
-- 
2.25.1



[PATCH v5 0/3] Add imx93-var-som support

2024-01-04 Thread Mathieu Othacehe
From: Mathieu Othacehe 

Hello,

This v5 fixes imx93_evk compilation by enabling binman support for this board.

Thanks,

Mathieu

v4: https://lists.denx.de/pipermail/u-boot/2024-January/542515.html

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

 arch/arm/dts/Makefile |3 +-
 arch/arm/dts/imx93-11x11-evk-u-boot.dtsi  |2 +
 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|8 +
 arch/arm/mach-imx/imx9/container.cfg  |   10 +
 arch/arm/mach-imx/imx9/imximage.cfg   |   10 +
 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/imx93_var_som.c |  126 ++
 .../variscite/imx93_var_som/imx93_var_som.env |   99 ++
 .../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_11x11_evk_defconfig |2 +
 configs/imx93_11x11_evk_ld_defconfig  |2 +
 configs/imx93_var_som_defconfig   |  156 ++
 doc/board/nxp/imx93_11x11_evk.rst |   68 +
 doc/board/nxp/index.rst   |1 +
 doc/board/variscite/imx93_var_som.rst |   68 +
 doc/board/variscite/index.rst |1 +
 include/configs/imx93_var_som.h   |   48 +
 34 files changed, 3455 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 arch/arm/mach-imx/imx9/container.cfg
 create mode 100644 arch/arm/mach-imx/imx9/imximage.cfg
 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/imx93_var_som.c
 create mode 100644 board/variscite/imx93_var_som/imx93_var_som.env
 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/nxp/imx93_11x11_evk.rst
 create mode 100644 doc/board/variscite/imx93_var_som.rst
 create mode 100644 include/configs/imx93_var_som.h

-- 
2.25.1



Re: [PATCH v4 0/3] Add imx93-var-som support

2024-01-04 Thread Mathieu Othacehe


Hello,

> 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


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

2024-01-04 Thread Mathieu Othacehe
From: Mathieu Othacehe 

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.

Signed-off-by: Mathieu Othacehe 
---
 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

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index e9e58c5478d..773c2546131 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -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 \
diff --git a/arch/arm/dts/imx93-var-som-symphony-u-boot.dtsi 
b/arch/arm/dts/imx93-var-som-symphony-u-boot.dtsi
new file mode 100644
index 000..1193fc0ca19
--- /dev/null
+++ b/arch/arm/dts/imx93-var-som-symphony-u-boot.dtsi
@@ -0,0 +1,266 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2022 NXP
+ * Copyright 2023 Variscite Ltd.
+ */
+
+#include "imx93-u-boot.dtsi"
+
+/ {
+   wdt-reboot {
+   compatible = "wdt-reboot";
+   wdt = <>;
+   bootph-pre-ram;
+   bootph-some-ram;
+   };
+
+   aliases {
+   ethernet0 = 
+   ethernet1 = 
+   };
+
+   firmware {
+   optee {
+   compatible = "linaro,optee-tz";
+   method = "smc";
+   };
+   };
+};
+
+&{/soc@0} {
+   bootph-all;
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-all;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_usdhc2_vmmc {
+   u-boot,off-on-delay-us = <2>;
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_reg_usdhc2_vmmc {
+   bootph-pre-ram;
+};
+
+_uart1 {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+_usdhc2 {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-some-ram;
+};
+
+ {
+   bootph-pre-ram;
+

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

2024-01-04 Thread Mathieu Othacehe
From: Mathieu Othacehe 

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

Reviewed-by: Fabio Estevam 
Signed-off-by: Mathieu Othacehe 
---
 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

diff --git a/arch/arm/dts/imx93-u-boot.dtsi b/arch/arm/dts/imx93-u-boot.dtsi
new file mode 100644
index 000..40e17bbc5ae
--- /dev/null
+++ b/arch/arm/dts/imx93-u-boot.dtsi
@@ -0,0 +1,88 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2023 Mathieu Othacehe 
+ */
+
+/ {
+   binman: binman {
+   multiple-images;
+   };
+};
+
+ {
+   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";
+   };
+   };
+};
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index a3b44c93e3d..b87f44193c3 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -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
-- 
2.25.1



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

2024-01-04 Thread Mathieu Othacehe
From: Mathieu Othacehe 

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

Reviewed-by: Fabio Estevam 
Signed-off-by: Mathieu Othacehe 
---
 common/spl/Kconfig | 2 +-
 common/spl/Kconfig.tpl | 2 +-
 common/spl/Kconfig.vpl | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index cf7ffc9b112..e7b84fc1fa6 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -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,
diff --git a/common/spl/Kconfig.tpl b/common/spl/Kconfig.tpl
index cc71578f646..4ee3b9b826d 100644
--- a/common/spl/Kconfig.tpl
+++ b/common/spl/Kconfig.tpl
@@ -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,
diff --git a/common/spl/Kconfig.vpl b/common/spl/Kconfig.vpl
index ae1a3c724f3..f1993026bba 100644
--- a/common/spl/Kconfig.vpl
+++ b/common/spl/Kconfig.vpl
@@ -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,
-- 
2.25.1



[PATCH v4 0/3] Add imx93-var-som support

2024-01-04 Thread Mathieu Othacehe
From: Mathieu Othacehe 

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

-- 
2.25.1



Re: [PATCH v3 3/3] Add imx93-var-som support

2024-01-04 Thread Mathieu Othacehe


Hello Fabio,

> I applied this patch against U-Boot's next branch.
>
> I had to manually add:

I was testing on 2023.10. I rebased the series on `next` on my side. I
had to do something similar to fb2bdc4efcb in order to fix booting.

> $ git am ~/Downloads/Add-imx93-var-som-support.patch
> Applying: spl: binman: Disable u_boot_any symbols for i.MX93 boards
> Applying: mach-imx: Add i.MX93 binman support.
> Applying: Add imx93-var-som support
> .git/rebase-apply/patch:3025: new blank line at EOF.
> +
> warning: 1 line adds whitespace errors.

Fixed.

>> +#include "imx93-u-boot.dtsi"
>
> This file should be included by default. No need to manually include it.

I am not sure why but without this include, I have the following
warning:

binman: Device tree 'u-boot.dtb' does not have a 'binman' node

which seem to indicate that this include is needed.

> Not needed to be done in this series, but in the future, it would be
> nice to convert this wdog driver to DM.

Noted.

I will send a v4 that should take all remarks into account.

Thanks,

Mathieu


[PATCH v3 3/3] Add imx93-var-som support

2023-12-29 Thread Mathieu Othacehe
From: Mathieu Othacehe 

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.

Signed-off-by: Mathieu Othacehe 
---
 arch/arm/dts/Makefile |3 +-
 .../dts/imx93-var-som-symphony-u-boot.dtsi|  253 +++
 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  |   59 +
 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 |  104 ++
 board/variscite/imx93_var_som/imximage.cfg|   10 +
 .../variscite/imx93_var_som/lpddr4x_timing.c  | 1489 +
 board/variscite/imx93_var_som/spl.c   |  144 ++
 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, 3262 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

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 85fd5b1157b..e6b604a2232 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1057,7 +1057,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 \
diff --git a/arch/arm/dts/imx93-var-som-symphony-u-boot.dtsi 
b/arch/arm/dts/imx93-var-som-symphony-u-boot.dtsi
new file mode 100644
index 000..e98bafd461a
--- /dev/null
+++ b/arch/arm/dts/imx93-var-som-symphony-u-boot.dtsi
@@ -0,0 +1,253 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2022 NXP
+ * Copyright 2023 Variscite Ltd.
+ */
+
+#include "imx93-u-boot.dtsi"
+
+/ {
+   wdt-reboot {
+   compatible = "wdt-reboot";
+   wdt = <>;
+   bootph-pre-ram;
+   };
+
+   aliases {
+   ethernet0 = 
+   ethernet1 = 
+   };
+
+   firmware {
+   optee {
+   compatible = "linaro,optee-tz";
+   method = "smc";
+   };
+   };
+};
+
+&{/soc@0} {
+   bootph-all;
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-all;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+_usdhc2_vmmc {
+   u-boot,off-on-delay-us = <2>;
+   bootph-pre-ram;
+};
+
+_reg_usdhc2_vmmc {
+   bootph-pre-ram;
+};
+
+_uart1 {
+   bootph-pre-ram;
+};
+
+_usdhc2 {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+   fsl,signal-voltage-switch-extra-delay-ms = <8>;
+};
+
+ {
+   compatible = "fsl,imx-eqos";
+};
+
+ {
+   reset-gpios = < 7 GPIO_ACTIVE_LOW>;
+   reset-assert-us = <15000>;
+

[PATCH v3 2/3] mach-imx: Add i.MX93 binman support.

2023-12-29 Thread Mathieu Othacehe
From: Mathieu Othacehe 

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

Signed-off-by: Mathieu Othacehe 
---
 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

diff --git a/arch/arm/dts/imx93-u-boot.dtsi b/arch/arm/dts/imx93-u-boot.dtsi
new file mode 100644
index 000..40e17bbc5ae
--- /dev/null
+++ b/arch/arm/dts/imx93-u-boot.dtsi
@@ -0,0 +1,88 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2023 Mathieu Othacehe 
+ */
+
+/ {
+   binman: binman {
+   multiple-images;
+   };
+};
+
+ {
+   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";
+   };
+   };
+};
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index aebfa6517bd..2a16f9b9dfc 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -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
@@ -211,7 +214,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
-- 
2.25.1



[PATCH v3 1/3] spl: binman: Disable u_boot_any symbols for i.MX93 boards

2023-12-29 Thread Mathieu Othacehe
From: Mathieu Othacehe 

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

Signed-off-by: Mathieu Othacehe 
---
 common/spl/Kconfig | 2 +-
 common/spl/Kconfig.tpl | 2 +-
 common/spl/Kconfig.vpl | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index c5dd476db58..322e6fe882f 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -206,7 +206,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,
diff --git a/common/spl/Kconfig.tpl b/common/spl/Kconfig.tpl
index 3d6cf1e59f3..9bb57e6fbff 100644
--- a/common/spl/Kconfig.tpl
+++ b/common/spl/Kconfig.tpl
@@ -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,
diff --git a/common/spl/Kconfig.vpl b/common/spl/Kconfig.vpl
index ae1a3c724f3..f1993026bba 100644
--- a/common/spl/Kconfig.vpl
+++ b/common/spl/Kconfig.vpl
@@ -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,
-- 
2.25.1



[PATCH v3 0/3] Add imx93-var-som support

2023-12-29 Thread Mathieu Othacehe
From: Mathieu Othacehe 

Hello,

This v3 adds support for binman and documents how to build and flash a
bootloader for the i.MX93 Variscite Symphony evaluation board.

Thanks,

Mathieu

v2: https://lists.denx.de/pipermail/u-boot/2023-December/542001.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|  253 +++
 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  |   59 +
 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 |  104 ++
 board/variscite/imx93_var_som/imximage.cfg|   10 +
 .../variscite/imx93_var_som/lpddr4x_timing.c  | 1489 +
 board/variscite/imx93_var_som/spl.c   |  144 ++
 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, 3374 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

-- 
2.25.1



[PATCH v2] Add imx93-var-som support

2023-12-28 Thread Mathieu Othacehe
From: Mathieu Othacehe 

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.

Signed-off-by: Mathieu Othacehe 
---
v1: https://lists.denx.de/pipermail/u-boot/2023-December/539825.html

Changes in v2:
- Use the device-trees that have been proposed here:
  
https://lore.kernel.org/linux-devicetree/20231227170919.8771-1-othac...@gnu.org/T/#t
- Add a MAINTAINERS file
- Remove the EXTCON_PTN5150 driver
- Use an env file
- Remove useless defines from imx93_var_som.h.

 arch/arm/dts/Makefile |3 +-
 .../dts/imx93-var-som-symphony-u-boot.dtsi|  251 +++
 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|6 +
 board/variscite/common/eth.c  |   59 +
 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|   18 +
 board/variscite/imx93_var_som/imx93_var_som.c |  126 ++
 .../variscite/imx93_var_som/imx93_var_som.env |  104 ++
 .../variscite/imx93_var_som/lpddr4x_timing.c  | 1489 +
 board/variscite/imx93_var_som/spl.c   |  144 ++
 configs/imx93_var_som_defconfig   |  156 ++
 include/configs/imx93_var_som.h   |   48 +
 20 files changed, 3171 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/imx93_var_som.c
 create mode 100644 board/variscite/imx93_var_som/imx93_var_som.env
 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 include/configs/imx93_var_som.h

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 9d28a485bec..b32b949f80c 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1124,7 +1124,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 \
diff --git a/arch/arm/dts/imx93-var-som-symphony-u-boot.dtsi 
b/arch/arm/dts/imx93-var-som-symphony-u-boot.dtsi
new file mode 100644
index 000..4612a1bfd26
--- /dev/null
+++ b/arch/arm/dts/imx93-var-som-symphony-u-boot.dtsi
@@ -0,0 +1,251 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2022 NXP
+ * Copyright 2023 Variscite Ltd.
+ */
+
+/ {
+   wdt-reboot {
+   compatible = "wdt-reboot";
+   wdt = <>;
+   bootph-pre-ram;
+   };
+
+   aliases {
+   ethernet0 = 
+   ethernet1 = 
+   };
+
+   firmware {
+   optee {
+   compatible = "linaro,optee-tz";
+   method = "smc";
+   };
+   };
+};
+
+&{/soc@0} {
+   bootph-all;
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-all;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+_usdhc2_vmmc {
+   u-boot,off-on-delay-us = <2>;
+   bootph-pre-ram;
+};
+
+_reg_usdhc2_vmmc {
+   bootph-pre-ram;
+};
+
+_uart1 {
+   bootph-pre-ram;
+};
+
+_usdhc2 {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+   fsl,signal-voltage-switch-extra-delay-ms = <8>;
+};
+
+ {
+   compatible = "fsl,imx-eqos";
+};
+
+ {
+   reset-gpios = < 7 GPIO_ACTIVE_LOW>;
+   reset-assert-us = <15000>;
+   reset-deassert-us = <10>;
+};
+
+ {
+   reset-gpios = < 5 GPIO_

Re: [PATCH] Add imx93-var-som support

2023-12-28 Thread Mathieu Othacehe


Hello Fabio,

Thanks for the review!

> It would also be helpful to add doc/board/variscite/imx93_var_som.rst
> that explains
> how to build U-Boot for this board, how to get the firmware, ATF,
> binaries, etc, and how to flash it to the boot medium.

For now, I am testing the bootloaders I produce using those
instructions:
https://variwiki.com/index.php?title=Yocto_Build_U-Boot=mx93-yocto-mickledore-6.1.36_2.1.0-v1.1

I understand that it would be nice to have u-boot do the image
construction with the firmware, ATF and so on, like implemented on
imx8.

Do you think that it could be done in a follow-up patch, once
imx93-var-som support is merged?

> Please also submit the imx93-var-som-symphony.dts support to Linux so that
> it can get reviewed by the DT folks.

Done here:
https://lore.kernel.org/linux-devicetree/20231227170919.8771-1-othac...@gnu.org/T/#t

> To not block the board support, I suggest sending a v2 without PTN5150
> support for now.

OK.

>> +/* Using ULP WDOG for reset */
>> +#define WDOG_BASE_ADDR  WDG3_BASE_ADDR
>
> Is this needed now that we use DM?

That specific define is needed as the ulp_wdog driver seems to require
it. I removed all the other unneeded defines in v2.

Thanks,

Mathieu


[PATCH] Add imx93-var-som support

2023-12-09 Thread Mathieu Othacehe
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.

Signed-off-by: Mathieu Othacehe 
---
 arch/arm/dts/Makefile |3 +-
 .../dts/imx93-var-som-symphony-u-boot.dtsi|  152 ++
 arch/arm/dts/imx93-var-som-symphony.dts   |  223 +++
 arch/arm/dts/imx93-var-som.dtsi   |  205 +++
 arch/arm/include/asm/arch-imx9/clock.h|1 +
 arch/arm/mach-imx/imx9/Kconfig|6 +
 board/variscite/common/Kconfig|6 +
 board/variscite/common/eth.c  |   59 +
 board/variscite/common/eth.h  |   12 +
 board/variscite/common/extcon-ptn5150.c   |  137 ++
 board/variscite/common/extcon-ptn5150.h   |   40 +
 board/variscite/common/imx9_eeprom.c  |  188 +++
 board/variscite/common/imx9_eeprom.h  |   83 +
 board/variscite/common/mmc.c  |   47 +
 board/variscite/imx93_var_som/Kconfig |   14 +
 board/variscite/imx93_var_som/Makefile|   18 +
 board/variscite/imx93_var_som/imx93_var_som.c |  147 ++
 .../variscite/imx93_var_som/lpddr4x_timing.c  | 1489 +
 board/variscite/imx93_var_som/spl.c   |  146 ++
 configs/imx93_var_som_defconfig   |  161 ++
 include/configs/imx93_var_som.h   |  175 ++
 21 files changed, 3311 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/Kconfig
 create mode 100644 board/variscite/common/eth.c
 create mode 100644 board/variscite/common/eth.h
 create mode 100644 board/variscite/common/extcon-ptn5150.c
 create mode 100644 board/variscite/common/extcon-ptn5150.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/Makefile
 create mode 100644 board/variscite/imx93_var_som/imx93_var_som.c
 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 include/configs/imx93_var_som.h

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 85fd5b1157b..e6b604a2232 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1057,7 +1057,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 \
diff --git a/arch/arm/dts/imx93-var-som-symphony-u-boot.dtsi 
b/arch/arm/dts/imx93-var-som-symphony-u-boot.dtsi
new file mode 100644
index 000..829aba89ebc
--- /dev/null
+++ b/arch/arm/dts/imx93-var-som-symphony-u-boot.dtsi
@@ -0,0 +1,152 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2022 NXP
+ * Copyright 2023 Variscite Ltd.
+ */
+
+/ {
+   wdt-reboot {
+   compatible = "wdt-reboot";
+   wdt = <>;
+   bootph-pre-ram;
+   };
+
+   aliases {
+   ethernet0 = 
+   ethernet1 = 
+   };
+
+   firmware {
+   optee {
+   compatible = "linaro,optee-tz";
+   method = "smc";
+   };
+   };
+};
+
+&{/soc@0} {
+   bootph-all;
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+   bootph-all;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+_usdhc2_vmmc {
+   u-boot,off-on-delay-us = <2>;
+   bootph-pre-ram;
+};
+
+_reg_usdhc2_vmmc {
+   bootph-pre-ram;
+};
+
+_uart1 {
+   bootph-pre-ram;
+};
+
+_usdhc2 {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+   fsl,signal-voltage-switch-extra-delay-ms = <8>;
+};
+
+ {
+   bootph-pre-ram;
+};
+
+&{/soc@0/bus@4200/i2c@4253/pmic@25} {
+   bootph-pre-ram;
+};
+
+&{/soc@0/bus@4200/i2c@4253/pmic@25/regulators} {
+   bootph-pre-ram;
+};
+
+_lpi2c3 {
+   bootph-pre-ram;
+};
+
+ {
+   compatible = "fsl,imx-eqos";
+};
+
+ {
+   reset-gpios = < 7 GPIO_ACTIVE_LOW>;
+   reset-assert-us = <15000>;
+   reset-deassert-us = <10>;
+};
+
+ {
+   reset-gpios = < 5 GPIO_ACTIVE_LOW>;
+   reset-assert-us = <15000