Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'armsoc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull ARM SoC late updates from Arnd Bergmann:
"Here are two branches that came relatively late during the linux-5.0
development cycle and have dependencies on the other branches:

- On the TI OMAP platform, the CPSW Ethernet PHY mode selection
driver is being replaced, this puts the final pieces in place

- On the DaVinci platform, the interrupt handling code in arch/arm
gets moved into a regular device driver in drivers/irqchip.

Since they both had some time in linux-next after the 5.0-rc8 release,
I'm sending them along with the other updates"

* tag 'armsoc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (38 commits)
net: ethernet: ti: cpsw: deprecate cpsw-phy-sel driver
ARM: davinci: remove intc related fields from davinci_soc_info
irqchip: davinci-cp-intc: move the driver to drivers/irqchip
ARM: davinci: cp-intc: remove redundant comments
ARM: davinci: cp-intc: drop GPL license boilerplate
ARM: davinci: cp-intc: use readl/writel_relaxed()
ARM: davinci: cp-intc: unify error handling
ARM: davinci: cp-intc: improve coding style
ARM: davinci: cp-intc: request the memory region before remapping it
ARM: davinci: cp-intc: use the new-style config structure
ARM: davinci: cp-intc: convert all hex numbers to lowercase
ARM: davinci: cp-intc: use a common prefix for all symbols
ARM: davinci: cp-intc: add the new config structures for da8xx SoCs
irqchip: davinci-cp-intc: add a new config structure
ARM: davinci: cp-intc: add a wrapper around cp_intc_init()
ARM: davinci: cp-intc: remove cp_intc.h
irqchip: davinci-aintc: move the driver to drivers/irqchip
ARM: davinci: aintc: remove unnecessary includes
ARM: davinci: aintc: remove the timer-specific irq_set_handler()
ARM: davinci: aintc: request memory region before remapping it
...

