diff options
Diffstat (limited to 'arch/sparc/include/asm/leon.h')
-rw-r--r-- | arch/sparc/include/asm/leon.h | 59 |
1 files changed, 25 insertions, 34 deletions
diff --git a/arch/sparc/include/asm/leon.h b/arch/sparc/include/asm/leon.h index 3ea5964c43b4..a4e457f003ed 100644 --- a/arch/sparc/include/asm/leon.h +++ b/arch/sparc/include/asm/leon.h | |||
@@ -52,29 +52,6 @@ | |||
52 | #define LEON_DIAGF_VALID 0x2000 | 52 | #define LEON_DIAGF_VALID 0x2000 |
53 | #define LEON_DIAGF_VALID_SHIFT 13 | 53 | #define LEON_DIAGF_VALID_SHIFT 13 |
54 | 54 | ||
55 | /* | ||
56 | * Interrupt Sources | ||
57 | * | ||
58 | * The interrupt source numbers directly map to the trap type and to | ||
59 | * the bits used in the Interrupt Clear, Interrupt Force, Interrupt Mask, | ||
60 | * and the Interrupt Pending Registers. | ||
61 | */ | ||
62 | #define LEON_INTERRUPT_CORRECTABLE_MEMORY_ERROR 1 | ||
63 | #define LEON_INTERRUPT_UART_1_RX_TX 2 | ||
64 | #define LEON_INTERRUPT_UART_0_RX_TX 3 | ||
65 | #define LEON_INTERRUPT_EXTERNAL_0 4 | ||
66 | #define LEON_INTERRUPT_EXTERNAL_1 5 | ||
67 | #define LEON_INTERRUPT_EXTERNAL_2 6 | ||
68 | #define LEON_INTERRUPT_EXTERNAL_3 7 | ||
69 | #define LEON_INTERRUPT_TIMER1 8 | ||
70 | #define LEON_INTERRUPT_TIMER2 9 | ||
71 | #define LEON_INTERRUPT_EMPTY1 10 | ||
72 | #define LEON_INTERRUPT_EMPTY2 11 | ||
73 | #define LEON_INTERRUPT_OPEN_ETH 12 | ||
74 | #define LEON_INTERRUPT_EMPTY4 13 | ||
75 | #define LEON_INTERRUPT_EMPTY5 14 | ||
76 | #define LEON_INTERRUPT_EMPTY6 15 | ||
77 | |||
78 | /* irq masks */ | 55 | /* irq masks */ |
79 | #define LEON_HARD_INT(x) (1 << (x)) /* irq 0-15 */ | 56 | #define LEON_HARD_INT(x) (1 << (x)) /* irq 0-15 */ |
80 | #define LEON_IRQMASK_R 0x0000fffe /* bit 15- 1 of lregs.irqmask */ | 57 | #define LEON_IRQMASK_R 0x0000fffe /* bit 15- 1 of lregs.irqmask */ |
@@ -183,7 +160,6 @@ static inline void leon_srmmu_enabletlb(void) | |||
183 | /* macro access for leon_readnobuffer_reg() */ | 160 | /* macro access for leon_readnobuffer_reg() */ |
184 | #define LEON_BYPASSCACHE_LOAD_VA(x) leon_readnobuffer_reg((unsigned long)(x)) | 161 | #define LEON_BYPASSCACHE_LOAD_VA(x) leon_readnobuffer_reg((unsigned long)(x)) |
185 | 162 | ||
186 | extern void sparc_leon_eirq_register(int eirq); | ||
187 | extern void leon_init(void); | 163 | extern void leon_init(void); |
188 | extern void leon_switch_mm(void); | 164 | extern void leon_switch_mm(void); |
189 | extern void leon_init_IRQ(void); | 165 | extern void leon_init_IRQ(void); |
@@ -224,11 +200,23 @@ static inline void sparc_leon3_disable_cache(void) | |||
224 | "sta %%l2, [%%g0] 2\n\t" : : : "l1", "l2"); | 200 | "sta %%l2, [%%g0] 2\n\t" : : : "l1", "l2"); |
225 | }; | 201 | }; |
226 | 202 | ||
203 | static inline unsigned long sparc_leon3_asr17(void) | ||
204 | { | ||
205 | u32 asr17; | ||
206 | __asm__ __volatile__ ("rd %%asr17, %0\n\t" : "=r"(asr17)); | ||
207 | return asr17; | ||
208 | }; | ||
209 | |||
210 | static inline int sparc_leon3_cpuid(void) | ||
211 | { | ||
212 | return sparc_leon3_asr17() >> 28; | ||
213 | } | ||
214 | |||
227 | #endif /*!__ASSEMBLY__*/ | 215 | #endif /*!__ASSEMBLY__*/ |
228 | 216 | ||
229 | #ifdef CONFIG_SMP | 217 | #ifdef CONFIG_SMP |
230 | # define LEON3_IRQ_RESCHEDULE 13 | 218 | # define LEON3_IRQ_IPI_DEFAULT 13 |
231 | # define LEON3_IRQ_TICKER (leon_percpu_timer_dev[0].irq) | 219 | # define LEON3_IRQ_TICKER (leon3_ticker_irq) |
232 | # define LEON3_IRQ_CROSS_CALL 15 | 220 | # define LEON3_IRQ_CROSS_CALL 15 |
233 | #endif | 221 | #endif |
234 | 222 | ||
@@ -327,9 +315,12 @@ struct leon2_cacheregs { | |||
327 | #include <linux/interrupt.h> | 315 | #include <linux/interrupt.h> |
328 | 316 | ||
329 | struct device_node; | 317 | struct device_node; |
330 | extern int sparc_leon_eirq_get(int eirq, int cpu); | 318 | extern unsigned int leon_build_device_irq(unsigned int real_irq, |
331 | extern irqreturn_t sparc_leon_eirq_isr(int dummy, void *dev_id); | 319 | irq_flow_handler_t flow_handler, |
332 | extern void sparc_leon_eirq_register(int eirq); | 320 | const char *name, int do_ack); |
321 | extern void leon_update_virq_handling(unsigned int virq, | ||
322 | irq_flow_handler_t flow_handler, | ||
323 | const char *name, int do_ack); | ||
333 | extern void leon_clear_clock_irq(void); | 324 | extern void leon_clear_clock_irq(void); |
334 | extern void leon_load_profile_irq(int cpu, unsigned int limit); | 325 | extern void leon_load_profile_irq(int cpu, unsigned int limit); |
335 | extern void leon_init_timers(irq_handler_t counter_fn); | 326 | extern void leon_init_timers(irq_handler_t counter_fn); |
@@ -346,6 +337,7 @@ extern void leon3_getCacheRegs(struct leon3_cacheregs *regs); | |||
346 | extern int leon_flush_needed(void); | 337 | extern int leon_flush_needed(void); |
347 | extern void leon_switch_mm(void); | 338 | extern void leon_switch_mm(void); |
348 | extern int srmmu_swprobe_trace; | 339 | extern int srmmu_swprobe_trace; |
340 | extern int leon3_ticker_irq; | ||
349 | 341 | ||
350 | #ifdef CONFIG_SMP | 342 | #ifdef CONFIG_SMP |
351 | extern int leon_smp_nrcpus(void); | 343 | extern int leon_smp_nrcpus(void); |
@@ -354,20 +346,19 @@ extern void leon_smp_done(void); | |||
354 | extern void leon_boot_cpus(void); | 346 | extern void leon_boot_cpus(void); |
355 | extern int leon_boot_one_cpu(int i); | 347 | extern int leon_boot_one_cpu(int i); |
356 | void leon_init_smp(void); | 348 | void leon_init_smp(void); |
357 | extern void cpu_probe(void); | ||
358 | extern void cpu_idle(void); | 349 | extern void cpu_idle(void); |
359 | extern void init_IRQ(void); | 350 | extern void init_IRQ(void); |
360 | extern void cpu_panic(void); | 351 | extern void cpu_panic(void); |
361 | extern int __leon_processor_id(void); | 352 | extern int __leon_processor_id(void); |
362 | void leon_enable_irq_cpu(unsigned int irq_nr, unsigned int cpu); | 353 | void leon_enable_irq_cpu(unsigned int irq_nr, unsigned int cpu); |
354 | extern irqreturn_t leon_percpu_timer_interrupt(int irq, void *unused); | ||
363 | 355 | ||
364 | extern unsigned int real_irq_entry[], smpleon_ticker[]; | 356 | extern unsigned int real_irq_entry[]; |
357 | extern unsigned int smpleon_ipi[]; | ||
365 | extern unsigned int patchme_maybe_smp_msg[]; | 358 | extern unsigned int patchme_maybe_smp_msg[]; |
366 | extern unsigned long trapbase_cpu1[]; | ||
367 | extern unsigned long trapbase_cpu2[]; | ||
368 | extern unsigned long trapbase_cpu3[]; | ||
369 | extern unsigned int t_nmi[], linux_trap_ipi15_leon[]; | 359 | extern unsigned int t_nmi[], linux_trap_ipi15_leon[]; |
370 | extern unsigned int linux_trap_ipi15_sun4m[]; | 360 | extern unsigned int linux_trap_ipi15_sun4m[]; |
361 | extern int leon_ipi_irq; | ||
371 | 362 | ||
372 | #endif /* CONFIG_SMP */ | 363 | #endif /* CONFIG_SMP */ |
373 | 364 | ||