blob: 99a2004cac76eb86d09dd558800e615b28788ac3 [file] [log] [blame]
Magnus Damm6d9598e2010-11-17 10:59:31 +00001/*
2 * sh73a0 processor support
3 *
4 * Copyright (C) 2010 Takashi Yoshii
5 * Copyright (C) 2010 Magnus Damm
6 * Copyright (C) 2008 Yoshihiro Shimoda
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 2 of the License.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
Magnus Damm6d9598e2010-11-17 10:59:31 +000016 */
17#include <linux/kernel.h>
18#include <linux/init.h>
19#include <linux/interrupt.h>
20#include <linux/irq.h>
Simon Horman48609532012-11-21 22:00:15 +090021#include <linux/of_platform.h>
Magnus Damm6d9598e2010-11-17 10:59:31 +000022#include <linux/delay.h>
23#include <linux/input.h>
24#include <linux/io.h>
Geert Uytterhoevended59d62014-06-20 18:53:09 +020025
Magnus Damm0b52b252015-01-09 14:08:49 +010026#include <asm/hardware/cache-l2x0.h>
Magnus Damm50e15c32012-02-29 21:37:27 +090027#include <asm/mach/map.h>
Magnus Damm6d9598e2010-11-17 10:59:31 +000028#include <asm/mach/arch.h>
Magnus Damm3be26fd2012-03-06 17:36:45 +090029#include <asm/mach/time.h>
Geert Uytterhoevended59d62014-06-20 18:53:09 +020030
Magnus Dammfd44aa52014-06-17 16:47:37 +090031#include "common.h"
Geert Uytterhoevended59d62014-06-20 18:53:09 +020032#include "sh73a0.h"
Magnus Damm6d9598e2010-11-17 10:59:31 +000033
Magnus Damm50e15c32012-02-29 21:37:27 +090034static struct map_desc sh73a0_io_desc[] __initdata = {
Geert Uytterhoeven178a2b02014-11-14 17:07:07 +010035 /* create a 1:1 identity mapping for 0xe6xxxxxx
Magnus Damm50e15c32012-02-29 21:37:27 +090036 * used by CPGA, INTC and PFC.
37 */
38 {
39 .virtual = 0xe6000000,
40 .pfn = __phys_to_pfn(0xe6000000),
41 .length = 256 << 20,
42 .type = MT_DEVICE_NONSHARED
43 },
44};
45
Geert Uytterhoeven9a986392015-06-17 11:31:20 +020046static void __init sh73a0_map_io(void)
Magnus Damm50e15c32012-02-29 21:37:27 +090047{
Geert Uytterhoeven7a2071c2014-11-14 16:49:47 +010048 debug_ll_io_init();
Magnus Damm50e15c32012-02-29 21:37:27 +090049 iotable_init(sh73a0_io_desc, ARRAY_SIZE(sh73a0_io_desc));
50}
51
Magnus Damm0b52b252015-01-09 14:08:49 +010052static void __init sh73a0_generic_init(void)
53{
54#ifdef CONFIG_CACHE_L2X0
55 /* Shared attribute override enable, 64K*8way */
56 l2x0_init(IOMEM(0xf0100000), 0x00400000, 0xc20f0fff);
57#endif
58 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
59}
60
Nicolas Pitre19c233b2015-07-27 18:27:52 -040061static const char *const sh73a0_boards_compat_dt[] __initconst = {
Simon Horman48609532012-11-21 22:00:15 +090062 "renesas,sh73a0",
63 NULL,
64};
65
66DT_MACHINE_START(SH73A0_DT, "Generic SH73A0 (Flattened Device Tree)")
Simon Hormanf9989502013-02-15 21:38:20 +090067 .smp = smp_ops(sh73a0_smp_ops),
Simon Horman48609532012-11-21 22:00:15 +090068 .map_io = sh73a0_map_io,
Geert Uytterhoevendac95362014-10-17 14:24:39 +020069 .init_early = shmobile_init_delay,
Magnus Damm0b52b252015-01-09 14:08:49 +010070 .init_machine = sh73a0_generic_init,
Magnus Damme604d802014-07-31 08:32:15 +090071 .init_late = shmobile_init_late,
Simon Horman48609532012-11-21 22:00:15 +090072 .dt_compat = sh73a0_boards_compat_dt,
73MACHINE_END