ARM: Common GIC entry macro code V2
Subsystems (6)
PATCH 1/1 ARM: Common GIC entry macro code V2
From: Magnus Damm <[email protected]>
This patch is the identical GIC demux implementation merge V2. Instead of implementing same code over and over simply share it in entry-macro-gic.S. The shared code is based on the realview implementation.
Each GIC demux instance still has to setup the base address of the controller using the get_irqnr_preamble macro. The rest of the GIC specific code can be shared.
The omap code is excluded due to complexity and lack of hardware - the CONFIG_SMP macros are used for multi-omap and the omap4 case - this makes is difficult to share code.
The s5pv310 subarch is excluded due to the special "addne" instruction in the get_irqnr_and_base macro.
The msm subarch is excluded as well since it treats PPIs differently than other platforms and needs a different version of the get_irqnr_and_base macro.
---
Changes since V1:
- dropped msm as requested by Abhijeet, thank you.
This patch is almost identical to 6284/1 in the RMKs patch tracker. The main difference is that this patch requires each platform to specify base address using the macro get_irqnr_preable. This patch includes tegra, but drops omap support due to multi-omap complexity.
Thanks to Shilimkar, Santosh and Srinidhi Kasagar for feedback.
arch/arm/include/asm/hardware/entry-macro-gic.S | 68 +++++++++++++++++++++ arch/arm/mach-cns3xxx/include/mach/entry-macro.S | 61 ------------------ arch/arm/mach-realview/include/mach/entry-macro.S | 60 ------------------ arch/arm/mach-tegra/include/mach/entry-macro.S | 64 ------------------- arch/arm/mach-ux500/include/mach/entry-macro.S | 67 -------------------- arch/arm/mach-vexpress/include/mach/entry-macro.S | 57 ----------------- 6 files changed, 73 insertions(+), 304 deletions(-)
arch/arm/include/asm/hardware/entry-macro-gic.S new file +68 -0
@@ -0,0 +1,68 @@ +/* + * arch/arm/include/asm/hardware/entry-macro-gic.S + * + * Low-level IRQ helper macros for GIC + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +#include <asm/hardware/gic.h> + +/* + * The interrupt numbering scheme is defined in the + * interrupt controller spec. To wit: + * + * Interrupts 0-15 are IPI + * 16-28 are reserved + * 29-31 are local. We allow 30 to be used for the watchdog. + * 32-1020 are global + * 1021-1022 are reserved + * 1023 is "spurious" (no interrupt) + * + * For now, we ignore all local interrupts so only return an interrupt if it's + * between 30 and 1020. The test_for_ipi routine below will pick up on IPIs. + * + * A simple read from the controller will tell us the number of the highest + * priority enabled interrupt. We then just need to check whether it is in the + * valid range for an IRQ (30-1020 inclusive). + */ + + .macro get_irqnr_and_base, irqnr, irqstat, base, tmp + + ldr \irqstat, [\base, #GIC_CPU_INTACK] + /* bits 12-10 = src CPU, 9-0 = int # */ + + ldr \tmp, =1021 + bic \irqnr, \irqstat, #0x1c00 + cmp \irqnr, #29 + cmpcc \irqnr, \irqnr + cmpne \irqnr, \tmp + cmpcs \irqnr, \irqnr + .endm + +/* We assume that irqstat (the raw value of the IRQ acknowledge + * register) is preserved from the macro above. + * If there is an IPI, we immediately signal end of interrupt on the + * controller, since this requires the original irqstat value which + * we won't easily be able to recreate later. + */ + + .macro test_for_ipi, irqnr, irqstat, base, tmp + bic \irqnr, \irqstat, #0x1c00 + cmp \irqnr, #16 + strcc \irqstat, [\base, #GIC_CPU_EOI] + cmpcs \irqnr, \irqnr + .endm + +/* As above, this assumes that irqstat and base are preserved.. */ + + .macro test_for_ltirq, irqnr, irqstat, base, tmp + bic \irqnr, \irqstat, #0x1c00 + mov \tmp, #0 + cmp \irqnr, #29 + moveq \tmp, #1 + streq \irqstat, [\base, #GIC_CPU_EOI] + cmp \tmp, #0 + .endm
arch/arm/mach-cns3xxx/include/mach/entry-macro.S +1 -60
70 lines not on this page · raw message
arch/arm/mach-realview/include/mach/entry-macro.S +1 -59
69 lines not on this page · raw message
arch/arm/mach-tegra/include/mach/entry-macro.S +1 -63
76 lines not on this page · raw message
arch/arm/mach-ux500/include/mach/entry-macro.S +1 -66
76 lines not on this page · raw message
arch/arm/mach-vexpress/include/mach/entry-macro.S +1 -56
63 lines not on this page · raw message
PATCH 1/1 ARM: Common GIC entry macro code V2
Hi,
Can you include the "arch/arm/mach-s5pv310/include/mach/entry-macro.S" also?
Thank you,
Kyungmin Park
Quoted 496 lines · Magnus Damm
From: Magnus Damm <[email protected]>
This patch is the identical GIC demux implementation merge V2. Instead of implementing same code over and over simply share it in
entry-macro-gic.S. The shared code is based on the realview implementation.Each GIC demux instance still has to setup the base address of the controller using the
get_irqnr_preamblemacro. The rest of the GIC specific code can be shared.The omap code is excluded due to complexity and lack of hardware - the
CONFIG_SMPmacros are used for multi-omap and the omap4 case - this makes is difficult to share code.The s5pv310 subarch is excluded due to the special "addne" instruction in the
get_irqnr_and_basemacro.The msm subarch is excluded as well since it treats PPIs differently than other platforms and needs a different version of the
get_irqnr_and_basemacro.Signed-off-by Magnus Damm <[email protected]>Acked-by Srinidhi Kasagar<[email protected]>---
?Changes since V1:
?- dropped msm as requested by Abhijeet, thank you.?This patch is almost identical to 6284/1 in the RMKs patch ?tracker. The main difference is that this patch requires ?each platform to specify base address using the macro ?get_irqnr_preable. This patch includes tegra, but drops ?omap support due to multi-omap complexity.
?Thanks to Shilimkar, Santosh and Srinidhi Kasagar for feedback.
?arch/arm/include/asm/hardware/entry-macro-gic.S ? | ? 68 +++++++++++++++++++++ ?arch/arm/mach-cns3xxx/include/mach/entry-macro.S ?| ? 61 ------------------ ?arch/arm/mach-realview/include/mach/entry-macro.S | ? 60 ------------------ ?arch/arm/mach-tegra/include/mach/entry-macro.S ? ?| ? 64 ------------------- ?arch/arm/mach-ux500/include/mach/entry-macro.S ? ?| ? 67 -------------------- ?arch/arm/mach-vexpress/include/mach/entry-macro.S | ? 57 -----------------?6 files changed, 73 insertions(+), 304 deletions(-)
arch/arm/include/asm/hardware/entry-macro-gic.S ? ? ? ?2010-11-10 16:06:26.000000000 +0900 new file +68
-0@@ -0,0 +1,68 @@ +/* + * arch/arm/include/asm/hardware/entry-macro-gic.S + * + * Low-level IRQ helper macros for GIC + * + * This file is licensed under ?the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +#include <asm/hardware/gic.h> + +/* + * The interrupt numbering scheme is defined in the + * interrupt controller spec. ?To wit: + * + * Interrupts 0-15 are IPI + * 16-28 are reserved + * 29-31 are local. ?We allow 30 to be used for the watchdog. + * 32-1020 are global + * 1021-1022 are reserved + * 1023 is "spurious" (no interrupt) + * + * For now, we ignore all local interrupts so only return an interrupt if it's + * between 30 and 1020. ?The test_for_ipi routine below will pick up on IPIs. + * + * A simple read from the controller will tell us the number of the highest + * priority enabled interrupt. ?We then just need to check whether it is in the + * valid range for an IRQ (30-1020 inclusive). + */ + + ? ? ? .macro ?get_irqnr_and_base, irqnr, irqstat, base, tmp + + ? ? ? ldr ? ? \irqstat, [\base, #GIC_CPU_INTACK] + ? ? ? /* bits 12-10 = src CPU, 9-0 = int # */ + + ? ? ? ldr ? ? \tmp, =1021 + ? ? ? bic ? ? \irqnr, \irqstat, #0x1c00 + ? ? ? cmp ? ? \irqnr, #29 + ? ? ? cmpcc ? \irqnr, \irqnr + ? ? ? cmpne ? \irqnr, \tmp + ? ? ? cmpcs ? \irqnr, \irqnr + ? ? ? .endm + +/* We assume that irqstat (the raw value of the IRQ acknowledge + * register) is preserved from the macro above. + * If there is an IPI, we immediately signal end of interrupt on the + * controller, since this requires the original irqstat value which + * we won't easily be able to recreate later. + */ + + ? ? ? .macro test_for_ipi, irqnr, irqstat, base, tmp + ? ? ? bic ? ? \irqnr, \irqstat, #0x1c00 + ? ? ? cmp ? ? \irqnr, #16 + ? ? ? strcc ? \irqstat, [\base, #GIC_CPU_EOI] + ? ? ? cmpcs ? \irqnr, \irqnr + ? ? ? .endm + +/* As above, this assumes that irqstat and base are preserved.. */ + + ? ? ? .macro test_for_ltirq, irqnr, irqstat, base, tmp + ? ? ? bic ? ? \irqnr, \irqstat, #0x1c00 + ? ? ? mov ? ? \tmp, #0 + ? ? ? cmp ? ? \irqnr, #29 + ? ? ? moveq ? \tmp, #1 + ? ? ? streq ? \irqstat, [\base, #GIC_CPU_EOI] + ? ? ? cmp ? ? \tmp, #0 + ? ? ? .endmarch/arm/mach-cns3xxx/include/mach/entry-macro.S ? ? ? 2010-11-10 16:06:25.000000000 +0900 renamed from arch/arm/mach-cns3xxx/include/mach/entry-macro.S +0
-0@@ -9,7 +9,7 @@?*/
?#include <
mach/hardware.h>arch/arm/mach-cns3xxx/include/mach/entry-macro.S ? ? ? 2010-11-10 16:06:25.000000000 +0900 renamed from arch/arm/mach-cns3xxx/include/mach/entry-macro.S +1
-1-#include <asm/hardware/gic.h> +#include <asm/hardware/entry-macro-gic.S>? ? ? ? ? ? ? ?.macro ?disable_fiq
? ? ? ? ? ? ? ?.endmarch/arm/mach-cns3xxx/include/mach/entry-macro.S ? ? ? 2010-11-10 16:06:25.000000000 +0900 renamed from arch/arm/mach-cns3xxx/include/mach/entry-macro.S +0
-0@@ -21,62 +21,3 @@? ? ? ? ? ? ? ?.macro ?arch_ret_to_user, tmp1, tmp2 ? ? ? ? ? ? ? ?.endm
arch/arm/mach-cns3xxx/include/mach/entry-macro.S ? ? ? 2010-11-10 16:06:25.000000000 +0900 renamed from arch/arm/mach-cns3xxx/include/mach/entry-macro.S +0
-59- - ? ? ? ? ? ? ? /* - ? ? ? ? ? ? ? ?* The interrupt numbering scheme is defined in the - ? ? ? ? ? ? ? ?* interrupt controller spec. ?To wit: - ? ? ? ? ? ? ? ?* - ? ? ? ? ? ? ? ?* Interrupts 0-15 are IPI - ? ? ? ? ? ? ? ?* 16-28 are reserved - ? ? ? ? ? ? ? ?* 29-31 are local. ?We allow 30 to be used for the watchdog. - ? ? ? ? ? ? ? ?* 32-1020 are global - ? ? ? ? ? ? ? ?* 1021-1022 are reserved - ? ? ? ? ? ? ? ?* 1023 is "spurious" (no interrupt) - ? ? ? ? ? ? ? ?* - ? ? ? ? ? ? ? ?* For now, we ignore all local interrupts so only return an interrupt if it's - ? ? ? ? ? ? ? ?* between 30 and 1020. ?The test_for_ipi routine below will pick up on IPIs. - ? ? ? ? ? ? ? ?* - ? ? ? ? ? ? ? ?* A simple read from the controller will tell us the number of the highest - ? ? ? ? ? ? ? ? * priority enabled interrupt. ?We then just need to check whether it is in the - ? ? ? ? ? ? ? ?* valid range for an IRQ (30-1020 inclusive). - ? ? ? ? ? ? ? ?*/ - - ? ? ? ? ? ? ? .macro ?get_irqnr_and_base, irqnr, irqstat, base, tmp - - ? ? ? ? ? ? ? ldr ? ? \irqstat, [\base, #GIC_CPU_INTACK] /* bits 12-10 = src CPU, 9-0 = int # */ - - ? ? ? ? ? ? ? ldr ? ? \tmp, =1021 - - ? ? ? ? ? ? ? bic ? ? \irqnr, \irqstat, #0x1c00 - - ? ? ? ? ? ? ? cmp ? ? \irqnr, #29 - ? ? ? ? ? ? ? cmpcc ? \irqnr, \irqnr - ? ? ? ? ? ? ? cmpne ? \irqnr, \tmp - ? ? ? ? ? ? ? cmpcs ? \irqnr, \irqnr - - ? ? ? ? ? ? ? .endm - - ? ? ? ? ? ? ? /* We assume that irqstat (the raw value of the IRQ acknowledge - ? ? ? ? ? ? ? ?* register) is preserved from the macro above. - ? ? ? ? ? ? ? ?* If there is an IPI, we immediately signal end of interrupt on the - ? ? ? ? ? ? ? ?* controller, since this requires the original irqstat value which - ? ? ? ? ? ? ? ?* we won't easily be able to recreate later. - ? ? ? ? ? ? ? ?*/ - - ? ? ? ? ? ? ? .macro test_for_ipi, irqnr, irqstat, base, tmp - ? ? ? ? ? ? ? bic ? ? \irqnr, \irqstat, #0x1c00 - ? ? ? ? ? ? ? cmp ? ? \irqnr, #16 - ? ? ? ? ? ? ? strcc ? \irqstat, [\base, #GIC_CPU_EOI] - ? ? ? ? ? ? ? cmpcs ? \irqnr, \irqnr - ? ? ? ? ? ? ? .endm - - ? ? ? ? ? ? ? /* As above, this assumes that irqstat and base are preserved.. */ - - ? ? ? ? ? ? ? .macro test_for_ltirq, irqnr, irqstat, base, tmp - ? ? ? ? ? ? ? bic ? ? \irqnr, \irqstat, #0x1c00 - ? ? ? ? ? ? ? mov ? ? \tmp, #0 - ? ? ? ? ? ? ? cmp ? ? \irqnr, #29 - ? ? ? ? ? ? ? moveq ? \tmp, #1 - ? ? ? ? ? ? ? streq ? \irqstat, [\base, #GIC_CPU_EOI] - ? ? ? ? ? ? ? cmp ? ? \tmp, #0 - ? ? ? ? ? ? ? .endmarch/arm/mach-realview/include/mach/entry-macro.S ? ? ?2010-11-10 16:06:25.000000000 +0900 renamed from arch/arm/mach-realview/include/mach/entry-macro.S +0
-0@@ -8,7 +8,7 @@?* warranty of any kind, whether express or implied. ?*/
?#include <mach/hardware.h>arch/arm/mach-realview/include/mach/entry-macro.S ? ? ?2010-11-10 16:06:25.000000000 +0900 renamed from arch/arm/mach-realview/include/mach/entry-macro.S +1
-1-#include <asm/hardware/gic.h> +#include <asm/hardware/entry-macro-gic.S>? ? ? ? ? ? ? ?.macro ?disable_fiq
? ? ? ? ? ? ? ?.endmarch/arm/mach-realview/include/mach/entry-macro.S ? ? ?2010-11-10 16:06:25.000000000 +0900 renamed from arch/arm/mach-realview/include/mach/entry-macro.S +0
-0@@ -21,61 +21,3 @@? ? ? ? ? ? ? ?.macro ?arch_ret_to_user, tmp1, tmp2 ? ? ? ? ? ? ? ?.endm
- ? ? ? ? ? ? ? /*
- ? ? ? ? ? ? ? ?* The interrupt numbering scheme is defined in the
- ? ? ? ? ? ? ? ?* interrupt controller spec. ?To wit:
- ? ? ? ? ? ? ? ?*
- ? ? ? ? ? ? ? ?* Interrupts 0-15 are IPI
- ? ? ? ? ? ? ? ?* 16-28 are reserved
- ? ? ? ? ? ? ? ?* 29-31 are local. ?We allow 30 to be used for the watchdog.
- ? ? ? ? ? ? ? ?* 32-1020 are global
- ? ? ? ? ? ? ? ?* 1021-1022 are reserved
- ? ? ? ? ? ? ? ?* 1023 is "spurious" (no interrupt)
- ? ? ? ? ? ? ? ?*
- ? ? ? ? ? ? ? ?* For now, we ignore all local interrupts so only return an interrupt if it's
- ? ? ? ? ? ? ? ?* between 30 and 1020. ?Thetest_for_ipiroutine below will pick up on IPIs.
- ? ? ? ? ? ? ? ?*
- ? ? ? ? ? ? ? ?* A simple read from the controller will tell us the number of the highest
- ? ? ? ? ? ? ? ? * priority enabled interrupt. ?We then just need to check whether it is in the
- ? ? ? ? ? ? ? ?* valid range for an IRQ (30-1020 inclusive).
- ? ? ? ? ? ? ? ?*/arch/arm/mach-realview/include/mach/entry-macro.S ? ? ?2010-11-10 16:06:25.000000000 +0900 renamed from arch/arm/mach-realview/include/mach/entry-macro.S +0
-40- - ? ? ? ? ? ? ? .macro ?get_irqnr_and_base, irqnr, irqstat, base, tmp - - ? ? ? ? ? ? ? ldr ? ? \irqstat, [\base, #GIC_CPU_INTACK] /* bits 12-10 = src CPU, 9-0 = int # */ - - ? ? ? ? ? ? ? ldr ? ? \tmp, =1021 - - ? ? ? ? ? ? ? bic ? ? \irqnr, \irqstat, #0x1c00 - - ? ? ? ? ? ? ? cmp ? ? \irqnr, #29 - ? ? ? ? ? ? ? cmpcc ? \irqnr, \irqnr - ? ? ? ? ? ? ? cmpne ? \irqnr, \tmp - ? ? ? ? ? ? ? cmpcs ? \irqnr, \irqnr - - ? ? ? ? ? ? ? .endm - - ? ? ? ? ? ? ? /* We assume that irqstat (the raw value of the IRQ acknowledge - ? ? ? ? ? ? ? ?* register) is preserved from the macro above. - ? ? ? ? ? ? ? ?* If there is an IPI, we immediately signal end of interrupt on the - ? ? ? ? ? ? ? ?* controller, since this requires the original irqstat value which - ? ? ? ? ? ? ? ?* we won't easily be able to recreate later. - ? ? ? ? ? ? ? ?*/ - - ? ? ? ? ? ? ? .macro test_for_ipi, irqnr, irqstat, base, tmp - ? ? ? ? ? ? ? bic ? ? \irqnr, \irqstat, #0x1c00 - ? ? ? ? ? ? ? cmp ? ? \irqnr, #16 - ? ? ? ? ? ? ? strcc ? \irqstat, [\base, #GIC_CPU_EOI] - ? ? ? ? ? ? ? cmpcs ? \irqnr, \irqnr - ? ? ? ? ? ? ? .endm - - ? ? ? ? ? ? ? /* As above, this assumes that irqstat and base are preserved.. */ - - ? ? ? ? ? ? ? .macro test_for_ltirq, irqnr, irqstat, base, tmp - ? ? ? ? ? ? ? bic ? ? \irqnr, \irqstat, #0x1c00 - ? ? ? ? ? ? ? mov ? ? \tmp, #0 - ? ? ? ? ? ? ? cmp ? ? \irqnr, #29 - ? ? ? ? ? ? ? moveq ? \tmp, #1 - ? ? ? ? ? ? ? streq ? \irqstat, [\base, #GIC_CPU_EOI] - ? ? ? ? ? ? ? cmp ? ? \tmp, #0 - ? ? ? ? ? ? ? .endmarch/arm/mach-tegra/include/mach/entry-macro.S 2010-11-10 16:06:25.000000000 +0900 renamed from arch/arm/mach-tegra/include/mach/entry-macro.S +1
-1@@ -17,7 +17,7 @@ ?#if defined(CONFIG_ARM_GIC) -#include <asm/hardware/gic.h> +#include <asm/hardware/entry-macro-gic.S>? ? ? ?/* Uses the GIC interrupt controller built into the cpu */ ?#define
ICTRL_BASE(IO_CPU_VIRT+0x100)arch/arm/mach-tegra/include/mach/entry-macro.S 2010-11-10 16:06:25.000000000 +0900 renamed from arch/arm/mach-tegra/include/mach/entry-macro.S +0
-0@@ -32,68 +32,6 @@? ? ? ?.macro ?arch_ret_to_user, tmp1, tmp2
? ? ? ?.endmarch/arm/mach-tegra/include/mach/entry-macro.S 2010-11-10 16:06:25.000000000 +0900 renamed from arch/arm/mach-tegra/include/mach/entry-macro.S +0
-62- - ? ? ? /* - ? ? ? ?* The interrupt numbering scheme is defined in the - ? ? ? ?* interrupt controller spec. ?To wit: - ? ? ? ?* - ? ? ? ?* Interrupts 0-15 are IPI - ? ? ? ?* 16-28 are reserved - ? ? ? ?* 29-31 are local. ?We allow 30 to be used for the watchdog. - ? ? ? ?* 32-1020 are global - ? ? ? ?* 1021-1022 are reserved - ? ? ? ?* 1023 is "spurious" (no interrupt) - ? ? ? ?* - ? ? ? ?* For now, we ignore all local interrupts so only return an interrupt - ? ? ? ?* if it's between 30 and 1020. ?The test_for_ipi routine below will - ? ? ? ?* pick up on IPIs. - ? ? ? ?* - ? ? ? ?* A simple read from the controller will tell us the number of the - ? ? ? ?* highest priority enabled interrupt. ?We then just need to check - ? ? ? ?* whether it is in the valid range for an IRQ (30-1020 inclusive). - ? ? ? ?*/ - - ? ? ? .macro ?get_irqnr_and_base, irqnr, irqstat, base, tmp - - ? ? ? /* bits 12-10 = src CPU, 9-0 = int # */ - ? ? ? ldr ? ? \irqstat, [\base, #GIC_CPU_INTACK] - - ? ? ? ldr ? ? ? ? ? ? \tmp, =1021 - - ? ? ? bic ? ? \irqnr, \irqstat, #0x1c00 - - ? ? ? cmp ? ? \irqnr, #29 - ? ? ? cmpcc ? \irqnr, \irqnr - ? ? ? cmpne ? \irqnr, \tmp - ? ? ? cmpcs ? \irqnr, \irqnr - - ? ? ? .endm - - ? ? ? /* We assume that irqstat (the raw value of the IRQ acknowledge - ? ? ? ?* register) is preserved from the macro above. - ? ? ? ?* If there is an IPI, we immediately signal end of interrupt on the - ? ? ? ?* controller, since this requires the original irqstat value which - ? ? ? ?* we won't easily be able to recreate later. - ? ? ? ?*/ - - ? ? ? .macro test_for_ipi, irqnr, irqstat, base, tmp - ? ? ? bic ? ? \irqnr, \irqstat, #0x1c00 - ? ? ? cmp ? ? \irqnr, #16 - ? ? ? strcc ? \irqstat, [\base, #GIC_CPU_EOI] - ? ? ? cmpcs ? \irqnr, \irqnr - ? ? ? .endm - - ? ? ? /* As above, this assumes that irqstat and base are preserved.. */ - - ? ? ? .macro test_for_ltirq, irqnr, irqstat, base, tmp - ? ? ? bic ? ? \irqnr, \irqstat, #0x1c00 - ? ? ? mov ? ? \tmp, #0 - ? ? ? cmp ? ? \irqnr, #29 - ? ? ? moveq ? \tmp, #1 - ? ? ? streq ? \irqstat, [\base, #GIC_CPU_EOI] - ? ? ? cmp ? ? \tmp, #0 - ? ? ? .endm -?#else
? ? ? ?/* legacy interrupt controller for AP16 */ ? ? ? ?.macro ?disable_fiqarch/arm/mach-ux500/include/mach/entry-macro.S 2010-11-10 16:06:25.000000000 +0900 renamed from arch/arm/mach-ux500/include/mach/entry-macro.S +0
-0@@ -11,7 +11,7 @@?* warranty of any kind, whether express or implied. ?*/
?#include <mach/hardware.h>arch/arm/mach-ux500/include/mach/entry-macro.S 2010-11-10 16:06:25.000000000 +0900 renamed from arch/arm/mach-ux500/include/mach/entry-macro.S +1
-1-#include <asm/hardware/gic.h> +#include <asm/hardware/entry-macro-gic.S>? ? ? ? ? ? ? ?.macro ?disable_fiq
? ? ? ? ? ? ? ?.endmarch/arm/mach-ux500/include/mach/entry-macro.S 2010-11-10 16:06:25.000000000 +0900 renamed from arch/arm/mach-ux500/include/mach/entry-macro.S +0
-0@@ -22,68 +22,3 @@? ? ? ? ? ? ? ?.macro ?arch_ret_to_user, tmp1, tmp2 ? ? ? ? ? ? ? ?.endm
arch/arm/mach-ux500/include/mach/entry-macro.S 2010-11-10 16:06:25.000000000 +0900 renamed from arch/arm/mach-ux500/include/mach/entry-macro.S +0
-65- - ? ? ? ? ? ? ? /* - ? ? ? ? ? ? ? ?* The interrupt numbering scheme is defined in the - ? ? ? ? ? ? ? ?* interrupt controller spec. ?To wit: - ? ? ? ? ? ? ? ?* - ? ? ? ? ? ? ? ?* Interrupts 0-15 are IPI - ? ? ? ? ? ? ? ?* 16-28 are reserved - ? ? ? ? ? ? ? ?* 29-31 are local. ?We allow 30 to be used for the watchdog. - ? ? ? ? ? ? ? ?* 32-1020 are global - ? ? ? ? ? ? ? ?* 1021-1022 are reserved - ? ? ? ? ? ? ? ?* 1023 is "spurious" (no interrupt) - ? ? ? ? ? ? ? ?* - ? ? ? ? ? ? ? ?* For now, we ignore all local interrupts so only return an - ? ? ? ? ? ? ? ?* interrupt if it's between 30 and 1020. The test_for_ipi - ? ? ? ? ? ? ? ?* routine below will pick up on IPIs. - ? ? ? ? ? ? ? ?* - ? ? ? ? ? ? ? ?* A simple read from the controller will tell us the number - ? ? ? ? ? ? ? ?* of the highest priority enabled interrupt. We then just - ? ? ? ? ? ? ? ?* need to check whether it is in the valid range for an - ? ? ? ? ? ? ? ?* IRQ (30-1020 inclusive). - ? ? ? ? ? ? ? ?*/ - - ? ? ? ? ? ? ? .macro ?get_irqnr_and_base, irqnr, irqstat, base, tmp - - ? ? ? ? ? ? ? /* bits 12-10 = src CPU, 9-0 = int # */ - ? ? ? ? ? ? ? ldr ? ? \irqstat, [\base, #GIC_CPU_INTACK] - - ? ? ? ? ? ? ? ldr ? ? \tmp, =1021 - - ? ? ? ? ? ? ? bic ? ? \irqnr, \irqstat, #0x1c00 - - ? ? ? ? ? ? ? cmp ? ? \irqnr, #29 - ? ? ? ? ? ? ? cmpcc ? \irqnr, \irqnr - ? ? ? ? ? ? ? cmpne ? \irqnr, \tmp - ? ? ? ? ? ? ? cmpcs ? \irqnr, \irqnr - - ? ? ? ? ? ? ? .endm - - ? ? ? ? ? ? ? /* We assume that irqstat (the raw value of the IRQ - ? ? ? ? ? ? ? ?* acknowledge register) is preserved from the macro above. - ? ? ? ? ? ? ? ?* If there is an IPI, we immediately signal end of - ? ? ? ? ? ? ? ?* interrupt on the controller, since this requires the - ? ? ? ? ? ? ? ?* original irqstat value which we won't easily be able - ? ? ? ? ? ? ? ?* to recreate later. - ? ? ? ? ? ? ? ?*/ - - ? ? ? ? ? ? ? .macro test_for_ipi, irqnr, irqstat, base, tmp - ? ? ? ? ? ? ? bic ? ? \irqnr, \irqstat, #0x1c00 - ? ? ? ? ? ? ? cmp ? ? \irqnr, #16 - ? ? ? ? ? ? ? strcc ? \irqstat, [\base, #GIC_CPU_EOI] - ? ? ? ? ? ? ? cmpcs ? \irqnr, \irqnr - ? ? ? ? ? ? ? .endm - - ? ? ? ? ? ? ? /* As above, this assumes that irqstat and base - ? ? ? ? ? ? ? ?* are preserved.. - ? ? ? ? ? ? ? ?*/ - - ? ? ? ? ? ? ? .macro test_for_ltirq, irqnr, irqstat, base, tmp - ? ? ? ? ? ? ? bic ? ? \irqnr, \irqstat, #0x1c00 - ? ? ? ? ? ? ? mov ? ? \tmp, #0 - ? ? ? ? ? ? ? cmp ? ? \irqnr, #29 - ? ? ? ? ? ? ? moveq ? \tmp, #1 - ? ? ? ? ? ? ? streq ? \irqstat, [\base, #GIC_CPU_EOI] - ? ? ? ? ? ? ? cmp ? ? \tmp, #0 - ? ? ? ? ? ? ? .endmarch/arm/mach-vexpress/include/mach/entry-macro.S ? ? ?2010-11-10 16:06:25.000000000 +0900 renamed from arch/arm/mach-vexpress/include/mach/entry-macro.S +1
-1@@ -1,4 +1,4 @@ -#include <asm/hardware/gic.h> +#include <asm/hardware/entry-macro-gic.S>? ? ? ?.macro ?disable_fiq
? ? ? ?.endmarch/arm/mach-vexpress/include/mach/entry-macro.S ? ? ?2010-11-10 16:06:25.000000000 +0900 renamed from arch/arm/mach-vexpress/include/mach/entry-macro.S +0
-0@@ -10,58 +10,3 @@? ? ? ?.macro ?arch_ret_to_user, tmp1, tmp2
? ? ? ?.endmarch/arm/mach-vexpress/include/mach/entry-macro.S ? ? ?2010-11-10 16:06:25.000000000 +0900 renamed from arch/arm/mach-vexpress/include/mach/entry-macro.S +0
-55- - ? ? ? /* - ? ? ? ?* The interrupt numbering scheme is defined in the - ? ? ? ?* interrupt controller spec. ?To wit: - ? ? ? ?* - ? ? ? ?* Interrupts 0-15 are IPI - ? ? ? ?* 16-28 are reserved - ? ? ? ?* 29-31 are local. ?We allow 30 to be used for the watchdog. - ? ? ? ?* 32-1020 are global - ? ? ? ?* 1021-1022 are reserved - ? ? ? ?* 1023 is "spurious" (no interrupt) - ? ? ? ?* - ? ? ? ?* For now, we ignore all local interrupts so only return an interrupt if it's - ? ? ? ?* between 30 and 1020. ?The test_for_ipi routine below will pick up on IPIs. - ? ? ? ?* - ? ? ? ?* A simple read from the controller will tell us the number of the highest - ? ? ? ?* priority enabled interrupt. ?We then just need to check whether it is in the - ? ? ? ?* valid range for an IRQ (30-1020 inclusive). - ? ? ? ?*/ - - ? ? ? .macro ?get_irqnr_and_base, irqnr, irqstat, base, tmp - ? ? ? ldr ? ? \irqstat, [\base, #GIC_CPU_INTACK] /* bits 12-10 = src CPU, 9-0 = int # */ - ? ? ? ldr ? ? \tmp, =1021 - ? ? ? bic ? ? \irqnr, \irqstat, #0x1c00 - ? ? ? cmp ? ? \irqnr, #29 - ? ? ? cmpcc ? \irqnr, \irqnr - ? ? ? cmpne ? \irqnr, \tmp - ? ? ? cmpcs ? \irqnr, \irqnr - ? ? ? .endm - - ? ? ? /* We assume that irqstat (the raw value of the IRQ acknowledge - ? ? ? ?* register) is preserved from the macro above. - ? ? ? ?* If there is an IPI, we immediately signal end of interrupt on the - ? ? ? ?* controller, since this requires the original irqstat value which - ? ? ? ?* we won't easily be able to recreate later. - ? ? ? ?*/ - - ? ? ? .macro test_for_ipi, irqnr, irqstat, base, tmp - ? ? ? bic ? ? \irqnr, \irqstat, #0x1c00 - ? ? ? cmp ? ? \irqnr, #16 - ? ? ? strcc ? \irqstat, [\base, #GIC_CPU_EOI] - ? ? ? cmpcs ? \irqnr, \irqnr - ? ? ? .endm - - ? ? ? /* As above, this assumes that irqstat and base are preserved.. */ - - ? ? ? .macro test_for_ltirq, irqnr, irqstat, base, tmp - ? ? ? bic ? ? \irqnr, \irqstat, #0x1c00 - ? ? ? mov ? ? \tmp, #0 - ? ? ? cmp ? ? \irqnr, #29 - ? ? ? moveq ? \tmp, #1 - ? ? ? streq ? \irqstat, [\base, #GIC_CPU_EOI] - ? ? ? cmp ? ? \tmp, #0 - ? ? ? .endm -_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 1/1 ARM: Common GIC entry macro code V2
Quoted 3 lines · Kyungmin Park
Hi,
Hi,
Quoted 1 line
Can you include the "
arch/arm/mach-s5pv310/include/mach/entry-macro.S"
also?
Quoted 1 line
In conclusion, can't it now.
Because according to current interrupt number structure of Samsung SoCs, irqnr macro need to add S5P_IRQ_OFFSET, 32.
Or have to add #ifdef in there...But don't like it.
Quoted 1 line
On Thu, Nov 11, 2010 at 4:49 PM, Magnus Damm <[email protected]>
Quoted 35 lines · wrote:
Quoted 35 lines
From: Magnus Damm <[email protected]>
This patch is the identical GIC demux implementation merge V2. Instead of implementing same code over and over simply share it in
entry-macro-gic.S. The shared code is based on the realview implementation.Each GIC demux instance still has to setup the base address of the controller using the
get_irqnr_preamblemacro. The rest of the GIC specific code can be shared.The omap code is excluded due to complexity and lack of hardware - the
CONFIG_SMPmacros are used for multi-omap and the omap4 case - this makes is difficult to share code.The s5pv310 subarch is excluded due to the special "addne" instruction in the
get_irqnr_and_basemacro.The msm subarch is excluded as well since it treats PPIs differently than other platforms and needs a different version of the
get_irqnr_and_basemacro.Signed-off-by Magnus Damm <[email protected]>Acked-by Srinidhi Kasagar<[email protected]>---
?Changes since V1:
?- dropped msm as requested by Abhijeet, thank you.?This patch is almost identical to 6284/1 in the RMKs patch ?tracker. The main difference is that this patch requires ?each platform to specify base address using the macro ?get_irqnr_preable. This patch includes tegra, but drops ?omap support due to multi-omap complexity.
Quoted 5 lines
Quoted 3 lines
?Thanks to Shilimkar, Santosh and Srinidhi Kasagar for feedback.
?arch/arm/include/asm/hardware/entry-macro-gic.S ? | ? 68
+++++++++++++++++++++
Quoted 1 line
?arch/arm/mach-cns3xxx/include/mach/entry-macro.S ?| ? 61
-----------------
Quoted 2 lines
-
Quoted 1 line
?arch/arm/mach-realview/include/mach/entry-macro.S | ? 60
-----------------
Quoted 2 lines
-
Quoted 1 line
?arch/arm/mach-tegra/include/mach/entry-macro.S ? ?| ? 64
-----------------
Quoted 2 lines
--
Quoted 1 line
?arch/arm/mach-ux500/include/mach/entry-macro.S ? ?| ? 67
-----------------
Quoted 2 lines
---
Quoted 1 line
?arch/arm/mach-vexpress/include/mach/entry-macro.S | ? 57
-----------------
Quoted 4 lines
arch/arm/include/asm/hardware/entry-macro-gic.S ? ? ?
Quoted 4 lines
?6 files changed, 73 insertions(+), 304 deletions(-)
arch/arm/include/asm/hardware/entry-macro-gic.S ? ? ? new file +0
-0
?2010-11-10
Quoted 18 lines
16:06:26.000000000 +0900
Quoted 17 lines
arch/arm/include/asm/hardware/entry-macro-gic.S ? ? ? new file +16
-0@@ -0,0 +1,68 @@ +/* + * arch/arm/include/asm/hardware/entry-macro-gic.S + * + * Low-level IRQ helper macros for GIC + * + * This file is licensed under ?the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +#include <asm/hardware/gic.h> + +/* + * The interrupt numbering scheme is defined in the + * interrupt controller spec. ?To wit: + *
Quoted 8 lines
arch/arm/include/asm/hardware/entry-macro-gic.S ? ? ? line 24
Quoted 8 lines
arch/arm/include/asm/hardware/entry-macro-gic.S ? ? ? new file +8
-0+ * Interrupts 0-15 are IPI + * 16-28 are reserved + * 29-31 are local. ?We allow 30 to be used for the watchdog. + * 32-1020 are global + * 1021-1022 are reserved + * 1023 is "spurious" (no interrupt) + * + * For now, we ignore all local interrupts so only return an interrupt
if
Quoted 7 lines
it's
arch/arm/include/asm/hardware/entry-macro-gic.S ? ? ? line 25
Quoted 1 line
arch/arm/include/asm/hardware/entry-macro-gic.S ? ? ? new file +1
-0+ * between 30 and 1020. ?The test_for_ipi routine below will pick up onIPIs.
arch/arm/include/asm/hardware/entry-macro-gic.S ? ? ? line 27
Quoted 2 lines
arch/arm/include/asm/hardware/entry-macro-gic.S ? ? ? new file +2
-0+ * + * A simple read from the controller will tell us the number of thehighest
Quoted 1 line
arch/arm/include/asm/hardware/entry-macro-gic.S ? ? ? new file +1
-0+ * priority enabled interrupt. ?We then just need to check whether it
is
Quoted 33 lines
in the
Quoted 32 lines
arch/arm/include/asm/hardware/entry-macro-gic.S ? ? ? new file +32
-0+ * valid range for an IRQ (30-1020 inclusive). + */ + + ? ? ? .macro ?get_irqnr_and_base, irqnr, irqstat, base, tmp + + ? ? ? ldr ? ? \irqstat, [\base, #GIC_CPU_INTACK] + ? ? ? /* bits 12-10 = src CPU, 9-0 = int # */ + + ? ? ? ldr ? ? \tmp, =1021 + ? ? ? bic ? ? \irqnr, \irqstat, #0x1c00 + ? ? ? cmp ? ? \irqnr, #29 + ? ? ? cmpcc ? \irqnr, \irqnr + ? ? ? cmpne ? \irqnr, \tmp + ? ? ? cmpcs ? \irqnr, \irqnr + ? ? ? .endm + +/* We assume that irqstat (the raw value of the IRQ acknowledge + * register) is preserved from the macro above. + * If there is an IPI, we immediately signal end of interrupt on the + * controller, since this requires the original irqstat value which + * we won't easily be able to recreate later. + */ + + ? ? ? .macro test_for_ipi, irqnr, irqstat, base, tmp + ? ? ? bic ? ? \irqnr, \irqstat, #0x1c00 + ? ? ? cmp ? ? \irqnr, #16 + ? ? ? strcc ? \irqstat, [\base, #GIC_CPU_EOI] + ? ? ? cmpcs ? \irqnr, \irqnr + ? ? ? .endm + +/* As above, this assumes that irqstat and base are preserved.. */ +
Quoted 8 lines
arch/arm/include/asm/hardware/entry-macro-gic.S ? ? ? line 68
Quoted 8 lines
arch/arm/include/asm/hardware/entry-macro-gic.S ? ? ? new file +8
-0+ ? ? ? .macro test_for_ltirq, irqnr, irqstat, base, tmp + ? ? ? bic ? ? \irqnr, \irqstat, #0x1c00 + ? ? ? mov ? ? \tmp, #0 + ? ? ? cmp ? ? \irqnr, #29 + ? ? ? moveq ? \tmp, #1 + ? ? ? streq ? \irqstat, [\base, #GIC_CPU_EOI] + ? ? ? cmp ? ? \tmp, #0 + ? ? ? .endm
(snip)
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
PATCH 1/1 ARM: Common GIC entry macro code V2
Quoted 6 lines · Kukjin Kim
Quoted 3 lines · Kyungmin Park
Hi,
Hi,
Quoted 8 lines
Quoted 1 line
Can you include the "
arch/arm/mach-s5pv310/include/mach/entry-macro.S"also?
Quoted 1 line
In conclusion, can't it now.
Because according to current interrupt number structure of Samsung SoCs, irqnr macro need to addS5P_IRQ_OFFSET, 32.Or have to add #ifdef in there...But don't like it.
I wonder why Samsung goes another way, use the common codes. if required, modify to use the common codes.
Thank you,
Kyungmin Park
Quoted 149 lines
Quoted 2 lines
On Thu, Nov 11, 2010 at 4:49 PM, Magnus Damm <[email protected]>
Quoted 35 lines · wrote:
Quoted 35 lines
From: Magnus Damm <[email protected]>
This patch is the identical GIC demux implementation merge V2. Instead of implementing same code over and over simply share it in
entry-macro-gic.S. The shared code is based on the realview implementation.Each GIC demux instance still has to setup the base address of the controller using the
get_irqnr_preamblemacro. The rest of the GIC specific code can be shared.The omap code is excluded due to complexity and lack of hardware - the
CONFIG_SMPmacros are used for multi-omap and the omap4 case - this makes is difficult to share code.The s5pv310 subarch is excluded due to the special "addne" instruction in the
get_irqnr_and_basemacro.The msm subarch is excluded as well since it treats PPIs differently than other platforms and needs a different version of the
get_irqnr_and_basemacro.Signed-off-by Magnus Damm <[email protected]>Acked-by Srinidhi Kasagar<[email protected]>---
?Changes since V1:
?- dropped msm as requested by Abhijeet, thank you.?This patch is almost identical to 6284/1 in the RMKs patch ?tracker. The main difference is that this patch requires ?each platform to specify base address using the macro ?get_irqnr_preable. This patch includes tegra, but drops ?omap support due to multi-omap complexity.
Quoted 5 lines
Quoted 3 lines
?Thanks to Shilimkar, Santosh and Srinidhi Kasagar for feedback.
?arch/arm/include/asm/hardware/entry-macro-gic.S ? | ? 68
+++++++++++++++++++++
Quoted 1 line
?arch/arm/mach-cns3xxx/include/mach/entry-macro.S ?| ? 61
-----------------
Quoted 2 lines
-
Quoted 1 line
?arch/arm/mach-realview/include/mach/entry-macro.S | ? 60
-----------------
Quoted 2 lines
-
Quoted 1 line
?arch/arm/mach-tegra/include/mach/entry-macro.S ? ?| ? 64
-----------------
Quoted 2 lines
--
Quoted 1 line
?arch/arm/mach-ux500/include/mach/entry-macro.S ? ?| ? 67
-----------------
Quoted 2 lines
---
Quoted 1 line
?arch/arm/mach-vexpress/include/mach/entry-macro.S | ? 57
-----------------
Quoted 4 lines
arch/arm/include/asm/hardware/entry-macro-gic.S
Quoted 4 lines
?6 files changed, 73 insertions(+), 304 deletions(-)
arch/arm/include/asm/hardware/entry-macro-gic.S new file +0
-0?2010-11-10
Quoted 18 lines
16:06:26.000000000 +0900
Quoted 17 lines
arch/arm/include/asm/hardware/entry-macro-gic.S new file +16
-0@@ -0,0 +1,68 @@ +/* + * arch/arm/include/asm/hardware/entry-macro-gic.S + * + * Low-level IRQ helper macros for GIC + * + * This file is licensed under ?the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +#include <asm/hardware/gic.h> + +/* + * The interrupt numbering scheme is defined in the + * interrupt controller spec. ?To wit: + *Quoted 8 lines
arch/arm/include/asm/hardware/entry-macro-gic.S
Quoted 8 lines
arch/arm/include/asm/hardware/entry-macro-gic.S new file +8
-0+ * Interrupts 0-15 are IPI + * 16-28 are reserved + * 29-31 are local. ?We allow 30 to be used for the watchdog. + * 32-1020 are global + * 1021-1022 are reserved + * 1023 is "spurious" (no interrupt) + * + * For now, we ignore all local interrupts so only return an interruptif
Quoted 7 lines
it's
arch/arm/include/asm/hardware/entry-macro-gic.S line 25
Quoted 1 line
arch/arm/include/asm/hardware/entry-macro-gic.S new file +1
-0+ * between 30 and 1020. ?The test_for_ipi routine below will pick up onIPIs.
arch/arm/include/asm/hardware/entry-macro-gic.S line 27
Quoted 2 lines
arch/arm/include/asm/hardware/entry-macro-gic.S new file +2
-0+ * + * A simple read from the controller will tell us the number of thehighest
Quoted 1 line
arch/arm/include/asm/hardware/entry-macro-gic.S new file +1
-0+ * priority enabled interrupt. ?We then just need to check whether itis
Quoted 33 lines
in the
Quoted 32 lines
arch/arm/include/asm/hardware/entry-macro-gic.S new file +32
-0+ * valid range for an IRQ (30-1020 inclusive). + */ + + ? ? ? .macro ?get_irqnr_and_base, irqnr, irqstat, base, tmp + + ? ? ? ldr ? ? \irqstat, [\base, #GIC_CPU_INTACK] + ? ? ? /* bits 12-10 = src CPU, 9-0 = int # */ + + ? ? ? ldr ? ? \tmp, =1021 + ? ? ? bic ? ? \irqnr, \irqstat, #0x1c00 + ? ? ? cmp ? ? \irqnr, #29 + ? ? ? cmpcc ? \irqnr, \irqnr + ? ? ? cmpne ? \irqnr, \tmp + ? ? ? cmpcs ? \irqnr, \irqnr + ? ? ? .endm + +/* We assume that irqstat (the raw value of the IRQ acknowledge + * register) is preserved from the macro above. + * If there is an IPI, we immediately signal end of interrupt on the + * controller, since this requires the original irqstat value which + * we won't easily be able to recreate later. + */ + + ? ? ? .macro test_for_ipi, irqnr, irqstat, base, tmp + ? ? ? bic ? ? \irqnr, \irqstat, #0x1c00 + ? ? ? cmp ? ? \irqnr, #16 + ? ? ? strcc ? \irqstat, [\base, #GIC_CPU_EOI] + ? ? ? cmpcs ? \irqnr, \irqnr + ? ? ? .endm + +/* As above, this assumes that irqstat and base are preserved.. */ +Quoted 8 lines
arch/arm/include/asm/hardware/entry-macro-gic.S line 68
Quoted 8 lines
arch/arm/include/asm/hardware/entry-macro-gic.S new file +8
-0+ ? ? ? .macro test_for_ltirq, irqnr, irqstat, base, tmp + ? ? ? bic ? ? \irqnr, \irqstat, #0x1c00 + ? ? ? mov ? ? \tmp, #0 + ? ? ? cmp ? ? \irqnr, #29 + ? ? ? moveq ? \tmp, #1 + ? ? ? streq ? \irqstat, [\base, #GIC_CPU_EOI] + ? ? ? cmp ? ? \tmp, #0 + ? ? ? .endm(snip)
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
PATCH 1/1 ARM: Common GIC entry macro code V2
In reply to Magnus DammQuoted 15 lines · Magnus Damm
From: Magnus Damm <[email protected]>
This patch is the identical GIC demux implementation merge V2. Instead of implementing same code over and over simply share it in
entry-macro-gic.S. The shared code is based on the realview implementation.Each GIC demux instance still has to setup the base address of the controller using the
get_irqnr_preamblemacro. The rest of the GIC specific code can be shared.The omap code is excluded due to complexity and lack of hardware - the
CONFIG_SMPmacros are used for multi-omap and the omap4 case - this makes is difficult to share code.
Quoted 6 lines
The s5pv310 subarch is excluded due to the special "addne" instruction in the
get_irqnr_and_basemacro.The msm subarch is excluded as well since it treats PPIs differently than other platforms and needs a different version of the
get_irqnr_and_basemacro.
I'm a little disappoint you didn't CC someone MSM related on this. Your patch is small enough that you can CC everyone effected. Here's get_maintainer.pl output on it,
Russell King <[email protected]> Anton Vorontsov <[email protected]> Srinidhi Kasagar <[email protected]> Linus Walleij <[email protected]> Alessandro Rubini <[email protected]> linux-arm-kernel at lists.infradead.org linux-kernel at vger.kernel.org
At least those people should be getting this. Also, why can't you break this up per sub-architecture ?
Daniel
Signature · 2 lines
Sent by a consultant of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
Tony Lindgren
maintainerPATCH 1/1 ARM: Common GIC entry macro code V2
In reply to Magnus DammHi Magnus,
Quoted 4 lines · Magnus Damm
The omap code is excluded due to complexity and lack of hardware - the
CONFIG_SMPmacros are used for multi-omap and the omap4 case - this makes is difficult to share code.
Hmm test_for_ipi and test_for_ltirq are needed for the SMP_ON_UP case, so I've moved those in to the MULTI_OMAP2 section.
Maybe merge the following into your original patch?
Regards,
Tony
From: Tony Lindgren <[email protected]>
Date: Thu, 11 Nov 2010 16:19:44 -0800
Subject: [PATCH] ARM: Common GIC entry macro for omap
Common GIC entry macro for omap
arch/arm/mach-omap2/include/mach/entry-macro.S +31 -61
@@ -105,6 +105,35 @@ omap_irq_base: .word 0 9999: .endm +#ifdef CONFIG_SMP + /* We assume that irqstat (the raw value of the IRQ acknowledge + * register) is preserved from the macro above. + * If there is an IPI, we immediately signal end of interrupt + * on the controller, since this requires the original irqstat + * value which we won't easily be able to recreate later. + */ + + .macro test_for_ipi, irqnr, irqstat, base, tmp + bic \irqnr, \irqstat, #0x1c00 + cmp \irqnr, #16 + it cc + strcc \irqstat, [\base, #GIC_CPU_EOI] + it cs + cmpcs \irqnr, \irqnr + .endm + + /* As above, this assumes that irqstat and base are preserved */ + + .macro test_for_ltirq, irqnr, irqstat, base, tmp + bic \irqnr, \irqstat, #0x1c00 + mov \tmp, #0 + cmp \irqnr, #29 + itt eq + moveq \tmp, #1 + streq \irqstat, [\base, #GIC_CPU_EOI] + cmp \tmp, #0 + .endm +#endif /* CONFIG_SMP */ #else /* MULTI_OMAP2 */
@@ -141,74 +170,15 @@ omap_irq_base: .word 0 #ifdef CONFIG_ARCH_OMAP4 +#include <asm/hardware/entry-macro-gic.S> .macro get_irqnr_preamble, base, tmp ldr \base, =OMAP4_IRQ_BASE .endm - /* - * The interrupt numbering scheme is defined in the - * interrupt controller spec. To wit: - * - * Interrupts 0-15 are IPI - * 16-28 are reserved - * 29-31 are local. We allow 30 to be used for the watchdog. - * 32-1020 are global - * 1021-1022 are reserved - * 1023 is "spurious" (no interrupt) - * - * For now, we ignore all local interrupts so only return an - * interrupt if it's between 30 and 1020. The test_for_ipi - * routine below will pick up on IPIs. - * A simple read from the controller will tell us the number - * of the highest priority enabled interrupt. - * We then just need to check whether it is in the - * valid range for an IRQ (30-1020 inclusive). - */ - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp - ldr \irqstat, [\base, #GIC_CPU_INTACK] - - ldr \tmp, =1021 - - bic \irqnr, \irqstat, #0x1c00 - - cmp \irqnr, #29 - cmpcc \irqnr, \irqnr - cmpne \irqnr, \tmp - cmpcs \irqnr, \irqnr - .endm #endif -#endif /* MULTI_OMAP2 */ - -#ifdef CONFIG_SMP - /* We assume that irqstat (the raw value of the IRQ acknowledge - * register) is preserved from the macro above. - * If there is an IPI, we immediately signal end of interrupt - * on the controller, since this requires the original irqstat - * value which we won't easily be able to recreate later. - */ - .macro test_for_ipi, irqnr, irqstat, base, tmp - bic \irqnr, \irqstat, #0x1c00 - cmp \irqnr, #16 - it cc - strcc \irqstat, [\base, #GIC_CPU_EOI] - it cs - cmpcs \irqnr, \irqnr - .endm - - /* As above, this assumes that irqstat and base are preserved */ - - .macro test_for_ltirq, irqnr, irqstat, base, tmp - bic \irqnr, \irqstat, #0x1c00 - mov \tmp, #0 - cmp \irqnr, #29 - itt eq - moveq \tmp, #1 - streq \irqstat, [\base, #GIC_CPU_EOI] - cmp \tmp, #0 - .endm -#endif /* CONFIG_SMP */ +#endif /* MULTI_OMAP2 */ .macro irq_prio_table .endm
PATCH 1/1 ARM: Common GIC entry macro code V2
In reply to Kyungmin ParkQuoted 6 lines · Kyungmin Park
Quoted 5 lines · Kukjin Kim
Quoted 2 lines · Kyungmin Park
Can you include the "
arch/arm/mach-s5pv310/include/mach/entry-macro.S"also?
Quoted 1 line
Quoted 8 lines
Quoted 5 lines
In conclusion, can't it now.
Because according to current interrupt number structure of Samsung SoCs, irqnr macro need to addS5P_IRQ_OFFSET, 32.Or have to add #ifdef in there...But don't like it.
I wonder why Samsung goes another way, use the common codes. if required, modify to use the common codes.
Yes, it would be nice if Samsung could use the common code as well. I will however ignore this for now to focus on getting something merged that most people can use. The Samsung bits can be dealt with incrementally.
Thanks,
/ magnus
PATCH 1/1 ARM: Common GIC entry macro code V2
In reply to Daniel WalkerQuoted 27 lines · Daniel Walker
Quoted 15 lines · Magnus Damm
From: Magnus Damm <[email protected]>
This patch is the identical GIC demux implementation merge V2. Instead of implementing same code over and over simply share it in
entry-macro-gic.S. The shared code is based on the realview implementation.Each GIC demux instance still has to setup the base address of the controller using the
get_irqnr_preamblemacro. The rest of the GIC specific code can be shared.The omap code is excluded due to complexity and lack of hardware - the
CONFIG_SMPmacros are used for multi-omap and the omap4 case - this makes is difficult to share code.Quoted 6 lines
The s5pv310 subarch is excluded due to the special "addne" instruction in the
get_irqnr_and_basemacro.The msm subarch is excluded as well since it treats PPIs differently than other platforms and needs a different version of the
get_irqnr_and_basemacro.I'm a little disappoint you didn't CC someone MSM related on this. Your patch is small enough that you can CC everyone effected. Here's get_maintainer.pl output on it,
Quoted 7 lines
Russell King <[email protected]> Anton Vorontsov <[email protected]> Srinidhi Kasagar <[email protected]> Linus Walleij <[email protected]> Alessandro Rubini <[email protected]> linux-arm-kernel at lists.infradead.org linux-kernel at vger.kernel.org
Hi Daniel,
Sorry to disappoint you, will use get_maintainer.pl and include people from former versions when I send out next version.
Quoted 2 lines
At least those people should be getting this. Also, why can't you break this up per sub-architecture ?
PATCH 1/1 ARM: Common GIC entry macro code V2
In reply to Tony LindgrenHi Tony,
Quoted 11 lines · Tony Lindgren
Hi Magnus,
Quoted 4 lines · Magnus Damm
The omap code is excluded due to complexity and lack of hardware - the
CONFIG_SMPmacros are used for multi-omap and the omap4 case - this makes is difficult to share code.Hmm
test_for_ipiandtest_for_ltirqare needed for theSMP_ON_UPcase, so I've moved those in to theMULTI_OMAP2section.
Looking good!
Quoted 1 line
Maybe merge the following into your original patch?
Sure, I'll include your code as a broken out patch in V3.
Thank you!
/ magnus