aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMagnus Damm <damm+renesas@opensource.se>2015-01-29 02:25:32 -0500
committerSimon Horman <horms+renesas@verge.net.au>2015-01-29 03:52:38 -0500
commit77cf5166f21c3b73b04571311dc89a327424f594 (patch)
tree3894ebd9e358869a6d7e79507bb70c534e440675 /arch
parent974b072f71e350bf2c5fb9cfd5c6c9d341a53300 (diff)
ARM: shmobile: r8a7790: Instantiate GIC from C board code in legacy builds
As of commit 9a1091ef0017c40a ("irqchip: gic: Support hierarchy irq domain."), the Lager legacy board support is known to be broken. The IRQ numbers of the GIC are now virtual, and no longer match the hardcoded hardware IRQ numbers in the legacy platform board code. To fix this issue specific to non-multiplatform r8a7790 and Lager: 1) Instantiate the GIC from platform board code and also 2) Skip over the DT arch timer as well as 3) Force delay setup based on DT CPU frequency With these 3 fixes in place interrupts on Lager are now unbroken. Partially based on legacy GIC fix by Geert Uytterhoeven, thanks to him for the initial work. Signed-off-by: Magnus Damm <damm+renesas@opensource.se> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-shmobile/board-lager.c13
-rw-r--r--arch/arm/mach-shmobile/setup-rcar-gen2.c2
-rw-r--r--arch/arm/mach-shmobile/timer.c5
3 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index 571327b1c942..3f513270fc60 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -25,6 +25,8 @@
25#include <linux/input.h> 25#include <linux/input.h>
26#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <linux/irq.h> 27#include <linux/irq.h>
28#include <linux/irqchip.h>
29#include <linux/irqchip/arm-gic.h>
28#include <linux/kernel.h> 30#include <linux/kernel.h>
29#include <linux/leds.h> 31#include <linux/leds.h>
30#include <linux/mfd/tmio.h> 32#include <linux/mfd/tmio.h>
@@ -873,6 +875,16 @@ static void __init lager_init(void)
873 lager_ksz8041_fixup); 875 lager_ksz8041_fixup);
874} 876}
875 877
878static void __init lager_legacy_init_irq(void)
879{
880 void __iomem *gic_dist_base = ioremap_nocache(0xf1001000, 0x1000);
881 void __iomem *gic_cpu_base = ioremap_nocache(0xf1002000, 0x1000);
882
883 gic_init(0, 29, gic_dist_base, gic_cpu_base);
884
885 /* Do not invoke DT-based interrupt code via irqchip_init() */
886}
887
876static const char * const lager_boards_compat_dt[] __initconst = { 888static const char * const lager_boards_compat_dt[] __initconst = {
877 "renesas,lager", 889 "renesas,lager",
878 NULL, 890 NULL,
@@ -881,6 +893,7 @@ static const char * const lager_boards_compat_dt[] __initconst = {
881DT_MACHINE_START(LAGER_DT, "lager") 893DT_MACHINE_START(LAGER_DT, "lager")
882 .smp = smp_ops(r8a7790_smp_ops), 894 .smp = smp_ops(r8a7790_smp_ops),
883 .init_early = shmobile_init_delay, 895 .init_early = shmobile_init_delay,
896 .init_irq = lager_legacy_init_irq,
884 .init_time = rcar_gen2_timer_init, 897 .init_time = rcar_gen2_timer_init,
885 .init_machine = lager_init, 898 .init_machine = lager_init,
886 .init_late = shmobile_init_late, 899 .init_late = shmobile_init_late,
diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c
index 7ed92790d13f..101b3e430a0d 100644
--- a/arch/arm/mach-shmobile/setup-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c
@@ -137,7 +137,9 @@ void __init rcar_gen2_timer_init(void)
137#ifdef CONFIG_COMMON_CLK 137#ifdef CONFIG_COMMON_CLK
138 rcar_gen2_clocks_init(mode); 138 rcar_gen2_clocks_init(mode);
139#endif 139#endif
140#ifdef CONFIG_ARCH_SHMOBILE_MULTI
140 clocksource_of_init(); 141 clocksource_of_init();
142#endif
141} 143}
142 144
143struct memory_reserve_config { 145struct memory_reserve_config {
diff --git a/arch/arm/mach-shmobile/timer.c b/arch/arm/mach-shmobile/timer.c
index 44d32a84b001..88f067bcec94 100644
--- a/arch/arm/mach-shmobile/timer.c
+++ b/arch/arm/mach-shmobile/timer.c
@@ -80,6 +80,11 @@ void __init shmobile_init_delay(void)
80 * to GIC being initialized from C and arch timer via DT */ 80 * to GIC being initialized from C and arch timer via DT */
81 if (of_machine_is_compatible("renesas,r8a73a4")) 81 if (of_machine_is_compatible("renesas,r8a73a4"))
82 has_arch_timer = false; 82 has_arch_timer = false;
83
84 /* Non-multiplatform r8a7790 SoC cannot use arch timer due
85 * to GIC being initialized from C and arch timer via DT */
86 if (of_machine_is_compatible("renesas,r8a7790"))
87 has_arch_timer = false;
83#endif 88#endif
84 89
85 if (!has_arch_timer || !IS_ENABLED(CONFIG_ARM_ARCH_TIMER)) { 90 if (!has_arch_timer || !IS_ENABLED(CONFIG_ARM_ARCH_TIMER)) {