Support SPL for i.MX7ULP
Subsystems (3)
v4 cover Support SPL for i.MX7ULP
I've just realized this patch was not applied from the original patchset "Support SPL for i.MX7ULP".
Please apply this patch to fix the code as now "include/configs/mx7ulp_com.h" refers to non-existent "include/configs/imx7ulp_spl.h".
This supersedes the patchset
https://patchwork.ozlabs.org/project/uboot/list/?series=309021
Changes in v4:
- rebase to the current master
- fix a reference to a non-existent option SPL_MMC_SUPPORT
- add a small fix for imx spl.
Changes in v3:
- rebase the patch to the current codebase
Oleksandr Suvorov (1):
imx: spl: fix a comment adding IMX9
Ricardo Salveti (1):
mx7ulp: add base SPL support for mx7ulp
arch/arm/mach-imx/Makefile | 2 +- arch/arm/mach-imx/mx7ulp/soc.c | 2 +- arch/arm/mach-imx/spl.c | 6 ++++-- include/configs/imx7ulp_spl.h | 39 ++++++++++++++++++++++++++++++++++ 4 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 include/configs/imx7ulp_spl.h
Signature · 1 line
2.37.1
PATCH v4 1/2 mx7ulp: add base SPL support for mx7ulp
From: Ricardo Salveti <[email protected]>
Add a base implementation of mx7ulp SPL config header and soc, and changes in makefiles in order to allow building SPL on mx7ulp based devices.
---
Changes in v4:
- rebase to the current master
- fix a reference to a non-existent option SPL_MMC_SUPPORT
Changes in v3:
- rebase the patch to the current codebase
arch/arm/mach-imx/Makefile | 2 +- arch/arm/mach-imx/mx7ulp/soc.c | 2 +- arch/arm/mach-imx/spl.c | 6 ++++-- include/configs/imx7ulp_spl.h | 39 ++++++++++++++++++++++++++++++++++ 4 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 include/configs/imx7ulp_spl.h
arch/arm/mach-imx/Makefile +1 -1
@@ -29,7 +29,7 @@ endif obj-$(CONFIG_GPT_TIMER) += timer.o obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o endif -ifeq ($(SOC),$(filter $(SOC),mx7 mx6 mxs imx8m imx8 imx9 imxrt)) +ifeq ($(SOC),$(filter $(SOC),mx7 mx7ulp mx6 mxs imx8m imx8 imx9 imxrt)) obj-y += misc.o obj-$(CONFIG_CMD_PRIBLOB) += priblob.o obj-$(CONFIG_SPL_BUILD) += spl.o
arch/arm/mach-imx/mx7ulp/soc.c +1 -1
@@ -234,7 +234,7 @@ void s_init(void) }#endif -#ifndef CONFIG_ULP_WATCHDOG +#if !CONFIG_IS_ENABLED (ULP_WATCHDOG ) ||CONFIG_IS_ENABLED (SPL_BUILD )void reset_cpu (void ) {setbits_le32 (SIM0_RBASE ,SIM_SOPT1_A7_SW_RESET );
arch/arm/mach-imx/spl.c +4 -2
@@ -147,7 +147,7 @@ u32 spl_boot_device(void) return BOOT_DEVICE_NONE; } -#elif defined(CONFIG_MX7) || defined(CONFIG_IMX8M) || defined(CONFIG_IMX8) || defined(CONFIG_IMX9) +#elif defined(CONFIG_MX7) || defined(CONFIG_MX7ULP) || defined(CONFIG_IMX8M) || defined(CONFIG_IMX8) || defined(CONFIG_IMX9)/* Translate iMX7/i.MX8M boot device to the SPL boot device enumeration */ u32 spl_boot_device (void ) {
@@ -160,7 +160,9 @@ u32 spl_boot_device(void)*/ if (((bmode >>24 ) &0x03 ) ==0x01 )/* Serial Downloader */ return BOOT_DEVICE_BOARD ; +#endif +#if defined(CONFIG_MX7 ) || defined(CONFIG_MX7ULP )/* * The above method does not detect that the boot ROM used * serial downloader in case the boot ROM decided to use the
@@ -178,7 +180,7 @@ u32 spl_boot_device(void) return spl_board_boot_device(boot_device_spl); } -#endif /* CONFIG_MX7 || CONFIG_IMX8M || CONFIG_IMX8 */ +#endif /* CONFIG_MX7 || CONFIG_MX7ULP || CONFIG_IMX8M || CONFIG_IMX8 */ #ifdef CONFIG_SPL_USB_GADGET int g_dnl_bind_fixup (struct usb_device_descriptor *dev,const char *name)
include/configs/imx7ulp_spl.h new file +39 -0
@@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* SPL definitions for the i.MX7ULP SPL +* +* (C) Copyright 2019 Foundries.io +*/ + +#ifndef __IMX7ULP_SPL_CONFIG_H +#define __IMX7ULP_SPL_CONFIG_H + +#if CONFIG_IS_ENABLED (SPL ) +/* +* see figure 35-5 in i.MX 7ULP Reference manual: +* - IMX7ULP A7 OCRAM free area RAM is from 0x2F010000 to 0x2F03FF00. +* - Set the stack at the end of the free area section, at 0x2003FEB8. +* - The BOOT ROM loads what they consider the firmware image +* which consists of a 4K header in front of us that contains the IVT, DCD, +* and some padding thus 'our' max size is really 0x2F03FF00 - 0x2F011000. +* 187KB is more than enough for the SPL. +*/ +#define CONFIG_SPL_STACK 0x2F03FEB8 + +/* MMC support */ +#if CONFIG_IS_ENABLED (SPL_MMC ) +#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1 +#define CONFIG_SYS_MONITOR_LEN 409600/* 400 KB */ +#endif + +/* Define the payload for FAT/EXT support */ +#if CONFIG_IS_ENABLED (SPL_FS_FAT ) ||CONFIG_IS_ENABLED (SPL_FS_EXT4 ) +#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot-dtb.img" +#endif + +#define CONFIG_SYS_SPL_MALLOC_START 0x68300000 +#define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000/* 1 MB */ + +#endif /* CONFIG_SPL */ + +#endif /* __IMX7ULP_SPL_CONFIG_H */
Signature · 1 line
2.37.1
PATCH v4 2/2 imx: spl: fix a comment adding IMX9
There is a paired to ifdef comment which should include CONFIG_IMX9 as well.
---
Changes in v4:
- add a small fix for imx spl.
arch/arm/mach-imx/spl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-imx/spl.c +1 -1
@@ -180,7 +180,7 @@ u32 spl_boot_device(void) return spl_board_boot_device(boot_device_spl); } -#endif /* CONFIG_MX7 || CONFIG_MX7ULP || CONFIG_IMX8M || CONFIG_IMX8 */ +#endif /* CONFIG_MX7 || CONFIG_MX7ULP || CONFIG_IMX8M || CONFIG_IMX8 || CONFIG_IMX9 */ #ifdef CONFIG_SPL_USB_GADGET int g_dnl_bind_fixup (struct usb_device_descriptor *dev,const char *name)
Signature · 1 line
2.37.1
PATCH v4 2/2 imx: spl: fix a comment adding IMX9
Quoted 4 lines
There is a paired to ifdef comment which should include
CONFIG_IMX9as well.Fixes 881df6ed84c ("imx: add basic i.MX9 support")Signed-off-by Oleksandr Suvorov <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================
Re: [PATCH v4 1/2] mx7ulp: add base SPL support for mx7ulp
In reply to Oleksandr SuvorovHi Oleksandr, Ricardo,
Quoted 104 lines · Oleksandr Suvorov
From: Ricardo Salveti <[email protected]>
Add a base implementation of mx7ulp SPL config header and soc, and changes in makefiles in order to allow building SPL on mx7ulp based devices.
Signed-off-by Ricardo Salveti <[email protected]>Co-developed-by Oleksandr Suvorov <[email protected]>Signed-off-by Oleksandr Suvorov <[email protected]>---
Changes in v4:
- rebase to the current master
- fix a reference to a non-existent optionSPL_MMC_SUPPORTChanges in v3:
- rebase the patch to the current codebasearch/arm/mach-imx/Makefile | 2 +- arch/arm/mach-imx/mx7ulp/soc.c | 2 +- arch/arm/mach-imx/spl.c | 6 ++++-- include/configs/imx7ulp_spl.h | 39 ++++++++++++++++++++++++++++++++++ 4 files changed, 45 insertions(+), 4 deletions(-)create mode 100644
include/configs/imx7ulp_spl.harch/arm/mach-imx/Makefile +1
-1@@ -29,7 +29,7 @@ endif obj-$(CONFIG_GPT_TIMER) += timer.o obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o endif -ifeq ($(SOC),$(filter $(SOC),mx7 mx6 mxs imx8m imx8 imx9 imxrt)) +ifeq ($(SOC),$(filter $(SOC),mx7 mx7ulp mx6 mxs imx8m imx8 imx9 imxrt)) obj-y += misc.o obj-$(CONFIG_CMD_PRIBLOB) += priblob.o obj-$(CONFIG_SPL_BUILD) += spl.oarch/arm/mach-imx/mx7ulp/soc.c +1
-1@@ -234,7 +234,7 @@ void s_init(void) }#endif -#ifndef CONFIG_ULP_WATCHDOG +#if !CONFIG_IS_ENABLED (ULP_WATCHDOG ) ||CONFIG_IS_ENABLED (SPL_BUILD )void reset_cpu (void ) {setbits_le32 (SIM0_RBASE ,SIM_SOPT1_A7_SW_RESET );arch/arm/mach-imx/spl.c +4
-2@@ -147,7 +147,7 @@ u32 spl_boot_device(void) return BOOT_DEVICE_NONE; } -#elif defined(CONFIG_MX7) || defined(CONFIG_IMX8M) || defined(CONFIG_IMX8) || defined(CONFIG_IMX9) +#elif defined(CONFIG_MX7) || defined(CONFIG_MX7ULP) || defined(CONFIG_IMX8M) || defined(CONFIG_IMX8) || defined(CONFIG_IMX9)/* Translate iMX7/i.MX8M boot device to the SPL boot device enumeration */ u32 spl_boot_device (void ) {@@ -160,7 +160,9 @@ u32 spl_boot_device(void)*/ if (((bmode >>24 ) &0x03 ) ==0x01 )/* Serial Downloader */ return BOOT_DEVICE_BOARD ; +#endif +#if defined(CONFIG_MX7 ) || defined(CONFIG_MX7ULP )/* * The above method does not detect that the boot ROM used * serial downloader in case the boot ROM decided to use the @@ -178,7 +180,7 @@ u32 spl_boot_device(void) return spl_board_boot_device(boot_device_spl); } -#endif /* CONFIG_MX7 || CONFIG_IMX8M || CONFIG_IMX8 */ +#endif /* CONFIG_MX7 || CONFIG_MX7ULP || CONFIG_IMX8M || CONFIG_IMX8 */ #ifdef CONFIG_SPL_USB_GADGET int g_dnl_bind_fixup (struct usb_device_descriptor *dev,const char *name)include/configs/imx7ulp_spl.h new file +15
-0@@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* SPL definitions for the i.MX7ULP SPL +* +* (C) Copyright 2019 Foundries.io +*/ + +#ifndef __IMX7ULP_SPL_CONFIG_H +#define __IMX7ULP_SPL_CONFIG_H + +#if CONFIG_IS_ENABLED (SPL ) +/* +* see figure 35-5 in i.MX 7ULP Reference manual: +* - IMX7ULP A7 OCRAM free area RAM is from 0x2F010000 to 0x2F03FF00. +* - Set the stack at the end of the free area section, at 0x2003FEB8.
include/configs/imx7ulp_spl.h line 25
Quoted 10 lines
include/configs/imx7ulp_spl.h new file +10
-0+* - The BOOT ROM loads what they consider the firmware image +* which consists of a 4K header in front of us that contains the IVT, DCD, +* and some padding thus 'our' max size is really 0x2F03FF00 - 0x2F011000. +* 187KB is more than enough for the SPL. +*/ +#define CONFIG_SPL_STACK 0x2F03FEB8 + +/* MMC support */ +#if CONFIG_IS_ENABLED (SPL_MMC ) +#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
This should be in defconfig and it is not accepted anymore in header, it raises an error. See :
https://source.denx.de/u-boot/custodians/u-boot-imx/-/jobs/516648
Best regards,
Stefano
Quoted 14 lines
include/configs/imx7ulp_spl.h new file +14
-0+#define CONFIG_SYS_MONITOR_LEN 409600/* 400 KB */ +#endif + +/* Define the payload for FAT/EXT support */ +#if CONFIG_IS_ENABLED (SPL_FS_FAT ) ||CONFIG_IS_ENABLED (SPL_FS_EXT4 ) +#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot-dtb.img" +#endif + +#define CONFIG_SYS_SPL_MALLOC_START 0x68300000 +#define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000/* 1 MB */ + +#endif /* CONFIG_SPL */ + +#endif /* __IMX7ULP_SPL_CONFIG_H */
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================
PATCH v4 1/2 mx7ulp: add base SPL support for mx7ulp
In reply to Oleksandr SuvorovQuoted 7 lines
From: Ricardo Salveti <[email protected]>
Add a base implementation of mx7ulp SPL config header and soc, and changes in makefiles in order to allow building SPL on mx7ulp based devices.Signed-off-by Ricardo Salveti <[email protected]>Co-developed-by Oleksandr Suvorov <[email protected]>Signed-off-by Oleksandr Suvorov <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================