Skip to contentSkip to conversation

ARM: mstar: Add basic support for i2m and SMP

PATCH Applied Daniel Palmer 5 participants 22 messages Dec 1, 2020 – Dec 10, 2020

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

v2 cover ARM: mstar: Add basic support for i2m and SMP

Sorry for spamming this. I wanted to fix the DT parts before anyone spent time looking at the DT related commits in v1.

This series adds basic support for the infinity2m series of chips. For now the SigmaStar SSD202D which is a dual Cortex A7 in a QFN128 package.

These chips share most of the same hardware with the currently supported infinity, infinity3 and mercury5 chips.

Changes since v1:

- Based on Arnd's feedback[0] there is now "mstar,smpctrl" as the most generic compatible string for the smp control registers and a more specific "sstar,ssd201" (yes sstar is right, this is a SigmaStar chip) string that is good for the SSD201 and SSD202D chips.

- Small code clean ups: remove initialiser for smpctrl, remove unneeded #ifdef CONFIG_SMP, make the smp_operations struct static and const.

0 - https://lore.kernel.org/linux-arm-kernel/CAK8P3a2MC5m4PdmXnwjGw_oZinKU93LP+eYQ8qaCmH4EesH0Bw@mail.gmail.com/

Daniel Palmer (10):
dt-bindings: mstar: Add binding details for mstar,smpctrl
dt-bindings: vendor-prefixes: Add honestar vendor prefix
dt-bindings: mstar: Add Honestar SSD201_HT_V2 to mstar boards
ARM: mstar: Add infinity2m support
ARM: mstar: Add common dtsi for SSD201/SSD202D
ARM: mstar: Add chip level dtsi for SSD202D
ARM: mstar: Add dts for Honestar ssd201htv2
ARM: mstar: Add smp ctrl registers to infinity2m dtsi
ARM: mstar: Wire up smpctrl for SSD201/SSD202D
ARM: mstar: SMP support

 .../bindings/arm/mstar/mstar,smpctrl.yaml     | 40 +++++++++++++++
 .../devicetree/bindings/arm/mstar/mstar.yaml  |  6 +++
 .../devicetree/bindings/vendor-prefixes.yaml  |  2 +
 arch/arm/boot/dts/Makefile                    |  1 +
 .../mstar-infinity2m-ssd202d-ssd201htv2.dts   | 25 ++++++++++
 .../boot/dts/mstar-infinity2m-ssd202d.dtsi    | 14 ++++++
 .../boot/dts/mstar-infinity2m-ssd20xd.dtsi    | 12 +++++
 arch/arm/boot/dts/mstar-infinity2m.dtsi       | 22 +++++++++
 arch/arm/boot/dts/mstar-v7.dtsi               |  2 +-
 arch/arm/mach-mstar/mstarv7.c                 | 49 +++++++++++++++++++
 10 files changed, 172 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/arm/mstar/mstar,smpctrl.yaml
 create mode 100644 arch/arm/boot/dts/mstar-infinity2m-ssd202d-ssd201htv2.dts
 create mode 100644 arch/arm/boot/dts/mstar-infinity2m-ssd202d.dtsi
 create mode 100644 arch/arm/boot/dts/mstar-infinity2m-ssd20xd.dtsi
 create mode 100644 arch/arm/boot/dts/mstar-infinity2m.dtsi
Signature · 1 line
2.29.2
#1 lore raw

PATCH v2 1/10 dt-bindings: mstar: Add binding details for mstar,smpctrl

This adds a YAML description of the smpctrl node needed by the platform code for the MStar/SigmaStar Armv7 SoCs to boot secondary cpus.

---
 .../bindings/arm/mstar/mstar,smpctrl.yaml     | 40 +++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/mstar/mstar,smpctrl.yaml
