diff options
-rw-r--r-- | arch/microblaze/kernel/intc.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/arch/microblaze/kernel/intc.c b/arch/microblaze/kernel/intc.c index 07be937b3d9a..3b441e255880 100644 --- a/arch/microblaze/kernel/intc.c +++ b/arch/microblaze/kernel/intc.c | |||
@@ -12,7 +12,7 @@ | |||
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/irqdomain.h> | 13 | #include <linux/irqdomain.h> |
14 | #include <linux/irq.h> | 14 | #include <linux/irq.h> |
15 | #include <asm/page.h> | 15 | #include <linux/of_address.h> |
16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
17 | #include <linux/bug.h> | 17 | #include <linux/bug.h> |
18 | 18 | ||
@@ -20,7 +20,7 @@ | |||
20 | #include <asm/irq.h> | 20 | #include <asm/irq.h> |
21 | #include "../../drivers/irqchip/irqchip.h" | 21 | #include "../../drivers/irqchip/irqchip.h" |
22 | 22 | ||
23 | static unsigned int intc_baseaddr; | 23 | static void __iomem *intc_baseaddr; |
24 | 24 | ||
25 | /* No one else should require these constants, so define them locally here. */ | 25 | /* No one else should require these constants, so define them locally here. */ |
26 | #define ISR 0x00 /* Interrupt Status Register */ | 26 | #define ISR 0x00 /* Interrupt Status Register */ |
@@ -120,19 +120,28 @@ static int __init xilinx_intc_of_init(struct device_node *intc, | |||
120 | struct device_node *parent) | 120 | struct device_node *parent) |
121 | { | 121 | { |
122 | u32 nr_irq, intr_mask; | 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 = of_iomap(intc, 0); |
125 | intc_baseaddr = (unsigned long) ioremap(intc_baseaddr, PAGE_SIZE); | 126 | BUG_ON(!intc_baseaddr); |
126 | nr_irq = be32_to_cpup(of_get_property(intc, | 127 | |
127 | "xlnx,num-intr-inputs", NULL)); | 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 | if (intr_mask > (u32)((1ULL << nr_irq) - 1)) | 140 | if (intr_mask > (u32)((1ULL << nr_irq) - 1)) |
132 | pr_info(" ERROR: Mismatch in kind-of-intr param\n"); | 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", | 143 | pr_info("%s: num_irq=%d, edge=0x%x\n", |
135 | intc->name, intc_baseaddr, nr_irq, intr_mask); | 144 | intc->full_name, nr_irq, intr_mask); |
136 | 145 | ||
137 | /* | 146 | /* |
138 | * Disable all external interrupts until they are | 147 | * Disable all external interrupts until they are |