Source
x
/*
* CLPS711X IRQ driver
*
* Copyright (C) 2013 Alexander Shiyan <shc_work@mail.ru>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
static const struct {
unsigned int flags;
phys_addr_t eoi;
} clps711x_irqs[] = {
[1] = { CLPS711X_FLAG_FIQ, CLPS711X_BLEOI, },
[3] = { CLPS711X_FLAG_FIQ, CLPS711X_MCEOI, },
[4] = { CLPS711X_FLAG_EN, CLPS711X_COEOI, },
[5] = { CLPS711X_FLAG_EN, },
[6] = { CLPS711X_FLAG_EN, },
[7] = { CLPS711X_FLAG_EN, },
[8] = { CLPS711X_FLAG_EN, CLPS711X_TC1EOI, },
[9] = { CLPS711X_FLAG_EN, CLPS711X_TC2EOI, },
[10] = { CLPS711X_FLAG_EN, CLPS711X_RTCEOI, },
[11] = { CLPS711X_FLAG_EN, CLPS711X_TEOI, },
[12] = { CLPS711X_FLAG_EN, },
[13] = { CLPS711X_FLAG_EN, },
[14] = { CLPS711X_FLAG_EN, CLPS711X_UMSEOI, },
[15] = { CLPS711X_FLAG_EN, CLPS711X_SRXEOF, },
[16] = { CLPS711X_FLAG_EN, CLPS711X_KBDEOI, },
[17] = { CLPS711X_FLAG_EN, },
[18] = { CLPS711X_FLAG_EN, },
[28] = { CLPS711X_FLAG_EN, },
[29] = { CLPS711X_FLAG_EN, },
[32] = { CLPS711X_FLAG_FIQ, },
};
static struct {
void __iomem *base;
void __iomem *intmr[3];
void __iomem *intsr[3];
struct irq_domain *domain;
struct irq_domain_ops ops;
} *clps711x_intc;
static asmlinkage void __exception_irq_entry clps711x_irqh(struct pt_regs *regs)
{
u32 irqstat;
do {
irqstat = readw_relaxed(clps711x_intc->intmr[0]) &
readw_relaxed(clps711x_intc->intsr[0]);
if (irqstat)
handle_domain_irq(clps711x_intc->domain,
fls(irqstat) - 1, regs);
irqstat = readw_relaxed(clps711x_intc->intmr[1]) &
readw_relaxed(clps711x_intc->intsr[1]);
if (irqstat)
handle_domain_irq(clps711x_intc->domain,
fls(irqstat) - 1 + 16, regs);
} while (irqstat);