Documentation/devicetree/bindings/arm/mstar/mstar,smpctrl.yaml new file +40 -0
new file mode 100644
index 000000000000..599c65980f5d
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+# Copyright 2020 thingy.jp.
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/arm/mstar/mstar,smpctrl.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: MStar/SigmaStar Armv7 SoC SMP control registers
+
+maintainers:
+  - Daniel Palmer <[email protected]>
+
+description: |
+  MStar/SigmaStar's Armv7 SoCs that have more than one processor
+  have a region of registers that allow setting the boot address
+  and a magic number that allows secondary processors to leave
+  the loop they are parked in by the boot ROM.
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - sstar,ssd201-smpctrl # SSD201/SSD202D
+      - const: mstar,smpctrl
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    smpctrl@204000 {
+        compatible = "sstar,ssd201-smpctrl", "mstar,smpctrl";
+        reg = <0x204000 0x200>;
+    };
Signature · 1 line
2.29.2
maintainer
#2 lore raw

Re: [PATCH v2 01/10] dt-bindings: mstar: Add binding details for mstar,smpctrl

Quoted 2 lines · Daniel Palmer

This adds a YAML description of the smpctrl node needed by the platform code for the MStar/SigmaStar Armv7 SoCs to boot secondary cpus.

You need an 'enable-method' string defined too.

Quoted 56 lines
---
 .../bindings/arm/mstar/mstar,smpctrl.yaml     | 40 +++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/mstar/mstar,smpctrl.yaml
Documentation/devicetree/bindings/arm/mstar/mstar,smpctrl.yaml new file +40 -0
new file mode 100644
index 000000000000..599c65980f5d
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+# Copyright 2020 thingy.jp.
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/arm/mstar/mstar,smpctrl.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: MStar/SigmaStar Armv7 SoC SMP control registers
+
+maintainers:
+  - Daniel Palmer <[email protected]>
+
+description: |
+  MStar/SigmaStar's Armv7 SoCs that have more than one processor
+  have a region of registers that allow setting the boot address
+  and a magic number that allows secondary processors to leave
+  the loop they are parked in by the boot ROM.
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - sstar,ssd201-smpctrl # SSD201/SSD202D
+      - const: mstar,smpctrl
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    smpctrl@204000 {
+        compatible = "sstar,ssd201-smpctrl", "mstar,smpctrl";
+        reg = <0x204000 0x200>;
+    };
Signature · 1 line
2.29.2
#3 lore raw

Re: [PATCH v2 01/10] dt-bindings: mstar: Add binding details for mstar, smpctrl

Quoted 6 lines · Rob Herring
Quoted 2 lines · Daniel Palmer

This adds a YAML description of the smpctrl node needed by the platform code for the MStar/SigmaStar Armv7 SoCs to boot secondary cpus.

You need an 'enable-method' string defined too.

I had already applied the series by the time I saw this reply.

Daniel, please send patches on top of this series to address Rob's comments.

Arnd

#4 lore raw

Re: [PATCH v2 01/10] dt-bindings: mstar: Add binding details for mstar,smpctrl

Hi Arnd,

Quoted 2 lines · Arnd Bergmann

Daniel, please send patches on top of this series to address Rob's comments.

Will do. On the enabled method one I had a question for Rob so I'll wait for a reply to that and then send the fixes.
Sorry about the trouble caused.

Thanks,

Daniel

#5 lore raw

Re: [PATCH v2 01/10] dt-bindings: mstar: Add binding details for mstar,smpctrl

In reply to Rob Herring

Hi Rob,

Quoted 5 lines · Rob Herring
Quoted 2 lines · Daniel Palmer

This adds a YAML description of the smpctrl node needed by the platform code for the MStar/SigmaStar Armv7 SoCs to boot secondary cpus.

You need an 'enable-method' string defined too.

The machine has smp ops set so I didn't think this was needed? I was going to convert it to using enable-method in the cpu node but the same code is used to enable the secondary cpu in all of the chips with a second cpu so I didn't think I was really needed.

Thanks,

Daniel

#6 lore raw

PATCH v2 2/10 dt-bindings: vendor-prefixes: Add honestar vendor prefix

In reply to Daniel Palmer

