From 723f14c946cbc8c09c3acf7bb7b7da65a4eeecd0 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Wed, 22 Apr 2026 10:48:58 +0200 Subject: clk: meson: do not fail when setting SD_EMMC_x_CLK0 Since Linux v7.0, the MMC controllers has the following properties: assigned-clocks = <&clkc CLKID_SD_EMMC_x_CLK0>; assigned-clock-rates = <24000000>; Which causes mmc controllers to fail in probe. Make sure we do not fail until we properly implement rate setup. Tested-by: Ferass El Hafidi # on lepotato Link: https://patch.msgid.link/20260422-u-boot-amlogic-test-v1-1-b5790d3c04e0@linaro.org Signed-off-by: Neil Armstrong --- drivers/clk/meson/g12a.c | 5 +++++ drivers/clk/meson/gxbb.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/drivers/clk/meson/g12a.c b/drivers/clk/meson/g12a.c index a7a42b2edb6..f33938e1419 100644 --- a/drivers/clk/meson/g12a.c +++ b/drivers/clk/meson/g12a.c @@ -946,6 +946,11 @@ static ulong meson_clk_set_rate_by_id(struct clk *clk, unsigned long id, case CLKID_HDMI: return meson_clk_set_rate_by_id(clk, CLKID_HDMI_DIV, rate, current_rate); + case CLKID_SD_EMMC_A_CLK0: + case CLKID_SD_EMMC_B_CLK0: + case CLKID_SD_EMMC_C_CLK0: + /* TOFIX: implement rate set for MMC clocks */ + return 0; default: return -ENOENT; } diff --git a/drivers/clk/meson/gxbb.c b/drivers/clk/meson/gxbb.c index 218be45c2cb..bf46f4d50bc 100644 --- a/drivers/clk/meson/gxbb.c +++ b/drivers/clk/meson/gxbb.c @@ -900,6 +900,11 @@ static ulong meson_clk_set_rate_by_id(struct clk *clk, unsigned long id, case CLKID_HDMI: return meson_clk_set_rate_by_id(clk, CLKID_HDMI_DIV, rate, current_rate); + case CLKID_SD_EMMC_A_CLK0: + case CLKID_SD_EMMC_B_CLK0: + case CLKID_SD_EMMC_C_CLK0: + /* TOFIX: implement rate set for MMC clocks */ + return 0; default: return -ENOENT; } -- cgit v1.2.3 From 93c13379a4446ea38f85c4e393d187b8de2159ab Mon Sep 17 00:00:00 2001 From: Ferass El Hafidi Date: Wed, 22 Apr 2026 15:43:23 +0000 Subject: arm: mach-meson: provide reset_cpu only when SYSRESET is disabled This is in preparation of enabling SYSRESET across all Amlogic boards by default. SYSRESET brings its own reset_cpu implementation which will conflict with the one defined in board-common.c. SPL however will not have SYSRESET enabled (due to overhead in the final image, as we have very little space to work with), and thus will still need that reset_cpu to be defined. Furthermore, some boards do not enable PSCI support in U-Boot, so they may still need this implementation. Guard reset_cpu inside #ifdef to only compile it in when SYSRESET is not enabled. Signed-off-by: Ferass El Hafidi Reviewed-by: Neil Armstrong Link: https://patch.msgid.link/20260422-b4-amlogic-sysreset-capsules-v3-1-07b5ccc8f552@postmarketos.org Signed-off-by: Neil Armstrong --- arch/arm/mach-meson/board-common.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-meson/board-common.c b/arch/arm/mach-meson/board-common.c index a5afc2d75c0..c34b81e5e78 100644 --- a/arch/arm/mach-meson/board-common.c +++ b/arch/arm/mach-meson/board-common.c @@ -155,16 +155,14 @@ int board_late_init(void) return meson_board_late_init(); } +#if defined(CONFIG_XPL) || !CONFIG_IS_ENABLED(SYSRESET) void reset_cpu(void) { -#if CONFIG_SPL_BUILD /* * We do not have BL31 running yet, so no PSCI. * Instead, let the watchdog reset the board. */ for (;;) ; -#else - psci_system_reset(); -#endif } +#endif -- cgit v1.2.3 From 63a0b3e9abba4df4e6d560f317be2712862c6141 Mon Sep 17 00:00:00 2001 From: Ferass El Hafidi Date: Wed, 22 Apr 2026 15:43:24 +0000 Subject: arm: meson: enable SYSRESET_PSCI Previously, Amlogic SoCs defined their own reset_cpu() implementation that essentially just did what the sysreset PSCI driver already supports. To reduce duplication (and allow for EFI Capsule on Disk support), make use of it instead of a board-specific reset_cpu. This does not affect SPL, as in that stage we do not actually have PSCI (BL31 is not loaded yet at that point). Also, boards that don't select PSCI support in their config will not have it enabled. Reviewed-by: Neil Armstrong Signed-off-by: Ferass El Hafidi Link: https://patch.msgid.link/20260422-b4-amlogic-sysreset-capsules-v3-2-07b5ccc8f552@postmarketos.org Signed-off-by: Neil Armstrong --- arch/arm/mach-meson/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mach-meson/Kconfig b/arch/arm/mach-meson/Kconfig index ef86129b535..c687ef822a2 100644 --- a/arch/arm/mach-meson/Kconfig +++ b/arch/arm/mach-meson/Kconfig @@ -12,6 +12,8 @@ config MESON64_COMMON select MMC_PWRSEQ select BOARD_LATE_INIT select MESON_SM + imply SYSRESET + imply SYSRESET_PSCI imply CMD_DM config MESON_GX -- cgit v1.2.3 From 94deb742654ae2f8996e9db17158834261b8c05e Mon Sep 17 00:00:00 2001 From: Ferass El Hafidi Date: Wed, 22 Apr 2026 15:43:25 +0000 Subject: configs: libretech-ac_defconfig: enable EFI Capsule on Disk Everything is already in place for EFI capsule updates, so enabling Capsule on Disk is fairly trivial. This allows updating U-Boot on SPI flash from Linux using fwupd's Capsule support. Reviewed-by: Neil Armstrong Signed-off-by: Ferass El Hafidi Link: https://patch.msgid.link/20260422-b4-amlogic-sysreset-capsules-v3-3-07b5ccc8f552@postmarketos.org Signed-off-by: Neil Armstrong --- configs/libretech-ac_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/libretech-ac_defconfig b/configs/libretech-ac_defconfig index 1a67ca734b8..17d54655017 100644 --- a/configs/libretech-ac_defconfig +++ b/configs/libretech-ac_defconfig @@ -23,6 +23,7 @@ CONFIG_DEBUG_UART=y CONFIG_REMAKE_ELF=y CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y +CONFIG_EFI_CAPSULE_ON_DISK=y CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y -- cgit v1.2.3 From e07cc9e7fdcc35780f539ee1d452ffd3da0fbd1f Mon Sep 17 00:00:00 2001 From: Ferass El Hafidi Date: Wed, 22 Apr 2026 15:43:26 +0000 Subject: configs: libretech-cc_defconfig: enable EFI Capsule on Disk Everything is in place to allow this board to support EFI Capsule updates. Enable everything needed to support Capsule updates, as well as Capsule on Disk. All this allows updating U-Boot on eMMC directly from linux using fwupd. Also enable DFU_MMC, which is a requirement for EFI Capsule flashing to eMMC/SD to work. Reviewed-by: Neil Armstrong Signed-off-by: Ferass El Hafidi Link: https://patch.msgid.link/20260422-b4-amlogic-sysreset-capsules-v3-4-07b5ccc8f552@postmarketos.org Signed-off-by: Neil Armstrong --- configs/libretech-cc_defconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configs/libretech-cc_defconfig b/configs/libretech-cc_defconfig index d5878bdc431..622922e97ee 100644 --- a/configs/libretech-cc_defconfig +++ b/configs/libretech-cc_defconfig @@ -16,6 +16,9 @@ CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_IDENT_STRING=" libretech-cc" CONFIG_DEBUG_UART=y CONFIG_REMAKE_ELF=y +CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y +CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y +CONFIG_EFI_CAPSULE_ON_DISK=y CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y @@ -38,6 +41,7 @@ CONFIG_OF_CONTROL=y CONFIG_ENV_RELOC_GD_ENV_ADDR=y CONFIG_SARADC_MESON=y CONFIG_DFU_RAM=y +CONFIG_DFU_MMC=y CONFIG_MMC_MESON_GX=y CONFIG_PHY_MESON_GXL=y CONFIG_DM_MDIO=y -- cgit v1.2.3