aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/sh4a/smp-shx3.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-03-29 23:38:01 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-04-20 23:23:25 -0400
commit3366e3585fbf0d40ce6f2382b544851cf4df1654 (patch)
tree2d0e01291d103d28bdb67afffb816fa1d7023fbb /arch/sh/kernel/cpu/sh4a/smp-shx3.c
parent4a6feab0ee5240c4bd5378d9f8a46b85718c68a7 (diff)
sh: Move platform smp ops in to their own structure.
This cribs the MIPS plat_smp_ops approach for wrapping up the platform ops. This will allow for mixing and matching different ops on the same platform in the future. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu/sh4a/smp-shx3.c')
-rw-r--r--arch/sh/kernel/cpu/sh4a/smp-shx3.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/smp-shx3.c b/arch/sh/kernel/cpu/sh4a/smp-shx3.c
index c98b4574c44e..5c5d50ccbfcd 100644
--- a/arch/sh/kernel/cpu/sh4a/smp-shx3.c
+++ b/arch/sh/kernel/cpu/sh4a/smp-shx3.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * SH-X3 SMP 2 * SH-X3 SMP
3 * 3 *
4 * Copyright (C) 2007 - 2008 Paul Mundt 4 * Copyright (C) 2007 - 2010 Paul Mundt
5 * Copyright (C) 2007 Magnus Damm 5 * Copyright (C) 2007 Magnus Damm
6 * 6 *
7 * This file is subject to the terms and conditions of the GNU General Public 7 * This file is subject to the terms and conditions of the GNU General Public
@@ -37,7 +37,7 @@ static irqreturn_t ipi_interrupt_handler(int irq, void *arg)
37 return IRQ_HANDLED; 37 return IRQ_HANDLED;
38} 38}
39 39
40void __init plat_smp_setup(void) 40static void shx3_smp_setup(void)
41{ 41{
42 unsigned int cpu = 0; 42 unsigned int cpu = 0;
43 int i, num; 43 int i, num;
@@ -63,7 +63,7 @@ void __init plat_smp_setup(void)
63 printk(KERN_INFO "Detected %i available secondary CPU(s)\n", num); 63 printk(KERN_INFO "Detected %i available secondary CPU(s)\n", num);
64} 64}
65 65
66void __init plat_prepare_cpus(unsigned int max_cpus) 66static void shx3_prepare_cpus(unsigned int max_cpus)
67{ 67{
68 int i; 68 int i;
69 69
@@ -76,7 +76,7 @@ void __init plat_prepare_cpus(unsigned int max_cpus)
76 IRQF_DISABLED | IRQF_PERCPU, "IPI", (void *)(long)i); 76 IRQF_DISABLED | IRQF_PERCPU, "IPI", (void *)(long)i);
77} 77}
78 78
79void plat_start_cpu(unsigned int cpu, unsigned long entry_point) 79static void shx3_start_cpu(unsigned int cpu, unsigned long entry_point)
80{ 80{
81 if (__in_29bit_mode()) 81 if (__in_29bit_mode())
82 __raw_writel(entry_point, RESET_REG(cpu)); 82 __raw_writel(entry_point, RESET_REG(cpu));
@@ -93,12 +93,12 @@ void plat_start_cpu(unsigned int cpu, unsigned long entry_point)
93 __raw_writel(STBCR_RESET | STBCR_LTSLP, STBCR_REG(cpu)); 93 __raw_writel(STBCR_RESET | STBCR_LTSLP, STBCR_REG(cpu));
94} 94}
95 95
96int plat_smp_processor_id(void) 96static unsigned int shx3_smp_processor_id(void)
97{ 97{
98 return __raw_readl(0xff000048); /* CPIDR */ 98 return __raw_readl(0xff000048); /* CPIDR */
99} 99}
100 100
101void plat_send_ipi(unsigned int cpu, unsigned int message) 101static void shx3_send_ipi(unsigned int cpu, unsigned int message)
102{ 102{
103 unsigned long addr = 0xfe410070 + (cpu * 4); 103 unsigned long addr = 0xfe410070 + (cpu * 4);
104 104
@@ -106,3 +106,11 @@ void plat_send_ipi(unsigned int cpu, unsigned int message)
106 106
107 __raw_writel(1 << (message << 2), addr); /* C0INTICI..CnINTICI */ 107 __raw_writel(1 << (message << 2), addr); /* C0INTICI..CnINTICI */
108} 108}
109
110struct plat_smp_ops shx3_smp_ops = {
111 .smp_setup = shx3_smp_setup,
112 .prepare_cpus = shx3_prepare_cpus,
113 .start_cpu = shx3_start_cpu,
114 .smp_processor_id = shx3_smp_processor_id,
115 .send_ipi = shx3_send_ipi,
116};