This patch series adds support for U-Boot SPL booting on Amlogic GX SoCs, replacing the "bl2.bin" binary blob running as TF-A BL2 on these boards.
Boards tested: - Libre Computer LePotato (S905X, 1 GB) - Videostrong KII Pro (S905) - Xiaomi Mi TV Stick (S805Y) - downstream defconfig [1] - ODROID-C2 (S905) Each of these boards were tested booting mainline u-boot and TF-A BL31, either from an SD card or using Ymodem, and then booting to Linux. More testing is, of course, very much welcome. In particular, further testing of other boards that could not be tested, of the ODROID-C2, and of the 2 GB LePotato would be appreciated. Currently known issues: - LPDDR2/LPDDR3 support not implemented - some DRAM rank modes are not supported - eMMC booting is broken (pwrseq?) - SPI boot is untested - we are quite limited in space, so e.g. the clock driver does not fit Future work: - add logic to automatically detect rank mode and DRAM size - investigate using U-Boot TPL to free some space - may fix eMMC booting as a side effect - support more rank modes - add support for Amlogic g12b/sm1 SoCs - ... See doc/board/amlogic/spl.rst for building and installation instructions. This patch series depends on Jonas Karlman's amlimage work, which was sent in the mailing list [2]. It has been rebased for resending as part of this patch series. Thanks Jonas! I would like to also thank Libre Computer and MNT Research for donating boards to me and the rest of the linux-amlogic community for the invaluable help. [1]: https://scm.dersco.re/amlogic/u-boot-kii-pro.git/commit/?h=wip/spl-aquaman-2025.08&id=d030951d0aaac04f1e2cc8a8eb01eb662a782f21 [2]: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Ferass El Hafidi <[email protected]> --- Changes in v5: - Mention future work in cover letter - Remove unrelated changes from binman patch - Enforce SPL max size at build system level rather than at the mkimage level - Add meson-gxbb-u-boot.dtsi (similar to already existing meson-gxl-u-boot.dtsi) - DT: Drop a few #define's: - BL31_ADDR => BL31 address now set in gxbb/gxl-u-boot DTSI - SCP_ADDR - Don't check CONFIG_MESON_GX (already implied) - DT: SHA256 hash on all images - Check CONFIG_SPL_FIT_SIGNATURE and CONFIG_SPL_SHA256 (except for SCP image, not a dealbreaker if it cannot be verified in SPL, as it is verified by the SCP bootROM anyway) - DT: move mkimage args to gxbb/gxl-u-boot DTSI - Mention AML_STDPARAMS=1 in TF-A building docs - Fix typo in spl.c (s/YMODEM/YMODEM_SUPPORT/) - Link to v4: https://lore.kernel.org/r/[email protected] Changes in v4: - Remove "RFC" prefix, no longer an RFC patch (but still testing and feedback very much welcome) - Continue using meson_gx_mmc_is_compatible in DM MMC driver - Fix typo in amlimage secure boot info printf - Drop FIT image post-processing on libretech-cc - Add Neil's R-b tags for all the other patches except MMC patch - Link to v3: https://lore.kernel.org/r/[email protected] Changes in v3: - Do not depend on DEBUG_UART_BASE in the non-DM UART driver - Grammar fixes in documentation - amlimage: check digest type in _print_header, version in _verify_image - Link to v2: https://lore.kernel.org/r/[email protected] Changes in v2: - Drop "mmc: meson_gx_mmc: don't bail if there is no clock driver", given SPL does not use the DM MMC driver by default anyway - Drop spurious DM_DRIVER_ALIAS from UART driver - Document in send_scp() why it is only needed for GXBB - Move GXBB/GXL-specific code to separate spl-gxbb/spl-gxl files - Add a few defines for pll init - Actually disable FIT image post-processing on GXL - Add Neil's R-b tag (subset) - Link to v1: https://lore.kernel.org/r/[email protected] --- Ferass El Hafidi (9): mmc: meson_gx_mmc: add minimal non-DM driver serial: serial_meson: add minimal non-DM driver arm: meson: initial u-boot SPL support for GX SoCs arm: meson: spl: add support for SPL DRAM init arm: dts: meson: add meson-gxbb-u-boot.dtsi arm: dts: meson-gx-u-boot: add binman configuration for U-Boot SPL board: amlogic: add kconfig fragments for SPL spl: meson: set SPL max size for GX SoCs doc: board: amlogic: add u-boot-spl documentation Jonas Karlman (1): tools: mkimage: Add Amlogic Boot Image type MAINTAINERS | 1 + arch/arm/dts/meson-gx-u-boot.dtsi | 125 ++++++ arch/arm/dts/meson-gxbb-kii-pro-u-boot.dtsi | 2 +- arch/arm/dts/meson-gxbb-nanopi-k2-u-boot.dtsi | 2 +- arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi | 2 +- arch/arm/dts/meson-gxbb-p200-u-boot.dtsi | 2 +- arch/arm/dts/meson-gxbb-p201-u-boot.dtsi | 2 +- arch/arm/dts/meson-gxbb-u-boot.dtsi | 27 ++ arch/arm/dts/meson-gxbb-wetek-hub-u-boot.dtsi | 2 +- arch/arm/dts/meson-gxbb-wetek-play2-u-boot.dtsi | 2 +- arch/arm/dts/meson-gxl-u-boot.dtsi | 20 + arch/arm/include/asm/arch-meson/clock-gx.h | 14 + arch/arm/include/asm/arch-meson/dram-gx.h | 341 +++++++++++++++++ arch/arm/include/asm/arch-meson/dram-gxbb.h | 168 +++++++++ arch/arm/include/asm/arch-meson/dram-gxl.h | 193 ++++++++++ arch/arm/include/asm/arch-meson/dram-settings-gx.h | 296 +++++++++++++++ arch/arm/include/asm/arch-meson/dram-timings-gx.h | 117 ++++++ arch/arm/include/asm/arch-meson/gx.h | 41 ++ arch/arm/mach-meson/Kconfig | 112 +++++- arch/arm/mach-meson/Makefile | 10 + arch/arm/mach-meson/board-common.c | 11 + arch/arm/mach-meson/dram-gx.c | 419 +++++++++++++++++++++ arch/arm/mach-meson/dram-gxbb.c | 174 +++++++++ arch/arm/mach-meson/dram-gxl.c | 167 ++++++++ arch/arm/mach-meson/spl-gx.c | 168 +++++++++ arch/arm/mach-meson/spl-gxbb.c | 113 ++++++ arch/arm/mach-meson/spl-gxl.c | 39 ++ arch/arm/mach-meson/spl.c | 123 ++++++ board/amlogic/p200/spl-odroid-c2.config | 38 ++ board/amlogic/p200/spl-videostrong-kii-pro.config | 39 ++ board/amlogic/p212/spl-libretech-cc-1gb.config | 36 ++ board/amlogic/p212/spl-libretech-cc-2gb.config | 38 ++ boot/image.c | 1 + common/spl/Kconfig | 1 + doc/board/amlogic/index.rst | 1 + doc/board/amlogic/pre-generated-fip.rst | 9 + doc/board/amlogic/spl.rst | 77 ++++ drivers/mmc/meson_gx_mmc.c | 77 ++++ drivers/serial/serial.c | 2 + drivers/serial/serial_meson.c | 119 +++++- include/image.h | 1 + tools/Makefile | 1 + tools/amlimage.c | 255 +++++++++++++ 43 files changed, 3379 insertions(+), 9 deletions(-) --- base-commit: 072264c4b3406aee50dad08355588577a547ab48 change-id: 20250830-spl-gx-1148b58dd3b1 Best regards, -- Ferass El Hafidi <[email protected]>

