Skip to contentSkip to conversation

ARM: SMP: support Broadcom mobile SoCs

PATCH Applied Alex Elder 2 participants 6 messages Jun 30, 2014 – Jul 28, 2014

Subsystems (5)
lore
Share & tools
lore

Alex Elder

author
#0 lore raw

v6 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

Notes:
- This series previously included the binding as its first patch. That has now been posted separately to facilitate and focus review.
- This series is based on v3.16-rc1, plus two recently-posted patches:
http://lists.infradead.org/pipermail/linux-arm-kernel/2014-June/264012.html
http://lists.infradead.org/pipermail/linux-arm-kernel/2014-June/264024.html
- This series, along with the binding patch, is available here:
http://git.linaro.org/landing-teams/working/broadcom/kernel.git
Branch review/bcm-smp-v6

History
v6: - Only change was to separate the binding patch from the series.
v5: - No real change; rebased onto v3.16-rc1.
v4: - 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

Alex Elder (4):
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

 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 ++++++++++++++++++++++++++++++++++++++++
 6 files changed, 259 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/mach-bcm/kona_smp.c
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH v6 1/4 ARM: add SMP support for Broadcom mobile SoCs

This 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
index 9bc6db1..ac6d139 100644
@@ -10,7 +10,6 @@ config ARCH_BCM_MOBILE
 	bool "Broadcom Mobile SoC Support" if ARCH_MULTI_V7
 	select ARCH_REQUIRE_GPIOLIB
 	select ARM_ERRATA_754322
-	select ARM_ERRATA_764369 if SMP
 	select ARM_ERRATA_775420
 	select ARM_GIC
 	select GPIO_BCM_KONA
@@ -27,16 +26,18 @@ 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_L2_CACHE
@@ -50,6 +51,17 @@ config ARCH_BCM_MOBILE_SMC
 	bool
 	depends on ARCH_BCM_281XX || ARCH_BCM_21664
 
+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
index 7312921..2eaafc8 100644
@@ -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_L2_CACHE) += kona_l2_cache.o
 
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
author
#2 lore raw

PATCH v6 2/4 ARM: configs: enable SMP in bcm_defconfig

In reply to Alex Elder

Also 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
index dcfc559..0339c5e 100644
@@ -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
author
#3 lore raw

PATCH v6 3/4 ARM: dts: enable SMP support for bcm28155

In reply to Alex Elder

Define 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
index 6b05ae6..2ddaa51 100644
@@ -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
author
#4 lore raw

PATCH v6 4/4 ARM: dts: enable SMP support for bcm21664

In reply to Alex Elder

Define 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
index 8b36682..2016b72 100644
@@ -27,6 +27,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
Applied
#5 lore raw
In reply to Alex Elder
Quoted 11 lines · Alex Elder

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

Applied the series to mach-bcm for-3.17/[soc|dt]

Thanks,
Matt