Skip to contentSkip to conversation

MIPS: BMIPS5200 SMP support

PATCH In review Florian Fainelli 1 participant 7 messages Feb 4, 2016 – Apr 3, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover MIPS: BMIPS5200 SMP support

Hi all,

This patch series adds BCM7435/BMIPS52000 SMP support, it builds on top of the series submitted here:

https://www.linux-mips.org/archives/linux-mips/2016-01/msg00737.html

Florian Fainelli (4):
MIPS: BMIPS: Add Whirlwind (BMIPS5200) initialization code
MIPS: BMIPS: Add missing 7038 L1 register cells to BCM7435
MIPS: BMIPS: Remove maxcpus from BCM97435SVMB DTS
MIPS: BMIPS: Fill in current_cpu_data.core

 arch/mips/boot/dts/brcm/bcm7435.dtsi     |   5 +-
 arch/mips/boot/dts/brcm/bcm97435svmb.dts |   2 +-
 arch/mips/kernel/Makefile                |   2 +-
 arch/mips/kernel/bmips_5xxx_init.S       | 753 +++++++++++++++++++++++++++++++
 arch/mips/kernel/bmips_vec.S             |  41 +-
 arch/mips/kernel/smp-bmips.c             |   1 +
 6 files changed, 797 insertions(+), 7 deletions(-)
 create mode 100644 arch/mips/kernel/bmips_5xxx_init.S
Signature · 1 line
2.1.0
#1 lore raw

PATCH 1/4 MIPS: BMIPS: Add Whirlwind (BMIPS5200) initialization code

Import bmips_5xxx_init.S from the stblinux-3.3 tree, and to make sure that this would work nicely with a BMIPS multiplatform kernel (with BMIPS330, BMIPS43XX and BMIPS5000 enabled), update soft_reset to check for the BMIPS5200 processor id (PRID_IMP_BMIPS5200) and execute bmips_5xxx_init for these processors to bring them online.

Tested on 7425, 7429 and 7435 with CPU hotplug. 7435 SMP still needs some additional changes in the L1 interrupt area to work properly with interrupt affinity.

---
 arch/mips/kernel/Makefile          |   2 +-
 arch/mips/kernel/bmips_5xxx_init.S | 753 +++++++++++++++++++++++++++++++++++++
 arch/mips/kernel/bmips_vec.S       |  41 +-
 3 files changed, 792 insertions(+), 4 deletions(-)
 create mode 100644 arch/mips/kernel/bmips_5xxx_init.S
arch/mips/kernel/Makefile +1 -1
index 68e2b7db9348..47c5412f4ca0 100644
@@ -44,7 +44,7 @@ obj-$(CONFIG_CPU_CAVIUM_OCTEON)	+= r4k_fpu.o octeon_switch.o
 
 obj-$(CONFIG_SMP)		+= smp.o
 obj-$(CONFIG_SMP_UP)		+= smp-up.o
-obj-$(CONFIG_CPU_BMIPS)		+= smp-bmips.o bmips_vec.o
+obj-$(CONFIG_CPU_BMIPS)		+= smp-bmips.o bmips_vec.o bmips_5xxx_init.o
 
 obj-$(CONFIG_MIPS_MT)		+= mips-mt.o
 obj-$(CONFIG_MIPS_MT_FPAFF)	+= mips-mt-fpaff.o
arch/mips/kernel/bmips_5xxx_init.S new file +753 -0

753 lines not on this page · raw message

arch/mips/kernel/bmips_vec.S +38 -3

58 lines not on this page · raw message

Signature · 1 line
2.1.0
#2 lore raw

PATCH 2/4 MIPS: BMIPS: Add missing 7038 L1 register cells to BCM7435

In reply to Florian Fainelli

7435 has 4 7038 L1 base register address for each of its Core + TP (for a total of 4 threads of execution), add the two missing cells for Core 1. We are providing HW interrupts 2/3 even for Core 1/TP0/TP1 because that's what they are, and we can later decide to remap these in software to provide proper interrupt affinity/parenting.

---
 arch/mips/boot/dts/brcm/bcm7435.dtsi | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/mips/boot/dts/brcm/bcm7435.dtsi +3 -2
