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

« back to all changes in this revision

Viewing changes to arch/arm/common/gic.c

  • Committer: Bazaar Package Importer
  • Author(s): John Rigby, John Rigby
  • Date: 2011-03-18 07:36:33 UTC
  • mfrom: (5.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110318073633-tqfe9391ct71zb2p
Tags: 2.6.38-1001.2
[ John Rigby ]

* Rebase to new upstreams:
  Linux v2.6.38-rc6 -- same
  linaro-linux-2.6.38-upstream-1Mar2011 -- new
  Ubuntu-2.6.38-5.32 -- same
  - LP: #724377
* Enable CONFIG_THUMB2_KERNEL for OMAP[34]
* Bump ABI
* Rebase to new upstreams:
  Linux v2.6.38-rc7
  linaro-linux-2.6.38-upstream-4Mar2011
  ubuntu-natty master-next as of 4Mar2011
* Re-enable display on OMAP4
* Disable CONFIG_OMAP2_DSS_SDI
  - LP: #728603
  - LP: #720055
* Rebase to new upstreams:
  Linux v2.6.38-rc8
  linaro-linux-2.6.38-upstream-9Mar2011
    rebased to 2.6.38-rc8
* Remove generated file kernel-versions and sort kernel-versions.in
* Enable CONFIG_TIMER_STATS
  - LP: #718677
* Rebase to new upstreams:
  Linux v2.6.38 final
  linaro-linux-2.6.38-upstream-16Mar2011
  - LP: #708883
  - LP: #723159
  ubuntu-natty Ubuntu-2.6.38-7.35
* Enable CONFIG_IP_PNP and CONFIG_ROOT_NFS for all flavours
  - LP: #736429
* mach-ux500: fix build error
  workaround a problem in linux-linaro-2.6.38
* OMAP4:Fix -EINVAL for vana, vcxio, vdac
  from omap-linux mailing list pending ack
* turn off ROOT_NFS for mx51
  it makes the kernel too large to boot with current hwpack settings

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
        void __iomem *cpu_base;
45
45
};
46
46
 
 
47
/*
 
48
 * Supported arch specific GIC irq extension.
 
49
 * Default make them NULL.
 
50
 */
 
51
struct irq_chip gic_arch_extn = {
 
52
        .irq_ack        = NULL,
 
53
        .irq_mask       = NULL,
 
54
        .irq_unmask     = NULL,
 
55
        .irq_retrigger  = NULL,
 
56
        .irq_set_type   = NULL,
 
57
        .irq_set_wake   = NULL,
 
58
};
 
59
 
47
60
#ifndef MAX_GIC_NR
48
61
#define MAX_GIC_NR      1
49
62
#endif
74
87
static void gic_ack_irq(struct irq_data *d)
75
88
{
76
89
        spin_lock(&irq_controller_lock);
 
90
        if (gic_arch_extn.irq_ack)
 
91
                gic_arch_extn.irq_ack(d);
77
92
        writel(gic_irq(d), gic_cpu_base(d) + GIC_CPU_EOI);
78
93
        spin_unlock(&irq_controller_lock);
79
94
}
84
99
 
85
100
        spin_lock(&irq_controller_lock);
86
101
        writel(mask, gic_dist_base(d) + GIC_DIST_ENABLE_CLEAR + (gic_irq(d) / 32) * 4);
 
102
        if (gic_arch_extn.irq_mask)
 
103
                gic_arch_extn.irq_mask(d);
87
104
        spin_unlock(&irq_controller_lock);
88
105
}
89
106
 
92
109
        u32 mask = 1 << (d->irq % 32);
93
110
 
94
111
        spin_lock(&irq_controller_lock);
 
112
        if (gic_arch_extn.irq_unmask)
 
113
                gic_arch_extn.irq_unmask(d);
95
114
        writel(mask, gic_dist_base(d) + GIC_DIST_ENABLE_SET + (gic_irq(d) / 32) * 4);
96
115
        spin_unlock(&irq_controller_lock);
97
116
}
116
135
 
117
136
        spin_lock(&irq_controller_lock);
118
137
 
 
138
        if (gic_arch_extn.irq_set_type)
 
139
                gic_arch_extn.irq_set_type(d, type);
 
140
 
119
141
        val = readl(base + GIC_DIST_CONFIG + confoff);
120
142
        if (type == IRQ_TYPE_LEVEL_HIGH)
121
143
                val &= ~confmask;
141
163
        return 0;
142
164
}
143
165
 
 
166
static int gic_retrigger(struct irq_data *d)
 
167
{
 
168
        if (gic_arch_extn.irq_retrigger)
 
169
                return gic_arch_extn.irq_retrigger(d);
 
170
 
 
171
        return -ENXIO;
 
172
}
 
173
 
144
174
#ifdef CONFIG_SMP
145
 
static int
146
 
gic_set_cpu(struct irq_data *d, const struct cpumask *mask_val, bool force)
 
175
static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
 
176
                            bool force)
147
177
{
148
178
        void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + (gic_irq(d) & ~3);
149
179
        unsigned int shift = (d->irq % 4) * 8;
150
180
        unsigned int cpu = cpumask_first(mask_val);
151
 
        u32 val;
152
 
        struct irq_desc *desc;
 
181
        u32 val, mask, bit;
 
182
 
 
183
        if (cpu >= 8)
 
184
                return -EINVAL;
 
185
 
 
186
        mask = 0xff << shift;
 
187
        bit = 1 << (cpu + shift);
153
188
 
154
189
        spin_lock(&irq_controller_lock);
155
 
        desc = irq_to_desc(d->irq);
156
 
        if (desc == NULL) {
157
 
                spin_unlock(&irq_controller_lock);
158
 
                return -EINVAL;
159
 
        }
160
190
        d->node = cpu;
161
 
        val = readl(reg) & ~(0xff << shift);
162
 
        val |= 1 << (cpu + shift);
163
 
        writel(val, reg);
 
191
        val = readl(reg) & ~mask;
 
192
        writel(val | bit, reg);
164
193
        spin_unlock(&irq_controller_lock);
165
194
 
166
195
        return 0;
167
196
}
168
197
#endif
169
198
 
 
199
#ifdef CONFIG_PM
 
200
static int gic_set_wake(struct irq_data *d, unsigned int on)
 
201
{
 
202
        int ret = -ENXIO;
 
203
 
 
204
        if (gic_arch_extn.irq_set_wake)
 
205
                ret = gic_arch_extn.irq_set_wake(d, on);
 
206
 
 
207
        return ret;
 
208
}
 
209
 
 
210
#else
 
211
#define gic_set_wake    NULL
 
212
#endif
 
213
 
170
214
static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
171
215
{
172
216
        struct gic_chip_data *chip_data = get_irq_data(irq);
202
246
        .irq_mask               = gic_mask_irq,
203
247
        .irq_unmask             = gic_unmask_irq,
204
248
        .irq_set_type           = gic_set_type,
 
249
        .irq_retrigger          = gic_retrigger,
205
250
#ifdef CONFIG_SMP
206
 
        .irq_set_affinity       = gic_set_cpu,
 
251
        .irq_set_affinity       = gic_set_affinity,
207
252
#endif
 
253
        .irq_set_wake           = gic_set_wake,
208
254
};
209
255
 
210
256
void __init gic_cascade_irq(unsigned int gic_nr, unsigned int irq)