All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Heiko Stübner" <heiko@sntech.de>
To: Russell King <linux@armlinux.org.uk>, jbx6244@gmail.com
Cc: linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
	Johan Jonker <jbx6244@gmail.com>
Subject: Re: [PATCH v2] ARM: rockchip: smp: enable secondary rk3066a/rk3188 CPUs
Date: Sat, 17 Oct 2026 00:36:55 +0200	[thread overview]
Message-ID: <1979829.CQOukoFCf9@diego> (raw)
In-Reply-To: <20261013-cpu-v2-v2-1-fe3bbc9edd33@gmail.com>

Hi Johan,

Am Dienstag, 13. Oktober 2026, 18:20:49 Mitteleuropäische Sommerzeit schrieb Johan Jonker via B4 Relay:
> From: Johan Jonker <jbx6244@gmail.com>
> 
> Early Rockchip SoCs like rk3066a and rk3188 had boot loaders
> that remapped the boot ROM and the internal memory. Currently
> U-boot makes use of a common board file without remapping
> resulting in the secondary CPUs power up hanging in a wait loop.
> 
> Make the various boot loader methods work by:
> 
> * add code that disables remapping on both rk3066 and rk3188
> * change to use the same boot ROM path for all socs in rockchip_boot_secondary()
> * drop the rockchip_smp_prepare_sram() part
> 
> Signed-off-by: Johan Jonker <jbx6244@gmail.com>

in general this seems to work on both my rk3188-rock and rk3066-marsboard,
after I did some changes:

> --- a/arch/arm/mach-rockchip/core.h
> +++ /dev/null
> @@ -1,10 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0-or-later */
> -/*
> - * Copyright (c) 2013 MundoReader S.L.
> - * Author: Heiko Stuebner <heiko@sntech.de>
> - */
> -
> -extern char rockchip_secondary_trampoline;
> -extern char rockchip_secondary_trampoline_end;
> -
> -extern unsigned long rockchip_boot_fn;

that file is included rockchip.c as well, not sure why that is in there,
but this include needs to be removed too.

[...]

> diff --git a/arch/arm/mach-rockchip/platsmp.c b/arch/arm/mach-rockchip/platsmp.c
> index f659d894bfae..ece17e9cbaca 100644
> --- a/arch/arm/mach-rockchip/platsmp.c
> +++ b/arch/arm/mach-rockchip/platsmp.c

[...]

