f24ab3c7de7fc4e620023dea3ae0e97fa56808b6
[linux-3.10.git] / arch / arm / mach-tegra / board-pluto.c
1 /*
2  * arch/arm/mach-tegra/board-pluto.c
3  *
4  * Copyright (c) 2012-2014, NVIDIA CORPORATION. All rights reserved.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18  */
19
20 #include <linux/kernel.h>
21 #include <linux/init.h>
22 #include <linux/slab.h>
23 #include <linux/ctype.h>
24 #include <linux/platform_device.h>
25 #include <linux/clk.h>
26 #include <linux/serial_8250.h>
27 #include <linux/i2c.h>
28 #include <linux/dma-mapping.h>
29 #include <linux/delay.h>
30 #include <linux/i2c-tegra.h>
31 #include <linux/gpio.h>
32 #include <linux/input.h>
33 #include <linux/platform_data/tegra_usb.h>
34 #include <linux/spi/spi.h>
35 #include <linux/spi/rm31080a_ts.h>
36 #include <linux/platform_data/serial-tegra.h>
37 #include <linux/memblock.h>
38 #include <linux/spi/spi-tegra.h>
39 #include <linux/nfc/pn544.h>
40 #include <linux/nfc/bcm2079x.h>
41 #include <linux/rfkill-gpio.h>
42 #include <linux/skbuff.h>
43 #include <linux/ti_wilink_st.h>
44 #include <linux/regulator/consumer.h>
45 #include <linux/smb349-charger.h>
46 #include <linux/max17048_battery.h>
47 #include <linux/leds.h>
48 #include <linux/i2c/at24.h>
49 #include <linux/mfd/max8831.h>
50 #include <linux/of_platform.h>
51 #include <linux/a2220.h>
52 #include <linux/mfd/tlv320aic3262-registers.h>
53 #include <linux/mfd/tlv320aic3xxx-core.h>
54 #include <linux/usb/tegra_usb_phy.h>
55 #include <linux/clk/tegra.h>
56 #include <linux/clocksource.h>
57 #include <linux/irqchip.h>
58 #include <linux/tegra_fiq_debugger.h>
59 #include <linux/platform_data/tegra_usb_modem_power.h>
60
61 #include <mach/irqs.h>
62 #include <mach/pinmux.h>
63 #include <mach/pinmux-t11.h>
64 #include <mach/io_dpd.h>
65 #include <mach/i2s.h>
66 #include <mach/isomgr.h>
67 #include <mach/tegra_asoc_pdata.h>
68 #include <asm/mach-types.h>
69 #include <asm/mach/arch.h>
70 #include <mach/gpio-tegra.h>
71 #include <mach/tegra-bb-power.h>
72 #include <mach/tegra_wakeup_monitor.h>
73 #include <mach/xusb.h>
74 #include <media/tegra_dtv.h>
75
76 #include "board.h"
77 #include "board-common.h"
78 #include "board-touch.h"
79 #include "board-touch-raydium.h"
80 #include "clock.h"
81 #include "board-pluto.h"
82 #include "baseband-xmm-power.h"
83 #include "tegra-board-id.h"
84 #include "devices.h"
85 #include "gpio-names.h"
86 #include "pm.h"
87 #include "common.h"
88 #include "iomap.h"
89 #include "tegra-of-dev-auxdata.h"
90
91
92 #ifdef CONFIG_BT_BLUESLEEP
93 static struct rfkill_gpio_platform_data pluto_bt_rfkill_pdata = {
94         .name           = "bt_rfkill",
95         .shutdown_gpio  = TEGRA_GPIO_PQ7,
96         .reset_gpio     = TEGRA_GPIO_PQ6,
97         .type           = RFKILL_TYPE_BLUETOOTH,
98 };
99
100 static struct platform_device pluto_bt_rfkill_device = {
101         .name = "rfkill_gpio",
102         .id             = -1,
103         .dev = {
104                 .platform_data = &pluto_bt_rfkill_pdata,
105         },
106 };
107
108 static noinline void __init pluto_setup_bt_rfkill(void)
109 {
110         platform_device_register(&pluto_bt_rfkill_device);
111 }
112
113 static struct resource pluto_bluesleep_resources[] = {
114         [0] = {
115                 .name = "gpio_host_wake",
116                         .start  = TEGRA_GPIO_PU6,
117                         .end    = TEGRA_GPIO_PU6,
118                         .flags  = IORESOURCE_IO,
119         },
120         [1] = {
121                 .name = "gpio_ext_wake",
122                         .start  = TEGRA_GPIO_PEE1,
123                         .end    = TEGRA_GPIO_PEE1,
124                         .flags  = IORESOURCE_IO,
125         },
126         [2] = {
127                 .name = "host_wake",
128                         .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
129         },
130 };
131
132 static struct platform_device pluto_bluesleep_device = {
133         .name           = "bluesleep",
134         .id             = -1,
135         .num_resources  = ARRAY_SIZE(pluto_bluesleep_resources),
136         .resource       = pluto_bluesleep_resources,
137 };
138
139 static noinline void __init pluto_setup_bluesleep(void)
140 {
141         pluto_bluesleep_resources[2].start =
142                 pluto_bluesleep_resources[2].end =
143                         gpio_to_irq(TEGRA_GPIO_PU6);
144         platform_device_register(&pluto_bluesleep_device);
145         return;
146 }
147 #elif defined CONFIG_BLUEDROID_PM
148 static struct resource pluto_bluedroid_pm_resources[] = {
149         [0] = {
150                 .name   = "shutdown_gpio",
151                 .start  = TEGRA_GPIO_PQ7,
152                 .end    = TEGRA_GPIO_PQ7,
153                 .flags  = IORESOURCE_IO,
154         },
155         [1] = {
156                 .name = "host_wake",
157                 .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
158         },
159         [2] = {
160                 .name = "gpio_ext_wake",
161                 .start  = TEGRA_GPIO_PEE1,
162                 .end    = TEGRA_GPIO_PEE1,
163                 .flags  = IORESOURCE_IO,
164         },
165         [3] = {
166                 .name = "gpio_host_wake",
167                 .start  = TEGRA_GPIO_PU6,
168                 .end    = TEGRA_GPIO_PU6,
169                 .flags  = IORESOURCE_IO,
170         },
171         [4] = {
172                 .name = "reset_gpio",
173                 .start  = TEGRA_GPIO_PQ6,
174                 .end    = TEGRA_GPIO_PQ6,
175                 .flags  = IORESOURCE_IO,
176         },
177 };
178
179 static struct platform_device pluto_bluedroid_pm_device = {
180         .name = "bluedroid_pm",
181         .id             = 0,
182         .num_resources  = ARRAY_SIZE(pluto_bluedroid_pm_resources),
183         .resource       = pluto_bluedroid_pm_resources,
184 };
185
186 static noinline void __init pluto_setup_bluedroid_pm(void)
187 {
188         pluto_bluedroid_pm_resources[1].start =
189                 pluto_bluedroid_pm_resources[1].end =
190                                         gpio_to_irq(TEGRA_GPIO_PU6);
191         platform_device_register(&pluto_bluedroid_pm_device);
192 }
193 #endif
194
195 static __initdata struct tegra_clk_init_table pluto_clk_init_table[] = {
196         /* name         parent          rate            enabled */
197         { "pll_m",      NULL,           0,              false},
198         { "hda",        "pll_p",        108000000,      false},
199         { "hda2codec_2x", "pll_p",      48000000,       false},
200         { "pwm",        "pll_p",        3187500,        false},
201         { "i2s1",       "pll_a_out0",   0,              false},
202         { "i2s2",       "pll_a_out0",   0,              false},
203         { "i2s3",       "pll_a_out0",   0,              false},
204         { "i2s4",       "pll_a_out0",   0,              false},
205         { "spdif_out",  "pll_a_out0",   0,              false},
206         { "d_audio",    "clk_m",        12000000,       false},
207         { "dam0",       "clk_m",        12000000,       false},
208         { "dam1",       "clk_m",        12000000,       false},
209         { "dam2",       "clk_m",        12000000,       false},
210         { "audio0",     "i2s0_sync",    0,              false},
211         { "audio1",     "i2s1_sync",    0,              false},
212         { "audio2",     "i2s2_sync",    0,              false},
213         { "audio3",     "i2s3_sync",    0,              false},
214         { "audio4",     "i2s4_sync",    0,              false},
215         { "vi_sensor",  "pll_p",        150000000,      false},
216         { "cilab",      "pll_p",        150000000,      false},
217         { "cilcd",      "pll_p",        150000000,      false},
218         { "cile",       "pll_p",        150000000,      false},
219         { "i2c1",       "pll_p",        3200000,        false},
220         { "i2c2",       "pll_p",        3200000,        false},
221         { "i2c3",       "pll_p",        3200000,        false},
222         { "i2c4",       "pll_p",        3200000,        false},
223         { "i2c5",       "pll_p",        3200000,        false},
224         { "sbc1",       "pll_p",        25000000,       false},
225         { "sbc2",       "pll_p",        25000000,       false},
226         { "sbc3",       "pll_p",        25000000,       false},
227         { "sbc4",       "pll_p",        25000000,       false},
228         { "sbc5",       "pll_p",        25000000,       false},
229         { "sbc6",       "pll_p",        25000000,       false},
230         { "extern3",    "clk_m",        12000000,       false},
231         { "dsia",       "pll_d2_out0",  0,              false},
232         { "uarta",      "pll_p",        408000000,      false},
233         { "uartb",      "pll_p",        408000000,      false},
234         { "uartc",      "pll_p",        408000000,      false},
235         { "uartd",      "pll_p",        408000000,      false},
236         { NULL,         NULL,           0,              0},
237 };
238
239 static struct bcm2079x_platform_data nfc_pdata = {
240         .irq_gpio = TEGRA_GPIO_PW2,
241         .en_gpio = TEGRA_GPIO_PU4,
242         .wake_gpio = TEGRA_GPIO_PX7,
243         };
244
245 static struct i2c_board_info __initdata pluto_i2c_bus3_board_info[] = {
246         {
247                 I2C_BOARD_INFO("bcm2079x-i2c", 0x77),
248                 .platform_data = &nfc_pdata,
249         },
250 };
251
252 static struct aic3262_gpio_setup aic3262_gpio[] = {
253         /* GPIO 1*/
254         {
255                 .used = 1,
256                 .in = 0,
257                 .value = AIC3262_GPIO1_FUNC_INT1_OUTPUT ,
258         },
259         /* GPIO 2*/
260         {
261                 .used = 1,
262                 .in = 0,
263                 .value = AIC3262_GPIO2_FUNC_ADC_MOD_CLK_OUTPUT,
264         },
265         /* GPI1 */
266         {
267                 .used = 1,
268                 .in = 1,
269         },
270         /* GPI2 */
271         {
272                 .used = 1,
273                 .in = 1,
274                 .in_reg = AIC3262_DMIC_INPUT_CNTL,
275                 .in_reg_bitmask = AIC3262_DMIC_CONFIGURE_MASK,
276                 .in_reg_shift = AIC3262_DMIC_CONFIGURE_SHIFT,
277                 .value = AIC3262_DMIC_GPI2_LEFT_GPI2_RIGHT,
278         },
279         /* GPO1 */
280         {
281                 .used = 1,
282                 .in = 0,
283                 .value = AIC3262_GPO1_FUNC_MSO_OUTPUT_FOR_SPI,
284         },
285 };
286 static struct aic3xxx_pdata aic3262_codec_pdata = {
287         .gpio_irq       = 0,
288         .gpio           = aic3262_gpio,
289         .naudint_irq    = 0,
290         .irq_base       = AIC3262_CODEC_IRQ_BASE,
291 };
292
293 static struct i2c_board_info __initdata cs42l73_board_info = {
294         I2C_BOARD_INFO("cs42l73", 0x4a),
295 };
296
297 static struct i2c_board_info __initdata pluto_codec_a2220_info = {
298         I2C_BOARD_INFO("audience_a2220", 0x3E),
299 };
300
301 static struct i2c_board_info __initdata pluto_codec_aic326x_info = {
302         I2C_BOARD_INFO("tlv320aic3262", 0x18),
303         .platform_data = &aic3262_codec_pdata,
304 };
305
306 static void pluto_i2c_init(void)
307 {
308         pluto_i2c_bus3_board_info[0].irq = gpio_to_irq(TEGRA_GPIO_PW2);
309         i2c_register_board_info(0, pluto_i2c_bus3_board_info, 1);
310         i2c_register_board_info(0, &pluto_codec_aic326x_info, 1);
311         i2c_register_board_info(0, &pluto_codec_a2220_info, 1);
312         i2c_register_board_info(0, &cs42l73_board_info, 1);
313 }
314
315 static struct tegra_serial_platform_data pluto_uartd_pdata = {
316         .dma_req_selector = 19,
317         .modem_interrupt = false,
318 };
319
320 static void __init pluto_uart_init(void)
321 {
322         int debug_port_id;
323
324         /* Register low speed only if it is selected */
325         if (!is_tegra_debug_uartport_hs()) {
326                 debug_port_id = uart_console_debug_init(3);
327                 if (debug_port_id < 0)
328                         return;
329
330                 platform_device_register(uart_console_debug_device);
331
332         } else {
333                 tegra_uartd_device.dev.platform_data = &pluto_uartd_pdata;
334                 platform_device_register(&tegra_uartd_device);
335         }
336
337 }
338
339 static struct resource tegra_rtc_resources[] = {
340         [0] = {
341                 .start = TEGRA_RTC_BASE,
342                 .end = TEGRA_RTC_BASE + TEGRA_RTC_SIZE - 1,
343                 .flags = IORESOURCE_MEM,
344         },
345         [1] = {
346                 .start = INT_RTC,
347                 .end = INT_RTC,
348                 .flags = IORESOURCE_IRQ,
349         },
350 };
351
352 static struct platform_device tegra_rtc_device = {
353         .name = "tegra_rtc",
354         .id   = -1,
355         .resource = tegra_rtc_resources,
356         .num_resources = ARRAY_SIZE(tegra_rtc_resources),
357 };
358
359 #if defined(CONFIG_TEGRA_WAKEUP_MONITOR)
360 static struct tegra_wakeup_monitor_platform_data
361                         pluto_tegra_wakeup_monitor_pdata = {
362         .wifi_wakeup_source     = 6,
363         .rtc_wakeup_source      = 18,
364 };
365
366 static struct platform_device pluto_tegra_wakeup_monitor_device = {
367         .name = "tegra_wakeup_monitor",
368         .id   = -1,
369         .dev  = {
370                 .platform_data = &pluto_tegra_wakeup_monitor_pdata,
371         },
372 };
373 #endif
374
375 static struct tegra_asoc_platform_data pluto_audio_pdata = {
376         .gpio_spkr_en           = TEGRA_GPIO_SPKR_EN,
377         .gpio_hp_det            = TEGRA_GPIO_HP_DET,
378         .gpio_hp_mute           = -1,
379         .gpio_int_mic_en        = TEGRA_GPIO_INT_MIC_EN,
380         .gpio_ext_mic_en        = TEGRA_GPIO_EXT_MIC_EN,
381         .gpio_ldo1_en           = TEGRA_GPIO_LDO1_EN,
382         .i2s_param[HIFI_CODEC]  = {
383                 .audio_port_id  = 1,
384                 .is_i2s_master  = 0,
385                 .i2s_mode       = TEGRA_DAIFMT_I2S,
386                 .sample_size    = 16,
387                 .channels       = 2,
388         },
389         .i2s_param[BASEBAND]    = {
390                 .audio_port_id  = 2,
391                 .is_i2s_master  = 1,
392                 .i2s_mode       = TEGRA_DAIFMT_I2S,
393                 .sample_size    = 16,
394                 .rate           = 16000,
395                 .channels       = 2,
396                 .bit_clk        = 1024000,
397         },
398         .i2s_param[BT_SCO]      = {
399                 .audio_port_id  = 3,
400                 .is_i2s_master  = 1,
401                 .i2s_mode       = TEGRA_DAIFMT_DSP_A,
402                 .sample_size    = 16,
403                 .channels       = 1,
404                 .bit_clk        = 512000,
405         },
406         .i2s_param[VOICE_CODEC] = {
407                 .audio_port_id  = 0,
408                 .is_i2s_master  = 1,
409                 .i2s_mode       = TEGRA_DAIFMT_I2S,
410                 .sample_size    = 16,
411                 .rate           = 16000,
412                 .channels       = 2,
413         },
414 };
415
416 static struct tegra_asoc_platform_data pluto_aic3262_pdata = {
417         .gpio_spkr_en           = TEGRA_GPIO_SPKR_EN,
418         .gpio_hp_det            = TEGRA_GPIO_HP_DET,
419         .gpio_hp_mute           = -1,
420         .gpio_int_mic_en        = TEGRA_GPIO_INT_MIC_EN,
421         .gpio_ext_mic_en        = TEGRA_GPIO_EXT_MIC_EN,
422         .gpio_ldo1_en           = TEGRA_GPIO_LDO1_EN,
423         .i2s_param[HIFI_CODEC]  = {
424                 .audio_port_id  = 1,
425                 .is_i2s_master  = 0,
426                 .i2s_mode       = TEGRA_DAIFMT_I2S,
427                 .sample_size    = 16,
428                 .rate           = 48000,
429                 .channels       = 2,
430         },
431         .i2s_param[BASEBAND]    = {
432                 .audio_port_id  = 2,
433                 .is_i2s_master  = 1,
434                 .i2s_mode       = TEGRA_DAIFMT_I2S,
435                 .sample_size    = 16,
436                 .rate           = 16000,
437                 .channels       = 2,
438                 .bit_clk        = 1024000,
439         },
440         .i2s_param[BT_SCO]      = {
441                 .audio_port_id  = 3,
442                 .is_i2s_master  = 1,
443                 .i2s_mode       = TEGRA_DAIFMT_DSP_A,
444                 .sample_size    = 16,
445                 .channels       = 1,
446                 .bit_clk        = 512000,
447         },
448         .i2s_param[VOICE_CODEC] = {
449                 .audio_port_id  = 0,
450                 .is_i2s_master  = 1,
451                 .i2s_mode       = TEGRA_DAIFMT_I2S,
452                 .sample_size    = 16,
453                 .rate           = 16000,
454                 .channels       = 2,
455         },
456 };
457
458 static struct platform_device pluto_audio_device = {
459         .name   = "tegra-snd-cs42l73",
460         .id     = 2,
461         .dev    = {
462                 .platform_data = &pluto_audio_pdata,
463         },
464 };
465
466 static struct platform_device pluto_audio_aic326x_device = {
467         .name   = "tegra-snd-aic326x",
468         .id     = 2,
469         .dev    = {
470                 .platform_data  = &pluto_aic3262_pdata,
471         },
472 };
473
474 static struct tegra_spi_device_controller_data dev_bdata = {
475         .rx_clk_tap_delay = 0,
476         .tx_clk_tap_delay = 0,
477 };
478 static struct spi_board_info aic326x_spi_board_info[] = {
479         {
480                 .modalias = "tlv320aic3xxx",
481                 .bus_num = 3,
482                 .chip_select = 0,
483                 .max_speed_hz = 4*1000*1000,
484                 .mode = SPI_MODE_1,
485                 .controller_data = &dev_bdata,
486                 .platform_data = &aic3262_codec_pdata,
487         },
488 };
489
490 #ifdef CONFIG_MHI_NETDEV
491 struct platform_device mhi_netdevice0 = {
492         .name = "mhi_net_device",
493         .id = 0,
494 };
495 #endif /* CONFIG_MHI_NETDEV */
496
497 static struct platform_device *pluto_devices[] __initdata = {
498         &tegra_pmu_device,
499         &tegra_rtc_device,
500         &tegra_udc_device,
501 #if defined(CONFIG_TEGRA_WATCHDOG)
502         &tegra_wdt0_device,
503 #endif
504 #if defined(CONFIG_TEGRA_AVP)
505         &tegra_avp_device,
506 #endif
507 #if defined(CONFIG_CRYPTO_DEV_TEGRA_SE)
508         &tegra11_se_device,
509 #endif
510         &tegra_ahub_device,
511         &tegra_dam_device0,
512         &tegra_dam_device1,
513         &tegra_dam_device2,
514         &tegra_i2s_device0,
515         &tegra_i2s_device1,
516         &tegra_i2s_device2,
517         &tegra_i2s_device3,
518         &tegra_i2s_device4,
519         &tegra_spdif_device,
520         &spdif_dit_device,
521         &pluto_audio_aic326x_device,
522         &bluetooth_dit_device,
523         &baseband_dit_device,
524 #if defined(CONFIG_TEGRA_WAKEUP_MONITOR)
525         &pluto_tegra_wakeup_monitor_device,
526 #endif
527         &pluto_audio_device,
528         &tegra_hda_device,
529 #if defined(CONFIG_CRYPTO_DEV_TEGRA_AES)
530         &tegra_aes_device,
531 #endif
532 #ifdef CONFIG_MHI_NETDEV
533         &mhi_netdevice0,  /* MHI netdevice */
534 #endif /* CONFIG_MHI_NETDEV */
535 };
536
537 #ifdef CONFIG_USB_SUPPORT
538
539 static void pluto_usb_hsic_postsupend(void)
540 {
541         pr_debug("%s\n", __func__);
542 #ifdef CONFIG_TEGRA_BB_XMM_POWER
543         baseband_xmm_set_power_status(BBXMM_PS_L2);
544 #endif
545 }
546
547 static void pluto_usb_hsic_preresume(void)
548 {
549         pr_debug("%s\n", __func__);
550 #ifdef CONFIG_TEGRA_BB_XMM_POWER
551         baseband_xmm_set_power_status(BBXMM_PS_L2TOL0);
552 #endif
553 }
554
555 static void pluto_usb_hsic_post_resume(void)
556 {
557         pr_debug("%s\n", __func__);
558 #ifdef CONFIG_TEGRA_BB_XMM_POWER
559         baseband_xmm_set_power_status(BBXMM_PS_L0);
560 #endif
561 }
562
563 static void pluto_usb_hsic_phy_power(void)
564 {
565         pr_debug("%s\n", __func__);
566 #ifdef CONFIG_TEGRA_BB_XMM_POWER
567         baseband_xmm_set_power_status(BBXMM_PS_L0);
568 #endif
569 }
570
571 static void pluto_usb_hsic_post_phy_off(void)
572 {
573         pr_debug("%s\n", __func__);
574 #ifdef CONFIG_TEGRA_BB_XMM_POWER
575         baseband_xmm_set_power_status(BBXMM_PS_L2);
576 #endif
577 }
578
579 static struct tegra_usb_phy_platform_ops oem2_plat_ops = {
580         .post_suspend = pluto_usb_hsic_postsupend,
581         .pre_resume = pluto_usb_hsic_preresume,
582         .port_power = pluto_usb_hsic_phy_power,
583         .post_resume = pluto_usb_hsic_post_resume,
584         .post_phy_off = pluto_usb_hsic_post_phy_off,
585 };
586
587 static struct tegra_usb_platform_data tegra_ehci3_hsic_smsc_hub_pdata = {
588         .port_otg = false,
589         .has_hostpc = true,
590         .unaligned_dma_buf_supported = false,
591         .phy_intf = TEGRA_USB_PHY_INTF_HSIC,
592         .op_mode        = TEGRA_USB_OPMODE_HOST,
593         .u_data.host = {
594                 .vbus_gpio = -1,
595                 .hot_plug = false,
596                 .remote_wakeup_supported = true,
597                 .power_off_on_suspend = true,
598         },
599 };
600
601 static struct tegra_usb_platform_data tegra_udc_pdata = {
602         .port_otg = true,
603         .has_hostpc = true,
604         .id_det_type = TEGRA_USB_PMU_ID,
605         .unaligned_dma_buf_supported = false,
606         .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
607         .op_mode = TEGRA_USB_OPMODE_DEVICE,
608         .u_data.dev = {
609                 .vbus_pmu_irq = 0,
610                 .vbus_gpio = -1,
611                 .charging_supported = false,
612                 .remote_wakeup_supported = false,
613         },
614         .u_cfg.utmi = {
615                 .hssync_start_delay = 0,
616                 .elastic_limit = 16,
617                 .idle_wait_delay = 17,
618                 .term_range_adj = 6,
619                 .xcvr_setup = 8,
620                 .xcvr_lsfslew = 0,
621                 .xcvr_lsrslew = 3,
622                 .xcvr_setup_offset = 0,
623                 .xcvr_use_fuses = 1,
624         },
625 };
626
627 static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
628         .port_otg = true,
629         .has_hostpc = true,
630         .id_det_type = TEGRA_USB_PMU_ID,
631         .id_extcon_dev_name = "MAX77665_MUIC_ID",
632         .unaligned_dma_buf_supported = false,
633         .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
634         .op_mode = TEGRA_USB_OPMODE_HOST,
635         .u_data.host = {
636                 .vbus_gpio = -1,
637                 .hot_plug = false,
638                 .remote_wakeup_supported = true,
639                 .power_off_on_suspend = true,
640         },
641         .u_cfg.utmi = {
642                 .hssync_start_delay = 0,
643                 .elastic_limit = 16,
644                 .idle_wait_delay = 17,
645                 .term_range_adj = 6,
646                 .xcvr_setup = 15,
647                 .xcvr_lsfslew = 0,
648                 .xcvr_lsrslew = 3,
649                 .xcvr_setup_offset = 0,
650                 .xcvr_use_fuses = 1,
651                 .vbus_oc_map = 0x7,
652         },
653 };
654
655 static struct tegra_usb_otg_data tegra_otg_pdata = {
656         .ehci_device = &tegra_ehci1_device,
657         .ehci_pdata = &tegra_ehci1_utmi_pdata,
658 };
659
660 static struct regulator *baseband_reg;
661 static struct gpio modem_gpios[] = { /* i500 modem */
662         {MDM_RST, GPIOF_OUT_INIT_LOW, "MODEM RESET"},
663 };
664
665 static struct gpio modem2_gpios[] = {
666         {MDM2_PWR_ON, GPIOF_OUT_INIT_LOW, "MODEM2 PWR ON"},
667         {MDM2_RST, GPIOF_OUT_INIT_LOW, "MODEM2 RESET"},
668 };
669
670 static struct tegra_usb_platform_data tegra_ehci2_hsic_baseband_pdata = {
671         .port_otg = false,
672         .has_hostpc = true,
673         .unaligned_dma_buf_supported = false,
674         .phy_intf = TEGRA_USB_PHY_INTF_HSIC,
675         .op_mode = TEGRA_USB_OPMODE_HOST,
676         .u_data.host = {
677                 .vbus_gpio = -1,
678                 .hot_plug = false,
679                 .remote_wakeup_supported = true,
680                 .power_off_on_suspend = true,
681         },
682 };
683
684 static struct tegra_usb_platform_data tegra_ehci3_hsic_baseband2_pdata = {
685         .port_otg = false,
686         .has_hostpc = true,
687         .unaligned_dma_buf_supported = false,
688         .phy_intf = TEGRA_USB_PHY_INTF_HSIC,
689         .op_mode = TEGRA_USB_OPMODE_HOST,
690         .u_data.host = {
691                 .vbus_gpio = -1,
692                 .hot_plug = false,
693                 .remote_wakeup_supported = true,
694                 .power_off_on_suspend = true,
695         },
696 };
697
698 static struct tegra_usb_platform_data tegra_hsic_pdata = {
699         .port_otg = false,
700         .has_hostpc = true,
701         .unaligned_dma_buf_supported = false,
702         .phy_intf = TEGRA_USB_PHY_INTF_HSIC,
703         .op_mode        = TEGRA_USB_OPMODE_HOST,
704         .u_data.host = {
705                 .vbus_gpio = -1,
706                 .hot_plug = false,
707                 .remote_wakeup_supported = true,
708                 .power_off_on_suspend = true,
709         },
710 };
711
712 static struct platform_device *
713 tegra_usb_hsic_host_register(struct platform_device *ehci_dev)
714 {
715         struct platform_device *pdev;
716         int val;
717
718         pdev = platform_device_alloc(ehci_dev->name, ehci_dev->id);
719         if (!pdev)
720                 return NULL;
721
722         val = platform_device_add_resources(pdev, ehci_dev->resource,
723                                                 ehci_dev->num_resources);
724         if (val)
725                 goto error;
726
727         pdev->dev.dma_mask =  ehci_dev->dev.dma_mask;
728         pdev->dev.coherent_dma_mask = ehci_dev->dev.coherent_dma_mask;
729
730         val = platform_device_add_data(pdev, &tegra_hsic_pdata,
731                         sizeof(struct tegra_usb_platform_data));
732         if (val)
733                 goto error;
734
735         val = platform_device_add(pdev);
736         if (val)
737                 goto error;
738
739         return pdev;
740
741 error:
742         pr_err("%s: failed to add the host contoller device\n", __func__);
743         platform_device_put(pdev);
744         return NULL;
745 }
746
747 static void tegra_usb_hsic_host_unregister(struct platform_device **platdev)
748 {
749         struct platform_device *pdev = *platdev;
750
751         if (pdev && &pdev->dev) {
752                 platform_device_unregister(pdev);
753                 *platdev = NULL;
754         } else
755                 pr_err("%s: no platform device\n", __func__);
756 }
757
758 static struct tegra_usb_phy_platform_ops oem1_hsic_pops;
759
760 static union tegra_bb_gpio_id bb_gpio_oem1 = {
761         .oem1 = {
762                 .reset = BB_OEM1_GPIO_RST,
763                 .pwron = BB_OEM1_GPIO_ON,
764                 .awr = BB_OEM1_GPIO_AWR,
765                 .cwr = BB_OEM1_GPIO_CWR,
766                 .spare = BB_OEM1_GPIO_SPARE,
767                 .wdi = BB_OEM1_GPIO_WDI,
768         },
769 };
770
771 static struct tegra_bb_pdata bb_pdata_oem1 = {
772         .id = &bb_gpio_oem1,
773         .device = &tegra_ehci3_device,
774         .ehci_register = tegra_usb_hsic_host_register,
775         .ehci_unregister = tegra_usb_hsic_host_unregister,
776         .bb_id = TEGRA_BB_OEM1,
777 };
778
779 static struct platform_device tegra_bb_oem1 = {
780         .name = "tegra_baseband_power",
781         .id = -1,
782         .dev = {
783                 .platform_data = &bb_pdata_oem1,
784         },
785 };
786
787 static int baseband_init(void)
788 {
789         int ret;
790
791         ret = gpio_request_array(modem_gpios, ARRAY_SIZE(modem_gpios));
792         if (ret) {
793                 pr_warn("%s:gpio request failed\n", __func__);
794                 return ret;
795         }
796
797         baseband_reg = regulator_get(NULL, "vdd_core_bb");
798         if (IS_ERR(baseband_reg))
799                 pr_warn("%s: baseband regulator get failed\n", __func__);
800         else {
801                 if (regulator_enable(baseband_reg) != 0)
802                         pr_warn("baseband regulator enable failed\n");
803         }
804
805         /* enable pull-up for MDM1 UART RX */
806         tegra_pinmux_set_pullupdown(TEGRA_PINGROUP_GPIO_PU1,
807                                     TEGRA_PUPD_PULL_UP);
808
809         /* enable pull-down for MDM1_COLD_BOOT */
810         tegra_pinmux_set_pullupdown(TEGRA_PINGROUP_ULPI_DATA4,
811                                     TEGRA_PUPD_PULL_DOWN);
812
813         /* export GPIO for user space access through sysfs */
814         gpio_export(MDM_RST, false);
815
816         return 0;
817 }
818
819 static const struct tegra_modem_operations baseband_operations = {
820         .init = baseband_init,
821 };
822
823 static struct tegra_usb_modem_power_platform_data baseband_pdata = {
824         .ops = &baseband_operations,
825         .wake_gpio = -1,
826         .boot_gpio = MDM_COLDBOOT,
827         .boot_irq_flags = IRQF_TRIGGER_RISING |
828                                     IRQF_TRIGGER_FALLING |
829                                     IRQF_ONESHOT,
830         .autosuspend_delay = 2000,
831         .short_autosuspend_delay = 50,
832         .tegra_ehci_device = &tegra_ehci2_device,
833         .tegra_ehci_pdata = &tegra_ehci2_hsic_baseband_pdata,
834         .i_breach_ppm = 500000,
835         /* FIXME: get useful adjperiods */
836         .i_thresh_3g_adjperiod = 10000,
837         .i_thresh_lte_adjperiod = 10000,
838 };
839
840 static struct platform_device icera_baseband_device = {
841         .name = "tegra_usb_modem_power",
842         .id = -1,
843         .dev = {
844                 .platform_data = &baseband_pdata,
845         },
846 };
847
848 static void baseband2_start(void)
849 {
850         pr_info("%s\n", __func__);
851         gpio_set_value(MDM2_PWR_ON, 1);
852 }
853
854 static void baseband2_reset(void)
855 {
856         /* Initiate power cycle on baseband sub system */
857         pr_info("%s\n", __func__);
858         gpio_set_value(MDM2_RST, 0);
859         mdelay(200);
860         gpio_set_value(MDM2_RST, 1);
861 }
862
863 static int baseband2_init(void)
864 {
865         int ret;
866
867         tegra_pinmux_set_tristate(TEGRA_PINGROUP_GPIO_X1_AUD, TEGRA_TRI_NORMAL);
868
869         ret = gpio_request_array(modem2_gpios, ARRAY_SIZE(modem2_gpios));
870         if (ret)
871                 return ret;
872
873         /* enable pull-down for MDM2_COLD_BOOT */
874         tegra_pinmux_set_pullupdown(TEGRA_PINGROUP_KB_ROW4,
875                                     TEGRA_PUPD_PULL_DOWN);
876
877         /* export GPIO for user space access through sysfs */
878         gpio_export(MDM2_RST, false);
879
880         return 0;
881 }
882
883 static const struct tegra_modem_operations baseband2_operations = {
884         .init = baseband2_init,
885         .start = baseband2_start,
886         .reset = baseband2_reset,
887 };
888
889 static struct tegra_usb_modem_power_platform_data baseband2_pdata = {
890         .ops = &baseband2_operations,
891         .wake_gpio = -1,
892         .boot_gpio = MDM2_COLDBOOT,
893         .boot_irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
894         .autosuspend_delay = 2000,
895         .short_autosuspend_delay = 50,
896         .tegra_ehci_device = &tegra_ehci3_device,
897         .tegra_ehci_pdata = &tegra_ehci3_hsic_baseband2_pdata,
898 };
899
900 static struct platform_device icera_baseband2_device = {
901         .name = "tegra_usb_modem_power",
902         .id = -1,
903         .dev = {
904                 .platform_data = &baseband2_pdata,
905         },
906 };
907
908 static struct baseband_power_platform_data tegra_baseband_xmm_power_data = {
909         .baseband_type = BASEBAND_XMM,
910         .modem = {
911                 .xmm = {
912                         .bb_rst = XMM_GPIO_BB_RST,
913                         .bb_on = XMM_GPIO_BB_ON,
914                         .ipc_bb_wake = XMM_GPIO_IPC_BB_WAKE,
915                         .ipc_ap_wake = XMM_GPIO_IPC_AP_WAKE,
916                         .ipc_hsic_active = XMM_GPIO_IPC_HSIC_ACTIVE,
917                         .ipc_hsic_sus_req = XMM_GPIO_IPC_HSIC_SUS_REQ,
918                 },
919         },
920 };
921
922 static struct platform_device tegra_baseband_xmm_power_device = {
923         .name = "baseband_xmm_power",
924         .id = -1,
925         .dev = {
926                 .platform_data = &tegra_baseband_xmm_power_data,
927         },
928 };
929
930 static struct platform_device tegra_baseband_xmm_power2_device = {
931         .name = "baseband_xmm_power2",
932         .id = -1,
933         .dev = {
934                 .platform_data = &tegra_baseband_xmm_power_data,
935         },
936 };
937
938 static void pluto_usb_init(void)
939 {
940         int usb_port_owner_info = tegra_get_usb_port_owner_info();
941
942         if (!(usb_port_owner_info & UTMI1_PORT_OWNER_XUSB)) {
943                 tegra_otg_pdata.is_xhci = false;
944                 tegra_udc_pdata.u_data.dev.is_xhci = false;
945         } else {
946                 tegra_otg_pdata.is_xhci = true;
947                 tegra_udc_pdata.u_data.dev.is_xhci = true;
948         }
949         tegra_otg_device.dev.platform_data = &tegra_otg_pdata;
950         platform_device_register(&tegra_otg_device);
951
952         /* Setup the udc platform data */
953         tegra_udc_device.dev.platform_data = &tegra_udc_pdata;
954 }
955
956 static void pluto_modem_init(void)
957 {
958         int modem_id = tegra_get_modem_id();
959         struct board_info board_info;
960         int usb_port_owner_info = tegra_get_usb_port_owner_info();
961
962         tegra_get_board_info(&board_info);
963         pr_info("%s: modem_id = %d\n", __func__, modem_id);
964
965         switch (modem_id) {
966         case TEGRA_BB_I500: /* on board i500 HSIC */
967                 if (!(usb_port_owner_info & HSIC1_PORT_OWNER_XUSB))
968                         platform_device_register(&icera_baseband_device);
969                 break;
970         case TEGRA_BB_I500SWD: /* i500 SWD HSIC */
971                 if (!(usb_port_owner_info & HSIC2_PORT_OWNER_XUSB))
972                         platform_device_register(&icera_baseband2_device);
973                 break;
974         case TEGRA_BB_OEM1:     /* OEM1 HSIC */
975                 if ((board_info.board_id == BOARD_E1575) ||
976                         ((board_info.board_id == BOARD_E1580) &&
977                                 (board_info.fab >= BOARD_FAB_A03))) {
978                         tegra_pinmux_set_tristate(TEGRA_PINGROUP_GPIO_X1_AUD,
979                                                         TEGRA_TRI_NORMAL);
980                         bb_gpio_oem1.oem1.pwron = BB_OEM1_GPIO_ON_V;
981                 }
982                 if (!(usb_port_owner_info & HSIC2_PORT_OWNER_XUSB)) {
983                         tegra_hsic_pdata.ops = &oem1_hsic_pops;
984                         tegra_ehci3_device.dev.platform_data
985                                 = &tegra_hsic_pdata;
986                         platform_device_register(&tegra_bb_oem1);
987                 }
988                 break;
989         case TEGRA_BB_OEM2: /* XMM6260/XMM6360 HSIC */
990                 /* fix wrong wiring in Pluto A02 */
991                 if ((board_info.board_id == BOARD_E1580) &&
992                         (board_info.fab == BOARD_FAB_A02)) {
993                         pr_info(
994 "%s: Pluto A02: replace MDM2_PWR_ON with MDM2_PWR_ON_FOR_PLUTO_A02\n",
995                                 __func__);
996                         if (tegra_baseband_xmm_power_data.modem.xmm.bb_on
997                                 != MDM2_PWR_ON)
998                                 pr_err(
999 "%s: expected MDM2_PWR_ON default gpio for XMM bb_on\n",
1000                                         __func__);
1001                         tegra_baseband_xmm_power_data.modem.xmm.bb_on
1002                                 = MDM2_PWR_ON_FOR_PLUTO_A02;
1003                 }
1004                 /* baseband-power.ko will register ehci3 device */
1005                 tegra_hsic_pdata.ops = &oem2_plat_ops;
1006                 tegra_hsic_pdata.u_data.host.remote_wakeup_supported = false;
1007                 tegra_hsic_pdata.u_data.host.power_off_on_suspend = false;
1008                 tegra_ehci3_device.dev.platform_data =
1009                                         &tegra_hsic_pdata;
1010                 tegra_baseband_xmm_power_data.hsic_register =
1011                                                 &tegra_usb_hsic_host_register;
1012                 tegra_baseband_xmm_power_data.hsic_unregister =
1013                                                 &tegra_usb_hsic_host_unregister;
1014                 tegra_baseband_xmm_power_data.ehci_device =
1015                                         &tegra_ehci3_device;
1016                 platform_device_register(&tegra_baseband_xmm_power_device);
1017                 platform_device_register(&tegra_baseband_xmm_power2_device);
1018                 /* override audio settings - use 8kHz */
1019                 pluto_audio_pdata.i2s_param[BASEBAND].audio_port_id
1020                         = pluto_aic3262_pdata.i2s_param[BASEBAND].audio_port_id
1021                         = 2;
1022                 pluto_audio_pdata.i2s_param[BASEBAND].is_i2s_master
1023                         = pluto_aic3262_pdata.i2s_param[BASEBAND].is_i2s_master
1024                         = 1;
1025                 pluto_audio_pdata.i2s_param[BASEBAND].i2s_mode
1026                         = pluto_aic3262_pdata.i2s_param[BASEBAND].i2s_mode
1027                         = TEGRA_DAIFMT_I2S;
1028                 pluto_audio_pdata.i2s_param[BASEBAND].sample_size
1029                         = pluto_aic3262_pdata.i2s_param[BASEBAND].sample_size
1030                         = 16;
1031                 pluto_audio_pdata.i2s_param[BASEBAND].rate
1032                         = pluto_aic3262_pdata.i2s_param[BASEBAND].rate
1033                         = 8000;
1034                 pluto_audio_pdata.i2s_param[BASEBAND].channels
1035                         = pluto_aic3262_pdata.i2s_param[BASEBAND].channels
1036                         = 2;
1037                 break;
1038         case TEGRA_BB_HSIC_HUB: /* HSIC hub */
1039                 if (!(usb_port_owner_info & HSIC2_PORT_OWNER_XUSB)) {
1040                         tegra_ehci3_device.dev.platform_data =
1041                                 &tegra_ehci3_hsic_smsc_hub_pdata;
1042                         platform_device_register(&tegra_ehci3_device);
1043                 }
1044                 break;
1045         default:
1046                 return;
1047         }
1048 }
1049
1050 static struct tegra_xusb_platform_data xusb_pdata = {
1051         .portmap = TEGRA_XUSB_SS_P0 | TEGRA_XUSB_USB2_P0,
1052 };
1053
1054 static void pluto_xusb_init(void)
1055 {
1056         int usb_port_owner_info = tegra_get_usb_port_owner_info();
1057
1058         if (!(usb_port_owner_info & UTMI1_PORT_OWNER_XUSB))
1059                 xusb_pdata.portmap &= ~(TEGRA_XUSB_USB2_P0 |
1060                                 TEGRA_XUSB_SS_P0);
1061 }
1062 #else
1063 static void pluto_usb_init(void) { }
1064 static void pluto_modem_init(void) { }
1065 static void pluto_xusb_init(void) { }
1066 #endif
1067
1068 static void pluto_audio_init(void)
1069 {
1070         struct board_info board_info;
1071
1072         tegra_get_board_info(&board_info);
1073
1074         spi_register_board_info(aic326x_spi_board_info,
1075                                         ARRAY_SIZE(aic326x_spi_board_info));
1076 }
1077
1078 static __initdata struct tegra_clk_init_table touch_clk_init_table[] = {
1079         /* name         parent          rate            enabled */
1080         { "extern2",    "pll_p",        41000000,       false},
1081         { "clk_out_2",  "extern2",      40800000,       false},
1082         { NULL,         NULL,           0,              0},
1083 };
1084
1085 struct rm_spi_ts_platform_data rm31080ts_pluto_data = {
1086         .gpio_reset = TOUCH_GPIO_RST_RAYDIUM_SPI,
1087         .config = 0,
1088         .platform_id = RM_PLATFORM_P005,
1089         .name_of_clock = "clk_out_2",
1090         .name_of_clock_con = "extern2",
1091 };
1092
1093 static struct tegra_spi_device_controller_data dev_cdata = {
1094         .rx_clk_tap_delay = 0,
1095         .tx_clk_tap_delay = 0,
1096 };
1097
1098 struct spi_board_info rm31080a_pluto_spi_board[1] = {
1099         {
1100          .modalias = "rm_ts_spidev",
1101          .bus_num = 3,
1102          .chip_select = 2,
1103          .max_speed_hz = 12 * 1000 * 1000,
1104          .mode = SPI_MODE_0,
1105          .controller_data = &dev_cdata,
1106          .platform_data = &rm31080ts_pluto_data,
1107          },
1108 };
1109
1110 static struct synaptics_gpio_data synaptics_gpio_pluto_data = {
1111         .attn_gpio = SYNAPTICS_ATTN_GPIO,
1112         .attn_polarity = RMI_ATTN_ACTIVE_LOW,
1113         .reset_gpio = SYNAPTICS_RESET_GPIO,
1114 };
1115
1116 static struct rmi_device_platform_data synaptics_pluto_platformdata = {
1117         .sensor_name   = "TM9999",
1118         .attn_gpio     = SYNAPTICS_ATTN_GPIO,
1119         .attn_polarity = RMI_ATTN_ACTIVE_LOW,
1120         .gpio_data     = &synaptics_gpio_pluto_data,
1121         .gpio_config   = synaptics_touchpad_gpio_setup,
1122         .spi_data = {
1123                 .block_delay_us = 100,
1124                 .read_delay_us = 100,
1125                 .write_delay_us = 20,
1126         },
1127         .power_management = {
1128                 .nosleep = RMI_F01_NOSLEEP_OFF,
1129         },
1130         .f19_button_map = &synaptics_button_map,
1131         .f54_direct_touch_report_size = 944,
1132 };
1133
1134 static struct spi_board_info synaptics_9999_spi_board_pluto[] = {
1135         {
1136                 .modalias = "rmi_spi",
1137                 .bus_num = 3,
1138                 .chip_select = 2,
1139                 .max_speed_hz = 8*1000*1000,
1140                 .mode = SPI_MODE_3,
1141                 .platform_data = &synaptics_pluto_platformdata,
1142         },
1143 };
1144
1145 static int __init pluto_touch_init(void)
1146 {
1147         tegra_clk_init_from_table(touch_clk_init_table);
1148         if (tegra_get_touch_vendor_id() == RAYDIUM_TOUCH) {
1149                 pr_info("%s: initializing raydium\n", __func__);
1150                 rm31080a_pluto_spi_board[0].irq =
1151                         gpio_to_irq(TOUCH_GPIO_IRQ_RAYDIUM_SPI);
1152                 touch_init_raydium(TOUCH_GPIO_IRQ_RAYDIUM_SPI,
1153                                         TOUCH_GPIO_RST_RAYDIUM_SPI,
1154                                         &rm31080ts_pluto_data,
1155                                         &rm31080a_pluto_spi_board[0],
1156                                         ARRAY_SIZE(rm31080a_pluto_spi_board));
1157         } else {
1158                 pr_info("%s: initializing synaptics\n", __func__);
1159                 touch_init_synaptics(synaptics_9999_spi_board_pluto,
1160                                 ARRAY_SIZE(synaptics_9999_spi_board_pluto));
1161         }
1162         return 0;
1163 }
1164
1165 #ifdef CONFIG_USE_OF
1166 struct of_dev_auxdata pluto_auxdata_lookup[] __initdata = {
1167         OF_DEV_AUXDATA("nvidia,tegra114-apbdma", 0x6000a000, "tegra-apbdma",
1168                                 NULL),
1169         OF_DEV_AUXDATA("nvidia,tegra114-sdhci", 0x78000600, "sdhci-tegra.3",
1170                                 NULL),
1171         OF_DEV_AUXDATA("nvidia,tegra114-sdhci", 0x78000400, "sdhci-tegra.2",
1172                                 NULL),
1173         OF_DEV_AUXDATA("nvidia,tegra114-sdhci", 0x78000000, "sdhci-tegra.0",
1174                                 &pluto_tegra_sdhci_platform_data0),
1175         OF_DEV_AUXDATA("nvidia,tegra114-camera", 0x0, "tegra_camera",
1176                                 NULL),
1177         OF_DEV_AUXDATA("nvidia,tegra114-host1x", TEGRA_HOST1X_BASE, "host1x",
1178                                 NULL),
1179         OF_DEV_AUXDATA("nvidia,tegra114-gr3d", TEGRA_GR3D_BASE, "gr3d",
1180                                 NULL),
1181         OF_DEV_AUXDATA("nvidia,tegra114-gr2d", TEGRA_GR2D_BASE, "gr2d",
1182                                 NULL),
1183         OF_DEV_AUXDATA("nvidia,tegra114-msenc", TEGRA_MSENC_BASE, "msenc",
1184                                 NULL),
1185         OF_DEV_AUXDATA("nvidia,tegra114-vi", TEGRA_VI_BASE, "vi",
1186                                 NULL),
1187         OF_DEV_AUXDATA("nvidia,tegra114-isp", TEGRA_ISP_BASE, "isp",
1188                                 NULL),
1189         OF_DEV_AUXDATA("nvidia,tegra114-tsec", TEGRA_TSEC_BASE, "tsec",
1190                                 NULL),
1191         T114_I2C_OF_DEV_AUXDATA,
1192         T114_SPI_OF_DEV_AUXDATA,
1193         OF_DEV_AUXDATA("nvidia,tegra114-kbc", 0x7000e200, "tegra-kbc",
1194                                 NULL),
1195         OF_DEV_AUXDATA("nvidia,tegra114-hsuart", 0x70006000, "serial-tegra.0",
1196                                 NULL),
1197         OF_DEV_AUXDATA("nvidia,tegra114-hsuart", 0x70006040, "serial-tegra.1",
1198                                 NULL),
1199         OF_DEV_AUXDATA("nvidia,tegra114-hsuart", 0x70006200, "serial-tegra.2",
1200                                 NULL),
1201         OF_DEV_AUXDATA("nvidia,tegra114-xhci", 0x70090000, "tegra-xhci",
1202                                 &xusb_pdata),
1203         {}
1204 };
1205 #endif
1206
1207 static struct tegra_dtv_platform_data pluto_dtv_pdata = {
1208         .dma_req_selector = 11,
1209 };
1210
1211 static void __init pluto_dtv_init(void)
1212 {
1213         tegra_dtv_device.dev.platform_data = &pluto_dtv_pdata;
1214         platform_device_register(&tegra_dtv_device);
1215 }
1216
1217 static void __init tegra_pluto_early_init(void)
1218 {
1219         tegra_clk_init_from_table(pluto_clk_init_table);
1220         tegra_clk_verify_parents();
1221         tegra_soc_device_init("tegra_pluto");
1222 }
1223
1224 static void __init tegra_pluto_late_init(void)
1225 {
1226         pluto_i2c_init();
1227         pluto_usb_init();
1228         pluto_xusb_init();
1229         pluto_uart_init();
1230         pluto_audio_init();
1231         platform_add_devices(pluto_devices, ARRAY_SIZE(pluto_devices));
1232         tegra_io_dpd_init();
1233         pluto_sdhci_init();
1234         pluto_regulator_init();
1235         pluto_dtv_init();
1236         pluto_suspend_init();
1237         pluto_touch_init();
1238         pluto_emc_init();
1239         pluto_edp_init();
1240         isomgr_init();
1241         pluto_panel_init();
1242         pluto_pmon_init();
1243         pluto_kbc_init();
1244 #ifdef CONFIG_BT_BLUESLEEP
1245         pluto_setup_bluesleep();
1246         pluto_setup_bt_rfkill();
1247 #elif defined CONFIG_BLUEDROID_PM
1248         pluto_setup_bluedroid_pm();
1249 #endif
1250         pluto_modem_init();
1251 #ifdef CONFIG_TEGRA_WDT_RECOVERY
1252         tegra_wdt_recovery_init();
1253 #endif
1254         pluto_sensors_init();
1255         tegra_serial_debug_init(TEGRA_UARTD_BASE, INT_WDT_CPU, NULL, -1, -1);
1256         pluto_soctherm_init();
1257         tegra_register_fuse();
1258 }
1259
1260 static void __init pluto_ramconsole_reserve(unsigned long size)
1261 {
1262         tegra_reserve_ramoops_memory(SZ_1M);
1263 }
1264
1265 static void __init tegra_pluto_dt_init(void)
1266 {
1267         tegra_pluto_early_init();
1268
1269         of_platform_populate(NULL,
1270                 of_default_bus_match_table, pluto_auxdata_lookup,
1271                 &platform_bus);
1272
1273         tegra_pluto_late_init();
1274 }
1275
1276 static void __init tegra_pluto_reserve(void)
1277 {
1278 #if defined(CONFIG_NVMAP_CONVERT_CARVEOUT_TO_IOVMM)
1279         /* for PANEL_5_SHARP_1080p: 1920*1080*4*2 = 16588800 bytes */
1280         tegra_reserve(0, SZ_16M, SZ_4M);
1281 #else
1282         tegra_reserve(SZ_128M, SZ_16M, SZ_4M);
1283 #endif
1284         pluto_ramconsole_reserve(SZ_1M);
1285 }
1286
1287 static const char * const pluto_dt_board_compat[] = {
1288         "nvidia,pluto",
1289         NULL
1290 };
1291
1292 MACHINE_START(TEGRA_PLUTO, "tegra_pluto")
1293         .atag_offset    = 0x100,
1294         .smp            = smp_ops(tegra_smp_ops),
1295         .map_io         = tegra_map_common_io,
1296         .reserve        = tegra_pluto_reserve,
1297         .init_early     = tegra11x_init_early,
1298         .init_irq       = irqchip_init,
1299         .init_time      = clocksource_of_init,
1300         .init_machine   = tegra_pluto_dt_init,
1301         .restart        = tegra_assert_system_reset,
1302         .dt_compat      = pluto_dt_board_compat,
1303         .init_late      = tegra_init_late
1304 MACHINE_END