SMP and CPU hotplug support for Meson8/Meson8b
Martin Blumenstingl
reviewerv3 cover SMP and CPU hotplug support for Meson8/Meson8b
This patchset adds support for booting the secondary CPU cores (and taking them offline again) on Amlogic Meson8 and Meson8b SoCs. It is based on an earlier version from Carlo Caione - this helped me a lot to get a better understanding of how SMP/CPU hotplug works (compared to the code found in Amlogic's GPL kernel sources from year 2015).
The .dts changes from series depend on:
- "add the reset controller to the Meson8b clkc", see [1]
- "ARM: dts: meson: add a node which describes the SRAM", see [2]
Changes since v2 from [0]
- added support for Meson8 (which requires a slightly different enable-method)
- implemented CPU hotplug support which allows taking a CPU core offline for both, Meson8 and Meson8b
- add a function to smp_scu.c which allows enabling a CPU core from a different CPU (previously only the power mode for the current CPU could be changed). Without this the CPU cores on Meson8 won't come up (Amlogic's vendor GPL kernel sources also enable power through SCU as very first step for Meson8b as well)
- add a function to smp_scu.c to get the power status of a CPU core (which is needed because the code in .cpu_kill needs to wait until the core is actually powered off)
- dropped patch "ARM: DTS: meson8b: Extend L2 cache controller node" as it is already applied (for both, Meson8 and Meson8b)
- dropped the patches which implement the reset controller which is built into the clock-controller, these are a separate series: [1]
- moved the enable-method property to each CPU node
[0] http://lists.infradead.org/pipermail/linux-arm-kernel/2015-December/390355.html
[1] http://lists.infradead.org/pipermail/linux-amlogic/2017-July/004283.html
[2] http://lists.infradead.org/pipermail/linux-amlogic/2017-July/004282.html
Carlo Caione (2):
dt-bindings: Amlogic: Add Meson8 and Meson8b SMP related documentation
ARM: dts: meson8b: add support for booting the secondary CPU cores
Martin Blumenstingl (4):
ARM: smp_scu: add a helper for powering on a specific CPU
ARM: smp_scu: allow the platform code to read the SCU CPU status
ARM: meson: Add SMP bringup code for Meson8 and Meson8b
ARM: dts: meson8: add support for booting the secondary CPU cores
.../devicetree/bindings/arm/amlogic/pmu.txt | 18 + .../devicetree/bindings/arm/amlogic/smp-sram.txt | 32 ++ Documentation/devicetree/bindings/arm/cpus.txt | 2 + arch/arm/Makefile | 1 + arch/arm/boot/dts/meson8.dtsi | 20 + arch/arm/boot/dts/meson8b.dtsi | 20 + arch/arm/include/asm/smp_scu.h | 12 + arch/arm/kernel/smp_scu.c | 47 +- arch/arm/mach-meson/Kconfig | 1 + arch/arm/mach-meson/Makefile | 1 + arch/arm/mach-meson/platsmp.c | 502 +++++++++++++++++++++ 11 files changed, 650 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/amlogic/pmu.txt create mode 100644 Documentation/devicetree/bindings/arm/amlogic/smp-sram.txt create mode 100644 arch/arm/mach-meson/platsmp.c
Signature · 1 line
2.13.2
Martin Blumenstingl
reviewerPATCH v3 1/6 dt-bindings: Amlogic: Add Meson8 and Meson8b SMP related documentation
From: Carlo Caione <[email protected]>
With this patch we add documentation for:
* power-management-unit: the PMU is used to bring up the cores during SMP operations
* sram: among other things the sram is used to store the first code executed by the core when it is powered up
* cpu-enable-method: the CPU enable method used by Amlogic Meson8 and Meson8b SoCs
--- .../devicetree/bindings/arm/amlogic/pmu.txt | 18 ++++++++++++ .../devicetree/bindings/arm/amlogic/smp-sram.txt | 32 ++++++++++++++++++++++ Documentation/devicetree/bindings/arm/cpus.txt | 2 ++ 3 files changed, 52 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/amlogic/pmu.txt create mode 100644 Documentation/devicetree/bindings/arm/amlogic/smp-sram.txt
Documentation/devicetree/bindings/arm/amlogic/pmu.txt new file +18 -0
@@ -0,0 +1,18 @@ +Amlogic Meson8 and Meson8b power-management-unit: +------------------------------------------------- + +The pmu is used to turn off and on different power domains of the SoCs +This includes the power to the CPU cores. + +Required node properties: +- compatible value : depending on the SoC this should be one of: + "amlogic,meson8-pmu" + "amlogic,meson8b-pmu" +- reg : physical base address and the size of the registers window + +Example: + + pmu at c81000e4 { + compatible = "amlogic,meson8b-pmu", "syscon"; + reg = <0xc81000e0 0x18>; + };
Documentation/devicetree/bindings/arm/amlogic/smp-sram.txt new file +32 -0
@@ -0,0 +1,32 @@ +Amlogic Meson8 and Meson8b SRAM for smp bringup: +------------------------------------------------ + +Amlogic's SMP-capable SoCs use part of the sram for the bringup of the cores. +Once the core gets powered up it executes the code that is residing at a +specific location. + +Therefore a reserved section sub-node has to be added to the mmio-sram +declaration. + +Required sub-node properties: +- compatible : depending on the SoC this should be one of: + "amlogic,meson8-smp-sram" + "amlogic,meson8b-smp-sram" + +The rest of the properties should follow the generic mmio-sram discription +found in ../../misc/sram.txt + +Example: + + sram: sram at d9000000 { + compatible = "mmio-sram"; + reg = <0xd9000000 0x20000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0xd9000000 0x20000>; + + smp-sram at 1ff80 { + compatible = "amlogic,meson8b-smp-sram"; + reg = <0x1ff80 0x8>; + }; + };
Documentation/devicetree/bindings/arm/cpus.txt +2 -0
@@ -197,6 +197,8 @@ described below. "actions,s500-smp" "allwinner,sun6i-a31" "allwinner,sun8i-a23" + "amlogic,meson8-smp" + "amlogic,meson8b-smp" "arm,realview-smp" "brcm,bcm11351-cpu-method" "brcm,bcm23550"
Signature · 1 line
2.13.2
Rob Herring
maintainerPATCH v3 1/6 dt-bindings: Amlogic: Add Meson8 and Meson8b SMP related documentation
Quoted 14 lines · Martin Blumenstingl
From: Carlo Caione <[email protected]>
With this patch we add documentation for:
* power-management-unit: the PMU is used to bring up the cores during SMP operations
* sram: among other things the sram is used to store the first code executed by the core when it is powered up
* cpu-enable-method: the CPU enable method used by Amlogic Meson8 and Meson8b SoCsSigned-off-by Carlo Caione <[email protected]>[also add Meson8 to the documentation]Signed-off-by Martin Blumenstingl <[email protected]>
Quoted 7 lines
--- .../devicetree/bindings/arm/amlogic/pmu.txt | 18 ++++++++++++ .../devicetree/bindings/arm/amlogic/smp-sram.txt | 32 ++++++++++++++++++++++ Documentation/devicetree/bindings/arm/cpus.txt | 2 ++ 3 files changed, 52 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/amlogic/pmu.txt create mode 100644 Documentation/devicetree/bindings/arm/amlogic/smp-sram.txt
Martin Blumenstingl
reviewerPATCH v3 2/6 ARM: smp_scu: add a helper for powering on a specific CPU
In reply to Martin BlumenstinglTo boot the secondary CPUs on the Amlogic Meson8/Meson8m2 (Cortex-A9) and Meson8b (Cortex-A5) SoCs we have to enable SCU mode SCU_PM_NORMAL, otherwise the secondary cores will not start.
This patch adds a scu_cpu_power_enable() function which can be used to enable SCU_PM_NORMAL for a specific (logical) CPU. An internal helper function is also created, to avoid code duplication with scu_power_mode().
--- arch/arm/include/asm/smp_scu.h | 6 ++++++ arch/arm/kernel/smp_scu.c | 39 +++++++++++++++++++++++++++++---------- 2 files changed, 35 insertions(+), 10 deletions(-)
arch/arm/include/asm/smp_scu.h +6 -0
@@ -26,6 +26,7 @@ static inline unsigned long scu_a9_get_base(void)#ifdef CONFIG_HAVE_ARM_SCU unsigned int scu_get_core_count (void __iomem *);int scu_power_mode (void __iomem *,unsigned int ); +int scu_cpu_power_enable (void __iomem *,unsigned int );#else static inline unsigned int scu_get_core_count (void __iomem *scu_base) {
@@ -35,6 +36,11 @@ static inline int scu_power_mode(void __iomem *scu_base, unsigned int mode) {return -EINVAL ; } +static inline int scu_cpu_power_enable (void __iomem *scu_base, +unsigned int mode) +{ +return -EINVAL ; +}#endif #if defined(CONFIG_SMP ) && defined(CONFIG_HAVE_ARM_SCU )
arch/arm/kernel/smp_scu.c +29 -10
@@ -72,18 +72,12 @@ void scu_enable(void __iomem *scu_base) }#endif -/* -* Set the executing CPUs power mode as defined. This will be in -* preparation for it executing a WFI instruction. -* -* This function must be called with preemption disabled, and as it -* has the side effect of disabling coherency, caches must have been -* flushed. Interrupts must also have been disabled. -*/ -int scu_power_mode (void __iomem *scu_base,unsigned int mode) +static int scu_set_power_mode_internal (void __iomem *scu_base, +unsigned int logical_cpu, +unsigned int mode) {unsigned int val; -int cpu =MPIDR_AFFINITY_LEVEL (cpu_logical_map (smp_processor_id ()),0 ); +int cpu =MPIDR_AFFINITY_LEVEL (cpu_logical_map (logical_cpu),0 );if (mode >3 || mode ==1 || cpu >3 )return -EINVAL ;
@@ -94,3 +88,28 @@ int scu_power_mode(void __iomem *scu_base, unsigned int mode)return 0 ; } + +/* +* Set the executing CPUs power mode as defined. This will be in +* preparation for it executing a WFI instruction. +* +* This function must be called with preemption disabled, and as it +* has the side effect of disabling coherency, caches must have been +* flushed. Interrupts must also have been disabled. +*/ +int scu_power_mode (void __iomem *scu_base,unsigned int mode) +{ +return scu_set_power_mode_internal (scu_base,smp_processor_id (), mode); +} + +/* +* Set the executing CPUs power mode to SCU_PM_NORMAL. +* +* This function must be called with preemption disabled, and as it +* has the side effect of disabling coherency, caches must have been +* flushed. Interrupts must also have been disabled. +*/ +int scu_cpu_power_enable (void __iomem *scu_base,unsigned int cpu) +{ +return scu_set_power_mode_internal (scu_base, cpu,SCU_PM_NORMAL ); +}
Signature · 1 line
2.13.2
Martin Blumenstingl
reviewerPATCH v3 3/6 ARM: smp_scu: allow the platform code to read the SCU CPU status
In reply to Martin BlumenstinglOn Amlogic Meson8 / Meson8m2 (both Cortex-A9) and Meson8b (Cortex-A5) the CPU hotplug code needs to wait until the SCU status of the CPU that is being taken offline is SCU_PM_POWEROFF.
Provide a utility function (which can be invoked for example from .cpu_kill()) which allows reading the SCU status of a CPU.
--- arch/arm/include/asm/smp_scu.h | 6 ++++++ arch/arm/kernel/smp_scu.c | 18 +++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-)
arch/arm/include/asm/smp_scu.h +6 -0
@@ -27,6 +27,7 @@ static inline unsigned long scu_a9_get_base(void)unsigned int scu_get_core_count (void __iomem *);int scu_power_mode (void __iomem *,unsigned int );int scu_cpu_power_enable (void __iomem *,unsigned int ); +int scu_get_cpu_power_mode (void __iomem *scu_base,unsigned int logical_cpu);#else static inline unsigned int scu_get_core_count (void __iomem *scu_base) {
@@ -41,6 +42,11 @@ static inline int scu_cpu_power_enable(void __iomem *scu_base, {return -EINVAL ; } +static inline int scu_get_cpu_power_mode (void __iomem *scu_base, +unsigned int logical_cpu) +{ +return -EINVAL ; +}#endif #if defined(CONFIG_SMP ) && defined(CONFIG_HAVE_ARM_SCU )
arch/arm/kernel/smp_scu.c +17 -1
@@ -21,6 +21,7 @@#define SCU_STANDBY_ENABLE (1 << 5)#define SCU_CONFIG 0x04#define SCU_CPU_STATUS 0x08 +#define SCU_CPU_STATUS_MASK GENMASK(1, 0)#define SCU_INVALIDATE 0x0c#define SCU_FPGA_REVISION 0x10
@@ -82,7 +83,8 @@ static int scu_set_power_mode_internal(void __iomem *scu_base,if (mode >3 || mode ==1 || cpu >3 )return -EINVAL ; - val =readb_relaxed (scu_base +SCU_CPU_STATUS + cpu) & ~0x03 ; + val =readb_relaxed (scu_base +SCU_CPU_STATUS + cpu); + val &= ~SCU_CPU_STATUS_MASK ; val |= mode;writeb_relaxed (val, scu_base +SCU_CPU_STATUS + cpu);
@@ -113,3 +115,17 @@ int scu_cpu_power_enable(void __iomem *scu_base, unsigned int cpu) {return scu_set_power_mode_internal (scu_base, cpu,SCU_PM_NORMAL ); } + +int scu_get_cpu_power_mode (void __iomem *scu_base,unsigned int logical_cpu) +{ +unsigned int val; +int cpu =MPIDR_AFFINITY_LEVEL (cpu_logical_map (logical_cpu),0 ); + +if (cpu >3 ) +return -EINVAL ; + + val =readb_relaxed (scu_base +SCU_CPU_STATUS + cpu); + val &=SCU_CPU_STATUS_MASK ; + +return val; +}
Signature · 1 line
2.13.2
Martin Blumenstingl
reviewerPATCH v3 4/6 ARM: meson: Add SMP bringup code for Meson8 and Meson8b
In reply to Martin BlumenstinglThis adds the necessary SMP-operations and startup code to use the additional cores on the Amlogic Meson8/Meson8m2 (both are using the same sequence) and Meson8b (using a slightly difference sequence) SoCs.
--- arch/arm/Makefile | 1 + arch/arm/mach-meson/Kconfig | 1 + arch/arm/mach-meson/Makefile | 1 + arch/arm/mach-meson/platsmp.c | 502 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 505 insertions(+) create mode 100644 arch/arm/mach-meson/platsmp.c
arch/arm/Makefile +1 -0
@@ -147,6 +147,7 @@ textofs-$(CONFIG_SA1111) := 0x00208000 endif textofs-$(CONFIG_ARCH_MSM8X60) := 0x00208000 textofs-$(CONFIG_ARCH_MSM8960) := 0x00208000 +textofs-$(CONFIG_ARCH_MESON) := 0x00208000 textofs-$(CONFIG_ARCH_AXXIA) := 0x00308000 # Machine directory name. This list is sorted alphanumerically
arch/arm/mach-meson/Kconfig +1 -0
@@ -9,6 +9,7 @@ menuconfig ARCH_MESON select PINCTRL_MESON select COMMON_CLK select COMMON_CLK_AMLOGIC + select HAVE_ARM_SCU if SMP if ARCH_MESON
arch/arm/mach-meson/Makefile +1 -0
@@ -1 +1,2 @@ obj-$(CONFIG_ARCH_MESON) += meson.o +obj-$(CONFIG_SMP) += platsmp.o
arch/arm/mach-meson/platsmp.c new file +502 -0
502 lines not on this page · raw message
Signature · 1 line
2.13.2
Russell King - ARM Linux
maintainerPATCH v3 4/6 ARM: meson: Add SMP bringup code for Meson8 and Meson8b
arch/arm/mach-meson/platsmp.c line 59
Quoted 13 lines · Martin Blumenstingl
arch/arm/mach-meson/platsmp.c new file +13
-0+static DEFINE_SPINLOCK (boot_lock); + +/* +* Write pen_release in a way that is guaranteed to be visible to all +* observers, irrespective of whether they're taking part in coherency +* or not. This is necessary for the hotplug code to work reliably. +*/ +static void write_pen_release (int val) +{ + pen_release = val; +smp_wmb (); +sync_cache_w (&pen_release); +}
Hi Martin,
This looks like a classic case of cargo-cult copying of the early ARM Ltd Realview SMP code, and people really need to understand that is not a good implementation to copy. The Realview platforms are very limited in what they can do: there's no power control of the CPU cores, and there's no individual reset. These platforms are evaluation platforms for the CPUs, where the CPUs themselves are often "test chips". They are not production systems.
The only way to control the cores on these platforms is via software loops such as the holding pen and loops in the hotplug code, since the CPUs always have to be executing some code somewhere. There are other issues too which required the boot_lock (to ensure local timer calibration worked.)
None of these issues apply to production SMP platforms, so you likely do not need any of this - and I see from your code that you do have power and reset controls for the CPUs. What I'm basically saying here is:
please rip out the holding pen and boot_lock code from your SMP implementation.
If you do need it, please include a detailed explanation why it's required - requiring it suggests that the hardware is broken, and probably doesn't support hotplug and therefore does not support suspend/ resume.
Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.
Martin Blumenstingl
reviewerPATCH v3 4/6 ARM: meson: Add SMP bringup code for Meson8 and Meson8b
Hi Russel,
Quoted 37 lines · Russell King - ARM Linux
arch/arm/mach-meson/platsmp.c line 59
Quoted 13 lines · Martin Blumenstingl
arch/arm/mach-meson/platsmp.c new file +13
-0+static DEFINE_SPINLOCK (boot_lock); + +/* +* Write pen_release in a way that is guaranteed to be visible to all +* observers, irrespective of whether they're taking part in coherency +* or not. This is necessary for the hotplug code to work reliably. +*/ +static void write_pen_release (int val) +{ + pen_release = val; +smp_wmb (); +sync_cache_w (&pen_release); +}Hi Martin,
This looks like a classic case of cargo-cult copying of the early ARM Ltd Realview SMP code, and people really need to understand that is not a good implementation to copy. The Realview platforms are very limited in what they can do: there's no power control of the CPU cores, and there's no individual reset. These platforms are evaluation platforms for the CPUs, where the CPUs themselves are often "test chips". They are not production systems.
The only way to control the cores on these platforms is via software loops such as the holding pen and loops in the hotplug code, since the CPUs always have to be executing some code somewhere. There are other issues too which required the
boot_lock(to ensure local timer calibration worked.)None of these issues apply to production SMP platforms, so you likely do not need any of this - and I see from your code that you do have power and reset controls for the CPUs. What I'm basically saying here is:
please rip out the holding pen andboot_lockcode from your SMP implementation.
Quoted 4 lines
If you do need it, please include a detailed explanation why it's required - requiring it suggests that the hardware is broken, and probably doesn't support hotplug and therefore does not support suspend/ resume.
uh, I see - thank you for the explanation!
you are probably right when you say that it's not needed - I added it when implementing Meson8 support (Carlo's series only handled Meson8b). I couldn't get it working on Meson8 at first, but that was before I found out that we have to enable power through SCU first.
I will remove and re-test this later - many thanks for looking into this (and for the detailed explanation).
this will probably make the code much easier to read :)
one more question:
the code uses some memory barrier macros (smp_wmb(), smp_rmb(), mb() and dsb_sev()).
unfortunately I'm not very familiar with these - could you please have a look at this and let me know which ones you would keep or remove? secondary_start_kernel() is already flushing some caches, so maybe those barriers can also be removed
Regards,
Martin
Martin Blumenstingl
reviewerPATCH v3 4/6 ARM: meson: Add SMP bringup code for Meson8 and Meson8b
Quoted 51 lines · Martin Blumenstingl
Hi Russel,
Quoted 37 lines · Russell King - ARM Linux
arch/arm/mach-meson/platsmp.c line 59
Quoted 13 lines · Martin Blumenstingl
arch/arm/mach-meson/platsmp.c new file +13
-0+static DEFINE_SPINLOCK (boot_lock); + +/* +* Write pen_release in a way that is guaranteed to be visible to all +* observers, irrespective of whether they're taking part in coherency +* or not. This is necessary for the hotplug code to work reliably. +*/ +static void write_pen_release (int val) +{ + pen_release = val; +smp_wmb (); +sync_cache_w (&pen_release); +}Hi Martin,
This looks like a classic case of cargo-cult copying of the early ARM Ltd Realview SMP code, and people really need to understand that is not a good implementation to copy. The Realview platforms are very limited in what they can do: there's no power control of the CPU cores, and there's no individual reset. These platforms are evaluation platforms for the CPUs, where the CPUs themselves are often "test chips". They are not production systems.
The only way to control the cores on these platforms is via software loops such as the holding pen and loops in the hotplug code, since the CPUs always have to be executing some code somewhere. There are other issues too which required the
boot_lock(to ensure local timer calibration worked.)None of these issues apply to production SMP platforms, so you likely do not need any of this - and I see from your code that you do have power and reset controls for the CPUs. What I'm basically saying here is:
please rip out the holding pen andboot_lockcode from your SMP implementation.Quoted 4 lines
If you do need it, please include a detailed explanation why it's required - requiring it suggests that the hardware is broken, and probably doesn't support hotplug and therefore does not support suspend/ resume.
uh, I see - thank you for the explanation!
you are probably right when you say that it's not needed - I added it when implementing Meson8 support (Carlo's series only handled Meson8b). I couldn't get it working on Meson8 at first, but that was before I found out that we have to enable power through SCU first.
Quoted 3 lines
I will remove and re-test this later - many thanks for looking into this (and for the detailed explanation).
this will probably make the code much easier to read :)
and indeed, you were right: it works fine without all this pen_release / smp_lock code!
this also allows us to get rid of meson8_smp_secondary_init()
Quoted 7 lines
one more question:
the code uses some memory barrier macros (smp_wmb(),smp_rmb(),mb()anddsb_sev()).
unfortunately I'm not very familiar with these - could you please have a look at this and let me know which ones you would keep or remove?secondary_start_kernel()is already flushing some caches, so maybe those barriers can also be removed
deleting the pen_release / smp_lock code also gets rid of the smp_wmb(), mb() and dsb_sev() invocation.
there's only a dsb(); dmb(); left in meson_smp_finalize_secondary_boot() and an smp_rmb() in {meson8,meson8b}_smp_cpu_kill()
Martin Blumenstingl
reviewerPATCH v3 5/6 ARM: dts: meson8: add support for booting the secondary CPU cores
In reply to Martin BlumenstinglBooting the secondary CPU cores involves the following nodes/devices:
- SCU (Snoop-Control-Unit, for which we already have a DT node)
- a reset line for each CPU core, provided by the reset-controller which is built into the clock-controller
- the PMU (power management unit) which controls the power of the CPU cores
- a range in the SRAM specifically reserved for booting secondary CPU cores
- the "enable-method" which activates booting the secondary CPU cores
This adds all required nodes and properties to boot the secondary CPU cores.
--- arch/arm/boot/dts/meson8.dtsi | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
arch/arm/boot/dts/meson8.dtsi +20 -0
@@ -60,6 +60,8 @@ compatible = "arm,cortex-a9"; next-level-cache = <&L2>; reg = <0x200>; + enable-method = "amlogic,meson8-smp"; + resets = <&clkc 0>; }; cpu at 201 {
@@ -67,6 +69,8 @@ compatible = "arm,cortex-a9"; next-level-cache = <&L2>; reg = <0x201>; + enable-method = "amlogic,meson8-smp"; + resets = <&clkc 1>; }; cpu at 202 {
@@ -74,6 +78,8 @@ compatible = "arm,cortex-a9"; next-level-cache = <&L2>; reg = <0x202>; + enable-method = "amlogic,meson8-smp"; + resets = <&clkc 2>; }; cpu at 203 {
@@ -81,6 +87,8 @@ compatible = "arm,cortex-a9"; next-level-cache = <&L2>; reg = <0x203>; + enable-method = "amlogic,meson8-smp"; + resets = <&clkc 3>; }; };
@@ -118,6 +126,11 @@ }; /* end of / */ &aobus { + pmu: pmu at e0 { + compatible = "amlogic,meson8-pmu", "syscon"; + reg = <0xe0 0x8>; + }; + pinctrl_aobus: pinctrl at 84 { compatible = "amlogic,meson8-aobus-pinctrl"; reg = <0x84 0xc>;
@@ -249,6 +262,13 @@ }; }; +&ahb_sram { + smp-sram at 1ff80 { + compatible = "amlogic,meson8-smp-sram"; + reg = <0x1ff80 0x8>; + }; +}; + ðmac { clocks = <&clkc CLKID_ETH>; clock-names = "stmmaceth";
Signature · 1 line
2.13.2
Martin Blumenstingl
reviewerPATCH v3 6/6 ARM: dts: meson8b: add support for booting the secondary CPU cores
In reply to Martin BlumenstinglFrom: Carlo Caione <[email protected]>
Booting the secondary CPU cores involves the following nodes/devices:
- SCU (Snoop-Control-Unit, for which we already have a DT node)
- a reset line for each CPU core, provided by the reset-controller which is built into the clock-controller
- the PMU (power management unit) which controls the power of the CPU cores
- a range in the SRAM specifically reserved for booting secondary CPU cores
- the "enable-method" which activates booting the secondary CPU cores
This adds all required nodes and properties to boot the secondary CPU cores.
--- arch/arm/boot/dts/meson8b.dtsi | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
arch/arm/boot/dts/meson8b.dtsi +20 -0
@@ -59,6 +59,8 @@ compatible = "arm,cortex-a5"; next-level-cache = <&L2>; reg = <0x200>; + enable-method = "amlogic,meson8b-smp"; + resets = <&clkc 0>; }; cpu at 201 {
@@ -66,6 +68,8 @@ compatible = "arm,cortex-a5"; next-level-cache = <&L2>; reg = <0x201>; + enable-method = "amlogic,meson8b-smp"; + resets = <&clkc 1>; }; cpu at 202 {
@@ -73,6 +77,8 @@ compatible = "arm,cortex-a5"; next-level-cache = <&L2>; reg = <0x202>; + enable-method = "amlogic,meson8b-smp"; + resets = <&clkc 2>; }; cpu at 203 {
@@ -80,6 +86,8 @@ compatible = "arm,cortex-a5"; next-level-cache = <&L2>; reg = <0x203>; + enable-method = "amlogic,meson8b-smp"; + resets = <&clkc 3>; }; };
@@ -90,6 +98,11 @@ }; /* end of / */ &aobus { + pmu: pmu at e0 { + compatible = "amlogic,meson8b-pmu", "syscon"; + reg = <0xe0 0x18>; + }; + pinctrl_aobus: pinctrl at 84 { compatible = "amlogic,meson8b-aobus-pinctrl"; reg = <0x84 0xc>;
@@ -157,6 +170,13 @@ }; }; +&ahb_sram { + smp-sram at 1ff80 { + compatible = "amlogic,meson8b-smp-sram"; + reg = <0x1ff80 0x8>; + }; +}; + ðmac { clocks = <&clkc CLKID_ETH>; clock-names = "stmmaceth";
Signature · 1 line
2.13.2