|
12 | 12 | #include <linux/init.h> |
13 | 13 | #include <linux/irqdomain.h> |
14 | 14 | #include <linux/irq.h> |
15 | | -#include <asm/page.h> |
| 15 | +#include <linux/of_address.h> |
16 | 16 | #include <linux/io.h> |
17 | 17 | #include <linux/bug.h> |
18 | 18 |
|
19 | 19 | #include <asm/prom.h> |
20 | 20 | #include <asm/irq.h> |
21 | 21 | #include "../../drivers/irqchip/irqchip.h" |
22 | 22 |
|
23 | | -static unsigned int intc_baseaddr; |
| 23 | +static void __iomem *intc_baseaddr; |
24 | 24 |
|
25 | 25 | /* No one else should require these constants, so define them locally here. */ |
26 | 26 | #define ISR 0x00 /* Interrupt Status Register */ |
@@ -120,19 +120,28 @@ static int __init xilinx_intc_of_init(struct device_node *intc, |
120 | 120 | struct device_node *parent) |
121 | 121 | { |
122 | 122 | u32 nr_irq, intr_mask; |
| 123 | + int ret; |
123 | 124 |
|
124 | | - intc_baseaddr = be32_to_cpup(of_get_property(intc, "reg", NULL)); |
125 | | - intc_baseaddr = (unsigned long) ioremap(intc_baseaddr, PAGE_SIZE); |
126 | | - nr_irq = be32_to_cpup(of_get_property(intc, |
127 | | - "xlnx,num-intr-inputs", NULL)); |
| 125 | + intc_baseaddr = of_iomap(intc, 0); |
| 126 | + BUG_ON(!intc_baseaddr); |
| 127 | + |
| 128 | + ret = of_property_read_u32(intc, "xlnx,num-intr-inputs", &nr_irq); |
| 129 | + if (ret < 0) { |
| 130 | + pr_err("%s: unable to read xlnx,num-intr-inputs\n", __func__); |
| 131 | + return -EINVAL; |
| 132 | + } |
| 133 | + |
| 134 | + ret = of_property_read_u32(intc, "xlnx,kind-of-intr", &intr_mask); |
| 135 | + if (ret < 0) { |
| 136 | + pr_err("%s: unable to read xlnx,kind-of-intr\n", __func__); |
| 137 | + return -EINVAL; |
| 138 | + } |
128 | 139 |
|
129 | | - intr_mask = |
130 | | - be32_to_cpup(of_get_property(intc, "xlnx,kind-of-intr", NULL)); |
131 | 140 | if (intr_mask > (u32)((1ULL << nr_irq) - 1)) |
132 | 141 | pr_info(" ERROR: Mismatch in kind-of-intr param\n"); |
133 | 142 |
|
134 | | - pr_info("%s #0 at 0x%08x, num_irq=%d, edge=0x%x\n", |
135 | | - intc->name, intc_baseaddr, nr_irq, intr_mask); |
| 143 | + pr_info("%s: num_irq=%d, edge=0x%x\n", |
| 144 | + intc->full_name, nr_irq, intr_mask); |
136 | 145 |
|
137 | 146 | /* |
138 | 147 | * Disable all external interrupts until they are |
|
0 commit comments