Skip to contentSkip to conversation

ARM: sun6i: Switch to enable-method for SMP

PATCH New Maxime Ripard 1 participant 7 messages Apr 18, 2014 – May 17, 2014

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

cover ARM: sun6i: Switch to enable-method for SMP

The recent introduction of CPU_METHOD_OF_DECLARE allowed to deprecate one more fiel of the struct machine_desc.

Switch to it for the Allwinner A31 SoC.

Maxime Ripard (5):
Documentation: dt: bindings: Document ARM PSCI enable method
ARM: sun6i: Use CPU_METHOD_OF_DECLARE
Documentation: dt: bindings: Document Allwinner A31 enable method
ARM: sun6i: Define the A31 CPUs enable-method
ARM: sun6i: Retire the smp field in A31 machine

 Documentation/devicetree/bindings/arm/cpus.txt |  2 ++
 arch/arm/boot/dts/sun6i-a31.dtsi               |  1 +
 arch/arm/mach-sunxi/common.h                   | 19 -------------------
 arch/arm/mach-sunxi/platsmp.c                  |  3 +--
 arch/arm/mach-sunxi/sunxi.c                    |  3 ---
 5 files changed, 4 insertions(+), 24 deletions(-)
 delete mode 100644 arch/arm/mach-sunxi/common.h
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/5 Documentation: dt: bindings: Document ARM PSCI enable method

arm,psci is also a valid enable-method for the CPUs on ARM. Document it.

---
 Documentation/devicetree/bindings/arm/cpus.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/arm/cpus.txt +1 -0
index 333f4aea3029..ad6f7758d6ba 100644
@@ -182,6 +182,7 @@ nodes to be present and contain the properties described below.
 			     "psci"
 			# On ARM 32-bit systems this property is optional and
 			  can be one of:
+			    "arm,psci"
 			    "qcom,gcc-msm8660"
 			    "qcom,kpss-acc-v1"
 			    "qcom,kpss-acc-v2"
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/5 ARM: sun6i: Use CPU_METHOD_OF_DECLARE

In reply to Maxime Ripard

CPU_METHOD_OF_DECLARE allows to bind the smp_ops to a set of cpus through the enable-method property, instead of relying on the machine to define it. Switch to it to get closer to an empty machine.

---
 arch/arm/mach-sunxi/platsmp.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-sunxi/platsmp.c +1 -0
index 0c7dbce033cc..828f21126973 100644
@@ -122,3 +122,4 @@ struct smp_operations sun6i_smp_ops __initdata = {
 	.smp_prepare_cpus	= sun6i_smp_prepare_cpus,
 	.smp_boot_secondary	= sun6i_smp_boot_secondary,
 };
+CPU_METHOD_OF_DECLARE(sun6i_smp, "allwinner,sun6i-a31", &sun6i_smp_ops);
Signature · 1 line
1.9.1
#3 lore raw

PATCH 3/5 Documentation: dt: bindings: Document Allwinner A31 enable method

In reply to Maxime Ripard

Document the necently introduced A31 enable-method as a valid option.

---
 Documentation/devicetree/bindings/arm/cpus.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/arm/cpus.txt +1 -0
index ad6f7758d6ba..14611d22b95a 100644
@@ -183,6 +183,7 @@ nodes to be present and contain the properties described below.
 			# On ARM 32-bit systems this property is optional and
 			  can be one of:
 			    "arm,psci"
+			    "allwinner,sun6i-a31"
 			    "qcom,gcc-msm8660"
 			    "qcom,kpss-acc-v1"
 			    "qcom,kpss-acc-v2"
Signature · 1 line
1.9.1
#4 lore raw

PATCH 4/5 ARM: sun6i: Define the A31 CPUs enable-method

In reply to Maxime Ripard

That will allow to use the CPU_METHOD_OF_DECLARE definition we did previously.

---
 arch/arm/boot/dts/sun6i-a31.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/sun6i-a31.dtsi +1 -0
index bc46814d2ff0..e88519cc6e70 100644
@@ -27,6 +27,7 @@
 
 
 	cpus {
+		enable-method = "allwinner,sun6i-a31";
 		#address-cells = <1>;
 		#size-cells = <0>;
 
Signature · 1 line
1.9.1
#5 lore raw

PATCH 5/5 ARM: sun6i: Retire the smp field in A31 machine

In reply to Maxime Ripard

Now that we can rely on the enable-method, remove the smp field declaration from A31 machine.

---
 arch/arm/mach-sunxi/common.h  | 19 -------------------
 arch/arm/mach-sunxi/platsmp.c |  2 --
 arch/arm/mach-sunxi/sunxi.c   |  3 ---
 3 files changed, 24 deletions(-)
 delete mode 100644 arch/arm/mach-sunxi/common.h
arch/arm/mach-sunxi/common.h deleted +0 -19
deleted file mode 100644
index 9e5ac4756cbb..000000000000
@@ -1,19 +0,0 @@
-/*
- * Core functions for Allwinner SoCs
- *
- * Copyright (C) 2013 Maxime Ripard
- *
- * Maxime Ripard <[email protected]>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef __ARCH_SUNXI_COMMON_H_
-#define __ARCH_SUNXI_COMMON_H_
-
-void sun6i_secondary_startup(void);
-extern struct smp_operations sun6i_smp_ops;
-
-#endif /* __ARCH_SUNXI_COMMON_H_ */
arch/arm/mach-sunxi/platsmp.c +0 -2
index 828f21126973..c53077bb8c3f 100644
@@ -21,8 +21,6 @@
 #include <linux/of_address.h>
 #include <linux/smp.h>
 
-#include "common.h"
-
 #define CPUCFG_CPU_PWR_CLAMP_STATUS_REG(cpu)	((cpu) * 0x40 + 0x64)
 #define CPUCFG_CPU_RST_CTRL_REG(cpu)		(((cpu) + 1) * 0x40)
 #define CPUCFG_CPU_CTRL_REG(cpu)		(((cpu) + 1) * 0x40 + 0x04)
arch/arm/mach-sunxi/sunxi.c +0 -3
index 460b5a4962ef..df906e3a8f91 100644
@@ -25,8 +25,6 @@
 #include <asm/mach/map.h>
 #include <asm/system_misc.h>
 
-#include "common.h"
-
 #define SUN4I_WATCHDOG_CTRL_REG		0x00
 #define SUN4I_WATCHDOG_CTRL_RESTART		BIT(0)
 #define SUN4I_WATCHDOG_MODE_REG		0x04
@@ -149,7 +147,6 @@ DT_MACHINE_START(SUN6I_DT, "Allwinner sun6i (A31) Family")
 	.init_time	= sun6i_timer_init,
 	.dt_compat	= sun6i_board_dt_compat,
 	.restart	= sun6i_restart,
-	.smp		= smp_ops(sun6i_smp_ops),
 MACHINE_END
 
 static const char * const sun7i_board_dt_compat[] = {
Signature · 1 line
1.9.1
#6 lore raw

cover ARM: sun6i: Switch to enable-method for SMP

In reply to Maxime Ripard
Quoted 4 lines · Maxime Ripard

The recent introduction of CPU_METHOD_OF_DECLARE allowed to deprecate one more fiel of the struct machine_desc.

Switch to it for the Allwinner A31 SoC.

Merged the whole series.

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140517/011b9265/attachment-0001.sig>