[RFC 5/7] Make Hi3620 explicit, remove wildcards

Marty Plummer netz.kernel at gmail.com
Thu Sep 8 10:23:44 PDT 2016


This is a preparatory series for adding the ARMv5/v6 hi3520 SoCs.
Assumptions were made when adding hi3620 that don't hold water in
light of adding support for the hi3520 SoC.  Fix the issue by renaming
config options and other namespaces to avoid collisions with the new
work.

Only internal APIs are modified with this series.

Signed-off-by: Marty Plummer <netz.kernel at gmail.com>
---
 arch/arm/mach-hisi/Kconfig     |  4 ++--
 arch/arm/mach-hisi/core.h      | 10 +++++-----
 arch/arm/mach-hisi/hisilicon.c |  6 +++---
 arch/arm/mach-hisi/hotplug.c   | 16 ++++++++--------
 arch/arm/mach-hisi/platsmp.c   | 24 ++++++++++++------------
 5 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/arch/arm/mach-hisi/Kconfig b/arch/arm/mach-hisi/Kconfig
index a3b091a..8a552c3 100644
--- a/arch/arm/mach-hisi/Kconfig
+++ b/arch/arm/mach-hisi/Kconfig
@@ -12,8 +12,8 @@ if ARCH_HISI
 
 menu "Hisilicon platform type"
 
-config ARCH_HI3xxx
-	bool "Hisilicon Hi36xx family"
+config ARCH_HI3620
+	bool "Hisilicon Hi3620 family"
 	depends on ARCH_MULTI_V7
 	select CACHE_L2X0
 	select HAVE_ARM_SCU if SMP
diff --git a/arch/arm/mach-hisi/core.h b/arch/arm/mach-hisi/core.h
index e883583..cb7bc84 100644
--- a/arch/arm/mach-hisi/core.h
+++ b/arch/arm/mach-hisi/core.h
@@ -3,13 +3,13 @@
 
 #include <linux/reboot.h>
 
-extern void hi3xxx_set_cpu_jump(int cpu, void *jump_addr);
-extern int hi3xxx_get_cpu_jump(int cpu);
+extern void hi3620_set_cpu_jump(int cpu, void *jump_addr);
+extern int hi3620_get_cpu_jump(int cpu);
 extern void secondary_startup(void);
 
-extern void hi3xxx_cpu_die(unsigned int cpu);
-extern int hi3xxx_cpu_kill(unsigned int cpu);
-extern void hi3xxx_set_cpu(int cpu, bool enable);
+extern void hi3620_cpu_die(unsigned int cpu);
+extern int hi3620_cpu_kill(unsigned int cpu);
+extern void hi3620_set_cpu(int cpu, bool enable);
 
 extern void hix5hd2_set_cpu(int cpu, bool enable);
 extern void hix5hd2_cpu_die(unsigned int cpu);
diff --git a/arch/arm/mach-hisi/hisilicon.c b/arch/arm/mach-hisi/hisilicon.c
index c08c44e..dfa1ee8 100644
--- a/arch/arm/mach-hisi/hisilicon.c
+++ b/arch/arm/mach-hisi/hisilicon.c
@@ -9,7 +9,7 @@
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
-*/
+ */
 
 #include <linux/clocksource.h>
 #include <linux/irqchip.h>
@@ -44,12 +44,12 @@ static void __init hi3620_map_io(void)
 	iotable_init(hi3620_io_desc, ARRAY_SIZE(hi3620_io_desc));
 }
 
-static const char *const hi3xxx_compat[] __initconst = {
+static const char *const hi3620_compat[] __initconst = {
 	"hisilicon,hi3620-hi4511",
 	NULL,
 };
 
 DT_MACHINE_START(HI3620, "Hisilicon Hi3620 (Flattened Device Tree)")
 	.map_io		= hi3620_map_io,
-	.dt_compat	= hi3xxx_compat,
+	.dt_compat	= hi3620_compat,
 MACHINE_END
diff --git a/arch/arm/mach-hisi/hotplug.c b/arch/arm/mach-hisi/hotplug.c
index a129aae..f06b428 100644
--- a/arch/arm/mach-hisi/hotplug.c
+++ b/arch/arm/mach-hisi/hotplug.c
@@ -143,7 +143,7 @@ static void set_cpu_hi3620(int cpu, bool enable)
 	}
 }
 
-static int hi3xxx_hotplug_init(void)
+static int hi3620_hotplug_init(void)
 {
 	struct device_node *node;
 
@@ -157,10 +157,10 @@ static int hi3xxx_hotplug_init(void)
 	return -ENOENT;
 }
 
-void hi3xxx_set_cpu(int cpu, bool enable)
+void hi3620_set_cpu(int cpu, bool enable)
 {
 	if (!ctrl_base) {
-		if (hi3xxx_hotplug_init() < 0)
+		if (hi3620_hotplug_init() < 0)
 			return;
 	}
 
@@ -262,24 +262,24 @@ static inline void cpu_enter_lowpower(void)
 }
 
 #ifdef CONFIG_HOTPLUG_CPU
