blob: 593a756dc7f7ddcf56e6bb7c551954e811db401c [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>
18#include <asm/hardware/gic.h>
19#include <asm/mach/arch.h>
20#include <asm/mach/map.h>
21#include <mach/generic.h>
22#include <mach/spear.h>
23
24/* Base addresses */
25#define SPEAR1310_SSP1_BASE UL(0x5D400000)
26#define SPEAR1310_SATA0_BASE UL(0xB1000000)
27#define SPEAR1310_SATA1_BASE UL(0xB1800000)
28#define SPEAR1310_SATA2_BASE UL(0xB4000000)
29
Vipul Kumar Samar07e812a2012-10-17 12:08:26 +053030#define SPEAR1310_RAS_GRP1_BASE UL(0xD8000000)
31#define VA_SPEAR1310_RAS_GRP1_BASE UL(0xFA000000)
32#define SPEAR1310_RAS_BASE UL(0xD8400000)
33#define VA_SPEAR1310_RAS_BASE IOMEM(UL(0xFA400000))
34
Viresh Kumare3978dc2012-04-19 22:23:13 +053035/* ssp device registration */
36static struct pl022_ssp_controller ssp1_plat_data = {
37 .bus_id = 0,
38 .enable_dma = 0,
39 .num_chipselect = 3,
40};
41
42/* Add SPEAr1310 auxdata to pass platform data */
43static struct of_dev_auxdata spear1310_auxdata_lookup[] __initdata = {
44 OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL, &cf_dma_priv),
45 OF_DEV_AUXDATA("snps,dma-spear1340", DMAC0_BASE, NULL, &dmac_plat_data),
46 OF_DEV_AUXDATA("snps,dma-spear1340", DMAC1_BASE, NULL, &dmac_plat_data),
47 OF_DEV_AUXDATA("arm,pl022", SSP_BASE, NULL, &pl022_plat_data),
48
49 OF_DEV_AUXDATA("arm,pl022", SPEAR1310_SSP1_BASE, NULL, &ssp1_plat_data),
50 {}
51};
52
53static void __init spear1310_dt_init(void)
54{
55 of_platform_populate(NULL, of_default_bus_match_table,
56 spear1310_auxdata_lookup, NULL);
57}
58
59static const char * const spear1310_dt_board_compat[] = {
60 "st,spear1310",
61 "st,spear1310-evb",
62 NULL,
63};
64
65/*
66 * Following will create 16MB static virtual/physical mappings
67 * PHYSICAL VIRTUAL
68 * 0xD8000000 0xFA000000
69 */
70struct map_desc spear1310_io_desc[] __initdata = {
71 {
72 .virtual = VA_SPEAR1310_RAS_GRP1_BASE,
73 .pfn = __phys_to_pfn(SPEAR1310_RAS_GRP1_BASE),
74 .length = SZ_16M,
75 .type = MT_DEVICE
76 },
77};
78
79static void __init spear1310_map_io(void)
80{
81 iotable_init(spear1310_io_desc, ARRAY_SIZE(spear1310_io_desc));
82 spear13xx_map_io();
83}
84
85DT_MACHINE_START(SPEAR1310_DT, "ST SPEAr1310 SoC with Flattened Device Tree")
Arnd Bergmann2d8b21d2011-09-08 13:15:22 +010086 .smp = smp_ops(spear13xx_smp_ops),
Viresh Kumare3978dc2012-04-19 22:23:13 +053087 .map_io = spear1310_map_io,
88 .init_irq = spear13xx_dt_init_irq,
89 .handle_irq = gic_handle_irq,
90 .timer = &spear13xx_timer,
91 .init_machine = spear1310_dt_init,
92 .restart = spear_restart,
93 .dt_compat = spear1310_dt_board_compat,
94MACHINE_END