1 // SPDX-License-Identifier: GPL-2.0-only
3 * arch/arm/mach-spear3xx/spear310.c
5 * SPEAr310 machine source file
7 * Copyright (C) 2009-2012 ST Microelectronics
8 * Viresh Kumar <vireshk@kernel.org>
11 #define pr_fmt(fmt) "SPEAr310: " fmt
13 #include <linux/amba/pl08x.h>
14 #include <linux/amba/serial.h>
15 #include <linux/of_platform.h>
16 #include <asm/mach/arch.h>
20 #define SPEAR310_UART1_BASE UL(0xB2000000)
21 #define SPEAR310_UART2_BASE UL(0xB2080000)
22 #define SPEAR310_UART3_BASE UL(0xB2100000)
23 #define SPEAR310_UART4_BASE UL(0xB2180000)
24 #define SPEAR310_UART5_BASE UL(0xB2200000)
26 /* DMAC platform data's slave info */
27 struct pl08x_channel_data spear310_dma_info
[] = {
33 .periph_buses
= PL08X_AHB1
,
39 .periph_buses
= PL08X_AHB1
,
45 .periph_buses
= PL08X_AHB1
,
51 .periph_buses
= PL08X_AHB1
,
57 .periph_buses
= PL08X_AHB1
,
63 .periph_buses
= PL08X_AHB1
,
69 .periph_buses
= PL08X_AHB1
,
75 .periph_buses
= PL08X_AHB1
,
81 .periph_buses
= PL08X_AHB1
,
83 .bus_id
= "from_jpeg",
87 .periph_buses
= PL08X_AHB1
,
93 .periph_buses
= PL08X_AHB1
,
99 .periph_buses
= PL08X_AHB1
,
101 .bus_id
= "uart2_rx",
105 .periph_buses
= PL08X_AHB1
,
107 .bus_id
= "uart2_tx",
111 .periph_buses
= PL08X_AHB1
,
113 .bus_id
= "uart3_rx",
117 .periph_buses
= PL08X_AHB1
,
119 .bus_id
= "uart3_tx",
123 .periph_buses
= PL08X_AHB1
,
125 .bus_id
= "uart4_rx",
129 .periph_buses
= PL08X_AHB1
,
131 .bus_id
= "uart4_tx",
135 .periph_buses
= PL08X_AHB1
,
137 .bus_id
= "uart5_rx",
141 .periph_buses
= PL08X_AHB1
,
143 .bus_id
= "uart5_tx",
147 .periph_buses
= PL08X_AHB1
,
153 .periph_buses
= PL08X_AHB1
,
159 .periph_buses
= PL08X_AHB1
,
165 .periph_buses
= PL08X_AHB1
,
171 .periph_buses
= PL08X_AHB1
,
177 .periph_buses
= PL08X_AHB1
,
183 .periph_buses
= PL08X_AHB1
,
187 /* uart devices plat data */
188 static struct amba_pl011_data spear310_uart_data
[] = {
190 .dma_filter
= pl08x_filter_id
,
191 .dma_tx_param
= "uart1_tx",
192 .dma_rx_param
= "uart1_rx",
194 .dma_filter
= pl08x_filter_id
,
195 .dma_tx_param
= "uart2_tx",
196 .dma_rx_param
= "uart2_rx",
198 .dma_filter
= pl08x_filter_id
,
199 .dma_tx_param
= "uart3_tx",
200 .dma_rx_param
= "uart3_rx",
202 .dma_filter
= pl08x_filter_id
,
203 .dma_tx_param
= "uart4_tx",
204 .dma_rx_param
= "uart4_rx",
206 .dma_filter
= pl08x_filter_id
,
207 .dma_tx_param
= "uart5_tx",
208 .dma_rx_param
= "uart5_rx",
212 /* Add SPEAr310 auxdata to pass platform data */
213 static struct of_dev_auxdata spear310_auxdata_lookup
[] __initdata
= {
214 OF_DEV_AUXDATA("arm,pl022", SPEAR3XX_ICM1_SSP_BASE
, NULL
,
216 OF_DEV_AUXDATA("arm,pl080", SPEAR_ICM3_DMA_BASE
, NULL
,
218 OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART1_BASE
, NULL
,
219 &spear310_uart_data
[0]),
220 OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART2_BASE
, NULL
,
221 &spear310_uart_data
[1]),
222 OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART3_BASE
, NULL
,
223 &spear310_uart_data
[2]),
224 OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART4_BASE
, NULL
,
225 &spear310_uart_data
[3]),
226 OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART5_BASE
, NULL
,
227 &spear310_uart_data
[4]),
231 static void __init
spear310_dt_init(void)
233 pl080_plat_data
.slave_channels
= spear310_dma_info
;
234 pl080_plat_data
.num_slave_channels
= ARRAY_SIZE(spear310_dma_info
);
236 of_platform_default_populate(NULL
, spear310_auxdata_lookup
, NULL
);
239 static const char * const spear310_dt_board_compat
[] = {
245 static void __init
spear310_map_io(void)
250 DT_MACHINE_START(SPEAR310_DT
, "ST SPEAr310 SoC with Flattened Device Tree")
251 .map_io
= spear310_map_io
,
252 .init_time
= spear3xx_timer_init
,
253 .init_machine
= spear310_dt_init
,
254 .restart
= spear_restart
,
255 .dt_compat
= spear310_dt_board_compat
,