Add prefix for Honestar Technologies Co., Ltd.

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index 2735be1a8470..a6cf2cef6f89 100644
@@ -451,6 +451,8 @@ patternProperties:
     description: Holt Integrated Circuits, Inc.
   "^honeywell,.*":
     description: Honeywell
+  "^honestar,.*":
+    description: Honestar Technologies Co., Ltd.
   "^hoperun,.*":
     description: Jiangsu HopeRun Software Co., Ltd.
   "^hp,.*":
Signature · 1 line
2.29.2
maintainer
#7 lore raw

Re: [PATCH v2 02/10] dt-bindings: vendor-prefixes: Add honestar vendor prefix

Quoted 12 lines · Daniel Palmer

Add prefix for Honestar Technologies Co., Ltd.

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +0 -0
index 2735be1a8470..a6cf2cef6f89 100644

Documentation/devicetree/bindings/vendor-prefixes.yaml patternProperties: · line 455

Quoted 5 lines
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -451,6 +451,8 @@ patternProperties:
     description: Holt Integrated Circuits, Inc.
   "^honeywell,.*":
     description: Honeywell
+  "^honestar,.*":
+    description: Honestar Technologies Co., Ltd.

Alphabetical order please.

Quoted 6 lines
Documentation/devicetree/bindings/vendor-prefixes.yaml +0 -0
   "^hoperun,.*":
     description: Jiangsu HopeRun Software Co., Ltd.
   "^hp,.*":
Signature · 1 line
2.29.2
#8 lore raw

Re: [PATCH v2 02/10] dt-bindings: vendor-prefixes: Add honestar vendor prefix

Hi Rob,

Quoted 4 lines · Rob Herring

Documentation/devicetree/bindings/vendor-prefixes.yaml patternProperties: · line 455

Quoted 2 lines
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
+  "^honestar,.*":
+    description: Honestar Technologies Co., Ltd.

Alphabetical order please.

Sorry about that. I intended to do that but apparently don't know the alphabet anymore..

Thanks,

Daniel

#9 lore raw

PATCH v2 3/10 dt-bindings: mstar: Add Honestar SSD201_HT_V2 to mstar boards

In reply to Daniel Palmer

The Honestar SSD201_HT_V2 is a full size devkit for the SigmaStar SSD201 or SSD202D (they are pin compatible).

Currently only the SSD202D version is supported as that's the one I have.

---
 Documentation/devicetree/bindings/arm/mstar/mstar.yaml | 6 ++++++
 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/arm/mstar/mstar.yaml +6 -0
index 7c787405bb2f..61d08c473eb8 100644
@@ -20,6 +20,12 @@ properties:
               - thingyjp,breadbee-crust # thingy.jp BreadBee Crust
           - const: mstar,infinity
 
+      - description: infinity2m boards
+        items:
+          - enum:
+              - honestar,ssd201htv2 # Honestar SSD201_HT_V2 devkit
+          - const: mstar,infinity2m
+
       - description: infinity3 boards
         items:
           - enum:
Signature · 1 line
2.29.2
maintainer Reviewed-by on v2 3/10
#10 lore raw

Re: [PATCH v2 03/10] dt-bindings: mstar: Add Honestar SSD201_HT_V2 to mstar boards

Quoted 12 lines · Daniel Palmer

The Honestar SSD201_HT_V2 is a full size devkit for the SigmaStar SSD201 or SSD202D (they are pin compatible).

Currently only the SSD202D version is supported as that's the one I have.

---
 Documentation/devicetree/bindings/arm/mstar/mstar.yaml | 6 ++++++
 1 file changed, 6 insertions(+)
#11 lore raw

PATCH v2 4/10 ARM: mstar: Add infinity2m support

In reply to Daniel Palmer

The infinity2m series of chips are like the other Mstar/Sigmastar chips in that they have a Cortex A7 system with DDR memory integrated in a single package.

The infinity2m chips are intended for recording the incoming streams from IP cameras. So instead of video encoders they have video decoders, instead of a camera interface they have display hardware and so on.

Aside from the above points the big difference about these chips is that they include a second Cortex A7 core.

