sunxi: SPL FIT support for 32-bit sunxi SoCs
Subsystems (3)
Samuel Holland
maintainerv3 cover sunxi: SPL FIT support for 32-bit sunxi SoCs
This series makes the necessary changes so 32-bit sunxi SoCs can load additional device trees or firmware from SPL along with U-Boot proper. Crust (SCP firmware) has support for A33 and H3, and H3 also needs to load an eGon blob to support CPU 0 hotplug (a silicon bug workaround).
FIT unlocks more features (signatures, multiple DTBs, etc.), so enable it by default. A10 (sun4i) only has 24 KiB of SRAM A1, so it needs SPL_FIT_IMAGE_TINY. For consistency, enable that option everywhere.
After this series is applied, we can increase SPL_MAX_SIZE for H6 and newer SoCs, both 32-bit (e.g. A50, T113) and 64-bit. I did not do that yet because there is some discussion to be had about the correct value:
it must be adjusted to guarantee return-to-FEL functionality, and the exact adjustment depends on the sunxi-fel tool implementation.
Changes in v3:
- Rebased and collected tags
Changes in v2:
- Disable padding from SPL_PAD_TO
- Rely on binman min-size instead of using explicit offsets
- Use Kconfig for firmware addresses instead of an #ifdef staircase
Samuel Holland (4):
sunxi: spl: Disable padding from SPL_PAD_TO
sunxi: binman: Move BL31 and SCP firmware addresses to Kconfig
sunxi: binman: Support FIT generation for 32-bit SoCs
sunxi: Enable SPL FIT loading for 32-bit SoCs
arch/arm/Kconfig | 1 + arch/arm/dts/sunxi-u-boot.dtsi | 39 ++++++++++++++++++---------------- arch/arm/mach-sunxi/Kconfig | 17 +++++++++++++++ common/spl/Kconfig | 6 ++---- 4 files changed, 41 insertions(+), 22 deletions(-)
Signature · 1 line
2.41.0
Samuel Holland
maintainerPATCH v3 1/4 sunxi: spl: Disable padding from SPL_PAD_TO
Starting with H6, Allwinner removed the artificial 32 KiB SPL size limit from the boot ROM. Now SPL size is only limited by the available SRAM. This limit ranges from 152 KiB on H6 to a whopping 2052 KiB on R329. To take advantage of this additional space, we must increase SPL_MAX_SIZE. Since we do not want to unnecessarily pad SPL out to these giant sizes, we must set SPL_PAD_TO to zero. This causes no problems because binman already takes care of appending the SPL payload at the right offset.
---
(no changes since v2)
Changes in v2:
- New patch for v2
common/spl/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
common/spl/Kconfig +1 -2
@@ -97,8 +97,7 @@ config SPL_PAD_TO default 0x31000 if ARCH_MX6 && MX6_OCRAM_256KB default 0x11000 if ARCH_MX7 || (ARCH_MX6 && !MX6_OCRAM_256KB) default 0x10000 if ARCH_KEYSTONE - default 0x8000 if ARCH_SUNXI && !MACH_SUN50I_H616 - default 0x0 if ARCH_MTMIPS + default 0x0 if ARCH_MTMIPS || ARCH_SUNXI default TPL_MAX_SIZE if TPL_MAX_SIZE > SPL_MAX_SIZE default SPL_MAX_SIZE help
Signature · 1 line
2.41.0
Re: [PATCH v3 1/4] sunxi: spl: Disable padding from SPL_PAD_TO
On Tue, 31 Oct 2023 00:17:38 -0500
Samuel Holland <[email protected]> wrote:
Hi Samuel,
Quoted 7 lines
Starting with H6, Allwinner removed the artificial 32 KiB SPL size limit from the boot ROM. Now SPL size is only limited by the available SRAM. This limit ranges from 152 KiB on H6 to a whopping 2052 KiB on R329. To take advantage of this additional space, we must increase
SPL_MAX_SIZE. Since we do not want to unnecessarily pad SPL out to these giant sizes, we must setSPL_PAD_TOto zero. This causes no problems because binman already takes care of appending the SPL payload at the right offset.
That looks alright now, back in v2023.04 (at time of v2) this still broke compilation, but this was fixed with your patch 9a4aa31ad514. I actually cannot see any effect on sunxi builds anymore, apart from the check in config_fallbacks.h, which is appeased with the value being set to 0 here. So:
Quoted 1 line
Signed-off-by Samuel Holland <[email protected]>
Cheers,
Andre
Quoted 24 lines
---
(no changes since v2)
Changes in v2:
- New patch for v2common/spl/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)common/spl/Kconfig +1
-2@@ -97,8 +97,7 @@ config SPL_PAD_TO default 0x31000 if ARCH_MX6 && MX6_OCRAM_256KB default 0x11000 if ARCH_MX7 || (ARCH_MX6 && !MX6_OCRAM_256KB) default 0x10000 if ARCH_KEYSTONE - default 0x8000 if ARCH_SUNXI && !MACH_SUN50I_H616 - default 0x0 if ARCH_MTMIPS + default 0x0 if ARCH_MTMIPS || ARCH_SUNXI default TPL_MAX_SIZE if TPL_MAX_SIZE > SPL_MAX_SIZE default SPL_MAX_SIZE help
Samuel Holland
maintainerPATCH v3 2/4 sunxi: binman: Move BL31 and SCP firmware addresses to Kconfig
In reply to Samuel HollandThis is easier to read than the #ifdef staircase, provides better visibility into the memory map (alongside the other Kconfig definitions), and allows these addresses to be reused from code.
---
(no changes since v2)
Changes in v2:
- New patch for v2, split from the .dtsi changes
arch/arm/dts/sunxi-u-boot.dtsi | 24 +++++++----------------- arch/arm/mach-sunxi/Kconfig | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 17 deletions(-)
arch/arm/dts/sunxi-u-boot.dtsi +7 -17
@@ -1,15 +1,5 @@ #include <config.h> -#ifdef CONFIG_MACH_SUN50I_H6 -#define BL31_ADDR 0x104000 -#define SCP_ADDR 0x114000 -#elif defined(CONFIG_MACH_SUN50I_H616) -#define BL31_ADDR 0x40000000 -#else -#define BL31_ADDR 0x44000 -#define SCP_ADDR 0x50000 -#endif - / { aliases { mmc0 = &mmc0;
@@ -69,8 +59,8 @@ os = "arm-trusted-firmware"; arch = "arm64"; compression = "none"; - load = <BL31_ADDR>; - entry = <BL31_ADDR>; + load = <CONFIG_SUNXI_BL31_BASE>; + entry = <CONFIG_SUNXI_BL31_BASE>; atf-bl31 { filename = "bl31.bin";
@@ -78,13 +68,13 @@ }; }; -#ifdef SCP_ADDR +#if CONFIG_SUNXI_SCP_BASE scp { description = "SCP firmware"; type = "firmware"; arch = "or1k"; compression = "none"; - load = <SCP_ADDR>; + load = <CONFIG_SUNXI_SCP_BASE>; scp { filename = "scp.bin";
@@ -106,10 +96,10 @@ @config-SEQ { description = "NAME"; firmware = "atf"; -#ifndef SCP_ADDR - loadables = "uboot"; -#else +#if CONFIG_SUNXI_SCP_BASE loadables = "scp", "uboot"; +#else + loadables = "uboot"; #endif fdt = "fdt-SEQ"; };
arch/arm/mach-sunxi/Kconfig +17 -0
@@ -155,6 +155,23 @@ config SUNXI_RVBAR_ALTERNATIVE for all other SoCs, so the content of the SRAM_VER_REG becomes irrelevant there, and we can use the same code. +config SUNXI_BL31_BASE + hex + default 0x00044000 if MACH_SUN50I || MACH_SUN50I_H5 + default 0x00104000 if MACH_SUN50I_H6 + default 0x40000000 if MACH_SUN50I_H616 + default 0x0 + help + Address where BL31 (TF-A) is loaded, or zero if BL31 is not used. + +config SUNXI_SCP_BASE + hex + default 0x00050000 if MACH_SUN50I || MACH_SUN50I_H5 + default 0x00114000 if MACH_SUN50I_H6 + default 0x0 + help + Address where SCP firmware is loaded, or zero if it is not used. + config SUNXI_A64_TIMER_ERRATUM bool
Signature · 1 line
2.41.0
Re: [PATCH v3 2/4] sunxi: binman: Move BL31 and SCP firmware addresses to Kconfig
On Tue, 31 Oct 2023 00:17:39 -0500
Samuel Holland <[email protected]> wrote:
Hi Samuel,
Quoted 3 lines
This is easier to read than the #ifdef staircase, provides better visibility into the memory map (alongside the other
Kconfigdefinitions), and allows these addresses to be reused from code.
This is indeed much nicer, and simplifies adding more SoCs. I checked that the addresses are the same:
Quoted 2 lines
Reviewed-by Simon Glass <[email protected]>Signed-off-by Samuel Holland <[email protected]>
Cheers,
Andre
Quoted 100 lines
---
(no changes since v2)
Changes in v2:
- New patch for v2, split from the .dtsi changesarch/arm/dts/sunxi-u-boot.dtsi | 24 +++++++----------------- arch/arm/mach-sunxi/Kconfig | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 17 deletions(-)arch/arm/dts/sunxi-u-boot.dtsi +7
-17@@ -1,15 +1,5 @@ #include <config.h> -#ifdef CONFIG_MACH_SUN50I_H6 -#define BL31_ADDR 0x104000 -#define SCP_ADDR 0x114000 -#elif defined(CONFIG_MACH_SUN50I_H616) -#define BL31_ADDR 0x40000000 -#else -#define BL31_ADDR 0x44000 -#define SCP_ADDR 0x50000 -#endif - / { aliases { mmc0 = &mmc0;@@ -69,8 +59,8 @@ os = "arm-trusted-firmware"; arch = "arm64"; compression = "none"; - load = <BL31_ADDR>; - entry = <BL31_ADDR>; + load = <CONFIG_SUNXI_BL31_BASE>; + entry = <CONFIG_SUNXI_BL31_BASE>; atf-bl31 { filename = "bl31.bin";@@ -78,13 +68,13 @@ }; }; -#ifdef SCP_ADDR +#if CONFIG_SUNXI_SCP_BASE scp { description = "SCP firmware"; type = "firmware"; arch = "or1k"; compression = "none"; - load = <SCP_ADDR>; + load = <CONFIG_SUNXI_SCP_BASE>; scp { filename = "scp.bin";@@ -106,10 +96,10 @@ @config-SEQ { description = "NAME"; firmware = "atf"; -#ifndef SCP_ADDR - loadables = "uboot"; -#else +#if CONFIG_SUNXI_SCP_BASE loadables = "scp", "uboot"; +#else + loadables = "uboot"; #endif fdt = "fdt-SEQ"; };arch/arm/mach-sunxi/Kconfig +17
-0@@ -155,6 +155,23 @@ config SUNXI_RVBAR_ALTERNATIVE for all other SoCs, so the content of the SRAM_VER_REG becomes irrelevant there, and we can use the same code. +config SUNXI_BL31_BASE + hex + default 0x00044000 if MACH_SUN50I || MACH_SUN50I_H5 + default 0x00104000 if MACH_SUN50I_H6 + default 0x40000000 if MACH_SUN50I_H616 + default 0x0 + help + Address where BL31 (TF-A) is loaded, or zero if BL31 is not used. + +config SUNXI_SCP_BASE + hex + default 0x00050000 if MACH_SUN50I || MACH_SUN50I_H5 + default 0x00114000 if MACH_SUN50I_H6 + default 0x0 + help + Address where SCP firmware is loaded, or zero if it is not used. + config SUNXI_A64_TIMER_ERRATUM bool
Samuel Holland
maintainerPATCH v3 3/4 sunxi: binman: Support FIT generation for 32-bit SoCs
In reply to Samuel HollandSome 32-bit SoCs can use SCP firmware to implement additional PSCI functionality, such as system suspend. In order to load this firmware from SPL, we need to generate and use a FIT instead of a legacy image.
Adjust the binman FIT definition so it does not rely on TF-A BL31, as this is not used on 32-bit SoCs. Instead, after loading the firmware, U-Boot proper is executed directly.
---
(no changes since v2)
Changes in v2:
- Rely on binman min-size instead of using explicit offsets
- Use Kconfig for firmware addresses instead of an #ifdef staircase
arch/arm/dts/sunxi-u-boot.dtsi | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-)
arch/arm/dts/sunxi-u-boot.dtsi +18 -5
@@ -1,5 +1,11 @@ #include <config.h> +#ifdef CONFIG_ARM64 +#define ARCH "arm64" +#else +#define ARCH "arm" +#endif + / { aliases { mmc0 = &mmc0;
@@ -34,30 +40,32 @@ filename = "spl/sunxi-spl.bin"; }; -#ifdef CONFIG_ARM64 +#ifdef CONFIG_SPL_LOAD_FIT fit { - description = "Configuration to load ATF before U-Boot"; + description = "Configuration to load U-Boot and firmware"; #address-cells = <1>; fit,fdt-list = "of-list"; images { uboot { - description = "U-Boot (64-bit)"; + description = "U-Boot"; type = "standalone"; os = "u-boot"; - arch = "arm64"; + arch = ARCH; compression = "none"; load = <CONFIG_TEXT_BASE>; + entry = <CONFIG_TEXT_BASE>; u-boot-nodtb { }; }; +#if CONFIG_SUNXI_BL31_BASE atf { description = "ARM Trusted Firmware"; type = "firmware"; os = "arm-trusted-firmware"; - arch = "arm64"; + arch = ARCH; compression = "none"; load = <CONFIG_SUNXI_BL31_BASE>; entry = <CONFIG_SUNXI_BL31_BASE>;
@@ -67,6 +75,7 @@ missing-msg = "atf-bl31-sunxi"; }; }; +#endif #if CONFIG_SUNXI_SCP_BASE scp {
@@ -95,7 +104,11 @@ @config-SEQ { description = "NAME"; +#if CONFIG_SUNXI_BL31_BASE firmware = "atf"; +#else + firmware = "uboot"; +#endif #if CONFIG_SUNXI_SCP_BASE loadables = "scp", "uboot"; #else
Signature · 1 line
2.41.0
Re: [PATCH v3 3/4] sunxi: binman: Support FIT generation for 32-bit SoCs
Quoted 12 lines · Samuel Holland
Some 32-bit SoCs can use SCP firmware to implement additional PSCI functionality, such as system suspend. In order to load this firmware from SPL, we need to generate and use a FIT instead of a legacy image.
Adjust the binman FIT definition so it does not rely on TF-A BL31, as this is not used on 32-bit SoCs. Instead, after loading the firmware, U-Boot proper is executed directly.
Signed-off-by Samuel Holland <[email protected]>---
Quoted 8 lines
(no changes since v2)
Changes in v2:
- Rely on binman min-size instead of using explicit offsets
- UseKconfigfor firmware addresses instead of an #ifdef staircasearch/arm/dts/sunxi-u-boot.dtsi | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-)
Re: [PATCH v3 3/4] sunxi: binman: Support FIT generation for 32-bit SoCs
In reply to Samuel HollandOn Tue, 31 Oct 2023 00:17:40 -0500
Samuel Holland <[email protected]> wrote:
Hi,
Quoted 7 lines
Some 32-bit SoCs can use SCP firmware to implement additional PSCI functionality, such as system suspend. In order to load this firmware from SPL, we need to generate and use a FIT instead of a legacy image.
Adjust the binman FIT definition so it does not rely on TF-A BL31, as this is not used on 32-bit SoCs. Instead, after loading the firmware, U-Boot proper is executed directly.
I like that it removes the artificial restriction to use a FIT image only on arm64 builds, and indeed hinges that on the relevant CONFIG_SPL_LOAD_FIT variable.
The changes look alright, even "uboot" being mentioned twice (once as firmware, once as loadable): the SPL code can cope with that.
Quoted 1 line
Signed-off-by Samuel Holland <[email protected]>
Cheers,
Andre
Quoted 85 lines
---
(no changes since v2)
Changes in v2:
- Rely on binman min-size instead of using explicit offsets
- UseKconfigfor firmware addresses instead of an #ifdef staircasearch/arm/dts/sunxi-u-boot.dtsi | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-)arch/arm/dts/sunxi-u-boot.dtsi +18
-5@@ -1,5 +1,11 @@ #include <config.h> +#ifdef CONFIG_ARM64 +#define ARCH "arm64" +#else +#define ARCH "arm" +#endif + / { aliases { mmc0 = &mmc0;@@ -34,30 +40,32 @@ filename = "spl/sunxi-spl.bin"; }; -#ifdef CONFIG_ARM64 +#ifdef CONFIG_SPL_LOAD_FIT fit { - description = "Configuration to load ATF before U-Boot"; + description = "Configuration to load U-Boot and firmware"; #address-cells = <1>; fit,fdt-list = "of-list"; images { uboot { - description = "U-Boot (64-bit)"; + description = "U-Boot"; type = "standalone"; os = "u-boot"; - arch = "arm64"; + arch = ARCH; compression = "none"; load = <CONFIG_TEXT_BASE>; + entry = <CONFIG_TEXT_BASE>; u-boot-nodtb { }; }; +#if CONFIG_SUNXI_BL31_BASE atf { description = "ARM Trusted Firmware"; type = "firmware"; os = "arm-trusted-firmware"; - arch = "arm64"; + arch = ARCH; compression = "none"; load = <CONFIG_SUNXI_BL31_BASE>; entry = <CONFIG_SUNXI_BL31_BASE>;@@ -67,6 +75,7 @@ missing-msg = "atf-bl31-sunxi"; }; }; +#endif #if CONFIG_SUNXI_SCP_BASE scp {@@ -95,7 +104,11 @@ @config-SEQ { description = "NAME"; +#if CONFIG_SUNXI_BL31_BASE firmware = "atf"; +#else + firmware = "uboot"; +#endif #if CONFIG_SUNXI_SCP_BASE loadables = "scp", "uboot"; #else
Re: [PATCH v3 3/4] sunxi: binman: Support FIT generation for 32-bit SoCs
In reply to Samuel HollandOn Tue, 31 Oct 2023 00:17:40 -0500
Samuel Holland <[email protected]> wrote:
Hi,
Quoted 9 lines
Some 32-bit SoCs can use SCP firmware to implement additional PSCI functionality, such as system suspend. In order to load this firmware from SPL, we need to generate and use a FIT instead of a legacy image.
Adjust the binman FIT definition so it does not rely on TF-A BL31, as this is not used on 32-bit SoCs. Instead, after loading the firmware, U-Boot proper is executed directly.
Signed-off-by Samuel Holland <[email protected]>
So I merged this patch (along with the others), but with one change below:
Quoted 40 lines
---
(no changes since v2)
Changes in v2:
- Rely on binman min-size instead of using explicit offsets
- UseKconfigfor firmware addresses instead of an #ifdef staircasearch/arm/dts/sunxi-u-boot.dtsi | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-)arch/arm/dts/sunxi-u-boot.dtsi +8
-2@@ -1,5 +1,11 @@ #include <config.h> +#ifdef CONFIG_ARM64 +#define ARCH "arm64" +#else +#define ARCH "arm" +#endif + / { aliases { mmc0 = &mmc0;@@ -34,30 +40,32 @@ filename = "spl/sunxi-spl.bin"; }; -#ifdef CONFIG_ARM64 +#ifdef CONFIG_SPL_LOAD_FIT fit { - description = "Configuration to load ATF before U-Boot"; + description = "Configuration to load U-Boot and firmware"; #address-cells = <1>; fit,fdt-list = "of-list"; images {
arch/arm/dts/sunxi-u-boot.dtsi line 57
Quoted 10 lines
arch/arm/dts/sunxi-u-boot.dtsi +3
-2uboot { - description = "U-Boot (64-bit)"; + description = "U-Boot"; type = "standalone"; os = "u-boot"; - arch = "arm64"; + arch = ARCH; compression = "none"; load = <CONFIG_TEXT_BASE>; + entry = <CONFIG_TEXT_BASE>;
This line for some odd reason broke the Debian arm64 Grub execution for
me: U-Boot would run fine, it would load grub.efi, but then I see U-Boot's exception handler, with an ESR 0x20000000 ("unknown reason"), and a reset.
It also confuses sunxi-fel's FIT loader, which expects exactly one image with an "entry" property, and thus refuses to load such an image. This is admittedly a limitation of sunxi-fel, but nevertheless would mean we cannot FEL boot those images at the moment.
I will look into fixing this there, but together with the first problem, I decided to make this line conditional, by bracketing it with a check for CONFIG_SUNXI_BL31_BASE being 0.
This means we never get two "entry" properties:
- for arm64, BL31_BASE is never 0, so we skip it here, but get it below, for the "atf" node.
- for arm, BL31_BASE is always 0, so we get it here, but skip the entire "atf" node below.
Happy to revisit this problem with a proper fix, but to not hold this series back any longer, because it's a nice series and cleans up some mess, I merged it with this modification, plus the removal of the unconditional enablement in the last patch.
Cheers,
Andre.
Quoted 35 lines
arch/arm/dts/sunxi-u-boot.dtsi +7
-1u-boot-nodtb { }; }; +#if CONFIG_SUNXI_BL31_BASE atf { description = "ARM Trusted Firmware"; type = "firmware"; os = "arm-trusted-firmware"; - arch = "arm64"; + arch = ARCH; compression = "none"; load = <CONFIG_SUNXI_BL31_BASE>; entry = <CONFIG_SUNXI_BL31_BASE>;@@ -67,6 +75,7 @@ missing-msg = "atf-bl31-sunxi"; }; }; +#endif #if CONFIG_SUNXI_SCP_BASE scp {@@ -95,7 +104,11 @@ @config-SEQ { description = "NAME"; +#if CONFIG_SUNXI_BL31_BASE firmware = "atf"; +#else + firmware = "uboot"; +#endif #if CONFIG_SUNXI_SCP_BASE loadables = "scp", "uboot"; #else
Samuel Holland
maintainerPATCH v3 4/4 sunxi: Enable SPL FIT loading for 32-bit SoCs
In reply to Samuel HollandNow that 32-bit SoCs can load U-Boot proper (and possibly other firmware) from a FIT, use this method by default. SPL_FIT_IMAGE_TINY is required to stay within the 24 or 32 KiB SPL size limit on early SoCs; for consistency, enable it everywhere.
---
(no changes since v2)
Changes in v2:
- New patch for v2, split from the .dtsi changes
arch/arm/Kconfig | 1 + common/spl/Kconfig | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/Kconfig +1 -0
@@ -1167,6 +1167,7 @@ config ARCH_SUNXI imply SPL_GPIO imply SPL_LIBCOMMON_SUPPORT imply SPL_LIBGENERIC_SUPPORT + imply SPL_LOAD_FIT imply SPL_MMC if MMC imply SPL_POWER imply SPL_SERIAL
common/spl/Kconfig +1 -2
@@ -567,8 +567,7 @@ config SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION config SPL_FIT_IMAGE_TINY bool "Remove functionality from SPL FIT loading to reduce size" depends on SPL_FIT - default y if MACH_SUN50I || MACH_SUN50I_H5 || SUN50I_GEN_H6 - default y if ARCH_IMX8M || ARCH_IMX9 + default y if ARCH_IMX8M || ARCH_IMX9 || ARCH_SUNXI help Enable this to reduce the size of the FIT image loading code in SPL, if space for the SPL binary is very tight.
Signature · 1 line
2.41.0
Re: [PATCH v3 4/4] sunxi: Enable SPL FIT loading for 32-bit SoCs
Quoted 9 lines · Samuel Holland
Now that 32-bit SoCs can load U-Boot proper (and possibly other firmware) from a FIT, use this method by default.
SPL_FIT_IMAGE_TINYis required to stay within the 24 or 32 KiB SPL size limit on early SoCs; for consistency, enable it everywhere.Signed-off-by Samuel Holland <[email protected]>---
Quoted 8 lines
(no changes since v2)
Changes in v2:
- New patch for v2, split from the .dtsi changesarch/arm/Kconfig | 1 + common/spl/Kconfig | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-)
Re: [PATCH v3 4/4] sunxi: Enable SPL FIT loading for 32-bit SoCs
In reply to Samuel HollandOn Tue, 31 Oct 2023 00:17:41 -0500
Samuel Holland <[email protected]> wrote:
Hi,
Quoted 4 lines
Now that 32-bit SoCs can load U-Boot proper (and possibly other firmware) from a FIT, use this method by default.
SPL_FIT_IMAGE_TINYis required to stay within the 24 or 32 KiB SPL size limit on early SoCs; for consistency, enable it everywhere.
Mmh, so that changes the build for an awful lot of boards, especially old ones that no one can be bothered to test anymore. I am bit scared of that change there, especially with the limited SRAM size there.
I think the main motivation stems from crust on H3, and since H3 boards are still in good use and get tested, I'd prefer to enable it just for H3 boards, at least for now.
If we don't hear anything bad for a while, we could try to enable it (by default) on the other SoCs as well.
What do you think?
Cheers,
Andre
Quoted 39 lines
Signed-off-by Samuel Holland <[email protected]>---
(no changes since v2)
Changes in v2:
- New patch for v2, split from the .dtsi changesarch/arm/Kconfig | 1 + common/spl/Kconfig | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-)arch/arm/Kconfig +1
-0@@ -1167,6 +1167,7 @@ config ARCH_SUNXI imply SPL_GPIO imply SPL_LIBCOMMON_SUPPORT imply SPL_LIBGENERIC_SUPPORT + imply SPL_LOAD_FIT imply SPL_MMC if MMC imply SPL_POWER imply SPL_SERIALcommon/spl/Kconfig +1
-2@@ -567,8 +567,7 @@ config SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION config SPL_FIT_IMAGE_TINY bool "Remove functionality from SPL FIT loading to reduce size" depends on SPL_FIT - default y if MACH_SUN50I || MACH_SUN50I_H5 || SUN50I_GEN_H6 - default y if ARCH_IMX8M || ARCH_IMX9 + default y if ARCH_IMX8M || ARCH_IMX9 || ARCH_SUNXI help Enable this to reduce the size of the FIT image loading code in SPL, if space for the SPL binary is very tight.
Re: [PATCH v3 4/4] sunxi: Enable SPL FIT loading for 32-bit SoCs
On Fri, 8 Dec 2023 01:39:45 +0000
Andre Przywara <[email protected]> wrote:
Hi Samuel,
Quoted 14 lines
On Tue, 31 Oct 2023 00:17:41 -0500
Samuel Holland <[email protected]> wrote:Hi,
Quoted 4 lines
Now that 32-bit SoCs can load U-Boot proper (and possibly other firmware) from a FIT, use this method by default.
SPL_FIT_IMAGE_TINYis required to stay within the 24 or 32 KiB SPL size limit on early SoCs; for consistency, enable it everywhere.Mmh, so that changes the build for an awful lot of boards, especially old ones that no one can be bothered to test anymore. I am bit scared of that change there, especially with the limited SRAM size there.
Quoted 7 lines
I think the main motivation stems from crust on H3, and since H3 boards are still in good use and get tested, I'd prefer to enable it just for H3 boards, at least for now.
If we don't hear anything bad for a while, we could try to enable it (by default) on the other SoCs as well.What do you think?
Any ideas here? I plan to take the other three patches, which would already allow people to enable FIT in their (def)config. I can just leave this one off for now, and we can merge a changed version later?
Cheers,
Andre
Quoted 40 lines
Quoted 39 lines
Signed-off-by Samuel Holland <[email protected]>---
(no changes since v2)
Changes in v2:
- New patch for v2, split from the .dtsi changesarch/arm/Kconfig | 1 + common/spl/Kconfig | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-)arch/arm/Kconfig +1
-0@@ -1167,6 +1167,7 @@ config ARCH_SUNXI imply SPL_GPIO imply SPL_LIBCOMMON_SUPPORT imply SPL_LIBGENERIC_SUPPORT + imply SPL_LOAD_FIT imply SPL_MMC if MMC imply SPL_POWER imply SPL_SERIALcommon/spl/Kconfig +1
-2@@ -567,8 +567,7 @@ config SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION config SPL_FIT_IMAGE_TINY bool "Remove functionality from SPL FIT loading to reduce size" depends on SPL_FIT - default y if MACH_SUN50I || MACH_SUN50I_H5 || SUN50I_GEN_H6 - default y if ARCH_IMX8M || ARCH_IMX9 + default y if ARCH_IMX8M || ARCH_IMX9 || ARCH_SUNXI help Enable this to reduce the size of the FIT image loading code in SPL, if space for the SPL binary is very tight.
Re: [PATCH v3 4/4] sunxi: Enable SPL FIT loading for 32-bit SoCs
On Wed, 17 Jan 2024 00:19:05 +0000
Andre Przywara <[email protected]> wrote:
Hi,
Quoted 25 lines
On Fri, 8 Dec 2023 01:39:45 +0000
Andre Przywara <[email protected]> wrote:Hi Samuel,
Quoted 20 lines
On Tue, 31 Oct 2023 00:17:41 -0500
Samuel Holland <[email protected]> wrote:Hi,
Quoted 4 lines
Now that 32-bit SoCs can load U-Boot proper (and possibly other firmware) from a FIT, use this method by default.
SPL_FIT_IMAGE_TINYis required to stay within the 24 or 32 KiB SPL size limit on early SoCs; for consistency, enable it everywhere.Mmh, so that changes the build for an awful lot of boards, especially old ones that no one can be bothered to test anymore. I am bit scared of that change there, especially with the limited SRAM size there.
I think the main motivation stems from crust on H3, and since H3 boards are still in good use and get tested, I'd prefer to enable it just for H3 boards, at least for now.
If we don't hear anything bad for a while, we could try to enable it (by default) on the other SoCs as well.
Quoted 6 lines
Quoted 1 line
What do you think?
Any ideas here? I plan to take the other three patches, which would already allow people to enable FIT in their (def)config. I can just leave this one off for now, and we can merge a changed version later?
So I took this patch as well, but removed the hunk with "imply SPL_LOAD_FIT" below. This means we still allow people to enable FIT images individually, but no defconfig or Kconfig option would default to it. Happy to discuss this decision and maybe take a later patch to rectify the situation.
Cheers,
Andre
Quoted 41 lines
Quoted 40 lines
Quoted 39 lines
Signed-off-by Samuel Holland <[email protected]>---
(no changes since v2)
Changes in v2:
- New patch for v2, split from the .dtsi changesarch/arm/Kconfig | 1 + common/spl/Kconfig | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-)arch/arm/Kconfig +1
-0@@ -1167,6 +1167,7 @@ config ARCH_SUNXI imply SPL_GPIO imply SPL_LIBCOMMON_SUPPORT imply SPL_LIBGENERIC_SUPPORT + imply SPL_LOAD_FIT imply SPL_MMC if MMC imply SPL_POWER imply SPL_SERIALcommon/spl/Kconfig +1
-2@@ -567,8 +567,7 @@ config SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION config SPL_FIT_IMAGE_TINY bool "Remove functionality from SPL FIT loading to reduce size" depends on SPL_FIT - default y if MACH_SUN50I || MACH_SUN50I_H5 || SUN50I_GEN_H6 - default y if ARCH_IMX8M || ARCH_IMX9 + default y if ARCH_IMX8M || ARCH_IMX9 || ARCH_SUNXI help Enable this to reduce the size of the FIT image loading code in SPL, if space for the SPL binary is very tight.
Quoted 30 lines · Samuel Holland
This series makes the necessary changes so 32-bit sunxi SoCs can load additional device trees or firmware from SPL along with U-Boot proper. Crust (SCP firmware) has support for A33 and H3, and H3 also needs to load an eGon blob to support CPU 0 hotplug (a silicon bug workaround).
FIT unlocks more features (signatures, multiple DTBs, etc.), so enable it by default. A10 (sun4i) only has 24 KiB of SRAM A1, so it needs
SPL_FIT_IMAGE_TINY. For consistency, enable that option everywhere.After this series is applied, we can increase
SPL_MAX_SIZEfor H6 and newer SoCs, both 32-bit (e.g. A50, T113) and 64-bit. I did not do that yet because there is some discussion to be had about the correct value:
it must be adjusted to guarantee return-to-FEL functionality, and the exact adjustment depends on the sunxi-fel tool implementation.Changes in v3:
- Rebased and collected tagsChanges in v2:
- Disable padding fromSPL_PAD_TO
- Rely on binman min-size instead of using explicit offsets
- UseKconfigfor firmware addresses instead of an #ifdef staircaseSamuel Holland (4):
sunxi: spl: Disable padding fromSPL_PAD_TO
sunxi: binman: Move BL31 and SCP firmware addresses toKconfig
sunxi: binman: Support FIT generation for 32-bit SoCs
sunxi: Enable SPL FIT loading for 32-bit SoCs
Quoted 9 lines
arch/arm/Kconfig | 1 + arch/arm/dts/sunxi-u-boot.dtsi | 39 ++++++++++++++++++---------------- arch/arm/mach-sunxi/Kconfig | 17 +++++++++++++++ common/spl/Kconfig | 6 ++---- 4 files changed, 41 insertions(+), 22 deletions(-)--
2.41.0
Looks good!