Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91183
b: refs/heads/master
c: ed6f598
h: refs/heads/master
i:
  91181: 5e4924a
  91179: fac2a26
  91175: 1c304f6
  91167: ba59428
v: v3
  • Loading branch information
Uwe Kleine-König authored and Uwe Kleine-König committed Mar 31, 2008
1 parent 41e4a9b commit e6f7a40
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5e69b945f20aec17bf057acbb61b6682461e7149
refs/heads/master: ed6f5987235c628e1041311d7c1efdf659e2dad7
30 changes: 18 additions & 12 deletions trunk/arch/arm/mach-ns9xxx/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,17 @@

#include "generic.h"

/* simple interrupt prio table: prio(x) < prio(y) <=> x < y */
#define irq2prio(i) (i)
#define prio2irq(p) (p)

static void ns9xxx_mask_irq(unsigned int irq)
{
/* XXX: better use cpp symbols */
u32 ic = __raw_readl(SYS_IC(irq / 4));
ic &= ~(1 << (7 + 8 * (3 - (irq & 3))));
__raw_writel(ic, SYS_IC(irq / 4));
int prio = irq2prio(irq);
u32 ic = __raw_readl(SYS_IC(prio / 4));
ic &= ~(1 << (7 + 8 * (3 - (prio & 3))));
__raw_writel(ic, SYS_IC(prio / 4));
}

static void ns9xxx_ack_irq(unsigned int irq)
Expand All @@ -41,9 +46,10 @@ static void ns9xxx_maskack_irq(unsigned int irq)
static void ns9xxx_unmask_irq(unsigned int irq)
{
/* XXX: better use cpp symbols */
u32 ic = __raw_readl(SYS_IC(irq / 4));
ic |= 1 << (7 + 8 * (3 - (irq & 3)));
__raw_writel(ic, SYS_IC(irq / 4));
int prio = irq2prio(irq);
u32 ic = __raw_readl(SYS_IC(prio / 4));
ic |= 1 << (7 + 8 * (3 - (prio & 3)));
__raw_writel(ic, SYS_IC(prio / 4));
}

static struct irq_chip ns9xxx_chip = {
Expand Down Expand Up @@ -96,14 +102,14 @@ void __init ns9xxx_init_irq(void)

/* disable all IRQs */
for (i = 0; i < 8; ++i)
__raw_writel((4 * i) << 24 | (4 * i + 1) << 16 |
(4 * i + 2) << 8 | (4 * i + 3), SYS_IC(i));
__raw_writel(prio2irq(4 * i) << 24 |
prio2irq(4 * i + 1) << 16 |
prio2irq(4 * i + 2) << 8 |
prio2irq(4 * i + 3),
SYS_IC(i));

/* simple interrupt prio table:
* prio(x) < prio(y) <=> x < y
*/
for (i = 0; i < 32; ++i)
__raw_writel(i, SYS_IVA(i));
__raw_writel(prio2irq(i), SYS_IVA(i));

for (i = 0; i <= 31; ++i) {
set_irq_chip(i, &ns9xxx_chip);
Expand Down

0 comments on commit e6f7a40

Please sign in to comment.