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 |
| 7 | * Viresh Kumar <viresh.kumar@st.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> |
| 18 | #include <asm/hardware/vic.h> |
| 19 | #include <asm/mach/arch.h> |
viresh kumar | 410782b | 2011-03-07 05:57:01 +0100 | [diff] [blame] | 20 | #include <plat/shirq.h> |
viresh kumar | bc4e814 | 2010-04-01 12:30:58 +0100 | [diff] [blame] | 21 | #include <mach/generic.h> |
viresh kumar | 02aa06b | 2011-03-07 05:57:02 +0100 | [diff] [blame] | 22 | #include <mach/hardware.h> |
viresh kumar | bc4e814 | 2010-04-01 12:30:58 +0100 | [diff] [blame] | 23 | |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 24 | /* pad multiplexing support */ |
| 25 | /* muxing registers */ |
| 26 | #define PAD_MUX_CONFIG_REG 0x00 |
| 27 | #define MODE_CONFIG_REG 0x04 |
| 28 | |
| 29 | /* modes */ |
| 30 | #define NAND_MODE (1 << 0) |
| 31 | #define NOR_MODE (1 << 1) |
| 32 | #define PHOTO_FRAME_MODE (1 << 2) |
| 33 | #define LEND_IP_PHONE_MODE (1 << 3) |
| 34 | #define HEND_IP_PHONE_MODE (1 << 4) |
| 35 | #define LEND_WIFI_PHONE_MODE (1 << 5) |
| 36 | #define HEND_WIFI_PHONE_MODE (1 << 6) |
| 37 | #define ATA_PABX_WI2S_MODE (1 << 7) |
| 38 | #define ATA_PABX_I2S_MODE (1 << 8) |
| 39 | #define CAML_LCDW_MODE (1 << 9) |
| 40 | #define CAMU_LCD_MODE (1 << 10) |
| 41 | #define CAMU_WLCD_MODE (1 << 11) |
| 42 | #define CAML_LCD_MODE (1 << 12) |
| 43 | #define ALL_MODES 0x1FFF |
| 44 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 45 | struct pmx_mode spear300_nand_mode = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 46 | .id = NAND_MODE, |
| 47 | .name = "nand mode", |
| 48 | .mask = 0x00, |
| 49 | }; |
| 50 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 51 | struct pmx_mode spear300_nor_mode = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 52 | .id = NOR_MODE, |
| 53 | .name = "nor mode", |
| 54 | .mask = 0x01, |
| 55 | }; |
| 56 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 57 | struct pmx_mode spear300_photo_frame_mode = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 58 | .id = PHOTO_FRAME_MODE, |
| 59 | .name = "photo frame mode", |
| 60 | .mask = 0x02, |
| 61 | }; |
| 62 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 63 | struct pmx_mode spear300_lend_ip_phone_mode = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 64 | .id = LEND_IP_PHONE_MODE, |
| 65 | .name = "lend ip phone mode", |
| 66 | .mask = 0x03, |
| 67 | }; |
| 68 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 69 | struct pmx_mode spear300_hend_ip_phone_mode = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 70 | .id = HEND_IP_PHONE_MODE, |
| 71 | .name = "hend ip phone mode", |
| 72 | .mask = 0x04, |
| 73 | }; |
| 74 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 75 | struct pmx_mode spear300_lend_wifi_phone_mode = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 76 | .id = LEND_WIFI_PHONE_MODE, |
| 77 | .name = "lend wifi phone mode", |
| 78 | .mask = 0x05, |
| 79 | }; |
| 80 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 81 | struct pmx_mode spear300_hend_wifi_phone_mode = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 82 | .id = HEND_WIFI_PHONE_MODE, |
| 83 | .name = "hend wifi phone mode", |
| 84 | .mask = 0x06, |
| 85 | }; |
| 86 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 87 | struct pmx_mode spear300_ata_pabx_wi2s_mode = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 88 | .id = ATA_PABX_WI2S_MODE, |
| 89 | .name = "ata pabx wi2s mode", |
| 90 | .mask = 0x07, |
| 91 | }; |
| 92 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 93 | struct pmx_mode spear300_ata_pabx_i2s_mode = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 94 | .id = ATA_PABX_I2S_MODE, |
| 95 | .name = "ata pabx i2s mode", |
| 96 | .mask = 0x08, |
| 97 | }; |
| 98 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 99 | struct pmx_mode spear300_caml_lcdw_mode = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 100 | .id = CAML_LCDW_MODE, |
| 101 | .name = "caml lcdw mode", |
| 102 | .mask = 0x0C, |
| 103 | }; |
| 104 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 105 | struct pmx_mode spear300_camu_lcd_mode = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 106 | .id = CAMU_LCD_MODE, |
| 107 | .name = "camu lcd mode", |
| 108 | .mask = 0x0D, |
| 109 | }; |
| 110 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 111 | struct pmx_mode spear300_camu_wlcd_mode = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 112 | .id = CAMU_WLCD_MODE, |
| 113 | .name = "camu wlcd mode", |
| 114 | .mask = 0x0E, |
| 115 | }; |
| 116 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 117 | struct pmx_mode spear300_caml_lcd_mode = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 118 | .id = CAML_LCD_MODE, |
| 119 | .name = "caml lcd mode", |
| 120 | .mask = 0x0F, |
| 121 | }; |
| 122 | |
| 123 | /* devices */ |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 124 | static struct pmx_dev_mode pmx_fsmc_2_chips_modes[] = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 125 | { |
| 126 | .ids = NAND_MODE | NOR_MODE | PHOTO_FRAME_MODE | |
| 127 | ATA_PABX_WI2S_MODE | ATA_PABX_I2S_MODE, |
| 128 | .mask = PMX_FIRDA_MASK, |
| 129 | }, |
| 130 | }; |
| 131 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 132 | struct pmx_dev spear300_pmx_fsmc_2_chips = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 133 | .name = "fsmc_2_chips", |
| 134 | .modes = pmx_fsmc_2_chips_modes, |
| 135 | .mode_count = ARRAY_SIZE(pmx_fsmc_2_chips_modes), |
| 136 | .enb_on_reset = 1, |
| 137 | }; |
| 138 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 139 | static struct pmx_dev_mode pmx_fsmc_4_chips_modes[] = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 140 | { |
| 141 | .ids = NAND_MODE | NOR_MODE | PHOTO_FRAME_MODE | |
| 142 | ATA_PABX_WI2S_MODE | ATA_PABX_I2S_MODE, |
| 143 | .mask = PMX_FIRDA_MASK | PMX_UART0_MASK, |
| 144 | }, |
| 145 | }; |
| 146 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 147 | struct pmx_dev spear300_pmx_fsmc_4_chips = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 148 | .name = "fsmc_4_chips", |
| 149 | .modes = pmx_fsmc_4_chips_modes, |
| 150 | .mode_count = ARRAY_SIZE(pmx_fsmc_4_chips_modes), |
| 151 | .enb_on_reset = 1, |
| 152 | }; |
| 153 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 154 | static struct pmx_dev_mode pmx_keyboard_modes[] = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 155 | { |
| 156 | .ids = LEND_IP_PHONE_MODE | HEND_IP_PHONE_MODE | |
| 157 | LEND_WIFI_PHONE_MODE | HEND_WIFI_PHONE_MODE | |
| 158 | CAML_LCDW_MODE | CAMU_LCD_MODE | CAMU_WLCD_MODE | |
| 159 | CAML_LCD_MODE, |
| 160 | .mask = 0x0, |
| 161 | }, |
| 162 | }; |
| 163 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 164 | struct pmx_dev spear300_pmx_keyboard = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 165 | .name = "keyboard", |
| 166 | .modes = pmx_keyboard_modes, |
| 167 | .mode_count = ARRAY_SIZE(pmx_keyboard_modes), |
| 168 | .enb_on_reset = 1, |
| 169 | }; |
| 170 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 171 | static struct pmx_dev_mode pmx_clcd_modes[] = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 172 | { |
| 173 | .ids = PHOTO_FRAME_MODE, |
| 174 | .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK , |
| 175 | }, { |
| 176 | .ids = HEND_IP_PHONE_MODE | HEND_WIFI_PHONE_MODE | |
| 177 | CAMU_LCD_MODE | CAML_LCD_MODE, |
| 178 | .mask = PMX_TIMER_3_4_MASK, |
| 179 | }, |
| 180 | }; |
| 181 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 182 | struct pmx_dev spear300_pmx_clcd = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 183 | .name = "clcd", |
| 184 | .modes = pmx_clcd_modes, |
| 185 | .mode_count = ARRAY_SIZE(pmx_clcd_modes), |
| 186 | .enb_on_reset = 1, |
| 187 | }; |
| 188 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 189 | static struct pmx_dev_mode pmx_telecom_gpio_modes[] = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 190 | { |
| 191 | .ids = PHOTO_FRAME_MODE | CAMU_LCD_MODE | CAML_LCD_MODE, |
| 192 | .mask = PMX_MII_MASK, |
| 193 | }, { |
| 194 | .ids = LEND_IP_PHONE_MODE | LEND_WIFI_PHONE_MODE, |
| 195 | .mask = PMX_MII_MASK | PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK, |
| 196 | }, { |
| 197 | .ids = ATA_PABX_I2S_MODE | CAML_LCDW_MODE | CAMU_WLCD_MODE, |
| 198 | .mask = PMX_MII_MASK | PMX_TIMER_3_4_MASK, |
| 199 | }, { |
| 200 | .ids = HEND_IP_PHONE_MODE | HEND_WIFI_PHONE_MODE, |
| 201 | .mask = PMX_MII_MASK | PMX_TIMER_1_2_MASK, |
| 202 | }, { |
| 203 | .ids = ATA_PABX_WI2S_MODE, |
| 204 | .mask = PMX_MII_MASK | PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK |
| 205 | | PMX_UART0_MODEM_MASK, |
| 206 | }, |
| 207 | }; |
| 208 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 209 | struct pmx_dev spear300_pmx_telecom_gpio = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 210 | .name = "telecom_gpio", |
| 211 | .modes = pmx_telecom_gpio_modes, |
| 212 | .mode_count = ARRAY_SIZE(pmx_telecom_gpio_modes), |
| 213 | .enb_on_reset = 1, |
| 214 | }; |
| 215 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 216 | static struct pmx_dev_mode pmx_telecom_tdm_modes[] = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 217 | { |
| 218 | .ids = PHOTO_FRAME_MODE | LEND_IP_PHONE_MODE | |
| 219 | HEND_IP_PHONE_MODE | LEND_WIFI_PHONE_MODE |
| 220 | | HEND_WIFI_PHONE_MODE | ATA_PABX_WI2S_MODE |
| 221 | | ATA_PABX_I2S_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE |
| 222 | | CAMU_WLCD_MODE | CAML_LCD_MODE, |
| 223 | .mask = PMX_UART0_MODEM_MASK | PMX_SSP_CS_MASK, |
| 224 | }, |
| 225 | }; |
| 226 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 227 | struct pmx_dev spear300_pmx_telecom_tdm = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 228 | .name = "telecom_tdm", |
| 229 | .modes = pmx_telecom_tdm_modes, |
| 230 | .mode_count = ARRAY_SIZE(pmx_telecom_tdm_modes), |
| 231 | .enb_on_reset = 1, |
| 232 | }; |
| 233 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 234 | static struct pmx_dev_mode pmx_telecom_spi_cs_i2c_clk_modes[] = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 235 | { |
| 236 | .ids = LEND_IP_PHONE_MODE | HEND_IP_PHONE_MODE | |
| 237 | LEND_WIFI_PHONE_MODE | HEND_WIFI_PHONE_MODE |
| 238 | | ATA_PABX_WI2S_MODE | ATA_PABX_I2S_MODE | |
| 239 | CAML_LCDW_MODE | CAML_LCD_MODE, |
| 240 | .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK, |
| 241 | }, |
| 242 | }; |
| 243 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 244 | struct pmx_dev spear300_pmx_telecom_spi_cs_i2c_clk = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 245 | .name = "telecom_spi_cs_i2c_clk", |
| 246 | .modes = pmx_telecom_spi_cs_i2c_clk_modes, |
| 247 | .mode_count = ARRAY_SIZE(pmx_telecom_spi_cs_i2c_clk_modes), |
| 248 | .enb_on_reset = 1, |
| 249 | }; |
| 250 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 251 | static struct pmx_dev_mode pmx_telecom_camera_modes[] = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 252 | { |
| 253 | .ids = CAML_LCDW_MODE | CAML_LCD_MODE, |
| 254 | .mask = PMX_MII_MASK, |
| 255 | }, { |
| 256 | .ids = CAMU_LCD_MODE | CAMU_WLCD_MODE, |
| 257 | .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK | PMX_MII_MASK, |
| 258 | }, |
| 259 | }; |
| 260 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 261 | struct pmx_dev spear300_pmx_telecom_camera = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 262 | .name = "telecom_camera", |
| 263 | .modes = pmx_telecom_camera_modes, |
| 264 | .mode_count = ARRAY_SIZE(pmx_telecom_camera_modes), |
| 265 | .enb_on_reset = 1, |
| 266 | }; |
| 267 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 268 | static struct pmx_dev_mode pmx_telecom_dac_modes[] = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 269 | { |
| 270 | .ids = ATA_PABX_I2S_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE |
| 271 | | CAMU_WLCD_MODE | CAML_LCD_MODE, |
| 272 | .mask = PMX_TIMER_1_2_MASK, |
| 273 | }, |
| 274 | }; |
| 275 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 276 | struct pmx_dev spear300_pmx_telecom_dac = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 277 | .name = "telecom_dac", |
| 278 | .modes = pmx_telecom_dac_modes, |
| 279 | .mode_count = ARRAY_SIZE(pmx_telecom_dac_modes), |
| 280 | .enb_on_reset = 1, |
| 281 | }; |
| 282 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 283 | static struct pmx_dev_mode pmx_telecom_i2s_modes[] = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 284 | { |
| 285 | .ids = LEND_IP_PHONE_MODE | HEND_IP_PHONE_MODE |
| 286 | | LEND_WIFI_PHONE_MODE | HEND_WIFI_PHONE_MODE | |
| 287 | ATA_PABX_I2S_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE |
| 288 | | CAMU_WLCD_MODE | CAML_LCD_MODE, |
| 289 | .mask = PMX_UART0_MODEM_MASK, |
| 290 | }, |
| 291 | }; |
| 292 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 293 | struct pmx_dev spear300_pmx_telecom_i2s = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 294 | .name = "telecom_i2s", |
| 295 | .modes = pmx_telecom_i2s_modes, |
| 296 | .mode_count = ARRAY_SIZE(pmx_telecom_i2s_modes), |
| 297 | .enb_on_reset = 1, |
| 298 | }; |
| 299 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 300 | static struct pmx_dev_mode pmx_telecom_boot_pins_modes[] = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 301 | { |
| 302 | .ids = NAND_MODE | NOR_MODE, |
| 303 | .mask = PMX_UART0_MODEM_MASK | PMX_TIMER_1_2_MASK | |
| 304 | PMX_TIMER_3_4_MASK, |
| 305 | }, |
| 306 | }; |
| 307 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 308 | struct pmx_dev spear300_pmx_telecom_boot_pins = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 309 | .name = "telecom_boot_pins", |
| 310 | .modes = pmx_telecom_boot_pins_modes, |
| 311 | .mode_count = ARRAY_SIZE(pmx_telecom_boot_pins_modes), |
| 312 | .enb_on_reset = 1, |
| 313 | }; |
| 314 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 315 | static struct pmx_dev_mode pmx_telecom_sdhci_4bit_modes[] = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 316 | { |
| 317 | .ids = PHOTO_FRAME_MODE | LEND_IP_PHONE_MODE | |
| 318 | HEND_IP_PHONE_MODE | LEND_WIFI_PHONE_MODE | |
| 319 | HEND_WIFI_PHONE_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE | |
| 320 | CAMU_WLCD_MODE | CAML_LCD_MODE | ATA_PABX_WI2S_MODE | |
| 321 | ATA_PABX_I2S_MODE, |
| 322 | .mask = PMX_GPIO_PIN0_MASK | PMX_GPIO_PIN1_MASK | |
| 323 | PMX_GPIO_PIN2_MASK | PMX_GPIO_PIN3_MASK | |
| 324 | PMX_GPIO_PIN4_MASK | PMX_GPIO_PIN5_MASK, |
| 325 | }, |
| 326 | }; |
| 327 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 328 | struct pmx_dev spear300_pmx_telecom_sdhci_4bit = { |
viresh kumar | 069580b | 2011-03-07 05:57:03 +0100 | [diff] [blame] | 329 | .name = "telecom_sdhci_4bit", |
| 330 | .modes = pmx_telecom_sdhci_4bit_modes, |
| 331 | .mode_count = ARRAY_SIZE(pmx_telecom_sdhci_4bit_modes), |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 332 | .enb_on_reset = 1, |
| 333 | }; |
| 334 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 335 | static struct pmx_dev_mode pmx_telecom_sdhci_8bit_modes[] = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 336 | { |
| 337 | .ids = PHOTO_FRAME_MODE | LEND_IP_PHONE_MODE | |
| 338 | HEND_IP_PHONE_MODE | LEND_WIFI_PHONE_MODE | |
| 339 | HEND_WIFI_PHONE_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE | |
| 340 | CAMU_WLCD_MODE | CAML_LCD_MODE, |
| 341 | .mask = PMX_GPIO_PIN0_MASK | PMX_GPIO_PIN1_MASK | |
| 342 | PMX_GPIO_PIN2_MASK | PMX_GPIO_PIN3_MASK | |
| 343 | PMX_GPIO_PIN4_MASK | PMX_GPIO_PIN5_MASK | PMX_MII_MASK, |
| 344 | }, |
| 345 | }; |
| 346 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 347 | struct pmx_dev spear300_pmx_telecom_sdhci_8bit = { |
viresh kumar | 069580b | 2011-03-07 05:57:03 +0100 | [diff] [blame] | 348 | .name = "telecom_sdhci_8bit", |
| 349 | .modes = pmx_telecom_sdhci_8bit_modes, |
| 350 | .mode_count = ARRAY_SIZE(pmx_telecom_sdhci_8bit_modes), |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 351 | .enb_on_reset = 1, |
| 352 | }; |
| 353 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 354 | static struct pmx_dev_mode pmx_gpio1_modes[] = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 355 | { |
| 356 | .ids = PHOTO_FRAME_MODE, |
| 357 | .mask = PMX_UART0_MODEM_MASK | PMX_TIMER_1_2_MASK | |
| 358 | PMX_TIMER_3_4_MASK, |
| 359 | }, |
| 360 | }; |
| 361 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 362 | struct pmx_dev spear300_pmx_gpio1 = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 363 | .name = "arm gpio1", |
| 364 | .modes = pmx_gpio1_modes, |
| 365 | .mode_count = ARRAY_SIZE(pmx_gpio1_modes), |
| 366 | .enb_on_reset = 1, |
| 367 | }; |
| 368 | |
| 369 | /* pmx driver structure */ |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 370 | static struct pmx_driver pmx_driver = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 371 | .mode_reg = {.offset = MODE_CONFIG_REG, .mask = 0x0000000f}, |
| 372 | .mux_reg = {.offset = PAD_MUX_CONFIG_REG, .mask = 0x00007fff}, |
| 373 | }; |
| 374 | |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 375 | /* spear3xx shared irq */ |
Ryan Mallon | f6558bf | 2011-05-20 08:34:20 +0100 | [diff] [blame] | 376 | static struct shirq_dev_config shirq_ras1_config[] = { |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 377 | { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 378 | .virq = SPEAR300_VIRQ_IT_PERS_S, |
| 379 | .enb_mask = SPEAR300_IT_PERS_S_IRQ_MASK, |
| 380 | .status_mask = SPEAR300_IT_PERS_S_IRQ_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 381 | }, { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 382 | .virq = SPEAR300_VIRQ_IT_CHANGE_S, |
| 383 | .enb_mask = SPEAR300_IT_CHANGE_S_IRQ_MASK, |
| 384 | .status_mask = SPEAR300_IT_CHANGE_S_IRQ_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 385 | }, { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 386 | .virq = SPEAR300_VIRQ_I2S, |
| 387 | .enb_mask = SPEAR300_I2S_IRQ_MASK, |
| 388 | .status_mask = SPEAR300_I2S_IRQ_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 389 | }, { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 390 | .virq = SPEAR300_VIRQ_TDM, |
| 391 | .enb_mask = SPEAR300_TDM_IRQ_MASK, |
| 392 | .status_mask = SPEAR300_TDM_IRQ_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 393 | }, { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 394 | .virq = SPEAR300_VIRQ_CAMERA_L, |
| 395 | .enb_mask = SPEAR300_CAMERA_L_IRQ_MASK, |
| 396 | .status_mask = SPEAR300_CAMERA_L_IRQ_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 397 | }, { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 398 | .virq = SPEAR300_VIRQ_CAMERA_F, |
| 399 | .enb_mask = SPEAR300_CAMERA_F_IRQ_MASK, |
| 400 | .status_mask = SPEAR300_CAMERA_F_IRQ_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 401 | }, { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 402 | .virq = SPEAR300_VIRQ_CAMERA_V, |
| 403 | .enb_mask = SPEAR300_CAMERA_V_IRQ_MASK, |
| 404 | .status_mask = SPEAR300_CAMERA_V_IRQ_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 405 | }, { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 406 | .virq = SPEAR300_VIRQ_KEYBOARD, |
| 407 | .enb_mask = SPEAR300_KEYBOARD_IRQ_MASK, |
| 408 | .status_mask = SPEAR300_KEYBOARD_IRQ_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 409 | }, { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 410 | .virq = SPEAR300_VIRQ_GPIO1, |
| 411 | .enb_mask = SPEAR300_GPIO1_IRQ_MASK, |
| 412 | .status_mask = SPEAR300_GPIO1_IRQ_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 413 | }, |
| 414 | }; |
| 415 | |
Ryan Mallon | f6558bf | 2011-05-20 08:34:20 +0100 | [diff] [blame] | 416 | static struct spear_shirq shirq_ras1 = { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 417 | .irq = SPEAR3XX_IRQ_GEN_RAS_1, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 418 | .dev_config = shirq_ras1_config, |
| 419 | .dev_count = ARRAY_SIZE(shirq_ras1_config), |
| 420 | .regs = { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 421 | .enb_reg = SPEAR300_INT_ENB_MASK_REG, |
| 422 | .status_reg = SPEAR300_INT_STS_MASK_REG, |
| 423 | .status_reg_mask = SPEAR300_SHIRQ_RAS1_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 424 | .clear_reg = -1, |
| 425 | }, |
viresh kumar | bc4e814 | 2010-04-01 12:30:58 +0100 | [diff] [blame] | 426 | }; |
| 427 | |
Viresh Kumar | c5fa4fd | 2012-03-23 00:17:43 +0530 | [diff] [blame] | 428 | /* padmux devices to enable */ |
| 429 | static struct pmx_dev *spear300_evb_pmx_devs[] = { |
| 430 | /* spear3xx specific devices */ |
| 431 | &spear3xx_pmx_i2c, |
| 432 | &spear3xx_pmx_ssp_cs, |
| 433 | &spear3xx_pmx_ssp, |
| 434 | &spear3xx_pmx_mii, |
| 435 | &spear3xx_pmx_uart0, |
| 436 | |
| 437 | /* spear300 specific devices */ |
| 438 | &spear300_pmx_fsmc_2_chips, |
| 439 | &spear300_pmx_clcd, |
| 440 | &spear300_pmx_telecom_sdhci_4bit, |
| 441 | &spear300_pmx_gpio1, |
viresh kumar | c2c0783 | 2011-03-07 05:57:05 +0100 | [diff] [blame] | 442 | }; |
| 443 | |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame^] | 444 | /* DMAC platform data's slave info */ |
| 445 | struct pl08x_channel_data spear300_dma_info[] = { |
| 446 | { |
| 447 | .bus_id = "uart0_rx", |
| 448 | .min_signal = 2, |
| 449 | .max_signal = 2, |
| 450 | .muxval = 0, |
| 451 | .cctl = 0, |
| 452 | .periph_buses = PL08X_AHB1, |
| 453 | }, { |
| 454 | .bus_id = "uart0_tx", |
| 455 | .min_signal = 3, |
| 456 | .max_signal = 3, |
| 457 | .muxval = 0, |
| 458 | .cctl = 0, |
| 459 | .periph_buses = PL08X_AHB1, |
| 460 | }, { |
| 461 | .bus_id = "ssp0_rx", |
| 462 | .min_signal = 8, |
| 463 | .max_signal = 8, |
| 464 | .muxval = 0, |
| 465 | .cctl = 0, |
| 466 | .periph_buses = PL08X_AHB1, |
| 467 | }, { |
| 468 | .bus_id = "ssp0_tx", |
| 469 | .min_signal = 9, |
| 470 | .max_signal = 9, |
| 471 | .muxval = 0, |
| 472 | .cctl = 0, |
| 473 | .periph_buses = PL08X_AHB1, |
| 474 | }, { |
| 475 | .bus_id = "i2c_rx", |
| 476 | .min_signal = 10, |
| 477 | .max_signal = 10, |
| 478 | .muxval = 0, |
| 479 | .cctl = 0, |
| 480 | .periph_buses = PL08X_AHB1, |
| 481 | }, { |
| 482 | .bus_id = "i2c_tx", |
| 483 | .min_signal = 11, |
| 484 | .max_signal = 11, |
| 485 | .muxval = 0, |
| 486 | .cctl = 0, |
| 487 | .periph_buses = PL08X_AHB1, |
| 488 | }, { |
| 489 | .bus_id = "irda", |
| 490 | .min_signal = 12, |
| 491 | .max_signal = 12, |
| 492 | .muxval = 0, |
| 493 | .cctl = 0, |
| 494 | .periph_buses = PL08X_AHB1, |
| 495 | }, { |
| 496 | .bus_id = "adc", |
| 497 | .min_signal = 13, |
| 498 | .max_signal = 13, |
| 499 | .muxval = 0, |
| 500 | .cctl = 0, |
| 501 | .periph_buses = PL08X_AHB1, |
| 502 | }, { |
| 503 | .bus_id = "to_jpeg", |
| 504 | .min_signal = 14, |
| 505 | .max_signal = 14, |
| 506 | .muxval = 0, |
| 507 | .cctl = 0, |
| 508 | .periph_buses = PL08X_AHB1, |
| 509 | }, { |
| 510 | .bus_id = "from_jpeg", |
| 511 | .min_signal = 15, |
| 512 | .max_signal = 15, |
| 513 | .muxval = 0, |
| 514 | .cctl = 0, |
| 515 | .periph_buses = PL08X_AHB1, |
| 516 | }, { |
| 517 | .bus_id = "ras0_rx", |
| 518 | .min_signal = 0, |
| 519 | .max_signal = 0, |
| 520 | .muxval = 1, |
| 521 | .cctl = 0, |
| 522 | .periph_buses = PL08X_AHB1, |
| 523 | }, { |
| 524 | .bus_id = "ras0_tx", |
| 525 | .min_signal = 1, |
| 526 | .max_signal = 1, |
| 527 | .muxval = 1, |
| 528 | .cctl = 0, |
| 529 | .periph_buses = PL08X_AHB1, |
| 530 | }, { |
| 531 | .bus_id = "ras1_rx", |
| 532 | .min_signal = 2, |
| 533 | .max_signal = 2, |
| 534 | .muxval = 1, |
| 535 | .cctl = 0, |
| 536 | .periph_buses = PL08X_AHB1, |
| 537 | }, { |
| 538 | .bus_id = "ras1_tx", |
| 539 | .min_signal = 3, |
| 540 | .max_signal = 3, |
| 541 | .muxval = 1, |
| 542 | .cctl = 0, |
| 543 | .periph_buses = PL08X_AHB1, |
| 544 | }, { |
| 545 | .bus_id = "ras2_rx", |
| 546 | .min_signal = 4, |
| 547 | .max_signal = 4, |
| 548 | .muxval = 1, |
| 549 | .cctl = 0, |
| 550 | .periph_buses = PL08X_AHB1, |
| 551 | }, { |
| 552 | .bus_id = "ras2_tx", |
| 553 | .min_signal = 5, |
| 554 | .max_signal = 5, |
| 555 | .muxval = 1, |
| 556 | .cctl = 0, |
| 557 | .periph_buses = PL08X_AHB1, |
| 558 | }, { |
| 559 | .bus_id = "ras3_rx", |
| 560 | .min_signal = 6, |
| 561 | .max_signal = 6, |
| 562 | .muxval = 1, |
| 563 | .cctl = 0, |
| 564 | .periph_buses = PL08X_AHB1, |
| 565 | }, { |
| 566 | .bus_id = "ras3_tx", |
| 567 | .min_signal = 7, |
| 568 | .max_signal = 7, |
| 569 | .muxval = 1, |
| 570 | .cctl = 0, |
| 571 | .periph_buses = PL08X_AHB1, |
| 572 | }, { |
| 573 | .bus_id = "ras4_rx", |
| 574 | .min_signal = 8, |
| 575 | .max_signal = 8, |
| 576 | .muxval = 1, |
| 577 | .cctl = 0, |
| 578 | .periph_buses = PL08X_AHB1, |
| 579 | }, { |
| 580 | .bus_id = "ras4_tx", |
| 581 | .min_signal = 9, |
| 582 | .max_signal = 9, |
| 583 | .muxval = 1, |
| 584 | .cctl = 0, |
| 585 | .periph_buses = PL08X_AHB1, |
| 586 | }, { |
| 587 | .bus_id = "ras5_rx", |
| 588 | .min_signal = 10, |
| 589 | .max_signal = 10, |
| 590 | .muxval = 1, |
| 591 | .cctl = 0, |
| 592 | .periph_buses = PL08X_AHB1, |
| 593 | }, { |
| 594 | .bus_id = "ras5_tx", |
| 595 | .min_signal = 11, |
| 596 | .max_signal = 11, |
| 597 | .muxval = 1, |
| 598 | .cctl = 0, |
| 599 | .periph_buses = PL08X_AHB1, |
| 600 | }, { |
| 601 | .bus_id = "ras6_rx", |
| 602 | .min_signal = 12, |
| 603 | .max_signal = 12, |
| 604 | .muxval = 1, |
| 605 | .cctl = 0, |
| 606 | .periph_buses = PL08X_AHB1, |
| 607 | }, { |
| 608 | .bus_id = "ras6_tx", |
| 609 | .min_signal = 13, |
| 610 | .max_signal = 13, |
| 611 | .muxval = 1, |
| 612 | .cctl = 0, |
| 613 | .periph_buses = PL08X_AHB1, |
| 614 | }, { |
| 615 | .bus_id = "ras7_rx", |
| 616 | .min_signal = 14, |
| 617 | .max_signal = 14, |
| 618 | .muxval = 1, |
| 619 | .cctl = 0, |
| 620 | .periph_buses = PL08X_AHB1, |
| 621 | }, { |
| 622 | .bus_id = "ras7_tx", |
| 623 | .min_signal = 15, |
| 624 | .max_signal = 15, |
| 625 | .muxval = 1, |
| 626 | .cctl = 0, |
| 627 | .periph_buses = PL08X_AHB1, |
| 628 | }, |
| 629 | }; |
| 630 | |
Viresh Kumar | c5fa4fd | 2012-03-23 00:17:43 +0530 | [diff] [blame] | 631 | /* Add SPEAr300 auxdata to pass platform data */ |
| 632 | static struct of_dev_auxdata spear300_auxdata_lookup[] __initdata = { |
| 633 | OF_DEV_AUXDATA("arm,pl022", SPEAR3XX_ICM1_SSP_BASE, NULL, |
| 634 | &pl022_plat_data), |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame^] | 635 | OF_DEV_AUXDATA("arm,pl080", SPEAR3XX_ICM3_DMA_BASE, NULL, |
| 636 | &pl080_plat_data), |
Viresh Kumar | c5fa4fd | 2012-03-23 00:17:43 +0530 | [diff] [blame] | 637 | {} |
| 638 | }; |
viresh kumar | c2c0783 | 2011-03-07 05:57:05 +0100 | [diff] [blame] | 639 | |
Viresh Kumar | c5fa4fd | 2012-03-23 00:17:43 +0530 | [diff] [blame] | 640 | static void __init spear300_dt_init(void) |
viresh kumar | bc4e814 | 2010-04-01 12:30:58 +0100 | [diff] [blame] | 641 | { |
Viresh Kumar | c5fa4fd | 2012-03-23 00:17:43 +0530 | [diff] [blame] | 642 | int ret = -EINVAL; |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 643 | |
Viresh Kumar | 0b7ee71 | 2012-03-26 10:29:23 +0530 | [diff] [blame^] | 644 | pl080_plat_data.slave_channels = spear300_dma_info; |
| 645 | pl080_plat_data.num_slave_channels = ARRAY_SIZE(spear300_dma_info); |
| 646 | |
Viresh Kumar | c5fa4fd | 2012-03-23 00:17:43 +0530 | [diff] [blame] | 647 | of_platform_populate(NULL, of_default_bus_match_table, |
| 648 | spear300_auxdata_lookup, NULL); |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 649 | |
Uwe Kleine-König | b595076 | 2010-11-01 15:38:34 -0400 | [diff] [blame] | 650 | /* shared irq registration */ |
viresh kumar | 5382116 | 2011-03-07 05:57:06 +0100 | [diff] [blame] | 651 | shirq_ras1.regs.base = ioremap(SPEAR300_TELECOM_BASE, SZ_4K); |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 652 | if (shirq_ras1.regs.base) { |
| 653 | ret = spear_shirq_register(&shirq_ras1); |
| 654 | if (ret) |
Viresh Kumar | 5fb00f9 | 2012-03-26 10:39:43 +0530 | [diff] [blame] | 655 | pr_err("Error registering Shared IRQ\n"); |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 656 | } |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 657 | |
Viresh Kumar | c5fa4fd | 2012-03-23 00:17:43 +0530 | [diff] [blame] | 658 | if (of_machine_is_compatible("st,spear300-evb")) { |
| 659 | /* pmx initialization */ |
| 660 | pmx_driver.mode = &spear300_photo_frame_mode; |
| 661 | pmx_driver.devs = spear300_evb_pmx_devs; |
| 662 | pmx_driver.devs_count = ARRAY_SIZE(spear300_evb_pmx_devs); |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 663 | |
Viresh Kumar | c5fa4fd | 2012-03-23 00:17:43 +0530 | [diff] [blame] | 664 | pmx_driver.base = ioremap(SPEAR300_SOC_CONFIG_BASE, SZ_4K); |
| 665 | if (pmx_driver.base) { |
| 666 | ret = pmx_register(&pmx_driver); |
| 667 | if (ret) |
| 668 | pr_err("padmux: registration failed. err no: %d\n", |
| 669 | ret); |
| 670 | /* Free Mapping, device selection already done */ |
| 671 | iounmap(pmx_driver.base); |
| 672 | } |
| 673 | |
viresh kumar | 53688c5 | 2011-02-16 07:40:30 +0100 | [diff] [blame] | 674 | if (ret) |
Viresh Kumar | c5fa4fd | 2012-03-23 00:17:43 +0530 | [diff] [blame] | 675 | pr_err("Initialization Failed"); |
viresh kumar | 53688c5 | 2011-02-16 07:40:30 +0100 | [diff] [blame] | 676 | } |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 677 | } |
Viresh Kumar | c5fa4fd | 2012-03-23 00:17:43 +0530 | [diff] [blame] | 678 | |
| 679 | static const char * const spear300_dt_board_compat[] = { |
| 680 | "st,spear300", |
| 681 | "st,spear300-evb", |
| 682 | NULL, |
| 683 | }; |
| 684 | |
| 685 | static void __init spear300_map_io(void) |
| 686 | { |
| 687 | spear3xx_map_io(); |
| 688 | spear300_clk_init(); |
| 689 | } |
| 690 | |
| 691 | DT_MACHINE_START(SPEAR300_DT, "ST SPEAr300 SoC with Flattened Device Tree") |
| 692 | .map_io = spear300_map_io, |
| 693 | .init_irq = spear3xx_dt_init_irq, |
| 694 | .handle_irq = vic_handle_irq, |
| 695 | .timer = &spear3xx_timer, |
| 696 | .init_machine = spear300_dt_init, |
| 697 | .restart = spear_restart, |
| 698 | .dt_compat = spear300_dt_board_compat, |
| 699 | MACHINE_END |