ARM: SMP: support Broadcom mobile SoCs
Subsystems (5)
v3 cover ARM: SMP: support Broadcom mobile SoCs
This series adds SMP support for two Broadcom mobile SoC families. It uses CPU_METHOD_OF_DECLARE() so that SMP operations are assigned using device tree rather than adding it to a machine definition in a board file.
The enable method starts a secondary core by writing to a register monitored by CPUs spinning in a ROM-based holding pen loop. The address of this register is recorded as a property in the "cpus" node of the device tree.
-Alex
Note:
This series is based on v3.15-rc4, plus one more recently-posted patch:
http://permalink.gmane.org/gmane.linux.kernel/1683693
History
v3: - Dropped definition and use of CPU_METHOD_OF_DECLARE_SETUP()
- Added documentation for "enable-method"
- Rebased onto v3.15-rc4
v2: - Fixed a Makefile error (:= should have been +=)
- No longer set CONFIG_NR_CPUS in bcm_defconfig
- Rebased onto v3.15-rc1
This series is available here:
http://git.linaro.org/landing-teams/working/broadcom/kernel.git
Branch review/bcm-smp-v3
Alex Elder (5):
devicetree: bindings: document Broadcom CPU enable method
ARM: add SMP support for Broadcom mobile SoCs
ARM: configs: enable SMP in bcm_defconfig
ARM: dts: enable SMP support for bcm28155
ARM: dts: enable SMP support for bcm21664
Documentation/devicetree/bindings/arm/cpus.txt | 12 ++ arch/arm/boot/dts/bcm11351.dtsi | 19 +++ arch/arm/boot/dts/bcm21664.dtsi | 19 +++ arch/arm/configs/bcm_defconfig | 1 + arch/arm/mach-bcm/Kconfig | 18 ++- arch/arm/mach-bcm/Makefile | 3 + arch/arm/mach-bcm/platsmp.c | 201 +++++++++++++++++++++++++ 7 files changed, 270 insertions(+), 3 deletions(-) create mode 100644 arch/arm/mach-bcm/platsmp.c
Signature · 1 line
1.9.1
PATCH RESEND v3 1/5 devicetree: bindings: document Broadcom CPU enable method
Broadcom mobile SoCs use a ROM-implemented holding pen for controlled boot of secondary cores. A special register is used to communicate to the ROM that a secondary core should start executing kernel code. This enable method is currently used for members of the bcm281xx and bcm21664 SoC families.
The use of an enable method also allows the SMP operation vector to be assigned as a result of device tree content for these SoCs.
--- Documentation/devicetree/bindings/arm/cpus.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+)
Documentation/devicetree/bindings/arm/cpus.txt +12 -0
@@ -185,6 +185,7 @@ nodes to be present and contain the properties described below. "qcom,gcc-msm8660" "qcom,kpss-acc-v1" "qcom,kpss-acc-v2" + "brcm,bcm11351-cpu-method" - cpu-release-addr Usage: required for systems that have an "enable-method"
@@ -209,6 +210,17 @@ nodes to be present and contain the properties described below. Value type: <phandle> Definition: Specifies the ACC[2] node associated with this CPU. + - secondary-boot-reg + Usage: + Required for systems that have an "enable-method" + property value of "brcm,bcm11351-cpu-method". + Value type: <u32> + Definition: + Specifies the physical address of the register used to + request the ROM holding pen code release a secondary + CPU. The value written to the register is formed by + encoding the target CPU id into the low bits of the + physical start address it should jump to. Example 1 (dual-cluster big.LITTLE system 32-bit):
Signature · 1 line
1.9.1
PATCH RESEND v3 2/5 ARM: add SMP support for Broadcom mobile SoCs
In reply to Alex ElderThis patch adds SMP support for BCM281XX and BCM21664 family SoCs.
This feature is controlled with a distinct config option such that a SMP-enabled multi-v7 binary can be configured to run these SoCs in uniprocessor mode. Since this SMP functionality is used for multiple Broadcom mobile chip families the config option is called ARCH_BCM_MOBILE_SMP (for lack of a better name).
On SoCs of this type, the secondary core is not held in reset on power-on. Instead it loops in a ROM-based holding pen. To release it, one must write into a special register a jump address whose low-order bits have been replaced with a secondary core's id, then trigger an event with SEV. On receipt of an event, the ROM code will examine the register's contents, and if the low-order bits match its cpu id, it will clear them and write the value back to the register just prior to jumping to the address specified.
The location of the special register is defined in the device tree using a "secondary-boot-reg" property in a node whose "enable-method" matches.
Derived from code originally provided by Ray Jui <[email protected]>
--- arch/arm/mach-bcm/Kconfig | 18 +++- arch/arm/mach-bcm/Makefile | 3 + arch/arm/mach-bcm/platsmp.c | 201 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 219 insertions(+), 3 deletions(-) create mode 100644 arch/arm/mach-bcm/platsmp.c
arch/arm/mach-bcm/Kconfig +15 -3
@@ -14,7 +14,6 @@ config ARCH_BCM_MOBILE depends on MMU select ARCH_REQUIRE_GPIOLIB select ARM_ERRATA_754322 - select ARM_ERRATA_764369 if SMP select ARM_GIC select GPIO_BCM_KONA select TICK_ONESHOT
@@ -31,18 +30,31 @@ menu "Broadcom Mobile SoC Selection" config ARCH_BCM_281XX bool "Broadcom BCM281XX SoC family" default y + select HAVE_SMP help - Enable support for the the BCM281XX family, which includes + Enable support for the BCM281XX family, which includes BCM11130, BCM11140, BCM11351, BCM28145 and BCM28155 variants. config ARCH_BCM_21664 bool "Broadcom BCM21664 SoC family" default y + select HAVE_SMP help - Enable support for the the BCM21664 family, which includes + Enable support for the BCM21664 family, which includes BCM21663 and BCM21664 variants. +config ARCH_BCM_MOBILE_SMP + bool "Broadcom mobile SoC SMP support" + depends on (ARCH_BCM_281XX || ARCH_BCM_21664) && SMP + default y + select HAVE_ARM_SCU + select ARM_ERRATA_764369 + help + SMP support for the BCM281XX and BCM21664 SoC families. + Provided as an option so SMP support for SoCs of this type + can be disabled for an SMP-enabled kernel. + endmenu endif
arch/arm/mach-bcm/Makefile +3 -0
@@ -16,6 +16,9 @@ obj-$(CONFIG_ARCH_BCM_281XX) += board_bcm281xx.o # BCM21664 obj-$(CONFIG_ARCH_BCM_21664) += board_bcm21664.o +# BCM281XX and BCM21664 SMP support +obj-$(CONFIG_ARCH_BCM_MOBILE_SMP) += platsmp.o + # BCM281XX and BCM21664 L2 cache control obj-$(CONFIG_ARCH_BCM_MOBILE) += bcm_kona_smc.o bcm_kona_smc_asm.o kona.o plus_sec := $(call as-instr,.arch_extension sec,+sec)
arch/arm/mach-bcm/platsmp.c new file +201 -0
201 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH RESEND v3 3/5 ARM: configs: enable SMP in bcm_defconfig
In reply to Alex ElderAlso explicitly set CONFIG_NR_CPUS to 2, limiting it to the most we currently need.
--- arch/arm/configs/bcm_defconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm/configs/bcm_defconfig +1 -0
@@ -24,6 +24,7 @@ CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y # CONFIG_BLK_DEV_BSG is not set CONFIG_PARTITION_ADVANCED=y +CONFIG_SMP=y CONFIG_ARCH_BCM=y CONFIG_ARCH_BCM_MOBILE=y CONFIG_ARM_THUMBEE=y
Signature · 1 line
1.9.1
PATCH RESEND v3 4/5 ARM: dts: enable SMP support for bcm28155
In reply to Alex ElderDefine nodes representing the two Cortex A9 CPUs in a bcm28155 SoC.
--- arch/arm/boot/dts/bcm11351.dtsi | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
arch/arm/boot/dts/bcm11351.dtsi +19 -0
@@ -27,6 +27,25 @@ bootargs = "console=ttyS0,115200n8"; }; + cpus { + #address-cells = <1>; + #size-cells = <0>; + enable-method = "brcm,bcm11351-cpu-method"; + secondary-boot-reg = <0x3500417c>; + + cpu0: cpu at 0 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <0>; + }; + + cpu1: cpu at 1 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <1>; + }; + }; + gic: interrupt-controller at 3ff00100 { compatible = "arm,cortex-a9-gic"; #interrupt-cells = <3>;
Signature · 1 line
1.9.1
PATCH RESEND v3 5/5 ARM: dts: enable SMP support for bcm21664
In reply to Alex ElderDefine nodes representing the two Cortex A9 CPUs in a bcm21644 SoC.
--- arch/arm/boot/dts/bcm21664.dtsi | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
arch/arm/boot/dts/bcm21664.dtsi +19 -0
@@ -25,6 +25,25 @@ bootargs = "console=ttyS0,115200n8"; }; + cpus { + #address-cells = <1>; + #size-cells = <0>; + enable-method = "brcm,bcm11351-cpu-method"; + secondary-boot-reg = <0x35004178>; + + cpu0: cpu at 0 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <0>; + }; + + cpu1: cpu at 1 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <1>; + }; + }; + gic: interrupt-controller at 3ff00100 { compatible = "arm,cortex-a9-gic"; #interrupt-cells = <3>;
Signature · 1 line
1.9.1
Re: [PATCH v3 RESEND 2/5] ARM: add SMP support for Broadcom mobile SoCs
In reply to Alex ElderHi Alex,
2014-05-15 10:58 GMT-07:00 Alex Elder <[email protected]>:
Quoted 21 lines
This patch adds SMP support for BCM281XX and BCM21664 family SoCs.
This feature is controlled with a distinct config option such that a SMP-enabled multi-v7 binary can be configured to run these SoCs in uniprocessor mode. Since this SMP functionality is used for multiple Broadcom mobile chip families the config option is called
ARCH_BCM_MOBILE_SMP(for lack of a better name).On SoCs of this type, the secondary core is not held in reset on power-on. Instead it loops in a ROM-based holding pen. To release it, one must write into a special register a jump address whose low-order bits have been replaced with a secondary core's id, then trigger an event with SEV. On receipt of an event, the ROM code will examine the register's contents, and if the low-order bits match its cpu id, it will clear them and write the value back to the register just prior to jumping to the address specified.
The location of the special register is defined in the device tree using a "secondary-boot-reg" property in a node whose "enable-method" matches.
Quoted 7 lines
Derived from code originally provided by Ray Jui <[email protected]>
Signed-off-by Alex Elder <[email protected]>--- arch/arm/mach-bcm/Kconfig | 18 +++- arch/arm/mach-bcm/Makefile | 3 + arch/arm/mach-bcm/platsmp.c | 201 ++++++++++++++++++++++++++++++++++++++++++++
Could we make that name a little bit more specific to the mobile SoCs? There are other BCM SoCs either currently supported in this directory (BCM5310X), or making their way to be supported (brcmstb, bcm63xx), and those share nothing with the Mobile SoC SMP code.
Maybe we should create another level directory within mach-bcm...
Signature · 1 line
Florian
Re: [PATCH v3 RESEND 2/5] ARM: add SMP support for Broadcom mobile SoCs
Quoted 26 lines · Florian Fainelli
Hi Alex,
2014-05-15 10:58 GMT-07:00 Alex Elder <[email protected]>:
Quoted 23 lines
This patch adds SMP support for BCM281XX and BCM21664 family SoCs.
This feature is controlled with a distinct config option such that a SMP-enabled multi-v7 binary can be configured to run these SoCs in uniprocessor mode. Since this SMP functionality is used for multiple Broadcom mobile chip families the config option is called
ARCH_BCM_MOBILE_SMP(for lack of a better name).On SoCs of this type, the secondary core is not held in reset on power-on. Instead it loops in a ROM-based holding pen. To release it, one must write into a special register a jump address whose low-order bits have been replaced with a secondary core's id, then trigger an event with SEV. On receipt of an event, the ROM code will examine the register's contents, and if the low-order bits match its cpu id, it will clear them and write the value back to the register just prior to jumping to the address specified.
The location of the special register is defined in the device tree using a "secondary-boot-reg" property in a node whose "enable-method" matches.
Derived from code originally provided by Ray Jui <[email protected]>
Quoted 7 lines
Quoted 5 lines
Signed-off-by Alex Elder <[email protected]>--- arch/arm/mach-bcm/Kconfig | 18 +++- arch/arm/mach-bcm/Makefile | 3 + arch/arm/mach-bcm/platsmp.c | 201 ++++++++++++++++++++++++++++++++++++++++++++Could we make that name a little bit more specific to the mobile SoCs?
Sure. I thought about that but naming stuff here has been a sort of ongoing struggle... "Kona" made some sense, in some cases, but it's not perfect. Simlar with "mobile."
I'll propose "kona_smp.c". OK with you? Unless I get a better suggestion I'll plan to go with that next time around.
Thanks.
-Alex
Quoted 6 lines
There are other BCM SoCs either currently supported in this directory (BCM5310X), or making their way to be supported (brcmstb, bcm63xx), and those share nothing with the Mobile SoC SMP code.
Maybe we should create another level directory within mach-bcm...
Re: [PATCH v3 RESEND 2/5] ARM: add SMP support for Broadcom mobile SoCs
In reply to Florian FainelliQuoted 32 lines · Florian Fainelli
Hi Alex,
2014-05-15 10:58 GMT-07:00 Alex Elder <[email protected]>:
Quoted 21 lines
This patch adds SMP support for BCM281XX and BCM21664 family SoCs.
This feature is controlled with a distinct config option such that a SMP-enabled multi-v7 binary can be configured to run these SoCs in uniprocessor mode. Since this SMP functionality is used for multiple Broadcom mobile chip families the config option is called
ARCH_BCM_MOBILE_SMP(for lack of a better name).On SoCs of this type, the secondary core is not held in reset on power-on. Instead it loops in a ROM-based holding pen. To release it, one must write into a special register a jump address whose low-order bits have been replaced with a secondary core's id, then trigger an event with SEV. On receipt of an event, the ROM code will examine the register's contents, and if the low-order bits match its cpu id, it will clear them and write the value back to the register just prior to jumping to the address specified.
The location of the special register is defined in the device tree using a "secondary-boot-reg" property in a node whose "enable-method" matches.
Quoted 7 lines
Derived from code originally provided by Ray Jui <[email protected]>
Signed-off-by Alex Elder <[email protected]>--- arch/arm/mach-bcm/Kconfig | 18 +++- arch/arm/mach-bcm/Makefile | 3 + arch/arm/mach-bcm/platsmp.c | 201 ++++++++++++++++++++++++++++++++++++++++++++
Quoted 4 lines
Could we make that name a little bit more specific to the mobile SoCs? There are other BCM SoCs either currently supported in this directory (BCM5310X), or making their way to be supported (brcmstb, bcm63xx), and those share nothing with the Mobile SoC SMP code.
Right.
Quoted 1 line
Maybe we should create another level directory within mach-bcm...
Let's not go that far. The general direction we need to go is to work toward removing this code from mach-bcm/ completely. I don't really want to see us adding directories and encouraging burying a lot of new files in them.
A unique name will be enough and then we can work toward moving things out to drivers/ over time.
-Matt
Re: [PATCH v3 RESEND 2/5] ARM: add SMP support for Broadcom mobile SoCs
2014-05-15 11:26 GMT-07:00 Matt Porter <[email protected]>:
Quoted 38 lines · Florian Fainelli
Quoted 32 lines
Hi Alex,
2014-05-15 10:58 GMT-07:00 Alex Elder <[email protected]>:
Quoted 21 lines
This patch adds SMP support for BCM281XX and BCM21664 family SoCs.
This feature is controlled with a distinct config option such that a SMP-enabled multi-v7 binary can be configured to run these SoCs in uniprocessor mode. Since this SMP functionality is used for multiple Broadcom mobile chip families the config option is called
ARCH_BCM_MOBILE_SMP(for lack of a better name).On SoCs of this type, the secondary core is not held in reset on power-on. Instead it loops in a ROM-based holding pen. To release it, one must write into a special register a jump address whose low-order bits have been replaced with a secondary core's id, then trigger an event with SEV. On receipt of an event, the ROM code will examine the register's contents, and if the low-order bits match its cpu id, it will clear them and write the value back to the register just prior to jumping to the address specified.
The location of the special register is defined in the device tree using a "secondary-boot-reg" property in a node whose "enable-method" matches.
Quoted 7 lines
Derived from code originally provided by Ray Jui <[email protected]>
Signed-off-by Alex Elder <[email protected]>--- arch/arm/mach-bcm/Kconfig | 18 +++- arch/arm/mach-bcm/Makefile | 3 + arch/arm/mach-bcm/platsmp.c | 201 ++++++++++++++++++++++++++++++++++++++++++++Quoted 4 lines
Could we make that name a little bit more specific to the mobile SoCs? There are other BCM SoCs either currently supported in this directory (BCM5310X), or making their way to be supported (brcmstb, bcm63xx), and those share nothing with the Mobile SoC SMP code.
Quoted 8 lines
Right.
Quoted 1 line
Maybe we should create another level directory within mach-bcm...
Let's not go that far. The general direction we need to go is to work toward removing this code from mach-bcm/ completely. I don't really want to see us adding directories and encouraging burying a lot of new files in them.
Ok, makes sense.
Quoted 3 lines
A unique name will be enough and then we can work toward moving things out to
drivers/over time.
Sounds good, thanks!
Signature · 1 line
Florian
Re: [PATCH v3 RESEND 2/5] ARM: add SMP support for Broadcom mobile SoCs
In reply to Alex ElderQuoted 33 lines · Alex Elder
Quoted 32 lines · Florian Fainelli
Hi Alex,
2014-05-15 10:58 GMT-07:00 Alex Elder <[email protected]>:
Quoted 28 lines
This patch adds SMP support for BCM281XX and BCM21664 family SoCs.
This feature is controlled with a distinct config option such that a SMP-enabled multi-v7 binary can be configured to run these SoCs in uniprocessor mode. Since this SMP functionality is used for multiple Broadcom mobile chip families the config option is called
ARCH_BCM_MOBILE_SMP(for lack of a better name).On SoCs of this type, the secondary core is not held in reset on power-on. Instead it loops in a ROM-based holding pen. To release it, one must write into a special register a jump address whose low-order bits have been replaced with a secondary core's id, then trigger an event with SEV. On receipt of an event, the ROM code will examine the register's contents, and if the low-order bits match its cpu id, it will clear them and write the value back to the register just prior to jumping to the address specified.
The location of the special register is defined in the device tree using a "secondary-boot-reg" property in a node whose "enable-method" matches.
Derived from code originally provided by Ray Jui <[email protected]>
Signed-off-by Alex Elder <[email protected]>--- arch/arm/mach-bcm/Kconfig | 18 +++- arch/arm/mach-bcm/Makefile | 3 + arch/arm/mach-bcm/platsmp.c | 201 ++++++++++++++++++++++++++++++++++++++++++++
Quoted 8 lines
Quoted 1 line
Could we make that name a little bit more specific to the mobile SoCs?
Sure. I thought about that but naming stuff here has been a sort of ongoing struggle... "Kona" made some sense, in some cases, but it's not perfect. Simlar with "mobile."
I'll propose "
kona_smp.c". OK with you? Unless I get a better suggestion I'll plan to go with that next time around.
Works for me.
-Matt