From 0fa60e3c2a6dfe20da6cd4466c5cf3fb6149e26c Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 8 Feb 2024 18:33:50 +0100 Subject: [PATCH 1/5] ARM: imx: Let SPL configure ECSPI1 clock on Data Modul i.MX8M Plus eDM SBC The SPL clock code does configure the ECSPI clock frequency, which has to match the mxc-spi driver configuration for successful SPI NOR boot. Drop the assigned-clock from DT ecspi1 node on this board to let the SPL clock code do the configuration and keep it aligned with the driver expectation. Signed-off-by: Marek Vasut Reviewed-by: Fabio Estevam --- arch/arm/dts/imx8mp-data-modul-edm-sbc-u-boot.dtsi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/dts/imx8mp-data-modul-edm-sbc-u-boot.dtsi b/arch/arm/dts/imx8mp-data-modul-edm-sbc-u-boot.dtsi index cb6ea356fd7..805b5f57955 100644 --- a/arch/arm/dts/imx8mp-data-modul-edm-sbc-u-boot.dtsi +++ b/arch/arm/dts/imx8mp-data-modul-edm-sbc-u-boot.dtsi @@ -45,6 +45,9 @@ }; &ecspi1 { + /delete-property/ assigned-clocks; + /delete-property/ assigned-clock-rates; + /delete-property/ assigned-clock-parents; bootph-pre-ram; flash@0 { bootph-pre-ram; From 05d3602737769765ff0c1e71914d521bddedfb2c Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Fri, 9 Feb 2024 00:59:50 +0100 Subject: [PATCH 2/5] spi: mxc_spi: Add imx6ul-ecspi compatible string Recent i.MX8MP DTs use new fsl,imx6ul-ecspi compatible string instead of the fsl,imx51-ecspi compatible string. Add the new compatible string to fix ECSPI operation on i.MX8MP. For details, see Linux: 48d74376fb68 ("arm64: dts: imx8mp: update ecspi compatible and clk") 8eb1252bbedf ("spi: imx: remove ERR009165 workaround on i.mx6ul") Fixes: 451799a6ceac ("arm: dts: imx8mp: Sync the DT with kernel 6.4-rc4") Reviewed-by: Fabio Estevam Signed-off-by: Marek Vasut --- drivers/spi/mxc_spi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c index 33360a18329..e291092c481 100644 --- a/drivers/spi/mxc_spi.c +++ b/drivers/spi/mxc_spi.c @@ -670,6 +670,7 @@ static const struct dm_spi_ops mxc_spi_ops = { static const struct udevice_id mxc_spi_ids[] = { { .compatible = "fsl,imx51-ecspi" }, + { .compatible = "fsl,imx6ul-ecspi" }, { } }; From 2029a4c6be564887ba0860f1e91ea7d54b5675d5 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Fri, 9 Feb 2024 11:30:07 +0100 Subject: [PATCH 3/5] imx93: Use a header for imx9_probe_mu declaration Put imx9_probe_mu declaration in a new mu.h header file. Signed-off-by: Mathieu Othacehe Reviewed-by: Igor Opaniuk --- 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 00000000000..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; From db783ee982e946ce27c63761b848d9ffa503455d Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Fri, 9 Feb 2024 11:30:08 +0100 Subject: [PATCH 4/5] board: imx93_var_som: Probe ELE MU 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); From fcd377ed6480643b1f79188c7a8fb9280a211b4f Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Fri, 9 Feb 2024 11:30:09 +0100 Subject: [PATCH 5/5] configs: imx93_var_som: Enable AHAB support 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