diff mbox

ARM: shmobile: r8a7778: Instantiate GIC from C board code in legacy builds

Message ID 20150116011710.12605.71607.sendpatchset@little-apple (mailing list archive)
State Accepted
Commit 1fbbc3f0c5440a4c674b3d6de0a9dd447666b508
Delegated to: Simon Horman
Headers show

Commit Message

Magnus Damm Jan. 16, 2015, 1:17 a.m. UTC
From: Magnus Damm <damm+renesas@opensource.se>
   
As of commit 9a1091ef0017c40a ("irqchip: gic: Support hierarchy irq
domain."), Bock-W legacy hangs during boot with:

Unable to handle kernel paging request at virtual address cf86a128
pgd = c0004000
[cf86a128] *pgd=6f80041e(bad)
Internal error: Oops: 8000000d [#1] SMP ARM
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.19.0-rc4 #1
Hardware name: bockw
task: cf823b40 ti: cf824000 task.ti: cf824000
PC is at 0xcf86a128
LR is at request_threaded_irq+0xbc/0x124

This happens because the IRQ numbers of the GIC are now virtual, and no
longer match the hardcoded hardware IRQ numbers in the platform board
code.

To fix this, instantiate the GIC from platform board code when compiling
a legacy kernel, like is done for the sh73a0 and r8a7740 legacy code.

Follows same style as the r8a7740 legacy GIC fix by Geert Uytterhoeven,
thanks to him for the initial work.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
---

 Written against renesas-devel-20150114v2-v3.19-rc4

 arch/arm/mach-shmobile/setup-r8a7778.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Geert Uytterhoeven Jan. 16, 2015, 9:20 a.m. UTC | #1
On Fri, Jan 16, 2015 at 2:17 AM, Magnus Damm <magnus.damm@gmail.com> wrote:
> From: Magnus Damm <damm+renesas@opensource.se>
>
> As of commit 9a1091ef0017c40a ("irqchip: gic: Support hierarchy irq
> domain."), Bock-W legacy hangs during boot with:
>
> Unable to handle kernel paging request at virtual address cf86a128
> pgd = c0004000
> [cf86a128] *pgd=6f80041e(bad)
> Internal error: Oops: 8000000d [#1] SMP ARM
> CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.19.0-rc4 #1
> Hardware name: bockw
> task: cf823b40 ti: cf824000 task.ti: cf824000
> PC is at 0xcf86a128
> LR is at request_threaded_irq+0xbc/0x124
>
> This happens because the IRQ numbers of the GIC are now virtual, and no
> longer match the hardcoded hardware IRQ numbers in the platform board
> code.
>
> To fix this, instantiate the GIC from platform board code when compiling
> a legacy kernel, like is done for the sh73a0 and r8a7740 legacy code.
>
> Follows same style as the r8a7740 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>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Simon Horman Jan. 17, 2015, 12:32 a.m. UTC | #2
On Fri, Jan 16, 2015 at 10:20:38AM +0100, Geert Uytterhoeven wrote:
> On Fri, Jan 16, 2015 at 2:17 AM, Magnus Damm <magnus.damm@gmail.com> wrote:
> > From: Magnus Damm <damm+renesas@opensource.se>
> >
> > As of commit 9a1091ef0017c40a ("irqchip: gic: Support hierarchy irq
> > domain."), Bock-W legacy hangs during boot with:
> >
> > Unable to handle kernel paging request at virtual address cf86a128
> > pgd = c0004000
> > [cf86a128] *pgd=6f80041e(bad)
> > Internal error: Oops: 8000000d [#1] SMP ARM
> > CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.19.0-rc4 #1
> > Hardware name: bockw
> > task: cf823b40 ti: cf824000 task.ti: cf824000
> > PC is at 0xcf86a128
> > LR is at request_threaded_irq+0xbc/0x124
> >
> > This happens because the IRQ numbers of the GIC are now virtual, and no
> > longer match the hardcoded hardware IRQ numbers in the platform board
> > code.
> >
> > To fix this, instantiate the GIC from platform board code when compiling
> > a legacy kernel, like is done for the sh73a0 and r8a7740 legacy code.
> >
> > Follows same style as the r8a7740 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>

Thanks, its nice to see this fixed :)

I have queued up this and the similar patch for the r8a7779 as fixes for
v3.19.

I believe that now it is only the r8a73a4 that is left needing this problem
resolved. As I have access to that hardware I'm happy to help with any
work in that area.
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- 0001/arch/arm/mach-shmobile/setup-r8a7778.c
+++ work/arch/arm/mach-shmobile/setup-r8a7778.c	2015-01-15 19:03:50.269336083 +0900
@@ -576,11 +576,18 @@  void __init r8a7778_init_irq_extpin(int
 void __init r8a7778_init_irq_dt(void)
 {
 	void __iomem *base = ioremap_nocache(0xfe700000, 0x00100000);
+#ifdef CONFIG_ARCH_SHMOBILE_LEGACY
+	void __iomem *gic_dist_base = ioremap_nocache(0xfe438000, 0x1000);
+	void __iomem *gic_cpu_base = ioremap_nocache(0xfe430000, 0x1000);
+#endif
 
 	BUG_ON(!base);
 
+#ifdef CONFIG_ARCH_SHMOBILE_LEGACY
+	gic_init(0, 29, gic_dist_base, gic_cpu_base);
+#else
 	irqchip_init();
-
+#endif
 	/* route all interrupts to ARM */
 	__raw_writel(0x73ffffff, base + INT2NTSR0);
 	__raw_writel(0xffffffff, base + INT2NTSR1);