> @@ -320,9 +279,27 @@ static void __init rockchip_smp_prepare_cpus(unsigned int max_cpus)
>  	for (i = 1; i < ncores; i++)
>  		pmu_set_power_domain(0 + i, false);
>  
> +	/* Make sure that the remap function is disabled */
>  	if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) {
> -		if (rockchip_smp_prepare_sram(node)) {
> -			of_node_put(node);
> +		unsigned int reg;
> +		int ret;
> +
> +		if (of_machine_is_compatible("rockchip,rk3066a")) {
> +			reg = RK3066_GRF_SOC_CON0;
> +			grf = syscon_regmap_lookup_by_compatible("rockchip,rk3066-grf");
> +		} else {
> +			reg = RK3188_GRF_SOC_CON0;
> +			grf = syscon_regmap_lookup_by_compatible("rockchip,rk3188-grf");
> +		}
> +
> +		if (IS_ERR(grf)) {
> +			pr_err("%s: could not find grf dt node\n", __func__);
> +			return;
> +		}
> +
> +		ret = regmap_update_bits(grf, reg, NOC_REMAP, 0);

the GRF registers use highword-masks, so this should probably be like
	ret = regmap_write(grf, reg, NOC_REMAP << 16);
enabling the NOC_REMAP bit for writing and thus having "0" written
to that bit.


Heiko




_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

WARNING: multiple messages have this Message-ID (diff)
From: "Heiko Stübner" <heiko@sntech.de>
To: Russell King <linux@armlinux.org.uk>, jbx6244@gmail.com
Cc: linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
	Johan Jonker <jbx6244@gmail.com>
Subject: Re: [PATCH v2] ARM: rockchip: smp: enable secondary rk3066a/rk3188 CPUs
Date: Sat, 17 Oct 2026 00:36:55 +0200	[thread overview]
Message-ID: <1979829.CQOukoFCf9@diego> (raw)
In-Reply-To: <20261013-cpu-v2-v2-1-fe3bbc9edd33@gmail.com>

Hi Johan,

Am Dienstag, 13. Oktober 2026, 18:20:49 Mitteleuropäische Sommerzeit schrieb Johan Jonker via B4 Relay:
> From: Johan Jonker <jbx6244@gmail.com>
> 
> Early Rockchip SoCs like rk3066a and rk3188 had boot loaders
> that remapped the boot ROM and the internal memory. Currently
> U-boot makes use of a common board file without remapping
> resulting in the secondary CPUs power up hanging in a wait loop.
> 
> Make the various boot loader methods work by:
> 
> * add code that disables remapping on both rk3066 and rk3188
> * change to use the same boot ROM path for all socs in rockchip_boot_secondary()
> * drop the rockchip_smp_prepare_sram() part
> 
> Signed-off-by: Johan Jonker <jbx6244@gmail.com>

in general this seems to work on both my rk3188-rock and rk3066-marsboard,
after I did some changes:

> --- a/arch/arm/mach-rockchip/core.h
> +++ /dev/null
> @@ -1,10 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0-or-later */
> -/*
> - * Copyright (c) 2013 MundoReader S.L.
> - * Author: Heiko Stuebner <heiko@sntech.de>
> - */
> -
> -extern char rockchip_secondary_trampoline;
> -extern char rockchip_secondary_trampoline_end;
> -
> -extern unsigned long rockchip_boot_fn;

that file is included rockchip.c as well, not sure why that is in there,
but this include needs to be removed too.

[...]

> diff --git a/arch/arm/mach-rockchip/platsmp.c b/arch/arm/mach-rockchip/platsmp.c
> index f659d894bfae..ece17e9cbaca 100644
> --- a/arch/arm/mach-rockchip/platsmp.c
> +++ b/arch/arm/mach-rockchip/platsmp.c

[...]

> @@ -320,9 +279,27 @@ static void __init rockchip_smp_prepare_cpus(unsigned int max_cpus)
>  	for (i = 1; i < ncores; i++)
>  		pmu_set_power_domain(0 + i, false);
>  
> +	/* Make sure that the remap function is disabled */
>  	if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) {
> -		if (rockchip_smp_prepare_sram(node)) {
> -			of_node_put(node);
> +		unsigned int reg;
> +		int ret;
> +
> +		if (of_machine_is_compatible("rockchip,rk3066a")) {
> +			reg = RK3066_GRF_SOC_CON0;
> +			grf = syscon_regmap_lookup_by_compatible("rockchip,rk3066-grf");
> +		} else {
> +			reg = RK3188_GRF_SOC_CON0;
> +			grf = syscon_regmap_lookup_by_compatible("rockchip,rk3188-grf");
> +		}
> +
> +		if (IS_ERR(grf)) {
> +			pr_err("%s: could not find grf dt node\n", __func__);
> +			return;
> +		}
> +
> +		ret = regmap_update_bits(grf, reg, NOC_REMAP, 0);

the GRF registers use highword-masks, so this should probably be like
	ret = regmap_write(grf, reg, NOC_REMAP << 16);
enabling the NOC_REMAP bit for writing and thus having "0" written
to that bit.


Heiko





  reply	other threads:[~2026-10-16 22:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13 16:20 [PATCH v2] ARM: rockchip: smp: enable secondary rk3066a/rk3188 CPUs Johan Jonker via B4 Relay
2026-10-13 16:20 ` Johan Jonker
2026-10-13 16:20 ` Johan Jonker via B4 Relay
2026-10-16 22:36 ` Heiko Stübner [this message]
2026-10-16 22:36   ` Heiko Stübner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1979829.CQOukoFCf9@diego \
    --to=heiko@sntech.de \
    --cc=jbx6244@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.