* [PATCH 0/2] add basic rk3288 smp support @ 2014-09-10 10:05 Kever Yang 2014-09-10 10:05 ` [PATCH 1/2] ARM: rockchip: add basic smp support for rk3288 Kever Yang 2014-09-10 10:05 ` [PATCH 2/2] ARM: dts: add intmem node for rk3288 smp support Kever Yang 0 siblings, 2 replies; 6+ messages in thread From: Kever Yang @ 2014-09-10 10:05 UTC (permalink / raw) To: heiko Cc: dianders, sonnyrao, addy.ke, cf, xjq, hj, huangtao, Kever Yang, Ian Campbell, devicetree, linux-kernel, Kumar Gala, Russell King, linux-rockchip, Rob Herring, Pawel Moll, Mark Rutland, linux-arm-kernel rk3288 is dual-core CPU Soc, we need to enable the smp. This patchset works with either arch-timer use the phisical counter in kernel or the firmware initialize the arch-timer virtual counter offset and use virtual counter in kernel. Kever Yang (2): ARM: rockchip: add basic smp support for rk3288 ARM: dts: add intmem node for rk3288 smp support arch/arm/boot/dts/rk3288.dtsi | 18 ++++++++++++ arch/arm/mach-rockchip/core.h | 1 + arch/arm/mach-rockchip/platsmp.c | 60 +++++++++++++++++++++++++++++++++++++--- 3 files changed, 75 insertions(+), 4 deletions(-) -- 1.9.1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] ARM: rockchip: add basic smp support for rk3288 2014-09-10 10:05 [PATCH 0/2] add basic rk3288 smp support Kever Yang @ 2014-09-10 10:05 ` Kever Yang 2014-09-10 19:17 ` Heiko Stübner 2014-09-11 17:41 ` Doug Anderson 2014-09-10 10:05 ` [PATCH 2/2] ARM: dts: add intmem node for rk3288 smp support Kever Yang 1 sibling, 2 replies; 6+ messages in thread From: Kever Yang @ 2014-09-10 10:05 UTC (permalink / raw) To: heiko Cc: dianders, sonnyrao, addy.ke, cf, xjq, hj, huangtao, Kever Yang, Russell King, linux-arm-kernel, linux-rockchip, linux-kernel basic rk3288 smp support Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> --- arch/arm/mach-rockchip/core.h | 1 + arch/arm/mach-rockchip/platsmp.c | 60 +++++++++++++++++++++++++++++++++++++--- 2 files changed, 57 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-rockchip/core.h b/arch/arm/mach-rockchip/core.h index 39bca96..b2ade69 100644 --- a/arch/arm/mach-rockchip/core.h +++ b/arch/arm/mach-rockchip/core.h @@ -18,3 +18,4 @@ extern char rockchip_secondary_trampoline_end; extern unsigned long rockchip_boot_fn; extern void rockchip_secondary_startup(void); +extern void secondary_startup(void); diff --git a/arch/arm/mach-rockchip/platsmp.c b/arch/arm/mach-rockchip/platsmp.c index 189684f..fcd33fd 100644 --- a/arch/arm/mach-rockchip/platsmp.c +++ b/arch/arm/mach-rockchip/platsmp.c @@ -77,6 +77,12 @@ static int __cpuinit rockchip_boot_secondary(unsigned int cpu, /* start the core */ pmu_set_power_domain(0 + cpu, true); + /* wait for cpu 1~3 bootup and run into wfe state */ + udelay(10); + writel(virt_to_phys(secondary_startup), sram_base_addr + 8); + writel(0xDEADBEAF, sram_base_addr + 4); + dsb_sev(); + return 0; } @@ -125,7 +131,7 @@ static int __init rockchip_smp_prepare_sram(struct device_node *node) return 0; } -static void __init rockchip_smp_prepare_cpus(unsigned int max_cpus) +static void __init rk3066_smp_prepare_cpus(unsigned int max_cpus) { struct device_node *node; unsigned int i; @@ -194,12 +200,58 @@ static void rockchip_cpu_die(unsigned int cpu) } #endif -static struct smp_operations rockchip_smp_ops __initdata = { - .smp_prepare_cpus = rockchip_smp_prepare_cpus, +static void __init rk3288_smp_prepare_cpus(unsigned int max_cpus) +{ + struct device_node *node; + unsigned int i; + + node = of_find_compatible_node(NULL, NULL, "rockchip,rk3066-smp-sram"); + if (!node) { + pr_err("%s: could not find sram dt node\n", __func__); + return; + } + + sram_base_addr = of_iomap(node, 0); + if (!sram_base_addr) { + pr_err("%s: could not map pmu registers\n", __func__); + return; + } + + node = of_find_compatible_node(NULL, NULL, "rockchip,rk3288-pmu"); + if (!node) { + pr_err("%s: could not find pmu dt node\n", __func__); + return; + } + + pmu_base_addr = of_iomap(node, 0); + if (!pmu_base_addr) { + pr_err("%s: could not map pmu registers\n", __func__); + return; + } + + ncores = 4; + + /* Make sure that all cores except the first are really off */ + for (i = 1; i < ncores; i++) + pmu_set_power_domain(0 + i, false); +} + +static struct smp_operations rockchip3066_smp_ops __initdata = { + .smp_prepare_cpus = rk3066_smp_prepare_cpus, + .smp_boot_secondary = rockchip_boot_secondary, +#ifdef CONFIG_HOTPLUG_CPU + .cpu_kill = rockchip_cpu_kill, + .cpu_die = rockchip_cpu_die, +#endif +}; +CPU_METHOD_OF_DECLARE(rk3066_smp, "rockchip,rk3066-smp", &rockchip3066_smp_ops); + +static struct smp_operations rockchip3288_smp_ops __initdata = { + .smp_prepare_cpus = rk3288_smp_prepare_cpus, .smp_boot_secondary = rockchip_boot_secondary, #ifdef CONFIG_HOTPLUG_CPU .cpu_kill = rockchip_cpu_kill, .cpu_die = rockchip_cpu_die, #endif }; -CPU_METHOD_OF_DECLARE(rk3066_smp, "rockchip,rk3066-smp", &rockchip_smp_ops); +CPU_METHOD_OF_DECLARE(rk3288_smp, "rockchip,rk3288-smp", &rockchip3288_smp_ops); -- 1.9.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] ARM: rockchip: add basic smp support for rk3288 2014-09-10 10:05 ` [PATCH 1/2] ARM: rockchip: add basic smp support for rk3288 Kever Yang @ 2014-09-10 19:17 ` Heiko Stübner 2014-09-11 17:41 ` Doug Anderson 1 sibling, 0 replies; 6+ messages in thread From: Heiko Stübner @ 2014-09-10 19:17 UTC (permalink / raw) To: Kever Yang Cc: dianders, sonnyrao, addy.ke, cf, xjq, hj, huangtao, Russell King, linux-arm-kernel, linux-rockchip, linux-kernel Hi Kever, Am Mittwoch, 10. September 2014, 18:05:53 schrieb Kever Yang: > basic rk3288 smp support > > Signed-off-by: Heiko Stuebner <heiko@sntech.de> > Signed-off-by: Kever Yang <kever.yang@rock-chips.com> > --- > > arch/arm/mach-rockchip/core.h | 1 + > arch/arm/mach-rockchip/platsmp.c | 60 > +++++++++++++++++++++++++++++++++++++--- 2 files changed, 57 insertions(+), > 4 deletions(-) > > diff --git a/arch/arm/mach-rockchip/core.h b/arch/arm/mach-rockchip/core.h > index 39bca96..b2ade69 100644 > --- a/arch/arm/mach-rockchip/core.h > +++ b/arch/arm/mach-rockchip/core.h > @@ -18,3 +18,4 @@ extern char rockchip_secondary_trampoline_end; > > extern unsigned long rockchip_boot_fn; > extern void rockchip_secondary_startup(void); > +extern void secondary_startup(void); > diff --git a/arch/arm/mach-rockchip/platsmp.c > b/arch/arm/mach-rockchip/platsmp.c index 189684f..fcd33fd 100644 > --- a/arch/arm/mach-rockchip/platsmp.c > +++ b/arch/arm/mach-rockchip/platsmp.c > @@ -77,6 +77,12 @@ static int __cpuinit rockchip_boot_secondary(unsigned int > cpu, /* start the core */ > pmu_set_power_domain(0 + cpu, true); > > + /* wait for cpu 1~3 bootup and run into wfe state */ > + udelay(10); > + writel(virt_to_phys(secondary_startup), sram_base_addr + 8); > + writel(0xDEADBEAF, sram_base_addr + 4); > + dsb_sev(); > + Are you sure this also works on the Cortex-A9, which do share the rockchip_boot_secondary function here? This is also the area where the rk3066/rk3188 put their bringup trampoline, so writing new values there might break the code fragment for them. > return 0; > } > > @@ -125,7 +131,7 @@ static int __init rockchip_smp_prepare_sram(struct > device_node *node) return 0; > } > > -static void __init rockchip_smp_prepare_cpus(unsigned int max_cpus) > +static void __init rk3066_smp_prepare_cpus(unsigned int max_cpus) > { > struct device_node *node; > unsigned int i; > @@ -194,12 +200,58 @@ static void rockchip_cpu_die(unsigned int cpu) > } > #endif > > -static struct smp_operations rockchip_smp_ops __initdata = { > - .smp_prepare_cpus = rockchip_smp_prepare_cpus, > +static void __init rk3288_smp_prepare_cpus(unsigned int max_cpus) > +{ > + struct device_node *node; > + unsigned int i; > + > + node = of_find_compatible_node(NULL, NULL, "rockchip,rk3066-smp-sram"); > + if (!node) { > + pr_err("%s: could not find sram dt node\n", __func__); > + return; > + } > + > + sram_base_addr = of_iomap(node, 0); > + if (!sram_base_addr) { > + pr_err("%s: could not map pmu registers\n", __func__); > + return; > + } > + > + node = of_find_compatible_node(NULL, NULL, "rockchip,rk3288-pmu"); > + if (!node) { > + pr_err("%s: could not find pmu dt node\n", __func__); > + return; > + } > + > + pmu_base_addr = of_iomap(node, 0); > + if (!pmu_base_addr) { > + pr_err("%s: could not map pmu registers\n", __func__); > + return; > + } > + > + ncores = 4; > + > + /* Make sure that all cores except the first are really off */ > + for (i = 1; i < ncores; i++) > + pmu_set_power_domain(0 + i, false); > +} > + > +static struct smp_operations rockchip3066_smp_ops __initdata = { > + .smp_prepare_cpus = rk3066_smp_prepare_cpus, > + .smp_boot_secondary = rockchip_boot_secondary, > +#ifdef CONFIG_HOTPLUG_CPU > + .cpu_kill = rockchip_cpu_kill, > + .cpu_die = rockchip_cpu_die, > +#endif > +}; > +CPU_METHOD_OF_DECLARE(rk3066_smp, "rockchip,rk3066-smp", > &rockchip3066_smp_ops); + > +static struct smp_operations rockchip3288_smp_ops __initdata = { > + .smp_prepare_cpus = rk3288_smp_prepare_cpus, > .smp_boot_secondary = rockchip_boot_secondary, > #ifdef CONFIG_HOTPLUG_CPU > .cpu_kill = rockchip_cpu_kill, > .cpu_die = rockchip_cpu_die, > #endif > }; > -CPU_METHOD_OF_DECLARE(rk3066_smp, "rockchip,rk3066-smp", > &rockchip_smp_ops); +CPU_METHOD_OF_DECLARE(rk3288_smp, > "rockchip,rk3288-smp", &rockchip3288_smp_ops); ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] ARM: rockchip: add basic smp support for rk3288 2014-09-10 10:05 ` [PATCH 1/2] ARM: rockchip: add basic smp support for rk3288 Kever Yang 2014-09-10 19:17 ` Heiko Stübner @ 2014-09-11 17:41 ` Doug Anderson 1 sibling, 0 replies; 6+ messages in thread From: Doug Anderson @ 2014-09-11 17:41 UTC (permalink / raw) To: Kever Yang Cc: Heiko Stübner, Sonny Rao, Addy Ke, Eddie Cai, Jianqun Xu, han jiang, Tao Huang, Russell King, linux-arm-kernel@lists.infradead.org, linux-rockchip, linux-kernel@vger.kernel.org Kever, On Wed, Sep 10, 2014 at 3:05 AM, Kever Yang <kever.yang@rock-chips.com> wrote: > -CPU_METHOD_OF_DECLARE(rk3066_smp, "rockchip,rk3066-smp", &rockchip_smp_ops); > +CPU_METHOD_OF_DECLARE(rk3288_smp, "rockchip,rk3288-smp", &rockchip3288_smp_ops); I haven't done a full review, but I think that the above means you need to update "Documentation/devicetree/bindings/arm/cpus.txt". -Doug ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] ARM: dts: add intmem node for rk3288 smp support 2014-09-10 10:05 [PATCH 0/2] add basic rk3288 smp support Kever Yang 2014-09-10 10:05 ` [PATCH 1/2] ARM: rockchip: add basic smp support for rk3288 Kever Yang @ 2014-09-10 10:05 ` Kever Yang 2014-09-11 17:58 ` Doug Anderson 1 sibling, 1 reply; 6+ messages in thread From: Kever Yang @ 2014-09-10 10:05 UTC (permalink / raw) To: heiko Cc: dianders, sonnyrao, addy.ke, cf, xjq, hj, huangtao, Kever Yang, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Russell King, linux-arm-kernel, linux-rockchip, devicetree, linux-kernel This patch add intmem node des which is needed by platsmp.c and enable the smp. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> --- arch/arm/boot/dts/rk3288.dtsi | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi index dca586e..562ec5f 100644 --- a/arch/arm/boot/dts/rk3288.dtsi +++ b/arch/arm/boot/dts/rk3288.dtsi @@ -40,6 +40,7 @@ #address-cells = <1>; #size-cells = <0>; + enable-method = "rockchip,rk3288-smp"; cpu@500 { device_type = "cpu"; compatible = "arm,cortex-a12"; @@ -353,6 +354,23 @@ status = "disabled"; }; + bus_intmem@ff700000 { + compatible = "mmio-sram"; + reg = <0xff700000 0x18000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0xff700000 0x18000>; + smp-sram@0 { + compatible = "rockchip,rk3066-smp-sram"; + reg = <0x00 0x10>; + }; + }; + + pmu_intmem@ff720000 { + compatible = "mmio-sram"; + reg = <0xff720000 0x4000>; + }; + pmu: power-management@ff730000 { compatible = "rockchip,rk3288-pmu", "syscon"; reg = <0xff730000 0x100>; -- 1.9.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] ARM: dts: add intmem node for rk3288 smp support 2014-09-10 10:05 ` [PATCH 2/2] ARM: dts: add intmem node for rk3288 smp support Kever Yang @ 2014-09-11 17:58 ` Doug Anderson 0 siblings, 0 replies; 6+ messages in thread From: Doug Anderson @ 2014-09-11 17:58 UTC (permalink / raw) To: Kever Yang Cc: Heiko Stübner, Sonny Rao, Addy Ke, Eddie Cai, Jianqun Xu, han jiang, Tao Huang, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Russell King, linux-arm-kernel@lists.infradead.org, linux-rockchip, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Kever, On Wed, Sep 10, 2014 at 3:05 AM, Kever Yang <kever.yang@rock-chips.com> wrote: > This patch add intmem node des which is needed by platsmp.c > and enable the smp. > > Signed-off-by: Heiko Stuebner <heiko@sntech.de> > Signed-off-by: Kever Yang <kever.yang@rock-chips.com> > --- > > arch/arm/boot/dts/rk3288.dtsi | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi > index dca586e..562ec5f 100644 > --- a/arch/arm/boot/dts/rk3288.dtsi > +++ b/arch/arm/boot/dts/rk3288.dtsi > @@ -40,6 +40,7 @@ > #address-cells = <1>; > #size-cells = <0>; > > + enable-method = "rockchip,rk3288-smp"; > cpu@500 { > device_type = "cpu"; > compatible = "arm,cortex-a12"; > @@ -353,6 +354,23 @@ > status = "disabled"; > }; > > + bus_intmem@ff700000 { > + compatible = "mmio-sram"; > + reg = <0xff700000 0x18000>; > + #address-cells = <1>; > + #size-cells = <1>; > + ranges = <0 0xff700000 0x18000>; > + smp-sram@0 { nit: I think the "smp-sram@0" line is indented one too many tabs. I haven't done a full review of this series yet, though... ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-09-11 17:58 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-09-10 10:05 [PATCH 0/2] add basic rk3288 smp support Kever Yang 2014-09-10 10:05 ` [PATCH 1/2] ARM: rockchip: add basic smp support for rk3288 Kever Yang 2014-09-10 19:17 ` Heiko Stübner 2014-09-11 17:41 ` Doug Anderson 2014-09-10 10:05 ` [PATCH 2/2] ARM: dts: add intmem node for rk3288 smp support Kever Yang 2014-09-11 17:58 ` Doug Anderson
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox