diff options
author | Heiko Stuebner <heiko@sntech.de> | 2013-04-04 01:53:49 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2013-04-04 01:56:16 -0400 |
commit | 658dc8fb9cbc7712b1518ce79211ffadcabd1c9e (patch) | |
tree | 378cbd27f58b9d129cd580983fc4a972429b5bc5 /drivers/irqchip/irq-s3c24xx.c | |
parent | bd7c0da2c1590ea292052b873f93d2c1dbbf7d28 (diff) |
irqchip: s3c24xx: globally keep track of the created intc instances
For dt-enabled machines we want to use a big irq_domain over all controllers
and therefore need to access not only the main controllers but the
sub-controller as well.
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'drivers/irqchip/irq-s3c24xx.c')
-rw-r--r-- | drivers/irqchip/irq-s3c24xx.c | 99 |
1 files changed, 50 insertions, 49 deletions
diff --git a/drivers/irqchip/irq-s3c24xx.c b/drivers/irqchip/irq-s3c24xx.c index 7cba4f0090f2..9914abdb8214 100644 --- a/drivers/irqchip/irq-s3c24xx.c +++ b/drivers/irqchip/irq-s3c24xx.c | |||
@@ -69,6 +69,14 @@ struct s3c_irq_intc { | |||
69 | struct s3c_irq_data *irqs; | 69 | struct s3c_irq_data *irqs; |
70 | }; | 70 | }; |
71 | 71 | ||
72 | /* | ||
73 | * Array holding pointers to the global controller structs | ||
74 | * [0] ... main_intc | ||
75 | * [1] ... sub_intc | ||
76 | * [2] ... main_intc2 on s3c2416 | ||
77 | */ | ||
78 | static struct s3c_irq_intc *s3c_intc[3]; | ||
79 | |||
72 | static void s3c_irq_mask(struct irq_data *data) | 80 | static void s3c_irq_mask(struct irq_data *data) |
73 | { | 81 | { |
74 | struct s3c_irq_intc *intc = data->domain->host_data; | 82 | struct s3c_irq_intc *intc = data->domain->host_data; |
@@ -307,9 +315,6 @@ static void s3c_irq_demux(unsigned int irq, struct irq_desc *desc) | |||
307 | chained_irq_exit(chip, desc); | 315 | chained_irq_exit(chip, desc); |
308 | } | 316 | } |
309 | 317 | ||
310 | static struct s3c_irq_intc *main_intc; | ||
311 | static struct s3c_irq_intc *main_intc2; | ||
312 | |||
313 | static inline int s3c24xx_handle_intc(struct s3c_irq_intc *intc, | 318 | static inline int s3c24xx_handle_intc(struct s3c_irq_intc *intc, |
314 | struct pt_regs *regs) | 319 | struct pt_regs *regs) |
315 | { | 320 | { |
@@ -345,12 +350,12 @@ static inline int s3c24xx_handle_intc(struct s3c_irq_intc *intc, | |||
345 | asmlinkage void __exception_irq_entry s3c24xx_handle_irq(struct pt_regs *regs) | 350 | asmlinkage void __exception_irq_entry s3c24xx_handle_irq(struct pt_regs *regs) |
346 | { | 351 | { |
347 | do { | 352 | do { |
348 | if (likely(main_intc)) | 353 | if (likely(s3c_intc[0])) |
349 | if (s3c24xx_handle_intc(main_intc, regs)) | 354 | if (s3c24xx_handle_intc(s3c_intc[0], regs)) |
350 | continue; | 355 | continue; |
351 | 356 | ||
352 | if (main_intc2) | 357 | if (s3c_intc[2]) |
353 | if (s3c24xx_handle_intc(main_intc2, regs)) | 358 | if (s3c24xx_handle_intc(s3c_intc[2], regs)) |
354 | continue; | 359 | continue; |
355 | 360 | ||
356 | break; | 361 | break; |
@@ -577,11 +582,6 @@ static struct s3c_irq_intc *s3c24xx_init_intc(struct device_node *np, | |||
577 | goto err; | 582 | goto err; |
578 | } | 583 | } |
579 | 584 | ||
580 | if (address == 0x4a000000) | ||
581 | main_intc = intc; | ||
582 | else if (address == 0x4a000040) | ||
583 | main_intc2 = intc; | ||
584 | |||
585 | set_handle_irq(s3c24xx_handle_irq); | 585 | set_handle_irq(s3c24xx_handle_irq); |
586 | 586 | ||
587 | return intc; | 587 | return intc; |
@@ -670,20 +670,20 @@ static struct s3c_irq_data init_s3c2410subint[32] = { | |||
670 | 670 | ||
671 | void __init s3c2410_init_irq(void) | 671 | void __init s3c2410_init_irq(void) |
672 | { | 672 | { |
673 | struct s3c_irq_intc *main_intc; | ||
674 | |||
675 | #ifdef CONFIG_FIQ | 673 | #ifdef CONFIG_FIQ |
676 | init_FIQ(FIQ_START); | 674 | init_FIQ(FIQ_START); |
677 | #endif | 675 | #endif |
678 | 676 | ||
679 | main_intc = s3c24xx_init_intc(NULL, &init_s3c2410base[0], NULL, 0x4a000000); | 677 | s3c_intc[0] = s3c24xx_init_intc(NULL, &init_s3c2410base[0], NULL, |
680 | if (IS_ERR(main_intc)) { | 678 | 0x4a000000); |
679 | if (IS_ERR(s3c_intc[0])) { | ||
681 | pr_err("irq: could not create main interrupt controller\n"); | 680 | pr_err("irq: could not create main interrupt controller\n"); |
682 | return; | 681 | return; |
683 | } | 682 | } |
684 | 683 | ||
685 | s3c24xx_init_intc(NULL, &init_s3c2410subint[0], main_intc, 0x4a000018); | 684 | s3c_intc[1] = s3c24xx_init_intc(NULL, &init_s3c2410subint[0], |
686 | s3c24xx_init_intc(NULL, &init_eint[0], main_intc, 0x560000a4); | 685 | s3c_intc[0], 0x4a000018); |
686 | s3c24xx_init_intc(NULL, &init_eint[0], s3c_intc[0], 0x560000a4); | ||
687 | } | 687 | } |
688 | #endif | 688 | #endif |
689 | 689 | ||
@@ -770,22 +770,22 @@ static struct s3c_irq_data init_s3c2412subint[32] = { | |||
770 | 770 | ||
771 | void s3c2412_init_irq(void) | 771 | void s3c2412_init_irq(void) |
772 | { | 772 | { |
773 | struct s3c_irq_intc *main_intc; | ||
774 | |||
775 | pr_info("S3C2412: IRQ Support\n"); | 773 | pr_info("S3C2412: IRQ Support\n"); |
776 | 774 | ||
777 | #ifdef CONFIG_FIQ | 775 | #ifdef CONFIG_FIQ |
778 | init_FIQ(FIQ_START); | 776 | init_FIQ(FIQ_START); |
779 | #endif | 777 | #endif |
780 | 778 | ||
781 | main_intc = s3c24xx_init_intc(NULL, &init_s3c2412base[0], NULL, 0x4a000000); | 779 | s3c_intc[0] = s3c24xx_init_intc(NULL, &init_s3c2412base[0], NULL, |
782 | if (IS_ERR(main_intc)) { | 780 | 0x4a000000); |
781 | if (IS_ERR(s3c_intc[0])) { | ||
783 | pr_err("irq: could not create main interrupt controller\n"); | 782 | pr_err("irq: could not create main interrupt controller\n"); |
784 | return; | 783 | return; |
785 | } | 784 | } |
786 | 785 | ||
787 | s3c24xx_init_intc(NULL, &init_s3c2412eint[0], main_intc, 0x560000a4); | 786 | s3c24xx_init_intc(NULL, &init_s3c2412eint[0], s3c_intc[0], 0x560000a4); |
788 | s3c24xx_init_intc(NULL, &init_s3c2412subint[0], main_intc, 0x4a000018); | 787 | s3c_intc[1] = s3c24xx_init_intc(NULL, &init_s3c2412subint[0], |
788 | s3c_intc[0], 0x4a000018); | ||
789 | } | 789 | } |
790 | #endif | 790 | #endif |
791 | 791 | ||
@@ -869,24 +869,25 @@ static struct s3c_irq_data init_s3c2416_second[32] = { | |||
869 | 869 | ||
870 | void __init s3c2416_init_irq(void) | 870 | void __init s3c2416_init_irq(void) |
871 | { | 871 | { |
872 | struct s3c_irq_intc *main_intc; | ||
873 | |||
874 | pr_info("S3C2416: IRQ Support\n"); | 872 | pr_info("S3C2416: IRQ Support\n"); |
875 | 873 | ||
876 | #ifdef CONFIG_FIQ | 874 | #ifdef CONFIG_FIQ |
877 | init_FIQ(FIQ_START); | 875 | init_FIQ(FIQ_START); |
878 | #endif | 876 | #endif |
879 | 877 | ||
880 | main_intc = s3c24xx_init_intc(NULL, &init_s3c2416base[0], NULL, 0x4a000000); | 878 | s3c_intc[0] = s3c24xx_init_intc(NULL, &init_s3c2416base[0], NULL, |
881 | if (IS_ERR(main_intc)) { | 879 | 0x4a000000); |
880 | if (IS_ERR(s3c_intc[0])) { | ||
882 | pr_err("irq: could not create main interrupt controller\n"); | 881 | pr_err("irq: could not create main interrupt controller\n"); |
883 | return; | 882 | return; |
884 | } | 883 | } |
885 | 884 | ||
886 | s3c24xx_init_intc(NULL, &init_eint[0], main_intc, 0x560000a4); | 885 | s3c24xx_init_intc(NULL, &init_eint[0], s3c_intc[0], 0x560000a4); |
887 | s3c24xx_init_intc(NULL, &init_s3c2416subint[0], main_intc, 0x4a000018); | 886 | s3c_intc[1] = s3c24xx_init_intc(NULL, &init_s3c2416subint[0], |
887 | s3c_intc[0], 0x4a000018); | ||
888 | 888 | ||
889 | s3c24xx_init_intc(NULL, &init_s3c2416_second[0], NULL, 0x4a000040); | 889 | s3c_intc[2] = s3c24xx_init_intc(NULL, &init_s3c2416_second[0], |
890 | NULL, 0x4a000040); | ||
890 | } | 891 | } |
891 | 892 | ||
892 | #endif | 893 | #endif |
@@ -947,22 +948,22 @@ static struct s3c_irq_data init_s3c2440subint[32] = { | |||
947 | 948 | ||
948 | void __init s3c2440_init_irq(void) | 949 | void __init s3c2440_init_irq(void) |
949 | { | 950 | { |
950 | struct s3c_irq_intc *main_intc; | ||
951 | |||
952 | pr_info("S3C2440: IRQ Support\n"); | 951 | pr_info("S3C2440: IRQ Support\n"); |
953 | 952 | ||
954 | #ifdef CONFIG_FIQ | 953 | #ifdef CONFIG_FIQ |
955 | init_FIQ(FIQ_START); | 954 | init_FIQ(FIQ_START); |
956 | #endif | 955 | #endif |
957 | 956 | ||
958 | main_intc = s3c24xx_init_intc(NULL, &init_s3c2440base[0], NULL, 0x4a000000); | 957 | s3c_intc[0] = s3c24xx_init_intc(NULL, &init_s3c2440base[0], NULL, |
959 | if (IS_ERR(main_intc)) { | 958 | 0x4a000000); |
959 | if (IS_ERR(s3c_intc[0])) { | ||
960 | pr_err("irq: could not create main interrupt controller\n"); | 960 | pr_err("irq: could not create main interrupt controller\n"); |
961 | return; | 961 | return; |
962 | } | 962 | } |
963 | 963 | ||
964 | s3c24xx_init_intc(NULL, &init_eint[0], main_intc, 0x560000a4); | 964 | s3c24xx_init_intc(NULL, &init_eint[0], s3c_intc[0], 0x560000a4); |
965 | s3c24xx_init_intc(NULL, &init_s3c2440subint[0], main_intc, 0x4a000018); | 965 | s3c_intc[1] = s3c24xx_init_intc(NULL, &init_s3c2440subint[0], |
966 | s3c_intc[0], 0x4a000018); | ||
966 | } | 967 | } |
967 | #endif | 968 | #endif |
968 | 969 | ||
@@ -1020,22 +1021,22 @@ static struct s3c_irq_data init_s3c2442subint[32] = { | |||
1020 | 1021 | ||
1021 | void __init s3c2442_init_irq(void) | 1022 | void __init s3c2442_init_irq(void) |
1022 | { | 1023 | { |
1023 | struct s3c_irq_intc *main_intc; | ||
1024 | |||
1025 | pr_info("S3C2442: IRQ Support\n"); | 1024 | pr_info("S3C2442: IRQ Support\n"); |
1026 | 1025 | ||
1027 | #ifdef CONFIG_FIQ | 1026 | #ifdef CONFIG_FIQ |
1028 | init_FIQ(FIQ_START); | 1027 | init_FIQ(FIQ_START); |
1029 | #endif | 1028 | #endif |
1030 | 1029 | ||
1031 | main_intc = s3c24xx_init_intc(NULL, &init_s3c2442base[0], NULL, 0x4a000000); | 1030 | s3c_intc[0] = s3c24xx_init_intc(NULL, &init_s3c2442base[0], NULL, |
1032 | if (IS_ERR(main_intc)) { | 1031 | 0x4a000000); |
1032 | if (IS_ERR(s3c_intc[0])) { | ||
1033 | pr_err("irq: could not create main interrupt controller\n"); | 1033 | pr_err("irq: could not create main interrupt controller\n"); |
1034 | return; | 1034 | return; |
1035 | } | 1035 | } |
1036 | 1036 | ||
1037 | s3c24xx_init_intc(NULL, &init_eint[0], main_intc, 0x560000a4); | 1037 | s3c24xx_init_intc(NULL, &init_eint[0], s3c_intc[0], 0x560000a4); |
1038 | s3c24xx_init_intc(NULL, &init_s3c2442subint[0], main_intc, 0x4a000018); | 1038 | s3c_intc[1] = s3c24xx_init_intc(NULL, &init_s3c2442subint[0], |
1039 | s3c_intc[0], 0x4a000018); | ||
1039 | } | 1040 | } |
1040 | #endif | 1041 | #endif |
1041 | 1042 | ||
@@ -1110,21 +1111,21 @@ static struct s3c_irq_data init_s3c2443subint[32] = { | |||
1110 | 1111 | ||
1111 | void __init s3c2443_init_irq(void) | 1112 | void __init s3c2443_init_irq(void) |
1112 | { | 1113 | { |
1113 | struct s3c_irq_intc *main_intc; | ||
1114 | |||
1115 | pr_info("S3C2443: IRQ Support\n"); | 1114 | pr_info("S3C2443: IRQ Support\n"); |
1116 | 1115 | ||
1117 | #ifdef CONFIG_FIQ | 1116 | #ifdef CONFIG_FIQ |
1118 | init_FIQ(FIQ_START); | 1117 | init_FIQ(FIQ_START); |
1119 | #endif | 1118 | #endif |
1120 | 1119 | ||
1121 | main_intc = s3c24xx_init_intc(NULL, &init_s3c2443base[0], NULL, 0x4a000000); | 1120 | s3c_intc[0] = s3c24xx_init_intc(NULL, &init_s3c2443base[0], NULL, |
1122 | if (IS_ERR(main_intc)) { | 1121 | 0x4a000000); |
1122 | if (IS_ERR(s3c_intc[0])) { | ||
1123 | pr_err("irq: could not create main interrupt controller\n"); | 1123 | pr_err("irq: could not create main interrupt controller\n"); |
1124 | return; | 1124 | return; |
1125 | } | 1125 | } |
1126 | 1126 | ||
1127 | s3c24xx_init_intc(NULL, &init_eint[0], main_intc, 0x560000a4); | 1127 | s3c24xx_init_intc(NULL, &init_eint[0], s3c_intc[0], 0x560000a4); |
1128 | s3c24xx_init_intc(NULL, &init_s3c2443subint[0], main_intc, 0x4a000018); | 1128 | s3c_intc[1] = s3c24xx_init_intc(NULL, &init_s3c2443subint[0], |
1129 | s3c_intc[0], 0x4a000018); | ||
1129 | } | 1130 | } |
1130 | #endif | 1131 | #endif |