~ubuntu-branches/ubuntu/quantal/linux-linaro-mx51/quantal

« back to all changes in this revision

Viewing changes to arch/arm/mach-ns9xxx/irq.c

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-3o58a3c1bj7x00rs
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * arch/arm/mach-ns9xxx/irq.c
3
 
 *
4
 
 * Copyright (C) 2006,2007 by Digi International Inc.
5
 
 * All rights reserved.
6
 
 *
7
 
 * This program is free software; you can redistribute it and/or modify it
8
 
 * under the terms of the GNU General Public License version 2 as published by
9
 
 * the Free Software Foundation.
10
 
 */
11
 
#include <linux/interrupt.h>
12
 
#include <linux/kernel_stat.h>
13
 
#include <linux/io.h>
14
 
#include <asm/mach/irq.h>
15
 
#include <mach/regs-sys-common.h>
16
 
#include <mach/irqs.h>
17
 
#include <mach/board.h>
18
 
 
19
 
#include "generic.h"
20
 
 
21
 
/* simple interrupt prio table: prio(x) < prio(y) <=> x < y */
22
 
#define irq2prio(i) (i)
23
 
#define prio2irq(p) (p)
24
 
 
25
 
static void ns9xxx_mask_irq(struct irq_data *d)
26
 
{
27
 
        /* XXX: better use cpp symbols */
28
 
        int prio = irq2prio(d->irq);
29
 
        u32 ic = __raw_readl(SYS_IC(prio / 4));
30
 
        ic &= ~(1 << (7 + 8 * (3 - (prio & 3))));
31
 
        __raw_writel(ic, SYS_IC(prio / 4));
32
 
}
33
 
 
34
 
static void ns9xxx_eoi_irq(struct irq_data *d)
35
 
{
36
 
        __raw_writel(0, SYS_ISRADDR);
37
 
}
38
 
 
39
 
static void ns9xxx_unmask_irq(struct irq_data *d)
40
 
{
41
 
        /* XXX: better use cpp symbols */
42
 
        int prio = irq2prio(d->irq);
43
 
        u32 ic = __raw_readl(SYS_IC(prio / 4));
44
 
        ic |= 1 << (7 + 8 * (3 - (prio & 3)));
45
 
        __raw_writel(ic, SYS_IC(prio / 4));
46
 
}
47
 
 
48
 
static struct irq_chip ns9xxx_chip = {
49
 
        .irq_eoi        = ns9xxx_eoi_irq,
50
 
        .irq_mask       = ns9xxx_mask_irq,
51
 
        .irq_unmask     = ns9xxx_unmask_irq,
52
 
};
53
 
 
54
 
void __init ns9xxx_init_irq(void)
55
 
{
56
 
        int i;
57
 
 
58
 
        /* disable all IRQs */
59
 
        for (i = 0; i < 8; ++i)
60
 
                __raw_writel(prio2irq(4 * i) << 24 |
61
 
                                prio2irq(4 * i + 1) << 16 |
62
 
                                prio2irq(4 * i + 2) << 8 |
63
 
                                prio2irq(4 * i + 3),
64
 
                                SYS_IC(i));
65
 
 
66
 
        for (i = 0; i < 32; ++i)
67
 
                __raw_writel(prio2irq(i), SYS_IVA(i));
68
 
 
69
 
        for (i = 0; i <= 31; ++i) {
70
 
                irq_set_chip_and_handler(i, &ns9xxx_chip, handle_fasteoi_irq);
71
 
                set_irq_flags(i, IRQF_VALID);
72
 
                irq_set_status_flags(i, IRQ_LEVEL);
73
 
        }
74
 
}