Wolfram Sang | c44e182 | 2018-06-14 10:56:06 +0900 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Kuninori Morimoto | ccb7cc7 | 2013-03-21 03:01:36 -0700 | [diff] [blame] | 2 | /* |
| 3 | * r8a7778 processor support |
| 4 | * |
| 5 | * Copyright (C) 2013 Renesas Solutions Corp. |
| 6 | * Copyright (C) 2013 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> |
Sergei Shtylyov | 5242191 | 2013-04-04 18:55:46 +0000 | [diff] [blame] | 7 | * Copyright (C) 2013 Cogent Embedded, Inc. |
Kuninori Morimoto | ccb7cc7 | 2013-03-21 03:01:36 -0700 | [diff] [blame] | 8 | */ |
| 9 | |
Kuninori Morimoto | ccb7cc7 | 2013-03-21 03:01:36 -0700 | [diff] [blame] | 10 | #include <linux/io.h> |
Kuninori Morimoto | ccb7cc7 | 2013-03-21 03:01:36 -0700 | [diff] [blame] | 11 | #include <linux/irqchip.h> |
Geert Uytterhoeven | 02c94f3 | 2014-06-20 18:53:04 +0200 | [diff] [blame] | 12 | |
Kuninori Morimoto | ccb7cc7 | 2013-03-21 03:01:36 -0700 | [diff] [blame] | 13 | #include <asm/mach/arch.h> |
Kuninori Morimoto | ccb7cc7 | 2013-03-21 03:01:36 -0700 | [diff] [blame] | 14 | |
Magnus Damm | fd44aa5 | 2014-06-17 16:47:37 +0900 | [diff] [blame] | 15 | #include "common.h" |
Kuninori Morimoto | ccb7cc7 | 2013-03-21 03:01:36 -0700 | [diff] [blame] | 16 | |
Kuninori Morimoto | ccb7cc7 | 2013-03-21 03:01:36 -0700 | [diff] [blame] | 17 | #define INT2SMSKCR0 0x82288 /* 0xfe782288 */ |
| 18 | #define INT2SMSKCR1 0x8228c /* 0xfe78228c */ |
| 19 | |
| 20 | #define INT2NTSR0 0x00018 /* 0xfe700018 */ |
| 21 | #define INT2NTSR1 0x0002c /* 0xfe70002c */ |
Geert Uytterhoeven | 20e7333 | 2015-09-30 17:50:19 +0200 | [diff] [blame] | 22 | |
| 23 | static void __init r8a7778_init_irq_dt(void) |
Kuninori Morimoto | ccb7cc7 | 2013-03-21 03:01:36 -0700 | [diff] [blame] | 24 | { |
| 25 | void __iomem *base = ioremap_nocache(0xfe700000, 0x00100000); |
| 26 | |
| 27 | BUG_ON(!base); |
| 28 | |
Kuninori Morimoto | 54aa4c4 | 2013-07-09 01:48:34 -0700 | [diff] [blame] | 29 | irqchip_init(); |
Ulrich Hecht | 4baadb9 | 2015-08-14 15:51:03 +0200 | [diff] [blame] | 30 | |
Kuninori Morimoto | ccb7cc7 | 2013-03-21 03:01:36 -0700 | [diff] [blame] | 31 | /* route all interrupts to ARM */ |
| 32 | __raw_writel(0x73ffffff, base + INT2NTSR0); |
| 33 | __raw_writel(0xffffffff, base + INT2NTSR1); |
| 34 | |
| 35 | /* unmask all known interrupts in INTCS2 */ |
| 36 | __raw_writel(0x08330773, base + INT2SMSKCR0); |
| 37 | __raw_writel(0x00311110, base + INT2SMSKCR1); |
| 38 | |
| 39 | iounmap(base); |
| 40 | } |
| 41 | |
Nicolas Pitre | 19c233b | 2015-07-27 18:27:52 -0400 | [diff] [blame] | 42 | static const char *const r8a7778_compat_dt[] __initconst = { |
Kuninori Morimoto | ccb7cc7 | 2013-03-21 03:01:36 -0700 | [diff] [blame] | 43 | "renesas,r8a7778", |
| 44 | NULL, |
| 45 | }; |
| 46 | |
| 47 | DT_MACHINE_START(R8A7778_DT, "Generic R8A7778 (Flattened Device Tree)") |
Geert Uytterhoeven | 92ee341 | 2014-10-17 14:24:38 +0200 | [diff] [blame] | 48 | .init_early = shmobile_init_delay, |
Kuninori Morimoto | ccb7cc7 | 2013-03-21 03:01:36 -0700 | [diff] [blame] | 49 | .init_irq = r8a7778_init_irq_dt, |
Magnus Damm | 7759a7a | 2014-07-31 08:32:50 +0900 | [diff] [blame] | 50 | .init_late = shmobile_init_late, |
Kuninori Morimoto | ccb7cc7 | 2013-03-21 03:01:36 -0700 | [diff] [blame] | 51 | .dt_compat = r8a7778_compat_dt, |
Kuninori Morimoto | ccb7cc7 | 2013-03-21 03:01:36 -0700 | [diff] [blame] | 52 | MACHINE_END |