Simon Horman | b8b82b2 | 2012-11-22 00:34:25 +0900 | [diff] [blame] | 1 | /* |
| 2 | * KZM-A9-GT board support - Reference Device Tree Implementation |
| 3 | * |
| 4 | * Copyright (C) 2012 Horms Solutions Ltd. |
| 5 | * |
| 6 | * Based on board-kzm9g.c |
| 7 | * Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License as published by |
| 11 | * the Free Software Foundation; version 2 of the License. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
Simon Horman | b8b82b2 | 2012-11-22 00:34:25 +0900 | [diff] [blame] | 17 | */ |
| 18 | |
| 19 | #include <linux/delay.h> |
Simon Horman | b8b82b2 | 2012-11-22 00:34:25 +0900 | [diff] [blame] | 20 | #include <linux/io.h> |
| 21 | #include <linux/irq.h> |
Simon Horman | b8b82b2 | 2012-11-22 00:34:25 +0900 | [diff] [blame] | 22 | #include <linux/input.h> |
| 23 | #include <linux/of_platform.h> |
Geert Uytterhoeven | ded59d6 | 2014-06-20 18:53:09 +0200 | [diff] [blame] | 24 | |
Simon Horman | b8b82b2 | 2012-11-22 00:34:25 +0900 | [diff] [blame] | 25 | #include <asm/hardware/cache-l2x0.h> |
| 26 | #include <asm/mach-types.h> |
| 27 | #include <asm/mach/arch.h> |
Geert Uytterhoeven | ded59d6 | 2014-06-20 18:53:09 +0200 | [diff] [blame] | 28 | |
Magnus Damm | fd44aa5 | 2014-06-17 16:47:37 +0900 | [diff] [blame] | 29 | #include "common.h" |
Geert Uytterhoeven | ded59d6 | 2014-06-20 18:53:09 +0200 | [diff] [blame] | 30 | #include "sh73a0.h" |
Simon Horman | b8b82b2 | 2012-11-22 00:34:25 +0900 | [diff] [blame] | 31 | |
Simon Horman | b8b82b2 | 2012-11-22 00:34:25 +0900 | [diff] [blame] | 32 | static void __init kzm_init(void) |
| 33 | { |
| 34 | sh73a0_add_standard_devices_dt(); |
Guennadi Liakhovetski | f017d01 | 2013-02-08 19:38:27 +0100 | [diff] [blame] | 35 | |
Simon Horman | b8b82b2 | 2012-11-22 00:34:25 +0900 | [diff] [blame] | 36 | #ifdef CONFIG_CACHE_L2X0 |
Russell King | 36bccb1 | 2014-03-19 12:44:41 +0000 | [diff] [blame] | 37 | /* Shared attribute override enable, 64K*8way */ |
Russell King | 2edb89c | 2014-03-19 12:16:36 +0000 | [diff] [blame] | 38 | l2x0_init(IOMEM(0xf0100000), 0x00400000, 0xc20f0fff); |
Simon Horman | b8b82b2 | 2012-11-22 00:34:25 +0900 | [diff] [blame] | 39 | #endif |
| 40 | } |
| 41 | |
Geert Uytterhoeven | 534547c | 2014-11-07 14:46:32 +0100 | [diff] [blame] | 42 | #define RESCNT2 IOMEM(0xe6188020) |
| 43 | static void kzm9g_restart(enum reboot_mode mode, const char *cmd) |
| 44 | { |
| 45 | /* Do soft power on reset */ |
| 46 | writel((1 << 31), RESCNT2); |
| 47 | } |
| 48 | |
Simon Horman | b8b82b2 | 2012-11-22 00:34:25 +0900 | [diff] [blame] | 49 | static const char *kzm9g_boards_compat_dt[] __initdata = { |
| 50 | "renesas,kzm9g-reference", |
| 51 | NULL, |
| 52 | }; |
| 53 | |
Simon Horman | b8b82b2 | 2012-11-22 00:34:25 +0900 | [diff] [blame] | 54 | DT_MACHINE_START(KZM9G_DT, "kzm9g-reference") |
| 55 | .smp = smp_ops(sh73a0_smp_ops), |
| 56 | .map_io = sh73a0_map_io, |
Magnus Damm | fc35ca2 | 2014-08-20 22:03:30 +0900 | [diff] [blame] | 57 | .init_early = shmobile_init_delay, |
Simon Horman | b8b82b2 | 2012-11-22 00:34:25 +0900 | [diff] [blame] | 58 | .init_machine = kzm_init, |
Magnus Damm | eeed09e | 2014-07-31 08:32:24 +0900 | [diff] [blame] | 59 | .init_late = shmobile_init_late, |
Geert Uytterhoeven | 534547c | 2014-11-07 14:46:32 +0100 | [diff] [blame] | 60 | .restart = kzm9g_restart, |
Simon Horman | b8b82b2 | 2012-11-22 00:34:25 +0900 | [diff] [blame] | 61 | .dt_compat = kzm9g_boards_compat_dt, |
| 62 | MACHINE_END |