-void hi3xxx_cpu_die(unsigned int cpu)
+void hi3620_cpu_die(unsigned int cpu)
 {
 	cpu_enter_lowpower();
-	hi3xxx_set_cpu_jump(cpu, phys_to_virt(0));
+	hi3620_set_cpu_jump(cpu, phys_to_virt(0));
 	cpu_do_idle();
 
 	/* We should have never returned from idle */
 	panic("cpu %d unexpectedly exit from shutdown\n", cpu);
 }
 
-int hi3xxx_cpu_kill(unsigned int cpu)
+int hi3620_cpu_kill(unsigned int cpu)
 {
 	unsigned long timeout = jiffies + msecs_to_jiffies(50);
 
-	while (hi3xxx_get_cpu_jump(cpu))
+	while (hi3620_get_cpu_jump(cpu))
 		if (time_after(jiffies, timeout))
 			return 0;
-	hi3xxx_set_cpu(cpu, false);
+	hi3620_set_cpu(cpu, false);
 	return 1;
 }
 
diff --git a/arch/arm/mach-hisi/platsmp.c b/arch/arm/mach-hisi/platsmp.c
index e1d6764..e36783e 100644
--- a/arch/arm/mach-hisi/platsmp.c
+++ b/arch/arm/mach-hisi/platsmp.c
@@ -23,7 +23,7 @@
 
 static void __iomem *ctrl_base;
 
-void hi3xxx_set_cpu_jump(int cpu, void *jump_addr)
+void hi3620_set_cpu_jump(int cpu, void *jump_addr)
 {
 	cpu = cpu_logical_map(cpu);
 	if (!cpu || !ctrl_base)
@@ -31,7 +31,7 @@ void hi3xxx_set_cpu_jump(int cpu, void *jump_addr)
 	writel_relaxed(virt_to_phys(jump_addr), ctrl_base + ((cpu - 1) << 2));
 }
 
-int hi3xxx_get_cpu_jump(int cpu)
+int hi3620_get_cpu_jump(int cpu)
 {
 	cpu = cpu_logical_map(cpu);
 	if (!cpu || !ctrl_base)
@@ -56,7 +56,7 @@ static void __init hisi_enable_scu_a9(void)
 	}
 }
 
-static void __init hi3xxx_smp_prepare_cpus(unsigned int max_cpus)
+static void __init hi3620_smp_prepare_cpus(unsigned int max_cpus)
 {
 	struct device_node *np = NULL;
 	u32 offset = 0;
@@ -81,20 +81,20 @@ static void __init hi3xxx_smp_prepare_cpus(unsigned int max_cpus)
 	}
 }
 
-static int hi3xxx_boot_secondary(unsigned int cpu, struct task_struct *idle)
+static int hi3620_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
-	hi3xxx_set_cpu(cpu, true);
-	hi3xxx_set_cpu_jump(cpu, secondary_startup);
+	hi3620_set_cpu(cpu, true);
+	hi3620_set_cpu_jump(cpu, secondary_startup);
 	arch_send_wakeup_ipi_mask(cpumask_of(cpu));
 	return 0;
 }
 
-static const struct smp_operations hi3xxx_smp_ops __initconst = {
-	.smp_prepare_cpus	= hi3xxx_smp_prepare_cpus,
-	.smp_boot_secondary	= hi3xxx_boot_secondary,
+static const struct smp_operations hi3620_smp_ops __initconst = {
+	.smp_prepare_cpus	= hi3620_smp_prepare_cpus,
+	.smp_boot_secondary	= hi3620_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
-	.cpu_die		= hi3xxx_cpu_die,
-	.cpu_kill		= hi3xxx_cpu_kill,
+	.cpu_die		= hi3620_cpu_die,
+	.cpu_kill		= hi3620_cpu_kill,
 #endif
 };
 
@@ -181,6 +181,6 @@ static const struct smp_operations hip01_smp_ops __initconst = {
 	.smp_boot_secondary     = hip01_boot_secondary,
 };
 
-CPU_METHOD_OF_DECLARE(hi3xxx_smp, "hisilicon,hi3620-smp", &hi3xxx_smp_ops);
+CPU_METHOD_OF_DECLARE(hi3620_smp, "hisilicon,hi3620-smp", &hi3620_smp_ops);
 CPU_METHOD_OF_DECLARE(hix5hd2_smp, "hisilicon,hix5hd2-smp", &hix5hd2_smp_ops);
 CPU_METHOD_OF_DECLARE(hip01_smp, "hisilicon,hip01-smp", &hip01_smp_ops);
-- 
2.9.3




More information about the linux-arm-kernel mailing list