---
 arch/arm/boot/dts/mstar-infinity2m.dtsi | 15 +++++++++++++++
 arch/arm/boot/dts/mstar-v7.dtsi         |  2 +-
 arch/arm/mach-mstar/mstarv7.c           |  1 +
 3 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boot/dts/mstar-infinity2m.dtsi
arch/arm/boot/dts/mstar-infinity2m.dtsi new file +15 -0
new file mode 100644
index 000000000000..02adb9fe9d3c
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2020 thingy.jp.
+ * Author: Daniel Palmer <[email protected]>
+ */
+
+#include "mstar-infinity.dtsi"
+
+&cpus {
+	cpu1: cpu@1 {
+		device_type = "cpu";
+		compatible = "arm,cortex-a7";
+		reg = <0x1>;
+	};
+};
arch/arm/boot/dts/mstar-v7.dtsi +1 -1
index 07fc46c7b4d4..2862b32c7f63 100644
@@ -13,7 +13,7 @@ / {
 	#size-cells = <1>;
 	interrupt-parent = <&gic>;
 
-	cpus {
+	cpus: cpus {
 		#address-cells = <1>;
 		#size-cells = <0>;
 
arch/arm/mach-mstar/mstarv7.c +1 -0
index 81a4cbcab206..1aa748fa006e 100644
@@ -35,6 +35,7 @@ static void __iomem *l3bridge;
 
 static const char * const mstarv7_board_dt_compat[] __initconst = {
 	"mstar,infinity",
+	"mstar,infinity2m",
 	"mstar,infinity3",
 	"mstar,mercury5",
 	NULL,
Signature · 1 line
2.29.2
#12 lore raw

PATCH v2 5/10 ARM: mstar: Add common dtsi for SSD201/SSD202D

In reply to Daniel Palmer

The SSD201 and SSD202D are basically the same chip with a different DDR die packaged (64MB DDR2 or 128MB DDR3).

This patch adds a shared dtsi for the common parts of these chips like gpio, pinctrl etc.

---
 arch/arm/boot/dts/mstar-infinity2m-ssd20xd.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 arch/arm/boot/dts/mstar-infinity2m-ssd20xd.dtsi
arch/arm/boot/dts/mstar-infinity2m-ssd20xd.dtsi new file +7 -0
new file mode 100644
index 000000000000..0811220f0a79
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2020 thingy.jp.
+ * Author: Daniel Palmer <[email protected]>
+ */
+
+#include "mstar-infinity2m.dtsi"
Signature · 1 line
2.29.2
#13 lore raw

PATCH v2 6/10 ARM: mstar: Add chip level dtsi for SSD202D

In reply to Daniel Palmer

Add a chip level dtsi for the SigmaStar SSD202D

---
 arch/arm/boot/dts/mstar-infinity2m-ssd202d.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 arch/arm/boot/dts/mstar-infinity2m-ssd202d.dtsi
arch/arm/boot/dts/mstar-infinity2m-ssd202d.dtsi new file +14 -0
new file mode 100644
index 000000000000..176e10a29896
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2020 thingy.jp.
+ * Author: Daniel Palmer <[email protected]>
+ */
+
+#include "mstar-infinity2m-ssd20xd.dtsi"
+
+/ {
+	memory {
+		device_type = "memory";
+		reg = <0x20000000 0x8000000>;
+	};
+};
Signature · 1 line
2.29.2
#14 lore raw

PATCH v2 7/10 ARM: mstar: Add dts for Honestar ssd201htv2

In reply to Daniel Palmer

Add a dts for the Honestar ssd201htv2 devkit.
This is for the board populated with a SSD202D.

---
 arch/arm/boot/dts/Makefile                    |  1 +
 .../mstar-infinity2m-ssd202d-ssd201htv2.dts   | 25 +++++++++++++++++++
 2 files changed, 26 insertions(+)
 create mode 100644 arch/arm/boot/dts/mstar-infinity2m-ssd202d-ssd201htv2.dts
arch/arm/boot/dts/Makefile +1 -0
index ce66ffd5a1bb..ccbf44b6f32a 100644
@@ -1372,6 +1372,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
 dtb-$(CONFIG_ARCH_MILBEAUT) += milbeaut-m10v-evb.dtb
 dtb-$(CONFIG_ARCH_MSTARV7) += \
 	mstar-infinity-msc313-breadbee_crust.dtb \
+	mstar-infinity2m-ssd202d-ssd201htv2.dtb \
 	mstar-infinity3-msc313e-breadbee.dtb \
 	mstar-mercury5-ssc8336n-midrived08.dtb
 dtb-$(CONFIG_ARCH_ZX) += zx296702-ad1.dtb
arch/arm/boot/dts/mstar-infinity2m-ssd202d-ssd201htv2.dts new file +25 -0
new file mode 100644
index 000000000000..5d81641414a2
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2020 thingy.jp.
+ * Author: Daniel Palmer <[email protected]>
+ */
+
+/dts-v1/;
+#include "mstar-infinity2m-ssd202d.dtsi"
+
+/ {
+	model = "SSD201_HT_V2";
+	compatible = "honestar,ssd201htv2", "mstar,infinity2m";
+
+	aliases {
+		serial0 = &pm_uart;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+};
+
+&pm_uart {
+	status = "okay";
+};
Signature · 1 line
2.29.2
#15 lore raw

PATCH v2 8/10 ARM: mstar: Add smp ctrl registers to infinity2m dtsi

In reply to Daniel Palmer

Add the smpctrl registers to the infinity2m dtsi so that the second CPU can be enabled on chips in this family.

---
 arch/arm/boot/dts/mstar-infinity2m.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/boot/dts/mstar-infinity2m.dtsi +7 -0
index 02adb9fe9d3c..6d4d1d224e96 100644
@@ -13,3 +13,10 @@ cpu1: cpu@1 {
 		reg = <0x1>;
 	};
 };
+
+&riu {
+	smpctrl: smpctrl@204000 {
+		reg = <0x204000 0x200>;
+		status = "disabled";
+	};
+};
Signature · 1 line
2.29.2
#16 lore raw

PATCH v2 9/10 ARM: mstar: Wire up smpctrl for SSD201/SSD202D

In reply to Daniel Palmer

Add the specific compat string for the smpctrl registers to the SSD201/SSD202D common dtsi.

---
 arch/arm/boot/dts/mstar-infinity2m-ssd20xd.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/mstar-infinity2m-ssd20xd.dtsi +5 -0
index 0811220f0a79..7a5e28b33f96 100644
@@ -5,3 +5,8 @@
  */
 
 #include "mstar-infinity2m.dtsi"
+
+&smpctrl {
+	compatible = "sstar,ssd201-smpctrl", "mstar,smpctrl";
+	status = "okay";
+};
Signature · 1 line
2.29.2
#17 lore raw

PATCH v2 10/10 ARM: mstar: SMP support

In reply to Daniel Palmer

This patch adds SMP support for MStar/Sigmastar chips that have a second core like those in the infinity2m family.

So far only single and dual core chips have been found so this does the bare minimum to boot the second core. From what I can tell not having the "holding pen" code to handle multiple cores is fine if there is only one core the will get booted. This might need to be reconsidered if chips with more cores turn up.

---
 arch/arm/mach-mstar/mstarv7.c | 48 +++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)
arch/arm/mach-mstar/mstarv7.c +48 -0
index 1aa748fa006e..274c4f0df270 100644
@@ -31,6 +31,13 @@
 #define MSTARV7_L3BRIDGE_FLUSH_TRIGGER	BIT(0)
 #define MSTARV7_L3BRIDGE_STATUS_DONE	BIT(12)
 
+#ifdef CONFIG_SMP
+#define MSTARV7_CPU1_BOOT_ADDR_HIGH	0x4c
+#define MSTARV7_CPU1_BOOT_ADDR_LOW	0x50
+#define MSTARV7_CPU1_UNLOCK		0x58
+#define MSTARV7_CPU1_UNLOCK_MAGIC	0xbabe
+#endif
+
 static void __iomem *l3bridge;
 
 static const char * const mstarv7_board_dt_compat[] __initconst = {
@@ -63,6 +70,46 @@ static void mstarv7_mb(void)
 	}
 }
 
+#ifdef CONFIG_SMP
+static int mstarv7_boot_secondary(unsigned int cpu, struct task_struct *idle)
+{
+	struct device_node *np;
+	u32 bootaddr = (u32) __pa_symbol(secondary_startup_arm);
+	void __iomem *smpctrl;
+
+	/*
+	 * right now we don't know how to boot anything except
+	 * cpu 1.
+	 */
+	if (cpu != 1)
+		return -EINVAL;
+
+	np = of_find_compatible_node(NULL, NULL, "mstar,smpctrl");
+	smpctrl = of_iomap(np, 0);
+
+	if (!smpctrl)
+		return -ENODEV;
+
+	/* set the boot address for the second cpu */
+	writew(bootaddr & 0xffff, smpctrl + MSTARV7_CPU1_BOOT_ADDR_LOW);
+	writew((bootaddr >> 16) & 0xffff, smpctrl + MSTARV7_CPU1_BOOT_ADDR_HIGH);
+
+	/* unlock the second cpu */
+	writew(MSTARV7_CPU1_UNLOCK_MAGIC, smpctrl + MSTARV7_CPU1_UNLOCK);
+
+	/* and away we go...*/
+	arch_send_wakeup_ipi_mask(cpumask_of(cpu));
+
+	iounmap(smpctrl);
+
+	return 0;
+}
+
+static const struct smp_operations __initdata mstarv7_smp_ops = {
+	.smp_boot_secondary = mstarv7_boot_secondary,
+};
+#endif
+
 static void __init mstarv7_init(void)
 {
 	struct device_node *np;
@@ -78,4 +125,5 @@ static void __init mstarv7_init(void)
 DT_MACHINE_START(MSTARV7_DT, "MStar/Sigmastar Armv7 (Device Tree)")
 	.dt_compat	= mstarv7_board_dt_compat,
 	.init_machine	= mstarv7_init,
+	.smp		= smp_ops(mstarv7_smp_ops),
 MACHINE_END
Signature · 1 line
2.29.2
#18 lore raw

Re: [PATCH v2 10/10] ARM: mstar: SMP support

arch/arm/mach-mstar/mstarv7.c static void mstarv7_mb(void) · line 91

Quoted 5 lines · Daniel Palmer
arch/arm/mach-mstar/mstarv7.c +5 -0
+	np = of_find_compatible_node(NULL, NULL, "mstar,smpctrl");
+	smpctrl = of_iomap(np, 0);
+
+	if (!smpctrl)
+		return -ENODEV;

Wouldn't -ENOMEM be more appropriate here?

Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
#19 lore raw

Re: [PATCH v2 10/10] ARM: mstar: SMP support

Hi Russell,

Quoted 9 lines · Russell King - ARM Linux admin

arch/arm/mach-mstar/mstarv7.c static void mstarv7_mb(void) · line 91

Quoted 5 lines · Daniel Palmer
arch/arm/mach-mstar/mstarv7.c +5 -0
+     np = of_find_compatible_node(NULL, NULL, "mstar,smpctrl");
+     smpctrl = of_iomap(np, 0);
+
+     if (!smpctrl)
+             return -ENODEV;

Wouldn't -ENOMEM be more appropriate here?

There seems to be examples of both -ENOMEM and -ENODEV in other ARM platforms. arch/arm/mach-aspeed/platsmp.c uses -ENODEV for example.

I went with -ENODEV there as the source of the error is most likely the node not being in the device tree.
I didn't check the result of of_find_compatible_node() because for the memory barrier code in the same file I was told it wasn't necessary.

Thanks,

Daniel

#20 lore raw
In reply to Daniel Palmer
This series was applied to soc/soc.git (refs/heads/for-next):

Hello:

This series was applied to soc/soc.git (refs/heads/for-next):

Quoted 9 lines · On Tue, 1 Dec 2020 22:43:20 +0900 you wrote:

Sorry for spamming this. I wanted to fix the DT parts before anyone spent time looking at the DT related commits in v1.

This series adds basic support for the infinity2m series of chips. For now the SigmaStar SSD202D which is a dual Cortex A7 in a QFN128 package.

[...]

Here is the summary with links:
- [v2,01/10] dt-bindings: mstar: Add binding details for mstar, smpctrl

    https://git.kernel.org/soc/soc/c/80e73332ee82
  - [v2,02/10] dt-bindings: vendor-prefixes: Add honestar vendor prefix
    https://git.kernel.org/soc/soc/c/43181b5d8072
  - [v2,03/10] dt-bindings: mstar: Add Honestar SSD201_HT_V2 to mstar boards
    https://git.kernel.org/soc/soc/c/8c50a8b359c4
  - [v2,04/10] ARM: mstar: Add infinity2m support
    https://git.kernel.org/soc/soc/c/ba2290b1b750
  - [v2,05/10] ARM: mstar: Add common dtsi for SSD201/SSD202D
    https://git.kernel.org/soc/soc/c/572ef97bc734
  - [v2,06/10] ARM: mstar: Add chip level dtsi for SSD202D
    https://git.kernel.org/soc/soc/c/dbbaf35d589e
  - [v2,07/10] ARM: mstar: Add dts for Honestar ssd201htv2
    https://git.kernel.org/soc/soc/c/418cb58b4566
  - [v2,08/10] ARM: mstar: Add smp ctrl registers to infinity2m dtsi
    https://git.kernel.org/soc/soc/c/570e471ce054
  - [v2,09/10] ARM: mstar: Wire up smpctrl for SSD201/SSD202D
    https://git.kernel.org/soc/soc/c/ecaafac1eb73
  - [v2,10/10] ARM: mstar: SMP support
    https://git.kernel.org/soc/soc/c/5919eec0f092

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

#21 lore raw
In reply to Daniel Palmer

From: Arnd Bergmann <[email protected]>

Quoted 9 lines · Daniel Palmer

Sorry for spamming this. I wanted to fix the DT parts before anyone spent time looking at the DT related commits in v1.

This series adds basic support for the infinity2m series of chips. For now the SigmaStar SSD202D which is a dual Cortex A7 in a QFN128 package.

[...]

Applied to arm/dt, thanks!

[01/10] dt-bindings: mstar: Add binding details for mstar,smpctrl

        commit: 80e73332ee829cd55d86272b7d3d4d5f0fc4c4ff
[02/10] dt-bindings: vendor-prefixes: Add honestar vendor prefix
        commit: 43181b5d8072dd92513dca995789a1a1123ffc8a
[03/10] dt-bindings: mstar: Add Honestar SSD201_HT_V2 to mstar boards
        commit: 8c50a8b359c4f262a05ed5fb05373177d11bd20c
[04/10] ARM: mstar: Add infinity2m support
        commit: ba2290b1b7505b28912092a0976e071a447ee18c
[05/10] ARM: mstar: Add common dtsi for SSD201/SSD202D
        commit: 572ef97bc7341b45c721d79f98262c4adb25919c
[06/10] ARM: mstar: Add chip level dtsi for SSD202D
        commit: dbbaf35d589e554d5956780282feb5d62d7f2af6
[07/10] ARM: mstar: Add dts for Honestar ssd201htv2
        commit: 418cb58b45661724ba145bd769e53910ad9324b0
[08/10] ARM: mstar: Add smp ctrl registers to infinity2m dtsi
        commit: 570e471ce0540165aed5bc638e462de7c1110a28
[09/10] ARM: mstar: Wire up smpctrl for SSD201/SSD202D
        commit: ecaafac1eb73de8209680ec030769a2def4801e5
[10/10] ARM: mstar: SMP support
        commit: 5919eec0f09214901b09faeaf6341addebc57a89

       Arnd