6 #include <linux/kernel.h>
7 #include <linux/errno.h>
16 #include <asm/oplib.h>
17 #include <asm/timer.h>
21 #include <asm/traps.h>
22 #include <asm/cacheflush.h>
24 #include <asm/setup.h>
35 static int dummy_master_l10_counter;
43 #define LEON_IMASK(cpu) (&leon3_irqctrl_regs->mask[cpu])
44 #define LEON_IACK (&leon3_irqctrl_regs->iclear)
45 #define LEON_DO_ACK_HW 1
50 static inline unsigned int leon_eirq_get(
int cpu)
56 static void leon_handle_ext_irq(
unsigned int irq,
struct irq_desc *
desc)
60 int cpu = sparc_leon3_cpuid();
62 eirq = leon_eirq_get(cpu);
64 if ((eirq & 0x10) && p && p->
irq)
71 unsigned long mask, oldmask;
74 if (eirq < 1 || eirq > 0xf) {
99 "leon_get_irqmask: false irq number: %d\n", irq);
112 cpumask_and(&mask, cpu_online_mask, affinity);
113 if (cpumask_equal(&mask, cpu_online_mask) || cpumask_empty(&mask))
116 return cpumask_first(&mask);
119 #define irq_choose_cpu(affinity) boot_cpu_id
132 if (oldcpu == newcpu)
141 spin_unlock_irqrestore(&leon_irq_lock, flags);
156 spin_unlock_irqrestore(&leon_irq_lock, flags);
159 static void leon_mask_irq(
struct irq_data *data)
169 spin_unlock_irqrestore(&leon_irq_lock, flags);
172 static unsigned int leon_startup_irq(
struct irq_data *data)
175 leon_unmask_irq(data);
179 static void leon_shutdown_irq(
struct irq_data *data)
186 static void leon_eoi_irq(
struct irq_data *data)
196 .irq_startup = leon_startup_irq,
197 .irq_shutdown = leon_shutdown_irq,
198 .irq_mask = leon_mask_irq,
199 .irq_unmask = leon_unmask_irq,
200 .irq_eoi = leon_eoi_irq,
201 .irq_set_affinity = leon_set_affinity,
212 const char *
name,
int do_ack)
238 unsigned int real_irq)
245 const char *
name,
int do_ack)
247 unsigned long mask = (
unsigned long)irq_get_chip_data(virq);
258 static u32 leon_cycles_offset(
void)
272 struct clock_event_device *
ce;
275 leon_clear_profile_irq(cpu);
277 ce = &
per_cpu(sparc32_clockevent, cpu);
280 if (ce->event_handler)
281 ce->event_handler(ce);
310 dummy_master_l10_counter = 0;
346 ampopts = *(
int *)pp->
value;
372 (((1000000 /
HZ) - 1)));
388 (((1000000/
HZ) - 1)));
403 icsel = (icsel >> ((7 - (
boot_cpu_id&0x7)) * 4)) & 0xf;
404 leon3_irqctrl_regs += icsel;
432 patchme_maybe_smp_msg[0] = 0x01000000;
433 local_ops->cache_all();
469 static void leon_clear_clock_irq(
void)
473 static void leon_load_profile_irq(
int cpu,
unsigned int limit)
492 void leon_clear_profile_irq(
int cpu)
496 void leon_enable_irq_cpu(
unsigned int irq_nr,
unsigned int cpu)
503 spin_unlock_irqrestore(&leon_irq_lock, flags);