Release 4.14 arch/powerpc/platforms/8xx/pic.c
#include <linux/kernel.h>
#include <linux/stddef.h>
#include <linux/sched.h>
#include <linux/signal.h>
#include <linux/irq.h>
#include <linux/dma-mapping.h>
#include <asm/prom.h>
#include <asm/irq.h>
#include <asm/io.h>
#include <asm/8xx_immap.h>
#include "pic.h"
#define PIC_VEC_SPURRIOUS 15
extern int cpm_get_irq(struct pt_regs *regs);
static struct irq_domain *mpc8xx_pic_host;
static unsigned long mpc8xx_cached_irq_mask;
static sysconf8xx_t __iomem *siu_reg;
static inline unsigned long mpc8xx_irqd_to_bit(struct irq_data *d)
{
return 0x80000000 >> irqd_to_hwirq(d);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Grant C. Likely | 17 | 80.95% | 1 | 50.00% |
Vitaly Bordug | 4 | 19.05% | 1 | 50.00% |
Total | 21 | 100.00% | 2 | 100.00% |
static void mpc8xx_unmask_irq(struct irq_data *d)
{
mpc8xx_cached_irq_mask |= mpc8xx_irqd_to_bit(d);
out_be32(&siu_reg->sc_simask, mpc8xx_cached_irq_mask);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Vitaly Bordug | 17 | 60.71% | 1 | 25.00% |
Grant C. Likely | 6 | 21.43% | 2 | 50.00% |
Lennert Buytenhek | 5 | 17.86% | 1 | 25.00% |
Total | 28 | 100.00% | 4 | 100.00% |
static void mpc8xx_mask_irq(struct irq_data *d)
{
mpc8xx_cached_irq_mask &= ~mpc8xx_irqd_to_bit(d);
out_be32(&siu_reg->sc_simask, mpc8xx_cached_irq_mask);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Vitaly Bordug | 17 | 58.62% | 1 | 25.00% |
Grant C. Likely | 7 | 24.14% | 2 | 50.00% |
Lennert Buytenhek | 5 | 17.24% | 1 | 25.00% |
Total | 29 | 100.00% | 4 | 100.00% |
static void mpc8xx_ack(struct irq_data *d)
{
out_be32(&siu_reg->sc_sipend, mpc8xx_irqd_to_bit(d));
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Vitaly Bordug | 16 | 66.67% | 1 | 33.33% |
Grant C. Likely | 4 | 16.67% | 1 | 33.33% |
Lennert Buytenhek | 4 | 16.67% | 1 | 33.33% |
Total | 24 | 100.00% | 3 | 100.00% |
static void mpc8xx_end_irq(struct irq_data *d)
{
mpc8xx_cached_irq_mask |= mpc8xx_irqd_to_bit(d);
out_be32(&siu_reg->sc_simask, mpc8xx_cached_irq_mask);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Vitaly Bordug | 17 | 60.71% | 1 | 25.00% |
Grant C. Likely | 6 | 21.43% | 2 | 50.00% |
Lennert Buytenhek | 5 | 17.86% | 1 | 25.00% |
Total | 28 | 100.00% | 4 | 100.00% |
static int mpc8xx_set_irq_type(struct irq_data *d, unsigned int flow_type)
{
/* only external IRQ senses are programmable */
if ((flow_type & IRQ_TYPE_EDGE_FALLING) && !(irqd_to_hwirq(d) & 1)) {
unsigned int siel = in_be32(&siu_reg->sc_siel);
siel |= mpc8xx_irqd_to_bit(d);
out_be32(&siu_reg->sc_siel, siel);
irq_set_handler_locked(d, handle_edge_irq);
}
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Vitaly Bordug | 48 | 64.00% | 1 | 14.29% |
Grant C. Likely | 17 | 22.67% | 2 | 28.57% |
Lennert Buytenhek | 5 | 6.67% | 1 | 14.29% |
Thomas Gleixner | 4 | 5.33% | 2 | 28.57% |
Benjamin Herrenschmidt | 1 | 1.33% | 1 | 14.29% |
Total | 75 | 100.00% | 7 | 100.00% |
static struct irq_chip mpc8xx_pic = {
.name = "8XX SIU",
.irq_unmask = mpc8xx_unmask_irq,
.irq_mask = mpc8xx_mask_irq,
.irq_ack = mpc8xx_ack,
.irq_eoi = mpc8xx_end_irq,
.irq_set_type = mpc8xx_set_irq_type,
};
unsigned int mpc8xx_get_irq(void)
{
int irq;
/* For MPC8xx, read the SIVEC register and shift the bits down
* to get the irq number.
*/
irq = in_be32(&siu_reg->sc_sivec) >> 26;
if (irq == PIC_VEC_SPURRIOUS)
return 0;
return irq_linear_revmap(mpc8xx_pic_host, irq);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Vitaly Bordug | 38 | 92.68% | 1 | 33.33% |
Christophe Leroy | 2 | 4.88% | 1 | 33.33% |
Michael Ellerman | 1 | 2.44% | 1 | 33.33% |
Total | 41 | 100.00% | 3 | 100.00% |
static int mpc8xx_pic_host_map(struct irq_domain *h, unsigned int virq,
irq_hw_number_t hw)
{
pr_debug("mpc8xx_pic_host_map(%d, 0x%lx)\n", virq, hw);
/* Set default irq handle */
irq_set_chip_and_handler(virq, &mpc8xx_pic, handle_level_irq);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Vitaly Bordug | 39 | 95.12% | 1 | 33.33% |
Grant C. Likely | 1 | 2.44% | 1 | 33.33% |
Thomas Gleixner | 1 | 2.44% | 1 | 33.33% |
Total | 41 | 100.00% | 3 | 100.00% |
static int mpc8xx_pic_host_xlate(struct irq_domain *h, struct device_node *ct,
const u32 *intspec, unsigned int intsize,
irq_hw_number_t *out_hwirq, unsigned int *out_flags)
{
static unsigned char map_pic_senses[4] = {
IRQ_TYPE_EDGE_RISING,
IRQ_TYPE_LEVEL_LOW,
IRQ_TYPE_LEVEL_HIGH,
IRQ_TYPE_EDGE_FALLING,
};
if (intspec[0] > 0x1f)
return 0;
*out_hwirq = intspec[0];
if (intsize > 1 && intspec[1] < 4)
*out_flags = map_pic_senses[intspec[1]];
else
*out_flags = IRQ_TYPE_NONE;
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Vitaly Bordug | 91 | 86.67% | 1 | 25.00% |
Grant C. Likely | 13 | 12.38% | 2 | 50.00% |
Roman Fietze | 1 | 0.95% | 1 | 25.00% |
Total | 105 | 100.00% | 4 | 100.00% |
static const struct irq_domain_ops mpc8xx_pic_host_ops = {
.map = mpc8xx_pic_host_map,
.xlate = mpc8xx_pic_host_xlate,
};
int mpc8xx_pic_init(void)
{
struct resource res;
struct device_node *np;
int ret;
np = of_find_compatible_node(NULL, NULL, "fsl,pq1-pic");
if (np == NULL)
np = of_find_node_by_type(NULL, "mpc8xx-pic");
if (np == NULL) {
printk(KERN_ERR "Could not find fsl,pq1-pic node\n");
return -ENOMEM;
}
ret = of_address_to_resource(np, 0, &res);
if (ret)
goto out;
siu_reg = ioremap(res.start, resource_size(&res));
if (siu_reg == NULL) {
ret = -EINVAL;
goto out;
}
mpc8xx_pic_host = irq_domain_add_linear(np, 64, &mpc8xx_pic_host_ops, NULL);
if (mpc8xx_pic_host == NULL) {
printk(KERN_ERR "MPC8xx PIC: failed to allocate irq host!\n");
ret = -ENOMEM;
goto out;
}
return 0;
out:
of_node_put(np);
return ret;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Vitaly Bordug | 111 | 68.52% | 1 | 16.67% |
Scott Wood | 19 | 11.73% | 1 | 16.67% |
Julia Lawall | 14 | 8.64% | 1 | 16.67% |
Michael Ellerman | 12 | 7.41% | 1 | 16.67% |
Joe Perches | 4 | 2.47% | 1 | 16.67% |
Grant C. Likely | 2 | 1.23% | 1 | 16.67% |
Total | 162 | 100.00% | 6 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Vitaly Bordug | 504 | 74.89% | 1 | 4.76% |
Grant C. Likely | 76 | 11.29% | 4 | 19.05% |
Lennert Buytenhek | 29 | 4.31% | 1 | 4.76% |
Scott Wood | 20 | 2.97% | 1 | 4.76% |
Julia Lawall | 14 | 2.08% | 1 | 4.76% |
Michael Ellerman | 13 | 1.93% | 2 | 9.52% |
Thomas Gleixner | 6 | 0.89% | 4 | 19.05% |
Christophe Leroy | 4 | 0.59% | 3 | 14.29% |
Joe Perches | 4 | 0.59% | 1 | 4.76% |
Roman Fietze | 1 | 0.15% | 1 | 4.76% |
Benjamin Herrenschmidt | 1 | 0.15% | 1 | 4.76% |
Krzysztof Kozlowski | 1 | 0.15% | 1 | 4.76% |
Total | 673 | 100.00% | 21 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.