diff options
Diffstat (limited to 'arch/arc/kernel/mcip.c')
-rw-r--r-- | arch/arc/kernel/mcip.c | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/arch/arc/kernel/mcip.c b/arch/arc/kernel/mcip.c index 72f9179b1a24..c424d5abc318 100644 --- a/arch/arc/kernel/mcip.c +++ b/arch/arc/kernel/mcip.c | |||
@@ -15,11 +15,12 @@ | |||
15 | #include <asm/mcip.h> | 15 | #include <asm/mcip.h> |
16 | #include <asm/setup.h> | 16 | #include <asm/setup.h> |
17 | 17 | ||
18 | static char smp_cpuinfo_buf[128]; | ||
19 | static int idu_detected; | ||
20 | |||
21 | static DEFINE_RAW_SPINLOCK(mcip_lock); | 18 | static DEFINE_RAW_SPINLOCK(mcip_lock); |
22 | 19 | ||
20 | #ifdef CONFIG_SMP | ||
21 | |||
22 | static char smp_cpuinfo_buf[128]; | ||
23 | |||
23 | static void mcip_setup_per_cpu(int cpu) | 24 | static void mcip_setup_per_cpu(int cpu) |
24 | { | 25 | { |
25 | smp_ipi_irq_setup(cpu, IPI_IRQ); | 26 | smp_ipi_irq_setup(cpu, IPI_IRQ); |
@@ -86,21 +87,7 @@ static void mcip_ipi_clear(int irq) | |||
86 | 87 | ||
87 | static void mcip_probe_n_setup(void) | 88 | static void mcip_probe_n_setup(void) |
88 | { | 89 | { |
89 | struct mcip_bcr { | 90 | struct mcip_bcr mp; |
90 | #ifdef CONFIG_CPU_BIG_ENDIAN | ||
91 | unsigned int pad3:8, | ||
92 | idu:1, llm:1, num_cores:6, | ||
93 | iocoh:1, gfrc:1, dbg:1, pad2:1, | ||
94 | msg:1, sem:1, ipi:1, pad:1, | ||
95 | ver:8; | ||
96 | #else | ||
97 | unsigned int ver:8, | ||
98 | pad:1, ipi:1, sem:1, msg:1, | ||
99 | pad2:1, dbg:1, gfrc:1, iocoh:1, | ||
100 | num_cores:6, llm:1, idu:1, | ||
101 | pad3:8; | ||
102 | #endif | ||
103 | } mp; | ||
104 | 91 | ||
105 | READ_BCR(ARC_REG_MCIP_BCR, mp); | 92 | READ_BCR(ARC_REG_MCIP_BCR, mp); |
106 | 93 | ||
@@ -114,7 +101,6 @@ static void mcip_probe_n_setup(void) | |||
114 | IS_AVAIL1(mp.gfrc, "GFRC")); | 101 | IS_AVAIL1(mp.gfrc, "GFRC")); |
115 | 102 | ||
116 | cpuinfo_arc700[0].extn.gfrc = mp.gfrc; | 103 | cpuinfo_arc700[0].extn.gfrc = mp.gfrc; |
117 | idu_detected = mp.idu; | ||
118 | 104 | ||
119 | if (mp.dbg) { | 105 | if (mp.dbg) { |
120 | __mcip_cmd_data(CMD_DEBUG_SET_SELECT, 0, 0xf); | 106 | __mcip_cmd_data(CMD_DEBUG_SET_SELECT, 0, 0xf); |
@@ -130,6 +116,8 @@ struct plat_smp_ops plat_smp_ops = { | |||
130 | .ipi_clear = mcip_ipi_clear, | 116 | .ipi_clear = mcip_ipi_clear, |
131 | }; | 117 | }; |
132 | 118 | ||
119 | #endif | ||
120 | |||
133 | /*************************************************************************** | 121 | /*************************************************************************** |
134 | * ARCv2 Interrupt Distribution Unit (IDU) | 122 | * ARCv2 Interrupt Distribution Unit (IDU) |
135 | * | 123 | * |
@@ -295,8 +283,11 @@ idu_of_init(struct device_node *intc, struct device_node *parent) | |||
295 | /* Read IDU BCR to confirm nr_irqs */ | 283 | /* Read IDU BCR to confirm nr_irqs */ |
296 | int nr_irqs = of_irq_count(intc); | 284 | int nr_irqs = of_irq_count(intc); |
297 | int i, irq; | 285 | int i, irq; |
286 | struct mcip_bcr mp; | ||
287 | |||
288 | READ_BCR(ARC_REG_MCIP_BCR, mp); | ||
298 | 289 | ||
299 | if (!idu_detected) | 290 | if (!mp.idu) |
300 | panic("IDU not detected, but DeviceTree using it"); | 291 | panic("IDU not detected, but DeviceTree using it"); |
301 | 292 | ||
302 | pr_info("MCIP: IDU referenced from Devicetree %d irqs\n", nr_irqs); | 293 | pr_info("MCIP: IDU referenced from Devicetree %d irqs\n", nr_irqs); |