aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/include/asm/leon.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/include/asm/leon.h')
-rw-r--r--arch/sparc/include/asm/leon.h59
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
186extern void sparc_leon_eirq_register(int eirq);
187extern void leon_init(void); 163extern void leon_init(void);
188extern void leon_switch_mm(void); 164extern void leon_switch_mm(void);
189extern void leon_init_IRQ(void); 165extern 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
203static 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
210static 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
329struct device_node; 317struct device_node;
330extern int sparc_leon_eirq_get(int eirq, int cpu); 318extern unsigned int leon_build_device_irq(unsigned int real_irq,
331extern irqreturn_t sparc_leon_eirq_isr(int dummy, void *dev_id); 319 irq_flow_handler_t flow_handler,
332extern void sparc_leon_eirq_register(int eirq); 320 const char *name, int do_ack);
321extern void leon_update_virq_handling(unsigned int virq,
322 irq_flow_handler_t flow_handler,
323 const char *name, int do_ack);
333extern void leon_clear_clock_irq(void); 324extern void leon_clear_clock_irq(void);
334extern void leon_load_profile_irq(int cpu, unsigned int limit); 325extern void leon_load_profile_irq(int cpu, unsigned int limit);
335extern void leon_init_timers(irq_handler_t counter_fn); 326extern void leon_init_timers(irq_handler_t counter_fn);
@@ -346,6 +337,7 @@ extern void leon3_getCacheRegs(struct leon3_cacheregs *regs);
346extern int leon_flush_needed(void); 337extern int leon_flush_needed(void);
347extern void leon_switch_mm(void); 338extern void leon_switch_mm(void);
348extern int srmmu_swprobe_trace; 339extern int srmmu_swprobe_trace;
340extern int leon3_ticker_irq;
349 341
350#ifdef CONFIG_SMP 342#ifdef CONFIG_SMP
351extern int leon_smp_nrcpus(void); 343extern int leon_smp_nrcpus(void);
@@ -354,20 +346,19 @@ extern void leon_smp_done(void);
354extern void leon_boot_cpus(void); 346extern void leon_boot_cpus(void);
355extern int leon_boot_one_cpu(int i); 347extern int leon_boot_one_cpu(int i);
356void leon_init_smp(void); 348void leon_init_smp(void);
357extern void cpu_probe(void);
358extern void cpu_idle(void); 349extern void cpu_idle(void);
359extern void init_IRQ(void); 350extern void init_IRQ(void);
360extern void cpu_panic(void); 351extern void cpu_panic(void);
361extern int __leon_processor_id(void); 352extern int __leon_processor_id(void);
362void leon_enable_irq_cpu(unsigned int irq_nr, unsigned int cpu); 353void leon_enable_irq_cpu(unsigned int irq_nr, unsigned int cpu);
354extern irqreturn_t leon_percpu_timer_interrupt(int irq, void *unused);
363 355
364extern unsigned int real_irq_entry[], smpleon_ticker[]; 356extern unsigned int real_irq_entry[];
357extern unsigned int smpleon_ipi[];
365extern unsigned int patchme_maybe_smp_msg[]; 358extern unsigned int patchme_maybe_smp_msg[];
366extern unsigned long trapbase_cpu1[];
367extern unsigned long trapbase_cpu2[];
368extern unsigned long trapbase_cpu3[];
369extern unsigned int t_nmi[], linux_trap_ipi15_leon[]; 359extern unsigned int t_nmi[], linux_trap_ipi15_leon[];
370extern unsigned int linux_trap_ipi15_sun4m[]; 360extern unsigned int linux_trap_ipi15_sun4m[];
361extern int leon_ipi_irq;
371 362
372#endif /* CONFIG_SMP */ 363#endif /* CONFIG_SMP */
373 364