Skip to content

Commit 77cf516

Browse files
Magnus Dammhorms
authored andcommitted
ARM: shmobile: r8a7790: Instantiate GIC from C board code in legacy builds
As of commit 9a1091e ("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>
1 parent 974b072 commit 77cf516

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

arch/arm/mach-shmobile/board-lager.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#include <linux/input.h>
2626
#include <linux/interrupt.h>
2727
#include <linux/irq.h>
28+
#include <linux/irqchip.h>
29+
#include <linux/irqchip/arm-gic.h>
2830
#include <linux/kernel.h>
2931
#include <linux/leds.h>
3032
#include <linux/mfd/tmio.h>
@@ -873,6 +875,16 @@ static void __init lager_init(void)
873875
lager_ksz8041_fixup);
874876
}
875877

878+
static 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+
876888
static const char * const lager_boards_compat_dt[] __initconst = {
877889
"renesas,lager",
878890
NULL,
@@ -881,6 +893,7 @@ static const char * const lager_boards_compat_dt[] __initconst = {
881893
DT_MACHINE_START(LAGER_DT, "lager")
882894
.smp = smp_ops(r8a7790_smp_ops),
883895
.init_early = shmobile_init_delay,
896+
.init_irq = lager_legacy_init_irq,
884897
.init_time = rcar_gen2_timer_init,
885898
.init_machine = lager_init,
886899
.init_late = shmobile_init_late,

arch/arm/mach-shmobile/setup-rcar-gen2.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ void __init rcar_gen2_timer_init(void)
137137
#ifdef CONFIG_COMMON_CLK
138138
rcar_gen2_clocks_init(mode);
139139
#endif
140+
#ifdef CONFIG_ARCH_SHMOBILE_MULTI
140141
clocksource_of_init();
142+
#endif
141143
}
142144

143145
struct memory_reserve_config {

arch/arm/mach-shmobile/timer.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ void __init shmobile_init_delay(void)
8080
* to GIC being initialized from C and arch timer via DT */
8181
if (of_machine_is_compatible("renesas,r8a73a4"))
8282
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;
8388
#endif
8489

8590
if (!has_arch_timer || !IS_ENABLED(CONFIG_ARM_ARCH_TIMER)) {

0 commit comments

Comments
 (0)