Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
spear1310.c
Go to the documentation of this file.
1 /*
2  * arch/arm/mach-spear13xx/spear1310.c
3  *
4  * SPEAr1310 machine source file
5  *
6  * Copyright (C) 2012 ST Microelectronics
7  * Viresh Kumar <[email protected]>
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/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 
30 /* ssp device registration */
31 static struct pl022_ssp_controller ssp1_plat_data = {
32  .bus_id = 0,
33  .enable_dma = 0,
34  .num_chipselect = 3,
35 };
36 
37 /* Add SPEAr1310 auxdata to pass platform data */
38 static struct of_dev_auxdata spear1310_auxdata_lookup[] __initdata = {
39  OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL, &cf_dma_priv),
40  OF_DEV_AUXDATA("snps,dma-spear1340", DMAC0_BASE, NULL, &dmac_plat_data),
41  OF_DEV_AUXDATA("snps,dma-spear1340", DMAC1_BASE, NULL, &dmac_plat_data),
42  OF_DEV_AUXDATA("arm,pl022", SSP_BASE, NULL, &pl022_plat_data),
43 
44  OF_DEV_AUXDATA("arm,pl022", SPEAR1310_SSP1_BASE, NULL, &ssp1_plat_data),
45  {}
46 };
47 
48 static void __init spear1310_dt_init(void)
49 {
50  of_platform_populate(NULL, of_default_bus_match_table,
51  spear1310_auxdata_lookup, NULL);
52 }
53 
54 static const char * const spear1310_dt_board_compat[] = {
55  "st,spear1310",
56  "st,spear1310-evb",
57  NULL,
58 };
59 
60 /*
61  * Following will create 16MB static virtual/physical mappings
62  * PHYSICAL VIRTUAL
63  * 0xD8000000 0xFA000000
64  */
65 struct map_desc spear1310_io_desc[] __initdata = {
66  {
67  .virtual = VA_SPEAR1310_RAS_GRP1_BASE,
68  .pfn = __phys_to_pfn(SPEAR1310_RAS_GRP1_BASE),
69  .length = SZ_16M,
70  .type = MT_DEVICE
71  },
72 };
73 
74 static void __init spear1310_map_io(void)
75 {
76  iotable_init(spear1310_io_desc, ARRAY_SIZE(spear1310_io_desc));
78 }
79 
80 DT_MACHINE_START(SPEAR1310_DT, "ST SPEAr1310 SoC with Flattened Device Tree")
81  .smp = smp_ops(spear13xx_smp_ops),
82  .map_io = spear1310_map_io,
83  .init_irq = spear13xx_dt_init_irq,
84  .handle_irq = gic_handle_irq,
85  .timer = &spear13xx_timer,
86  .init_machine = spear1310_dt_init,
87  .restart = spear_restart,
88  .dt_compat = spear1310_dt_board_compat,