]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blame - arch/arm/mach-iop32x/irq.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
[mirror_ubuntu-hirsute-kernel.git] / arch / arm / mach-iop32x / irq.c
CommitLineData
d2912cb1 1// SPDX-License-Identifier: GPL-2.0-only
1da177e4 2/*
c852ac80 3 * arch/arm/mach-iop32x/irq.c
1da177e4 4 *
3f7e5815 5 * Generic IOP32X IRQ handling functionality
1da177e4
LT
6 *
7 * Author: Rory Bolt <rorybolt@pacbell.net>
8 * Copyright (C) 2002 Rory Bolt
1da177e4 9 */
c852ac80 10
1da177e4
LT
11#include <linux/init.h>
12#include <linux/interrupt.h>
13#include <linux/list.h>
1da177e4
LT
14#include <asm/mach/irq.h>
15#include <asm/irq.h>
a09e64fb 16#include <mach/hardware.h>
1da177e4
LT
17#include <asm/mach-types.h>
18
c852ac80 19static u32 iop32x_mask;
1da177e4 20
d73d8011 21static void intctl_write(u32 val)
1da177e4 22{
c852ac80 23 asm volatile("mcr p6, 0, %0, c0, c0, 0" : : "r" (val));
1da177e4
LT
24}
25
d73d8011 26static void intstr_write(u32 val)
1da177e4 27{
c852ac80 28 asm volatile("mcr p6, 0, %0, c4, c0, 0" : : "r" (val));
1da177e4
LT
29}
30
31static void
465b4079 32iop32x_irq_mask(struct irq_data *d)
1da177e4 33{
465b4079 34 iop32x_mask &= ~(1 << d->irq);
c852ac80 35 intctl_write(iop32x_mask);
1da177e4
LT
36}
37
38static void
465b4079 39iop32x_irq_unmask(struct irq_data *d)
1da177e4 40{
465b4079 41 iop32x_mask |= 1 << d->irq;
c852ac80 42 intctl_write(iop32x_mask);
1da177e4
LT
43}
44
38c677cb 45struct irq_chip ext_chip = {
465b4079
LB
46 .name = "IOP32x",
47 .irq_ack = iop32x_irq_mask,
48 .irq_mask = iop32x_irq_mask,
49 .irq_unmask = iop32x_irq_unmask,
1da177e4
LT
50};
51
c852ac80 52void __init iop32x_init_irq(void)
1da177e4 53{
c852ac80 54 int i;
1da177e4 55
588ef769
DW
56 iop_init_cp6_handler();
57
c852ac80
LB
58 intctl_write(0);
59 intstr_write(0);
0c92e830
LB
60 if (machine_is_glantank() ||
61 machine_is_iq80321() ||
e60d07b6 62 machine_is_iq31244() ||
a8135fcf
AP
63 machine_is_n2100() ||
64 machine_is_em7210())
7e9740b1 65 *IOP3XX_PCIIRSR = 0x0f;
1da177e4 66
c852ac80 67 for (i = 0; i < NR_IRQS; i++) {
f38c02f3 68 irq_set_chip_and_handler(i, &ext_chip, handle_level_irq);
e8d36d5d 69 irq_clear_status_flags(i, IRQ_NOREQUEST | IRQ_NOPROBE);
1da177e4
LT
70 }
71}