xref: /openbmc/linux/arch/arm/mach-spear/spear1310.c (revision 6e8887f6)
1 /*
2  * arch/arm/mach-spear13xx/spear1310.c
3  *
4  * SPEAr1310 machine source file
5  *
6  * Copyright (C) 2012 ST Microelectronics
7  * Viresh Kumar <viresh.linux@gmail.com>
8  *
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/irqchip.h>
18 #include <linux/of_platform.h>
19 #include <linux/pata_arasan_cf_data.h>
20 #include <asm/mach/arch.h>
21 #include <asm/mach/map.h>
22 #include "generic.h"
23 #include <mach/spear.h>
24 
25 /* Base addresses */
26 #define SPEAR1310_RAS_GRP1_BASE			UL(0xD8000000)
27 #define VA_SPEAR1310_RAS_GRP1_BASE		UL(0xFA000000)
28 
29 static void __init spear1310_dt_init(void)
30 {
31 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
32 }
33 
34 static 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  */
45 struct map_desc spear1310_io_desc[] __initdata = {
46 	{
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 
54 static void __init spear1310_map_io(void)
55 {
56 	iotable_init(spear1310_io_desc, ARRAY_SIZE(spear1310_io_desc));
57 	spear13xx_map_io();
58 }
59 
60 DT_MACHINE_START(SPEAR1310_DT, "ST SPEAr1310 SoC with Flattened Device Tree")
61 	.smp		=	smp_ops(spear13xx_smp_ops),
62 	.map_io		=	spear1310_map_io,
63 	.init_irq	=	irqchip_init,
64 	.init_time	=	spear13xx_timer_init,
65 	.init_machine	=	spear1310_dt_init,
66 	.restart	=	spear_restart,
67 	.dt_compat	=	spear1310_dt_board_compat,
68 MACHINE_END
69