index 614ee211f71a..07eff7f69fa9 100644
@@ -63,13 +63,14 @@
 
 		periph_intc: periph_intc@41b500 {
 			compatible = "brcm,bcm7038-l1-intc";
-			reg = <0x41b500 0x40>, <0x41b600 0x40>;
+			reg = <0x41b500 0x40>, <0x41b600 0x40>,
+				<0x41b700 0x40>, <0x41b800 0x40>;
 
 			interrupt-controller;
 			#interrupt-cells = <1>;
 
 			interrupt-parent = <&cpu_intc>;
-			interrupts = <2>, <3>;
+			interrupts = <2>, <3>, <2>, <3>;
 		};
 
 		sun_l2_intc: sun_l2_intc@403000 {
Signature · 1 line
2.1.0
#3 lore raw

PATCH 3/4 MIPS: BMIPS: Remove maxcpus from BCM97435SVMB DTS

In reply to Florian Fainelli

Now that SMP properly works on 7435, do not restrict the number of core, unleash them all.

---
 arch/mips/boot/dts/brcm/bcm97435svmb.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/boot/dts/brcm/bcm97435svmb.dts +1 -1
index 1df088183523..68f486eba3f7 100644
@@ -14,7 +14,7 @@
 	};
 
 	chosen {
-		bootargs = "console=ttyS0,115200 maxcpus=1";
+		bootargs = "console=ttyS0,115200";
 		stdout-path = &uart0;
 	};
 };
Signature · 1 line
2.1.0
#4 lore raw

PATCH 4/4 MIPS: BMIPS: Fill in current_cpu_data.core

In reply to Florian Fainelli

Read the core ID in bmips_smp_finish() for BMIPS5000 CPUs to get appropriate processor parenting in set_cpu_sibling_map().

---
 arch/mips/kernel/smp-bmips.c | 1 +
 1 file changed, 1 insertion(+)
arch/mips/kernel/smp-bmips.c +1 -0
index 78cf8c2f1de0..6d11788b4502 100644
@@ -243,6 +243,7 @@ static void bmips_init_secondary(void)
 		break;
 	case CPU_BMIPS5000:
 		write_c0_brcm_action(ACTION_CLR_IPI(smp_processor_id(), 0));
+		current_cpu_data.core = (read_c0_brcm_config() >> 25) & 3;
 		break;
 	}
 }
Signature · 1 line
2.1.0
#5 lore raw
In reply to Florian Fainelli
Quoted 6 lines · Florian Fainelli

Hi all,

This patch series adds BCM7435/BMIPS52000 SMP support, it builds on top of the series submitted here:

https://www.linux-mips.org/archives/linux-mips/2016-01/msg00737.html

Ralf, can you also queue these for 4.6 if they look okay to you? Thanks!

Quoted 16 lines

Florian Fainelli (4):
MIPS: BMIPS: Add Whirlwind (BMIPS5200) initialization code
MIPS: BMIPS: Add missing 7038 L1 register cells to BCM7435
MIPS: BMIPS: Remove maxcpus from BCM97435SVMB DTS
MIPS: BMIPS: Fill in current_cpu_data.core

 arch/mips/boot/dts/brcm/bcm7435.dtsi     |   5 +-
 arch/mips/boot/dts/brcm/bcm97435svmb.dts |   2 +-
 arch/mips/kernel/Makefile                |   2 +-
 arch/mips/kernel/bmips_5xxx_init.S       | 753 +++++++++++++++++++++++++++++++
 arch/mips/kernel/bmips_vec.S             |  41 +-
 arch/mips/kernel/smp-bmips.c             |   1 +
 6 files changed, 797 insertions(+), 7 deletions(-)
 create mode 100644 arch/mips/kernel/bmips_5xxx_init.S
Signature · 1 line
Florian
#6 lore raw
Quoted 9 lines · Florian Fainelli
Quoted 6 lines · Florian Fainelli

Hi all,

This patch series adds BCM7435/BMIPS52000 SMP support, it builds on top of the series submitted here:

https://www.linux-mips.org/archives/linux-mips/2016-01/msg00737.html

Ralf, can you also queue these for 4.6 if they look okay to you? Thanks!

Same here, can this make it into 4.6? Thanks

Quoted 19 lines
Quoted 17 lines

Florian Fainelli (4):
MIPS: BMIPS: Add Whirlwind (BMIPS5200) initialization code
MIPS: BMIPS: Add missing 7038 L1 register cells to BCM7435
MIPS: BMIPS: Remove maxcpus from BCM97435SVMB DTS
MIPS: BMIPS: Fill in current_cpu_data.core

 arch/mips/boot/dts/brcm/bcm7435.dtsi     |   5 +-
 arch/mips/boot/dts/brcm/bcm97435svmb.dts |   2 +-
 arch/mips/kernel/Makefile                |   2 +-
 arch/mips/kernel/bmips_5xxx_init.S       | 753 +++++++++++++++++++++++++++++++
 arch/mips/kernel/bmips_vec.S             |  41 +-
 arch/mips/kernel/smp-bmips.c             |   1 +
 6 files changed, 797 insertions(+), 7 deletions(-)
 create mode 100644 arch/mips/kernel/bmips_5xxx_init.S
Signature · 1 line
Florian