blob: 325b89579be105b4abe626f5b9086c727fd3d950 [file] [log] [blame]
viresh kumarbc4e8142010-04-01 12:30:58 +01001/*
2 * arch/arm/mach-spear3xx/spear300.c
3 *
4 * SPEAr300 machine source file
5 *
Viresh Kumarc5fa4fd2012-03-23 00:17:43 +05306 * Copyright (C) 2009-2012 ST Microelectronics
Viresh Kumarda899472015-07-17 16:23:50 -07007 * Viresh Kumar <vireshk@kernel.org>
viresh kumarbc4e8142010-04-01 12:30:58 +01008 *
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
Viresh Kumar5fb00f92012-03-26 10:39:43 +053014#define pr_fmt(fmt) "SPEAr300: " fmt
15
Viresh Kumar0b7ee712012-03-26 10:29:23 +053016#include <linux/amba/pl08x.h>
Viresh Kumarc5fa4fd2012-03-23 00:17:43 +053017#include <linux/of_platform.h>
Viresh Kumarc5fa4fd2012-03-23 00:17:43 +053018#include <asm/mach/arch.h>
Arnd Bergmann2b9c6132012-12-02 15:49:04 +010019#include "generic.h"
Arnd Bergmann5019f0b2012-04-11 17:30:11 +000020#include <mach/spear.h>
21
Viresh Kumar0b7ee712012-03-26 10:29:23 +053022/* DMAC platform data's slave info */
23struct pl08x_channel_data spear300_dma_info[] = {
24 {
25 .bus_id = "uart0_rx",
26 .min_signal = 2,
27 .max_signal = 2,
28 .muxval = 0,
Viresh Kumar0b7ee712012-03-26 10:29:23 +053029 .periph_buses = PL08X_AHB1,
30 }, {
31 .bus_id = "uart0_tx",
32 .min_signal = 3,
33 .max_signal = 3,
34 .muxval = 0,
Viresh Kumar0b7ee712012-03-26 10:29:23 +053035 .periph_buses = PL08X_AHB1,
36 }, {
37 .bus_id = "ssp0_rx",
38 .min_signal = 8,
39 .max_signal = 8,
40 .muxval = 0,
Viresh Kumar0b7ee712012-03-26 10:29:23 +053041 .periph_buses = PL08X_AHB1,
42 }, {
43 .bus_id = "ssp0_tx",
44 .min_signal = 9,
45 .max_signal = 9,
46 .muxval = 0,
Viresh Kumar0b7ee712012-03-26 10:29:23 +053047 .periph_buses = PL08X_AHB1,
48 }, {
49 .bus_id = "i2c_rx",
50 .min_signal = 10,
51 .max_signal = 10,
52 .muxval = 0,
Viresh Kumar0b7ee712012-03-26 10:29:23 +053053 .periph_buses = PL08X_AHB1,
54 }, {
55 .bus_id = "i2c_tx",
56 .min_signal = 11,
57 .max_signal = 11,
58 .muxval = 0,
Viresh Kumar0b7ee712012-03-26 10:29:23 +053059 .periph_buses = PL08X_AHB1,
60 }, {
61 .bus_id = "irda",
62 .min_signal = 12,
63 .max_signal = 12,
64 .muxval = 0,
Viresh Kumar0b7ee712012-03-26 10:29:23 +053065 .periph_buses = PL08X_AHB1,
66 }, {
67 .bus_id = "adc",
68 .min_signal = 13,
69 .max_signal = 13,
70 .muxval = 0,
Viresh Kumar0b7ee712012-03-26 10:29:23 +053071 .periph_buses = PL08X_AHB1,
72 }, {
73 .bus_id = "to_jpeg",
74 .min_signal = 14,
75 .max_signal = 14,
76 .muxval = 0,
Viresh Kumar0b7ee712012-03-26 10:29:23 +053077 .periph_buses = PL08X_AHB1,
78 }, {
79 .bus_id = "from_jpeg",
80 .min_signal = 15,
81 .max_signal = 15,
82 .muxval = 0,
Viresh Kumar0b7ee712012-03-26 10:29:23 +053083 .periph_buses = PL08X_AHB1,
84 }, {
85 .bus_id = "ras0_rx",
86 .min_signal = 0,
87 .max_signal = 0,
88 .muxval = 1,
Viresh Kumar0b7ee712012-03-26 10:29:23 +053089 .periph_buses = PL08X_AHB1,
90 }, {
91 .bus_id = "ras0_tx",
92 .min_signal = 1,
93 .max_signal = 1,
94 .muxval = 1,
Viresh Kumar0b7ee712012-03-26 10:29:23 +053095 .periph_buses = PL08X_AHB1,
96 }, {
97 .bus_id = "ras1_rx",
98 .min_signal = 2,
99 .max_signal = 2,
100 .muxval = 1,
Viresh Kumar0b7ee712012-03-26 10:29:23 +0530101 .periph_buses = PL08X_AHB1,
102 }, {
103 .bus_id = "ras1_tx",
104 .min_signal = 3,
105 .max_signal = 3,
106 .muxval = 1,
Viresh Kumar0b7ee712012-03-26 10:29:23 +0530107 .periph_buses = PL08X_AHB1,
108 }, {
109 .bus_id = "ras2_rx",
110 .min_signal = 4,
111 .max_signal = 4,
112 .muxval = 1,
Viresh Kumar0b7ee712012-03-26 10:29:23 +0530113 .periph_buses = PL08X_AHB1,
114 }, {
115 .bus_id = "ras2_tx",
116 .min_signal = 5,
117 .max_signal = 5,
118 .muxval = 1,
Viresh Kumar0b7ee712012-03-26 10:29:23 +0530119 .periph_buses = PL08X_AHB1,
120 }, {
121 .bus_id = "ras3_rx",
122 .min_signal = 6,
123 .max_signal = 6,
124 .muxval = 1,
Viresh Kumar0b7ee712012-03-26 10:29:23 +0530125 .periph_buses = PL08X_AHB1,
126 }, {
127 .bus_id = "ras3_tx",
128 .min_signal = 7,
129 .max_signal = 7,
130 .muxval = 1,
Viresh Kumar0b7ee712012-03-26 10:29:23 +0530131 .periph_buses = PL08X_AHB1,
132 }, {
133 .bus_id = "ras4_rx",
134 .min_signal = 8,
135 .max_signal = 8,
136 .muxval = 1,
Viresh Kumar0b7ee712012-03-26 10:29:23 +0530137 .periph_buses = PL08X_AHB1,
138 }, {
139 .bus_id = "ras4_tx",
140 .min_signal = 9,
141 .max_signal = 9,
142 .muxval = 1,
Viresh Kumar0b7ee712012-03-26 10:29:23 +0530143 .periph_buses = PL08X_AHB1,
144 }, {
145 .bus_id = "ras5_rx",
146 .min_signal = 10,
147 .max_signal = 10,
148 .muxval = 1,
Viresh Kumar0b7ee712012-03-26 10:29:23 +0530149 .periph_buses = PL08X_AHB1,
150 }, {
151 .bus_id = "ras5_tx",
152 .min_signal = 11,
153 .max_signal = 11,
154 .muxval = 1,
Viresh Kumar0b7ee712012-03-26 10:29:23 +0530155 .periph_buses = PL08X_AHB1,
156 }, {
157 .bus_id = "ras6_rx",
158 .min_signal = 12,
159 .max_signal = 12,
160 .muxval = 1,
Viresh Kumar0b7ee712012-03-26 10:29:23 +0530161 .periph_buses = PL08X_AHB1,
162 }, {
163 .bus_id = "ras6_tx",
164 .min_signal = 13,
165 .max_signal = 13,
166 .muxval = 1,
Viresh Kumar0b7ee712012-03-26 10:29:23 +0530167 .periph_buses = PL08X_AHB1,
168 }, {
169 .bus_id = "ras7_rx",
170 .min_signal = 14,
171 .max_signal = 14,
172 .muxval = 1,
Viresh Kumar0b7ee712012-03-26 10:29:23 +0530173 .periph_buses = PL08X_AHB1,
174 }, {
175 .bus_id = "ras7_tx",
176 .min_signal = 15,
177 .max_signal = 15,
178 .muxval = 1,
Viresh Kumar0b7ee712012-03-26 10:29:23 +0530179 .periph_buses = PL08X_AHB1,
180 },
181};
182
Viresh Kumarc5fa4fd2012-03-23 00:17:43 +0530183/* Add SPEAr300 auxdata to pass platform data */
184static struct of_dev_auxdata spear300_auxdata_lookup[] __initdata = {
185 OF_DEV_AUXDATA("arm,pl022", SPEAR3XX_ICM1_SSP_BASE, NULL,
186 &pl022_plat_data),
Arnd Bergmannd42799b2012-12-02 14:45:27 +0100187 OF_DEV_AUXDATA("arm,pl080", SPEAR_ICM3_DMA_BASE, NULL,
Viresh Kumar0b7ee712012-03-26 10:29:23 +0530188 &pl080_plat_data),
Viresh Kumarc5fa4fd2012-03-23 00:17:43 +0530189 {}
190};
viresh kumarc2c07832011-03-07 05:57:05 +0100191
Viresh Kumarc5fa4fd2012-03-23 00:17:43 +0530192static void __init spear300_dt_init(void)
viresh kumarbc4e8142010-04-01 12:30:58 +0100193{
Viresh Kumar0b7ee712012-03-26 10:29:23 +0530194 pl080_plat_data.slave_channels = spear300_dma_info;
195 pl080_plat_data.num_slave_channels = ARRAY_SIZE(spear300_dma_info);
196
Kefeng Wang435ebcb2016-06-01 14:53:05 +0800197 of_platform_default_populate(NULL, spear300_auxdata_lookup, NULL);
viresh kumar70f4c0b2010-04-01 12:31:29 +0100198}
Viresh Kumarc5fa4fd2012-03-23 00:17:43 +0530199
200static const char * const spear300_dt_board_compat[] = {
201 "st,spear300",
202 "st,spear300-evb",
203 NULL,
204};
205
206static void __init spear300_map_io(void)
207{
208 spear3xx_map_io();
Viresh Kumarc5fa4fd2012-03-23 00:17:43 +0530209}
210
211DT_MACHINE_START(SPEAR300_DT, "ST SPEAr300 SoC with Flattened Device Tree")
212 .map_io = spear300_map_io,
Stephen Warren6bb27d72012-11-08 12:40:59 -0700213 .init_time = spear3xx_timer_init,
Viresh Kumarc5fa4fd2012-03-23 00:17:43 +0530214 .init_machine = spear300_dt_init,
215 .restart = spear_restart,
216 .dt_compat = spear300_dt_board_compat,
217MACHINE_END