Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 1 | /* |
| 2 | * marzen board support |
| 3 | * |
Vladimir Barinov | 7cef5e7f | 2013-08-22 17:25:25 -0300 | [diff] [blame] | 4 | * Copyright (C) 2011, 2013 Renesas Solutions Corp. |
Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 5 | * Copyright (C) 2011 Magnus Damm |
Vladimir Barinov | 7cef5e7f | 2013-08-22 17:25:25 -0300 | [diff] [blame] | 6 | * Copyright (C) 2013 Cogent Embedded, Inc. |
Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; version 2 of the License. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this program; if not, write to the Free Software |
| 19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 20 | */ |
| 21 | |
| 22 | #include <linux/kernel.h> |
| 23 | #include <linux/init.h> |
| 24 | #include <linux/interrupt.h> |
| 25 | #include <linux/irq.h> |
| 26 | #include <linux/platform_device.h> |
| 27 | #include <linux/delay.h> |
| 28 | #include <linux/io.h> |
Laurent Pinchart | 48b1e3e | 2013-03-10 03:43:32 +0100 | [diff] [blame] | 29 | #include <linux/leds.h> |
Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 30 | #include <linux/dma-mapping.h> |
Laurent Pinchart | 4a655ec | 2013-03-06 14:22:11 +0100 | [diff] [blame] | 31 | #include <linux/pinctrl/machine.h> |
Laurent Pinchart | 5fcf4a3 | 2013-04-08 12:05:32 +0200 | [diff] [blame] | 32 | #include <linux/platform_data/gpio-rcar.h> |
Laurent Pinchart | df83d90 | 2013-03-27 11:55:35 +0100 | [diff] [blame] | 33 | #include <linux/platform_data/rcar-du.h> |
Kuninori Morimoto | fee529d | 2013-07-26 00:35:29 -0700 | [diff] [blame] | 34 | #include <linux/platform_data/usb-rcar-phy.h> |
Guennadi Liakhovetski | b354e22 | 2012-06-27 00:32:32 +0200 | [diff] [blame] | 35 | #include <linux/regulator/fixed.h> |
| 36 | #include <linux/regulator/machine.h> |
Magnus Damm | db5eb99 | 2011-12-14 01:36:51 +0900 | [diff] [blame] | 37 | #include <linux/smsc911x.h> |
Kuninori Morimoto | b82573e | 2012-10-10 19:57:02 -0700 | [diff] [blame] | 38 | #include <linux/spi/spi.h> |
| 39 | #include <linux/spi/sh_hspi.h> |
Simon Horman | 44e9ac4 | 2013-02-13 09:45:50 +0000 | [diff] [blame] | 40 | #include <linux/mmc/host.h> |
Phil Edworthy | 894cda1 | 2012-08-06 13:31:05 +0100 | [diff] [blame] | 41 | #include <linux/mmc/sh_mobile_sdhi.h> |
| 42 | #include <linux/mfd/tmio.h> |
Vladimir Barinov | 7cef5e7f | 2013-08-22 17:25:25 -0300 | [diff] [blame] | 43 | #include <media/soc_camera.h> |
Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 44 | #include <mach/r8a7779.h> |
| 45 | #include <mach/common.h> |
Rob Herring | 250a272 | 2012-01-03 16:57:33 -0600 | [diff] [blame] | 46 | #include <mach/irqs.h> |
Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 47 | #include <asm/mach-types.h> |
| 48 | #include <asm/mach/arch.h> |
Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 49 | #include <asm/traps.h> |
| 50 | |
Phil Edworthy | 894cda1 | 2012-08-06 13:31:05 +0100 | [diff] [blame] | 51 | /* Fixed 3.3V regulator to be used by SDHI0 */ |
| 52 | static struct regulator_consumer_supply fixed3v3_power_consumers[] = { |
| 53 | REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"), |
| 54 | REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"), |
| 55 | }; |
| 56 | |
Guennadi Liakhovetski | b354e22 | 2012-06-27 00:32:32 +0200 | [diff] [blame] | 57 | /* Dummy supplies, where voltage doesn't matter */ |
| 58 | static struct regulator_consumer_supply dummy_supplies[] = { |
| 59 | REGULATOR_SUPPLY("vddvario", "smsc911x"), |
| 60 | REGULATOR_SUPPLY("vdd33a", "smsc911x"), |
| 61 | }; |
| 62 | |
Kuninori Morimoto | fee529d | 2013-07-26 00:35:29 -0700 | [diff] [blame] | 63 | /* USB PHY */ |
| 64 | static struct resource usb_phy_resources[] = { |
| 65 | [0] = { |
| 66 | .start = 0xffe70800, |
| 67 | .end = 0xffe70900 - 1, |
| 68 | .flags = IORESOURCE_MEM, |
| 69 | }, |
| 70 | }; |
| 71 | |
| 72 | static struct rcar_phy_platform_data usb_phy_platform_data; |
| 73 | |
| 74 | static struct platform_device usb_phy = { |
| 75 | .name = "rcar_usb_phy", |
| 76 | .id = -1, |
| 77 | .dev = { |
| 78 | .platform_data = &usb_phy_platform_data, |
| 79 | }, |
| 80 | .resource = usb_phy_resources, |
| 81 | .num_resources = ARRAY_SIZE(usb_phy_resources), |
| 82 | }; |
Sergei Shtylyov | 2437b27 | 2013-06-02 01:55:04 +0400 | [diff] [blame] | 83 | |
Magnus Damm | db5eb99 | 2011-12-14 01:36:51 +0900 | [diff] [blame] | 84 | /* SMSC LAN89218 */ |
| 85 | static struct resource smsc911x_resources[] = { |
| 86 | [0] = { |
| 87 | .start = 0x18000000, /* ExCS0 */ |
| 88 | .end = 0x180000ff, /* A1->A7 */ |
| 89 | .flags = IORESOURCE_MEM, |
| 90 | }, |
| 91 | [1] = { |
Simon Horman | 6e26703 | 2013-04-18 21:21:09 +0900 | [diff] [blame] | 92 | .start = irq_pin(1), /* IRQ 1 */ |
Magnus Damm | db5eb99 | 2011-12-14 01:36:51 +0900 | [diff] [blame] | 93 | .flags = IORESOURCE_IRQ, |
| 94 | }, |
| 95 | }; |
| 96 | |
| 97 | static struct smsc911x_platform_config smsc911x_platdata = { |
| 98 | .flags = SMSC911X_USE_32BIT, /* 32-bit SW on 16-bit HW bus */ |
| 99 | .phy_interface = PHY_INTERFACE_MODE_MII, |
| 100 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, |
| 101 | .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, |
| 102 | }; |
| 103 | |
| 104 | static struct platform_device eth_device = { |
| 105 | .name = "smsc911x", |
Kuninori Morimoto | 497dcf6 | 2012-08-29 18:58:01 -0700 | [diff] [blame] | 106 | .id = -1, |
Magnus Damm | db5eb99 | 2011-12-14 01:36:51 +0900 | [diff] [blame] | 107 | .dev = { |
| 108 | .platform_data = &smsc911x_platdata, |
| 109 | }, |
| 110 | .resource = smsc911x_resources, |
| 111 | .num_resources = ARRAY_SIZE(smsc911x_resources), |
| 112 | }; |
| 113 | |
Phil Edworthy | 894cda1 | 2012-08-06 13:31:05 +0100 | [diff] [blame] | 114 | static struct resource sdhi0_resources[] = { |
| 115 | [0] = { |
| 116 | .name = "sdhi0", |
| 117 | .start = 0xffe4c000, |
| 118 | .end = 0xffe4c0ff, |
| 119 | .flags = IORESOURCE_MEM, |
| 120 | }, |
| 121 | [1] = { |
Kuninori Morimoto | 0b6794e | 2013-02-25 01:39:44 -0800 | [diff] [blame] | 122 | .start = gic_iid(0x88), |
Phil Edworthy | 894cda1 | 2012-08-06 13:31:05 +0100 | [diff] [blame] | 123 | .flags = IORESOURCE_IRQ, |
| 124 | }, |
| 125 | }; |
| 126 | |
| 127 | static struct sh_mobile_sdhi_info sdhi0_platform_data = { |
Max Filippov | e6a8b11 | 2013-08-25 21:47:26 +0400 | [diff] [blame] | 128 | .dma_slave_tx = HPBDMA_SLAVE_SDHI0_TX, |
| 129 | .dma_slave_rx = HPBDMA_SLAVE_SDHI0_RX, |
Phil Edworthy | 894cda1 | 2012-08-06 13:31:05 +0100 | [diff] [blame] | 130 | .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT, |
| 131 | .tmio_caps = MMC_CAP_SD_HIGHSPEED, |
| 132 | }; |
| 133 | |
| 134 | static struct platform_device sdhi0_device = { |
| 135 | .name = "sh_mobile_sdhi", |
| 136 | .num_resources = ARRAY_SIZE(sdhi0_resources), |
| 137 | .resource = sdhi0_resources, |
| 138 | .id = 0, |
| 139 | .dev = { |
| 140 | .platform_data = &sdhi0_platform_data, |
| 141 | } |
| 142 | }; |
| 143 | |
Kuninori Morimoto | eb8ca94 | 2012-08-27 19:00:15 -0700 | [diff] [blame] | 144 | /* Thermal */ |
| 145 | static struct resource thermal_resources[] = { |
| 146 | [0] = { |
| 147 | .start = 0xFFC48000, |
| 148 | .end = 0xFFC48038 - 1, |
| 149 | .flags = IORESOURCE_MEM, |
| 150 | }, |
| 151 | }; |
| 152 | |
| 153 | static struct platform_device thermal_device = { |
| 154 | .name = "rcar_thermal", |
| 155 | .resource = thermal_resources, |
| 156 | .num_resources = ARRAY_SIZE(thermal_resources), |
| 157 | }; |
| 158 | |
Kuninori Morimoto | b82573e | 2012-10-10 19:57:02 -0700 | [diff] [blame] | 159 | /* HSPI */ |
| 160 | static struct resource hspi_resources[] = { |
| 161 | [0] = { |
| 162 | .start = 0xFFFC7000, |
| 163 | .end = 0xFFFC7018 - 1, |
| 164 | .flags = IORESOURCE_MEM, |
| 165 | }, |
| 166 | }; |
| 167 | |
| 168 | static struct platform_device hspi_device = { |
| 169 | .name = "sh-hspi", |
| 170 | .id = 0, |
| 171 | .resource = hspi_resources, |
| 172 | .num_resources = ARRAY_SIZE(hspi_resources), |
| 173 | }; |
| 174 | |
Laurent Pinchart | df83d90 | 2013-03-27 11:55:35 +0100 | [diff] [blame] | 175 | /* |
| 176 | * DU |
| 177 | * |
| 178 | * The panel only specifies the [hv]display and [hv]total values. The position |
| 179 | * and width of the sync pulses don't matter, they're copied from VESA timings. |
| 180 | */ |
| 181 | static struct rcar_du_encoder_data du_encoders[] = { |
| 182 | { |
| 183 | .type = RCAR_DU_ENCODER_VGA, |
| 184 | .output = RCAR_DU_OUTPUT_DPAD0, |
| 185 | }, { |
| 186 | .type = RCAR_DU_ENCODER_LVDS, |
| 187 | .output = RCAR_DU_OUTPUT_DPAD1, |
| 188 | .connector.lvds.panel = { |
| 189 | .width_mm = 210, |
| 190 | .height_mm = 158, |
| 191 | .mode = { |
| 192 | .clock = 65000, |
| 193 | .hdisplay = 1024, |
| 194 | .hsync_start = 1048, |
| 195 | .hsync_end = 1184, |
| 196 | .htotal = 1344, |
| 197 | .vdisplay = 768, |
| 198 | .vsync_start = 771, |
| 199 | .vsync_end = 777, |
| 200 | .vtotal = 806, |
| 201 | .flags = 0, |
| 202 | }, |
| 203 | }, |
| 204 | }, |
| 205 | }; |
| 206 | |
| 207 | static const struct rcar_du_platform_data du_pdata __initconst = { |
| 208 | .encoders = du_encoders, |
| 209 | .num_encoders = ARRAY_SIZE(du_encoders), |
| 210 | }; |
| 211 | |
| 212 | static const struct resource du_resources[] __initconst = { |
| 213 | DEFINE_RES_MEM(0xfff80000, 0x40000), |
| 214 | DEFINE_RES_IRQ(gic_iid(0x3f)), |
| 215 | }; |
| 216 | |
| 217 | static void __init marzen_add_du_device(void) |
| 218 | { |
| 219 | struct platform_device_info info = { |
| 220 | .name = "rcar-du-r8a7779", |
| 221 | .id = -1, |
| 222 | .res = du_resources, |
| 223 | .num_res = ARRAY_SIZE(du_resources), |
| 224 | .data = &du_pdata, |
| 225 | .size_data = sizeof(du_pdata), |
| 226 | .dma_mask = DMA_BIT_MASK(32), |
| 227 | }; |
| 228 | |
| 229 | platform_device_register_full(&info); |
| 230 | } |
| 231 | |
Laurent Pinchart | 48b1e3e | 2013-03-10 03:43:32 +0100 | [diff] [blame] | 232 | /* LEDS */ |
| 233 | static struct gpio_led marzen_leds[] = { |
| 234 | { |
| 235 | .name = "led2", |
Laurent Pinchart | 5fcf4a3 | 2013-04-08 12:05:32 +0200 | [diff] [blame] | 236 | .gpio = RCAR_GP_PIN(4, 29), |
Laurent Pinchart | 48b1e3e | 2013-03-10 03:43:32 +0100 | [diff] [blame] | 237 | .default_state = LEDS_GPIO_DEFSTATE_ON, |
| 238 | }, { |
| 239 | .name = "led3", |
Laurent Pinchart | 5fcf4a3 | 2013-04-08 12:05:32 +0200 | [diff] [blame] | 240 | .gpio = RCAR_GP_PIN(4, 30), |
Laurent Pinchart | 48b1e3e | 2013-03-10 03:43:32 +0100 | [diff] [blame] | 241 | .default_state = LEDS_GPIO_DEFSTATE_ON, |
| 242 | }, { |
| 243 | .name = "led4", |
Laurent Pinchart | 5fcf4a3 | 2013-04-08 12:05:32 +0200 | [diff] [blame] | 244 | .gpio = RCAR_GP_PIN(4, 31), |
Laurent Pinchart | 48b1e3e | 2013-03-10 03:43:32 +0100 | [diff] [blame] | 245 | .default_state = LEDS_GPIO_DEFSTATE_ON, |
| 246 | }, |
| 247 | }; |
| 248 | |
| 249 | static struct gpio_led_platform_data marzen_leds_pdata = { |
| 250 | .leds = marzen_leds, |
| 251 | .num_leds = ARRAY_SIZE(marzen_leds), |
| 252 | }; |
| 253 | |
| 254 | static struct platform_device leds_device = { |
| 255 | .name = "leds-gpio", |
| 256 | .id = 0, |
| 257 | .dev = { |
| 258 | .platform_data = &marzen_leds_pdata, |
| 259 | }, |
| 260 | }; |
| 261 | |
Vladimir Barinov | 7cef5e7f | 2013-08-22 17:25:25 -0300 | [diff] [blame] | 262 | static struct rcar_vin_platform_data vin_platform_data __initdata = { |
| 263 | .flags = RCAR_VIN_BT656, |
| 264 | }; |
| 265 | |
| 266 | #define MARZEN_CAMERA(idx) \ |
| 267 | static struct i2c_board_info camera##idx##_info = { \ |
| 268 | I2C_BOARD_INFO("adv7180", 0x20 + (idx)), \ |
| 269 | }; \ |
| 270 | \ |
| 271 | static struct soc_camera_link iclink##idx##_adv7180 = { \ |
| 272 | .bus_id = 1 + 2 * (idx), \ |
| 273 | .i2c_adapter_id = 0, \ |
| 274 | .board_info = &camera##idx##_info, \ |
| 275 | }; \ |
| 276 | \ |
| 277 | static struct platform_device camera##idx##_device = { \ |
| 278 | .name = "soc-camera-pdrv", \ |
| 279 | .id = idx, \ |
| 280 | .dev = { \ |
| 281 | .platform_data = &iclink##idx##_adv7180, \ |
| 282 | }, \ |
| 283 | }; |
| 284 | |
| 285 | MARZEN_CAMERA(0); |
| 286 | MARZEN_CAMERA(1); |
| 287 | |
Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 288 | static struct platform_device *marzen_devices[] __initdata = { |
Magnus Damm | db5eb99 | 2011-12-14 01:36:51 +0900 | [diff] [blame] | 289 | ð_device, |
Phil Edworthy | 894cda1 | 2012-08-06 13:31:05 +0100 | [diff] [blame] | 290 | &sdhi0_device, |
Kuninori Morimoto | eb8ca94 | 2012-08-27 19:00:15 -0700 | [diff] [blame] | 291 | &thermal_device, |
Kuninori Morimoto | b82573e | 2012-10-10 19:57:02 -0700 | [diff] [blame] | 292 | &hspi_device, |
Laurent Pinchart | 48b1e3e | 2013-03-10 03:43:32 +0100 | [diff] [blame] | 293 | &leds_device, |
Kuninori Morimoto | fee529d | 2013-07-26 00:35:29 -0700 | [diff] [blame] | 294 | &usb_phy, |
Vladimir Barinov | 7cef5e7f | 2013-08-22 17:25:25 -0300 | [diff] [blame] | 295 | &camera0_device, |
| 296 | &camera1_device, |
Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 297 | }; |
| 298 | |
Laurent Pinchart | 4a655ec | 2013-03-06 14:22:11 +0100 | [diff] [blame] | 299 | static const struct pinctrl_map marzen_pinctrl_map[] = { |
Laurent Pinchart | df83d90 | 2013-03-27 11:55:35 +0100 | [diff] [blame] | 300 | /* DU (CN10: ARGB0, CN13: LVDS) */ |
| 301 | PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7779", "pfc-r8a7779", |
| 302 | "du0_rgb888", "du0"), |
| 303 | PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7779", "pfc-r8a7779", |
| 304 | "du0_sync_1", "du0"), |
| 305 | PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7779", "pfc-r8a7779", |
| 306 | "du0_clk_out_0", "du0"), |
| 307 | PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7779", "pfc-r8a7779", |
| 308 | "du1_rgb666", "du1"), |
| 309 | PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7779", "pfc-r8a7779", |
| 310 | "du1_sync_1", "du1"), |
| 311 | PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7779", "pfc-r8a7779", |
| 312 | "du1_clk_out", "du1"), |
Laurent Pinchart | a321747 | 2013-03-06 14:22:11 +0100 | [diff] [blame] | 313 | /* HSPI0 */ |
| 314 | PIN_MAP_MUX_GROUP_DEFAULT("sh-hspi.0", "pfc-r8a7779", |
| 315 | "hspi0", "hspi0"), |
Laurent Pinchart | e9cd49f | 2013-03-06 14:22:11 +0100 | [diff] [blame] | 316 | /* SCIF2 (CN18: DEBUG0) */ |
| 317 | PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.2", "pfc-r8a7779", |
| 318 | "scif2_data_c", "scif2"), |
| 319 | /* SCIF4 (CN19: DEBUG1) */ |
| 320 | PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-r8a7779", |
| 321 | "scif4_data", "scif4"), |
Laurent Pinchart | 4a655ec | 2013-03-06 14:22:11 +0100 | [diff] [blame] | 322 | /* SDHI0 */ |
| 323 | PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779", |
| 324 | "sdhi0_data4", "sdhi0"), |
| 325 | PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779", |
| 326 | "sdhi0_ctrl", "sdhi0"), |
| 327 | PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779", |
| 328 | "sdhi0_cd", "sdhi0"), |
| 329 | PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779", |
| 330 | "sdhi0_wp", "sdhi0"), |
Laurent Pinchart | f423df8 | 2013-03-07 13:46:02 +0100 | [diff] [blame] | 331 | /* SMSC */ |
| 332 | PIN_MAP_MUX_GROUP_DEFAULT("smsc911x", "pfc-r8a7779", |
Laurent Pinchart | ee097e6 | 2013-03-07 13:46:02 +0100 | [diff] [blame] | 333 | "intc_irq1_b", "intc"), |
| 334 | PIN_MAP_MUX_GROUP_DEFAULT("smsc911x", "pfc-r8a7779", |
Laurent Pinchart | f423df8 | 2013-03-07 13:46:02 +0100 | [diff] [blame] | 335 | "lbsc_ex_cs0", "lbsc"), |
Laurent Pinchart | a00f6e5 | 2013-03-07 13:46:02 +0100 | [diff] [blame] | 336 | /* USB0 */ |
| 337 | PIN_MAP_MUX_GROUP_DEFAULT("ehci-platform.0", "pfc-r8a7779", |
| 338 | "usb0", "usb0"), |
| 339 | /* USB1 */ |
| 340 | PIN_MAP_MUX_GROUP_DEFAULT("ehci-platform.0", "pfc-r8a7779", |
| 341 | "usb1", "usb1"), |
| 342 | /* USB2 */ |
| 343 | PIN_MAP_MUX_GROUP_DEFAULT("ehci-platform.1", "pfc-r8a7779", |
| 344 | "usb2", "usb2"), |
Vladimir Barinov | 7cef5e7f | 2013-08-22 17:25:25 -0300 | [diff] [blame] | 345 | /* VIN1 */ |
| 346 | PIN_MAP_MUX_GROUP_DEFAULT("r8a7779-vin.1", "pfc-r8a7779", |
| 347 | "vin1_clk", "vin1"), |
| 348 | PIN_MAP_MUX_GROUP_DEFAULT("r8a7779-vin.1", "pfc-r8a7779", |
| 349 | "vin1_data8", "vin1"), |
| 350 | /* VIN3 */ |
| 351 | PIN_MAP_MUX_GROUP_DEFAULT("r8a7779-vin.3", "pfc-r8a7779", |
| 352 | "vin3_clk", "vin3"), |
| 353 | PIN_MAP_MUX_GROUP_DEFAULT("r8a7779-vin.3", "pfc-r8a7779", |
| 354 | "vin3_data8", "vin3"), |
Laurent Pinchart | 4a655ec | 2013-03-06 14:22:11 +0100 | [diff] [blame] | 355 | }; |
| 356 | |
Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 357 | static void __init marzen_init(void) |
| 358 | { |
Phil Edworthy | 894cda1 | 2012-08-06 13:31:05 +0100 | [diff] [blame] | 359 | regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers, |
| 360 | ARRAY_SIZE(fixed3v3_power_consumers), 3300000); |
Kuninori Morimoto | 90b85af | 2012-08-29 18:58:15 -0700 | [diff] [blame] | 361 | regulator_register_fixed(1, dummy_supplies, |
Phil Edworthy | 894cda1 | 2012-08-06 13:31:05 +0100 | [diff] [blame] | 362 | ARRAY_SIZE(dummy_supplies)); |
Guennadi Liakhovetski | b354e22 | 2012-06-27 00:32:32 +0200 | [diff] [blame] | 363 | |
Laurent Pinchart | 4a655ec | 2013-03-06 14:22:11 +0100 | [diff] [blame] | 364 | pinctrl_register_mappings(marzen_pinctrl_map, |
| 365 | ARRAY_SIZE(marzen_pinctrl_map)); |
Magnus Damm | 19c43fc | 2011-12-14 01:36:22 +0900 | [diff] [blame] | 366 | r8a7779_pinmux_init(); |
Simon Horman | 6e26703 | 2013-04-18 21:21:09 +0900 | [diff] [blame] | 367 | r8a7779_init_irq_extpin(1); /* IRQ1 as individual interrupt */ |
Magnus Damm | 19c43fc | 2011-12-14 01:36:22 +0900 | [diff] [blame] | 368 | |
Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 369 | r8a7779_add_standard_devices(); |
Vladimir Barinov | 7cef5e7f | 2013-08-22 17:25:25 -0300 | [diff] [blame] | 370 | r8a7779_add_vin_device(1, &vin_platform_data); |
| 371 | r8a7779_add_vin_device(3, &vin_platform_data); |
Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 372 | platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices)); |
Laurent Pinchart | df83d90 | 2013-03-27 11:55:35 +0100 | [diff] [blame] | 373 | marzen_add_du_device(); |
Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 374 | } |
| 375 | |
Magnus Damm | 7ebbb4a | 2013-07-24 16:30:42 +0900 | [diff] [blame] | 376 | static const char *marzen_boards_compat_dt[] __initdata = { |
| 377 | "renesas,marzen", |
| 378 | NULL, |
| 379 | }; |
| 380 | |
| 381 | DT_MACHINE_START(MARZEN, "marzen") |
Marc Zyngier | a62580e | 2011-09-08 13:15:22 +0100 | [diff] [blame] | 382 | .smp = smp_ops(r8a7779_smp_ops), |
Magnus Damm | 3e353b87 | 2012-02-29 21:37:43 +0900 | [diff] [blame] | 383 | .map_io = r8a7779_map_io, |
| 384 | .init_early = r8a7779_add_early_devices, |
Kuninori Morimoto | 693ac41 | 2013-08-01 23:39:34 -0700 | [diff] [blame] | 385 | .init_irq = r8a7779_init_irq_dt, |
Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 386 | .init_machine = marzen_init, |
Sergei Shtylyov | 2c8788b | 2013-06-02 01:30:15 +0400 | [diff] [blame] | 387 | .init_late = r8a7779_init_late, |
Magnus Damm | 7ebbb4a | 2013-07-24 16:30:42 +0900 | [diff] [blame] | 388 | .dt_compat = marzen_boards_compat_dt, |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 389 | .init_time = r8a7779_earlytimer_init, |
Magnus Damm | f411fad | 2011-12-14 01:36:12 +0900 | [diff] [blame] | 390 | MACHINE_END |