ipv4: Minor logic clean-up in ipv4_mtu
[linux-2.6/cjktty.git] / arch / arm / mach-spear13xx / spear1310.c
blob732d29bc73307231ccc9009ba1b80195a7153588
1 /*
2 * arch/arm/mach-spear13xx/spear1310.c
4 * SPEAr1310 machine source file
6 * Copyright (C) 2012 ST Microelectronics
7 * Viresh Kumar <viresh.linux@gmail.com>
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.
14 #define pr_fmt(fmt) "SPEAr1310: " fmt
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>
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)
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,
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),
44 OF_DEV_AUXDATA("arm,pl022", SPEAR1310_SSP1_BASE, NULL, &ssp1_plat_data),
48 static void __init spear1310_dt_init(void)
50 of_platform_populate(NULL, of_default_bus_match_table,
51 spear1310_auxdata_lookup, NULL);
54 static const char * const spear1310_dt_board_compat[] = {
55 "st,spear1310",
56 "st,spear1310-evb",
57 NULL,
61 * Following will create 16MB static virtual/physical mappings
62 * PHYSICAL VIRTUAL
63 * 0xD8000000 0xFA000000
65 struct map_desc spear1310_io_desc[] __initdata = {
67 .virtual = VA_SPEAR1310_RAS_GRP1_BASE,
68 .pfn = __phys_to_pfn(SPEAR1310_RAS_GRP1_BASE),
69 .length = SZ_16M,
70 .type = MT_DEVICE
74 static void __init spear1310_map_io(void)
76 iotable_init(spear1310_io_desc, ARRAY_SIZE(spear1310_io_desc));
77 spear13xx_map_io();
80 DT_MACHINE_START(SPEAR1310_DT, "ST SPEAr1310 SoC with Flattened Device Tree")
81 .map_io = spear1310_map_io,
82 .init_irq = spear13xx_dt_init_irq,
83 .handle_irq = gic_handle_irq,
84 .timer = &spear13xx_timer,
85 .init_machine = spear1310_dt_init,
86 .restart = spear_restart,
87 .dt_compat = spear1310_dt_board_compat,
88 MACHINE_END