linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] More highbank fixes for 3.8
@ 2013-01-31 20:01 Rob Herring
  2013-01-31 20:01 ` [PATCH 1/3] ARM: scu: add empty scu_enable for !CONFIG_SMP Rob Herring
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rob Herring @ 2013-01-31 20:01 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

A couple more fixes for highbank related to fallout from using MPIDR
value for the physical cpu id and an scu build error introduced by
suspend fixes. 

Rob

Rob Herring (3):
  ARM: scu: add empty scu_enable for !CONFIG_SMP
  ARM: scu: mask cluster id from cpu_logical_map
  ARM: highbank: mask cluster id from cpu_logical_map

 arch/arm/include/asm/smp_scu.h    |    8 +++++++-
 arch/arm/kernel/smp_scu.c         |    2 +-
 arch/arm/mach-highbank/highbank.c |    3 ++-
 arch/arm/mach-highbank/sysregs.h  |    4 ++--
 4 files changed, 12 insertions(+), 5 deletions(-)

-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] ARM: scu: add empty scu_enable for !CONFIG_SMP
  2013-01-31 20:01 [PATCH 0/3] More highbank fixes for 3.8 Rob Herring
@ 2013-01-31 20:01 ` Rob Herring
  2013-01-31 20:01 ` [PATCH 2/3] ARM: scu: mask cluster id from cpu_logical_map Rob Herring
  2013-01-31 20:01 ` [PATCH 3/3] ARM: highbank: " Rob Herring
  2 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2013-01-31 20:01 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

Add an empty version of scu_enable for !SMP builds. This fixes
compile error for highbank suspend code on !SMP builds.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 arch/arm/include/asm/smp_scu.h |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/smp_scu.h b/arch/arm/include/asm/smp_scu.h
index 4eb6d00..86dff32 100644
--- a/arch/arm/include/asm/smp_scu.h
+++ b/arch/arm/include/asm/smp_scu.h
@@ -7,8 +7,14 @@
 
 #ifndef __ASSEMBLER__
 unsigned int scu_get_core_count(void __iomem *);
-void scu_enable(void __iomem *);
 int scu_power_mode(void __iomem *, unsigned int);
+
+#ifdef CONFIG_SMP
+void scu_enable(void __iomem *scu_base);
+#else
+static inline void scu_enable(void __iomem *scu_base) {}
+#endif
+
 #endif
 
 #endif
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] ARM: scu: mask cluster id from cpu_logical_map
  2013-01-31 20:01 [PATCH 0/3] More highbank fixes for 3.8 Rob Herring
  2013-01-31 20:01 ` [PATCH 1/3] ARM: scu: add empty scu_enable for !CONFIG_SMP Rob Herring
@ 2013-01-31 20:01 ` Rob Herring
  2013-01-31 20:01 ` [PATCH 3/3] ARM: highbank: " Rob Herring
  2 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2013-01-31 20:01 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

With commit a0ae0240 (ARM: kernel: add device tree init map function),
the cpu id value may include the cluster id and is no longer 0-3, so we
need to mask it in scu_power_mode to get the local cpu number. Since we
are only dealing with the cpu we are running on, the cluster id should
not ever be needed.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 arch/arm/kernel/smp_scu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/kernel/smp_scu.c b/arch/arm/kernel/smp_scu.c
index b9f015e..45eac87 100644
--- a/arch/arm/kernel/smp_scu.c
+++ b/arch/arm/kernel/smp_scu.c
@@ -75,7 +75,7 @@ void scu_enable(void __iomem *scu_base)
 int scu_power_mode(void __iomem *scu_base, unsigned int mode)
 {
 	unsigned int val;
-	int cpu = cpu_logical_map(smp_processor_id());
+	int cpu = MPIDR_AFFINITY_LEVEL(cpu_logical_map(smp_processor_id()), 0);
 
 	if (mode > 3 || mode == 1 || cpu > 3)
 		return -EINVAL;
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] ARM: highbank: mask cluster id from cpu_logical_map
  2013-01-31 20:01 [PATCH 0/3] More highbank fixes for 3.8 Rob Herring
  2013-01-31 20:01 ` [PATCH 1/3] ARM: scu: add empty scu_enable for !CONFIG_SMP Rob Herring
  2013-01-31 20:01 ` [PATCH 2/3] ARM: scu: mask cluster id from cpu_logical_map Rob Herring
@ 2013-01-31 20:01 ` Rob Herring
  2 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2013-01-31 20:01 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

With commit a0ae0240 (ARM: kernel: add device tree init map function),
the cpu id value may include the cluster id and is no longer 0-3, so we
need to mask it now to get the right hard cpu index.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 arch/arm/mach-highbank/highbank.c |    3 ++-
 arch/arm/mach-highbank/sysregs.h  |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c
index 981dc1e..e6c0612 100644
--- a/arch/arm/mach-highbank/highbank.c
+++ b/arch/arm/mach-highbank/highbank.c
@@ -28,6 +28,7 @@
 
 #include <asm/arch_timer.h>
 #include <asm/cacheflush.h>
+#include <asm/cputype.h>
 #include <asm/smp_plat.h>
 #include <asm/smp_twd.h>
 #include <asm/hardware/arm_timer.h>
@@ -59,7 +60,7 @@ static void __init highbank_scu_map_io(void)
 
 void highbank_set_cpu_jump(int cpu, void *jump_addr)
 {
-	cpu = cpu_logical_map(cpu);
+	cpu = MPIDR_AFFINITY_LEVEL(cpu_logical_map(cpu), 0);
 	writel(virt_to_phys(jump_addr), HB_JUMP_TABLE_VIRT(cpu));
 	__cpuc_flush_dcache_area(HB_JUMP_TABLE_VIRT(cpu), 16);
 	outer_clean_range(HB_JUMP_TABLE_PHYS(cpu),
diff --git a/arch/arm/mach-highbank/sysregs.h b/arch/arm/mach-highbank/sysregs.h
index 70af9d1..5995df7 100644
--- a/arch/arm/mach-highbank/sysregs.h
+++ b/arch/arm/mach-highbank/sysregs.h
@@ -37,7 +37,7 @@ extern void __iomem *sregs_base;
 
 static inline void highbank_set_core_pwr(void)
 {
-	int cpu = cpu_logical_map(smp_processor_id());
+	int cpu = MPIDR_AFFINITY_LEVEL(cpu_logical_map(smp_processor_id()), 0);
 	if (scu_base_addr)
 		scu_power_mode(scu_base_addr, SCU_PM_POWEROFF);
 	else
@@ -46,7 +46,7 @@ static inline void highbank_set_core_pwr(void)
 
 static inline void highbank_clear_core_pwr(void)
 {
-	int cpu = cpu_logical_map(smp_processor_id());
+	int cpu = MPIDR_AFFINITY_LEVEL(cpu_logical_map(smp_processor_id()), 0);
 	if (scu_base_addr)
 		scu_power_mode(scu_base_addr, SCU_PM_NORMAL);
 	else
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-01-31 20:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-31 20:01 [PATCH 0/3] More highbank fixes for 3.8 Rob Herring
2013-01-31 20:01 ` [PATCH 1/3] ARM: scu: add empty scu_enable for !CONFIG_SMP Rob Herring
2013-01-31 20:01 ` [PATCH 2/3] ARM: scu: mask cluster id from cpu_logical_map Rob Herring
2013-01-31 20:01 ` [PATCH 3/3] ARM: highbank: " Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).