On 8/18/23 07:27, Andre Przywara wrote:
Hi Andre,
So instead of trying to derive some pattern from where there is none, I'd
rather do: config SUNXI_CPU_HOTPLUG_ADDRESS
hex
default 0x01c000bc if MACH_SUN8I_R40
But the hotplug flag register is at 0x01c000b8 for R40?
....
default 0x01c25da4
and then use that symbol in both places (v7 PSCI + v8 FEL).
As mentioned, I can fix the pieces that break when naively doing so in the
FEL code. That has also the rewarding property of allowing to remove both
SUNXI_R_CPUCFG_BASE and SUNXI_RTC_BASE from the code base completely.
I might hold on to SUNXI_RTC_BASE for a bit, since the SPL may need it
for the various reset-to-FEL mechanisms. I still want a nice way of
getting mainline U-Boot to do this in the near term.
What do you think?
I don't think this really solves your underlying grievance, since
various sunxis need distinct offsets to jump from the hotplug address
register to the secondary CPU soft entry point:
CONFIG_SUNXI_CPU_HOTPLUG_ADDRESS + 4 // for R40
CONFIG_SUNXI_CPU_HOTPLUG_ADDRESS + 8 // for R528
...at which point we're back to the "Kconfig symbol is really pointing
to a sort of control block" idea.
We could take advantage of the fact that ARMv7 psci.c and ARMv8
fel_utils.S are never both built and call it something horrible like
"SUNXI_CPU_HOTPLUG_OR_SOFT_ENTRY_ADDR" but then it wouldn't be clear
from a glance *which* it is. We could go with *two* (three, if we need
R528's CPU0 entry for a reset-to-FEL mechanism) Kconfig symbols, but
that's a lot for configuration symbols that are really only needed in
pretty much one place each.
Cheers,
Andre
Likewise,
Sam