viresh kumar | bc4e814 | 2010-04-01 12:30:58 +0100 | [diff] [blame] | 1 | /* |
| 2 | * arch/arm/mach-spear3xx/spear300.c |
| 3 | * |
| 4 | * SPEAr300 machine source file |
| 5 | * |
Viresh Kumar | c5fa4fd | 2012-03-23 00:17:43 +0530 | [diff] [blame] | 6 | * Copyright (C) 2009-2012 ST Microelectronics |
Viresh Kumar | 10d8935 | 2012-06-20 12:53:02 -0700 | [diff] [blame] | 7 | * Viresh Kumar <viresh.linux@gmail.com> |
viresh kumar | bc4e814 | 2010-04-01 12:30:58 +0100 | [diff] [blame] | 8 | * |
| 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 Kumar | 5fb00f9 | 2012-03-26 10:39:43 +0530 | [diff] [blame] | 14 | #define pr_fmt(fmt) "SPEAr300: " fmt |
| 15 | |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 16 | #include <linux/amba/pl08x.h> |
Viresh Kumar | c5fa4fd | 2012-03-23 00:17:43 +0530 | [diff] [blame] | 17 | #include <linux/of_platform.h> |
Viresh Kumar | c5fa4fd | 2012-03-23 00:17:43 +0530 | [diff] [blame] | 18 | #include <asm/mach/arch.h> |
Arnd Bergmann | 2b9c613 | 2012-12-02 15:49:04 +0100 | [diff] [blame] | 19 | #include "generic.h" |
Arnd Bergmann | 5019f0b | 2012-04-11 17:30:11 +0000 | [diff] [blame] | 20 | #include <mach/spear.h> |
| 21 | |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 22 | /* DMAC platform data's slave info */ |
| 23 | struct pl08x_channel_data spear300_dma_info[] = { |
| 24 | { |
| 25 | .bus_id = "uart0_rx", |
| 26 | .min_signal = 2, |
| 27 | .max_signal = 2, |
| 28 | .muxval = 0, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 29 | .periph_buses = PL08X_AHB1, |
| 30 | }, { |
| 31 | .bus_id = "uart0_tx", |
| 32 | .min_signal = 3, |
| 33 | .max_signal = 3, |
| 34 | .muxval = 0, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 35 | .periph_buses = PL08X_AHB1, |
| 36 | }, { |
| 37 | .bus_id = "ssp0_rx", |
| 38 | .min_signal = 8, |
| 39 | .max_signal = 8, |
| 40 | .muxval = 0, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 41 | .periph_buses = PL08X_AHB1, |
| 42 | }, { |
| 43 | .bus_id = "ssp0_tx", |
| 44 | .min_signal = 9, |
| 45 | .max_signal = 9, |
| 46 | .muxval = 0, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 47 | .periph_buses = PL08X_AHB1, |
| 48 | }, { |
| 49 | .bus_id = "i2c_rx", |
| 50 | .min_signal = 10, |
| 51 | .max_signal = 10, |
| 52 | .muxval = 0, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 53 | .periph_buses = PL08X_AHB1, |
| 54 | }, { |
| 55 | .bus_id = "i2c_tx", |
| 56 | .min_signal = 11, |
| 57 | .max_signal = 11, |
| 58 | .muxval = 0, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 59 | .periph_buses = PL08X_AHB1, |
| 60 | }, { |
| 61 | .bus_id = "irda", |
| 62 | .min_signal = 12, |
| 63 | .max_signal = 12, |
| 64 | .muxval = 0, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 65 | .periph_buses = PL08X_AHB1, |
| 66 | }, { |
| 67 | .bus_id = "adc", |
| 68 | .min_signal = 13, |
| 69 | .max_signal = 13, |
| 70 | .muxval = 0, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 71 | .periph_buses = PL08X_AHB1, |
| 72 | }, { |
| 73 | .bus_id = "to_jpeg", |
| 74 | .min_signal = 14, |
| 75 | .max_signal = 14, |
| 76 | .muxval = 0, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 77 | .periph_buses = PL08X_AHB1, |
| 78 | }, { |
| 79 | .bus_id = "from_jpeg", |
| 80 | .min_signal = 15, |
| 81 | .max_signal = 15, |
| 82 | .muxval = 0, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 83 | .periph_buses = PL08X_AHB1, |
| 84 | }, { |
| 85 | .bus_id = "ras0_rx", |
| 86 | .min_signal = 0, |
| 87 | .max_signal = 0, |
| 88 | .muxval = 1, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 89 | .periph_buses = PL08X_AHB1, |
| 90 | }, { |
| 91 | .bus_id = "ras0_tx", |
| 92 | .min_signal = 1, |
| 93 | .max_signal = 1, |
| 94 | .muxval = 1, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 95 | .periph_buses = PL08X_AHB1, |
| 96 | }, { |
| 97 | .bus_id = "ras1_rx", |
| 98 | .min_signal = 2, |
| 99 | .max_signal = 2, |
| 100 | .muxval = 1, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 101 | .periph_buses = PL08X_AHB1, |
| 102 | }, { |
| 103 | .bus_id = "ras1_tx", |
| 104 | .min_signal = 3, |
| 105 | .max_signal = 3, |
| 106 | .muxval = 1, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 107 | .periph_buses = PL08X_AHB1, |
| 108 | }, { |
| 109 | .bus_id = "ras2_rx", |
| 110 | .min_signal = 4, |
| 111 | .max_signal = 4, |
| 112 | .muxval = 1, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 113 | .periph_buses = PL08X_AHB1, |
| 114 | }, { |
| 115 | .bus_id = "ras2_tx", |
| 116 | .min_signal = 5, |
| 117 | .max_signal = 5, |
| 118 | .muxval = 1, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 119 | .periph_buses = PL08X_AHB1, |
| 120 | }, { |
| 121 | .bus_id = "ras3_rx", |
| 122 | .min_signal = 6, |
| 123 | .max_signal = 6, |
| 124 | .muxval = 1, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 125 | .periph_buses = PL08X_AHB1, |
| 126 | }, { |
| 127 | .bus_id = "ras3_tx", |
| 128 | .min_signal = 7, |
| 129 | .max_signal = 7, |
| 130 | .muxval = 1, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 131 | .periph_buses = PL08X_AHB1, |
| 132 | }, { |
| 133 | .bus_id = "ras4_rx", |
| 134 | .min_signal = 8, |
| 135 | .max_signal = 8, |
| 136 | .muxval = 1, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 137 | .periph_buses = PL08X_AHB1, |
| 138 | }, { |
| 139 | .bus_id = "ras4_tx", |
| 140 | .min_signal = 9, |
| 141 | .max_signal = 9, |
| 142 | .muxval = 1, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 143 | .periph_buses = PL08X_AHB1, |
| 144 | }, { |
| 145 | .bus_id = "ras5_rx", |
| 146 | .min_signal = 10, |
| 147 | .max_signal = 10, |
| 148 | .muxval = 1, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 149 | .periph_buses = PL08X_AHB1, |
| 150 | }, { |
| 151 | .bus_id = "ras5_tx", |
| 152 | .min_signal = 11, |
| 153 | .max_signal = 11, |
| 154 | .muxval = 1, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 155 | .periph_buses = PL08X_AHB1, |
| 156 | }, { |
| 157 | .bus_id = "ras6_rx", |
| 158 | .min_signal = 12, |
| 159 | .max_signal = 12, |
| 160 | .muxval = 1, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 161 | .periph_buses = PL08X_AHB1, |
| 162 | }, { |
| 163 | .bus_id = "ras6_tx", |
| 164 | .min_signal = 13, |
| 165 | .max_signal = 13, |
| 166 | .muxval = 1, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 167 | .periph_buses = PL08X_AHB1, |
| 168 | }, { |
| 169 | .bus_id = "ras7_rx", |
| 170 | .min_signal = 14, |
| 171 | .max_signal = 14, |
| 172 | .muxval = 1, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 173 | .periph_buses = PL08X_AHB1, |
| 174 | }, { |
| 175 | .bus_id = "ras7_tx", |
| 176 | .min_signal = 15, |
| 177 | .max_signal = 15, |
| 178 | .muxval = 1, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 179 | .periph_buses = PL08X_AHB1, |
| 180 | }, |
| 181 | }; |
| 182 | |
Viresh Kumar | c5fa4fd | 2012-03-23 00:17:43 +0530 | [diff] [blame] | 183 | /* Add SPEAr300 auxdata to pass platform data */ |
| 184 | static struct of_dev_auxdata spear300_auxdata_lookup[] __initdata = { |
| 185 | OF_DEV_AUXDATA("arm,pl022", SPEAR3XX_ICM1_SSP_BASE, NULL, |
| 186 | &pl022_plat_data), |
Arnd Bergmann | d42799b | 2012-12-02 14:45:27 +0100 | [diff] [blame] | 187 | OF_DEV_AUXDATA("arm,pl080", SPEAR_ICM3_DMA_BASE, NULL, |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 188 | &pl080_plat_data), |
Viresh Kumar | c5fa4fd | 2012-03-23 00:17:43 +0530 | [diff] [blame] | 189 | {} |
| 190 | }; |
viresh kumar | c2c0783 | 2011-03-07 05:57:05 +0100 | [diff] [blame] | 191 | |
Viresh Kumar | c5fa4fd | 2012-03-23 00:17:43 +0530 | [diff] [blame] | 192 | static void __init spear300_dt_init(void) |
viresh kumar | bc4e814 | 2010-04-01 12:30:58 +0100 | [diff] [blame] | 193 | { |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame] | 194 | pl080_plat_data.slave_channels = spear300_dma_info; |
| 195 | pl080_plat_data.num_slave_channels = ARRAY_SIZE(spear300_dma_info); |
| 196 | |
Viresh Kumar | c5fa4fd | 2012-03-23 00:17:43 +0530 | [diff] [blame] | 197 | of_platform_populate(NULL, of_default_bus_match_table, |
| 198 | spear300_auxdata_lookup, NULL); |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 199 | } |
Viresh Kumar | c5fa4fd | 2012-03-23 00:17:43 +0530 | [diff] [blame] | 200 | |
| 201 | static const char * const spear300_dt_board_compat[] = { |
| 202 | "st,spear300", |
| 203 | "st,spear300-evb", |
| 204 | NULL, |
| 205 | }; |
| 206 | |
| 207 | static void __init spear300_map_io(void) |
| 208 | { |
| 209 | spear3xx_map_io(); |
Viresh Kumar | c5fa4fd | 2012-03-23 00:17:43 +0530 | [diff] [blame] | 210 | } |
| 211 | |
| 212 | DT_MACHINE_START(SPEAR300_DT, "ST SPEAr300 SoC with Flattened Device Tree") |
| 213 | .map_io = spear300_map_io, |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 214 | .init_time = spear3xx_timer_init, |
Viresh Kumar | c5fa4fd | 2012-03-23 00:17:43 +0530 | [diff] [blame] | 215 | .init_machine = spear300_dt_init, |
| 216 | .restart = spear_restart, |
| 217 | .dt_compat = spear300_dt_board_compat, |
| 218 | MACHINE_END |