Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 1 | /* |
| 2 | * marzen board support |
| 3 | * |
| 4 | * Copyright (C) 2011 Renesas Solutions Corp. |
| 5 | * Copyright (C) 2011 Magnus Damm |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; version 2 of the License. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 19 | */ |
| 20 | |
| 21 | #include <linux/kernel.h> |
| 22 | #include <linux/init.h> |
| 23 | #include <linux/interrupt.h> |
| 24 | #include <linux/irq.h> |
| 25 | #include <linux/platform_device.h> |
| 26 | #include <linux/delay.h> |
| 27 | #include <linux/io.h> |
Laurent Pinchart | 48b1e3e | 2013-03-10 03:43:32 +0100 | [diff] [blame] | 28 | #include <linux/leds.h> |
Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 29 | #include <linux/dma-mapping.h> |
Laurent Pinchart | 4a655ec | 2013-03-06 14:22:11 +0100 | [diff] [blame] | 30 | #include <linux/pinctrl/machine.h> |
Laurent Pinchart | 5fcf4a3 | 2013-04-08 12:05:32 +0200 | [diff] [blame] | 31 | #include <linux/platform_data/gpio-rcar.h> |
Guennadi Liakhovetski | b354e22 | 2012-06-27 00:32:32 +0200 | [diff] [blame] | 32 | #include <linux/regulator/fixed.h> |
| 33 | #include <linux/regulator/machine.h> |
Magnus Damm | db5eb99 | 2011-12-14 01:36:51 +0900 | [diff] [blame] | 34 | #include <linux/smsc911x.h> |
Kuninori Morimoto | b82573e | 2012-10-10 19:57:02 -0700 | [diff] [blame] | 35 | #include <linux/spi/spi.h> |
| 36 | #include <linux/spi/sh_hspi.h> |
Simon Horman | 44e9ac4 | 2013-02-13 09:45:50 +0000 | [diff] [blame] | 37 | #include <linux/mmc/host.h> |
Phil Edworthy | 894cda1 | 2012-08-06 13:31:05 +0100 | [diff] [blame] | 38 | #include <linux/mmc/sh_mobile_sdhi.h> |
| 39 | #include <linux/mfd/tmio.h> |
Kuninori Morimoto | 94e1f7f | 2012-10-29 01:15:34 -0700 | [diff] [blame] | 40 | #include <linux/usb/otg.h> |
| 41 | #include <linux/usb/ehci_pdriver.h> |
Kuninori Morimoto | ac7c4ea | 2012-10-29 01:15:43 -0700 | [diff] [blame] | 42 | #include <linux/usb/ohci_pdriver.h> |
Kuninori Morimoto | 94e1f7f | 2012-10-29 01:15:34 -0700 | [diff] [blame] | 43 | #include <linux/pm_runtime.h> |
Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 44 | #include <mach/hardware.h> |
| 45 | #include <mach/r8a7779.h> |
| 46 | #include <mach/common.h> |
Rob Herring | 250a272 | 2012-01-03 16:57:33 -0600 | [diff] [blame] | 47 | #include <mach/irqs.h> |
Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 48 | #include <asm/mach-types.h> |
| 49 | #include <asm/mach/arch.h> |
Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 50 | #include <asm/traps.h> |
| 51 | |
Phil Edworthy | 894cda1 | 2012-08-06 13:31:05 +0100 | [diff] [blame] | 52 | /* Fixed 3.3V regulator to be used by SDHI0 */ |
| 53 | static struct regulator_consumer_supply fixed3v3_power_consumers[] = { |
| 54 | REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"), |
| 55 | REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"), |
| 56 | }; |
| 57 | |
Guennadi Liakhovetski | b354e22 | 2012-06-27 00:32:32 +0200 | [diff] [blame] | 58 | /* Dummy supplies, where voltage doesn't matter */ |
| 59 | static struct regulator_consumer_supply dummy_supplies[] = { |
| 60 | REGULATOR_SUPPLY("vddvario", "smsc911x"), |
| 61 | REGULATOR_SUPPLY("vdd33a", "smsc911x"), |
| 62 | }; |
| 63 | |
Magnus Damm | db5eb99 | 2011-12-14 01:36:51 +0900 | [diff] [blame] | 64 | /* SMSC LAN89218 */ |
| 65 | static struct resource smsc911x_resources[] = { |
| 66 | [0] = { |
| 67 | .start = 0x18000000, /* ExCS0 */ |
| 68 | .end = 0x180000ff, /* A1->A7 */ |
| 69 | .flags = IORESOURCE_MEM, |
| 70 | }, |
| 71 | [1] = { |
Simon Horman | 6e26703 | 2013-04-18 21:21:09 +0900 | [diff] [blame^] | 72 | .start = irq_pin(1), /* IRQ 1 */ |
Magnus Damm | db5eb99 | 2011-12-14 01:36:51 +0900 | [diff] [blame] | 73 | .flags = IORESOURCE_IRQ, |
| 74 | }, |
| 75 | }; |
| 76 | |
| 77 | static struct smsc911x_platform_config smsc911x_platdata = { |
| 78 | .flags = SMSC911X_USE_32BIT, /* 32-bit SW on 16-bit HW bus */ |
| 79 | .phy_interface = PHY_INTERFACE_MODE_MII, |
| 80 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, |
| 81 | .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, |
| 82 | }; |
| 83 | |
| 84 | static struct platform_device eth_device = { |
| 85 | .name = "smsc911x", |
Kuninori Morimoto | 497dcf6 | 2012-08-29 18:58:01 -0700 | [diff] [blame] | 86 | .id = -1, |
Magnus Damm | db5eb99 | 2011-12-14 01:36:51 +0900 | [diff] [blame] | 87 | .dev = { |
| 88 | .platform_data = &smsc911x_platdata, |
| 89 | }, |
| 90 | .resource = smsc911x_resources, |
| 91 | .num_resources = ARRAY_SIZE(smsc911x_resources), |
| 92 | }; |
| 93 | |
Phil Edworthy | 894cda1 | 2012-08-06 13:31:05 +0100 | [diff] [blame] | 94 | static struct resource sdhi0_resources[] = { |
| 95 | [0] = { |
| 96 | .name = "sdhi0", |
| 97 | .start = 0xffe4c000, |
| 98 | .end = 0xffe4c0ff, |
| 99 | .flags = IORESOURCE_MEM, |
| 100 | }, |
| 101 | [1] = { |
Kuninori Morimoto | 0b6794e | 2013-02-25 01:39:44 -0800 | [diff] [blame] | 102 | .start = gic_iid(0x88), |
Phil Edworthy | 894cda1 | 2012-08-06 13:31:05 +0100 | [diff] [blame] | 103 | .flags = IORESOURCE_IRQ, |
| 104 | }, |
| 105 | }; |
| 106 | |
| 107 | static struct sh_mobile_sdhi_info sdhi0_platform_data = { |
| 108 | .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT, |
| 109 | .tmio_caps = MMC_CAP_SD_HIGHSPEED, |
| 110 | }; |
| 111 | |
| 112 | static struct platform_device sdhi0_device = { |
| 113 | .name = "sh_mobile_sdhi", |
| 114 | .num_resources = ARRAY_SIZE(sdhi0_resources), |
| 115 | .resource = sdhi0_resources, |
| 116 | .id = 0, |
| 117 | .dev = { |
| 118 | .platform_data = &sdhi0_platform_data, |
| 119 | } |
| 120 | }; |
| 121 | |
Kuninori Morimoto | eb8ca94 | 2012-08-27 19:00:15 -0700 | [diff] [blame] | 122 | /* Thermal */ |
| 123 | static struct resource thermal_resources[] = { |
| 124 | [0] = { |
| 125 | .start = 0xFFC48000, |
| 126 | .end = 0xFFC48038 - 1, |
| 127 | .flags = IORESOURCE_MEM, |
| 128 | }, |
| 129 | }; |
| 130 | |
| 131 | static struct platform_device thermal_device = { |
| 132 | .name = "rcar_thermal", |
| 133 | .resource = thermal_resources, |
| 134 | .num_resources = ARRAY_SIZE(thermal_resources), |
| 135 | }; |
| 136 | |
Kuninori Morimoto | b82573e | 2012-10-10 19:57:02 -0700 | [diff] [blame] | 137 | /* HSPI */ |
| 138 | static struct resource hspi_resources[] = { |
| 139 | [0] = { |
| 140 | .start = 0xFFFC7000, |
| 141 | .end = 0xFFFC7018 - 1, |
| 142 | .flags = IORESOURCE_MEM, |
| 143 | }, |
| 144 | }; |
| 145 | |
| 146 | static struct platform_device hspi_device = { |
| 147 | .name = "sh-hspi", |
| 148 | .id = 0, |
| 149 | .resource = hspi_resources, |
| 150 | .num_resources = ARRAY_SIZE(hspi_resources), |
| 151 | }; |
| 152 | |
Kuninori Morimoto | b5ce635 | 2012-10-29 01:15:25 -0700 | [diff] [blame] | 153 | /* USB PHY */ |
| 154 | static struct resource usb_phy_resources[] = { |
| 155 | [0] = { |
| 156 | .start = 0xffe70000, |
| 157 | .end = 0xffe70900 - 1, |
| 158 | .flags = IORESOURCE_MEM, |
| 159 | }, |
| 160 | [1] = { |
| 161 | .start = 0xfff70000, |
| 162 | .end = 0xfff70900 - 1, |
| 163 | .flags = IORESOURCE_MEM, |
| 164 | }, |
| 165 | }; |
| 166 | |
| 167 | static struct platform_device usb_phy_device = { |
| 168 | .name = "rcar_usb_phy", |
| 169 | .resource = usb_phy_resources, |
| 170 | .num_resources = ARRAY_SIZE(usb_phy_resources), |
| 171 | }; |
| 172 | |
Laurent Pinchart | 48b1e3e | 2013-03-10 03:43:32 +0100 | [diff] [blame] | 173 | /* LEDS */ |
| 174 | static struct gpio_led marzen_leds[] = { |
| 175 | { |
| 176 | .name = "led2", |
Laurent Pinchart | 5fcf4a3 | 2013-04-08 12:05:32 +0200 | [diff] [blame] | 177 | .gpio = RCAR_GP_PIN(4, 29), |
Laurent Pinchart | 48b1e3e | 2013-03-10 03:43:32 +0100 | [diff] [blame] | 178 | .default_state = LEDS_GPIO_DEFSTATE_ON, |
| 179 | }, { |
| 180 | .name = "led3", |
Laurent Pinchart | 5fcf4a3 | 2013-04-08 12:05:32 +0200 | [diff] [blame] | 181 | .gpio = RCAR_GP_PIN(4, 30), |
Laurent Pinchart | 48b1e3e | 2013-03-10 03:43:32 +0100 | [diff] [blame] | 182 | .default_state = LEDS_GPIO_DEFSTATE_ON, |
| 183 | }, { |
| 184 | .name = "led4", |
Laurent Pinchart | 5fcf4a3 | 2013-04-08 12:05:32 +0200 | [diff] [blame] | 185 | .gpio = RCAR_GP_PIN(4, 31), |
Laurent Pinchart | 48b1e3e | 2013-03-10 03:43:32 +0100 | [diff] [blame] | 186 | .default_state = LEDS_GPIO_DEFSTATE_ON, |
| 187 | }, |
| 188 | }; |
| 189 | |
| 190 | static struct gpio_led_platform_data marzen_leds_pdata = { |
| 191 | .leds = marzen_leds, |
| 192 | .num_leds = ARRAY_SIZE(marzen_leds), |
| 193 | }; |
| 194 | |
| 195 | static struct platform_device leds_device = { |
| 196 | .name = "leds-gpio", |
| 197 | .id = 0, |
| 198 | .dev = { |
| 199 | .platform_data = &marzen_leds_pdata, |
| 200 | }, |
| 201 | }; |
| 202 | |
Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 203 | static struct platform_device *marzen_devices[] __initdata = { |
Magnus Damm | db5eb99 | 2011-12-14 01:36:51 +0900 | [diff] [blame] | 204 | ð_device, |
Phil Edworthy | 894cda1 | 2012-08-06 13:31:05 +0100 | [diff] [blame] | 205 | &sdhi0_device, |
Kuninori Morimoto | eb8ca94 | 2012-08-27 19:00:15 -0700 | [diff] [blame] | 206 | &thermal_device, |
Kuninori Morimoto | b82573e | 2012-10-10 19:57:02 -0700 | [diff] [blame] | 207 | &hspi_device, |
Kuninori Morimoto | b5ce635 | 2012-10-29 01:15:25 -0700 | [diff] [blame] | 208 | &usb_phy_device, |
Laurent Pinchart | 48b1e3e | 2013-03-10 03:43:32 +0100 | [diff] [blame] | 209 | &leds_device, |
Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 210 | }; |
| 211 | |
Kuninori Morimoto | 94e1f7f | 2012-10-29 01:15:34 -0700 | [diff] [blame] | 212 | /* USB */ |
| 213 | static struct usb_phy *phy; |
| 214 | static int usb_power_on(struct platform_device *pdev) |
| 215 | { |
| 216 | if (!phy) |
| 217 | return -EIO; |
| 218 | |
| 219 | pm_runtime_enable(&pdev->dev); |
| 220 | pm_runtime_get_sync(&pdev->dev); |
| 221 | |
| 222 | usb_phy_init(phy); |
| 223 | |
| 224 | return 0; |
| 225 | } |
| 226 | |
| 227 | static void usb_power_off(struct platform_device *pdev) |
| 228 | { |
| 229 | if (!phy) |
| 230 | return; |
| 231 | |
| 232 | usb_phy_shutdown(phy); |
| 233 | |
| 234 | pm_runtime_put_sync(&pdev->dev); |
| 235 | pm_runtime_disable(&pdev->dev); |
| 236 | } |
| 237 | |
| 238 | static struct usb_ehci_pdata ehcix_pdata = { |
| 239 | .power_on = usb_power_on, |
| 240 | .power_off = usb_power_off, |
| 241 | .power_suspend = usb_power_off, |
| 242 | }; |
| 243 | |
| 244 | static struct resource ehci0_resources[] = { |
| 245 | [0] = { |
| 246 | .start = 0xffe70000, |
| 247 | .end = 0xffe70400 - 1, |
| 248 | .flags = IORESOURCE_MEM, |
| 249 | }, |
| 250 | [1] = { |
Kuninori Morimoto | 0b6794e | 2013-02-25 01:39:44 -0800 | [diff] [blame] | 251 | .start = gic_iid(0x4c), |
Kuninori Morimoto | 94e1f7f | 2012-10-29 01:15:34 -0700 | [diff] [blame] | 252 | .flags = IORESOURCE_IRQ, |
| 253 | }, |
| 254 | }; |
| 255 | |
| 256 | static struct platform_device ehci0_device = { |
| 257 | .name = "ehci-platform", |
| 258 | .id = 0, |
| 259 | .dev = { |
| 260 | .dma_mask = &ehci0_device.dev.coherent_dma_mask, |
| 261 | .coherent_dma_mask = 0xffffffff, |
| 262 | .platform_data = &ehcix_pdata, |
| 263 | }, |
| 264 | .num_resources = ARRAY_SIZE(ehci0_resources), |
| 265 | .resource = ehci0_resources, |
| 266 | }; |
| 267 | |
| 268 | static struct resource ehci1_resources[] = { |
| 269 | [0] = { |
| 270 | .start = 0xfff70000, |
| 271 | .end = 0xfff70400 - 1, |
| 272 | .flags = IORESOURCE_MEM, |
| 273 | }, |
| 274 | [1] = { |
Kuninori Morimoto | 0b6794e | 2013-02-25 01:39:44 -0800 | [diff] [blame] | 275 | .start = gic_iid(0x4d), |
Kuninori Morimoto | 94e1f7f | 2012-10-29 01:15:34 -0700 | [diff] [blame] | 276 | .flags = IORESOURCE_IRQ, |
| 277 | }, |
| 278 | }; |
| 279 | |
| 280 | static struct platform_device ehci1_device = { |
| 281 | .name = "ehci-platform", |
| 282 | .id = 1, |
| 283 | .dev = { |
| 284 | .dma_mask = &ehci1_device.dev.coherent_dma_mask, |
| 285 | .coherent_dma_mask = 0xffffffff, |
| 286 | .platform_data = &ehcix_pdata, |
| 287 | }, |
| 288 | .num_resources = ARRAY_SIZE(ehci1_resources), |
| 289 | .resource = ehci1_resources, |
| 290 | }; |
| 291 | |
Kuninori Morimoto | ac7c4ea | 2012-10-29 01:15:43 -0700 | [diff] [blame] | 292 | static struct usb_ohci_pdata ohcix_pdata = { |
| 293 | .power_on = usb_power_on, |
| 294 | .power_off = usb_power_off, |
| 295 | .power_suspend = usb_power_off, |
| 296 | }; |
| 297 | |
| 298 | static struct resource ohci0_resources[] = { |
| 299 | [0] = { |
| 300 | .start = 0xffe70400, |
| 301 | .end = 0xffe70800 - 1, |
| 302 | .flags = IORESOURCE_MEM, |
| 303 | }, |
| 304 | [1] = { |
Kuninori Morimoto | 0b6794e | 2013-02-25 01:39:44 -0800 | [diff] [blame] | 305 | .start = gic_iid(0x4c), |
Kuninori Morimoto | ac7c4ea | 2012-10-29 01:15:43 -0700 | [diff] [blame] | 306 | .flags = IORESOURCE_IRQ, |
| 307 | }, |
| 308 | }; |
| 309 | |
| 310 | static struct platform_device ohci0_device = { |
| 311 | .name = "ohci-platform", |
| 312 | .id = 0, |
| 313 | .dev = { |
| 314 | .dma_mask = &ohci0_device.dev.coherent_dma_mask, |
| 315 | .coherent_dma_mask = 0xffffffff, |
| 316 | .platform_data = &ohcix_pdata, |
| 317 | }, |
| 318 | .num_resources = ARRAY_SIZE(ohci0_resources), |
| 319 | .resource = ohci0_resources, |
| 320 | }; |
| 321 | |
| 322 | static struct resource ohci1_resources[] = { |
| 323 | [0] = { |
| 324 | .start = 0xfff70400, |
| 325 | .end = 0xfff70800 - 1, |
| 326 | .flags = IORESOURCE_MEM, |
| 327 | }, |
| 328 | [1] = { |
Kuninori Morimoto | 0b6794e | 2013-02-25 01:39:44 -0800 | [diff] [blame] | 329 | .start = gic_iid(0x4d), |
Kuninori Morimoto | ac7c4ea | 2012-10-29 01:15:43 -0700 | [diff] [blame] | 330 | .flags = IORESOURCE_IRQ, |
| 331 | }, |
| 332 | }; |
| 333 | |
| 334 | static struct platform_device ohci1_device = { |
| 335 | .name = "ohci-platform", |
| 336 | .id = 1, |
| 337 | .dev = { |
| 338 | .dma_mask = &ohci1_device.dev.coherent_dma_mask, |
| 339 | .coherent_dma_mask = 0xffffffff, |
| 340 | .platform_data = &ohcix_pdata, |
| 341 | }, |
| 342 | .num_resources = ARRAY_SIZE(ohci1_resources), |
| 343 | .resource = ohci1_resources, |
| 344 | }; |
| 345 | |
Kuninori Morimoto | 94e1f7f | 2012-10-29 01:15:34 -0700 | [diff] [blame] | 346 | static struct platform_device *marzen_late_devices[] __initdata = { |
| 347 | &ehci0_device, |
| 348 | &ehci1_device, |
Kuninori Morimoto | ac7c4ea | 2012-10-29 01:15:43 -0700 | [diff] [blame] | 349 | &ohci0_device, |
| 350 | &ohci1_device, |
Kuninori Morimoto | 94e1f7f | 2012-10-29 01:15:34 -0700 | [diff] [blame] | 351 | }; |
| 352 | |
| 353 | void __init marzen_init_late(void) |
| 354 | { |
| 355 | /* get usb phy */ |
| 356 | phy = usb_get_phy(USB_PHY_TYPE_USB2); |
| 357 | |
| 358 | shmobile_init_late(); |
| 359 | platform_add_devices(marzen_late_devices, |
| 360 | ARRAY_SIZE(marzen_late_devices)); |
| 361 | } |
| 362 | |
Laurent Pinchart | 4a655ec | 2013-03-06 14:22:11 +0100 | [diff] [blame] | 363 | static const struct pinctrl_map marzen_pinctrl_map[] = { |
Laurent Pinchart | a321747 | 2013-03-06 14:22:11 +0100 | [diff] [blame] | 364 | /* HSPI0 */ |
| 365 | PIN_MAP_MUX_GROUP_DEFAULT("sh-hspi.0", "pfc-r8a7779", |
| 366 | "hspi0", "hspi0"), |
Laurent Pinchart | e9cd49f | 2013-03-06 14:22:11 +0100 | [diff] [blame] | 367 | /* SCIF2 (CN18: DEBUG0) */ |
| 368 | PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.2", "pfc-r8a7779", |
| 369 | "scif2_data_c", "scif2"), |
| 370 | /* SCIF4 (CN19: DEBUG1) */ |
| 371 | PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-r8a7779", |
| 372 | "scif4_data", "scif4"), |
Laurent Pinchart | 4a655ec | 2013-03-06 14:22:11 +0100 | [diff] [blame] | 373 | /* SDHI0 */ |
| 374 | PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779", |
| 375 | "sdhi0_data4", "sdhi0"), |
| 376 | PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779", |
| 377 | "sdhi0_ctrl", "sdhi0"), |
| 378 | PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779", |
| 379 | "sdhi0_cd", "sdhi0"), |
| 380 | PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779", |
| 381 | "sdhi0_wp", "sdhi0"), |
Laurent Pinchart | f423df8 | 2013-03-07 13:46:02 +0100 | [diff] [blame] | 382 | /* SMSC */ |
| 383 | PIN_MAP_MUX_GROUP_DEFAULT("smsc911x", "pfc-r8a7779", |
Laurent Pinchart | ee097e6 | 2013-03-07 13:46:02 +0100 | [diff] [blame] | 384 | "intc_irq1_b", "intc"), |
| 385 | PIN_MAP_MUX_GROUP_DEFAULT("smsc911x", "pfc-r8a7779", |
Laurent Pinchart | f423df8 | 2013-03-07 13:46:02 +0100 | [diff] [blame] | 386 | "lbsc_ex_cs0", "lbsc"), |
Laurent Pinchart | a00f6e5 | 2013-03-07 13:46:02 +0100 | [diff] [blame] | 387 | /* USB0 */ |
| 388 | PIN_MAP_MUX_GROUP_DEFAULT("ehci-platform.0", "pfc-r8a7779", |
| 389 | "usb0", "usb0"), |
| 390 | /* USB1 */ |
| 391 | PIN_MAP_MUX_GROUP_DEFAULT("ehci-platform.0", "pfc-r8a7779", |
| 392 | "usb1", "usb1"), |
| 393 | /* USB2 */ |
| 394 | PIN_MAP_MUX_GROUP_DEFAULT("ehci-platform.1", "pfc-r8a7779", |
| 395 | "usb2", "usb2"), |
Laurent Pinchart | 4a655ec | 2013-03-06 14:22:11 +0100 | [diff] [blame] | 396 | }; |
| 397 | |
Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 398 | static void __init marzen_init(void) |
| 399 | { |
Phil Edworthy | 894cda1 | 2012-08-06 13:31:05 +0100 | [diff] [blame] | 400 | regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers, |
| 401 | ARRAY_SIZE(fixed3v3_power_consumers), 3300000); |
Kuninori Morimoto | 90b85af | 2012-08-29 18:58:15 -0700 | [diff] [blame] | 402 | regulator_register_fixed(1, dummy_supplies, |
Phil Edworthy | 894cda1 | 2012-08-06 13:31:05 +0100 | [diff] [blame] | 403 | ARRAY_SIZE(dummy_supplies)); |
Guennadi Liakhovetski | b354e22 | 2012-06-27 00:32:32 +0200 | [diff] [blame] | 404 | |
Laurent Pinchart | 4a655ec | 2013-03-06 14:22:11 +0100 | [diff] [blame] | 405 | pinctrl_register_mappings(marzen_pinctrl_map, |
| 406 | ARRAY_SIZE(marzen_pinctrl_map)); |
Magnus Damm | 19c43fc | 2011-12-14 01:36:22 +0900 | [diff] [blame] | 407 | r8a7779_pinmux_init(); |
Simon Horman | 6e26703 | 2013-04-18 21:21:09 +0900 | [diff] [blame^] | 408 | r8a7779_init_irq_extpin(1); /* IRQ1 as individual interrupt */ |
Magnus Damm | 19c43fc | 2011-12-14 01:36:22 +0900 | [diff] [blame] | 409 | |
Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 410 | r8a7779_add_standard_devices(); |
| 411 | platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices)); |
| 412 | } |
| 413 | |
Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 414 | MACHINE_START(MARZEN, "marzen") |
Marc Zyngier | a62580e | 2011-09-08 13:15:22 +0100 | [diff] [blame] | 415 | .smp = smp_ops(r8a7779_smp_ops), |
Magnus Damm | 3e353b87 | 2012-02-29 21:37:43 +0900 | [diff] [blame] | 416 | .map_io = r8a7779_map_io, |
| 417 | .init_early = r8a7779_add_early_devices, |
Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 418 | .nr_irqs = NR_IRQS_LEGACY, |
| 419 | .init_irq = r8a7779_init_irq, |
Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 420 | .init_machine = marzen_init, |
Kuninori Morimoto | 94e1f7f | 2012-10-29 01:15:34 -0700 | [diff] [blame] | 421 | .init_late = marzen_init_late, |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 422 | .init_time = r8a7779_earlytimer_init, |
Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 423 | MACHINE_END |