From 8fde50f702b92895f0a1ae5fa307199ab4ff0dbe Mon Sep 17 00:00:00 2001 From: Giulio Benetti Date: Tue, 28 Apr 2020 18:20:11 +0200 Subject: [PATCH 01/21] ARM: dts: imxrt1050: indent lcdif node correctly Accidentally submitted a patch with indentation not correct, let's fix it by indenting wrong lines. Signed-off-by: Giulio Benetti Acked-by: Peng Fan --- arch/arm/dts/imxrt1050.dtsi | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm/dts/imxrt1050.dtsi b/arch/arm/dts/imxrt1050.dtsi index 7cfe5f5c95c..a9281001e55 100644 --- a/arch/arm/dts/imxrt1050.dtsi +++ b/arch/arm/dts/imxrt1050.dtsi @@ -147,12 +147,12 @@ }; lcdif: lcdif@402b8000 { - compatible = "fsl,imxrt-lcdif"; - reg = <0x402b8000 0x10000>; - interrupts = ; - clocks = <&clks IMXRT1050_CLK_LCDIF>; - clock-names = "per"; - status = "disabled"; + compatible = "fsl,imxrt-lcdif"; + reg = <0x402b8000 0x4000>; + interrupts = ; + clocks = <&clks IMXRT1050_CLK_LCDIF>; + clock-names = "per"; + status = "disabled"; }; }; }; From f3e1c536a9d9b9940f02d0b4f24eb818e31398dc Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Tue, 5 May 2020 20:18:02 +0800 Subject: [PATCH 02/21] imx: Kconfig: enable IMX_BOOTAUX for i.MX8M i.MX8M could use imx bootaux to boot m4/m7 core, so let's add it to the dependency list. Signed-off-by: Peng Fan --- arch/arm/mach-imx/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index bed8cc7e886..6c3fedf665d 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig @@ -23,7 +23,7 @@ config IMX_RDC config IMX_BOOTAUX bool "Support boot auxiliary core" - depends on ARCH_MX7 || ARCH_MX6 || ARCH_VF610 + depends on ARCH_MX7 || ARCH_MX6 || ARCH_VF610 || ARCH_IMX8M help bootaux [addr] to boot auxiliary core. From 0e9c045b2b6a0409d650dd39265b4f6924a69832 Mon Sep 17 00:00:00 2001 From: Patrick Wildt Date: Fri, 8 May 2020 11:59:47 +0200 Subject: [PATCH 03/21] imx: move ATF to the back of the FIT to fix loading over yModem MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With yModem the FIT Image is only supplied once, so we can only seek forward in the yModem supplied image and never backwards. With the recent changes to the SPL mechanism, including loading U-Boot first, FDT after, then the loadables, we must also reorder the FIT image script to make sure that the loadables are last in the FIT image. Signed-off-by: Patrick Wildt Tested-by: Sébastien Szymanski --- arch/arm/mach-imx/mkimage_fit_atf.sh | 31 +++++++++++++++------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/arch/arm/mach-imx/mkimage_fit_atf.sh b/arch/arm/mach-imx/mkimage_fit_atf.sh index dd1ca5ad3fd..fe12b7bb4bd 100755 --- a/arch/arm/mach-imx/mkimage_fit_atf.sh +++ b/arch/arm/mach-imx/mkimage_fit_atf.sh @@ -62,6 +62,23 @@ cat << __HEADER_EOF compression = "none"; load = <$BL33_LOAD_ADDR>; }; +__HEADER_EOF + +cnt=1 +for dtname in $* +do + cat << __FDT_IMAGE_EOF + fdt@$cnt { + description = "$(basename $dtname .dtb)"; + data = /incbin/("$dtname"); + type = "flat_dt"; + compression = "none"; + }; +__FDT_IMAGE_EOF +cnt=$((cnt+1)) +done + +cat << __HEADER_EOF atf@1 { description = "ARM Trusted Firmware"; os = "arm-trusted-firmware"; @@ -88,20 +105,6 @@ cat << __HEADER_EOF __HEADER_EOF fi -cnt=1 -for dtname in $* -do - cat << __FDT_IMAGE_EOF - fdt@$cnt { - description = "$(basename $dtname .dtb)"; - data = /incbin/("$dtname"); - type = "flat_dt"; - compression = "none"; - }; -__FDT_IMAGE_EOF -cnt=$((cnt+1)) -done - cat << __CONF_HEADER_EOF }; configurations { From 9ccd30df609db2186fc27c107bb905a51197e221 Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Mon, 11 May 2020 09:45:51 -0300 Subject: [PATCH 04/21] imx8mp_evk: Add a README file Add a README file explaining the U-Boot build and SD card flash procedures. Signed-off-by: Fabio Estevam --- board/freescale/imx8mp_evk/README | 41 +++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 board/freescale/imx8mp_evk/README diff --git a/board/freescale/imx8mp_evk/README b/board/freescale/imx8mp_evk/README new file mode 100644 index 00000000000..7dd3a9352a5 --- /dev/null +++ b/board/freescale/imx8mp_evk/README @@ -0,0 +1,41 @@ +U-Boot for the NXP i.MX8MP EVK board + +Quick Start +=========== +- Build the ARM Trusted firmware binary +- Get the firmware-imx package +- Build U-Boot +- Boot + +Get and Build the ARM Trusted firmware +====================================== +Note: $(srctree) is the U-Boot source directory +Get ATF from: https://source.codeaurora.org/external/imx/imx-atf +branch: imx_5.4.3_2.0.0 +$ make PLAT=imx8mp bl31 +$ sudo cp build/imx8mp/release/bl31.bin $(srctree) + +Get the ddr firmware +==================== +$ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.7.bin +$ chmod +x firmware-imx-8.7.bin +$ ./firmware-imx-8.7 +$ sudo cp firmware-imx-8.7/firmware/ddr/synopsys/lpddr4_pmu_train_1d_dmem_201904.bin $(srctree)/lpddr4_pmu_train_1d_dmem.bin +$ sudo cp firmware-imx-8.7/firmware/ddr/synopsys/lpddr4_pmu_train_1d_imem_201904.bin $(srctree)/lpddr4_pmu_train_1d_imem.bin +$ sudo cp firmware-imx-8.7/firmware/ddr/synopsys/lpddr4_pmu_train_2d_dmem_201904.bin $(srctree)/lpddr4_pmu_train_2d_dmem.bin +$ sudo cp firmware-imx-8.7/firmware/ddr/synopsys/lpddr4_pmu_train_2d_imem_201904.bin $(srctree)/lpddr4_pmu_train_2d_imem.bin + +Build U-Boot +============ +$ export CROSS_COMPILE=aarch64-poky-linux- +$ make imx8mp_evk_defconfig +$ export ATF_LOAD_ADDR=0x960000 +$ make flash.bin + +Burn the flash.bin to the MicroSD card at offset 32KB +$sudo dd if=flash.bin of=/dev/sd[x] bs=1K seek=32; sync + +Boot +==== +Set Boot switch to SD boot +Use /dev/ttyUSB2 for U-Boot console From c5a015c32e46632b9d593402951feface11ca66b Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Mon, 11 May 2020 11:00:27 -0300 Subject: [PATCH 05/21] imx8mm_evk: Select the watchdog driver Currently the watchdog driver is not selected, which causes the following warnings in both SPL and U-Boot proper: U-Boot SPL 2020.07-rc1-00387-g67887903af (May 07 2020 - 23:49:27 -0300) Normal Boot WDT: Started without servicing (60s timeout) Trying to boot from MMC1 U-Boot 2020.07-rc1-00387-g67887903af (May 07 2020 - 23:49:27 -0300) CPU: Freescale i.MX8MMQ rev1.0 at 1200 MHz Reset cause: POR Model: FSL i.MX8MM EVK board DRAM: 2 GiB WDT: Started without servicing (60s timeout) .... System reboots after staying 60s in the U-Boot prompt. Fix this problem by enabling CONFIG_WATCHDOG so that watchdog can be properly serviced. Suggested-by: Marek Vasut Signed-off-by: Fabio Estevam --- configs/imx8mm_evk_defconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/configs/imx8mm_evk_defconfig b/configs/imx8mm_evk_defconfig index 9a72f46f276..e7abf6b07c1 100644 --- a/configs/imx8mm_evk_defconfig +++ b/configs/imx8mm_evk_defconfig @@ -85,5 +85,4 @@ CONFIG_SPL_SYSRESET=y CONFIG_SYSRESET_PSCI=y CONFIG_SYSRESET_WATCHDOG=y CONFIG_DM_THERMAL=y -# CONFIG_WATCHDOG is not set CONFIG_IMX_WATCHDOG=y From 010bd4718b9ef1cfe39f7be8ef4ee4c56d6b1edb Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Mon, 11 May 2020 11:00:28 -0300 Subject: [PATCH 06/21] imx8mn_ddr4_evk: Select the watchdog driver Currently watchdog driver is not selected, which causes system to reboot after staying 60s in the U-Boot prompt. Fix this problem by enabling CONFIG_WATCHDOG so that watchdog can be properly serviced. Signed-off-by: Fabio Estevam --- configs/imx8mn_ddr4_evk_defconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/configs/imx8mn_ddr4_evk_defconfig b/configs/imx8mn_ddr4_evk_defconfig index bc6014d73ae..7fd443f37ef 100644 --- a/configs/imx8mn_ddr4_evk_defconfig +++ b/configs/imx8mn_ddr4_evk_defconfig @@ -79,5 +79,4 @@ CONFIG_SPL_SYSRESET=y CONFIG_SYSRESET_PSCI=y CONFIG_SYSRESET_WATCHDOG=y CONFIG_DM_THERMAL=y -# CONFIG_WATCHDOG is not set CONFIG_IMX_WATCHDOG=y From 979d5e4bf674f7f676b9d116b526c7e422a2238e Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Mon, 11 May 2020 11:00:29 -0300 Subject: [PATCH 07/21] imx8mm_beacon: Select the watchdog driver Currently watchdog driver is not selected, which causes system to reboot after staying 60s in the U-Boot prompt. Fix this problem by enabling CONFIG_WATCHDOG so that watchdog can be properly serviced. Signed-off-by: Fabio Estevam Reviewed-by: Adam Ford --- configs/imx8mm_beacon_defconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/configs/imx8mm_beacon_defconfig b/configs/imx8mm_beacon_defconfig index b935d723606..a518963f487 100644 --- a/configs/imx8mm_beacon_defconfig +++ b/configs/imx8mm_beacon_defconfig @@ -100,5 +100,4 @@ CONFIG_SPL_SYSRESET=y CONFIG_SYSRESET_PSCI=y CONFIG_SYSRESET_WATCHDOG=y CONFIG_DM_THERMAL=y -# CONFIG_WATCHDOG is not set CONFIG_IMX_WATCHDOG=y From 51c0e493c2a97c51f5ee5b83c63d326bcf41cff4 Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Mon, 11 May 2020 11:00:30 -0300 Subject: [PATCH 08/21] imx8mp_evk: Select the watchdog driver Currently watchdog driver is not selected, which causes system to reboot after staying 60s in the U-Boot prompt. Fix this problem by enabling CONFIG_WATCHDOG so that watchdog can be properly serviced. Signed-off-by: Fabio Estevam --- configs/imx8mp_evk_defconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/configs/imx8mp_evk_defconfig b/configs/imx8mp_evk_defconfig index 44b2935f699..0693658365e 100644 --- a/configs/imx8mp_evk_defconfig +++ b/configs/imx8mp_evk_defconfig @@ -82,5 +82,4 @@ CONFIG_SYSRESET=y CONFIG_SPL_SYSRESET=y CONFIG_SYSRESET_PSCI=y CONFIG_SYSRESET_WATCHDOG=y -# CONFIG_WATCHDOG is not set CONFIG_IMX_WATCHDOG=y From 2c72bf21c66692cf0b9c305c27ac4a5218a4dd01 Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Mon, 11 May 2020 11:00:31 -0300 Subject: [PATCH 09/21] verdin-imx8mm: Select the watchdog driver Currently watchdog driver is not selected, which causes system to reboot after staying 60s in the U-Boot prompt. Fix this problem by enabling CONFIG_WATCHDOG so that watchdog can be properly serviced. Signed-off-by: Fabio Estevam Acked-by: Igor Opaniuk --- configs/verdin-imx8mm_defconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/configs/verdin-imx8mm_defconfig b/configs/verdin-imx8mm_defconfig index c68b299a959..f5b6e032514 100644 --- a/configs/verdin-imx8mm_defconfig +++ b/configs/verdin-imx8mm_defconfig @@ -99,5 +99,4 @@ CONFIG_SPL_SYSRESET=y CONFIG_SYSRESET_PSCI=y CONFIG_SYSRESET_WATCHDOG=y CONFIG_DM_THERMAL=y -# CONFIG_WATCHDOG is not set CONFIG_IMX_WATCHDOG=y From 1f63ee656698724bcdc4e711b4ccd267f6bf64ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Szymanski?= Date: Wed, 13 May 2020 16:02:28 +0200 Subject: [PATCH 10/21] imx: rom api: fix image offset computation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When not booting from FlexSPI, the offset computation is: offset = image_offset + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512 - 0x8000; When booting from SD card or eMMC user partition, image_offset is 0x8000. It is useless to add and remove 0x8000. When booting from other device, image_offset is 0 so this computation is wrong. Simplfy this computation to work on all booting devices. Signed-off-by: Sébastien Szymanski --- arch/arm/mach-imx/spl_imx_romapi.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/arm/mach-imx/spl_imx_romapi.c b/arch/arm/mach-imx/spl_imx_romapi.c index f588a5f5216..893b7d12a79 100644 --- a/arch/arm/mach-imx/spl_imx_romapi.c +++ b/arch/arm/mach-imx/spl_imx_romapi.c @@ -84,12 +84,7 @@ static int spl_romapi_load_image_seekable(struct spl_image_info *spl_image, printf("image offset 0x%x, pagesize 0x%x, ivt offset 0x%x\n", image_offset, pagesize, offset); - if (((rom_bt_dev >> 16) & 0xff) == BT_DEV_TYPE_FLEXSPINOR) - offset = CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512; - else - offset = image_offset + - CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512 - 0x8000; - + offset = CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512; size = ALIGN(sizeof(struct image_header), pagesize); ret = g_rom_api->download_image((u8 *)header, offset, size, ((uintptr_t)header) ^ offset ^ size); From c04b41b3299d7d82c4b991a200bef137d4991a85 Mon Sep 17 00:00:00 2001 From: Lukasz Majewski Date: Wed, 13 May 2020 17:45:15 +0200 Subject: [PATCH 11/21] imx: Update MTD partitions layout for display5 (i.MX6Q) board This change updates the MTD partition layout on SPI-NOR memory for display5 board. Signed-off-by: Lukasz Majewski --- configs/display5_defconfig | 2 +- configs/display5_factory_defconfig | 2 +- include/configs/display5.h | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/configs/display5_defconfig b/configs/display5_defconfig index 78e4627bdac..700bdcbd17a 100644 --- a/configs/display5_defconfig +++ b/configs/display5_defconfig @@ -71,7 +71,7 @@ CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y CONFIG_CMD_MTDPARTS=y CONFIG_MTDIDS_DEFAULT="nor0=02008000.spi.1" -CONFIG_MTDPARTS_DEFAULT="mtdparts=02008000.spi.1:128k(SPL),1m(u-boot),64k(env1),64k(env2),4m(swu-kernel),16m(swu-initramfs),1m(factory),-(reserved)" +CONFIG_MTDPARTS_DEFAULT="mtdparts=02008000.spi.1:128k(SPL),1m(u-boot),64k(env1),64k(env2),6m(swu-kernel),20m(swu-initramfs),3840k(reserved),1m(factory)" # CONFIG_SPL_EFI_PARTITION is not set CONFIG_OF_CONTROL=y CONFIG_DEFAULT_DEVICE_TREE="imx6q-display5" diff --git a/configs/display5_factory_defconfig b/configs/display5_factory_defconfig index d453073ddbc..39f31687b41 100644 --- a/configs/display5_factory_defconfig +++ b/configs/display5_factory_defconfig @@ -73,7 +73,7 @@ CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y CONFIG_CMD_MTDPARTS=y CONFIG_MTDIDS_DEFAULT="nor0=02008000.spi.1" -CONFIG_MTDPARTS_DEFAULT="mtdparts=02008000.spi.1:128k(SPL),1m(u-boot),64k(env1),64k(env2),4m(swu-kernel),16m(swu-initramfs),1m(factory),-(reserved)" +CONFIG_MTDPARTS_DEFAULT="mtdparts=02008000.spi.1:128k(SPL),1m(u-boot),64k(env1),64k(env2),6m(swu-kernel),20m(swu-initramfs),3840k(reserved),1m(factory)" # CONFIG_SPL_EFI_PARTITION is not set CONFIG_PARTITION_TYPE_GUID=y CONFIG_OF_CONTROL=y diff --git a/include/configs/display5.h b/include/configs/display5.h index 2e5dbfedc89..3348ecc7c7b 100644 --- a/include/configs/display5.h +++ b/include/configs/display5.h @@ -28,9 +28,10 @@ * 0x020000 - 0x120000 : SPI.u-boot (1MiB) * 0x120000 - 0x130000 : SPI.u-boot-env1 (64KiB) * 0x130000 - 0x140000 : SPI.u-boot-env2 (64KiB) - * 0x140000 - 0x540000 : SPI.swupdate-kernel-FIT (4MiB) - * 0x540000 - 0x1540000 : SPI.swupdate-initramfs (16MiB) - * 0x1540000 - 0x1640000 : SPI.factory (1MiB) + * 0x140000 - 0x740000 : SPI.swupdate-kernel-FIT (6MiB) + * 0x740000 - 0x1B40000 : SPI.swupdate-initramfs (20MiB) + * 0x1B40000 - 0x1F00000 : SPI.reserved (3840KiB) + * 0x1F00000 - 0x2000000 : SPI.factory (1MiB) */ /* SPI Flash Configs */ From 87f6e2f51e337623b1794e916d8b8eb654736c0d Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Tue, 26 May 2020 20:33:46 -0300 Subject: [PATCH 12/21] imx8mp_evk: spl: drop useless code Drop useless getting ccm device, there is no need to explicted do this in board code, and we not enable SPL CLK currently. Signed-off-by: Peng Fan Signed-off-by: Fabio Estevam --- board/freescale/imx8mp_evk/spl.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/board/freescale/imx8mp_evk/spl.c b/board/freescale/imx8mp_evk/spl.c index cd5b32c3f8c..f2cc1777577 100644 --- a/board/freescale/imx8mp_evk/spl.c +++ b/board/freescale/imx8mp_evk/spl.c @@ -29,11 +29,6 @@ #include #include -#include -#include -#include -#include - DECLARE_GLOBAL_DATA_PTR; int spl_board_boot_device(enum boot_device boot_dev_spl) @@ -48,16 +43,7 @@ void spl_dram_init(void) void spl_board_init(void) { - struct udevice *dev; - int ret; - puts("Normal Boot\n"); - - ret = uclass_get_device_by_name(UCLASS_CLK, - "clock-controller@30380000", - &dev); - if (ret < 0) - printf("Failed to find clock node. Check device tree\n"); } #define I2C_PAD_CTRL (PAD_CTL_DSE6 | PAD_CTL_HYS | PAD_CTL_PUE | PAD_CTL_PE) From ebdd07f5b2e4b00eee7f8630b3b026a65c3f51c4 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Tue, 26 May 2020 20:33:47 -0300 Subject: [PATCH 13/21] imx8mp_evk: spl: drop timer_init timer_init has been invoked in arch_cpu_init, no need to invoke it again in board code. Signed-off-by: Peng Fan Signed-off-by: Fabio Estevam --- board/freescale/imx8mp_evk/spl.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/board/freescale/imx8mp_evk/spl.c b/board/freescale/imx8mp_evk/spl.c index f2cc1777577..f45f935b934 100644 --- a/board/freescale/imx8mp_evk/spl.c +++ b/board/freescale/imx8mp_evk/spl.c @@ -114,8 +114,6 @@ void board_init_f(ulong dummy) board_early_init_f(); - timer_init(); - preloader_console_init(); /* Clear the BSS. */ From bdada3b14d554b029ec0406ca04cd54482c20d81 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Tue, 26 May 2020 20:33:48 -0300 Subject: [PATCH 14/21] imx8mp_evk: spl: use spl_early_init Use spl_early_init to replace spl_init, spl_init will be invoked in board_init_r, we only need use spl_early_init to setup malloc and scan early dt. Signed-off-by: Peng Fan Signed-off-by: Fabio Estevam --- board/freescale/imx8mp_evk/spl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/board/freescale/imx8mp_evk/spl.c b/board/freescale/imx8mp_evk/spl.c index f45f935b934..d4feb84d93e 100644 --- a/board/freescale/imx8mp_evk/spl.c +++ b/board/freescale/imx8mp_evk/spl.c @@ -114,17 +114,17 @@ void board_init_f(ulong dummy) board_early_init_f(); - preloader_console_init(); - - /* Clear the BSS. */ - memset(__bss_start, 0, __bss_end - __bss_start); - - ret = spl_init(); + ret = spl_early_init(); if (ret) { debug("spl_init() failed: %d\n", ret); hang(); } + preloader_console_init(); + + /* Clear the BSS. */ + memset(__bss_start, 0, __bss_end - __bss_start); + enable_tzc380(); setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1); From 0ec9d5bda93e0203405ffff134ce7b2d7fbda6aa Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Tue, 26 May 2020 20:33:49 -0300 Subject: [PATCH 15/21] imx8mp_evk: spl: no need the code since spl framework could do that We no need invoke the code, since spl framework could help us do that. Signed-off-by: Peng Fan Signed-off-by: Fabio Estevam --- board/freescale/imx8mp_evk/spl.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/board/freescale/imx8mp_evk/spl.c b/board/freescale/imx8mp_evk/spl.c index d4feb84d93e..3b3a854e29b 100644 --- a/board/freescale/imx8mp_evk/spl.c +++ b/board/freescale/imx8mp_evk/spl.c @@ -104,6 +104,7 @@ int board_fit_config_name_match(const char *name) } #endif +/* Do not use BSS area in this phase */ void board_init_f(ulong dummy) { int ret; @@ -122,9 +123,6 @@ void board_init_f(ulong dummy) preloader_console_init(); - /* Clear the BSS. */ - memset(__bss_start, 0, __bss_end - __bss_start); - enable_tzc380(); setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1); @@ -133,6 +131,4 @@ void board_init_f(ulong dummy) /* DDR initialization */ spl_dram_init(); - - board_init_r(NULL, 0); } From 28fff3fa1c7abb09888585252147e35496074880 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Tue, 26 May 2020 20:33:50 -0300 Subject: [PATCH 16/21] imx: imx8mp_evk: fix boot issue The u-boot-spl.bin pad with ddr firmware conflicts with the CONFIG_MALLOC_F_ADDR area, the ddr firmware will be overwritten by malloc in SPL stage and cause ddr initialization not able to finish. So update the related addresses to fix the issue. Reported-by: Fabio Estevam Signed-off-by: Peng Fan Signed-off-by: Fabio Estevam --- configs/imx8mp_evk_defconfig | 3 ++- include/configs/imx8mp_evk.h | 12 +++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/configs/imx8mp_evk_defconfig b/configs/imx8mp_evk_defconfig index 0693658365e..17452b6214e 100644 --- a/configs/imx8mp_evk_defconfig +++ b/configs/imx8mp_evk_defconfig @@ -4,7 +4,8 @@ CONFIG_SYS_TEXT_BASE=0x40200000 CONFIG_SPL_GPIO_SUPPORT=y CONFIG_SPL_LIBCOMMON_SUPPORT=y CONFIG_SPL_LIBGENERIC_SUPPORT=y -CONFIG_SYS_MALLOC_F_LEN=0x10000 +CONFIG_SYS_MALLOC_F_LEN=0x8000 +CONFIG_SPL_SYS_MALLOC_SIMPLE=y CONFIG_ENV_SIZE=0x1000 CONFIG_ENV_OFFSET=0x400000 CONFIG_SYS_I2C_MXC_I2C1=y diff --git a/include/configs/imx8mp_evk.h b/include/configs/imx8mp_evk.h index b346154fb3f..7f38f21c09c 100644 --- a/include/configs/imx8mp_evk.h +++ b/include/configs/imx8mp_evk.h @@ -24,16 +24,14 @@ #ifdef CONFIG_SPL_BUILD /*#define CONFIG_ENABLE_DDR_TRAINING_DEBUG*/ #define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv8/u-boot-spl.lds" -#define CONFIG_SPL_STACK 0x990000 -#define CONFIG_SPL_BSS_START_ADDR 0x0095e000 -#define CONFIG_SPL_BSS_MAX_SIZE 0x2000 /* 8 KB */ -#define CONFIG_SYS_SPL_MALLOC_START 0x42200000 -#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K /* 512 KB */ +#define CONFIG_SPL_STACK 0x960000 +#define CONFIG_SPL_BSS_START_ADDR 0x0098FC00 +#define CONFIG_SPL_BSS_MAX_SIZE 0x400 /* 1 KB */ +#define CONFIG_SYS_SPL_MALLOC_START 0x42200000 +#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K /* 512 KB */ #define CONFIG_SYS_ICACHE_OFF #define CONFIG_SYS_DCACHE_OFF -#define CONFIG_MALLOC_F_ADDR 0x940000 - #define CONFIG_SPL_ABORT_ON_RAW_IMAGE #undef CONFIG_DM_MMC From 661d9afe1429e28adcaacd277ab9f28e3790e93f Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Fri, 29 May 2020 19:22:41 +0200 Subject: [PATCH 17/21] power: pmic: Add SPL Kconfig entry for PFUZE100 Add Kconfig entry for the PFUZE PMIC, SPL variant. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Jaehoon Chung Cc: Peng Fan Cc: Stefano Babic Reviewed-by: Jaehoon Chung --- drivers/power/pmic/Kconfig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/power/pmic/Kconfig b/drivers/power/pmic/Kconfig index ef8bf49d495..a62aa38054c 100644 --- a/drivers/power/pmic/Kconfig +++ b/drivers/power/pmic/Kconfig @@ -105,6 +105,13 @@ config DM_PMIC_PFUZE100 This config enables implementation of driver-model pmic uclass features for PMIC PFUZE100. The driver implements read/write operations. +config SPL_DM_PMIC_PFUZE100 + bool "Enable Driver Model for PMIC PFUZE100 in SPL" + depends on DM_PMIC + ---help--- + This config enables implementation of driver-model pmic uclass features + for PMIC PFUZE100 in SPL. The driver implements read/write operations. + config DM_PMIC_MAX77686 bool "Enable Driver Model for PMIC MAX77686" depends on DM_PMIC From 0e06d63d195670f5181958f43216d7106c05357f Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sat, 30 May 2020 02:14:48 +0200 Subject: [PATCH 18/21] ARM: imx: ddr: Add missing PHY reset The iMX7D RM 9.2.4.9.3 Power removal flow Table 9-11. Re-enabling power explicitly says both the DDR controller and the PHY must be reset in the correct sequence. Currently the code only resets the controller. This leads to a misbehavior where the system brings the DRAM up after reboot, but the DRAM is unstable. Add the missing reset. The easiest way to trigger this is by triggering WDT without having the WDT assert WDOG_B signal, i.e. mw.w 0x30280000 0x25 . Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: NXP i.MX U-Boot Team Cc: Peng Fan Cc: Stefano Babic --- arch/arm/include/asm/arch-mx7/imx-regs.h | 1 + arch/arm/mach-imx/mx7/ddr.c | 22 +++++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/arch/arm/include/asm/arch-mx7/imx-regs.h b/arch/arm/include/asm/arch-mx7/imx-regs.h index 95238dcaa84..f37419c07f1 100644 --- a/arch/arm/include/asm/arch-mx7/imx-regs.h +++ b/arch/arm/include/asm/arch-mx7/imx-regs.h @@ -274,6 +274,7 @@ struct src { #define SRC_DDRC_RCR_DDRC_CORE_RST_OFFSET 1 #define SRC_DDRC_RCR_DDRC_CORE_RST_MASK (1 << 1) +#define SRC_DDRC_RCR_DDRC_PRST_MASK (1 << 0) /* GPR0 Bit Fields */ #define IOMUXC_GPR_GPR0_DMAREQ_MUX_SEL0_MASK 0x1u diff --git a/arch/arm/mach-imx/mx7/ddr.c b/arch/arm/mach-imx/mx7/ddr.c index 9713835bf27..d1e10a67887 100644 --- a/arch/arm/mach-imx/mx7/ddr.c +++ b/arch/arm/mach-imx/mx7/ddr.c @@ -13,6 +13,7 @@ #include #include #include +#include /* * Routine: mx7_dram_cfg @@ -37,8 +38,23 @@ void mx7_dram_cfg(struct ddrc *ddrc_regs_val, struct ddrc_mp *ddrc_mp_val, (struct iomuxc_gpr_base_regs *)IOMUXC_GPR_BASE_ADDR; int i; - /* Assert DDR Controller preset and DDR PHY reset */ - writel(SRC_DDRC_RCR_DDRC_CORE_RST_MASK, &src_regs->ddrc_rcr); + /* + * iMX7D RM 9.2.4.9.3 Power removal flow Table 9-11. Re-enabling power + * row 2 says "Reset controller / PHY by driving core_ddrc_rst = 0 , + * aresetn_n = 0, presetn = 0. That means reset everything. + */ + writel(SRC_DDRC_RCR_DDRC_CORE_RST_MASK | SRC_DDRC_RCR_DDRC_PRST_MASK, + &src_regs->ddrc_rcr); + + /* + * iMX7D RM 6.2.7.26 SRC_DDRC_RCR says wait 30 cycles (of unknown). + * If we assume this is 30 cycles at 100 MHz (about the rate of a + * DRAM bus), that's 300 nS, so waiting 10 uS is more then plenty. + */ + udelay(10); + + /* De-assert DDR Controller 'preset' and DDR PHY reset */ + clrbits_le32(&src_regs->ddrc_rcr, SRC_DDRC_RCR_DDRC_PRST_MASK); /* DDR controller configuration */ writel(ddrc_regs_val->mstr, &ddrc_regs->mstr); @@ -71,7 +87,7 @@ void mx7_dram_cfg(struct ddrc *ddrc_regs_val, struct ddrc_mp *ddrc_mp_val, writel(ddrc_regs_val->odtcfg, &ddrc_regs->odtcfg); writel(ddrc_regs_val->odtmap, &ddrc_regs->odtmap); - /* De-assert DDR Controller preset and DDR PHY reset */ + /* De-assert DDR Controller 'core_ddrc_rstn' and 'aresetn' */ clrbits_le32(&src_regs->ddrc_rcr, SRC_DDRC_RCR_DDRC_CORE_RST_MASK); /* PHY configuration */ From dae6cb8fb757fa13d9f894a67443a7ea7e93c6bc Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sat, 30 May 2020 22:44:45 +0200 Subject: [PATCH 19/21] ARM: imx: m53menlo: Do not fail boot on invalid splash screen None of these splash screen loading errors are so critical as to justify complete failure to boot, so just print error message as needed and return 0, the boot can very likely continue without the splash. Fix a couple of missing free(dst) instances as well. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: NXP i.MX U-Boot Team Cc: Peng Fan Cc: Stefano Babic --- board/menlo/m53menlo/m53menlo.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/board/menlo/m53menlo/m53menlo.c b/board/menlo/m53menlo/m53menlo.c index 58a564ac314..d4288a2c573 100644 --- a/board/menlo/m53menlo/m53menlo.c +++ b/board/menlo/m53menlo/m53menlo.c @@ -353,24 +353,28 @@ int board_late_init(void) ret = splash_screen_prepare(); if (ret < 0) - return ret; + goto splasherr; len = CONFIG_SYS_VIDEO_LOGO_MAX_SIZE; ret = gunzip(dst + 2, CONFIG_SYS_VIDEO_LOGO_MAX_SIZE - 2, (uchar *)addr, &len); if (ret) { printf("Error: no valid bmp or bmp.gz image at %lx\n", addr); - free(dst); - return ret; + goto splasherr; } ret = uclass_get_device(UCLASS_VIDEO, 0, &dev); if (ret) - return ret; + goto splasherr; ret = video_bmp_display(dev, (ulong)dst + 2, xpos, ypos, true); if (ret) - return ret; + goto splasherr; + + return 0; + +splasherr: + free(dst); #endif return 0; } From a13644c065173fad6bcaf163569bd01e6eb93834 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sat, 30 May 2020 22:44:46 +0200 Subject: [PATCH 20/21] ARM: dts: imx: m53menlo: Convert to DM_ETH Convert the board to DM_ETH instead of legacy networking. This requires a minor addition to the DT to satisfy the requirement for specifying a PHY node. No functional change from board user perspective. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: NXP i.MX U-Boot Team Cc: Peng Fan Cc: Stefano Babic --- arch/arm/dts/imx53-m53menlo.dts | 11 +++++++++++ configs/m53menlo_defconfig | 3 +++ 2 files changed, 14 insertions(+) diff --git a/arch/arm/dts/imx53-m53menlo.dts b/arch/arm/dts/imx53-m53menlo.dts index a6805eca9d0..3767dcaef4c 100644 --- a/arch/arm/dts/imx53-m53menlo.dts +++ b/arch/arm/dts/imx53-m53menlo.dts @@ -86,8 +86,19 @@ &fec { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_fec>; + phy-handle = <ðphy0>; phy-mode = "rmii"; status = "okay"; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + + ethphy0: ethernet-phy@0 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0>; + }; + }; }; &i2c1 { diff --git a/configs/m53menlo_defconfig b/configs/m53menlo_defconfig index a65c21a139e..52898996013 100644 --- a/configs/m53menlo_defconfig +++ b/configs/m53menlo_defconfig @@ -75,6 +75,9 @@ CONFIG_NAND_MXC=y CONFIG_PHYLIB=y CONFIG_PHY_MICREL=y CONFIG_PHY_MICREL_KSZ8XXX=y +CONFIG_DM_ETH=y +CONFIG_DM_MDIO=y +CONFIG_DM_ETH_PHY=y CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX5=y CONFIG_DM_REGULATOR=y From 385429680106f8612386e26564f69dccdd110620 Mon Sep 17 00:00:00 2001 From: Stefano Babic Date: Tue, 9 Jun 2020 11:19:55 +0200 Subject: [PATCH 21/21] Revert "imx: rom api: fix image offset computation" This reverts commit 1f63ee656698724bcdc4e711b4ccd267f6bf64ab. As reported by Ye Li on ML: 1. Removing the image_offset will break secondary (redundant) boot support for sd and emmc. 2. When booting from emmc boot partition, the image_offset is 0. But the flash.bin generated by mkimage with imximage-8mp-lpddr4.cfg is for sd. It expects to be burn at 32KB offset. The fit offset 0x60000 has already included the 32KB offset. So when you burn this flash.bin to emmc boot partition at offset 0, the fit offset should subtract the 32KB (0x60000 - 0x8000). Signed-off-by: Stefano Babic --- arch/arm/mach-imx/spl_imx_romapi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/spl_imx_romapi.c b/arch/arm/mach-imx/spl_imx_romapi.c index 893b7d12a79..f588a5f5216 100644 --- a/arch/arm/mach-imx/spl_imx_romapi.c +++ b/arch/arm/mach-imx/spl_imx_romapi.c @@ -84,7 +84,12 @@ static int spl_romapi_load_image_seekable(struct spl_image_info *spl_image, printf("image offset 0x%x, pagesize 0x%x, ivt offset 0x%x\n", image_offset, pagesize, offset); - offset = CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512; + if (((rom_bt_dev >> 16) & 0xff) == BT_DEV_TYPE_FLEXSPINOR) + offset = CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512; + else + offset = image_offset + + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512 - 0x8000; + size = ALIGN(sizeof(struct image_header), pagesize); ret = g_rom_api->download_image((u8 *)header, offset, size, ((uintptr_t)header) ^ offset ^ size);