[PATCH v2 4/6] mach-snapdragon: fixup CPUs with PSCI enable-method

Stephan Gerhold stephan.gerhold at linaro.org
Wed Jun 3 16:05:26 CEST 2026


On Tue, Jun 02, 2026 at 05:19:00PM +1000, Sam Day via B4 Relay wrote:
> From: Sam Day <me at samcday.com>
> 
> If there's no PSCI implementation, then change the enable-method of all
> CPUs from "psci" to "spin-table". Later, when spin_table_update_dt runs,
> it will further patch the CPU nodes with the necessary cpu-release-addr.
> 
> This new fixup is only applied when CONFIG_ARMV8_SPIN_TABLE is enabled,
> since that also determines whether spin_table_update_dt runs.
> 
> Signed-off-by: Sam Day <me at samcday.com>
> ---
>  arch/arm/mach-snapdragon/board.c | 41 ++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 41 insertions(+)
> 
> diff --git a/arch/arm/mach-snapdragon/board.c b/arch/arm/mach-snapdragon/board.c
> index 829a0109ac7..3b08069af98 100644
> --- a/arch/arm/mach-snapdragon/board.c
> +++ b/arch/arm/mach-snapdragon/board.c
> @@ -183,7 +183,9 @@ static void show_psci_version(void)
>  static void qcom_psci_fixup(void *fdt)
>  {
>  	int offset, ret;
> +	uint reg;
>  	struct arm_smccc_res res;
> +	const char *prop;
>  
>  	arm_smccc_smc(ARM_PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0, 0, 0, 0, 0, &res);
>  
> @@ -198,6 +200,45 @@ static void qcom_psci_fixup(void *fdt)
>  	ret = fdt_del_node(fdt, offset);
>  	if (ret)
>  		log_err("Failed to delete /psci node: %d\n", ret);
> +
> +	if (!CONFIG_IS_ENABLED(ARMV8_SPIN_TABLE))
> +		return;
> +
> +	/* If spin-table support is enabled, make sure any CPU nodes with a
> +	 * PSCI enable-method are updated to spin-table. Further, any PSCI
> +	 * power-domains properties are removed.
> +	 */
> +
> +	offset = fdt_path_offset(fdt, "/cpus");
> +	if (offset < 0)
> +		return;
> +
> +	for (offset = fdt_first_subnode(fdt, offset);
> +	     offset >= 0;
> +	     offset = fdt_next_subnode(fdt, offset)) {

fdt_for_each_subnode()?

> +		prop = fdt_getprop(fdt, offset, "device_type", NULL);
> +		if (!prop || strcmp(prop, "cpu"))
> +			continue;
> +
> +		prop = fdt_getprop(fdt, offset, "enable-method", NULL);
> +		if (!prop || strcmp(prop, "psci"))
> +			continue;
> +
> +		reg = fdtdec_get_uint(fdt, offset, "reg", 0);
> +		ret = fdt_setprop_string(fdt, offset,
> +					 "enable-method", "spin-table");
> +		if (ret)
> +			log_err("Failed to set CPU%d enable-method to 'spin-table', this CPU will not be available to booted OS! %d\n",
> +				reg, ret);
> +
> +		log_info("Patched CPU%d enable-method to 'spin-table'\n", reg);
> +
> +		prop = fdt_getprop(fdt, offset, "power-domain-names", NULL);
> +		if (prop && !strcmp(prop, "psci")) {
> +			fdt_delprop(fdt, offset, "power-domains");
> +			fdt_delprop(fdt, offset, "power-domain-names");
> +		}

So what if there is more than one power domains assigned and only one of
them is "psci"? (I had this at some point in a draft for full cpufreq
support for MSM8916)

I guess it makes sense deleting the "psci" power domain, since the
"idle-states" modification lk2nd does depends on some non-upstream
functionality in the msm8916-mainline/linux fork. But then it should
ideally look at the names more carefully somehow.

Thanks,
Stephan


More information about the U-Boot mailing list