diff options
author | Arnd Bergmann <arnd@arndb.de> | 2014-09-25 17:57:23 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2014-09-25 17:57:23 -0400 |
commit | 6839dbbb1627964518c417b07eb18f38aa8c8451 (patch) | |
tree | 942b6172aaca47ce1f563f4622d09b2345e8cb00 | |
parent | 8a87f1a6c8f6b78758f4e5e8e616b0df821ba2b2 (diff) | |
parent | 64d5947b9ee1284b38b8e212e7c94024452b2bb4 (diff) |
Merge tag 'intc-part2-for-v3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/drivers
Merge "part 2 of omap intc changes" from Tony Lindgren:
Second part of omap intc interrupt controller changes to
move it to drivers.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* tag 'intc-part2-for-v3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
irqchip: omap-intc: remove unnecessary comments
irqchip: omap-intc: correct maximum number or MIR registers
irqchip: omap-intc: enable TURBO idle mode
irqchip: omap-intc: enable IP protection
irqchip: omap-intc: remove unnecesary of_address_to_resource() call
irqchip: omap-intc: comment style cleanup
irqchip: omap-intc: minor improvement to omap_irq_pending()
arm: omap: irq: move irq.c to drivers/irqchip/
irqchip: add irq-omap-intc.h header
arm: omap2: n8x0: move i2c devices to DT
-rw-r--r-- | arch/arm/boot/dts/omap2420-n810.dts | 7 | ||||
-rw-r--r-- | arch/arm/boot/dts/omap2420-n8x0-common.dtsi | 6 | ||||
-rw-r--r-- | arch/arm/mach-omap2/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/Makefile | 3 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-n8x0.c | 26 | ||||
-rw-r--r-- | arch/arm/mach-omap2/common-board-devices.h | 5 | ||||
-rw-r--r-- | arch/arm/mach-omap2/common.h | 10 | ||||
-rw-r--r-- | arch/arm/mach-omap2/pdata-quirks.c | 2 | ||||
-rw-r--r-- | drivers/irqchip/Kconfig | 5 | ||||
-rw-r--r-- | drivers/irqchip/Makefile | 1 | ||||
-rw-r--r-- | drivers/irqchip/irq-omap-intc.c (renamed from arch/arm/mach-omap2/irq.c) | 64 | ||||
-rw-r--r-- | include/linux/irqchip/irq-omap-intc.h | 32 |
12 files changed, 101 insertions, 61 deletions
diff --git a/arch/arm/boot/dts/omap2420-n810.dts b/arch/arm/boot/dts/omap2420-n810.dts index 21baec154b78..b604d26bd48c 100644 --- a/arch/arm/boot/dts/omap2420-n810.dts +++ b/arch/arm/boot/dts/omap2420-n810.dts | |||
@@ -6,3 +6,10 @@ | |||
6 | model = "Nokia N810"; | 6 | model = "Nokia N810"; |
7 | compatible = "nokia,n810", "nokia,n8x0", "ti,omap2420", "ti,omap2"; | 7 | compatible = "nokia,n810", "nokia,n8x0", "ti,omap2420", "ti,omap2"; |
8 | }; | 8 | }; |
9 | |||
10 | &i2c2 { | ||
11 | aic3x@18 { | ||
12 | compatible = "tlv320aic3x"; | ||
13 | reg = <0x18>; | ||
14 | }; | ||
15 | }; | ||
diff --git a/arch/arm/boot/dts/omap2420-n8x0-common.dtsi b/arch/arm/boot/dts/omap2420-n8x0-common.dtsi index 89608b206519..24c50db2a478 100644 --- a/arch/arm/boot/dts/omap2420-n8x0-common.dtsi +++ b/arch/arm/boot/dts/omap2420-n8x0-common.dtsi | |||
@@ -27,6 +27,12 @@ | |||
27 | 27 | ||
28 | &i2c1 { | 28 | &i2c1 { |
29 | clock-frequency = <400000>; | 29 | clock-frequency = <400000>; |
30 | |||
31 | pmic@72 { | ||
32 | compatible = "menelaus"; | ||
33 | reg = <0x72>; | ||
34 | interrupts = <7 IRQ_TYPE_EDGE_RISING>; | ||
35 | }; | ||
30 | }; | 36 | }; |
31 | 37 | ||
32 | &i2c2 { | 38 | &i2c2 { |
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index 11ccf0b4e5c2..691d62a8a74b 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig | |||
@@ -86,6 +86,7 @@ config ARCH_OMAP2PLUS | |||
86 | select PINCTRL | 86 | select PINCTRL |
87 | select SOC_BUS | 87 | select SOC_BUS |
88 | select TI_PRIV_EDMA | 88 | select TI_PRIV_EDMA |
89 | select OMAP_IRQCHIP | ||
89 | help | 90 | help |
90 | Systems based on OMAP2, OMAP3, OMAP4 or OMAP5 | 91 | Systems based on OMAP2, OMAP3, OMAP4 or OMAP5 |
91 | 92 | ||
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index 69bbcba8842f..0b6095c78af1 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile | |||
@@ -10,7 +10,6 @@ obj-y := id.o io.o control.o mux.o devices.o fb.o serial.o gpmc.o timer.o pm.o \ | |||
10 | common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \ | 10 | common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \ |
11 | omap_device.o sram.o drm.o | 11 | omap_device.o sram.o drm.o |
12 | 12 | ||
13 | omap-2-3-common = irq.o | ||
14 | hwmod-common = omap_hwmod.o omap_hwmod_reset.o \ | 13 | hwmod-common = omap_hwmod.o omap_hwmod_reset.o \ |
15 | omap_hwmod_common_data.o | 14 | omap_hwmod_common_data.o |
16 | clock-common = clock.o clock_common_data.o \ | 15 | clock-common = clock.o clock_common_data.o \ |
@@ -20,7 +19,7 @@ secure-common = omap-smc.o omap-secure.o | |||
20 | obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common) | 19 | obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common) |
21 | obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common) $(secure-common) | 20 | obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common) $(secure-common) |
22 | obj-$(CONFIG_ARCH_OMAP4) += $(hwmod-common) $(secure-common) | 21 | obj-$(CONFIG_ARCH_OMAP4) += $(hwmod-common) $(secure-common) |
23 | obj-$(CONFIG_SOC_AM33XX) += irq.o $(hwmod-common) | 22 | obj-$(CONFIG_SOC_AM33XX) += $(hwmod-common) |
24 | obj-$(CONFIG_SOC_OMAP5) += $(hwmod-common) $(secure-common) | 23 | obj-$(CONFIG_SOC_OMAP5) += $(hwmod-common) $(secure-common) |
25 | obj-$(CONFIG_SOC_AM43XX) += $(hwmod-common) $(secure-common) | 24 | obj-$(CONFIG_SOC_AM43XX) += $(hwmod-common) $(secure-common) |
26 | obj-$(CONFIG_SOC_DRA7XX) += $(hwmod-common) $(secure-common) | 25 | obj-$(CONFIG_SOC_DRA7XX) += $(hwmod-common) $(secure-common) |
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c index aead77a4bc6d..97767a27ca9d 100644 --- a/arch/arm/mach-omap2/board-n8x0.c +++ b/arch/arm/mach-omap2/board-n8x0.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include "mmc.h" | 33 | #include "mmc.h" |
34 | #include "soc.h" | 34 | #include "soc.h" |
35 | #include "gpmc-onenand.h" | 35 | #include "gpmc-onenand.h" |
36 | #include "common-board-devices.h" | ||
36 | 37 | ||
37 | #define TUSB6010_ASYNC_CS 1 | 38 | #define TUSB6010_ASYNC_CS 1 |
38 | #define TUSB6010_SYNC_CS 4 | 39 | #define TUSB6010_SYNC_CS 4 |
@@ -568,29 +569,14 @@ static int n8x0_menelaus_late_init(struct device *dev) | |||
568 | } | 569 | } |
569 | #endif | 570 | #endif |
570 | 571 | ||
571 | static struct menelaus_platform_data n8x0_menelaus_platform_data __initdata = { | 572 | struct menelaus_platform_data n8x0_menelaus_platform_data __initdata = { |
572 | .late_init = n8x0_menelaus_late_init, | 573 | .late_init = n8x0_menelaus_late_init, |
573 | }; | 574 | }; |
574 | 575 | ||
575 | static struct i2c_board_info __initdata n8x0_i2c_board_info_1[] __initdata = { | 576 | struct aic3x_pdata n810_aic33_data __initdata = { |
576 | { | ||
577 | I2C_BOARD_INFO("menelaus", 0x72), | ||
578 | .irq = 7 + OMAP_INTC_START, | ||
579 | .platform_data = &n8x0_menelaus_platform_data, | ||
580 | }, | ||
581 | }; | ||
582 | |||
583 | static struct aic3x_pdata n810_aic33_data __initdata = { | ||
584 | .gpio_reset = 118, | 577 | .gpio_reset = 118, |
585 | }; | 578 | }; |
586 | 579 | ||
587 | static struct i2c_board_info n810_i2c_board_info_2[] __initdata = { | ||
588 | { | ||
589 | I2C_BOARD_INFO("tlv320aic3x", 0x18), | ||
590 | .platform_data = &n810_aic33_data, | ||
591 | }, | ||
592 | }; | ||
593 | |||
594 | static int __init n8x0_late_initcall(void) | 580 | static int __init n8x0_late_initcall(void) |
595 | { | 581 | { |
596 | if (!board_caps) | 582 | if (!board_caps) |
@@ -612,11 +598,5 @@ void * __init n8x0_legacy_init(void) | |||
612 | board_check_revision(); | 598 | board_check_revision(); |
613 | spi_register_board_info(n800_spi_board_info, | 599 | spi_register_board_info(n800_spi_board_info, |
614 | ARRAY_SIZE(n800_spi_board_info)); | 600 | ARRAY_SIZE(n800_spi_board_info)); |
615 | i2c_register_board_info(0, n8x0_i2c_board_info_1, | ||
616 | ARRAY_SIZE(n8x0_i2c_board_info_1)); | ||
617 | if (board_is_n810()) | ||
618 | i2c_register_board_info(1, n810_i2c_board_info_2, | ||
619 | ARRAY_SIZE(n810_i2c_board_info_2)); | ||
620 | |||
621 | return &mmc1_data; | 601 | return &mmc1_data; |
622 | } | 602 | } |
diff --git a/arch/arm/mach-omap2/common-board-devices.h b/arch/arm/mach-omap2/common-board-devices.h index f338177e6900..07c88ae083fb 100644 --- a/arch/arm/mach-omap2/common-board-devices.h +++ b/arch/arm/mach-omap2/common-board-devices.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __OMAP_COMMON_BOARD_DEVICES__ | 1 | #ifndef __OMAP_COMMON_BOARD_DEVICES__ |
2 | #define __OMAP_COMMON_BOARD_DEVICES__ | 2 | #define __OMAP_COMMON_BOARD_DEVICES__ |
3 | 3 | ||
4 | #include <sound/tlv320aic3x.h> | ||
5 | #include <linux/mfd/menelaus.h> | ||
4 | #include "twl-common.h" | 6 | #include "twl-common.h" |
5 | 7 | ||
6 | #define NAND_BLOCK_SIZE SZ_128K | 8 | #define NAND_BLOCK_SIZE SZ_128K |
@@ -12,4 +14,7 @@ void omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce, | |||
12 | struct ads7846_platform_data *board_pdata); | 14 | struct ads7846_platform_data *board_pdata); |
13 | void *n8x0_legacy_init(void); | 15 | void *n8x0_legacy_init(void); |
14 | 16 | ||
17 | extern struct menelaus_platform_data n8x0_menelaus_platform_data; | ||
18 | extern struct aic3x_pdata n810_aic33_data; | ||
19 | |||
15 | #endif /* __OMAP_COMMON_BOARD_DEVICES__ */ | 20 | #endif /* __OMAP_COMMON_BOARD_DEVICES__ */ |
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index 180009343adb..377eea849e7b 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/i2c/twl.h> | 32 | #include <linux/i2c/twl.h> |
33 | #include <linux/i2c-omap.h> | 33 | #include <linux/i2c-omap.h> |
34 | #include <linux/reboot.h> | 34 | #include <linux/reboot.h> |
35 | #include <linux/irqchip/irq-omap-intc.h> | ||
35 | 36 | ||
36 | #include <asm/proc-fns.h> | 37 | #include <asm/proc-fns.h> |
37 | 38 | ||
@@ -210,15 +211,6 @@ extern struct device *omap2_get_iva_device(void); | |||
210 | extern struct device *omap2_get_l3_device(void); | 211 | extern struct device *omap2_get_l3_device(void); |
211 | extern struct device *omap4_get_dsp_device(void); | 212 | extern struct device *omap4_get_dsp_device(void); |
212 | 213 | ||
213 | void omap2_init_irq(void); | ||
214 | void omap3_init_irq(void); | ||
215 | void ti81xx_init_irq(void); | ||
216 | extern int omap_irq_pending(void); | ||
217 | void omap_intc_save_context(void); | ||
218 | void omap_intc_restore_context(void); | ||
219 | void omap3_intc_suspend(void); | ||
220 | void omap3_intc_prepare_idle(void); | ||
221 | void omap3_intc_resume_idle(void); | ||
222 | void omap_gic_of_init(void); | 214 | void omap_gic_of_init(void); |
223 | 215 | ||
224 | #ifdef CONFIG_CACHE_L2X0 | 216 | #ifdef CONFIG_CACHE_L2X0 |
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c index 8695fd4ea476..06a0ccfa00a2 100644 --- a/arch/arm/mach-omap2/pdata-quirks.c +++ b/arch/arm/mach-omap2/pdata-quirks.c | |||
@@ -336,6 +336,8 @@ static struct pdata_init auxdata_quirks[] __initdata = { | |||
336 | struct of_dev_auxdata omap_auxdata_lookup[] __initdata = { | 336 | struct of_dev_auxdata omap_auxdata_lookup[] __initdata = { |
337 | #ifdef CONFIG_MACH_NOKIA_N8X0 | 337 | #ifdef CONFIG_MACH_NOKIA_N8X0 |
338 | OF_DEV_AUXDATA("ti,omap2420-mmc", 0x4809c000, "mmci-omap.0", NULL), | 338 | OF_DEV_AUXDATA("ti,omap2420-mmc", 0x4809c000, "mmci-omap.0", NULL), |
339 | OF_DEV_AUXDATA("menelaus", 0x72, "1-0072", &n8x0_menelaus_platform_data), | ||
340 | OF_DEV_AUXDATA("tlv320aic3x", 0x18, "2-0018", &n810_aic33_data), | ||
339 | #endif | 341 | #endif |
340 | #ifdef CONFIG_ARCH_OMAP3 | 342 | #ifdef CONFIG_ARCH_OMAP3 |
341 | OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002030, "48002030.pinmux", &pcs_pdata), | 343 | OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002030, "48002030.pinmux", &pcs_pdata), |
diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig index b8632bf9a7f3..9d539decf864 100644 --- a/drivers/irqchip/Kconfig +++ b/drivers/irqchip/Kconfig | |||
@@ -75,6 +75,11 @@ config OR1K_PIC | |||
75 | bool | 75 | bool |
76 | select IRQ_DOMAIN | 76 | select IRQ_DOMAIN |
77 | 77 | ||
78 | config OMAP_IRQCHIP | ||
79 | bool | ||
80 | select GENERIC_IRQ_CHIP | ||
81 | select IRQ_DOMAIN | ||
82 | |||
78 | config ORION_IRQCHIP | 83 | config ORION_IRQCHIP |
79 | bool | 84 | bool |
80 | select IRQ_DOMAIN | 85 | select IRQ_DOMAIN |
diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile index 73052ba9ca62..d0a2613c73bc 100644 --- a/drivers/irqchip/Makefile +++ b/drivers/irqchip/Makefile | |||
@@ -13,6 +13,7 @@ obj-$(CONFIG_ARCH_MOXART) += irq-moxart.o | |||
13 | obj-$(CONFIG_CLPS711X_IRQCHIP) += irq-clps711x.o | 13 | obj-$(CONFIG_CLPS711X_IRQCHIP) += irq-clps711x.o |
14 | obj-$(CONFIG_OR1K_PIC) += irq-or1k-pic.o | 14 | obj-$(CONFIG_OR1K_PIC) += irq-or1k-pic.o |
15 | obj-$(CONFIG_ORION_IRQCHIP) += irq-orion.o | 15 | obj-$(CONFIG_ORION_IRQCHIP) += irq-orion.o |
16 | obj-$(CONFIG_OMAP_IRQCHIP) += irq-omap-intc.o | ||
16 | obj-$(CONFIG_ARCH_SUNXI) += irq-sun4i.o | 17 | obj-$(CONFIG_ARCH_SUNXI) += irq-sun4i.o |
17 | obj-$(CONFIG_ARCH_SUNXI) += irq-sunxi-nmi.o | 18 | obj-$(CONFIG_ARCH_SUNXI) += irq-sunxi-nmi.o |
18 | obj-$(CONFIG_ARCH_SPEAR3XX) += spear-shirq.o | 19 | obj-$(CONFIG_ARCH_SPEAR3XX) += spear-shirq.o |
diff --git a/arch/arm/mach-omap2/irq.c b/drivers/irqchip/irq-omap-intc.c index b2993e45e84c..f3814e79192d 100644 --- a/arch/arm/mach-omap2/irq.c +++ b/drivers/irqchip/irq-omap-intc.c | |||
@@ -17,15 +17,16 @@ | |||
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | 18 | ||
19 | #include <asm/exception.h> | 19 | #include <asm/exception.h> |
20 | #include <asm/mach/irq.h> | ||
21 | #include <linux/irqdomain.h> | 20 | #include <linux/irqdomain.h> |
22 | #include <linux/of.h> | 21 | #include <linux/of.h> |
23 | #include <linux/of_address.h> | 22 | #include <linux/of_address.h> |
24 | #include <linux/of_irq.h> | 23 | #include <linux/of_irq.h> |
25 | 24 | ||
26 | #include "soc.h" | 25 | #include "irqchip.h" |
27 | #include "common.h" | 26 | |
28 | #include "../../drivers/irqchip/irqchip.h" | 27 | /* Define these here for now until we drop all board-files */ |
28 | #define OMAP24XX_IC_BASE 0x480fe000 | ||
29 | #define OMAP34XX_IC_BASE 0x48200000 | ||
29 | 30 | ||
30 | /* selected INTC register offsets */ | 31 | /* selected INTC register offsets */ |
31 | 32 | ||
@@ -48,16 +49,13 @@ | |||
48 | 49 | ||
49 | #define ACTIVEIRQ_MASK 0x7f /* omap2/3 active interrupt bits */ | 50 | #define ACTIVEIRQ_MASK 0x7f /* omap2/3 active interrupt bits */ |
50 | #define INTCPS_NR_ILR_REGS 128 | 51 | #define INTCPS_NR_ILR_REGS 128 |
51 | #define INTCPS_NR_MIR_REGS 3 | 52 | #define INTCPS_NR_MIR_REGS 4 |
52 | 53 | ||
53 | /* | 54 | #define INTC_IDLE_FUNCIDLE (1 << 0) |
54 | * OMAP2 has a number of different interrupt controllers, each interrupt | 55 | #define INTC_IDLE_TURBO (1 << 1) |
55 | * controller is identified as its own "bank". Register definitions are | 56 | |
56 | * fairly consistent for each bank, but not all registers are implemented | 57 | #define INTC_PROTECTION_ENABLE (1 << 0) |
57 | * for each bank.. when in doubt, consult the TRM. | ||
58 | */ | ||
59 | 58 | ||
60 | /* Structure to save interrupt controller context */ | ||
61 | struct omap_intc_regs { | 59 | struct omap_intc_regs { |
62 | u32 sysconfig; | 60 | u32 sysconfig; |
63 | u32 protection; | 61 | u32 protection; |
@@ -73,7 +71,6 @@ static void __iomem *omap_irq_base; | |||
73 | static int omap_nr_pending = 3; | 71 | static int omap_nr_pending = 3; |
74 | static int omap_nr_irqs = 96; | 72 | static int omap_nr_irqs = 96; |
75 | 73 | ||
76 | /* INTC bank register get/set */ | ||
77 | static void intc_writel(u32 reg, u32 val) | 74 | static void intc_writel(u32 reg, u32 val) |
78 | { | 75 | { |
79 | writel_relaxed(val, omap_irq_base + reg); | 76 | writel_relaxed(val, omap_irq_base + reg); |
@@ -131,12 +128,14 @@ void omap3_intc_prepare_idle(void) | |||
131 | * cf. errata ID i540 for 3430 (all revisions up to 3.1.x) | 128 | * cf. errata ID i540 for 3430 (all revisions up to 3.1.x) |
132 | */ | 129 | */ |
133 | intc_writel(INTC_SYSCONFIG, 0); | 130 | intc_writel(INTC_SYSCONFIG, 0); |
131 | intc_writel(INTC_IDLE, INTC_IDLE_TURBO); | ||
134 | } | 132 | } |
135 | 133 | ||
136 | void omap3_intc_resume_idle(void) | 134 | void omap3_intc_resume_idle(void) |
137 | { | 135 | { |
138 | /* Re-enable autoidle */ | 136 | /* Re-enable autoidle */ |
139 | intc_writel(INTC_SYSCONFIG, 1); | 137 | intc_writel(INTC_SYSCONFIG, 1); |
138 | intc_writel(INTC_IDLE, 0); | ||
140 | } | 139 | } |
141 | 140 | ||
142 | /* XXX: FIQ and additional INTC support (only MPU at the moment) */ | 141 | /* XXX: FIQ and additional INTC support (only MPU at the moment) */ |
@@ -173,11 +172,10 @@ static void __init omap_irq_soft_reset(void) | |||
173 | 172 | ||
174 | int omap_irq_pending(void) | 173 | int omap_irq_pending(void) |
175 | { | 174 | { |
176 | int irq; | 175 | int i; |
177 | 176 | ||
178 | for (irq = 0; irq < omap_nr_irqs; irq += 32) | 177 | for (i = 0; i < omap_nr_pending; i++) |
179 | if (intc_readl(INTC_PENDING_IRQ0 + | 178 | if (intc_readl(INTC_PENDING_IRQ0 + (0x20 * i))) |
180 | ((irq >> 5) << 5))) | ||
181 | return 1; | 179 | return 1; |
182 | return 0; | 180 | return 0; |
183 | } | 181 | } |
@@ -290,12 +288,28 @@ static int __init omap_init_irq_legacy(u32 base) | |||
290 | return 0; | 288 | return 0; |
291 | } | 289 | } |
292 | 290 | ||
291 | static void __init omap_irq_enable_protection(void) | ||
292 | { | ||
293 | u32 reg; | ||
294 | |||
295 | reg = intc_readl(INTC_PROTECTION); | ||
296 | reg |= INTC_PROTECTION_ENABLE; | ||
297 | intc_writel(INTC_PROTECTION, reg); | ||
298 | } | ||
299 | |||
293 | static int __init omap_init_irq(u32 base, struct device_node *node) | 300 | static int __init omap_init_irq(u32 base, struct device_node *node) |
294 | { | 301 | { |
302 | int ret; | ||
303 | |||
295 | if (node) | 304 | if (node) |
296 | return omap_init_irq_of(node); | 305 | ret = omap_init_irq_of(node); |
297 | else | 306 | else |
298 | return omap_init_irq_legacy(base); | 307 | ret = omap_init_irq_legacy(base); |
308 | |||
309 | if (ret == 0) | ||
310 | omap_irq_enable_protection(); | ||
311 | |||
312 | return ret; | ||
299 | } | 313 | } |
300 | 314 | ||
301 | static asmlinkage void __exception_irq_entry | 315 | static asmlinkage void __exception_irq_entry |
@@ -326,9 +340,11 @@ out: | |||
326 | } | 340 | } |
327 | } while (irqnr); | 341 | } while (irqnr); |
328 | 342 | ||
329 | /* If an irq is masked or deasserted while active, we will | 343 | /* |
344 | * If an irq is masked or deasserted while active, we will | ||
330 | * keep ending up here with no irq handled. So remove it from | 345 | * keep ending up here with no irq handled. So remove it from |
331 | * the INTC with an ack.*/ | 346 | * the INTC with an ack. |
347 | */ | ||
332 | if (!handled_irq) | 348 | if (!handled_irq) |
333 | omap_ack_irq(NULL); | 349 | omap_ack_irq(NULL); |
334 | } | 350 | } |
@@ -360,7 +376,6 @@ void __init ti81xx_init_irq(void) | |||
360 | static int __init intc_of_init(struct device_node *node, | 376 | static int __init intc_of_init(struct device_node *node, |
361 | struct device_node *parent) | 377 | struct device_node *parent) |
362 | { | 378 | { |
363 | struct resource res; | ||
364 | int ret; | 379 | int ret; |
365 | 380 | ||
366 | omap_nr_pending = 3; | 381 | omap_nr_pending = 3; |
@@ -369,11 +384,6 @@ static int __init intc_of_init(struct device_node *node, | |||
369 | if (WARN_ON(!node)) | 384 | if (WARN_ON(!node)) |
370 | return -ENODEV; | 385 | return -ENODEV; |
371 | 386 | ||
372 | if (of_address_to_resource(node, 0, &res)) { | ||
373 | WARN(1, "unable to get intc registers\n"); | ||
374 | return -EINVAL; | ||
375 | } | ||
376 | |||
377 | if (of_device_is_compatible(node, "ti,am33xx-intc")) { | 387 | if (of_device_is_compatible(node, "ti,am33xx-intc")) { |
378 | omap_nr_irqs = 128; | 388 | omap_nr_irqs = 128; |
379 | omap_nr_pending = 4; | 389 | omap_nr_pending = 4; |
diff --git a/include/linux/irqchip/irq-omap-intc.h b/include/linux/irqchip/irq-omap-intc.h new file mode 100644 index 000000000000..e06b370cfc0d --- /dev/null +++ b/include/linux/irqchip/irq-omap-intc.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /** | ||
2 | * irq-omap-intc.h - INTC Idle Functions | ||
3 | * | ||
4 | * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com | ||
5 | * | ||
6 | * Author: Felipe Balbi <balbi@ti.com> | ||
7 | * | ||
8 | * This program is free software: you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 of | ||
10 | * the License as published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | */ | ||
17 | |||
18 | #ifndef __INCLUDE_LINUX_IRQCHIP_IRQ_OMAP_INTC_H | ||
19 | #define __INCLUDE_LINUX_IRQCHIP_IRQ_OMAP_INTC_H | ||
20 | |||
21 | void omap2_init_irq(void); | ||
22 | void omap3_init_irq(void); | ||
23 | void ti81xx_init_irq(void); | ||
24 | |||
25 | int omap_irq_pending(void); | ||
26 | void omap_intc_save_context(void); | ||
27 | void omap_intc_restore_context(void); | ||
28 | void omap3_intc_suspend(void); | ||
29 | void omap3_intc_prepare_idle(void); | ||
30 | void omap3_intc_resume_idle(void); | ||
31 | |||
32 | #endif /* __INCLUDE_LINUX_IRQCHIP_IRQ_OMAP_INTC_H */ | ||