Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 1 | /* |
| 2 | * TI Common Platform Interrupt Controller (cp_intc) driver |
| 3 | * |
| 4 | * Author: Steve Chen <schen@mvista.com> |
| 5 | * Copyright (C) 2008-2009, MontaVista Software, Inc. <source@mvista.com> |
| 6 | * |
| 7 | * This file is licensed under the terms of the GNU General Public License |
| 8 | * version 2. This program is licensed "as is" without any warranty of any |
| 9 | * kind, whether express or implied. |
| 10 | */ |
| 11 | |
Heiko Schocher | 07caba9 | 2012-05-30 12:18:57 +0200 | [diff] [blame] | 12 | #include <linux/export.h> |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 13 | #include <linux/init.h> |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 14 | #include <linux/irq.h> |
David Lechner | 9a7f2fc | 2016-02-29 16:33:26 -0600 | [diff] [blame] | 15 | #include <linux/irqchip.h> |
Heiko Schocher | 07caba9 | 2012-05-30 12:18:57 +0200 | [diff] [blame] | 16 | #include <linux/irqdomain.h> |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 17 | #include <linux/io.h> |
Heiko Schocher | 961e657 | 2012-05-30 12:18:58 +0200 | [diff] [blame] | 18 | #include <linux/of.h> |
| 19 | #include <linux/of_address.h> |
| 20 | #include <linux/of_irq.h> |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 21 | |
Bartosz Golaszewski | d006459 | 2019-02-14 15:51:58 +0100 | [diff] [blame] | 22 | #include <asm/exception.h> |
Cyril Chemparathy | bd80894 | 2010-05-07 17:06:37 -0400 | [diff] [blame] | 23 | #include <mach/common.h> |
Bartosz Golaszewski | ed4d189 | 2019-02-14 15:52:17 +0100 | [diff] [blame] | 24 | |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 25 | #define DAVINCI_CP_INTC_CTRL 0x04 |
Bartosz Golaszewski | 3b5d1c5 | 2019-02-14 15:52:22 +0100 | [diff] [blame^] | 26 | #define DAVINCI_CP_INTC_HOST_CTRL 0x0c |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 27 | #define DAVINCI_CP_INTC_GLOBAL_ENABLE 0x10 |
| 28 | #define DAVINCI_CP_INTC_SYS_STAT_IDX_CLR 0x24 |
| 29 | #define DAVINCI_CP_INTC_SYS_ENABLE_IDX_SET 0x28 |
Bartosz Golaszewski | 3b5d1c5 | 2019-02-14 15:52:22 +0100 | [diff] [blame^] | 30 | #define DAVINCI_CP_INTC_SYS_ENABLE_IDX_CLR 0x2c |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 31 | #define DAVINCI_CP_INTC_HOST_ENABLE_IDX_SET 0x34 |
| 32 | #define DAVINCI_CP_INTC_HOST_ENABLE_IDX_CLR 0x38 |
| 33 | #define DAVINCI_CP_INTC_PRIO_IDX 0x80 |
| 34 | #define DAVINCI_CP_INTC_SYS_STAT_CLR(n) (0x0280 + (n << 2)) |
| 35 | #define DAVINCI_CP_INTC_SYS_ENABLE_CLR(n) (0x0380 + (n << 2)) |
| 36 | #define DAVINCI_CP_INTC_CHAN_MAP(n) (0x0400 + (n << 2)) |
Bartosz Golaszewski | 3b5d1c5 | 2019-02-14 15:52:22 +0100 | [diff] [blame^] | 37 | #define DAVINCI_CP_INTC_SYS_POLARITY(n) (0x0d00 + (n << 2)) |
| 38 | #define DAVINCI_CP_INTC_SYS_TYPE(n) (0x0d80 + (n << 2)) |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 39 | #define DAVINCI_CP_INTC_HOST_ENABLE(n) (0x1500 + (n << 2)) |
Bartosz Golaszewski | d006459 | 2019-02-14 15:51:58 +0100 | [diff] [blame] | 40 | #define DAVINCI_CP_INTC_PRI_INDX_MASK GENMASK(9, 0) |
| 41 | #define DAVINCI_CP_INTC_GPIR_NONE BIT(31) |
| 42 | |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 43 | static void __iomem *davinci_cp_intc_base; |
| 44 | static struct irq_domain *davinci_cp_intc_irq_domain; |
Bartosz Golaszewski | fb74684 | 2019-02-14 15:52:00 +0100 | [diff] [blame] | 45 | |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 46 | static inline unsigned int davinci_cp_intc_read(unsigned int offset) |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 47 | { |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 48 | return __raw_readl(davinci_cp_intc_base + offset); |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 49 | } |
| 50 | |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 51 | static inline void davinci_cp_intc_write(unsigned long value, |
| 52 | unsigned int offset) |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 53 | { |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 54 | __raw_writel(value, davinci_cp_intc_base + offset); |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 55 | } |
| 56 | |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 57 | static void davinci_cp_intc_ack_irq(struct irq_data *d) |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 58 | { |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 59 | davinci_cp_intc_write(d->hwirq, DAVINCI_CP_INTC_SYS_STAT_IDX_CLR); |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 60 | } |
| 61 | |
| 62 | /* Disable interrupt */ |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 63 | static void davinci_cp_intc_mask_irq(struct irq_data *d) |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 64 | { |
| 65 | /* XXX don't know why we need to disable nIRQ here... */ |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 66 | davinci_cp_intc_write(1, DAVINCI_CP_INTC_HOST_ENABLE_IDX_CLR); |
| 67 | davinci_cp_intc_write(d->hwirq, DAVINCI_CP_INTC_SYS_ENABLE_IDX_CLR); |
| 68 | davinci_cp_intc_write(1, DAVINCI_CP_INTC_HOST_ENABLE_IDX_SET); |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 69 | } |
| 70 | |
| 71 | /* Enable interrupt */ |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 72 | static void davinci_cp_intc_unmask_irq(struct irq_data *d) |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 73 | { |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 74 | davinci_cp_intc_write(d->hwirq, DAVINCI_CP_INTC_SYS_ENABLE_IDX_SET); |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 75 | } |
| 76 | |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 77 | static int davinci_cp_intc_set_irq_type(struct irq_data *d, |
| 78 | unsigned int flow_type) |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 79 | { |
Heiko Schocher | 07caba9 | 2012-05-30 12:18:57 +0200 | [diff] [blame] | 80 | unsigned reg = BIT_WORD(d->hwirq); |
| 81 | unsigned mask = BIT_MASK(d->hwirq); |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 82 | unsigned polarity = davinci_cp_intc_read( |
| 83 | DAVINCI_CP_INTC_SYS_POLARITY(reg)); |
| 84 | unsigned type = davinci_cp_intc_read( |
| 85 | DAVINCI_CP_INTC_SYS_TYPE(reg)); |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 86 | |
| 87 | switch (flow_type) { |
| 88 | case IRQ_TYPE_EDGE_RISING: |
| 89 | polarity |= mask; |
| 90 | type |= mask; |
| 91 | break; |
| 92 | case IRQ_TYPE_EDGE_FALLING: |
| 93 | polarity &= ~mask; |
| 94 | type |= mask; |
| 95 | break; |
| 96 | case IRQ_TYPE_LEVEL_HIGH: |
| 97 | polarity |= mask; |
| 98 | type &= ~mask; |
| 99 | break; |
| 100 | case IRQ_TYPE_LEVEL_LOW: |
| 101 | polarity &= ~mask; |
| 102 | type &= ~mask; |
| 103 | break; |
| 104 | default: |
| 105 | return -EINVAL; |
| 106 | } |
| 107 | |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 108 | davinci_cp_intc_write(polarity, DAVINCI_CP_INTC_SYS_POLARITY(reg)); |
| 109 | davinci_cp_intc_write(type, DAVINCI_CP_INTC_SYS_TYPE(reg)); |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 110 | |
| 111 | return 0; |
| 112 | } |
| 113 | |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 114 | static struct irq_chip davinci_cp_intc_irq_chip = { |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 115 | .name = "cp_intc", |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 116 | .irq_ack = davinci_cp_intc_ack_irq, |
| 117 | .irq_mask = davinci_cp_intc_mask_irq, |
| 118 | .irq_unmask = davinci_cp_intc_unmask_irq, |
| 119 | .irq_set_type = davinci_cp_intc_set_irq_type, |
Sudeep Holla | 3f86e57 | 2015-08-01 21:03:56 +0530 | [diff] [blame] | 120 | .flags = IRQCHIP_SKIP_SET_WAKE, |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 121 | }; |
| 122 | |
Bartosz Golaszewski | d006459 | 2019-02-14 15:51:58 +0100 | [diff] [blame] | 123 | static asmlinkage void __exception_irq_entry |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 124 | davinci_cp_intc_handle_irq(struct pt_regs *regs) |
Bartosz Golaszewski | d006459 | 2019-02-14 15:51:58 +0100 | [diff] [blame] | 125 | { |
| 126 | int gpir, irqnr, none; |
| 127 | |
| 128 | /* |
| 129 | * The interrupt number is in first ten bits. The NONE field set to 1 |
| 130 | * indicates a spurious irq. |
| 131 | */ |
| 132 | |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 133 | gpir = davinci_cp_intc_read(DAVINCI_CP_INTC_PRIO_IDX); |
Bartosz Golaszewski | d006459 | 2019-02-14 15:51:58 +0100 | [diff] [blame] | 134 | irqnr = gpir & DAVINCI_CP_INTC_PRI_INDX_MASK; |
| 135 | none = gpir & DAVINCI_CP_INTC_GPIR_NONE; |
| 136 | |
| 137 | if (unlikely(none)) { |
| 138 | pr_err_once("%s: spurious irq!\n", __func__); |
| 139 | return; |
| 140 | } |
| 141 | |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 142 | handle_domain_irq(davinci_cp_intc_irq_domain, irqnr, regs); |
Bartosz Golaszewski | d006459 | 2019-02-14 15:51:58 +0100 | [diff] [blame] | 143 | } |
| 144 | |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 145 | static int davinci_cp_intc_host_map(struct irq_domain *h, unsigned int virq, |
Heiko Schocher | 07caba9 | 2012-05-30 12:18:57 +0200 | [diff] [blame] | 146 | irq_hw_number_t hw) |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 147 | { |
Heiko Schocher | 07caba9 | 2012-05-30 12:18:57 +0200 | [diff] [blame] | 148 | pr_debug("cp_intc_host_map(%d, 0x%lx)\n", virq, hw); |
| 149 | |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 150 | irq_set_chip(virq, &davinci_cp_intc_irq_chip); |
Rob Herring | e8d36d5 | 2015-07-27 15:55:13 -0500 | [diff] [blame] | 151 | irq_set_probe(virq); |
Heiko Schocher | 07caba9 | 2012-05-30 12:18:57 +0200 | [diff] [blame] | 152 | irq_set_handler(virq, handle_edge_irq); |
| 153 | return 0; |
| 154 | } |
| 155 | |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 156 | static const struct irq_domain_ops davinci_cp_intc_irq_domain_ops = { |
| 157 | .map = davinci_cp_intc_host_map, |
Heiko Schocher | 07caba9 | 2012-05-30 12:18:57 +0200 | [diff] [blame] | 158 | .xlate = irq_domain_xlate_onetwocell, |
| 159 | }; |
| 160 | |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 161 | static int __init davinci_cp_intc_of_init(struct device_node *node, |
| 162 | struct device_node *parent) |
Heiko Schocher | 07caba9 | 2012-05-30 12:18:57 +0200 | [diff] [blame] | 163 | { |
| 164 | u32 num_irq = davinci_soc_info.intc_irq_num; |
Cyril Chemparathy | bd80894 | 2010-05-07 17:06:37 -0400 | [diff] [blame] | 165 | u8 *irq_prio = davinci_soc_info.intc_irq_prios; |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 166 | unsigned num_reg = BITS_TO_LONGS(num_irq); |
Heiko Schocher | 07caba9 | 2012-05-30 12:18:57 +0200 | [diff] [blame] | 167 | int i, irq_base; |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 168 | |
Heiko Schocher | 961e657 | 2012-05-30 12:18:58 +0200 | [diff] [blame] | 169 | if (node) { |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 170 | davinci_cp_intc_base = of_iomap(node, 0); |
Heiko Schocher | 961e657 | 2012-05-30 12:18:58 +0200 | [diff] [blame] | 171 | if (of_property_read_u32(node, "ti,intc-size", &num_irq)) |
| 172 | pr_warn("unable to get intc-size, default to %d\n", |
| 173 | num_irq); |
| 174 | } else { |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 175 | davinci_cp_intc_base = ioremap(davinci_soc_info.intc_base, SZ_8K); |
Heiko Schocher | 961e657 | 2012-05-30 12:18:58 +0200 | [diff] [blame] | 176 | } |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 177 | if (WARN_ON(!davinci_cp_intc_base)) |
Heiko Schocher | 07caba9 | 2012-05-30 12:18:57 +0200 | [diff] [blame] | 178 | return -EINVAL; |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 179 | |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 180 | davinci_cp_intc_write(0, DAVINCI_CP_INTC_GLOBAL_ENABLE); |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 181 | |
| 182 | /* Disable all host interrupts */ |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 183 | davinci_cp_intc_write(0, DAVINCI_CP_INTC_HOST_ENABLE(0)); |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 184 | |
| 185 | /* Disable system interrupts */ |
| 186 | for (i = 0; i < num_reg; i++) |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 187 | davinci_cp_intc_write(~0, DAVINCI_CP_INTC_SYS_ENABLE_CLR(i)); |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 188 | |
| 189 | /* Set to normal mode, no nesting, no priority hold */ |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 190 | davinci_cp_intc_write(0, DAVINCI_CP_INTC_CTRL); |
| 191 | davinci_cp_intc_write(0, DAVINCI_CP_INTC_HOST_CTRL); |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 192 | |
| 193 | /* Clear system interrupt status */ |
| 194 | for (i = 0; i < num_reg; i++) |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 195 | davinci_cp_intc_write(~0, DAVINCI_CP_INTC_SYS_STAT_CLR(i)); |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 196 | |
| 197 | /* Enable nIRQ (what about nFIQ?) */ |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 198 | davinci_cp_intc_write(1, DAVINCI_CP_INTC_HOST_ENABLE_IDX_SET); |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 199 | |
| 200 | /* |
| 201 | * Priority is determined by host channel: lower channel number has |
| 202 | * higher priority i.e. channel 0 has highest priority and channel 31 |
| 203 | * had the lowest priority. |
| 204 | */ |
| 205 | num_reg = (num_irq + 3) >> 2; /* 4 channels per register */ |
| 206 | if (irq_prio) { |
| 207 | unsigned j, k; |
| 208 | u32 val; |
| 209 | |
| 210 | for (k = i = 0; i < num_reg; i++) { |
| 211 | for (val = j = 0; j < 4; j++, k++) { |
| 212 | val >>= 8; |
| 213 | if (k < num_irq) |
| 214 | val |= irq_prio[k] << 24; |
| 215 | } |
| 216 | |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 217 | davinci_cp_intc_write(val, DAVINCI_CP_INTC_CHAN_MAP(i)); |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 218 | } |
| 219 | } else { |
| 220 | /* |
| 221 | * Default everything to channel 15 if priority not specified. |
| 222 | * Note that channel 0-1 are mapped to nFIQ and channels 2-31 |
| 223 | * are mapped to nIRQ. |
| 224 | */ |
| 225 | for (i = 0; i < num_reg; i++) |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 226 | davinci_cp_intc_write(0x0f0f0f0f, |
| 227 | DAVINCI_CP_INTC_CHAN_MAP(i)); |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 228 | } |
| 229 | |
Heiko Schocher | 07caba9 | 2012-05-30 12:18:57 +0200 | [diff] [blame] | 230 | irq_base = irq_alloc_descs(-1, 0, num_irq, 0); |
| 231 | if (irq_base < 0) { |
| 232 | pr_warn("Couldn't allocate IRQ numbers\n"); |
| 233 | irq_base = 0; |
| 234 | } |
| 235 | |
| 236 | /* create a legacy host */ |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 237 | davinci_cp_intc_irq_domain = irq_domain_add_legacy( |
| 238 | node, num_irq, irq_base, 0, |
| 239 | &davinci_cp_intc_irq_domain_ops, NULL); |
Heiko Schocher | 07caba9 | 2012-05-30 12:18:57 +0200 | [diff] [blame] | 240 | |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 241 | if (!davinci_cp_intc_irq_domain) { |
Heiko Schocher | 07caba9 | 2012-05-30 12:18:57 +0200 | [diff] [blame] | 242 | pr_err("cp_intc: failed to allocate irq host!\n"); |
| 243 | return -EINVAL; |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 244 | } |
| 245 | |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 246 | set_handle_irq(davinci_cp_intc_handle_irq); |
Bartosz Golaszewski | d006459 | 2019-02-14 15:51:58 +0100 | [diff] [blame] | 247 | |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 248 | /* Enable global interrupt */ |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 249 | davinci_cp_intc_write(1, DAVINCI_CP_INTC_GLOBAL_ENABLE); |
Heiko Schocher | 07caba9 | 2012-05-30 12:18:57 +0200 | [diff] [blame] | 250 | |
| 251 | return 0; |
| 252 | } |
| 253 | |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 254 | void __init davinci_cp_intc_init(void) |
Heiko Schocher | 07caba9 | 2012-05-30 12:18:57 +0200 | [diff] [blame] | 255 | { |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 256 | davinci_cp_intc_of_init(NULL, NULL); |
Sergei Shtylyov | 0521444 | 2009-03-11 19:49:05 +0400 | [diff] [blame] | 257 | } |
David Lechner | 9a7f2fc | 2016-02-29 16:33:26 -0600 | [diff] [blame] | 258 | |
Bartosz Golaszewski | b35b55e | 2019-02-14 15:52:21 +0100 | [diff] [blame] | 259 | IRQCHIP_DECLARE(cp_intc, "ti,cp-intc", davinci_cp_intc_of_init); |