+889 -964
+2
arch/arm/Kconfig
··· 590 590 select GENERIC_ALLOCATOR 591 591 select GENERIC_CLOCKEVENTS 592 592 select GENERIC_IRQ_CHIP 593 + select GENERIC_IRQ_MULTI_HANDLER 593 594 select GPIOLIB 594 595 select HAVE_IDE 595 596 select PM_GENERIC_DOMAINS if PM 596 597 select PM_GENERIC_DOMAINS_OF if PM && OF 597 598 select RESET_CONTROLLER 599 + select SPARSE_IRQ 598 600 select USE_OF 599 601 select ZONE_DMA 600 602 help
+6 -13
arch/arm/mach-davinci/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 if ARCH_DAVINCI 3 3 4 - config AINTC 5 - bool 6 - 7 - config CP_INTC 8 - bool 9 - select IRQ_DOMAIN 10 - 11 4 config ARCH_DAVINCI_DMx 12 5 bool 13 6 ··· 10 17 11 18 config ARCH_DAVINCI_DM644x 12 19 bool "DaVinci 644x based system" 13 - select AINTC 20 + select DAVINCI_AINTC 14 21 select ARCH_DAVINCI_DMx 15 22 16 23 config ARCH_DAVINCI_DM355 17 24 bool "DaVinci 355 based system" 18 - select AINTC 25 + select DAVINCI_AINTC 19 26 select ARCH_DAVINCI_DMx 20 27 21 28 config ARCH_DAVINCI_DM646x 22 29 bool "DaVinci 646x based system" 23 - select AINTC 30 + select DAVINCI_AINTC 24 31 select ARCH_DAVINCI_DMx 25 32 26 33 config ARCH_DAVINCI_DA830 ··· 29 36 select ARCH_DAVINCI_DA8XX 30 37 # needed on silicon revs 1.0, 1.1: 31 38 select CPU_DCACHE_WRITETHROUGH if !CPU_DCACHE_DISABLE 32 - select CP_INTC 39 + select DAVINCI_CP_INTC 33 40 34 41 config ARCH_DAVINCI_DA850 35 42 bool "DA850/OMAP-L138/AM18x based system" 36 43 depends on !ARCH_DAVINCI_DMx || (AUTO_ZRELADDR && ARM_PATCH_PHYS_VIRT) 37 44 select ARCH_DAVINCI_DA8XX 38 - select CP_INTC 45 + select DAVINCI_CP_INTC 39 46 40 47 config ARCH_DAVINCI_DA8XX 41 48 bool 42 49 43 50 config ARCH_DAVINCI_DM365 44 51 bool "DaVinci 365 based system" 45 - select AINTC 52 + select DAVINCI_AINTC 46 53 select ARCH_DAVINCI_DMx 47 54 48 55 comment "DaVinci Board Type"
-3
arch/arm/mach-davinci/Makefile
··· 18 18 obj-$(CONFIG_ARCH_DAVINCI_DA830) += da830.o devices-da8xx.o usb-da8xx.o 19 19 obj-$(CONFIG_ARCH_DAVINCI_DA850) += da850.o devices-da8xx.o usb-da8xx.o 20 20 21 - obj-$(CONFIG_AINTC) += irq.o 22 - obj-$(CONFIG_CP_INTC) += cp_intc.o 23 - 24 21 # Board specific 25 22 obj-$(CONFIG_MACH_DA8XX_DT) += da8xx-dt.o pdata-quirks.o 26 23 obj-$(CONFIG_MACH_DAVINCI_EVM) += board-dm644x-evm.o
+4 -4
arch/arm/mach-davinci/asp.h
··· 49 49 #define DAVINCI_DA830_DMA_MCASP2_AXEVT 5 50 50 51 51 /* Interrupts */ 52 - #define DAVINCI_ASP0_RX_INT IRQ_MBRINT 53 - #define DAVINCI_ASP0_TX_INT IRQ_MBXINT 54 - #define DAVINCI_ASP1_RX_INT IRQ_MBRINT 55 - #define DAVINCI_ASP1_TX_INT IRQ_MBXINT 52 + #define DAVINCI_ASP0_RX_INT DAVINCI_INTC_IRQ(IRQ_MBRINT) 53 + #define DAVINCI_ASP0_TX_INT DAVINCI_INTC_IRQ(IRQ_MBXINT) 54 + #define DAVINCI_ASP1_RX_INT DAVINCI_INTC_IRQ(IRQ_MBRINT) 55 + #define DAVINCI_ASP1_TX_INT DAVINCI_INTC_IRQ(IRQ_MBXINT) 56 56 57 57 #endif /* __ASM_ARCH_DAVINCI_ASP_H */
+3 -2
arch/arm/mach-davinci/board-da830-evm.c
··· 36 36 #include <asm/mach/arch.h> 37 37 38 38 #include <mach/common.h> 39 - #include "cp_intc.h" 40 39 #include <mach/mux.h> 41 40 #include <mach/da8xx.h> 41 + 42 + #include "irqs.h" 42 43 43 44 #define DA830_EVM_PHY_ID "" 44 45 /* ··· 634 633 MACHINE_START(DAVINCI_DA830_EVM, "DaVinci DA830/OMAP-L137/AM17x EVM") 635 634 .atag_offset = 0x100, 636 635 .map_io = da830_evm_map_io, 637 - .init_irq = cp_intc_init, 636 + .init_irq = da830_init_irq, 638 637 .init_time = da830_init_time, 639 638 .init_machine = da830_evm_init, 640 639 .init_late = davinci_init_late,
+3 -2
arch/arm/mach-davinci/board-da850-evm.c
··· 43 43 #include <linux/spi/flash.h> 44 44 45 45 #include <mach/common.h> 46 - #include "cp_intc.h" 47 46 #include <mach/da8xx.h> 48 47 #include <mach/mux.h> 48 + 49 + #include "irqs.h" 49 50 #include "sram.h" 50 51 51 52 #include <asm/mach-types.h> ··· 1500 1499 MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138/AM18x EVM") 1501 1500 .atag_offset = 0x100, 1502 1501 .map_io = da850_evm_map_io, 1503 - .init_irq = cp_intc_init, 1502 + .init_irq = da850_init_irq, 1504 1503 .init_time = da850_init_time, 1505 1504 .init_machine = da850_evm_init, 1506 1505 .init_late = davinci_init_late,
+1 -1
arch/arm/mach-davinci/board-dm355-evm.c
··· 438 438 MACHINE_START(DAVINCI_DM355_EVM, "DaVinci DM355 EVM") 439 439 .atag_offset = 0x100, 440 440 .map_io = dm355_evm_map_io, 441 - .init_irq = davinci_irq_init, 441 + .init_irq = dm355_init_irq, 442 442 .init_time = dm355_init_time, 443 443 .init_machine = dm355_evm_init, 444 444 .init_late = davinci_init_late,
+1 -1
arch/arm/mach-davinci/board-dm355-leopard.c
··· 273 273 MACHINE_START(DM355_LEOPARD, "DaVinci DM355 leopard") 274 274 .atag_offset = 0x100, 275 275 .map_io = dm355_leopard_map_io, 276 - .init_irq = davinci_irq_init, 276 + .init_irq = dm355_init_irq, 277 277 .init_time = dm355_init_time, 278 278 .init_machine = dm355_leopard_init, 279 279 .init_late = davinci_init_late,
+1 -1
arch/arm/mach-davinci/board-dm365-evm.c
··· 831 831 MACHINE_START(DAVINCI_DM365_EVM, "DaVinci DM365 EVM") 832 832 .atag_offset = 0x100, 833 833 .map_io = dm365_evm_map_io, 834 - .init_irq = davinci_irq_init, 834 + .init_irq = dm365_init_irq, 835 835 .init_time = dm365_init_time, 836 836 .init_machine = dm365_evm_init, 837 837 .init_late = davinci_init_late,
+5 -3
arch/arm/mach-davinci/board-dm644x-evm.c
··· 36 36 #include <asm/mach/arch.h> 37 37 38 38 #include <mach/common.h> 39 - #include <linux/platform_data/i2c-davinci.h> 40 - #include <mach/serial.h> 41 39 #include <mach/mux.h> 40 + #include <mach/serial.h> 41 + 42 + #include <linux/platform_data/i2c-davinci.h> 42 43 #include <linux/platform_data/mtd-davinci.h> 43 44 #include <linux/platform_data/mmc-davinci.h> 44 45 #include <linux/platform_data/usb-davinci.h> ··· 47 46 #include <linux/platform_data/ti-aemif.h> 48 47 49 48 #include "davinci.h" 49 + #include "irqs.h" 50 50 51 51 #define DM644X_EVM_PHY_ID "davinci_mdio-0:01" 52 52 #define LXT971_PHY_ID (0x001378e2) ··· 888 886 /* Maintainer: MontaVista Software <source@mvista.com> */ 889 887 .atag_offset = 0x100, 890 888 .map_io = davinci_evm_map_io, 891 - .init_irq = davinci_irq_init, 889 + .init_irq = dm644x_init_irq, 892 890 .init_time = dm644x_init_time, 893 891 .init_machine = davinci_evm_init, 894 892 .init_late = davinci_init_late,
+3 -3
arch/arm/mach-davinci/board-dm646x-evm.c
··· 44 44 #include <asm/mach/arch.h> 45 45 46 46 #include <mach/common.h> 47 - #include <mach/irqs.h> 48 47 #include <mach/serial.h> 49 48 50 49 #include "davinci.h" 50 + #include "irqs.h" 51 51 52 52 #define NAND_BLOCK_SIZE SZ_128K 53 53 ··· 860 860 MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM") 861 861 .atag_offset = 0x100, 862 862 .map_io = davinci_map_io, 863 - .init_irq = davinci_irq_init, 863 + .init_irq = dm646x_init_irq, 864 864 .init_time = dm646x_evm_init_time, 865 865 .init_machine = evm_init, 866 866 .init_late = davinci_init_late, ··· 870 870 MACHINE_START(DAVINCI_DM6467TEVM, "DaVinci DM6467T EVM") 871 871 .atag_offset = 0x100, 872 872 .map_io = davinci_map_io, 873 - .init_irq = davinci_irq_init, 873 + .init_irq = dm646x_init_irq, 874 874 .init_time = dm6467t_evm_init_time, 875 875 .init_machine = evm_init, 876 876 .init_late = davinci_init_late,
+1 -2
arch/arm/mach-davinci/board-mityomapl138.c
··· 29 29 #include <asm/mach-types.h> 30 30 #include <asm/mach/arch.h> 31 31 #include <mach/common.h> 32 - #include "cp_intc.h" 33 32 #include <mach/da8xx.h> 34 33 #include <linux/platform_data/mtd-davinci.h> 35 34 #include <linux/platform_data/mtd-davinci-aemif.h> ··· 627 628 MACHINE_START(MITYOMAPL138, "MityDSP-L138/MityARM-1808") 628 629 .atag_offset = 0x100, 629 630 .map_io = mityomapl138_map_io, 630 - .init_irq = cp_intc_init, 631 + .init_irq = da850_init_irq, 631 632 .init_time = da850_init_time, 632 633 .init_machine = mityomapl138_init, 633 634 .init_late = davinci_init_late,
+1 -1
arch/arm/mach-davinci/board-neuros-osd2.c
··· 231 231 /* Maintainer: Neuros Technologies <neuros@groups.google.com> */ 232 232 .atag_offset = 0x100, 233 233 .map_io = davinci_ntosd2_map_io, 234 - .init_irq = davinci_irq_init, 234 + .init_irq = dm644x_init_irq, 235 235 .init_time = dm644x_init_time, 236 236 .init_machine = davinci_ntosd2_init, 237 237 .init_late = davinci_init_late,
+1 -2
arch/arm/mach-davinci/board-omapl138-hawk.c
··· 27 27 #include <asm/mach/arch.h> 28 28 29 29 #include <mach/common.h> 30 - #include "cp_intc.h" 31 30 #include <mach/da8xx.h> 32 31 #include <mach/mux.h> 33 32 ··· 398 399 MACHINE_START(OMAPL138_HAWKBOARD, "AM18x/OMAP-L138 Hawkboard") 399 400 .atag_offset = 0x100, 400 401 .map_io = omapl138_hawk_map_io, 401 - .init_irq = cp_intc_init, 402 + .init_irq = da850_init_irq, 402 403 .init_time = da850_init_time, 403 404 .init_machine = omapl138_hawk_init, 404 405 .init_late = davinci_init_late,
+1 -1
arch/arm/mach-davinci/board-sffsdr.c
··· 152 152 MACHINE_START(SFFSDR, "Lyrtech SFFSDR") 153 153 .atag_offset = 0x100, 154 154 .map_io = davinci_sffsdr_map_io, 155 - .init_irq = davinci_irq_init, 155 + .init_irq = dm644x_init_irq, 156 156 .init_time = dm644x_init_time, 157 157 .init_machine = davinci_sffsdr_init, 158 158 .init_late = davinci_init_late,
-3
arch/arm/mach-davinci/common.c
··· 23 23 struct davinci_soc_info davinci_soc_info; 24 24 EXPORT_SYMBOL(davinci_soc_info); 25 25 26 - void __iomem *davinci_intc_base; 27 - int davinci_intc_type; 28 - 29 26 static int __init davinci_init_id(struct davinci_soc_info *soc_info) 30 27 { 31 28 int i;
-215
arch/arm/mach-davinci/cp_intc.c
··· 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 - 12 - #include <linux/export.h> 13 - #include <linux/init.h> 14 - #include <linux/irq.h> 15 - #include <linux/irqchip.h> 16 - #include <linux/irqdomain.h> 17 - #include <linux/io.h> 18 - #include <linux/of.h> 19 - #include <linux/of_address.h> 20 - #include <linux/of_irq.h> 21 - 22 - #include <mach/common.h> 23 - #include "cp_intc.h" 24 - 25 - static inline unsigned int cp_intc_read(unsigned offset) 26 - { 27 - return __raw_readl(davinci_intc_base + offset); 28 - } 29 - 30 - static inline void cp_intc_write(unsigned long value, unsigned offset) 31 - { 32 - __raw_writel(value, davinci_intc_base + offset); 33 - } 34 - 35 - static void cp_intc_ack_irq(struct irq_data *d) 36 - { 37 - cp_intc_write(d->hwirq, CP_INTC_SYS_STAT_IDX_CLR); 38 - } 39 - 40 - /* Disable interrupt */ 41 - static void cp_intc_mask_irq(struct irq_data *d) 42 - { 43 - /* XXX don't know why we need to disable nIRQ here... */ 44 - cp_intc_write(1, CP_INTC_HOST_ENABLE_IDX_CLR); 45 - cp_intc_write(d->hwirq, CP_INTC_SYS_ENABLE_IDX_CLR); 46 - cp_intc_write(1, CP_INTC_HOST_ENABLE_IDX_SET); 47 - } 48 - 49 - /* Enable interrupt */ 50 - static void cp_intc_unmask_irq(struct irq_data *d) 51 - { 52 - cp_intc_write(d->hwirq, CP_INTC_SYS_ENABLE_IDX_SET); 53 - } 54 - 55 - static int cp_intc_set_irq_type(struct irq_data *d, unsigned int flow_type) 56 - { 57 - unsigned reg = BIT_WORD(d->hwirq); 58 - unsigned mask = BIT_MASK(d->hwirq); 59 - unsigned polarity = cp_intc_read(CP_INTC_SYS_POLARITY(reg)); 60 - unsigned type = cp_intc_read(CP_INTC_SYS_TYPE(reg)); 61 - 62 - switch (flow_type) { 63 - case IRQ_TYPE_EDGE_RISING: 64 - polarity |= mask; 65 - type |= mask; 66 - break; 67 - case IRQ_TYPE_EDGE_FALLING: 68 - polarity &= ~mask; 69 - type |= mask; 70 - break; 71 - case IRQ_TYPE_LEVEL_HIGH: 72 - polarity |= mask; 73 - type &= ~mask; 74 - break; 75 - case IRQ_TYPE_LEVEL_LOW: 76 - polarity &= ~mask; 77 - type &= ~mask; 78 - break; 79 - default: 80 - return -EINVAL; 81 - } 82 - 83 - cp_intc_write(polarity, CP_INTC_SYS_POLARITY(reg)); 84 - cp_intc_write(type, CP_INTC_SYS_TYPE(reg)); 85 - 86 - return 0; 87 - } 88 - 89 - static struct irq_chip cp_intc_irq_chip = { 90 - .name = "cp_intc", 91 - .irq_ack = cp_intc_ack_irq, 92 - .irq_mask = cp_intc_mask_irq, 93 - .irq_unmask = cp_intc_unmask_irq, 94 - .irq_set_type = cp_intc_set_irq_type, 95 - .flags = IRQCHIP_SKIP_SET_WAKE, 96 - }; 97 - 98 - static struct irq_domain *cp_intc_domain; 99 - 100 - static int cp_intc_host_map(struct irq_domain *h, unsigned int virq, 101 - irq_hw_number_t hw) 102 - { 103 - pr_debug("cp_intc_host_map(%d, 0x%lx)\n", virq, hw); 104 - 105 - irq_set_chip(virq, &cp_intc_irq_chip); 106 - irq_set_probe(virq); 107 - irq_set_handler(virq, handle_edge_irq); 108 - return 0; 109 - } 110 - 111 - static const struct irq_domain_ops cp_intc_host_ops = { 112 - .map = cp_intc_host_map, 113 - .xlate = irq_domain_xlate_onetwocell, 114 - }; 115 - 116 - int __init cp_intc_of_init(struct device_node *node, struct device_node *parent) 117 - { 118 - u32 num_irq = davinci_soc_info.intc_irq_num; 119 - u8 *irq_prio = davinci_soc_info.intc_irq_prios; 120 - u32 *host_map = davinci_soc_info.intc_host_map; 121 - unsigned num_reg = BITS_TO_LONGS(num_irq); 122 - int i, irq_base; 123 - 124 - davinci_intc_type = DAVINCI_INTC_TYPE_CP_INTC; 125 - if (node) { 126 - davinci_intc_base = of_iomap(node, 0); 127 - if (of_property_read_u32(node, "ti,intc-size", &num_irq)) 128 - pr_warn("unable to get intc-size, default to %d\n", 129 - num_irq); 130 - } else { 131 - davinci_intc_base = ioremap(davinci_soc_info.intc_base, SZ_8K); 132 - } 133 - if (WARN_ON(!davinci_intc_base)) 134 - return -EINVAL; 135 - 136 - cp_intc_write(0, CP_INTC_GLOBAL_ENABLE); 137 - 138 - /* Disable all host interrupts */ 139 - cp_intc_write(0, CP_INTC_HOST_ENABLE(0)); 140 - 141 - /* Disable system interrupts */ 142 - for (i = 0; i < num_reg; i++) 143 - cp_intc_write(~0, CP_INTC_SYS_ENABLE_CLR(i)); 144 - 145 - /* Set to normal mode, no nesting, no priority hold */ 146 - cp_intc_write(0, CP_INTC_CTRL); 147 - cp_intc_write(0, CP_INTC_HOST_CTRL); 148 - 149 - /* Clear system interrupt status */ 150 - for (i = 0; i < num_reg; i++) 151 - cp_intc_write(~0, CP_INTC_SYS_STAT_CLR(i)); 152 - 153 - /* Enable nIRQ (what about nFIQ?) */ 154 - cp_intc_write(1, CP_INTC_HOST_ENABLE_IDX_SET); 155 - 156 - /* 157 - * Priority is determined by host channel: lower channel number has 158 - * higher priority i.e. channel 0 has highest priority and channel 31 159 - * had the lowest priority. 160 - */ 161 - num_reg = (num_irq + 3) >> 2; /* 4 channels per register */ 162 - if (irq_prio) { 163 - unsigned j, k; 164 - u32 val; 165 - 166 - for (k = i = 0; i < num_reg; i++) { 167 - for (val = j = 0; j < 4; j++, k++) { 168 - val >>= 8; 169 - if (k < num_irq) 170 - val |= irq_prio[k] << 24; 171 - } 172 - 173 - cp_intc_write(val, CP_INTC_CHAN_MAP(i)); 174 - } 175 - } else { 176 - /* 177 - * Default everything to channel 15 if priority not specified. 178 - * Note that channel 0-1 are mapped to nFIQ and channels 2-31 179 - * are mapped to nIRQ. 180 - */ 181 - for (i = 0; i < num_reg; i++) 182 - cp_intc_write(0x0f0f0f0f, CP_INTC_CHAN_MAP(i)); 183 - } 184 - 185 - if (host_map) 186 - for (i = 0; host_map[i] != -1; i++) 187 - cp_intc_write(host_map[i], CP_INTC_HOST_MAP(i)); 188 - 189 - irq_base = irq_alloc_descs(-1, 0, num_irq, 0); 190 - if (irq_base < 0) { 191 - pr_warn("Couldn't allocate IRQ numbers\n"); 192 - irq_base = 0; 193 - } 194 - 195 - /* create a legacy host */ 196 - cp_intc_domain = irq_domain_add_legacy(node, num_irq, 197 - irq_base, 0, &cp_intc_host_ops, NULL); 198 - 199 - if (!cp_intc_domain) { 200 - pr_err("cp_intc: failed to allocate irq host!\n"); 201 - return -EINVAL; 202 - } 203 - 204 - /* Enable global interrupt */ 205 - cp_intc_write(1, CP_INTC_GLOBAL_ENABLE); 206 - 207 - return 0; 208 - } 209 - 210 - void __init cp_intc_init(void) 211 - { 212 - cp_intc_of_init(NULL, NULL); 213 - } 214 - 215 - IRQCHIP_DECLARE(cp_intc, "ti,cp-intc", cp_intc_of_init);
-57
arch/arm/mach-davinci/cp_intc.h
··· 1 - /* 2 - * TI Common Platform Interrupt Controller (cp_intc) definitions 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 - #ifndef __ASM_HARDWARE_CP_INTC_H 12 - #define __ASM_HARDWARE_CP_INTC_H 13 - 14 - #define CP_INTC_REV 0x00 15 - #define CP_INTC_CTRL 0x04 16 - #define CP_INTC_HOST_CTRL 0x0C 17 - #define CP_INTC_GLOBAL_ENABLE 0x10 18 - #define CP_INTC_GLOBAL_NESTING_LEVEL 0x1C 19 - #define CP_INTC_SYS_STAT_IDX_SET 0x20 20 - #define CP_INTC_SYS_STAT_IDX_CLR 0x24 21 - #define CP_INTC_SYS_ENABLE_IDX_SET 0x28 22 - #define CP_INTC_SYS_ENABLE_IDX_CLR 0x2C 23 - #define CP_INTC_GLOBAL_WAKEUP_ENABLE 0x30 24 - #define CP_INTC_HOST_ENABLE_IDX_SET 0x34 25 - #define CP_INTC_HOST_ENABLE_IDX_CLR 0x38 26 - #define CP_INTC_PACING_PRESCALE 0x40 27 - #define CP_INTC_VECTOR_BASE 0x50 28 - #define CP_INTC_VECTOR_SIZE 0x54 29 - #define CP_INTC_VECTOR_NULL 0x58 30 - #define CP_INTC_PRIO_IDX 0x80 31 - #define CP_INTC_PRIO_VECTOR 0x84 32 - #define CP_INTC_SECURE_ENABLE 0x90 33 - #define CP_INTC_SECURE_PRIO_IDX 0x94 34 - #define CP_INTC_PACING_PARAM(n) (0x0100 + (n << 4)) 35 - #define CP_INTC_PACING_DEC(n) (0x0104 + (n << 4)) 36 - #define CP_INTC_PACING_MAP(n) (0x0108 + (n << 4)) 37 - #define CP_INTC_SYS_RAW_STAT(n) (0x0200 + (n << 2)) 38 - #define CP_INTC_SYS_STAT_CLR(n) (0x0280 + (n << 2)) 39 - #define CP_INTC_SYS_ENABLE_SET(n) (0x0300 + (n << 2)) 40 - #define CP_INTC_SYS_ENABLE_CLR(n) (0x0380 + (n << 2)) 41 - #define CP_INTC_CHAN_MAP(n) (0x0400 + (n << 2)) 42 - #define CP_INTC_HOST_MAP(n) (0x0800 + (n << 2)) 43 - #define CP_INTC_HOST_PRIO_IDX(n) (0x0900 + (n << 2)) 44 - #define CP_INTC_SYS_POLARITY(n) (0x0D00 + (n << 2)) 45 - #define CP_INTC_SYS_TYPE(n) (0x0D80 + (n << 2)) 46 - #define CP_INTC_WAKEUP_ENABLE(n) (0x0E00 + (n << 2)) 47 - #define CP_INTC_DEBUG_SELECT(n) (0x0F00 + (n << 2)) 48 - #define CP_INTC_SYS_SECURE_ENABLE(n) (0x1000 + (n << 2)) 49 - #define CP_INTC_HOST_NESTING_LEVEL(n) (0x1100 + (n << 2)) 50 - #define CP_INTC_HOST_ENABLE(n) (0x1500 + (n << 2)) 51 - #define CP_INTC_HOST_PRIO_VECTOR(n) (0x1600 + (n << 2)) 52 - #define CP_INTC_VECTOR_ADDR(n) (0x2000 + (n << 2)) 53 - 54 - void cp_intc_init(void); 55 - int cp_intc_of_init(struct device_node *, struct device_node *); 56 - 57 - #endif /* __ASM_HARDWARE_CP_INTC_H */
+22 -106
arch/arm/mach-davinci/da830.c
··· 12 12 #include <linux/clk/davinci.h> 13 13 #include <linux/gpio.h> 14 14 #include <linux/init.h> 15 + #include <linux/irqchip/irq-davinci-cp-intc.h> 15 16 #include <linux/platform_data/gpio-davinci.h> 16 17 17 18 #include <asm/mach/map.h> ··· 20 19 #include <mach/common.h> 21 20 #include <mach/cputype.h> 22 21 #include <mach/da8xx.h> 23 - #include <mach/irqs.h> 24 22 #include <mach/time.h> 25 23 24 + #include "irqs.h" 26 25 #include "mux.h" 27 26 28 27 /* Offsets of the 8 compare registers on the da830 */ ··· 624 623 -1 625 624 }; 626 625 627 - /* FIQ are pri 0-1; otherwise 2-7, with 7 lowest priority */ 628 - static u8 da830_default_priorities[DA830_N_CP_INTC_IRQ] = { 629 - [IRQ_DA8XX_COMMTX] = 7, 630 - [IRQ_DA8XX_COMMRX] = 7, 631 - [IRQ_DA8XX_NINT] = 7, 632 - [IRQ_DA8XX_EVTOUT0] = 7, 633 - [IRQ_DA8XX_EVTOUT1] = 7, 634 - [IRQ_DA8XX_EVTOUT2] = 7, 635 - [IRQ_DA8XX_EVTOUT3] = 7, 636 - [IRQ_DA8XX_EVTOUT4] = 7, 637 - [IRQ_DA8XX_EVTOUT5] = 7, 638 - [IRQ_DA8XX_EVTOUT6] = 7, 639 - [IRQ_DA8XX_EVTOUT7] = 7, 640 - [IRQ_DA8XX_CCINT0] = 7, 641 - [IRQ_DA8XX_CCERRINT] = 7, 642 - [IRQ_DA8XX_TCERRINT0] = 7, 643 - [IRQ_DA8XX_AEMIFINT] = 7, 644 - [IRQ_DA8XX_I2CINT0] = 7, 645 - [IRQ_DA8XX_MMCSDINT0] = 7, 646 - [IRQ_DA8XX_MMCSDINT1] = 7, 647 - [IRQ_DA8XX_ALLINT0] = 7, 648 - [IRQ_DA8XX_RTC] = 7, 649 - [IRQ_DA8XX_SPINT0] = 7, 650 - [IRQ_DA8XX_TINT12_0] = 7, 651 - [IRQ_DA8XX_TINT34_0] = 7, 652 - [IRQ_DA8XX_TINT12_1] = 7, 653 - [IRQ_DA8XX_TINT34_1] = 7, 654 - [IRQ_DA8XX_UARTINT0] = 7, 655 - [IRQ_DA8XX_KEYMGRINT] = 7, 656 - [IRQ_DA830_MPUERR] = 7, 657 - [IRQ_DA8XX_CHIPINT0] = 7, 658 - [IRQ_DA8XX_CHIPINT1] = 7, 659 - [IRQ_DA8XX_CHIPINT2] = 7, 660 - [IRQ_DA8XX_CHIPINT3] = 7, 661 - [IRQ_DA8XX_TCERRINT1] = 7, 662 - [IRQ_DA8XX_C0_RX_THRESH_PULSE] = 7, 663 - [IRQ_DA8XX_C0_RX_PULSE] = 7, 664 - [IRQ_DA8XX_C0_TX_PULSE] = 7, 665 - [IRQ_DA8XX_C0_MISC_PULSE] = 7, 666 - [IRQ_DA8XX_C1_RX_THRESH_PULSE] = 7, 667 - [IRQ_DA8XX_C1_RX_PULSE] = 7, 668 - [IRQ_DA8XX_C1_TX_PULSE] = 7, 669 - [IRQ_DA8XX_C1_MISC_PULSE] = 7, 670 - [IRQ_DA8XX_MEMERR] = 7, 671 - [IRQ_DA8XX_GPIO0] = 7, 672 - [IRQ_DA8XX_GPIO1] = 7, 673 - [IRQ_DA8XX_GPIO2] = 7, 674 - [IRQ_DA8XX_GPIO3] = 7, 675 - [IRQ_DA8XX_GPIO4] = 7, 676 - [IRQ_DA8XX_GPIO5] = 7, 677 - [IRQ_DA8XX_GPIO6] = 7, 678 - [IRQ_DA8XX_GPIO7] = 7, 679 - [IRQ_DA8XX_GPIO8] = 7, 680 - [IRQ_DA8XX_I2CINT1] = 7, 681 - [IRQ_DA8XX_LCDINT] = 7, 682 - [IRQ_DA8XX_UARTINT1] = 7, 683 - [IRQ_DA8XX_MCASPINT] = 7, 684 - [IRQ_DA8XX_ALLINT1] = 7, 685 - [IRQ_DA8XX_SPINT1] = 7, 686 - [IRQ_DA8XX_UHPI_INT1] = 7, 687 - [IRQ_DA8XX_USB_INT] = 7, 688 - [IRQ_DA8XX_IRQN] = 7, 689 - [IRQ_DA8XX_RWAKEUP] = 7, 690 - [IRQ_DA8XX_UARTINT2] = 7, 691 - [IRQ_DA8XX_DFTSSINT] = 7, 692 - [IRQ_DA8XX_EHRPWM0] = 7, 693 - [IRQ_DA8XX_EHRPWM0TZ] = 7, 694 - [IRQ_DA8XX_EHRPWM1] = 7, 695 - [IRQ_DA8XX_EHRPWM1TZ] = 7, 696 - [IRQ_DA830_EHRPWM2] = 7, 697 - [IRQ_DA830_EHRPWM2TZ] = 7, 698 - [IRQ_DA8XX_ECAP0] = 7, 699 - [IRQ_DA8XX_ECAP1] = 7, 700 - [IRQ_DA8XX_ECAP2] = 7, 701 - [IRQ_DA830_EQEP0] = 7, 702 - [IRQ_DA830_EQEP1] = 7, 703 - [IRQ_DA830_T12CMPINT0_0] = 7, 704 - [IRQ_DA830_T12CMPINT1_0] = 7, 705 - [IRQ_DA830_T12CMPINT2_0] = 7, 706 - [IRQ_DA830_T12CMPINT3_0] = 7, 707 - [IRQ_DA830_T12CMPINT4_0] = 7, 708 - [IRQ_DA830_T12CMPINT5_0] = 7, 709 - [IRQ_DA830_T12CMPINT6_0] = 7, 710 - [IRQ_DA830_T12CMPINT7_0] = 7, 711 - [IRQ_DA830_T12CMPINT0_1] = 7, 712 - [IRQ_DA830_T12CMPINT1_1] = 7, 713 - [IRQ_DA830_T12CMPINT2_1] = 7, 714 - [IRQ_DA830_T12CMPINT3_1] = 7, 715 - [IRQ_DA830_T12CMPINT4_1] = 7, 716 - [IRQ_DA830_T12CMPINT5_1] = 7, 717 - [IRQ_DA830_T12CMPINT6_1] = 7, 718 - [IRQ_DA830_T12CMPINT7_1] = 7, 719 - [IRQ_DA8XX_ARMCLKSTOPREQ] = 7, 720 - }; 721 - 722 626 static struct map_desc da830_io_desc[] = { 723 627 { 724 628 .virtual = IO_VIRT, ··· 678 772 static struct davinci_timer_instance da830_timer_instance[2] = { 679 773 { 680 774 .base = DA8XX_TIMER64P0_BASE, 681 - .bottom_irq = IRQ_DA8XX_TINT12_0, 682 - .top_irq = IRQ_DA8XX_TINT34_0, 775 + .bottom_irq = DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT12_0), 776 + .top_irq = DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT34_0), 683 777 .cmp_off = DA830_CMP12_0, 684 - .cmp_irq = IRQ_DA830_T12CMPINT0_0, 778 + .cmp_irq = DAVINCI_INTC_IRQ(IRQ_DA830_T12CMPINT0_0), 685 779 }, 686 780 { 687 781 .base = DA8XX_TIMER64P1_BASE, 688 - .bottom_irq = IRQ_DA8XX_TINT12_1, 689 - .top_irq = IRQ_DA8XX_TINT34_1, 782 + .bottom_irq = DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT12_1), 783 + .top_irq = DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT34_1), 690 784 .cmp_off = DA830_CMP12_0, 691 - .cmp_irq = IRQ_DA830_T12CMPINT0_1, 785 + .cmp_irq = DAVINCI_INTC_IRQ(IRQ_DA830_T12CMPINT0_1), 692 786 }, 693 787 }; 694 788 ··· 712 806 .pinmux_base = DA8XX_SYSCFG0_BASE + 0x120, 713 807 .pinmux_pins = da830_pins, 714 808 .pinmux_pins_num = ARRAY_SIZE(da830_pins), 715 - .intc_base = DA8XX_CP_INTC_BASE, 716 - .intc_type = DAVINCI_INTC_TYPE_CP_INTC, 717 - .intc_irq_prios = da830_default_priorities, 718 - .intc_irq_num = DA830_N_CP_INTC_IRQ, 719 809 .timer_info = &da830_timer_info, 720 810 .emac_pdata = &da8xx_emac_pdata, 721 811 }; ··· 722 820 723 821 da8xx_syscfg0_base = ioremap(DA8XX_SYSCFG0_BASE, SZ_4K); 724 822 WARN(!da8xx_syscfg0_base, "Unable to map syscfg0 module"); 823 + } 824 + 825 + static const struct davinci_cp_intc_config da830_cp_intc_config = { 826 + .reg = { 827 + .start = DA8XX_CP_INTC_BASE, 828 + .end = DA8XX_CP_INTC_BASE + SZ_8K - 1, 829 + .flags = IORESOURCE_MEM, 830 + }, 831 + .num_irqs = DA830_N_CP_INTC_IRQ, 832 + }; 833 + 834 + void __init da830_init_irq(void) 835 + { 836 + davinci_cp_intc_init(&da830_cp_intc_config); 725 837 } 726 838 727 839 void __init da830_init_time(void)
+30 -124
arch/arm/mach-davinci/da850.c
··· 18 18 #include <linux/cpufreq.h> 19 19 #include <linux/gpio.h> 20 20 #include <linux/init.h> 21 + #include <linux/irqchip/irq-davinci-cp-intc.h> 21 22 #include <linux/mfd/da8xx-cfgchip.h> 22 23 #include <linux/platform_data/clk-da8xx-cfgchip.h> 23 24 #include <linux/platform_data/clk-davinci-pll.h> ··· 33 32 #include <mach/cpufreq.h> 34 33 #include <mach/cputype.h> 35 34 #include <mach/da8xx.h> 36 - #include <mach/irqs.h> 37 35 #include <mach/pm.h> 38 36 #include <mach/time.h> 39 37 38 + #include "irqs.h" 40 39 #include "mux.h" 41 40 42 41 #define DA850_PLL1_BASE 0x01e1a000 ··· 299 298 -1 300 299 }; 301 300 302 - /* FIQ are pri 0-1; otherwise 2-7, with 7 lowest priority */ 303 - static u8 da850_default_priorities[DA850_N_CP_INTC_IRQ] = { 304 - [IRQ_DA8XX_COMMTX] = 7, 305 - [IRQ_DA8XX_COMMRX] = 7, 306 - [IRQ_DA8XX_NINT] = 7, 307 - [IRQ_DA8XX_EVTOUT0] = 7, 308 - [IRQ_DA8XX_EVTOUT1] = 7, 309 - [IRQ_DA8XX_EVTOUT2] = 7, 310 - [IRQ_DA8XX_EVTOUT3] = 7, 311 - [IRQ_DA8XX_EVTOUT4] = 7, 312 - [IRQ_DA8XX_EVTOUT5] = 7, 313 - [IRQ_DA8XX_EVTOUT6] = 7, 314 - [IRQ_DA8XX_EVTOUT7] = 7, 315 - [IRQ_DA8XX_CCINT0] = 7, 316 - [IRQ_DA8XX_CCERRINT] = 7, 317 - [IRQ_DA8XX_TCERRINT0] = 7, 318 - [IRQ_DA8XX_AEMIFINT] = 7, 319 - [IRQ_DA8XX_I2CINT0] = 7, 320 - [IRQ_DA8XX_MMCSDINT0] = 7, 321 - [IRQ_DA8XX_MMCSDINT1] = 7, 322 - [IRQ_DA8XX_ALLINT0] = 7, 323 - [IRQ_DA8XX_RTC] = 7, 324 - [IRQ_DA8XX_SPINT0] = 7, 325 - [IRQ_DA8XX_TINT12_0] = 7, 326 - [IRQ_DA8XX_TINT34_0] = 7, 327 - [IRQ_DA8XX_TINT12_1] = 7, 328 - [IRQ_DA8XX_TINT34_1] = 7, 329 - [IRQ_DA8XX_UARTINT0] = 7, 330 - [IRQ_DA8XX_KEYMGRINT] = 7, 331 - [IRQ_DA850_MPUADDRERR0] = 7, 332 - [IRQ_DA8XX_CHIPINT0] = 7, 333 - [IRQ_DA8XX_CHIPINT1] = 7, 334 - [IRQ_DA8XX_CHIPINT2] = 7, 335 - [IRQ_DA8XX_CHIPINT3] = 7, 336 - [IRQ_DA8XX_TCERRINT1] = 7, 337 - [IRQ_DA8XX_C0_RX_THRESH_PULSE] = 7, 338 - [IRQ_DA8XX_C0_RX_PULSE] = 7, 339 - [IRQ_DA8XX_C0_TX_PULSE] = 7, 340 - [IRQ_DA8XX_C0_MISC_PULSE] = 7, 341 - [IRQ_DA8XX_C1_RX_THRESH_PULSE] = 7, 342 - [IRQ_DA8XX_C1_RX_PULSE] = 7, 343 - [IRQ_DA8XX_C1_TX_PULSE] = 7, 344 - [IRQ_DA8XX_C1_MISC_PULSE] = 7, 345 - [IRQ_DA8XX_MEMERR] = 7, 346 - [IRQ_DA8XX_GPIO0] = 7, 347 - [IRQ_DA8XX_GPIO1] = 7, 348 - [IRQ_DA8XX_GPIO2] = 7, 349 - [IRQ_DA8XX_GPIO3] = 7, 350 - [IRQ_DA8XX_GPIO4] = 7, 351 - [IRQ_DA8XX_GPIO5] = 7, 352 - [IRQ_DA8XX_GPIO6] = 7, 353 - [IRQ_DA8XX_GPIO7] = 7, 354 - [IRQ_DA8XX_GPIO8] = 7, 355 - [IRQ_DA8XX_I2CINT1] = 7, 356 - [IRQ_DA8XX_LCDINT] = 7, 357 - [IRQ_DA8XX_UARTINT1] = 7, 358 - [IRQ_DA8XX_MCASPINT] = 7, 359 - [IRQ_DA8XX_ALLINT1] = 7, 360 - [IRQ_DA8XX_SPINT1] = 7, 361 - [IRQ_DA8XX_UHPI_INT1] = 7, 362 - [IRQ_DA8XX_USB_INT] = 7, 363 - [IRQ_DA8XX_IRQN] = 7, 364 - [IRQ_DA8XX_RWAKEUP] = 7, 365 - [IRQ_DA8XX_UARTINT2] = 7, 366 - [IRQ_DA8XX_DFTSSINT] = 7, 367 - [IRQ_DA8XX_EHRPWM0] = 7, 368 - [IRQ_DA8XX_EHRPWM0TZ] = 7, 369 - [IRQ_DA8XX_EHRPWM1] = 7, 370 - [IRQ_DA8XX_EHRPWM1TZ] = 7, 371 - [IRQ_DA850_SATAINT] = 7, 372 - [IRQ_DA850_TINTALL_2] = 7, 373 - [IRQ_DA8XX_ECAP0] = 7, 374 - [IRQ_DA8XX_ECAP1] = 7, 375 - [IRQ_DA8XX_ECAP2] = 7, 376 - [IRQ_DA850_MMCSDINT0_1] = 7, 377 - [IRQ_DA850_MMCSDINT1_1] = 7, 378 - [IRQ_DA850_T12CMPINT0_2] = 7, 379 - [IRQ_DA850_T12CMPINT1_2] = 7, 380 - [IRQ_DA850_T12CMPINT2_2] = 7, 381 - [IRQ_DA850_T12CMPINT3_2] = 7, 382 - [IRQ_DA850_T12CMPINT4_2] = 7, 383 - [IRQ_DA850_T12CMPINT5_2] = 7, 384 - [IRQ_DA850_T12CMPINT6_2] = 7, 385 - [IRQ_DA850_T12CMPINT7_2] = 7, 386 - [IRQ_DA850_T12CMPINT0_3] = 7, 387 - [IRQ_DA850_T12CMPINT1_3] = 7, 388 - [IRQ_DA850_T12CMPINT2_3] = 7, 389 - [IRQ_DA850_T12CMPINT3_3] = 7, 390 - [IRQ_DA850_T12CMPINT4_3] = 7, 391 - [IRQ_DA850_T12CMPINT5_3] = 7, 392 - [IRQ_DA850_T12CMPINT6_3] = 7, 393 - [IRQ_DA850_T12CMPINT7_3] = 7, 394 - [IRQ_DA850_RPIINT] = 7, 395 - [IRQ_DA850_VPIFINT] = 7, 396 - [IRQ_DA850_CCINT1] = 7, 397 - [IRQ_DA850_CCERRINT1] = 7, 398 - [IRQ_DA850_TCERRINT2] = 7, 399 - [IRQ_DA850_TINTALL_3] = 7, 400 - [IRQ_DA850_MCBSP0RINT] = 7, 401 - [IRQ_DA850_MCBSP0XINT] = 7, 402 - [IRQ_DA850_MCBSP1RINT] = 7, 403 - [IRQ_DA850_MCBSP1XINT] = 7, 404 - [IRQ_DA8XX_ARMCLKSTOPREQ] = 7, 405 - }; 406 - 407 301 static struct map_desc da850_io_desc[] = { 408 302 { 409 303 .virtual = IO_VIRT, ··· 335 439 static struct davinci_timer_instance da850_timer_instance[4] = { 336 440 { 337 441 .base = DA8XX_TIMER64P0_BASE, 338 - .bottom_irq = IRQ_DA8XX_TINT12_0, 339 - .top_irq = IRQ_DA8XX_TINT34_0, 442 + .bottom_irq = DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT12_0), 443 + .top_irq = DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT34_0), 340 444 }, 341 445 { 342 446 .base = DA8XX_TIMER64P1_BASE, 343 - .bottom_irq = IRQ_DA8XX_TINT12_1, 344 - .top_irq = IRQ_DA8XX_TINT34_1, 447 + .bottom_irq = DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT12_1), 448 + .top_irq = DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT34_1), 345 449 }, 346 450 { 347 451 .base = DA850_TIMER64P2_BASE, 348 - .bottom_irq = IRQ_DA850_TINT12_2, 349 - .top_irq = IRQ_DA850_TINT34_2, 452 + .bottom_irq = DAVINCI_INTC_IRQ(IRQ_DA850_TINT12_2), 453 + .top_irq = DAVINCI_INTC_IRQ(IRQ_DA850_TINT34_2), 350 454 }, 351 455 { 352 456 .base = DA850_TIMER64P3_BASE, 353 - .bottom_irq = IRQ_DA850_TINT12_3, 354 - .top_irq = IRQ_DA850_TINT34_3, 457 + .bottom_irq = DAVINCI_INTC_IRQ(IRQ_DA850_TINT12_3), 458 + .top_irq = DAVINCI_INTC_IRQ(IRQ_DA850_TINT34_3), 355 459 }, 356 460 }; 357 461 ··· 554 658 555 659 static struct resource da850_vpif_display_resource[] = { 556 660 { 557 - .start = IRQ_DA850_VPIFINT, 558 - .end = IRQ_DA850_VPIFINT, 661 + .start = DAVINCI_INTC_IRQ(IRQ_DA850_VPIFINT), 662 + .end = DAVINCI_INTC_IRQ(IRQ_DA850_VPIFINT), 559 663 .flags = IORESOURCE_IRQ, 560 664 }, 561 665 }; ··· 573 677 574 678 static struct resource da850_vpif_capture_resource[] = { 575 679 { 576 - .start = IRQ_DA850_VPIFINT, 577 - .end = IRQ_DA850_VPIFINT, 680 + .start = DAVINCI_INTC_IRQ(IRQ_DA850_VPIFINT), 681 + .end = DAVINCI_INTC_IRQ(IRQ_DA850_VPIFINT), 578 682 .flags = IORESOURCE_IRQ, 579 683 }, 580 684 { 581 - .start = IRQ_DA850_VPIFINT, 582 - .end = IRQ_DA850_VPIFINT, 685 + .start = DAVINCI_INTC_IRQ(IRQ_DA850_VPIFINT), 686 + .end = DAVINCI_INTC_IRQ(IRQ_DA850_VPIFINT), 583 687 .flags = IORESOURCE_IRQ, 584 688 }, 585 689 }; ··· 634 738 .pinmux_base = DA8XX_SYSCFG0_BASE + 0x120, 635 739 .pinmux_pins = da850_pins, 636 740 .pinmux_pins_num = ARRAY_SIZE(da850_pins), 637 - .intc_base = DA8XX_CP_INTC_BASE, 638 - .intc_type = DAVINCI_INTC_TYPE_CP_INTC, 639 - .intc_irq_prios = da850_default_priorities, 640 - .intc_irq_num = DA850_N_CP_INTC_IRQ, 641 741 .timer_info = &da850_timer_info, 642 742 .emac_pdata = &da8xx_emac_pdata, 643 743 .sram_dma = DA8XX_SHARED_RAM_BASE, ··· 650 758 651 759 da8xx_syscfg1_base = ioremap(DA8XX_SYSCFG1_BASE, SZ_4K); 652 760 WARN(!da8xx_syscfg1_base, "Unable to map syscfg1 module"); 761 + } 762 + 763 + static const struct davinci_cp_intc_config da850_cp_intc_config = { 764 + .reg = { 765 + .start = DA8XX_CP_INTC_BASE, 766 + .end = DA8XX_CP_INTC_BASE + SZ_8K - 1, 767 + .flags = IORESOURCE_MEM, 768 + }, 769 + .num_irqs = DA850_N_CP_INTC_IRQ, 770 + }; 771 + 772 + void __init da850_init_irq(void) 773 + { 774 + davinci_cp_intc_init(&da850_cp_intc_config); 653 775 } 654 776 655 777 void __init da850_init_time(void)
+4
arch/arm/mach-davinci/davinci.h
··· 88 88 /* DM355 function declarations */ 89 89 void dm355_init(void); 90 90 void dm355_init_time(void); 91 + void dm355_init_irq(void); 91 92 void dm355_register_clocks(void); 92 93 void dm355_init_spi0(unsigned chipselect_mask, 93 94 const struct spi_board_info *info, unsigned len); ··· 98 97 99 98 /* DM365 function declarations */ 100 99 void dm365_init(void); 100 + void dm365_init_irq(void); 101 101 void dm365_init_time(void); 102 102 void dm365_register_clocks(void); 103 103 void dm365_init_asp(void); ··· 112 110 113 111 /* DM644x function declarations */ 114 112 void dm644x_init(void); 113 + void dm644x_init_irq(void); 115 114 void dm644x_init_devices(void); 116 115 void dm644x_init_time(void); 117 116 void dm644x_register_clocks(void); ··· 122 119 123 120 /* DM646x function declarations */ 124 121 void dm646x_init(void); 122 + void dm646x_init_irq(void); 125 123 void dm646x_init_time(unsigned long ref_clk_rate, unsigned long aux_clkin_rate); 126 124 void dm646x_register_clocks(void); 127 125 void dm646x_init_mcasp0(struct snd_platform_data *pdata);
+74 -73
arch/arm/mach-davinci/devices-da8xx.c
··· 28 28 29 29 #include "asp.h" 30 30 #include "cpuidle.h" 31 + #include "irqs.h" 31 32 #include "sram.h" 32 33 33 34 #define DA8XX_TPCC_BASE 0x01c00000 ··· 65 64 static struct plat_serial8250_port da8xx_serial0_pdata[] = { 66 65 { 67 66 .mapbase = DA8XX_UART0_BASE, 68 - .irq = IRQ_DA8XX_UARTINT0, 67 + .irq = DAVINCI_INTC_IRQ(IRQ_DA8XX_UARTINT0), 69 68 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 70 69 UPF_IOREMAP, 71 70 .iotype = UPIO_MEM, ··· 78 77 static struct plat_serial8250_port da8xx_serial1_pdata[] = { 79 78 { 80 79 .mapbase = DA8XX_UART1_BASE, 81 - .irq = IRQ_DA8XX_UARTINT1, 80 + .irq = DAVINCI_INTC_IRQ(IRQ_DA8XX_UARTINT1), 82 81 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 83 82 UPF_IOREMAP, 84 83 .iotype = UPIO_MEM, ··· 91 90 static struct plat_serial8250_port da8xx_serial2_pdata[] = { 92 91 { 93 92 .mapbase = DA8XX_UART2_BASE, 94 - .irq = IRQ_DA8XX_UARTINT2, 93 + .irq = DAVINCI_INTC_IRQ(IRQ_DA8XX_UARTINT2), 95 94 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 96 95 UPF_IOREMAP, 97 96 .iotype = UPIO_MEM, ··· 172 171 }, 173 172 { 174 173 .name = "edma3_ccint", 175 - .start = IRQ_DA8XX_CCINT0, 174 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_CCINT0), 176 175 .flags = IORESOURCE_IRQ, 177 176 }, 178 177 { 179 178 .name = "edma3_ccerrint", 180 - .start = IRQ_DA8XX_CCERRINT, 179 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_CCERRINT), 181 180 .flags = IORESOURCE_IRQ, 182 181 }, 183 182 }; ··· 197 196 }, 198 197 { 199 198 .name = "edma3_ccint", 200 - .start = IRQ_DA850_CCINT1, 199 + .start = DAVINCI_INTC_IRQ(IRQ_DA850_CCINT1), 201 200 .flags = IORESOURCE_IRQ, 202 201 }, 203 202 { 204 203 .name = "edma3_ccerrint", 205 - .start = IRQ_DA850_CCERRINT1, 204 + .start = DAVINCI_INTC_IRQ(IRQ_DA850_CCERRINT1), 206 205 .flags = IORESOURCE_IRQ, 207 206 }, 208 207 }; ··· 307 306 .flags = IORESOURCE_MEM, 308 307 }, 309 308 { 310 - .start = IRQ_DA8XX_I2CINT0, 311 - .end = IRQ_DA8XX_I2CINT0, 309 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_I2CINT0), 310 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_I2CINT0), 312 311 .flags = IORESOURCE_IRQ, 313 312 }, 314 313 }; ··· 327 326 .flags = IORESOURCE_MEM, 328 327 }, 329 328 { 330 - .start = IRQ_DA8XX_I2CINT1, 331 - .end = IRQ_DA8XX_I2CINT1, 329 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_I2CINT1), 330 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_I2CINT1), 332 331 .flags = IORESOURCE_IRQ, 333 332 }, 334 333 }; ··· 383 382 .flags = IORESOURCE_MEM, 384 383 }, 385 384 { 386 - .start = IRQ_DA8XX_C0_RX_THRESH_PULSE, 387 - .end = IRQ_DA8XX_C0_RX_THRESH_PULSE, 385 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_C0_RX_THRESH_PULSE), 386 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_C0_RX_THRESH_PULSE), 388 387 .flags = IORESOURCE_IRQ, 389 388 }, 390 389 { 391 - .start = IRQ_DA8XX_C0_RX_PULSE, 392 - .end = IRQ_DA8XX_C0_RX_PULSE, 390 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_C0_RX_PULSE), 391 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_C0_RX_PULSE), 393 392 .flags = IORESOURCE_IRQ, 394 393 }, 395 394 { 396 - .start = IRQ_DA8XX_C0_TX_PULSE, 397 - .end = IRQ_DA8XX_C0_TX_PULSE, 395 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_C0_TX_PULSE), 396 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_C0_TX_PULSE), 398 397 .flags = IORESOURCE_IRQ, 399 398 }, 400 399 { 401 - .start = IRQ_DA8XX_C0_MISC_PULSE, 402 - .end = IRQ_DA8XX_C0_MISC_PULSE, 400 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_C0_MISC_PULSE), 401 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_C0_MISC_PULSE), 403 402 .flags = IORESOURCE_IRQ, 404 403 }, 405 404 }; ··· 471 470 }, 472 471 { 473 472 .name = "common", 474 - .start = IRQ_DA8XX_MCASPINT, 473 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_MCASPINT), 475 474 .flags = IORESOURCE_IRQ, 476 475 }, 477 476 }; ··· 506 505 }, 507 506 { 508 507 .name = "common", 509 - .start = IRQ_DA8XX_MCASPINT, 508 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_MCASPINT), 510 509 .flags = IORESOURCE_IRQ, 511 510 }, 512 511 }; ··· 541 540 }, 542 541 { 543 542 .name = "common", 544 - .start = IRQ_DA8XX_MCASPINT, 543 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_MCASPINT), 545 544 .flags = IORESOURCE_IRQ, 546 545 }, 547 546 }; ··· 589 588 .flags = IORESOURCE_MEM, 590 589 }, 591 590 { 592 - .start = IRQ_DA8XX_EVTOUT0, 593 - .end = IRQ_DA8XX_EVTOUT0, 591 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT0), 592 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT0), 594 593 .flags = IORESOURCE_IRQ, 595 594 }, 596 595 { 597 - .start = IRQ_DA8XX_EVTOUT1, 598 - .end = IRQ_DA8XX_EVTOUT1, 596 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT1), 597 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT1), 599 598 .flags = IORESOURCE_IRQ, 600 599 }, 601 600 { 602 - .start = IRQ_DA8XX_EVTOUT2, 603 - .end = IRQ_DA8XX_EVTOUT2, 601 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT2), 602 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT2), 604 603 .flags = IORESOURCE_IRQ, 605 604 }, 606 605 { 607 - .start = IRQ_DA8XX_EVTOUT3, 608 - .end = IRQ_DA8XX_EVTOUT3, 606 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT3), 607 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT3), 609 608 .flags = IORESOURCE_IRQ, 610 609 }, 611 610 { 612 - .start = IRQ_DA8XX_EVTOUT4, 613 - .end = IRQ_DA8XX_EVTOUT4, 611 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT4), 612 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT4), 614 613 .flags = IORESOURCE_IRQ, 615 614 }, 616 615 { 617 - .start = IRQ_DA8XX_EVTOUT5, 618 - .end = IRQ_DA8XX_EVTOUT5, 616 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT5), 617 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT5), 619 618 .flags = IORESOURCE_IRQ, 620 619 }, 621 620 { 622 - .start = IRQ_DA8XX_EVTOUT6, 623 - .end = IRQ_DA8XX_EVTOUT6, 621 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT6), 622 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT6), 624 623 .flags = IORESOURCE_IRQ, 625 624 }, 626 625 { 627 - .start = IRQ_DA8XX_EVTOUT7, 628 - .end = IRQ_DA8XX_EVTOUT7, 626 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT7), 627 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT7), 629 628 .flags = IORESOURCE_IRQ, 630 629 }, 631 630 }; ··· 675 674 .flags = IORESOURCE_MEM, 676 675 }, 677 676 [1] = { /* interrupt */ 678 - .start = IRQ_DA8XX_LCDINT, 679 - .end = IRQ_DA8XX_LCDINT, 677 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_LCDINT), 678 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_LCDINT), 680 679 .flags = IORESOURCE_IRQ, 681 680 }, 682 681 }; ··· 701 700 .flags = IORESOURCE_MEM, 702 701 }, 703 702 { /* interrupt */ 704 - .start = IRQ_DA8XX_GPIO0, 705 - .end = IRQ_DA8XX_GPIO0, 703 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO0), 704 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO0), 706 705 .flags = IORESOURCE_IRQ, 707 706 }, 708 707 { 709 - .start = IRQ_DA8XX_GPIO1, 710 - .end = IRQ_DA8XX_GPIO1, 708 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO1), 709 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO1), 711 710 .flags = IORESOURCE_IRQ, 712 711 }, 713 712 { 714 - .start = IRQ_DA8XX_GPIO2, 715 - .end = IRQ_DA8XX_GPIO2, 713 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO2), 714 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO2), 716 715 .flags = IORESOURCE_IRQ, 717 716 }, 718 717 { 719 - .start = IRQ_DA8XX_GPIO3, 720 - .end = IRQ_DA8XX_GPIO3, 718 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO3), 719 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO3), 721 720 .flags = IORESOURCE_IRQ, 722 721 }, 723 722 { 724 - .start = IRQ_DA8XX_GPIO4, 725 - .end = IRQ_DA8XX_GPIO4, 723 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO4), 724 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO4), 726 725 .flags = IORESOURCE_IRQ, 727 726 }, 728 727 { 729 - .start = IRQ_DA8XX_GPIO5, 730 - .end = IRQ_DA8XX_GPIO5, 728 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO5), 729 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO5), 731 730 .flags = IORESOURCE_IRQ, 732 731 }, 733 732 { 734 - .start = IRQ_DA8XX_GPIO6, 735 - .end = IRQ_DA8XX_GPIO6, 733 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO6), 734 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO6), 736 735 .flags = IORESOURCE_IRQ, 737 736 }, 738 737 { 739 - .start = IRQ_DA8XX_GPIO7, 740 - .end = IRQ_DA8XX_GPIO7, 738 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO7), 739 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO7), 741 740 .flags = IORESOURCE_IRQ, 742 741 }, 743 742 { 744 - .start = IRQ_DA8XX_GPIO8, 745 - .end = IRQ_DA8XX_GPIO8, 743 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO8), 744 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO8), 746 745 .flags = IORESOURCE_IRQ, 747 746 }, 748 747 }; ··· 767 766 .flags = IORESOURCE_MEM, 768 767 }, 769 768 { /* interrupt */ 770 - .start = IRQ_DA8XX_MMCSDINT0, 771 - .end = IRQ_DA8XX_MMCSDINT0, 769 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_MMCSDINT0), 770 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_MMCSDINT0), 772 771 .flags = IORESOURCE_IRQ, 773 772 }, 774 773 }; ··· 794 793 .flags = IORESOURCE_MEM, 795 794 }, 796 795 { /* interrupt */ 797 - .start = IRQ_DA850_MMCSDINT0_1, 798 - .end = IRQ_DA850_MMCSDINT0_1, 796 + .start = DAVINCI_INTC_IRQ(IRQ_DA850_MMCSDINT0_1), 797 + .end = DAVINCI_INTC_IRQ(IRQ_DA850_MMCSDINT0_1), 799 798 .flags = IORESOURCE_IRQ, 800 799 }, 801 800 }; ··· 846 845 .flags = IORESOURCE_MEM, 847 846 }, 848 847 { /* dsp irq */ 849 - .start = IRQ_DA8XX_CHIPINT0, 850 - .end = IRQ_DA8XX_CHIPINT0, 848 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_CHIPINT0), 849 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_CHIPINT0), 851 850 .flags = IORESOURCE_IRQ, 852 851 }, 853 852 }; ··· 937 936 .flags = IORESOURCE_MEM, 938 937 }, 939 938 { /* timer irq */ 940 - .start = IRQ_DA8XX_RTC, 941 - .end = IRQ_DA8XX_RTC, 939 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_RTC), 940 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_RTC), 942 941 .flags = IORESOURCE_IRQ, 943 942 }, 944 943 { /* alarm irq */ 945 - .start = IRQ_DA8XX_RTC, 946 - .end = IRQ_DA8XX_RTC, 944 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_RTC), 945 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_RTC), 947 946 .flags = IORESOURCE_IRQ, 948 947 }, 949 948 }; ··· 1010 1009 .flags = IORESOURCE_MEM, 1011 1010 }, 1012 1011 [1] = { 1013 - .start = IRQ_DA8XX_SPINT0, 1014 - .end = IRQ_DA8XX_SPINT0, 1012 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_SPINT0), 1013 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_SPINT0), 1015 1014 .flags = IORESOURCE_IRQ, 1016 1015 }, 1017 1016 }; ··· 1023 1022 .flags = IORESOURCE_MEM, 1024 1023 }, 1025 1024 [1] = { 1026 - .start = IRQ_DA8XX_SPINT1, 1027 - .end = IRQ_DA8XX_SPINT1, 1025 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_SPINT1), 1026 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_SPINT1), 1028 1027 .flags = IORESOURCE_IRQ, 1029 1028 }, 1030 1029 }; ··· 1104 1103 .flags = IORESOURCE_MEM, 1105 1104 }, 1106 1105 { 1107 - .start = IRQ_DA850_SATAINT, 1106 + .start = DAVINCI_INTC_IRQ(IRQ_DA850_SATAINT), 1108 1107 .flags = IORESOURCE_IRQ, 1109 1108 }, 1110 1109 };
+21 -19
arch/arm/mach-davinci/devices.c
··· 11 11 12 12 #include <linux/init.h> 13 13 #include <linux/platform_device.h> 14 + #include <linux/platform_data/i2c-davinci.h> 15 + #include <linux/platform_data/mmc-davinci.h> 16 + #include <linux/platform_data/edma.h> 14 17 #include <linux/dma-mapping.h> 15 18 #include <linux/io.h> 16 19 #include <linux/reboot.h> 17 20 18 21 #include <mach/hardware.h> 19 - #include <linux/platform_data/i2c-davinci.h> 20 - #include <mach/irqs.h> 21 22 #include <mach/cputype.h> 22 23 #include <mach/mux.h> 23 - #include <linux/platform_data/mmc-davinci.h> 24 24 #include <mach/time.h> 25 - #include <linux/platform_data/edma.h> 26 - 27 25 28 26 #include "davinci.h" 27 + #include "irqs.h" 29 28 30 29 #define DAVINCI_I2C_BASE 0x01C21000 31 30 #define DAVINCI_ATA_BASE 0x01C66000 ··· 55 56 .flags = IORESOURCE_MEM, 56 57 }, 57 58 { 58 - .start = IRQ_I2C, 59 + .start = DAVINCI_INTC_IRQ(IRQ_I2C), 59 60 .flags = IORESOURCE_IRQ, 60 61 }, 61 62 }; ··· 83 84 .flags = IORESOURCE_MEM, 84 85 }, 85 86 { 86 - .start = IRQ_IDE, 87 - .end = IRQ_IDE, 87 + .start = DAVINCI_INTC_IRQ(IRQ_IDE), 88 + .end = DAVINCI_INTC_IRQ(IRQ_IDE), 88 89 .flags = IORESOURCE_IRQ, 89 90 }, 90 91 }; ··· 132 133 }, 133 134 /* IRQs: MMC/SD, then SDIO */ 134 135 { 135 - .start = IRQ_MMCINT, 136 + .start = DAVINCI_INTC_IRQ(IRQ_MMCINT), 136 137 .flags = IORESOURCE_IRQ, 137 138 }, { 138 139 /* different on dm355 */ 139 - .start = IRQ_SDIOINT, 140 + .start = DAVINCI_INTC_IRQ(IRQ_SDIOINT), 140 141 .flags = IORESOURCE_IRQ, 141 142 }, 142 143 }; ··· 162 163 }, 163 164 /* IRQs: MMC/SD, then SDIO */ 164 165 { 165 - .start = IRQ_DM355_MMCINT1, 166 + .start = DAVINCI_INTC_IRQ(IRQ_DM355_MMCINT1), 166 167 .flags = IORESOURCE_IRQ, 167 168 }, { 168 - .start = IRQ_DM355_SDIOINT1, 169 + .start = DAVINCI_INTC_IRQ(IRQ_DM355_SDIOINT1), 169 170 .flags = IORESOURCE_IRQ, 170 171 }, 171 172 }; ··· 218 219 mmcsd1_resources[0].start = DM365_MMCSD1_BASE; 219 220 mmcsd1_resources[0].end = DM365_MMCSD1_BASE + 220 221 SZ_4K - 1; 221 - mmcsd1_resources[2].start = IRQ_DM365_SDIOINT1; 222 + mmcsd1_resources[2].start = DAVINCI_INTC_IRQ( 223 + IRQ_DM365_SDIOINT1); 222 224 davinci_mmcsd1_device.name = "da830-mmc"; 223 225 } else 224 226 break; ··· 230 230 if (cpu_is_davinci_dm355()) { 231 231 mmcsd0_resources[0].start = DM355_MMCSD0_BASE; 232 232 mmcsd0_resources[0].end = DM355_MMCSD0_BASE + SZ_4K - 1; 233 - mmcsd0_resources[2].start = IRQ_DM355_SDIOINT0; 233 + mmcsd0_resources[2].start = DAVINCI_INTC_IRQ( 234 + IRQ_DM355_SDIOINT0); 234 235 235 236 /* expose all 6 MMC0 signals: CLK, CMD, DATA[0..3] */ 236 237 davinci_cfg_reg(DM355_MMCSD0); ··· 242 241 mmcsd0_resources[0].start = DM365_MMCSD0_BASE; 243 242 mmcsd0_resources[0].end = DM365_MMCSD0_BASE + 244 243 SZ_4K - 1; 245 - mmcsd0_resources[2].start = IRQ_DM365_SDIOINT0; 244 + mmcsd0_resources[2].start = DAVINCI_INTC_IRQ( 245 + IRQ_DM365_SDIOINT0); 246 246 davinci_mmcsd0_device.name = "da830-mmc"; 247 247 } else if (cpu_is_davinci_dm644x()) { 248 248 /* REVISIT: should this be in board-init code? */ ··· 315 313 struct davinci_timer_instance davinci_timer_instance[2] = { 316 314 { 317 315 .base = DAVINCI_TIMER0_BASE, 318 - .bottom_irq = IRQ_TINT0_TINT12, 319 - .top_irq = IRQ_TINT0_TINT34, 316 + .bottom_irq = DAVINCI_INTC_IRQ(IRQ_TINT0_TINT12), 317 + .top_irq = DAVINCI_INTC_IRQ(IRQ_TINT0_TINT34), 320 318 }, 321 319 { 322 320 .base = DAVINCI_TIMER1_BASE, 323 - .bottom_irq = IRQ_TINT1_TINT12, 324 - .top_irq = IRQ_TINT1_TINT34, 321 + .bottom_irq = DAVINCI_INTC_IRQ(IRQ_TINT1_TINT12), 322 + .top_irq = DAVINCI_INTC_IRQ(IRQ_TINT1_TINT34), 325 323 }, 326 324 }; 327 325
+45 -33
arch/arm/mach-davinci/dm355.c
··· 15 15 #include <linux/dma-mapping.h> 16 16 #include <linux/dmaengine.h> 17 17 #include <linux/init.h> 18 + #include <linux/irqchip/irq-davinci-aintc.h> 18 19 #include <linux/platform_data/edma.h> 19 20 #include <linux/platform_data/gpio-davinci.h> 20 21 #include <linux/platform_data/spi-davinci.h> ··· 27 26 28 27 #include <mach/common.h> 29 28 #include <mach/cputype.h> 30 - #include <mach/irqs.h> 31 29 #include <mach/mux.h> 32 30 #include <mach/serial.h> 33 31 #include <mach/time.h> 34 32 35 33 #include "asp.h" 36 34 #include "davinci.h" 35 + #include "irqs.h" 37 36 #include "mux.h" 38 37 39 38 #define DM355_UART2_BASE (IO_PHYS + 0x206000) ··· 54 53 .flags = IORESOURCE_MEM, 55 54 }, 56 55 { 57 - .start = IRQ_DM355_SPINT0_0, 56 + .start = DAVINCI_INTC_IRQ(IRQ_DM355_SPINT0_0), 58 57 .flags = IORESOURCE_IRQ, 59 58 }, 60 59 }; ··· 274 273 }, 275 274 { 276 275 .name = "edma3_ccint", 277 - .start = IRQ_CCINT0, 276 + .start = DAVINCI_INTC_IRQ(IRQ_CCINT0), 278 277 .flags = IORESOURCE_IRQ, 279 278 }, 280 279 { 281 280 .name = "edma3_ccerrint", 282 - .start = IRQ_CCERRINT, 281 + .start = DAVINCI_INTC_IRQ(IRQ_CCERRINT), 283 282 .flags = IORESOURCE_IRQ, 284 283 }, 285 284 /* not using (or muxing) TC*_ERR */ ··· 359 358 360 359 static struct resource vpfe_resources[] = { 361 360 { 362 - .start = IRQ_VDINT0, 363 - .end = IRQ_VDINT0, 361 + .start = DAVINCI_INTC_IRQ(IRQ_VDINT0), 362 + .end = DAVINCI_INTC_IRQ(IRQ_VDINT0), 364 363 .flags = IORESOURCE_IRQ, 365 364 }, 366 365 { 367 - .start = IRQ_VDINT1, 368 - .end = IRQ_VDINT1, 366 + .start = DAVINCI_INTC_IRQ(IRQ_VDINT1), 367 + .end = DAVINCI_INTC_IRQ(IRQ_VDINT1), 369 368 .flags = IORESOURCE_IRQ, 370 369 }, 371 370 }; ··· 423 422 424 423 static struct resource dm355_venc_resources[] = { 425 424 { 426 - .start = IRQ_VENCINT, 427 - .end = IRQ_VENCINT, 425 + .start = DAVINCI_INTC_IRQ(IRQ_VENCINT), 426 + .end = DAVINCI_INTC_IRQ(IRQ_VENCINT), 428 427 .flags = IORESOURCE_IRQ, 429 428 }, 430 429 /* venc registers io space */ ··· 443 442 444 443 static struct resource dm355_v4l2_disp_resources[] = { 445 444 { 446 - .start = IRQ_VENCINT, 447 - .end = IRQ_VENCINT, 445 + .start = DAVINCI_INTC_IRQ(IRQ_VENCINT), 446 + .end = DAVINCI_INTC_IRQ(IRQ_VENCINT), 448 447 .flags = IORESOURCE_IRQ, 449 448 }, 450 449 /* venc registers io space */ ··· 548 547 .flags = IORESOURCE_MEM, 549 548 }, 550 549 { /* interrupt */ 551 - .start = IRQ_DM355_GPIOBNK0, 552 - .end = IRQ_DM355_GPIOBNK0, 550 + .start = DAVINCI_INTC_IRQ(IRQ_DM355_GPIOBNK0), 551 + .end = DAVINCI_INTC_IRQ(IRQ_DM355_GPIOBNK0), 553 552 .flags = IORESOURCE_IRQ, 554 553 }, 555 554 { 556 - .start = IRQ_DM355_GPIOBNK1, 557 - .end = IRQ_DM355_GPIOBNK1, 555 + .start = DAVINCI_INTC_IRQ(IRQ_DM355_GPIOBNK1), 556 + .end = DAVINCI_INTC_IRQ(IRQ_DM355_GPIOBNK1), 558 557 .flags = IORESOURCE_IRQ, 559 558 }, 560 559 { 561 - .start = IRQ_DM355_GPIOBNK2, 562 - .end = IRQ_DM355_GPIOBNK2, 560 + .start = DAVINCI_INTC_IRQ(IRQ_DM355_GPIOBNK2), 561 + .end = DAVINCI_INTC_IRQ(IRQ_DM355_GPIOBNK2), 563 562 .flags = IORESOURCE_IRQ, 564 563 }, 565 564 { 566 - .start = IRQ_DM355_GPIOBNK3, 567 - .end = IRQ_DM355_GPIOBNK3, 565 + .start = DAVINCI_INTC_IRQ(IRQ_DM355_GPIOBNK3), 566 + .end = DAVINCI_INTC_IRQ(IRQ_DM355_GPIOBNK3), 568 567 .flags = IORESOURCE_IRQ, 569 568 }, 570 569 { 571 - .start = IRQ_DM355_GPIOBNK4, 572 - .end = IRQ_DM355_GPIOBNK4, 570 + .start = DAVINCI_INTC_IRQ(IRQ_DM355_GPIOBNK4), 571 + .end = DAVINCI_INTC_IRQ(IRQ_DM355_GPIOBNK4), 573 572 .flags = IORESOURCE_IRQ, 574 573 }, 575 574 { 576 - .start = IRQ_DM355_GPIOBNK5, 577 - .end = IRQ_DM355_GPIOBNK5, 575 + .start = DAVINCI_INTC_IRQ(IRQ_DM355_GPIOBNK5), 576 + .end = DAVINCI_INTC_IRQ(IRQ_DM355_GPIOBNK5), 578 577 .flags = IORESOURCE_IRQ, 579 578 }, 580 579 { 581 - .start = IRQ_DM355_GPIOBNK6, 582 - .end = IRQ_DM355_GPIOBNK6, 580 + .start = DAVINCI_INTC_IRQ(IRQ_DM355_GPIOBNK6), 581 + .end = DAVINCI_INTC_IRQ(IRQ_DM355_GPIOBNK6), 583 582 .flags = IORESOURCE_IRQ, 584 583 }, 585 584 }; ··· 633 632 static struct plat_serial8250_port dm355_serial0_platform_data[] = { 634 633 { 635 634 .mapbase = DAVINCI_UART0_BASE, 636 - .irq = IRQ_UARTINT0, 635 + .irq = DAVINCI_INTC_IRQ(IRQ_UARTINT0), 637 636 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 638 637 UPF_IOREMAP, 639 638 .iotype = UPIO_MEM, ··· 646 645 static struct plat_serial8250_port dm355_serial1_platform_data[] = { 647 646 { 648 647 .mapbase = DAVINCI_UART1_BASE, 649 - .irq = IRQ_UARTINT1, 648 + .irq = DAVINCI_INTC_IRQ(IRQ_UARTINT1), 650 649 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 651 650 UPF_IOREMAP, 652 651 .iotype = UPIO_MEM, ··· 659 658 static struct plat_serial8250_port dm355_serial2_platform_data[] = { 660 659 { 661 660 .mapbase = DM355_UART2_BASE, 662 - .irq = IRQ_DM355_UARTINT2, 661 + .irq = DAVINCI_INTC_IRQ(IRQ_DM355_UARTINT2), 663 662 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 664 663 UPF_IOREMAP, 665 664 .iotype = UPIO_MEM, ··· 705 704 .pinmux_base = DAVINCI_SYSTEM_MODULE_BASE, 706 705 .pinmux_pins = dm355_pins, 707 706 .pinmux_pins_num = ARRAY_SIZE(dm355_pins), 708 - .intc_base = DAVINCI_ARM_INTC_BASE, 709 - .intc_type = DAVINCI_INTC_TYPE_AINTC, 710 - .intc_irq_prios = dm355_default_priorities, 711 - .intc_irq_num = DAVINCI_N_AINTC_IRQ, 712 707 .timer_info = &dm355_timer_info, 713 708 .sram_dma = 0x00010000, 714 709 .sram_len = SZ_32K, ··· 788 791 } 789 792 790 793 return 0; 794 + } 795 + 796 + static const struct davinci_aintc_config dm355_aintc_config = { 797 + .reg = { 798 + .start = DAVINCI_ARM_INTC_BASE, 799 + .end = DAVINCI_ARM_INTC_BASE + SZ_4K - 1, 800 + .flags = IORESOURCE_MEM, 801 + }, 802 + .num_irqs = 64, 803 + .prios = dm355_default_priorities, 804 + }; 805 + 806 + void __init dm355_init_irq(void) 807 + { 808 + davinci_aintc_init(&dm355_aintc_config); 791 809 } 792 810 793 811 static int __init dm355_init_devices(void)
+57 -45
arch/arm/mach-davinci/dm365.c
··· 19 19 #include <linux/dma-mapping.h> 20 20 #include <linux/dmaengine.h> 21 21 #include <linux/init.h> 22 + #include <linux/irqchip/irq-davinci-aintc.h> 22 23 #include <linux/platform_data/edma.h> 23 24 #include <linux/platform_data/gpio-davinci.h> 24 25 #include <linux/platform_data/keyscan-davinci.h> ··· 32 31 33 32 #include <mach/common.h> 34 33 #include <mach/cputype.h> 35 - #include <mach/irqs.h> 36 34 #include <mach/mux.h> 37 35 #include <mach/serial.h> 38 36 #include <mach/time.h> 39 37 40 38 #include "asp.h" 41 39 #include "davinci.h" 40 + #include "irqs.h" 42 41 #include "mux.h" 43 42 44 43 #define DM365_REF_FREQ 24000000 /* 24 MHz on the DM365 EVM */ ··· 225 224 .flags = IORESOURCE_MEM, 226 225 }, 227 226 { 228 - .start = IRQ_DM365_SPIINT0_0, 227 + .start = DAVINCI_INTC_IRQ(IRQ_DM365_SPIINT0_0), 229 228 .flags = IORESOURCE_IRQ, 230 229 }, 231 230 }; ··· 267 266 .flags = IORESOURCE_MEM, 268 267 }, 269 268 { /* interrupt */ 270 - .start = IRQ_DM365_GPIO0, 271 - .end = IRQ_DM365_GPIO0, 269 + .start = DAVINCI_INTC_IRQ(IRQ_DM365_GPIO0), 270 + .end = DAVINCI_INTC_IRQ(IRQ_DM365_GPIO0), 272 271 .flags = IORESOURCE_IRQ, 273 272 }, 274 273 { 275 - .start = IRQ_DM365_GPIO1, 276 - .end = IRQ_DM365_GPIO1, 274 + .start = DAVINCI_INTC_IRQ(IRQ_DM365_GPIO1), 275 + .end = DAVINCI_INTC_IRQ(IRQ_DM365_GPIO1), 277 276 .flags = IORESOURCE_IRQ, 278 277 }, 279 278 { 280 - .start = IRQ_DM365_GPIO2, 281 - .end = IRQ_DM365_GPIO2, 279 + .start = DAVINCI_INTC_IRQ(IRQ_DM365_GPIO2), 280 + .end = DAVINCI_INTC_IRQ(IRQ_DM365_GPIO2), 282 281 .flags = IORESOURCE_IRQ, 283 282 }, 284 283 { 285 - .start = IRQ_DM365_GPIO3, 286 - .end = IRQ_DM365_GPIO3, 284 + .start = DAVINCI_INTC_IRQ(IRQ_DM365_GPIO3), 285 + .end = DAVINCI_INTC_IRQ(IRQ_DM365_GPIO3), 287 286 .flags = IORESOURCE_IRQ, 288 287 }, 289 288 { 290 - .start = IRQ_DM365_GPIO4, 291 - .end = IRQ_DM365_GPIO4, 289 + .start = DAVINCI_INTC_IRQ(IRQ_DM365_GPIO4), 290 + .end = DAVINCI_INTC_IRQ(IRQ_DM365_GPIO4), 292 291 .flags = IORESOURCE_IRQ, 293 292 }, 294 293 { 295 - .start = IRQ_DM365_GPIO5, 296 - .end = IRQ_DM365_GPIO5, 294 + .start = DAVINCI_INTC_IRQ(IRQ_DM365_GPIO5), 295 + .end = DAVINCI_INTC_IRQ(IRQ_DM365_GPIO5), 297 296 .flags = IORESOURCE_IRQ, 298 297 }, 299 298 { 300 - .start = IRQ_DM365_GPIO6, 301 - .end = IRQ_DM365_GPIO6, 299 + .start = DAVINCI_INTC_IRQ(IRQ_DM365_GPIO6), 300 + .end = DAVINCI_INTC_IRQ(IRQ_DM365_GPIO6), 302 301 .flags = IORESOURCE_IRQ, 303 302 }, 304 303 { 305 - .start = IRQ_DM365_GPIO7, 306 - .end = IRQ_DM365_GPIO7, 304 + .start = DAVINCI_INTC_IRQ(IRQ_DM365_GPIO7), 305 + .end = DAVINCI_INTC_IRQ(IRQ_DM365_GPIO7), 307 306 .flags = IORESOURCE_IRQ, 308 307 }, 309 308 }; ··· 337 336 .flags = IORESOURCE_MEM, 338 337 }, 339 338 { 340 - .start = IRQ_DM365_EMAC_RXTHRESH, 341 - .end = IRQ_DM365_EMAC_RXTHRESH, 339 + .start = DAVINCI_INTC_IRQ(IRQ_DM365_EMAC_RXTHRESH), 340 + .end = DAVINCI_INTC_IRQ(IRQ_DM365_EMAC_RXTHRESH), 342 341 .flags = IORESOURCE_IRQ, 343 342 }, 344 343 { 345 - .start = IRQ_DM365_EMAC_RXPULSE, 346 - .end = IRQ_DM365_EMAC_RXPULSE, 344 + .start = DAVINCI_INTC_IRQ(IRQ_DM365_EMAC_RXPULSE), 345 + .end = DAVINCI_INTC_IRQ(IRQ_DM365_EMAC_RXPULSE), 347 346 .flags = IORESOURCE_IRQ, 348 347 }, 349 348 { 350 - .start = IRQ_DM365_EMAC_TXPULSE, 351 - .end = IRQ_DM365_EMAC_TXPULSE, 349 + .start = DAVINCI_INTC_IRQ(IRQ_DM365_EMAC_TXPULSE), 350 + .end = DAVINCI_INTC_IRQ(IRQ_DM365_EMAC_TXPULSE), 352 351 .flags = IORESOURCE_IRQ, 353 352 }, 354 353 { 355 - .start = IRQ_DM365_EMAC_MISCPULSE, 356 - .end = IRQ_DM365_EMAC_MISCPULSE, 354 + .start = DAVINCI_INTC_IRQ(IRQ_DM365_EMAC_MISCPULSE), 355 + .end = DAVINCI_INTC_IRQ(IRQ_DM365_EMAC_MISCPULSE), 357 356 .flags = IORESOURCE_IRQ, 358 357 }, 359 358 }; ··· 519 518 }, 520 519 { 521 520 .name = "edma3_ccint", 522 - .start = IRQ_CCINT0, 521 + .start = DAVINCI_INTC_IRQ(IRQ_CCINT0), 523 522 .flags = IORESOURCE_IRQ, 524 523 }, 525 524 { 526 525 .name = "edma3_ccerrint", 527 - .start = IRQ_CCERRINT, 526 + .start = DAVINCI_INTC_IRQ(IRQ_CCERRINT), 528 527 .flags = IORESOURCE_IRQ, 529 528 }, 530 529 /* not using TC*_ERR */ ··· 598 597 .flags = IORESOURCE_MEM, 599 598 }, 600 599 { 601 - .start = IRQ_DM365_RTCINT, 600 + .start = DAVINCI_INTC_IRQ(IRQ_DM365_RTCINT), 602 601 .flags = IORESOURCE_IRQ, 603 602 }, 604 603 }; ··· 628 627 }, 629 628 { 630 629 /* interrupt */ 631 - .start = IRQ_DM365_KEYINT, 632 - .end = IRQ_DM365_KEYINT, 630 + .start = DAVINCI_INTC_IRQ(IRQ_DM365_KEYINT), 631 + .end = DAVINCI_INTC_IRQ(IRQ_DM365_KEYINT), 633 632 .flags = IORESOURCE_IRQ, 634 633 }, 635 634 }; ··· 670 669 static struct plat_serial8250_port dm365_serial0_platform_data[] = { 671 670 { 672 671 .mapbase = DAVINCI_UART0_BASE, 673 - .irq = IRQ_UARTINT0, 672 + .irq = DAVINCI_INTC_IRQ(IRQ_UARTINT0), 674 673 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 675 674 UPF_IOREMAP, 676 675 .iotype = UPIO_MEM, ··· 683 682 static struct plat_serial8250_port dm365_serial1_platform_data[] = { 684 683 { 685 684 .mapbase = DM365_UART1_BASE, 686 - .irq = IRQ_UARTINT1, 685 + .irq = DAVINCI_INTC_IRQ(IRQ_UARTINT1), 687 686 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 688 687 UPF_IOREMAP, 689 688 .iotype = UPIO_MEM, ··· 722 721 .pinmux_base = DAVINCI_SYSTEM_MODULE_BASE, 723 722 .pinmux_pins = dm365_pins, 724 723 .pinmux_pins_num = ARRAY_SIZE(dm365_pins), 725 - .intc_base = DAVINCI_ARM_INTC_BASE, 726 - .intc_type = DAVINCI_INTC_TYPE_AINTC, 727 - .intc_irq_prios = dm365_default_priorities, 728 - .intc_irq_num = DAVINCI_N_AINTC_IRQ, 729 724 .timer_info = &dm365_timer_info, 730 725 .emac_pdata = &dm365_emac_pdata, 731 726 .sram_dma = 0x00010000, ··· 819 822 820 823 static struct resource vpfe_resources[] = { 821 824 { 822 - .start = IRQ_VDINT0, 823 - .end = IRQ_VDINT0, 825 + .start = DAVINCI_INTC_IRQ(IRQ_VDINT0), 826 + .end = DAVINCI_INTC_IRQ(IRQ_VDINT0), 824 827 .flags = IORESOURCE_IRQ, 825 828 }, 826 829 { 827 - .start = IRQ_VDINT1, 828 - .end = IRQ_VDINT1, 830 + .start = DAVINCI_INTC_IRQ(IRQ_VDINT1), 831 + .end = DAVINCI_INTC_IRQ(IRQ_VDINT1), 829 832 .flags = IORESOURCE_IRQ, 830 833 }, 831 834 }; ··· 906 909 907 910 static struct resource dm365_venc_resources[] = { 908 911 { 909 - .start = IRQ_VENCINT, 910 - .end = IRQ_VENCINT, 912 + .start = DAVINCI_INTC_IRQ(IRQ_VENCINT), 913 + .end = DAVINCI_INTC_IRQ(IRQ_VENCINT), 911 914 .flags = IORESOURCE_IRQ, 912 915 }, 913 916 /* venc registers io space */ ··· 926 929 927 930 static struct resource dm365_v4l2_disp_resources[] = { 928 931 { 929 - .start = IRQ_VENCINT, 930 - .end = IRQ_VENCINT, 932 + .start = DAVINCI_INTC_IRQ(IRQ_VENCINT), 933 + .end = DAVINCI_INTC_IRQ(IRQ_VENCINT), 931 934 .flags = IORESOURCE_IRQ, 932 935 }, 933 936 /* venc registers io space */ ··· 1047 1050 } 1048 1051 1049 1052 return 0; 1053 + } 1054 + 1055 + static const struct davinci_aintc_config dm365_aintc_config = { 1056 + .reg = { 1057 + .start = DAVINCI_ARM_INTC_BASE, 1058 + .end = DAVINCI_ARM_INTC_BASE + SZ_4K - 1, 1059 + .flags = IORESOURCE_MEM, 1060 + }, 1061 + .num_irqs = 64, 1062 + .prios = dm365_default_priorities, 1063 + }; 1064 + 1065 + void __init dm365_init_irq(void) 1066 + { 1067 + davinci_aintc_init(&dm365_aintc_config); 1050 1068 } 1051 1069 1052 1070 static int __init dm365_init_devices(void)
+40 -28
arch/arm/mach-davinci/dm644x.c
··· 14 14 #include <linux/clkdev.h> 15 15 #include <linux/dmaengine.h> 16 16 #include <linux/init.h> 17 + #include <linux/irqchip/irq-davinci-aintc.h> 17 18 #include <linux/platform_data/edma.h> 18 19 #include <linux/platform_data/gpio-davinci.h> 19 20 #include <linux/platform_device.h> ··· 24 23 25 24 #include <mach/common.h> 26 25 #include <mach/cputype.h> 27 - #include <mach/irqs.h> 28 26 #include <mach/mux.h> 29 27 #include <mach/serial.h> 30 28 #include <mach/time.h> 31 29 32 30 #include "asp.h" 33 31 #include "davinci.h" 32 + #include "irqs.h" 34 33 #include "mux.h" 35 34 36 35 /* ··· 60 59 .flags = IORESOURCE_MEM, 61 60 }, 62 61 { 63 - .start = IRQ_EMACINT, 64 - .end = IRQ_EMACINT, 62 + .start = DAVINCI_INTC_IRQ(IRQ_EMACINT), 63 + .end = DAVINCI_INTC_IRQ(IRQ_EMACINT), 65 64 .flags = IORESOURCE_IRQ, 66 65 }, 67 66 }; ··· 261 260 }, 262 261 { 263 262 .name = "edma3_ccint", 264 - .start = IRQ_CCINT0, 263 + .start = DAVINCI_INTC_IRQ(IRQ_CCINT0), 265 264 .flags = IORESOURCE_IRQ, 266 265 }, 267 266 { 268 267 .name = "edma3_ccerrint", 269 - .start = IRQ_CCERRINT, 268 + .start = DAVINCI_INTC_IRQ(IRQ_CCERRINT), 270 269 .flags = IORESOURCE_IRQ, 271 270 }, 272 271 /* not using TC*_ERR */ ··· 331 330 332 331 static struct resource dm644x_vpfe_resources[] = { 333 332 { 334 - .start = IRQ_VDINT0, 335 - .end = IRQ_VDINT0, 333 + .start = DAVINCI_INTC_IRQ(IRQ_VDINT0), 334 + .end = DAVINCI_INTC_IRQ(IRQ_VDINT0), 336 335 .flags = IORESOURCE_IRQ, 337 336 }, 338 337 { 339 - .start = IRQ_VDINT1, 340 - .end = IRQ_VDINT1, 338 + .start = DAVINCI_INTC_IRQ(IRQ_VDINT1), 339 + .end = DAVINCI_INTC_IRQ(IRQ_VDINT1), 341 340 .flags = IORESOURCE_IRQ, 342 341 }, 343 342 }; ··· 443 442 444 443 static struct resource dm644x_v4l2_disp_resources[] = { 445 444 { 446 - .start = IRQ_VENCINT, 447 - .end = IRQ_VENCINT, 445 + .start = DAVINCI_INTC_IRQ(IRQ_VENCINT), 446 + .end = DAVINCI_INTC_IRQ(IRQ_VENCINT), 448 447 .flags = IORESOURCE_IRQ, 449 448 }, 450 449 }; ··· 492 491 .flags = IORESOURCE_MEM, 493 492 }, 494 493 { /* interrupt */ 495 - .start = IRQ_GPIOBNK0, 496 - .end = IRQ_GPIOBNK0, 494 + .start = DAVINCI_INTC_IRQ(IRQ_GPIOBNK0), 495 + .end = DAVINCI_INTC_IRQ(IRQ_GPIOBNK0), 497 496 .flags = IORESOURCE_IRQ, 498 497 }, 499 498 { 500 - .start = IRQ_GPIOBNK1, 501 - .end = IRQ_GPIOBNK1, 499 + .start = DAVINCI_INTC_IRQ(IRQ_GPIOBNK1), 500 + .end = DAVINCI_INTC_IRQ(IRQ_GPIOBNK1), 502 501 .flags = IORESOURCE_IRQ, 503 502 }, 504 503 { 505 - .start = IRQ_GPIOBNK2, 506 - .end = IRQ_GPIOBNK2, 504 + .start = DAVINCI_INTC_IRQ(IRQ_GPIOBNK2), 505 + .end = DAVINCI_INTC_IRQ(IRQ_GPIOBNK2), 507 506 .flags = IORESOURCE_IRQ, 508 507 }, 509 508 { 510 - .start = IRQ_GPIOBNK3, 511 - .end = IRQ_GPIOBNK3, 509 + .start = DAVINCI_INTC_IRQ(IRQ_GPIOBNK3), 510 + .end = DAVINCI_INTC_IRQ(IRQ_GPIOBNK3), 512 511 .flags = IORESOURCE_IRQ, 513 512 }, 514 513 { 515 - .start = IRQ_GPIOBNK4, 516 - .end = IRQ_GPIOBNK4, 514 + .start = DAVINCI_INTC_IRQ(IRQ_GPIOBNK4), 515 + .end = DAVINCI_INTC_IRQ(IRQ_GPIOBNK4), 517 516 .flags = IORESOURCE_IRQ, 518 517 }, 519 518 }; ··· 574 573 static struct plat_serial8250_port dm644x_serial0_platform_data[] = { 575 574 { 576 575 .mapbase = DAVINCI_UART0_BASE, 577 - .irq = IRQ_UARTINT0, 576 + .irq = DAVINCI_INTC_IRQ(IRQ_UARTINT0), 578 577 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 579 578 UPF_IOREMAP, 580 579 .iotype = UPIO_MEM, ··· 587 586 static struct plat_serial8250_port dm644x_serial1_platform_data[] = { 588 587 { 589 588 .mapbase = DAVINCI_UART1_BASE, 590 - .irq = IRQ_UARTINT1, 589 + .irq = DAVINCI_INTC_IRQ(IRQ_UARTINT1), 591 590 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 592 591 UPF_IOREMAP, 593 592 .iotype = UPIO_MEM, ··· 600 599 static struct plat_serial8250_port dm644x_serial2_platform_data[] = { 601 600 { 602 601 .mapbase = DAVINCI_UART2_BASE, 603 - .irq = IRQ_UARTINT2, 602 + .irq = DAVINCI_INTC_IRQ(IRQ_UARTINT2), 604 603 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 605 604 UPF_IOREMAP, 606 605 .iotype = UPIO_MEM, ··· 646 645 .pinmux_base = DAVINCI_SYSTEM_MODULE_BASE, 647 646 .pinmux_pins = dm644x_pins, 648 647 .pinmux_pins_num = ARRAY_SIZE(dm644x_pins), 649 - .intc_base = DAVINCI_ARM_INTC_BASE, 650 - .intc_type = DAVINCI_INTC_TYPE_AINTC, 651 - .intc_irq_prios = dm644x_default_priorities, 652 - .intc_irq_num = DAVINCI_N_AINTC_IRQ, 653 648 .timer_info = &dm644x_timer_info, 654 649 .emac_pdata = &dm644x_emac_pdata, 655 650 .sram_dma = 0x00008000, ··· 724 727 } 725 728 726 729 return 0; 730 + } 731 + 732 + static const struct davinci_aintc_config dm644x_aintc_config = { 733 + .reg = { 734 + .start = DAVINCI_ARM_INTC_BASE, 735 + .end = DAVINCI_ARM_INTC_BASE + SZ_4K - 1, 736 + .flags = IORESOURCE_MEM, 737 + }, 738 + .num_irqs = 64, 739 + .prios = dm644x_default_priorities, 740 + }; 741 + 742 + void __init dm644x_init_irq(void) 743 + { 744 + davinci_aintc_init(&dm644x_aintc_config); 727 745 } 728 746 729 747 void __init dm644x_init_devices(void)
+47 -35
arch/arm/mach-davinci/dm646x.c
··· 15 15 #include <linux/dma-mapping.h> 16 16 #include <linux/dmaengine.h> 17 17 #include <linux/init.h> 18 + #include <linux/irqchip/irq-davinci-aintc.h> 18 19 #include <linux/platform_data/edma.h> 19 20 #include <linux/platform_data/gpio-davinci.h> 20 21 #include <linux/platform_device.h> ··· 25 24 26 25 #include <mach/common.h> 27 26 #include <mach/cputype.h> 28 - #include <mach/irqs.h> 29 27 #include <mach/mux.h> 30 28 #include <mach/serial.h> 31 29 #include <mach/time.h> 32 30 33 31 #include "asp.h" 34 32 #include "davinci.h" 33 + #include "irqs.h" 35 34 #include "mux.h" 36 35 37 36 #define DAVINCI_VPIF_BASE (0x01C12000) ··· 63 62 .flags = IORESOURCE_MEM, 64 63 }, 65 64 { 66 - .start = IRQ_DM646X_EMACRXTHINT, 67 - .end = IRQ_DM646X_EMACRXTHINT, 65 + .start = DAVINCI_INTC_IRQ(IRQ_DM646X_EMACRXTHINT), 66 + .end = DAVINCI_INTC_IRQ(IRQ_DM646X_EMACRXTHINT), 68 67 .flags = IORESOURCE_IRQ, 69 68 }, 70 69 { 71 - .start = IRQ_DM646X_EMACRXINT, 72 - .end = IRQ_DM646X_EMACRXINT, 70 + .start = DAVINCI_INTC_IRQ(IRQ_DM646X_EMACRXINT), 71 + .end = DAVINCI_INTC_IRQ(IRQ_DM646X_EMACRXINT), 73 72 .flags = IORESOURCE_IRQ, 74 73 }, 75 74 { 76 - .start = IRQ_DM646X_EMACTXINT, 77 - .end = IRQ_DM646X_EMACTXINT, 75 + .start = DAVINCI_INTC_IRQ(IRQ_DM646X_EMACTXINT), 76 + .end = DAVINCI_INTC_IRQ(IRQ_DM646X_EMACTXINT), 78 77 .flags = IORESOURCE_IRQ, 79 78 }, 80 79 { 81 - .start = IRQ_DM646X_EMACMISCINT, 82 - .end = IRQ_DM646X_EMACMISCINT, 80 + .start = DAVINCI_INTC_IRQ(IRQ_DM646X_EMACMISCINT), 81 + .end = DAVINCI_INTC_IRQ(IRQ_DM646X_EMACMISCINT), 83 82 .flags = IORESOURCE_IRQ, 84 83 }, 85 84 }; ··· 274 273 }, 275 274 { 276 275 .name = "edma3_ccint", 277 - .start = IRQ_CCINT0, 276 + .start = DAVINCI_INTC_IRQ(IRQ_CCINT0), 278 277 .flags = IORESOURCE_IRQ, 279 278 }, 280 279 { 281 280 .name = "edma3_ccerrint", 282 - .start = IRQ_CCERRINT, 281 + .start = DAVINCI_INTC_IRQ(IRQ_CCERRINT), 283 282 .flags = IORESOURCE_IRQ, 284 283 }, 285 284 /* not using TC*_ERR */ ··· 316 315 }, 317 316 { 318 317 .name = "tx", 319 - .start = IRQ_DM646X_MCASP0TXINT, 318 + .start = DAVINCI_INTC_IRQ(IRQ_DM646X_MCASP0TXINT), 320 319 .flags = IORESOURCE_IRQ, 321 320 }, 322 321 { 323 322 .name = "rx", 324 - .start = IRQ_DM646X_MCASP0RXINT, 323 + .start = DAVINCI_INTC_IRQ(IRQ_DM646X_MCASP0RXINT), 325 324 .flags = IORESOURCE_IRQ, 326 325 }, 327 326 }; ··· 342 341 }, 343 342 { 344 343 .name = "tx", 345 - .start = IRQ_DM646X_MCASP1TXINT, 344 + .start = DAVINCI_INTC_IRQ(IRQ_DM646X_MCASP1TXINT), 346 345 .flags = IORESOURCE_IRQ, 347 346 }, 348 347 }; ··· 389 388 390 389 static struct resource vpif_display_resource[] = { 391 390 { 392 - .start = IRQ_DM646X_VP_VERTINT2, 393 - .end = IRQ_DM646X_VP_VERTINT2, 391 + .start = DAVINCI_INTC_IRQ(IRQ_DM646X_VP_VERTINT2), 392 + .end = DAVINCI_INTC_IRQ(IRQ_DM646X_VP_VERTINT2), 394 393 .flags = IORESOURCE_IRQ, 395 394 }, 396 395 { 397 - .start = IRQ_DM646X_VP_VERTINT3, 398 - .end = IRQ_DM646X_VP_VERTINT3, 396 + .start = DAVINCI_INTC_IRQ(IRQ_DM646X_VP_VERTINT3), 397 + .end = DAVINCI_INTC_IRQ(IRQ_DM646X_VP_VERTINT3), 399 398 .flags = IORESOURCE_IRQ, 400 399 }, 401 400 }; ··· 413 412 414 413 static struct resource vpif_capture_resource[] = { 415 414 { 416 - .start = IRQ_DM646X_VP_VERTINT0, 417 - .end = IRQ_DM646X_VP_VERTINT0, 415 + .start = DAVINCI_INTC_IRQ(IRQ_DM646X_VP_VERTINT0), 416 + .end = DAVINCI_INTC_IRQ(IRQ_DM646X_VP_VERTINT0), 418 417 .flags = IORESOURCE_IRQ, 419 418 }, 420 419 { 421 - .start = IRQ_DM646X_VP_VERTINT1, 422 - .end = IRQ_DM646X_VP_VERTINT1, 420 + .start = DAVINCI_INTC_IRQ(IRQ_DM646X_VP_VERTINT1), 421 + .end = DAVINCI_INTC_IRQ(IRQ_DM646X_VP_VERTINT1), 423 422 .flags = IORESOURCE_IRQ, 424 423 }, 425 424 }; ··· 442 441 .flags = IORESOURCE_MEM, 443 442 }, 444 443 { /* interrupt */ 445 - .start = IRQ_DM646X_GPIOBNK0, 446 - .end = IRQ_DM646X_GPIOBNK0, 444 + .start = DAVINCI_INTC_IRQ(IRQ_DM646X_GPIOBNK0), 445 + .end = DAVINCI_INTC_IRQ(IRQ_DM646X_GPIOBNK0), 447 446 .flags = IORESOURCE_IRQ, 448 447 }, 449 448 { 450 - .start = IRQ_DM646X_GPIOBNK1, 451 - .end = IRQ_DM646X_GPIOBNK1, 449 + .start = DAVINCI_INTC_IRQ(IRQ_DM646X_GPIOBNK1), 450 + .end = DAVINCI_INTC_IRQ(IRQ_DM646X_GPIOBNK1), 452 451 .flags = IORESOURCE_IRQ, 453 452 }, 454 453 { 455 - .start = IRQ_DM646X_GPIOBNK2, 456 - .end = IRQ_DM646X_GPIOBNK2, 454 + .start = DAVINCI_INTC_IRQ(IRQ_DM646X_GPIOBNK2), 455 + .end = DAVINCI_INTC_IRQ(IRQ_DM646X_GPIOBNK2), 457 456 .flags = IORESOURCE_IRQ, 458 457 }, 459 458 }; ··· 514 513 static struct plat_serial8250_port dm646x_serial0_platform_data[] = { 515 514 { 516 515 .mapbase = DAVINCI_UART0_BASE, 517 - .irq = IRQ_UARTINT0, 516 + .irq = DAVINCI_INTC_IRQ(IRQ_UARTINT0), 518 517 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 519 518 UPF_IOREMAP, 520 519 .iotype = UPIO_MEM32, ··· 527 526 static struct plat_serial8250_port dm646x_serial1_platform_data[] = { 528 527 { 529 528 .mapbase = DAVINCI_UART1_BASE, 530 - .irq = IRQ_UARTINT1, 529 + .irq = DAVINCI_INTC_IRQ(IRQ_UARTINT1), 531 530 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 532 531 UPF_IOREMAP, 533 532 .iotype = UPIO_MEM32, ··· 540 539 static struct plat_serial8250_port dm646x_serial2_platform_data[] = { 541 540 { 542 541 .mapbase = DAVINCI_UART2_BASE, 543 - .irq = IRQ_DM646X_UARTINT2, 542 + .irq = DAVINCI_INTC_IRQ(IRQ_DM646X_UARTINT2), 544 543 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 545 544 UPF_IOREMAP, 546 545 .iotype = UPIO_MEM32, ··· 586 585 .pinmux_base = DAVINCI_SYSTEM_MODULE_BASE, 587 586 .pinmux_pins = dm646x_pins, 588 587 .pinmux_pins_num = ARRAY_SIZE(dm646x_pins), 589 - .intc_base = DAVINCI_ARM_INTC_BASE, 590 - .intc_type = DAVINCI_INTC_TYPE_AINTC, 591 - .intc_irq_prios = dm646x_default_priorities, 592 - .intc_irq_num = DAVINCI_N_AINTC_IRQ, 593 588 .timer_info = &dm646x_timer_info, 594 589 .emac_pdata = &dm646x_emac_pdata, 595 590 .sram_dma = 0x10010000, ··· 685 688 { 686 689 /* PLL1 and PSC are registered in dm646x_init_time() */ 687 690 platform_device_register(&dm646x_pll2_device); 691 + } 692 + 693 + static const struct davinci_aintc_config dm646x_aintc_config = { 694 + .reg = { 695 + .start = DAVINCI_ARM_INTC_BASE, 696 + .end = DAVINCI_ARM_INTC_BASE + SZ_4K - 1, 697 + .flags = IORESOURCE_MEM, 698 + }, 699 + .num_irqs = 64, 700 + .prios = dm646x_default_priorities, 701 + }; 702 + 703 + void __init dm646x_init_irq(void) 704 + { 705 + davinci_aintc_init(&dm646x_aintc_config); 688 706 } 689 707 690 708 static int __init dm646x_init_devices(void)
+5 -9
arch/arm/mach-davinci/include/mach/common.h
··· 17 17 #include <linux/types.h> 18 18 #include <linux/reboot.h> 19 19 20 - void davinci_timer_init(struct clk *clk); 20 + #include <asm/irq.h> 21 21 22 - extern void davinci_irq_init(void); 23 - extern void __iomem *davinci_intc_base; 24 - extern int davinci_intc_type; 22 + #define DAVINCI_INTC_START NR_IRQS 23 + #define DAVINCI_INTC_IRQ(_irqnum) (DAVINCI_INTC_START + (_irqnum)) 24 + 25 + void davinci_timer_init(struct clk *clk); 25 26 26 27 struct davinci_timer_instance { 27 28 u32 base; ··· 58 57 u32 pinmux_base; 59 58 const struct mux_config *pinmux_pins; 60 59 unsigned long pinmux_pins_num; 61 - u32 intc_base; 62 - int intc_type; 63 - u8 *intc_irq_prios; 64 - unsigned long intc_irq_num; 65 - u32 *intc_host_map; 66 60 struct davinci_timer_info *timer_info; 67 61 int gpio_type; 68 62 u32 gpio_base;
+2
arch/arm/mach-davinci/include/mach/da8xx.h
··· 88 88 #define DA8XX_ARM_RAM_BASE 0xffff0000 89 89 90 90 void da830_init(void); 91 + void da830_init_irq(void); 91 92 void da830_init_time(void); 92 93 void da830_register_clocks(void); 93 94 94 95 void da850_init(void); 96 + void da850_init_irq(void); 95 97 void da850_init_time(void); 96 98 void da850_register_clocks(void); 97 99
-39
arch/arm/mach-davinci/include/mach/entry-macro.S
··· 1 - /* 2 - * Low-level IRQ helper macros for TI DaVinci-based platforms 3 - * 4 - * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com> 5 - * 6 - * 2007 (c) MontaVista Software, Inc. This file is licensed under 7 - * the terms of the GNU General Public License version 2. This program 8 - * is licensed "as is" without any warranty of any kind, whether express 9 - * or implied. 10 - */ 11 - #include <mach/irqs.h> 12 - 13 - .macro get_irqnr_preamble, base, tmp 14 - ldr \base, =davinci_intc_base 15 - ldr \base, [\base] 16 - .endm 17 - 18 - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 19 - #if defined(CONFIG_AINTC) && defined(CONFIG_CP_INTC) 20 - ldr \tmp, =davinci_intc_type 21 - ldr \tmp, [\tmp] 22 - cmp \tmp, #DAVINCI_INTC_TYPE_CP_INTC 23 - beq 1001f 24 - #endif 25 - #if defined(CONFIG_AINTC) 26 - ldr \tmp, [\base, #0x14] 27 - movs \tmp, \tmp, lsr #2 28 - sub \irqnr, \tmp, #1 29 - b 1002f 30 - #endif 31 - #if defined(CONFIG_CP_INTC) 32 - 1001: ldr \irqnr, [\base, #0x80] /* get irq number */ 33 - mov \tmp, \irqnr, lsr #31 34 - and \irqnr, \irqnr, #0xff /* irq is in bits 0-9 */ 35 - and \tmp, \tmp, #0x1 36 - cmp \tmp, #0x1 37 - #endif 38 - 1002: 39 - .endm
-4
arch/arm/mach-davinci/include/mach/irqs.h arch/arm/mach-davinci/irqs.h
··· 30 30 /* Base address */ 31 31 #define DAVINCI_ARM_INTC_BASE 0x01C48000 32 32 33 - #define DAVINCI_INTC_TYPE_AINTC 0 34 - #define DAVINCI_INTC_TYPE_CP_INTC 1 35 - 36 33 /* Interrupt lines */ 37 34 #define IRQ_VDINT0 0 38 35 #define IRQ_VDINT1 1 ··· 401 404 /* da850 currently has the most gpio pins (144) */ 402 405 #define DAVINCI_N_GPIO 144 403 406 /* da850 currently has the most irqs so use DA850_N_CP_INTC_IRQ */ 404 - #define NR_IRQS (DA850_N_CP_INTC_IRQ + DAVINCI_N_GPIO) 405 407 406 408 #endif /* __ASM_ARCH_IRQS_H */
-117
arch/arm/mach-davinci/irq.c
··· 1 - /* 2 - * Interrupt handler for DaVinci boards. 3 - * 4 - * Copyright (C) 2006 Texas Instruments. 5 - * 6 - * This program is free software; you can redistribute it and/or modify 7 - * it under the terms of the GNU General Public License as published by 8 - * the Free Software Foundation; either version 2 of the License, or 9 - * (at your option) any later version. 10 - * 11 - * This program is distributed in the hope that it will be useful, 12 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 - * GNU General Public License for more details. 15 - * 16 - * You should have received a copy of the GNU General Public License 17 - * along with this program; if not, write to the Free Software 18 - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 - * 20 - */ 21 - #include <linux/kernel.h> 22 - #include <linux/init.h> 23 - #include <linux/interrupt.h> 24 - #include <linux/irq.h> 25 - #include <linux/io.h> 26 - 27 - #include <mach/hardware.h> 28 - #include <mach/cputype.h> 29 - #include <mach/common.h> 30 - #include <asm/mach/irq.h> 31 - 32 - #define FIQ_REG0_OFFSET 0x0000 33 - #define FIQ_REG1_OFFSET 0x0004 34 - #define IRQ_REG0_OFFSET 0x0008 35 - #define IRQ_REG1_OFFSET 0x000C 36 - #define IRQ_ENT_REG0_OFFSET 0x0018 37 - #define IRQ_ENT_REG1_OFFSET 0x001C 38 - #define IRQ_INCTL_REG_OFFSET 0x0020 39 - #define IRQ_EABASE_REG_OFFSET 0x0024 40 - #define IRQ_INTPRI0_REG_OFFSET 0x0030 41 - #define IRQ_INTPRI7_REG_OFFSET 0x004C 42 - 43 - static inline void davinci_irq_writel(unsigned long value, int offset) 44 - { 45 - __raw_writel(value, davinci_intc_base + offset); 46 - } 47 - 48 - static __init void 49 - davinci_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num) 50 - { 51 - struct irq_chip_generic *gc; 52 - struct irq_chip_type *ct; 53 - 54 - gc = irq_alloc_generic_chip("AINTC", 1, irq_start, base, handle_edge_irq); 55 - if (!gc) { 56 - pr_err("%s: irq_alloc_generic_chip for IRQ %u failed\n", 57 - __func__, irq_start); 58 - return; 59 - } 60 - 61 - ct = gc->chip_types; 62 - ct->chip.irq_ack = irq_gc_ack_set_bit; 63 - ct->chip.irq_mask = irq_gc_mask_clr_bit; 64 - ct->chip.irq_unmask = irq_gc_mask_set_bit; 65 - 66 - ct->regs.ack = IRQ_REG0_OFFSET; 67 - ct->regs.mask = IRQ_ENT_REG0_OFFSET; 68 - irq_setup_generic_chip(gc, IRQ_MSK(num), IRQ_GC_INIT_MASK_CACHE, 69 - IRQ_NOREQUEST | IRQ_NOPROBE, 0); 70 - } 71 - 72 - /* ARM Interrupt Controller Initialization */ 73 - void __init davinci_irq_init(void) 74 - { 75 - unsigned i, j; 76 - const u8 *davinci_def_priorities = davinci_soc_info.intc_irq_prios; 77 - 78 - davinci_intc_type = DAVINCI_INTC_TYPE_AINTC; 79 - davinci_intc_base = ioremap(davinci_soc_info.intc_base, SZ_4K); 80 - if (WARN_ON(!davinci_intc_base)) 81 - return; 82 - 83 - /* Clear all interrupt requests */ 84 - davinci_irq_writel(~0x0, FIQ_REG0_OFFSET); 85 - davinci_irq_writel(~0x0, FIQ_REG1_OFFSET); 86 - davinci_irq_writel(~0x0, IRQ_REG0_OFFSET); 87 - davinci_irq_writel(~0x0, IRQ_REG1_OFFSET); 88 - 89 - /* Disable all interrupts */ 90 - davinci_irq_writel(0x0, IRQ_ENT_REG0_OFFSET); 91 - davinci_irq_writel(0x0, IRQ_ENT_REG1_OFFSET); 92 - 93 - /* Interrupts disabled immediately, IRQ entry reflects all */ 94 - davinci_irq_writel(0x0, IRQ_INCTL_REG_OFFSET); 95 - 96 - /* we don't use the hardware vector table, just its entry addresses */ 97 - davinci_irq_writel(0, IRQ_EABASE_REG_OFFSET); 98 - 99 - /* Clear all interrupt requests */ 100 - davinci_irq_writel(~0x0, FIQ_REG0_OFFSET); 101 - davinci_irq_writel(~0x0, FIQ_REG1_OFFSET); 102 - davinci_irq_writel(~0x0, IRQ_REG0_OFFSET); 103 - davinci_irq_writel(~0x0, IRQ_REG1_OFFSET); 104 - 105 - for (i = IRQ_INTPRI0_REG_OFFSET; i <= IRQ_INTPRI7_REG_OFFSET; i += 4) { 106 - u32 pri; 107 - 108 - for (j = 0, pri = 0; j < 32; j += 4, davinci_def_priorities++) 109 - pri |= (*davinci_def_priorities & 0x07) << j; 110 - davinci_irq_writel(pri, i); 111 - } 112 - 113 - for (i = 0, j = 0; i < davinci_soc_info.intc_irq_num; i += 32, j += 0x04) 114 - davinci_alloc_gc(davinci_intc_base + j, i, 32); 115 - 116 - irq_set_handler(IRQ_TINT1_TINT34, handle_level_irq); 117 - }
+5 -4
arch/arm/mach-davinci/usb-da8xx.c
··· 18 18 #include <mach/common.h> 19 19 #include <mach/cputype.h> 20 20 #include <mach/da8xx.h> 21 - #include <mach/irqs.h> 21 + 22 + #include "irqs.h" 22 23 23 24 #define DA8XX_USB0_BASE 0x01e00000 24 25 #define DA8XX_USB1_BASE 0x01e25000 ··· 71 70 .flags = IORESOURCE_MEM, 72 71 }, 73 72 { 74 - .start = IRQ_DA8XX_USB_INT, 73 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_USB_INT), 75 74 .flags = IORESOURCE_IRQ, 76 75 .name = "mc", 77 76 }, ··· 106 105 .flags = IORESOURCE_MEM, 107 106 }, 108 107 [1] = { 109 - .start = IRQ_DA8XX_IRQN, 110 - .end = IRQ_DA8XX_IRQN, 108 + .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_IRQN), 109 + .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_IRQN), 111 110 .flags = IORESOURCE_IRQ, 112 111 }, 113 112 };
+8 -7
arch/arm/mach-davinci/usb.c
··· 2 2 /* 3 3 * USB 4 4 */ 5 + #include <linux/dma-mapping.h> 5 6 #include <linux/init.h> 6 7 #include <linux/platform_device.h> 7 - #include <linux/dma-mapping.h> 8 - 8 + #include <linux/platform_data/usb-davinci.h> 9 9 #include <linux/usb/musb.h> 10 10 11 11 #include <mach/common.h> 12 - #include <mach/irqs.h> 13 12 #include <mach/cputype.h> 14 - #include <linux/platform_data/usb-davinci.h> 13 + 14 + #include "irqs.h" 15 15 16 16 #define DAVINCI_USB_OTG_BASE 0x01c64000 17 17 ··· 38 38 .flags = IORESOURCE_MEM, 39 39 }, 40 40 { 41 - .start = IRQ_USBINT, 41 + .start = DAVINCI_INTC_IRQ(IRQ_USBINT), 42 42 .flags = IORESOURCE_IRQ, 43 43 .name = "mc" 44 44 }, ··· 70 70 71 71 if (cpu_is_davinci_dm646x()) { 72 72 /* Override the defaults as DM6467 uses different IRQs. */ 73 - usb_dev.resource[1].start = IRQ_DM646X_USBINT; 74 - usb_dev.resource[2].start = IRQ_DM646X_USBDMAINT; 73 + usb_dev.resource[1].start = DAVINCI_INTC_IRQ(IRQ_DM646X_USBINT); 74 + usb_dev.resource[2].start = DAVINCI_INTC_IRQ( 75 + IRQ_DM646X_USBDMAINT); 75 76 } else /* other devices don't have dedicated CPPI IRQ */ 76 77 usb_dev.num_resources = 2; 77 78
-4
drivers/input/keyboard/davinci_keyscan.c
··· 32 32 #include <linux/errno.h> 33 33 #include <linux/slab.h> 34 34 35 - #include <asm/irq.h> 36 - 37 - #include <mach/hardware.h> 38 - #include <mach/irqs.h> 39 35 #include <linux/platform_data/keyscan-davinci.h> 40 36 41 37 /* Key scan registers */
+10
drivers/irqchip/Kconfig
··· 129 129 select GENERIC_IRQ_CHIP 130 130 select IRQ_DOMAIN 131 131 132 + config DAVINCI_AINTC 133 + bool 134 + select GENERIC_IRQ_CHIP 135 + select IRQ_DOMAIN 136 + 137 + config DAVINCI_CP_INTC 138 + bool 139 + select GENERIC_IRQ_CHIP 140 + select IRQ_DOMAIN 141 + 132 142 config DW_APB_ICTL 133 143 bool 134 144 select GENERIC_IRQ_CHIP
+2
drivers/irqchip/Makefile
··· 6 6 obj-$(CONFIG_ATH79) += irq-ath79-misc.o 7 7 obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o 8 8 obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2836.o 9 + obj-$(CONFIG_DAVINCI_AINTC) += irq-davinci-aintc.o 10 + obj-$(CONFIG_DAVINCI_CP_INTC) += irq-davinci-cp-intc.o 9 11 obj-$(CONFIG_ARCH_EXYNOS) += exynos-combiner.o 10 12 obj-$(CONFIG_FARADAY_FTINTC010) += irq-ftintc010.o 11 13 obj-$(CONFIG_ARCH_HIP04) += irq-hip04.o
+163
drivers/irqchip/irq-davinci-aintc.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-or-later 2 + // 3 + // Copyright (C) 2006, 2019 Texas Instruments. 4 + // 5 + // Interrupt handler for DaVinci boards. 6 + 7 + #include <linux/kernel.h> 8 + #include <linux/init.h> 9 + #include <linux/interrupt.h> 10 + #include <linux/irq.h> 11 + #include <linux/irqchip/irq-davinci-aintc.h> 12 + #include <linux/io.h> 13 + #include <linux/irqdomain.h> 14 + 15 + #include <asm/exception.h> 16 + 17 + #define DAVINCI_AINTC_FIQ_REG0 0x00 18 + #define DAVINCI_AINTC_FIQ_REG1 0x04 19 + #define DAVINCI_AINTC_IRQ_REG0 0x08 20 + #define DAVINCI_AINTC_IRQ_REG1 0x0c 21 + #define DAVINCI_AINTC_IRQ_IRQENTRY 0x14 22 + #define DAVINCI_AINTC_IRQ_ENT_REG0 0x18 23 + #define DAVINCI_AINTC_IRQ_ENT_REG1 0x1c 24 + #define DAVINCI_AINTC_IRQ_INCTL_REG 0x20 25 + #define DAVINCI_AINTC_IRQ_EABASE_REG 0x24 26 + #define DAVINCI_AINTC_IRQ_INTPRI0_REG 0x30 27 + #define DAVINCI_AINTC_IRQ_INTPRI7_REG 0x4c 28 + 29 + static void __iomem *davinci_aintc_base; 30 + static struct irq_domain *davinci_aintc_irq_domain; 31 + 32 + static inline void davinci_aintc_writel(unsigned long value, int offset) 33 + { 34 + writel_relaxed(value, davinci_aintc_base + offset); 35 + } 36 + 37 + static inline unsigned long davinci_aintc_readl(int offset) 38 + { 39 + return readl_relaxed(davinci_aintc_base + offset); 40 + } 41 + 42 + static __init void 43 + davinci_aintc_setup_gc(void __iomem *base, 44 + unsigned int irq_start, unsigned int num) 45 + { 46 + struct irq_chip_generic *gc; 47 + struct irq_chip_type *ct; 48 + 49 + gc = irq_get_domain_generic_chip(davinci_aintc_irq_domain, irq_start); 50 + gc->reg_base = base; 51 + gc->irq_base = irq_start; 52 + 53 + ct = gc->chip_types; 54 + ct->chip.irq_ack = irq_gc_ack_set_bit; 55 + ct->chip.irq_mask = irq_gc_mask_clr_bit; 56 + ct->chip.irq_unmask = irq_gc_mask_set_bit; 57 + 58 + ct->regs.ack = DAVINCI_AINTC_IRQ_REG0; 59 + ct->regs.mask = DAVINCI_AINTC_IRQ_ENT_REG0; 60 + irq_setup_generic_chip(gc, IRQ_MSK(num), IRQ_GC_INIT_MASK_CACHE, 61 + IRQ_NOREQUEST | IRQ_NOPROBE, 0); 62 + } 63 + 64 + static asmlinkage void __exception_irq_entry 65 + davinci_aintc_handle_irq(struct pt_regs *regs) 66 + { 67 + int irqnr = davinci_aintc_readl(DAVINCI_AINTC_IRQ_IRQENTRY); 68 + 69 + /* 70 + * Use the formula for entry vector index generation from section 71 + * 8.3.3 of the manual. 72 + */ 73 + irqnr >>= 2; 74 + irqnr -= 1; 75 + 76 + handle_domain_irq(davinci_aintc_irq_domain, irqnr, regs); 77 + } 78 + 79 + /* ARM Interrupt Controller Initialization */ 80 + void __init davinci_aintc_init(const struct davinci_aintc_config *config) 81 + { 82 + unsigned int irq_off, reg_off, prio, shift; 83 + void __iomem *req; 84 + int ret, irq_base; 85 + const u8 *prios; 86 + 87 + req = request_mem_region(config->reg.start, 88 + resource_size(&config->reg), 89 + "davinci-cp-intc"); 90 + if (!req) { 91 + pr_err("%s: register range busy\n", __func__); 92 + return; 93 + } 94 + 95 + davinci_aintc_base = ioremap(config->reg.start, 96 + resource_size(&config->reg)); 97 + if (!davinci_aintc_base) { 98 + pr_err("%s: unable to ioremap register range\n", __func__); 99 + return; 100 + } 101 + 102 + /* Clear all interrupt requests */ 103 + davinci_aintc_writel(~0x0, DAVINCI_AINTC_FIQ_REG0); 104 + davinci_aintc_writel(~0x0, DAVINCI_AINTC_FIQ_REG1); 105 + davinci_aintc_writel(~0x0, DAVINCI_AINTC_IRQ_REG0); 106 + davinci_aintc_writel(~0x0, DAVINCI_AINTC_IRQ_REG1); 107 + 108 + /* Disable all interrupts */ 109 + davinci_aintc_writel(0x0, DAVINCI_AINTC_IRQ_ENT_REG0); 110 + davinci_aintc_writel(0x0, DAVINCI_AINTC_IRQ_ENT_REG1); 111 + 112 + /* Interrupts disabled immediately, IRQ entry reflects all */ 113 + davinci_aintc_writel(0x0, DAVINCI_AINTC_IRQ_INCTL_REG); 114 + 115 + /* we don't use the hardware vector table, just its entry addresses */ 116 + davinci_aintc_writel(0, DAVINCI_AINTC_IRQ_EABASE_REG); 117 + 118 + /* Clear all interrupt requests */ 119 + davinci_aintc_writel(~0x0, DAVINCI_AINTC_FIQ_REG0); 120 + davinci_aintc_writel(~0x0, DAVINCI_AINTC_FIQ_REG1); 121 + davinci_aintc_writel(~0x0, DAVINCI_AINTC_IRQ_REG0); 122 + davinci_aintc_writel(~0x0, DAVINCI_AINTC_IRQ_REG1); 123 + 124 + prios = config->prios; 125 + for (reg_off = DAVINCI_AINTC_IRQ_INTPRI0_REG; 126 + reg_off <= DAVINCI_AINTC_IRQ_INTPRI7_REG; reg_off += 4) { 127 + for (shift = 0, prio = 0; shift < 32; shift += 4, prios++) 128 + prio |= (*prios & 0x07) << shift; 129 + davinci_aintc_writel(prio, reg_off); 130 + } 131 + 132 + irq_base = irq_alloc_descs(-1, 0, config->num_irqs, 0); 133 + if (irq_base < 0) { 134 + pr_err("%s: unable to allocate interrupt descriptors: %d\n", 135 + __func__, irq_base); 136 + return; 137 + } 138 + 139 + davinci_aintc_irq_domain = irq_domain_add_legacy(NULL, 140 + config->num_irqs, irq_base, 0, 141 + &irq_domain_simple_ops, NULL); 142 + if (!davinci_aintc_irq_domain) { 143 + pr_err("%s: unable to create interrupt domain\n", __func__); 144 + return; 145 + } 146 + 147 + ret = irq_alloc_domain_generic_chips(davinci_aintc_irq_domain, 32, 1, 148 + "AINTC", handle_edge_irq, 149 + IRQ_NOREQUEST | IRQ_NOPROBE, 0, 0); 150 + if (ret) { 151 + pr_err("%s: unable to allocate generic irq chips for domain\n", 152 + __func__); 153 + return; 154 + } 155 + 156 + for (irq_off = 0, reg_off = 0; 157 + irq_off < config->num_irqs; 158 + irq_off += 32, reg_off += 0x04) 159 + davinci_aintc_setup_gc(davinci_aintc_base + reg_off, 160 + irq_base + irq_off, 32); 161 + 162 + set_handle_irq(davinci_aintc_handle_irq); 163 + }
+260
drivers/irqchip/irq-davinci-cp-intc.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + // 3 + // Author: Steve Chen <schen@mvista.com> 4 + // Copyright (C) 2008-2009, MontaVista Software, Inc. <source@mvista.com> 5 + // Author: Bartosz Golaszewski <bgolaszewski@baylibre.com> 6 + // Copyright (C) 2019, Texas Instruments 7 + // 8 + // TI Common Platform Interrupt Controller (cp_intc) driver 9 + 10 + #include <linux/export.h> 11 + #include <linux/init.h> 12 + #include <linux/irq.h> 13 + #include <linux/irqchip.h> 14 + #include <linux/irqchip/irq-davinci-cp-intc.h> 15 + #include <linux/irqdomain.h> 16 + #include <linux/io.h> 17 + #include <linux/of.h> 18 + #include <linux/of_address.h> 19 + #include <linux/of_irq.h> 20 + 21 + #include <asm/exception.h> 22 + 23 + #define DAVINCI_CP_INTC_CTRL 0x04 24 + #define DAVINCI_CP_INTC_HOST_CTRL 0x0c 25 + #define DAVINCI_CP_INTC_GLOBAL_ENABLE 0x10 26 + #define DAVINCI_CP_INTC_SYS_STAT_IDX_CLR 0x24 27 + #define DAVINCI_CP_INTC_SYS_ENABLE_IDX_SET 0x28 28 + #define DAVINCI_CP_INTC_SYS_ENABLE_IDX_CLR 0x2c 29 + #define DAVINCI_CP_INTC_HOST_ENABLE_IDX_SET 0x34 30 + #define DAVINCI_CP_INTC_HOST_ENABLE_IDX_CLR 0x38 31 + #define DAVINCI_CP_INTC_PRIO_IDX 0x80 32 + #define DAVINCI_CP_INTC_SYS_STAT_CLR(n) (0x0280 + (n << 2)) 33 + #define DAVINCI_CP_INTC_SYS_ENABLE_CLR(n) (0x0380 + (n << 2)) 34 + #define DAVINCI_CP_INTC_CHAN_MAP(n) (0x0400 + (n << 2)) 35 + #define DAVINCI_CP_INTC_SYS_POLARITY(n) (0x0d00 + (n << 2)) 36 + #define DAVINCI_CP_INTC_SYS_TYPE(n) (0x0d80 + (n << 2)) 37 + #define DAVINCI_CP_INTC_HOST_ENABLE(n) (0x1500 + (n << 2)) 38 + #define DAVINCI_CP_INTC_PRI_INDX_MASK GENMASK(9, 0) 39 + #define DAVINCI_CP_INTC_GPIR_NONE BIT(31) 40 + 41 + static void __iomem *davinci_cp_intc_base; 42 + static struct irq_domain *davinci_cp_intc_irq_domain; 43 + 44 + static inline unsigned int davinci_cp_intc_read(unsigned int offset) 45 + { 46 + return readl_relaxed(davinci_cp_intc_base + offset); 47 + } 48 + 49 + static inline void davinci_cp_intc_write(unsigned long value, 50 + unsigned int offset) 51 + { 52 + writel_relaxed(value, davinci_cp_intc_base + offset); 53 + } 54 + 55 + static void davinci_cp_intc_ack_irq(struct irq_data *d) 56 + { 57 + davinci_cp_intc_write(d->hwirq, DAVINCI_CP_INTC_SYS_STAT_IDX_CLR); 58 + } 59 + 60 + static void davinci_cp_intc_mask_irq(struct irq_data *d) 61 + { 62 + /* XXX don't know why we need to disable nIRQ here... */ 63 + davinci_cp_intc_write(1, DAVINCI_CP_INTC_HOST_ENABLE_IDX_CLR); 64 + davinci_cp_intc_write(d->hwirq, DAVINCI_CP_INTC_SYS_ENABLE_IDX_CLR); 65 + davinci_cp_intc_write(1, DAVINCI_CP_INTC_HOST_ENABLE_IDX_SET); 66 + } 67 + 68 + static void davinci_cp_intc_unmask_irq(struct irq_data *d) 69 + { 70 + davinci_cp_intc_write(d->hwirq, DAVINCI_CP_INTC_SYS_ENABLE_IDX_SET); 71 + } 72 + 73 + static int davinci_cp_intc_set_irq_type(struct irq_data *d, 74 + unsigned int flow_type) 75 + { 76 + unsigned int reg, mask, polarity, type; 77 + 78 + reg = BIT_WORD(d->hwirq); 79 + mask = BIT_MASK(d->hwirq); 80 + polarity = davinci_cp_intc_read(DAVINCI_CP_INTC_SYS_POLARITY(reg)); 81 + type = davinci_cp_intc_read(DAVINCI_CP_INTC_SYS_TYPE(reg)); 82 + 83 + switch (flow_type) { 84 + case IRQ_TYPE_EDGE_RISING: 85 + polarity |= mask; 86 + type |= mask; 87 + break; 88 + case IRQ_TYPE_EDGE_FALLING: 89 + polarity &= ~mask; 90 + type |= mask; 91 + break; 92 + case IRQ_TYPE_LEVEL_HIGH: 93 + polarity |= mask; 94 + type &= ~mask; 95 + break; 96 + case IRQ_TYPE_LEVEL_LOW: 97 + polarity &= ~mask; 98 + type &= ~mask; 99 + break; 100 + default: 101 + return -EINVAL; 102 + } 103 + 104 + davinci_cp_intc_write(polarity, DAVINCI_CP_INTC_SYS_POLARITY(reg)); 105 + davinci_cp_intc_write(type, DAVINCI_CP_INTC_SYS_TYPE(reg)); 106 + 107 + return 0; 108 + } 109 + 110 + static struct irq_chip davinci_cp_intc_irq_chip = { 111 + .name = "cp_intc", 112 + .irq_ack = davinci_cp_intc_ack_irq, 113 + .irq_mask = davinci_cp_intc_mask_irq, 114 + .irq_unmask = davinci_cp_intc_unmask_irq, 115 + .irq_set_type = davinci_cp_intc_set_irq_type, 116 + .flags = IRQCHIP_SKIP_SET_WAKE, 117 + }; 118 + 119 + static asmlinkage void __exception_irq_entry 120 + davinci_cp_intc_handle_irq(struct pt_regs *regs) 121 + { 122 + int gpir, irqnr, none; 123 + 124 + /* 125 + * The interrupt number is in first ten bits. The NONE field set to 1 126 + * indicates a spurious irq. 127 + */ 128 + 129 + gpir = davinci_cp_intc_read(DAVINCI_CP_INTC_PRIO_IDX); 130 + irqnr = gpir & DAVINCI_CP_INTC_PRI_INDX_MASK; 131 + none = gpir & DAVINCI_CP_INTC_GPIR_NONE; 132 + 133 + if (unlikely(none)) { 134 + pr_err_once("%s: spurious irq!\n", __func__); 135 + return; 136 + } 137 + 138 + handle_domain_irq(davinci_cp_intc_irq_domain, irqnr, regs); 139 + } 140 + 141 + static int davinci_cp_intc_host_map(struct irq_domain *h, unsigned int virq, 142 + irq_hw_number_t hw) 143 + { 144 + pr_debug("cp_intc_host_map(%d, 0x%lx)\n", virq, hw); 145 + 146 + irq_set_chip(virq, &davinci_cp_intc_irq_chip); 147 + irq_set_probe(virq); 148 + irq_set_handler(virq, handle_edge_irq); 149 + 150 + return 0; 151 + } 152 + 153 + static const struct irq_domain_ops davinci_cp_intc_irq_domain_ops = { 154 + .map = davinci_cp_intc_host_map, 155 + .xlate = irq_domain_xlate_onetwocell, 156 + }; 157 + 158 + static int __init 159 + davinci_cp_intc_do_init(const struct davinci_cp_intc_config *config, 160 + struct device_node *node) 161 + { 162 + unsigned int num_regs = BITS_TO_LONGS(config->num_irqs); 163 + int offset, irq_base; 164 + void __iomem *req; 165 + 166 + req = request_mem_region(config->reg.start, 167 + resource_size(&config->reg), 168 + "davinci-cp-intc"); 169 + if (!req) { 170 + pr_err("%s: register range busy\n", __func__); 171 + return -EBUSY; 172 + } 173 + 174 + davinci_cp_intc_base = ioremap(config->reg.start, 175 + resource_size(&config->reg)); 176 + if (!davinci_cp_intc_base) { 177 + pr_err("%s: unable to ioremap register range\n", __func__); 178 + return -EINVAL; 179 + } 180 + 181 + davinci_cp_intc_write(0, DAVINCI_CP_INTC_GLOBAL_ENABLE); 182 + 183 + /* Disable all host interrupts */ 184 + davinci_cp_intc_write(0, DAVINCI_CP_INTC_HOST_ENABLE(0)); 185 + 186 + /* Disable system interrupts */ 187 + for (offset = 0; offset < num_regs; offset++) 188 + davinci_cp_intc_write(~0, 189 + DAVINCI_CP_INTC_SYS_ENABLE_CLR(offset)); 190 + 191 + /* Set to normal mode, no nesting, no priority hold */ 192 + davinci_cp_intc_write(0, DAVINCI_CP_INTC_CTRL); 193 + davinci_cp_intc_write(0, DAVINCI_CP_INTC_HOST_CTRL); 194 + 195 + /* Clear system interrupt status */ 196 + for (offset = 0; offset < num_regs; offset++) 197 + davinci_cp_intc_write(~0, 198 + DAVINCI_CP_INTC_SYS_STAT_CLR(offset)); 199 + 200 + /* Enable nIRQ (what about nFIQ?) */ 201 + davinci_cp_intc_write(1, DAVINCI_CP_INTC_HOST_ENABLE_IDX_SET); 202 + 203 + /* Default all priorities to channel 7. */ 204 + num_regs = (config->num_irqs + 3) >> 2; /* 4 channels per register */ 205 + for (offset = 0; offset < num_regs; offset++) 206 + davinci_cp_intc_write(0x07070707, 207 + DAVINCI_CP_INTC_CHAN_MAP(offset)); 208 + 209 + irq_base = irq_alloc_descs(-1, 0, config->num_irqs, 0); 210 + if (irq_base < 0) { 211 + pr_err("%s: unable to allocate interrupt descriptors: %d\n", 212 + __func__, irq_base); 213 + return irq_base; 214 + } 215 + 216 + davinci_cp_intc_irq_domain = irq_domain_add_legacy( 217 + node, config->num_irqs, irq_base, 0, 218 + &davinci_cp_intc_irq_domain_ops, NULL); 219 + 220 + if (!davinci_cp_intc_irq_domain) { 221 + pr_err("%s: unable to create an interrupt domain\n", __func__); 222 + return -EINVAL; 223 + } 224 + 225 + set_handle_irq(davinci_cp_intc_handle_irq); 226 + 227 + /* Enable global interrupt */ 228 + davinci_cp_intc_write(1, DAVINCI_CP_INTC_GLOBAL_ENABLE); 229 + 230 + return 0; 231 + } 232 + 233 + int __init davinci_cp_intc_init(const struct davinci_cp_intc_config *config) 234 + { 235 + return davinci_cp_intc_do_init(config, NULL); 236 + } 237 + 238 + static int __init davinci_cp_intc_of_init(struct device_node *node, 239 + struct device_node *parent) 240 + { 241 + struct davinci_cp_intc_config config = { }; 242 + int ret; 243 + 244 + ret = of_address_to_resource(node, 0, &config.reg); 245 + if (ret) { 246 + pr_err("%s: unable to get the register range from device-tree\n", 247 + __func__); 248 + return ret; 249 + } 250 + 251 + ret = of_property_read_u32(node, "ti,intc-size", &config.num_irqs); 252 + if (ret) { 253 + pr_err("%s: unable to read the 'ti,intc-size' property\n", 254 + __func__); 255 + return ret; 256 + } 257 + 258 + return davinci_cp_intc_do_init(&config, node); 259 + } 260 + IRQCHIP_DECLARE(cp_intc, "ti,cp-intc", davinci_cp_intc_of_init);
+3 -3
drivers/net/ethernet/ti/Kconfig
··· 49 49 will be called davinci_cpdma. This is recommended. 50 50 51 51 config TI_CPSW_PHY_SEL 52 - bool 52 + bool "TI CPSW Phy mode Selection (DEPRECATED)" 53 + default n 53 54 ---help--- 54 55 This driver supports configuring of the phy mode connected to 55 - the CPSW. 56 + the CPSW. DEPRECATED: use PHY_TI_GMII_SEL. 56 57 57 58 config TI_CPSW_ALE 58 59 tristate "TI CPSW ALE Support" ··· 65 64 depends on ARCH_DAVINCI || ARCH_OMAP2PLUS || COMPILE_TEST 66 65 select TI_DAVINCI_CPDMA 67 66 select TI_DAVINCI_MDIO 68 - select TI_CPSW_PHY_SEL 69 67 select TI_CPSW_ALE 70 68 select MFD_SYSCON 71 69 select REGMAP
+6
drivers/net/ethernet/ti/cpsw.h
··· 21 21 ((mac)[2] << 16) | ((mac)[3] << 24)) 22 22 #define mac_lo(mac) (((mac)[4] << 0) | ((mac)[5] << 8)) 23 23 24 + #if IS_ENABLED(CONFIG_TI_CPSW_PHY_SEL) 24 25 void cpsw_phy_sel(struct device *dev, phy_interface_t phy_mode, int slave); 26 + #else 27 + static inline 28 + void cpsw_phy_sel(struct device *dev, phy_interface_t phy_mode, int slave) 29 + {} 30 + #endif 25 31 int ti_cm_get_macid(struct device *dev, int slave, u8 *mac_addr); 26 32 27 33 #endif /* __CPSW_H__ */
+27
include/linux/irqchip/irq-davinci-aintc.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 + /* 3 + * Copyright (C) 2019 Texas Instruments 4 + */ 5 + 6 + #ifndef _LINUX_IRQ_DAVINCI_AINTC_ 7 + #define _LINUX_IRQ_DAVINCI_AINTC_ 8 + 9 + #include <linux/ioport.h> 10 + 11 + /** 12 + * struct davinci_aintc_config - configuration data for davinci-aintc driver. 13 + * 14 + * @reg: register range to map 15 + * @num_irqs: number of HW interrupts supported by the controller 16 + * @prios: an array of size num_irqs containing priority settings for 17 + * each interrupt 18 + */ 19 + struct davinci_aintc_config { 20 + struct resource reg; 21 + unsigned int num_irqs; 22 + u8 *prios; 23 + }; 24 + 25 + void davinci_aintc_init(const struct davinci_aintc_config *config); 26 + 27 + #endif /* _LINUX_IRQ_DAVINCI_AINTC_ */
+25
include/linux/irqchip/irq-davinci-cp-intc.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 + /* 3 + * Copyright (C) 2019 Texas Instruments 4 + */ 5 + 6 + #ifndef _LINUX_IRQ_DAVINCI_CP_INTC_ 7 + #define _LINUX_IRQ_DAVINCI_CP_INTC_ 8 + 9 + #include <linux/ioport.h> 10 + 11 + /** 12 + * struct davinci_cp_intc_config - configuration data for davinci-cp-intc 13 + * driver. 14 + * 15 + * @reg: register range to map 16 + * @num_irqs: number of HW interrupts supported by the controller 17 + */ 18 + struct davinci_cp_intc_config { 19 + struct resource reg; 20 + unsigned int num_irqs; 21 + }; 22 + 23 + int davinci_cp_intc_init(const struct davinci_cp_intc_config *config); 24 + 25 + #endif /* _LINUX_IRQ_DAVINCI_CP_INTC_ */