ARM: SMP: support Broadcom mobile SoCs
Subsystems (5)
v4 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: - Renamed "platsmp.c" to be "kona_smp.c".
- Rebased onto v3.15-rc5
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-v4
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/kona_smp.c | 202 +++++++++++++++++++++++++ 7 files changed, 271 insertions(+), 3 deletions(-) create mode 100644 arch/arm/mach-bcm/kona_smp.c
Signature · 1 line
1.9.1
PATCH v4 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 v4 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 an 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/kona_smp.c | 202 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 220 insertions(+), 3 deletions(-) create mode 100644 arch/arm/mach-bcm/kona_smp.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) += kona_smp.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/kona_smp.c new file +202 -0
202 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v4 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
@@ -27,6 +27,7 @@ CONFIG_PARTITION_ADVANCED=y CONFIG_ARCH_BCM=y CONFIG_ARCH_BCM_MOBILE=y CONFIG_ARM_THUMBEE=y +CONFIG_SMP=y CONFIG_PREEMPT=y CONFIG_AEABI=y # CONFIG_COMPACTION is not set
Signature · 1 line
1.9.1
PATCH v4 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