Re: [PATCH v5 3/8] clk: sunxi-ng: a733: Add PRCM CCU
From: Junhui Liu
Date: Tue Oct 06 2026 - 23:36:06 EST
Hi Vinicius,
Thanks for testing.
On Tue Oct 6, 2026 at 2:30 AM CST, Vinicius Pedrosa wrote:
> Hi Junhui,
>
> On Wed Sep 30, 2026 at 1:26 AM CST, Junhui Liu wrote:
>> +static SUNXI_CCU_GATE_HW(bus_r_msgbox_clk, "bus-r-msgbox", &r_ahb_clk.common.hw, 0x17c, BIT(0), 0);
>
> [...]
>
>> +static SUNXI_CCU_GATE_HW(bus_r_riscv_clk, "bus-r-riscv", &r_apb0_clk.common.hw,
>> + 0x21c, BIT(0), 0);
>
> I'm bringing up mainline on a Radxa Cubie A7Z (PCB V1.11, 1 GiB). With
> 7.3-rc6, this series and a local common-DT integration, PSCI reboot and
> power-off hang once unused clocks are disabled. The boot chain uses
> vendor boot0/BL31 and source-built SCP/U-Boot.
>
> Keeping both of these gates enabled fixes reboot; either alone still
> hangs. With only these two marked CLK_IS_CRITICAL, reboot returns to
> boot0 and power-off drops DCDC1 from 3.3 V to 0.7 V and turns off the
> green LED with power still connected. I haven't checked whether each
> gate is needed for power-off on its own.
>
> My guess is that BL31 talks to the SCP for these, but I haven't traced
> it, and it may be specific to the vendor firmware.
Yes, it appears that the vendor SCP firmware runs on the E902 core
instead of the ARISC OR100 core on the A733. Disabling either
bus-r-riscv or bus-r-msgbox breaks the SCPI communication path between
TF-A and the SCP firmware.
>
> Would it make sense to mark them CLK_IS_CRITICAL, like bus-r-cpucfg
> already is? I can test the next revision on this board either way.
Mainline TF-A uses native PSCI for reboot and power-off on the NCAT2
family. Even if Crust is ported to the A733 in the future, I would
expect it to run on the ARISC OR100 core rather than the E902 core.
(Also see discussion in [1].)
The E902 may also be supported by the Linux remoteproc and mailbox
drivers in the future. In that case, bus-r-riscv and bus-r-msgbox
should be managed by their respective drivers instead of being kept
enabled globally.
I don't know if marking these clocks as CLK_IS_CRITICAL just for the
vendor SCP firmware is a good idea...
[1] https://lore.kernel.org/linux-sunxi/556cd32394062960a3ea4af0011155cfa83ae91f.camel@xxxxxxxxxxx/T/#u
>
> Thanks,
> Vinicius
--
Best regards,
Junhui Liu