~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/mips/pmc-sierra/msp71xx/msp_irq.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
#include <msp_int.h>
21
21
 
22
 
extern void msp_int_handle(void);
23
 
 
24
22
/* SLP bases systems */
25
23
extern void msp_slp_irq_init(void);
26
24
extern void msp_slp_irq_dispatch(void);
29
27
extern void msp_cic_irq_init(void);
30
28
extern void msp_cic_irq_dispatch(void);
31
29
 
 
30
/* VSMP support init */
 
31
extern void msp_vsmp_int_init(void);
 
32
 
 
33
/* vectored interrupt implementation */
 
34
 
 
35
/* SW0/1 interrupts are used for SMP/SMTC */
 
36
static inline void mac0_int_dispatch(void) { do_IRQ(MSP_INT_MAC0); }
 
37
static inline void mac1_int_dispatch(void) { do_IRQ(MSP_INT_MAC1); }
 
38
static inline void mac2_int_dispatch(void) { do_IRQ(MSP_INT_SAR); }
 
39
static inline void usb_int_dispatch(void)  { do_IRQ(MSP_INT_USB);  }
 
40
static inline void sec_int_dispatch(void)  { do_IRQ(MSP_INT_SEC);  }
 
41
 
32
42
/*
33
43
 * The PMC-Sierra MSP interrupts are arranged in a 3 level cascaded
34
44
 * hierarchical system.  The first level are the direct MIPS interrupts
96
106
                do_IRQ(MSP_INT_SW1);
97
107
}
98
108
 
99
 
static struct irqaction cascade_msp = {
 
109
static struct irqaction cic_cascade_msp = {
100
110
        .handler = no_action,
101
 
        .name    = "MSP cascade"
 
111
        .name    = "MSP CIC cascade"
102
112
};
103
113
 
 
114
static struct irqaction per_cascade_msp = {
 
115
        .handler = no_action,
 
116
        .name    = "MSP PER cascade"
 
117
};
104
118
 
105
119
void __init arch_init_irq(void)
106
120
{
 
121
        /* assume we'll be using vectored interrupt mode except in UP mode*/
 
122
#ifdef CONFIG_MIPS_MT
 
123
        BUG_ON(!cpu_has_vint);
 
124
#endif
107
125
        /* initialize the 1st-level CPU based interrupt controller */
108
126
        mips_cpu_irq_init();
109
127
 
110
128
#ifdef CONFIG_IRQ_MSP_CIC
111
129
        msp_cic_irq_init();
 
130
#ifdef CONFIG_MIPS_MT
 
131
        set_vi_handler(MSP_INT_CIC, msp_cic_irq_dispatch);
 
132
        set_vi_handler(MSP_INT_MAC0, mac0_int_dispatch);
 
133
        set_vi_handler(MSP_INT_MAC1, mac1_int_dispatch);
 
134
        set_vi_handler(MSP_INT_SAR, mac2_int_dispatch);
 
135
        set_vi_handler(MSP_INT_USB, usb_int_dispatch);
 
136
        set_vi_handler(MSP_INT_SEC, sec_int_dispatch);
 
137
#ifdef CONFIG_MIPS_MT_SMP
 
138
        msp_vsmp_int_init();
 
139
#elif defined CONFIG_MIPS_MT_SMTC
 
140
        /*Set hwmask for all platform devices */
 
141
        irq_hwmask[MSP_INT_MAC0] = C_IRQ0;
 
142
        irq_hwmask[MSP_INT_MAC1] = C_IRQ1;
 
143
        irq_hwmask[MSP_INT_USB] = C_IRQ2;
 
144
        irq_hwmask[MSP_INT_SAR] = C_IRQ3;
 
145
        irq_hwmask[MSP_INT_SEC] = C_IRQ5;
112
146
 
 
147
#endif  /* CONFIG_MIPS_MT_SMP */
 
148
#endif  /* CONFIG_MIPS_MT */
113
149
        /* setup the cascaded interrupts */
114
 
        setup_irq(MSP_INT_CIC, &cascade_msp);
115
 
        setup_irq(MSP_INT_PER, &cascade_msp);
 
150
        setup_irq(MSP_INT_CIC, &cic_cascade_msp);
 
151
        setup_irq(MSP_INT_PER, &per_cascade_msp);
 
152
 
116
153
#else
117
154
        /* setup the 2nd-level SLP register based interrupt controller */
 
155
        /* VSMP /SMTC support support is not enabled for SLP */
118
156
        msp_slp_irq_init();
119
157
 
120
158
        /* setup the cascaded SLP/PER interrupts */
121
 
        setup_irq(MSP_INT_SLP, &cascade_msp);
122
 
        setup_irq(MSP_INT_PER, &cascade_msp);
 
159
        setup_irq(MSP_INT_SLP, &cic_cascade_msp);
 
160
        setup_irq(MSP_INT_PER, &per_cascade_msp);
123
161
#endif
124
162
}