blob: d9ce4d8000f092eb005b2624f87b467a69c996b4 [file] [log] [blame]
Viresh Kumare3978dc2012-04-19 22:23:13 +05301/*
2 * arch/arm/mach-spear13xx/spear1310.c
3 *
4 * SPEAr1310 machine source file
5 *
6 * Copyright (C) 2012 ST Microelectronics
Viresh Kumar10d89352012-06-20 12:53:02 -07007 * Viresh Kumar <viresh.linux@gmail.com>
Viresh Kumare3978dc2012-04-19 22:23:13 +05308 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#define pr_fmt(fmt) "SPEAr1310: " fmt
15
16#include <linux/amba/pl022.h>
17#include <linux/of_platform.h>
Vipul Kumar Samar300a6852012-10-15 17:55:58 +053018#include <linux/pata_arasan_cf_data.h>
Viresh Kumare3978dc2012-04-19 22:23:13 +053019#include <asm/mach/arch.h>
20#include <asm/mach/map.h>
Arnd Bergmann2b9c6132012-12-02 15:49:04 +010021#include "generic.h"
Viresh Kumare3978dc2012-04-19 22:23:13 +053022#include <mach/spear.h>
23
24/* Base addresses */
Vipul Kumar Samar07e812a2012-10-17 12:08:26 +053025#define SPEAR1310_RAS_GRP1_BASE UL(0xD8000000)
26#define VA_SPEAR1310_RAS_GRP1_BASE UL(0xFA000000)
Vipul Kumar Samar07e812a2012-10-17 12:08:26 +053027
Viresh Kumare3978dc2012-04-19 22:23:13 +053028static void __init spear1310_dt_init(void)
29{
Arnd Bergmann6e8887f62013-01-28 21:48:47 +000030 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
Viresh Kumar2449d332014-03-10 15:43:18 +053031 platform_device_register_simple("spear-cpufreq", -1, NULL, 0);
Viresh Kumare3978dc2012-04-19 22:23:13 +053032}
33
34static const char * const spear1310_dt_board_compat[] = {
35 "st,spear1310",
36 "st,spear1310-evb",
37 NULL,
38};
39
40/*
41 * Following will create 16MB static virtual/physical mappings
42 * PHYSICAL VIRTUAL
43 * 0xD8000000 0xFA000000
44 */
Sachin Kamat17681ff2014-06-24 17:13:54 +053045static struct map_desc spear1310_io_desc[] __initdata = {
Viresh Kumare3978dc2012-04-19 22:23:13 +053046 {
47 .virtual = VA_SPEAR1310_RAS_GRP1_BASE,
48 .pfn = __phys_to_pfn(SPEAR1310_RAS_GRP1_BASE),
49 .length = SZ_16M,
50 .type = MT_DEVICE
51 },
52};
53
54static void __init spear1310_map_io(void)
55{
56 iotable_init(spear1310_io_desc, ARRAY_SIZE(spear1310_io_desc));
57 spear13xx_map_io();
58}
59
60DT_MACHINE_START(SPEAR1310_DT, "ST SPEAr1310 SoC with Flattened Device Tree")
Arnd Bergmann2d8b21d2011-09-08 13:15:22 +010061 .smp = smp_ops(spear13xx_smp_ops),
Viresh Kumare3978dc2012-04-19 22:23:13 +053062 .map_io = spear1310_map_io,
Stephen Warren6bb27d72012-11-08 12:40:59 -070063 .init_time = spear13xx_timer_init,
Viresh Kumare3978dc2012-04-19 22:23:13 +053064 .init_machine = spear1310_dt_init,
65 .restart = spear_restart,
66 .dt_compat = spear1310_dt_board_compat,
67MACHINE_END