2 * arch/arm/mach-spear3xx/spear310.c
4 * SPEAr310 machine source file
6 * Copyright (C) 2009-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) "SPEAr310: " fmt
16 #include <linux/amba/pl08x.h>
17 #include <linux/amba/serial.h>
18 #include <linux/of_platform.h>
19 #include <asm/mach/arch.h>
21 #include <mach/spear.h>
23 #define SPEAR310_UART1_BASE UL(0xB2000000)
24 #define SPEAR310_UART2_BASE UL(0xB2080000)
25 #define SPEAR310_UART3_BASE UL(0xB2100000)
26 #define SPEAR310_UART4_BASE UL(0xB2180000)
27 #define SPEAR310_UART5_BASE UL(0xB2200000)
29 /* DMAC platform data's slave info */
30 struct pl08x_channel_data spear310_dma_info[] = {
36 .periph_buses = PL08X_AHB1,
42 .periph_buses = PL08X_AHB1,
48 .periph_buses = PL08X_AHB1,
54 .periph_buses = PL08X_AHB1,
60 .periph_buses = PL08X_AHB1,
66 .periph_buses = PL08X_AHB1,
72 .periph_buses = PL08X_AHB1,
78 .periph_buses = PL08X_AHB1,
84 .periph_buses = PL08X_AHB1,
86 .bus_id = "from_jpeg",
90 .periph_buses = PL08X_AHB1,
96 .periph_buses = PL08X_AHB1,
102 .periph_buses = PL08X_AHB1,
104 .bus_id = "uart2_rx",
108 .periph_buses = PL08X_AHB1,
110 .bus_id = "uart2_tx",
114 .periph_buses = PL08X_AHB1,
116 .bus_id = "uart3_rx",
120 .periph_buses = PL08X_AHB1,
122 .bus_id = "uart3_tx",
126 .periph_buses = PL08X_AHB1,
128 .bus_id = "uart4_rx",
132 .periph_buses = PL08X_AHB1,
134 .bus_id = "uart4_tx",
138 .periph_buses = PL08X_AHB1,
140 .bus_id = "uart5_rx",
144 .periph_buses = PL08X_AHB1,
146 .bus_id = "uart5_tx",
150 .periph_buses = PL08X_AHB1,
156 .periph_buses = PL08X_AHB1,
162 .periph_buses = PL08X_AHB1,
168 .periph_buses = PL08X_AHB1,
174 .periph_buses = PL08X_AHB1,
180 .periph_buses = PL08X_AHB1,
186 .periph_buses = PL08X_AHB1,
190 /* uart devices plat data */
191 static struct amba_pl011_data spear310_uart_data[] = {
193 .dma_filter = pl08x_filter_id,
194 .dma_tx_param = "uart1_tx",
195 .dma_rx_param = "uart1_rx",
197 .dma_filter = pl08x_filter_id,
198 .dma_tx_param = "uart2_tx",
199 .dma_rx_param = "uart2_rx",
201 .dma_filter = pl08x_filter_id,
202 .dma_tx_param = "uart3_tx",
203 .dma_rx_param = "uart3_rx",
205 .dma_filter = pl08x_filter_id,
206 .dma_tx_param = "uart4_tx",
207 .dma_rx_param = "uart4_rx",
209 .dma_filter = pl08x_filter_id,
210 .dma_tx_param = "uart5_tx",
211 .dma_rx_param = "uart5_rx",
215 /* Add SPEAr310 auxdata to pass platform data */
216 static struct of_dev_auxdata spear310_auxdata_lookup[] __initdata = {
217 OF_DEV_AUXDATA("arm,pl022", SPEAR3XX_ICM1_SSP_BASE, NULL,
219 OF_DEV_AUXDATA("arm,pl080", SPEAR_ICM3_DMA_BASE, NULL,
221 OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART1_BASE, NULL,
222 &spear310_uart_data[0]),
223 OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART2_BASE, NULL,
224 &spear310_uart_data[1]),
225 OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART3_BASE, NULL,
226 &spear310_uart_data[2]),
227 OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART4_BASE, NULL,
228 &spear310_uart_data[3]),
229 OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART5_BASE, NULL,
230 &spear310_uart_data[4]),
234 static void __init spear310_dt_init(void)
236 pl080_plat_data.slave_channels = spear310_dma_info;
237 pl080_plat_data.num_slave_channels = ARRAY_SIZE(spear310_dma_info);
239 of_platform_populate(NULL, of_default_bus_match_table,
240 spear310_auxdata_lookup, NULL);
243 static const char * const spear310_dt_board_compat[] = {
249 static void __init spear310_map_io(void)
254 DT_MACHINE_START(SPEAR310_DT, "ST SPEAr310 SoC with Flattened Device Tree")
255 .map_io = spear310_map_io,
256 .init_time = spear3xx_timer_init,
257 .init_machine = spear310_dt_init,
258 .restart = spear_restart,
259 .dt_compat = spear310_dt_board_compat,