Re: [PATCH v4 1/2] imx: imxrt1050-evk: Add support for SPI flash booting
On Tue, Feb 20, 2024 at 2:20 PM Fabio Estevam wrote: > Please fix both issues and submit a v5. I have fixed these issues myself and applied it, thanks.
Re: [PATCH v4 1/2] imx: imxrt1050-evk: Add support for SPI flash booting
On Mon, Feb 19, 2024 at 11:50 PM Jesse T wrote: > Huh, this is very interesting and I haven't noticed before. > When sending git send-email lowercases my email. > It seems like all my commits are like this. > Do you want this fixed? Please fix both issues and submit a v5.
Re: [PATCH v4 1/2] imx: imxrt1050-evk: Add support for SPI flash booting
Hi Jesse On 20/02/24 04:30, Jesse Taube wrote: Add support for booting the imxrt1050-evk from spi. Add imximage config and the ability for SPL to boot from NOR. Enable binman in Kconfig and device tree for imxrt* as it is used to prepend fspi_header.bin to SPL and u-boot.img. Signed-off-by: Jesse Taube --- V1 -> V2: - Add defconfig to MAINTAINERS - Change Copyright of imximage-nor.cfg to myself - Fix spelling and grammar - Use imperative mood V2 -> V3: - Enabled binman for imxrt* V3 -> V4: - Mention binman in commit description - Squash enabled binman and this commit --- arch/arm/dts/imxrt1020-evk-u-boot.dtsi| 4 + arch/arm/dts/imxrt1050-evk-u-boot.dtsi| 31 ++ arch/arm/dts/imxrt1170-evk-u-boot.dtsi| 4 + arch/arm/mach-imx/imxrt/Kconfig | 1 + board/freescale/imxrt1050-evk/MAINTAINERS | 1 + .../freescale/imxrt1050-evk/imximage-nor.cfg | 42 board/freescale/imxrt1050-evk/imximage.cfg| 10 +- board/freescale/imxrt1050-evk/imxrt1050-evk.c | 7 +- configs/imxrt1050-evk_defconfig | 8 +- configs/imxrt1050-evk_fspi_defconfig | 100 ++ include/configs/imxrt1050-evk.h | 6 ++ 11 files changed, 208 insertions(+), 6 deletions(-) create mode 100644 board/freescale/imxrt1050-evk/imximage-nor.cfg create mode 100644 configs/imxrt1050-evk_fspi_defconfig diff --git a/arch/arm/dts/imxrt1020-evk-u-boot.dtsi b/arch/arm/dts/imxrt1020-evk-u-boot.dtsi index 46928c07e9..e246de0299 100644 --- a/arch/arm/dts/imxrt1020-evk-u-boot.dtsi +++ b/arch/arm/dts/imxrt1020-evk-u-boot.dtsi @@ -5,6 +5,10 @@ */ / { + binman: binman { + multiple-images; + }; + chosen { bootph-pre-ram; }; diff --git a/arch/arm/dts/imxrt1050-evk-u-boot.dtsi b/arch/arm/dts/imxrt1050-evk-u-boot.dtsi index a9095e736b..3f54411b7b 100644 --- a/arch/arm/dts/imxrt1050-evk-u-boot.dtsi +++ b/arch/arm/dts/imxrt1050-evk-u-boot.dtsi @@ -8,6 +8,10 @@ #include "imxrt1050-pinfunc.h" / { + binman: binman { + multiple-images; + }; + aliases { display0 = usbphy0 = @@ -113,6 +117,33 @@ }; }; + { +#ifdef CONFIG_FSPI_CONF_HEADER + imx-boot { + filename = "flash.bin"; + pad-byte = <0x00>; + + fspi_conf_block { + filename = CONFIG_FSPI_CONF_FILE; + type = "blob-ext"; + offset = <0x0>; + }; + + spl { + filename = "SPL"; + offset = <0x1000>; + type = "blob-ext"; + }; + + binman_uboot: uboot { + filename = "u-boot.img"; + offset = <0x1>; + type = "blob-ext"; + }; + }; +#endif +}; + { bootph-pre-ram; }; diff --git a/arch/arm/dts/imxrt1170-evk-u-boot.dtsi b/arch/arm/dts/imxrt1170-evk-u-boot.dtsi index f923a14301..6e892c1af7 100644 --- a/arch/arm/dts/imxrt1170-evk-u-boot.dtsi +++ b/arch/arm/dts/imxrt1170-evk-u-boot.dtsi @@ -6,6 +6,10 @@ */ / { + binman: binman { + multiple-images; + }; + chosen { bootph-pre-ram; }; diff --git a/arch/arm/mach-imx/imxrt/Kconfig b/arch/arm/mach-imx/imxrt/Kconfig index c1d6b09e77..f702f6 100644 --- a/arch/arm/mach-imx/imxrt/Kconfig +++ b/arch/arm/mach-imx/imxrt/Kconfig @@ -2,6 +2,7 @@ if ARCH_IMXRT config IMXRT bool + select BINMAN select SYS_FSL_ERRATUM_ESDHC135 config IMXRT1020 diff --git a/board/freescale/imxrt1050-evk/MAINTAINERS b/board/freescale/imxrt1050-evk/MAINTAINERS index a872855452..890825b39a 100644 --- a/board/freescale/imxrt1050-evk/MAINTAINERS +++ b/board/freescale/imxrt1050-evk/MAINTAINERS @@ -4,3 +4,4 @@ S: Maintained F:board/freescale/imxrt1050-evk F:include/configs/imxrt1050-evk.h F:configs/imxrt1050-evk_defconfig +F: configs/imxrt1050-evk_fspi_defconfig diff --git a/board/freescale/imxrt1050-evk/imximage-nor.cfg b/board/freescale/imxrt1050-evk/imximage-nor.cfg new file mode 100644 index 00..3b80e1f178 --- /dev/null +++ b/board/freescale/imxrt1050-evk/imximage-nor.cfg @@ -0,0 +1,42 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2024 + * Author(s): Jesse Taube + */ + +#include + +/* image version */ + +IMAGE_VERSION 2 + +/* + * Boot Device : one of + * spi/sd/nand/onenand, qspi/nor + */ + +BOOT_FROM nor + +/* + * Device Configuration Data (DCD) + * + * Each entry must have the format: + * Addr-type AddressValue + * + * where: + * Addr-type register length (1,2 or 4 bytes) + * Address absolute address of the register + * value value to be stored in the register + */ + +/* + * 0x400AC044 is
Re: [PATCH v4 1/2] imx: imxrt1050-evk: Add support for SPI flash booting
On Mon, Feb 19, 2024 at 7:53 PM Fabio Estevam wrote: > > On Mon, Feb 19, 2024 at 8:01 PM Jesse Taube wrote: > > > > Add support for booting the imxrt1050-evk from spi. > > Add imximage config and the ability for SPL to boot from NOR. > > Enable binman in Kconfig and device tree for imxrt* as it is used to > > prepend fspi_header.bin to SPL and u-boot.img. > > > > Signed-off-by: Jesse Taube > > I see the following warning when applying this series: > > $ git am v4-1-2-imx-imxrt1050-evk-Add-support-for-SPI-flash-booting.patch > Applying: imx: imxrt1050-evk: Add support for SPI flash booting > .git/rebase-apply/patch:175: new blank line at EOF. > + > warning: 1 line adds whitespace errors. > Applying: imx: imxrt1050-evk: Add documentation for SPI boot > Sorry, I somehow added an extra line at the end of `board/freescale/imxrt1050-evk/imximage-nor.cfg`. Do you want a v5... or `sed -i -z 's/\n\n$/\n/' board/freescale/imxrt1050-evk/imximage-nor.cfg && git commit -a --amend --no-edit` > checkpatch also complains: > > CHECK: From:/Signed-off-by: email comments mismatch: 'From: Jesse > Taube ' != 'Signed-off-by: Jesse Taube > ' Huh, this is very interesting and I haven't noticed before. When sending git send-email lowercases my email. It seems like all my commits are like this. Do you want this fixed?
Re: [PATCH v4 1/2] imx: imxrt1050-evk: Add support for SPI flash booting
On Mon, Feb 19, 2024 at 8:01 PM Jesse Taube wrote: > > Add support for booting the imxrt1050-evk from spi. > Add imximage config and the ability for SPL to boot from NOR. > Enable binman in Kconfig and device tree for imxrt* as it is used to > prepend fspi_header.bin to SPL and u-boot.img. > > Signed-off-by: Jesse Taube I see the following warning when applying this series: $ git am v4-1-2-imx-imxrt1050-evk-Add-support-for-SPI-flash-booting.patch Applying: imx: imxrt1050-evk: Add support for SPI flash booting .git/rebase-apply/patch:175: new blank line at EOF. + warning: 1 line adds whitespace errors. Applying: imx: imxrt1050-evk: Add documentation for SPI boot checkpatch also complains: CHECK: From:/Signed-off-by: email comments mismatch: 'From: Jesse Taube ' != 'Signed-off-by: Jesse Taube '
[PATCH v4 1/2] imx: imxrt1050-evk: Add support for SPI flash booting
Add support for booting the imxrt1050-evk from spi. Add imximage config and the ability for SPL to boot from NOR. Enable binman in Kconfig and device tree for imxrt* as it is used to prepend fspi_header.bin to SPL and u-boot.img. Signed-off-by: Jesse Taube --- V1 -> V2: - Add defconfig to MAINTAINERS - Change Copyright of imximage-nor.cfg to myself - Fix spelling and grammar - Use imperative mood V2 -> V3: - Enabled binman for imxrt* V3 -> V4: - Mention binman in commit description - Squash enabled binman and this commit --- arch/arm/dts/imxrt1020-evk-u-boot.dtsi| 4 + arch/arm/dts/imxrt1050-evk-u-boot.dtsi| 31 ++ arch/arm/dts/imxrt1170-evk-u-boot.dtsi| 4 + arch/arm/mach-imx/imxrt/Kconfig | 1 + board/freescale/imxrt1050-evk/MAINTAINERS | 1 + .../freescale/imxrt1050-evk/imximage-nor.cfg | 42 board/freescale/imxrt1050-evk/imximage.cfg| 10 +- board/freescale/imxrt1050-evk/imxrt1050-evk.c | 7 +- configs/imxrt1050-evk_defconfig | 8 +- configs/imxrt1050-evk_fspi_defconfig | 100 ++ include/configs/imxrt1050-evk.h | 6 ++ 11 files changed, 208 insertions(+), 6 deletions(-) create mode 100644 board/freescale/imxrt1050-evk/imximage-nor.cfg create mode 100644 configs/imxrt1050-evk_fspi_defconfig diff --git a/arch/arm/dts/imxrt1020-evk-u-boot.dtsi b/arch/arm/dts/imxrt1020-evk-u-boot.dtsi index 46928c07e9..e246de0299 100644 --- a/arch/arm/dts/imxrt1020-evk-u-boot.dtsi +++ b/arch/arm/dts/imxrt1020-evk-u-boot.dtsi @@ -5,6 +5,10 @@ */ / { + binman: binman { + multiple-images; + }; + chosen { bootph-pre-ram; }; diff --git a/arch/arm/dts/imxrt1050-evk-u-boot.dtsi b/arch/arm/dts/imxrt1050-evk-u-boot.dtsi index a9095e736b..3f54411b7b 100644 --- a/arch/arm/dts/imxrt1050-evk-u-boot.dtsi +++ b/arch/arm/dts/imxrt1050-evk-u-boot.dtsi @@ -8,6 +8,10 @@ #include "imxrt1050-pinfunc.h" / { + binman: binman { + multiple-images; + }; + aliases { display0 = usbphy0 = @@ -113,6 +117,33 @@ }; }; + { +#ifdef CONFIG_FSPI_CONF_HEADER + imx-boot { + filename = "flash.bin"; + pad-byte = <0x00>; + + fspi_conf_block { + filename = CONFIG_FSPI_CONF_FILE; + type = "blob-ext"; + offset = <0x0>; + }; + + spl { + filename = "SPL"; + offset = <0x1000>; + type = "blob-ext"; + }; + + binman_uboot: uboot { + filename = "u-boot.img"; + offset = <0x1>; + type = "blob-ext"; + }; + }; +#endif +}; + { bootph-pre-ram; }; diff --git a/arch/arm/dts/imxrt1170-evk-u-boot.dtsi b/arch/arm/dts/imxrt1170-evk-u-boot.dtsi index f923a14301..6e892c1af7 100644 --- a/arch/arm/dts/imxrt1170-evk-u-boot.dtsi +++ b/arch/arm/dts/imxrt1170-evk-u-boot.dtsi @@ -6,6 +6,10 @@ */ / { + binman: binman { + multiple-images; + }; + chosen { bootph-pre-ram; }; diff --git a/arch/arm/mach-imx/imxrt/Kconfig b/arch/arm/mach-imx/imxrt/Kconfig index c1d6b09e77..f702f6 100644 --- a/arch/arm/mach-imx/imxrt/Kconfig +++ b/arch/arm/mach-imx/imxrt/Kconfig @@ -2,6 +2,7 @@ if ARCH_IMXRT config IMXRT bool + select BINMAN select SYS_FSL_ERRATUM_ESDHC135 config IMXRT1020 diff --git a/board/freescale/imxrt1050-evk/MAINTAINERS b/board/freescale/imxrt1050-evk/MAINTAINERS index a872855452..890825b39a 100644 --- a/board/freescale/imxrt1050-evk/MAINTAINERS +++ b/board/freescale/imxrt1050-evk/MAINTAINERS @@ -4,3 +4,4 @@ S: Maintained F: board/freescale/imxrt1050-evk F: include/configs/imxrt1050-evk.h F: configs/imxrt1050-evk_defconfig +F: configs/imxrt1050-evk_fspi_defconfig diff --git a/board/freescale/imxrt1050-evk/imximage-nor.cfg b/board/freescale/imxrt1050-evk/imximage-nor.cfg new file mode 100644 index 00..3b80e1f178 --- /dev/null +++ b/board/freescale/imxrt1050-evk/imximage-nor.cfg @@ -0,0 +1,42 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2024 + * Author(s): Jesse Taube + */ + +#include + +/* image version */ + +IMAGE_VERSION 2 + +/* + * Boot Device : one of + * spi/sd/nand/onenand, qspi/nor + */ + +BOOT_FROM nor + +/* + * Device Configuration Data (DCD) + * + * Each entry must have the format: + * Addr-type AddressValue + * + * where: + * Addr-type register length (1,2 or 4 bytes) + * Address absolute address of the register + * value value to be stored in the register + */ + +/* + * 0x400AC044 is used to configure the flexram. + * Unfortunately setting all to OCRAM only works for MMC + *