Magnus Damm | 2862663 | 2011-08-18 05:44:07 +0000 | [diff] [blame] | 1 | /* |
| 2 | * kota2 board support |
| 3 | * |
| 4 | * Copyright (C) 2011 Renesas Solutions Corp. |
| 5 | * Copyright (C) 2011 Magnus Damm |
| 6 | * Copyright (C) 2010 Takashi Yoshii <yoshii.takashi.zj@renesas.com> |
| 7 | * Copyright (C) 2009 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License as published by |
| 11 | * the Free Software Foundation; version 2 of the License. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 21 | */ |
| 22 | |
| 23 | #include <linux/kernel.h> |
| 24 | #include <linux/init.h> |
| 25 | #include <linux/interrupt.h> |
| 26 | #include <linux/irq.h> |
| 27 | #include <linux/platform_device.h> |
| 28 | #include <linux/delay.h> |
| 29 | #include <linux/io.h> |
| 30 | #include <linux/smsc911x.h> |
| 31 | #include <linux/gpio.h> |
Magnus Damm | ef4f994 | 2011-08-18 05:44:16 +0000 | [diff] [blame] | 32 | #include <linux/input.h> |
| 33 | #include <linux/input/sh_keysc.h> |
Magnus Damm | 6b7c0ea | 2011-08-18 05:44:25 +0000 | [diff] [blame] | 34 | #include <linux/gpio_keys.h> |
Magnus Damm | ae6e708 | 2011-08-18 05:44:33 +0000 | [diff] [blame] | 35 | #include <linux/leds.h> |
Magnus Damm | 33661c9 | 2011-11-22 15:44:58 +0900 | [diff] [blame] | 36 | #include <linux/platform_data/leds-renesas-tpu.h> |
Magnus Damm | 4e92794 | 2011-08-18 05:44:42 +0000 | [diff] [blame] | 37 | #include <linux/mmc/host.h> |
| 38 | #include <linux/mmc/sh_mmcif.h> |
Magnus Damm | 8722c99 | 2011-08-18 05:45:00 +0000 | [diff] [blame] | 39 | #include <linux/mfd/tmio.h> |
| 40 | #include <linux/mmc/sh_mobile_sdhi.h> |
Magnus Damm | 2862663 | 2011-08-18 05:44:07 +0000 | [diff] [blame] | 41 | #include <mach/hardware.h> |
Rob Herring | 250a272 | 2012-01-03 16:57:33 -0600 | [diff] [blame] | 42 | #include <mach/irqs.h> |
Magnus Damm | 2862663 | 2011-08-18 05:44:07 +0000 | [diff] [blame] | 43 | #include <mach/sh73a0.h> |
| 44 | #include <mach/common.h> |
| 45 | #include <asm/mach-types.h> |
| 46 | #include <asm/mach/arch.h> |
Magnus Damm | 2862663 | 2011-08-18 05:44:07 +0000 | [diff] [blame] | 47 | #include <asm/mach/time.h> |
| 48 | #include <asm/hardware/gic.h> |
| 49 | #include <asm/hardware/cache-l2x0.h> |
| 50 | #include <asm/traps.h> |
| 51 | |
Kuninori Morimoto | c5e7bcd | 2011-11-10 18:44:43 -0800 | [diff] [blame] | 52 | /* SMSC 9220 */ |
Magnus Damm | 2862663 | 2011-08-18 05:44:07 +0000 | [diff] [blame] | 53 | static struct resource smsc9220_resources[] = { |
| 54 | [0] = { |
| 55 | .start = 0x14000000, /* CS5A */ |
| 56 | .end = 0x140000ff, /* A1->A7 */ |
| 57 | .flags = IORESOURCE_MEM, |
| 58 | }, |
| 59 | [1] = { |
Magnus Damm | 1b6cec8 | 2011-11-22 15:15:57 +0900 | [diff] [blame] | 60 | .start = SH73A0_PINT0_IRQ(2), /* PINTA2 */ |
Magnus Damm | 2862663 | 2011-08-18 05:44:07 +0000 | [diff] [blame] | 61 | .flags = IORESOURCE_IRQ, |
| 62 | }, |
| 63 | }; |
| 64 | |
| 65 | static struct smsc911x_platform_config smsc9220_platdata = { |
| 66 | .flags = SMSC911X_USE_32BIT, /* 32-bit SW on 16-bit HW bus */ |
| 67 | .phy_interface = PHY_INTERFACE_MODE_MII, |
| 68 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, |
| 69 | .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, |
| 70 | }; |
| 71 | |
| 72 | static struct platform_device eth_device = { |
| 73 | .name = "smsc911x", |
| 74 | .id = 0, |
| 75 | .dev = { |
| 76 | .platform_data = &smsc9220_platdata, |
| 77 | }, |
| 78 | .resource = smsc9220_resources, |
| 79 | .num_resources = ARRAY_SIZE(smsc9220_resources), |
| 80 | }; |
| 81 | |
Kuninori Morimoto | c5e7bcd | 2011-11-10 18:44:43 -0800 | [diff] [blame] | 82 | /* KEYSC */ |
Magnus Damm | ef4f994 | 2011-08-18 05:44:16 +0000 | [diff] [blame] | 83 | static struct sh_keysc_info keysc_platdata = { |
| 84 | .mode = SH_KEYSC_MODE_6, |
| 85 | .scan_timing = 3, |
| 86 | .delay = 100, |
| 87 | .keycodes = { |
| 88 | KEY_NUMERIC_STAR, KEY_NUMERIC_0, KEY_NUMERIC_POUND, |
| 89 | 0, 0, 0, 0, 0, |
| 90 | KEY_NUMERIC_7, KEY_NUMERIC_8, KEY_NUMERIC_9, |
| 91 | 0, KEY_DOWN, 0, 0, 0, |
| 92 | KEY_NUMERIC_4, KEY_NUMERIC_5, KEY_NUMERIC_6, |
| 93 | KEY_LEFT, KEY_ENTER, KEY_RIGHT, 0, 0, |
| 94 | KEY_NUMERIC_1, KEY_NUMERIC_2, KEY_NUMERIC_3, |
| 95 | 0, KEY_UP, 0, 0, 0, |
| 96 | 0, 0, 0, 0, 0, 0, 0, 0, |
| 97 | 0, 0, 0, 0, 0, 0, 0, 0, |
| 98 | 0, 0, 0, 0, 0, 0, 0, 0, |
| 99 | 0, 0, 0, 0, 0, 0, 0, 0, |
| 100 | }, |
| 101 | }; |
| 102 | |
| 103 | static struct resource keysc_resources[] = { |
| 104 | [0] = { |
| 105 | .name = "KEYSC", |
| 106 | .start = 0xe61b0000, |
| 107 | .end = 0xe61b0098 - 1, |
| 108 | .flags = IORESOURCE_MEM, |
| 109 | }, |
| 110 | [1] = { |
| 111 | .start = gic_spi(71), |
| 112 | .flags = IORESOURCE_IRQ, |
| 113 | }, |
| 114 | }; |
| 115 | |
| 116 | static struct platform_device keysc_device = { |
| 117 | .name = "sh_keysc", |
| 118 | .id = 0, |
| 119 | .num_resources = ARRAY_SIZE(keysc_resources), |
| 120 | .resource = keysc_resources, |
| 121 | .dev = { |
| 122 | .platform_data = &keysc_platdata, |
| 123 | }, |
| 124 | }; |
| 125 | |
Kuninori Morimoto | c5e7bcd | 2011-11-10 18:44:43 -0800 | [diff] [blame] | 126 | /* GPIO KEY */ |
Magnus Damm | 6b7c0ea | 2011-08-18 05:44:25 +0000 | [diff] [blame] | 127 | #define GPIO_KEY(c, g, d) { .code = c, .gpio = g, .desc = d, .active_low = 1 } |
| 128 | |
| 129 | static struct gpio_keys_button gpio_buttons[] = { |
| 130 | GPIO_KEY(KEY_VOLUMEUP, GPIO_PORT56, "+"), /* S2: VOL+ [IRQ9] */ |
| 131 | GPIO_KEY(KEY_VOLUMEDOWN, GPIO_PORT54, "-"), /* S3: VOL- [IRQ10] */ |
| 132 | GPIO_KEY(KEY_MENU, GPIO_PORT27, "Menu"), /* S4: MENU [IRQ30] */ |
| 133 | GPIO_KEY(KEY_HOMEPAGE, GPIO_PORT26, "Home"), /* S5: HOME [IRQ31] */ |
| 134 | GPIO_KEY(KEY_BACK, GPIO_PORT11, "Back"), /* S6: BACK [IRQ0] */ |
| 135 | GPIO_KEY(KEY_PHONE, GPIO_PORT238, "Tel"), /* S7: TEL [IRQ11] */ |
| 136 | GPIO_KEY(KEY_POWER, GPIO_PORT239, "C1"), /* S8: CAM [IRQ13] */ |
| 137 | GPIO_KEY(KEY_MAIL, GPIO_PORT224, "Mail"), /* S9: MAIL [IRQ3] */ |
| 138 | /* Omitted button "C3?": GPIO_PORT223 - S10: CUST [IRQ8] */ |
| 139 | GPIO_KEY(KEY_CAMERA, GPIO_PORT164, "C2"), /* S11: CAM_HALF [IRQ25] */ |
| 140 | /* Omitted button "?": GPIO_PORT152 - S12: CAM_FULL [No IRQ] */ |
| 141 | }; |
| 142 | |
| 143 | static struct gpio_keys_platform_data gpio_key_info = { |
| 144 | .buttons = gpio_buttons, |
| 145 | .nbuttons = ARRAY_SIZE(gpio_buttons), |
Magnus Damm | 6b7c0ea | 2011-08-18 05:44:25 +0000 | [diff] [blame] | 146 | }; |
| 147 | |
| 148 | static struct platform_device gpio_keys_device = { |
Magnus Damm | 2fde109 | 2012-01-17 20:14:07 +0900 | [diff] [blame] | 149 | .name = "gpio-keys", |
Magnus Damm | 6b7c0ea | 2011-08-18 05:44:25 +0000 | [diff] [blame] | 150 | .id = -1, |
| 151 | .dev = { |
| 152 | .platform_data = &gpio_key_info, |
| 153 | }, |
| 154 | }; |
| 155 | |
Kuninori Morimoto | c5e7bcd | 2011-11-10 18:44:43 -0800 | [diff] [blame] | 156 | /* GPIO LED */ |
Magnus Damm | ae6e708 | 2011-08-18 05:44:33 +0000 | [diff] [blame] | 157 | #define GPIO_LED(n, g) { .name = n, .gpio = g } |
| 158 | |
| 159 | static struct gpio_led gpio_leds[] = { |
Magnus Damm | ae6e708 | 2011-08-18 05:44:33 +0000 | [diff] [blame] | 160 | GPIO_LED("G", GPIO_PORT20), /* PORT20 [GPO0] -> LED7 -> "G" */ |
| 161 | GPIO_LED("H", GPIO_PORT21), /* PORT21 [GPO1] -> LED8 -> "H" */ |
| 162 | GPIO_LED("J", GPIO_PORT22), /* PORT22 [GPO2] -> LED9 -> "J" */ |
| 163 | }; |
| 164 | |
| 165 | static struct gpio_led_platform_data gpio_leds_info = { |
| 166 | .leds = gpio_leds, |
| 167 | .num_leds = ARRAY_SIZE(gpio_leds), |
| 168 | }; |
| 169 | |
| 170 | static struct platform_device gpio_leds_device = { |
| 171 | .name = "leds-gpio", |
| 172 | .id = -1, |
| 173 | .dev = { |
| 174 | .platform_data = &gpio_leds_info, |
| 175 | }, |
| 176 | }; |
| 177 | |
Magnus Damm | 33661c9 | 2011-11-22 15:44:58 +0900 | [diff] [blame] | 178 | /* TPU LED */ |
| 179 | static struct led_renesas_tpu_config led_renesas_tpu12_pdata = { |
| 180 | .name = "V2513", |
| 181 | .pin_gpio_fn = GPIO_FN_TPU1TO2, |
| 182 | .pin_gpio = GPIO_PORT153, |
| 183 | .channel_offset = 0x90, |
| 184 | .timer_bit = 2, |
| 185 | .max_brightness = 1000, |
| 186 | }; |
| 187 | |
| 188 | static struct resource tpu12_resources[] = { |
| 189 | [0] = { |
| 190 | .name = "TPU12", |
| 191 | .start = 0xe6610090, |
| 192 | .end = 0xe66100b5, |
| 193 | .flags = IORESOURCE_MEM, |
| 194 | }, |
| 195 | }; |
| 196 | |
| 197 | static struct platform_device leds_tpu12_device = { |
| 198 | .name = "leds-renesas-tpu", |
| 199 | .id = 12, |
| 200 | .dev = { |
| 201 | .platform_data = &led_renesas_tpu12_pdata, |
| 202 | }, |
| 203 | .num_resources = ARRAY_SIZE(tpu12_resources), |
| 204 | .resource = tpu12_resources, |
| 205 | }; |
| 206 | |
| 207 | static struct led_renesas_tpu_config led_renesas_tpu41_pdata = { |
| 208 | .name = "V2514", |
| 209 | .pin_gpio_fn = GPIO_FN_TPU4TO1, |
| 210 | .pin_gpio = GPIO_PORT199, |
| 211 | .channel_offset = 0x50, |
| 212 | .timer_bit = 1, |
| 213 | .max_brightness = 1000, |
| 214 | }; |
| 215 | |
| 216 | static struct resource tpu41_resources[] = { |
| 217 | [0] = { |
| 218 | .name = "TPU41", |
| 219 | .start = 0xe6640050, |
| 220 | .end = 0xe6640075, |
| 221 | .flags = IORESOURCE_MEM, |
| 222 | }, |
| 223 | }; |
| 224 | |
| 225 | static struct platform_device leds_tpu41_device = { |
| 226 | .name = "leds-renesas-tpu", |
| 227 | .id = 41, |
| 228 | .dev = { |
| 229 | .platform_data = &led_renesas_tpu41_pdata, |
| 230 | }, |
| 231 | .num_resources = ARRAY_SIZE(tpu41_resources), |
| 232 | .resource = tpu41_resources, |
| 233 | }; |
| 234 | |
| 235 | static struct led_renesas_tpu_config led_renesas_tpu21_pdata = { |
| 236 | .name = "V2515", |
| 237 | .pin_gpio_fn = GPIO_FN_TPU2TO1, |
| 238 | .pin_gpio = GPIO_PORT197, |
| 239 | .channel_offset = 0x50, |
| 240 | .timer_bit = 1, |
| 241 | .max_brightness = 1000, |
| 242 | }; |
| 243 | |
| 244 | static struct resource tpu21_resources[] = { |
| 245 | [0] = { |
| 246 | .name = "TPU21", |
| 247 | .start = 0xe6620050, |
| 248 | .end = 0xe6620075, |
| 249 | .flags = IORESOURCE_MEM, |
| 250 | }, |
| 251 | }; |
| 252 | |
| 253 | static struct platform_device leds_tpu21_device = { |
| 254 | .name = "leds-renesas-tpu", |
| 255 | .id = 21, |
| 256 | .dev = { |
| 257 | .platform_data = &led_renesas_tpu21_pdata, |
| 258 | }, |
| 259 | .num_resources = ARRAY_SIZE(tpu21_resources), |
| 260 | .resource = tpu21_resources, |
| 261 | }; |
| 262 | |
| 263 | static struct led_renesas_tpu_config led_renesas_tpu30_pdata = { |
| 264 | .name = "KEYLED", |
| 265 | .pin_gpio_fn = GPIO_FN_TPU3TO0, |
| 266 | .pin_gpio = GPIO_PORT163, |
| 267 | .channel_offset = 0x10, |
| 268 | .timer_bit = 0, |
| 269 | .max_brightness = 1000, |
| 270 | }; |
| 271 | |
| 272 | static struct resource tpu30_resources[] = { |
| 273 | [0] = { |
| 274 | .name = "TPU30", |
| 275 | .start = 0xe6630010, |
| 276 | .end = 0xe6630035, |
| 277 | .flags = IORESOURCE_MEM, |
| 278 | }, |
| 279 | }; |
| 280 | |
| 281 | static struct platform_device leds_tpu30_device = { |
| 282 | .name = "leds-renesas-tpu", |
| 283 | .id = 30, |
| 284 | .dev = { |
| 285 | .platform_data = &led_renesas_tpu30_pdata, |
| 286 | }, |
| 287 | .num_resources = ARRAY_SIZE(tpu30_resources), |
| 288 | .resource = tpu30_resources, |
| 289 | }; |
| 290 | |
Kuninori Morimoto | c5e7bcd | 2011-11-10 18:44:43 -0800 | [diff] [blame] | 291 | /* MMCIF */ |
Magnus Damm | 4e92794 | 2011-08-18 05:44:42 +0000 | [diff] [blame] | 292 | static struct resource mmcif_resources[] = { |
| 293 | [0] = { |
| 294 | .name = "MMCIF", |
| 295 | .start = 0xe6bd0000, |
| 296 | .end = 0xe6bd00ff, |
| 297 | .flags = IORESOURCE_MEM, |
| 298 | }, |
| 299 | [1] = { |
| 300 | .start = gic_spi(140), |
| 301 | .flags = IORESOURCE_IRQ, |
| 302 | }, |
| 303 | [2] = { |
| 304 | .start = gic_spi(141), |
| 305 | .flags = IORESOURCE_IRQ, |
| 306 | }, |
| 307 | }; |
| 308 | |
| 309 | static struct sh_mmcif_plat_data mmcif_info = { |
| 310 | .ocr = MMC_VDD_165_195, |
| 311 | .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE, |
| 312 | }; |
| 313 | |
| 314 | static struct platform_device mmcif_device = { |
| 315 | .name = "sh_mmcif", |
| 316 | .id = 0, |
| 317 | .dev = { |
| 318 | .platform_data = &mmcif_info, |
| 319 | }, |
| 320 | .num_resources = ARRAY_SIZE(mmcif_resources), |
| 321 | .resource = mmcif_resources, |
| 322 | }; |
| 323 | |
Kuninori Morimoto | c5e7bcd | 2011-11-10 18:44:43 -0800 | [diff] [blame] | 324 | /* SDHI0 */ |
Magnus Damm | 8722c99 | 2011-08-18 05:45:00 +0000 | [diff] [blame] | 325 | static struct sh_mobile_sdhi_info sdhi0_info = { |
| 326 | .tmio_caps = MMC_CAP_SD_HIGHSPEED, |
| 327 | .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT, |
| 328 | }; |
| 329 | |
| 330 | static struct resource sdhi0_resources[] = { |
| 331 | [0] = { |
| 332 | .name = "SDHI0", |
| 333 | .start = 0xee100000, |
| 334 | .end = 0xee1000ff, |
| 335 | .flags = IORESOURCE_MEM, |
| 336 | }, |
| 337 | [1] = { |
| 338 | .start = gic_spi(83), |
| 339 | .flags = IORESOURCE_IRQ, |
| 340 | }, |
| 341 | [2] = { |
| 342 | .start = gic_spi(84), |
| 343 | .flags = IORESOURCE_IRQ, |
| 344 | }, |
| 345 | [3] = { |
| 346 | .start = gic_spi(85), |
| 347 | .flags = IORESOURCE_IRQ, |
| 348 | }, |
| 349 | }; |
| 350 | |
| 351 | static struct platform_device sdhi0_device = { |
| 352 | .name = "sh_mobile_sdhi", |
| 353 | .id = 0, |
| 354 | .num_resources = ARRAY_SIZE(sdhi0_resources), |
| 355 | .resource = sdhi0_resources, |
| 356 | .dev = { |
| 357 | .platform_data = &sdhi0_info, |
| 358 | }, |
| 359 | }; |
| 360 | |
Kuninori Morimoto | c5e7bcd | 2011-11-10 18:44:43 -0800 | [diff] [blame] | 361 | /* SDHI1 */ |
Magnus Damm | 8722c99 | 2011-08-18 05:45:00 +0000 | [diff] [blame] | 362 | static struct sh_mobile_sdhi_info sdhi1_info = { |
| 363 | .tmio_caps = MMC_CAP_NONREMOVABLE | MMC_CAP_SDIO_IRQ, |
| 364 | .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT, |
| 365 | }; |
| 366 | |
| 367 | static struct resource sdhi1_resources[] = { |
| 368 | [0] = { |
| 369 | .name = "SDHI1", |
| 370 | .start = 0xee120000, |
| 371 | .end = 0xee1200ff, |
| 372 | .flags = IORESOURCE_MEM, |
| 373 | }, |
| 374 | [1] = { |
| 375 | .start = gic_spi(87), |
| 376 | .flags = IORESOURCE_IRQ, |
| 377 | }, |
| 378 | [2] = { |
| 379 | .start = gic_spi(88), |
| 380 | .flags = IORESOURCE_IRQ, |
| 381 | }, |
| 382 | [3] = { |
| 383 | .start = gic_spi(89), |
| 384 | .flags = IORESOURCE_IRQ, |
| 385 | }, |
| 386 | }; |
| 387 | |
| 388 | static struct platform_device sdhi1_device = { |
| 389 | .name = "sh_mobile_sdhi", |
| 390 | .id = 1, |
| 391 | .num_resources = ARRAY_SIZE(sdhi1_resources), |
| 392 | .resource = sdhi1_resources, |
| 393 | .dev = { |
| 394 | .platform_data = &sdhi1_info, |
| 395 | }, |
| 396 | }; |
| 397 | |
Magnus Damm | 2862663 | 2011-08-18 05:44:07 +0000 | [diff] [blame] | 398 | static struct platform_device *kota2_devices[] __initdata = { |
| 399 | ð_device, |
Magnus Damm | ef4f994 | 2011-08-18 05:44:16 +0000 | [diff] [blame] | 400 | &keysc_device, |
Magnus Damm | 6b7c0ea | 2011-08-18 05:44:25 +0000 | [diff] [blame] | 401 | &gpio_keys_device, |
Magnus Damm | ae6e708 | 2011-08-18 05:44:33 +0000 | [diff] [blame] | 402 | &gpio_leds_device, |
Magnus Damm | 33661c9 | 2011-11-22 15:44:58 +0900 | [diff] [blame] | 403 | &leds_tpu12_device, |
| 404 | &leds_tpu41_device, |
| 405 | &leds_tpu21_device, |
| 406 | &leds_tpu30_device, |
Magnus Damm | 4e92794 | 2011-08-18 05:44:42 +0000 | [diff] [blame] | 407 | &mmcif_device, |
Magnus Damm | 8722c99 | 2011-08-18 05:45:00 +0000 | [diff] [blame] | 408 | &sdhi0_device, |
| 409 | &sdhi1_device, |
Magnus Damm | 2862663 | 2011-08-18 05:44:07 +0000 | [diff] [blame] | 410 | }; |
| 411 | |
Magnus Damm | 2862663 | 2011-08-18 05:44:07 +0000 | [diff] [blame] | 412 | static void __init kota2_init(void) |
| 413 | { |
| 414 | sh73a0_pinmux_init(); |
| 415 | |
| 416 | /* SCIFA2 (UART2) */ |
| 417 | gpio_request(GPIO_FN_SCIFA2_TXD1, NULL); |
| 418 | gpio_request(GPIO_FN_SCIFA2_RXD1, NULL); |
| 419 | gpio_request(GPIO_FN_SCIFA2_RTS1_, NULL); |
| 420 | gpio_request(GPIO_FN_SCIFA2_CTS1_, NULL); |
| 421 | |
Magnus Damm | 9e9a892 | 2011-08-18 05:44:51 +0000 | [diff] [blame] | 422 | /* SCIFA4 (UART1) */ |
| 423 | gpio_request(GPIO_FN_SCIFA4_TXD, NULL); |
| 424 | gpio_request(GPIO_FN_SCIFA4_RXD, NULL); |
| 425 | gpio_request(GPIO_FN_SCIFA4_RTS_, NULL); |
| 426 | gpio_request(GPIO_FN_SCIFA4_CTS_, NULL); |
| 427 | |
Magnus Damm | 2862663 | 2011-08-18 05:44:07 +0000 | [diff] [blame] | 428 | /* SMSC911X */ |
| 429 | gpio_request(GPIO_FN_D0_NAF0, NULL); |
| 430 | gpio_request(GPIO_FN_D1_NAF1, NULL); |
| 431 | gpio_request(GPIO_FN_D2_NAF2, NULL); |
| 432 | gpio_request(GPIO_FN_D3_NAF3, NULL); |
| 433 | gpio_request(GPIO_FN_D4_NAF4, NULL); |
| 434 | gpio_request(GPIO_FN_D5_NAF5, NULL); |
| 435 | gpio_request(GPIO_FN_D6_NAF6, NULL); |
| 436 | gpio_request(GPIO_FN_D7_NAF7, NULL); |
| 437 | gpio_request(GPIO_FN_D8_NAF8, NULL); |
| 438 | gpio_request(GPIO_FN_D9_NAF9, NULL); |
| 439 | gpio_request(GPIO_FN_D10_NAF10, NULL); |
| 440 | gpio_request(GPIO_FN_D11_NAF11, NULL); |
| 441 | gpio_request(GPIO_FN_D12_NAF12, NULL); |
| 442 | gpio_request(GPIO_FN_D13_NAF13, NULL); |
| 443 | gpio_request(GPIO_FN_D14_NAF14, NULL); |
| 444 | gpio_request(GPIO_FN_D15_NAF15, NULL); |
| 445 | gpio_request(GPIO_FN_CS5A_, NULL); |
| 446 | gpio_request(GPIO_FN_WE0__FWE, NULL); |
| 447 | gpio_request(GPIO_PORT144, NULL); /* PINTA2 */ |
| 448 | gpio_direction_input(GPIO_PORT144); |
| 449 | gpio_request(GPIO_PORT145, NULL); /* RESET */ |
| 450 | gpio_direction_output(GPIO_PORT145, 1); |
| 451 | |
Magnus Damm | ef4f994 | 2011-08-18 05:44:16 +0000 | [diff] [blame] | 452 | /* KEYSC */ |
| 453 | gpio_request(GPIO_FN_KEYIN0_PU, NULL); |
| 454 | gpio_request(GPIO_FN_KEYIN1_PU, NULL); |
| 455 | gpio_request(GPIO_FN_KEYIN2_PU, NULL); |
| 456 | gpio_request(GPIO_FN_KEYIN3_PU, NULL); |
| 457 | gpio_request(GPIO_FN_KEYIN4_PU, NULL); |
| 458 | gpio_request(GPIO_FN_KEYIN5_PU, NULL); |
| 459 | gpio_request(GPIO_FN_KEYIN6_PU, NULL); |
| 460 | gpio_request(GPIO_FN_KEYIN7_PU, NULL); |
| 461 | gpio_request(GPIO_FN_KEYOUT0, NULL); |
| 462 | gpio_request(GPIO_FN_KEYOUT1, NULL); |
| 463 | gpio_request(GPIO_FN_KEYOUT2, NULL); |
| 464 | gpio_request(GPIO_FN_KEYOUT3, NULL); |
| 465 | gpio_request(GPIO_FN_KEYOUT4, NULL); |
| 466 | gpio_request(GPIO_FN_KEYOUT5, NULL); |
| 467 | gpio_request(GPIO_FN_PORT59_KEYOUT6, NULL); |
| 468 | gpio_request(GPIO_FN_PORT58_KEYOUT7, NULL); |
| 469 | gpio_request(GPIO_FN_KEYOUT8, NULL); |
| 470 | |
Magnus Damm | 4e92794 | 2011-08-18 05:44:42 +0000 | [diff] [blame] | 471 | /* MMCIF */ |
| 472 | gpio_request(GPIO_FN_MMCCLK0, NULL); |
| 473 | gpio_request(GPIO_FN_MMCD0_0, NULL); |
| 474 | gpio_request(GPIO_FN_MMCD0_1, NULL); |
| 475 | gpio_request(GPIO_FN_MMCD0_2, NULL); |
| 476 | gpio_request(GPIO_FN_MMCD0_3, NULL); |
| 477 | gpio_request(GPIO_FN_MMCD0_4, NULL); |
| 478 | gpio_request(GPIO_FN_MMCD0_5, NULL); |
| 479 | gpio_request(GPIO_FN_MMCD0_6, NULL); |
| 480 | gpio_request(GPIO_FN_MMCD0_7, NULL); |
| 481 | gpio_request(GPIO_FN_MMCCMD0, NULL); |
| 482 | gpio_request(GPIO_PORT208, NULL); /* Reset */ |
| 483 | gpio_direction_output(GPIO_PORT208, 1); |
| 484 | |
Magnus Damm | 8722c99 | 2011-08-18 05:45:00 +0000 | [diff] [blame] | 485 | /* SDHI0 (microSD) */ |
| 486 | gpio_request(GPIO_FN_SDHICD0_PU, NULL); |
| 487 | gpio_request(GPIO_FN_SDHICMD0_PU, NULL); |
| 488 | gpio_request(GPIO_FN_SDHICLK0, NULL); |
| 489 | gpio_request(GPIO_FN_SDHID0_3_PU, NULL); |
| 490 | gpio_request(GPIO_FN_SDHID0_2_PU, NULL); |
| 491 | gpio_request(GPIO_FN_SDHID0_1_PU, NULL); |
| 492 | gpio_request(GPIO_FN_SDHID0_0_PU, NULL); |
| 493 | |
Magnus Damm | 9e9a892 | 2011-08-18 05:44:51 +0000 | [diff] [blame] | 494 | /* SCIFB (BT) */ |
| 495 | gpio_request(GPIO_FN_PORT159_SCIFB_SCK, NULL); |
| 496 | gpio_request(GPIO_FN_PORT160_SCIFB_TXD, NULL); |
| 497 | gpio_request(GPIO_FN_PORT161_SCIFB_CTS_, NULL); |
| 498 | gpio_request(GPIO_FN_PORT162_SCIFB_RXD, NULL); |
| 499 | gpio_request(GPIO_FN_PORT163_SCIFB_RTS_, NULL); |
| 500 | |
Magnus Damm | 8722c99 | 2011-08-18 05:45:00 +0000 | [diff] [blame] | 501 | /* SDHI1 (BCM4330) */ |
| 502 | gpio_request(GPIO_FN_SDHICLK1, NULL); |
| 503 | gpio_request(GPIO_FN_SDHICMD1_PU, NULL); |
| 504 | gpio_request(GPIO_FN_SDHID1_3_PU, NULL); |
| 505 | gpio_request(GPIO_FN_SDHID1_2_PU, NULL); |
| 506 | gpio_request(GPIO_FN_SDHID1_1_PU, NULL); |
| 507 | gpio_request(GPIO_FN_SDHID1_0_PU, NULL); |
| 508 | |
Magnus Damm | 2862663 | 2011-08-18 05:44:07 +0000 | [diff] [blame] | 509 | #ifdef CONFIG_CACHE_L2X0 |
| 510 | /* Early BRESP enable, Shared attribute override enable, 64K*8way */ |
Rob Herring | a2a47ca | 2012-03-09 17:16:40 -0600 | [diff] [blame] | 511 | l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff); |
Magnus Damm | 2862663 | 2011-08-18 05:44:07 +0000 | [diff] [blame] | 512 | #endif |
| 513 | sh73a0_add_standard_devices(); |
| 514 | platform_add_devices(kota2_devices, ARRAY_SIZE(kota2_devices)); |
| 515 | } |
| 516 | |
Magnus Damm | 2862663 | 2011-08-18 05:44:07 +0000 | [diff] [blame] | 517 | MACHINE_START(KOTA2, "kota2") |
Magnus Damm | 50e15c3 | 2012-02-29 21:37:27 +0900 | [diff] [blame] | 518 | .map_io = sh73a0_map_io, |
| 519 | .init_early = sh73a0_add_early_devices, |
Magnus Damm | dcb4ea8 | 2011-11-22 15:29:54 +0900 | [diff] [blame] | 520 | .nr_irqs = NR_IRQS_LEGACY, |
Magnus Damm | 1b6cec8 | 2011-11-22 15:15:57 +0900 | [diff] [blame] | 521 | .init_irq = sh73a0_init_irq, |
Marc Zyngier | a83d8e2 | 2011-09-06 10:23:45 +0100 | [diff] [blame] | 522 | .handle_irq = gic_handle_irq, |
Magnus Damm | 2862663 | 2011-08-18 05:44:07 +0000 | [diff] [blame] | 523 | .init_machine = kota2_init, |
Shawn Guo | 21cc1b7 | 2012-04-26 21:58:41 +0800 | [diff] [blame^] | 524 | .init_late = shmobile_init_late, |
Magnus Damm | 3be26fd | 2012-03-06 17:36:45 +0900 | [diff] [blame] | 525 | .timer = &shmobile_timer, |
Magnus Damm | 2862663 | 2011-08-18 05:44:07 +0000 | [diff] [blame] | 526 | MACHINE_END |