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/hardware/vic.h>
20 #include <asm/mach/arch.h>
21 #include <mach/generic.h>
22 #include <mach/spear.h>
24 #define SPEAR310_UART1_BASE UL(0xB2000000)
25 #define SPEAR310_UART2_BASE UL(0xB2080000)
26 #define SPEAR310_UART3_BASE UL(0xB2100000)
27 #define SPEAR310_UART4_BASE UL(0xB2180000)
28 #define SPEAR310_UART5_BASE UL(0xB2200000)
30 /* DMAC platform data's slave info */
31 struct pl08x_channel_data spear310_dma_info
[] = {
37 .periph_buses
= PL08X_AHB1
,
43 .periph_buses
= PL08X_AHB1
,
49 .periph_buses
= PL08X_AHB1
,
55 .periph_buses
= PL08X_AHB1
,
61 .periph_buses
= PL08X_AHB1
,
67 .periph_buses
= PL08X_AHB1
,
73 .periph_buses
= PL08X_AHB1
,
79 .periph_buses
= PL08X_AHB1
,
85 .periph_buses
= PL08X_AHB1
,
87 .bus_id
= "from_jpeg",
91 .periph_buses
= PL08X_AHB1
,
97 .periph_buses
= PL08X_AHB1
,
103 .periph_buses
= PL08X_AHB1
,
105 .bus_id
= "uart2_rx",
109 .periph_buses
= PL08X_AHB1
,
111 .bus_id
= "uart2_tx",
115 .periph_buses
= PL08X_AHB1
,
117 .bus_id
= "uart3_rx",
121 .periph_buses
= PL08X_AHB1
,
123 .bus_id
= "uart3_tx",
127 .periph_buses
= PL08X_AHB1
,
129 .bus_id
= "uart4_rx",
133 .periph_buses
= PL08X_AHB1
,
135 .bus_id
= "uart4_tx",
139 .periph_buses
= PL08X_AHB1
,
141 .bus_id
= "uart5_rx",
145 .periph_buses
= PL08X_AHB1
,
147 .bus_id
= "uart5_tx",
151 .periph_buses
= PL08X_AHB1
,
157 .periph_buses
= PL08X_AHB1
,
163 .periph_buses
= PL08X_AHB1
,
169 .periph_buses
= PL08X_AHB1
,
175 .periph_buses
= PL08X_AHB1
,
181 .periph_buses
= PL08X_AHB1
,
187 .periph_buses
= PL08X_AHB1
,
191 /* uart devices plat data */
192 static struct amba_pl011_data spear310_uart_data
[] = {
194 .dma_filter
= pl08x_filter_id
,
195 .dma_tx_param
= "uart1_tx",
196 .dma_rx_param
= "uart1_rx",
198 .dma_filter
= pl08x_filter_id
,
199 .dma_tx_param
= "uart2_tx",
200 .dma_rx_param
= "uart2_rx",
202 .dma_filter
= pl08x_filter_id
,
203 .dma_tx_param
= "uart3_tx",
204 .dma_rx_param
= "uart3_rx",
206 .dma_filter
= pl08x_filter_id
,
207 .dma_tx_param
= "uart4_tx",
208 .dma_rx_param
= "uart4_rx",
210 .dma_filter
= pl08x_filter_id
,
211 .dma_tx_param
= "uart5_tx",
212 .dma_rx_param
= "uart5_rx",
216 /* Add SPEAr310 auxdata to pass platform data */
217 static struct of_dev_auxdata spear310_auxdata_lookup
[] __initdata
= {
218 OF_DEV_AUXDATA("arm,pl022", SPEAR3XX_ICM1_SSP_BASE
, NULL
,
220 OF_DEV_AUXDATA("arm,pl080", SPEAR3XX_ICM3_DMA_BASE
, NULL
,
222 OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART1_BASE
, NULL
,
223 &spear310_uart_data
[0]),
224 OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART2_BASE
, NULL
,
225 &spear310_uart_data
[1]),
226 OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART3_BASE
, NULL
,
227 &spear310_uart_data
[2]),
228 OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART4_BASE
, NULL
,
229 &spear310_uart_data
[3]),
230 OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART5_BASE
, NULL
,
231 &spear310_uart_data
[4]),
235 static void __init
spear310_dt_init(void)
237 pl080_plat_data
.slave_channels
= spear310_dma_info
;
238 pl080_plat_data
.num_slave_channels
= ARRAY_SIZE(spear310_dma_info
);
240 of_platform_populate(NULL
, of_default_bus_match_table
,
241 spear310_auxdata_lookup
, NULL
);
244 static const char * const spear310_dt_board_compat
[] = {
250 static void __init
spear310_map_io(void)
255 DT_MACHINE_START(SPEAR310_DT
, "ST SPEAr310 SoC with Flattened Device Tree")
256 .map_io
= spear310_map_io
,
257 .init_irq
= spear3xx_dt_init_irq
,
258 .handle_irq
= vic_handle_irq
,
259 .timer
= &spear3xx_timer
,
260 .init_machine
= spear310_dt_init
,
261 .restart
= spear_restart
,
262 .dt_compat
= spear310_dt_board_compat
,