ARM: tegra12: set CPU rate to 2.2GHz for sku 0x87
[linux-3.10.git] / arch / arm / mach-tegra / board-dalmore.c
1 /*
2  * arch/arm/mach-tegra/board-dalmore.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/rfkill-gpio.h>
41 #include <linux/skbuff.h>
42 #include <linux/ti_wilink_st.h>
43 #include <linux/regulator/consumer.h>
44 #include <linux/smb349-charger.h>
45 #include <linux/max17048_battery.h>
46 #include <linux/leds.h>
47 #include <linux/i2c/at24.h>
48 #include <linux/of_platform.h>
49 #include <linux/edp.h>
50 #include <linux/usb/tegra_usb_phy.h>
51 #include <linux/clk/tegra.h>
52 #include <linux/clocksource.h>
53 #include <linux/irqchip.h>
54 #include <linux/irqchip/tegra.h>
55 #include <linux/tegra_fiq_debugger.h>
56 #include <linux/platform_data/tegra_usb_modem_power.h>
57
58 #include <mach/irqs.h>
59 #include <mach/pinmux.h>
60 #include <mach/pinmux-t11.h>
61 #include <mach/io_dpd.h>
62 #include <mach/i2s.h>
63 #include <mach/isomgr.h>
64 #include <mach/tegra_asoc_pdata.h>
65 #include <asm/mach-types.h>
66 #include <asm/mach/arch.h>
67 #include <mach/gpio-tegra.h>
68 #include <mach/xusb.h>
69
70 #include "board-touch-raydium.h"
71 #include "board.h"
72 #include "board-common.h"
73 #include "clock.h"
74 #include "board-dalmore.h"
75 #include "devices.h"
76 #include "gpio-names.h"
77 #include "iomap.h"
78 #include "pm.h"
79 #include "common.h"
80 #include "tegra-board-id.h"
81 #include "tegra-of-dev-auxdata.h"
82
83 static struct board_info board_info, display_board_info;
84
85 #if defined(CONFIG_BT_BLUESLEEP) || defined(CONFIG_BT_BLUESLEEP_MODULE)
86 static struct rfkill_gpio_platform_data dalmore_bt_rfkill_pdata = {
87                 .name           = "bt_rfkill",
88                 .shutdown_gpio  = TEGRA_GPIO_PQ7,
89                 .reset_gpio     = TEGRA_GPIO_PQ6,
90                 .type           = RFKILL_TYPE_BLUETOOTH,
91 };
92
93 static struct platform_device dalmore_bt_rfkill_device = {
94         .name = "rfkill_gpio",
95         .id             = -1,
96         .dev = {
97                 .platform_data = &dalmore_bt_rfkill_pdata,
98         },
99 };
100
101 static struct resource dalmore_bluesleep_resources[] = {
102         [0] = {
103                 .name = "gpio_host_wake",
104                         .start  = TEGRA_GPIO_PU6,
105                         .end    = TEGRA_GPIO_PU6,
106                         .flags  = IORESOURCE_IO,
107         },
108         [1] = {
109                 .name = "gpio_ext_wake",
110                         .start  = TEGRA_GPIO_PEE1,
111                         .end    = TEGRA_GPIO_PEE1,
112                         .flags  = IORESOURCE_IO,
113         },
114         [2] = {
115                 .name = "host_wake",
116                         .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
117         },
118 };
119
120 static struct platform_device dalmore_bluesleep_device = {
121         .name           = "bluesleep",
122         .id             = -1,
123         .num_resources  = ARRAY_SIZE(dalmore_bluesleep_resources),
124         .resource       = dalmore_bluesleep_resources,
125 };
126
127 static noinline void __init dalmore_setup_bt_rfkill(void)
128 {
129         platform_device_register(&dalmore_bt_rfkill_device);
130 }
131
132 static noinline void __init dalmore_setup_bluesleep(void)
133 {
134         dalmore_bluesleep_resources[2].start =
135                 dalmore_bluesleep_resources[2].end =
136                         gpio_to_irq(TEGRA_GPIO_PU6);
137         platform_device_register(&dalmore_bluesleep_device);
138         return;
139 }
140 #elif defined(CONFIG_BLUEDROID_PM) || defined(CONFIG_BLUEDROID_PM_MODULE)
141 static struct resource dalmore_bluedroid_pm_resources[] = {
142         [0] = {
143                 .name   = "shutdown_gpio",
144                 .start  = TEGRA_GPIO_PQ7,
145                 .end    = TEGRA_GPIO_PQ7,
146                 .flags  = IORESOURCE_IO,
147         },
148         [1] = {
149                 .name = "host_wake",
150                 .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
151         },
152         [2] = {
153                 .name = "gpio_ext_wake",
154                 .start  = TEGRA_GPIO_PEE1,
155                 .end    = TEGRA_GPIO_PEE1,
156                 .flags  = IORESOURCE_IO,
157         },
158         [3] = {
159                 .name = "gpio_host_wake",
160                 .start  = TEGRA_GPIO_PU6,
161                 .end    = TEGRA_GPIO_PU6,
162                 .flags  = IORESOURCE_IO,
163         },
164         [4] = {
165                 .name = "reset_gpio",
166                 .start  = TEGRA_GPIO_PQ6,
167                 .end    = TEGRA_GPIO_PQ6,
168                 .flags  = IORESOURCE_IO,
169         },
170 };
171
172 static struct platform_device dalmore_bluedroid_pm_device = {
173         .name = "bluedroid_pm",
174         .id             = 0,
175         .num_resources  = ARRAY_SIZE(dalmore_bluedroid_pm_resources),
176         .resource       = dalmore_bluedroid_pm_resources,
177 };
178
179 static noinline void __init dalmore_setup_bluedroid_pm(void)
180 {
181         dalmore_bluedroid_pm_resources[1].start =
182                 dalmore_bluedroid_pm_resources[1].end =
183                                 gpio_to_irq(TEGRA_GPIO_PU6);
184         platform_device_register(&dalmore_bluedroid_pm_device);
185 }
186 #endif
187
188 static __initdata struct tegra_clk_init_table dalmore_clk_init_table[] = {
189         /* name         parent          rate            enabled */
190         { "pll_m",      NULL,           0,              false},
191         { "hda",        "pll_p",        108000000,      false},
192         { "hda2codec_2x", "pll_p",      48000000,       false},
193         { "pwm",        "pll_p",        3187500,        false},
194         { "blink",      "clk_32k",      32768,          true},
195         { "i2s1",       "pll_a_out0",   0,              false},
196         { "i2s3",       "pll_a_out0",   0,              false},
197         { "i2s4",       "pll_a_out0",   0,              false},
198         { "spdif_out",  "pll_a_out0",   0,              false},
199         { "d_audio",    "clk_m",        12000000,       false},
200         { "dam0",       "clk_m",        12000000,       false},
201         { "dam1",       "clk_m",        12000000,       false},
202         { "dam2",       "clk_m",        12000000,       false},
203         { "audio1",     "i2s1_sync",    0,              false},
204         { "audio3",     "i2s3_sync",    0,              false},
205         /* Setting vi_sensor-clk to true for validation purpose, will imapact
206          * power, later set to be false.*/
207         { "vi_sensor",  "pll_p",        150000000,      false},
208         { "cilab",      "pll_p",        150000000,      false},
209         { "cilcd",      "pll_p",        150000000,      false},
210         { "cile",       "pll_p",        150000000,      false},
211         { "i2c1",       "pll_p",        3200000,        false},
212         { "i2c2",       "pll_p",        3200000,        false},
213         { "i2c3",       "pll_p",        3200000,        false},
214         { "i2c4",       "pll_p",        3200000,        false},
215         { "i2c5",       "pll_p",        3200000,        false},
216         { "sbc1",       "pll_p",        25000000,       false},
217         { "sbc2",       "pll_p",        25000000,       false},
218         { "sbc3",       "pll_p",        25000000,       false},
219         { "sbc4",       "pll_p",        25000000,       false},
220         { "sbc5",       "pll_p",        25000000,       false},
221         { "sbc6",       "pll_p",        25000000,       false},
222         { "uarta",      "pll_p",        408000000,      false},
223         { "uartb",      "pll_p",        408000000,      false},
224         { "uartc",      "pll_p",        408000000,      false},
225         { "uartd",      "pll_p",        408000000,      false},
226         { NULL,         NULL,           0,              0},
227 };
228
229 static struct i2c_board_info __initdata rt5640_board_info = {
230         I2C_BOARD_INFO("rt5640", 0x1c),
231 };
232
233 static struct pn544_i2c_platform_data nfc_pdata = {
234         .irq_gpio = TEGRA_GPIO_PW2,
235         .ven_gpio = TEGRA_GPIO_PQ3,
236         .firm_gpio = TEGRA_GPIO_PH0,
237 };
238
239 static struct i2c_board_info __initdata nfc_board_info = {
240         I2C_BOARD_INFO("pn544", 0x28),
241         .platform_data = &nfc_pdata,
242 };
243
244 static void dalmore_i2c_init(void)
245 {
246         nfc_board_info.irq = gpio_to_irq(TEGRA_GPIO_PW2);
247         i2c_register_board_info(0, &nfc_board_info, 1);
248         i2c_register_board_info(0, &rt5640_board_info, 1);
249 }
250
251 static struct tegra_serial_platform_data dalmore_uartd_pdata = {
252         .dma_req_selector = 19,
253         .modem_interrupt = false,
254 };
255
256 static void __init dalmore_uart_init(void)
257 {
258         int debug_port_id;
259
260         /* Register low speed only if it is selected */
261         if (!is_tegra_debug_uartport_hs()) {
262                 debug_port_id = uart_console_debug_init(3);
263                 if (debug_port_id < 0)
264                         return;
265
266                 platform_device_register(uart_console_debug_device);
267
268         } else {
269                 tegra_uartd_device.dev.platform_data = &dalmore_uartd_pdata;
270                 platform_device_register(&tegra_uartd_device);
271         }
272
273 }
274
275 static struct resource tegra_rtc_resources[] = {
276         [0] = {
277                 .start = TEGRA_RTC_BASE,
278                 .end = TEGRA_RTC_BASE + TEGRA_RTC_SIZE - 1,
279                 .flags = IORESOURCE_MEM,
280         },
281         [1] = {
282                 .start = INT_RTC,
283                 .end = INT_RTC,
284                 .flags = IORESOURCE_IRQ,
285         },
286 };
287
288 static struct platform_device tegra_rtc_device = {
289         .name = "tegra_rtc",
290         .id   = -1,
291         .resource = tegra_rtc_resources,
292         .num_resources = ARRAY_SIZE(tegra_rtc_resources),
293 };
294
295 static struct tegra_asoc_platform_data dalmore_audio_pdata = {
296         .gpio_spkr_en           = TEGRA_GPIO_SPKR_EN,
297         .gpio_hp_det            = TEGRA_GPIO_HP_DET,
298         .gpio_hp_mute           = -1,
299         .gpio_int_mic_en        = TEGRA_GPIO_INT_MIC_EN,
300         .gpio_ext_mic_en        = TEGRA_GPIO_EXT_MIC_EN,
301         .gpio_ldo1_en           = TEGRA_GPIO_LDO1_EN,
302         .gpio_codec1 = TEGRA_GPIO_CODEC1_EN,
303         .gpio_codec2 = TEGRA_GPIO_CODEC2_EN,
304         .gpio_codec3 = TEGRA_GPIO_CODEC3_EN,
305         .i2s_param[HIFI_CODEC]  = {
306                 .audio_port_id  = 1,
307                 .is_i2s_master  = 1,
308                 .i2s_mode       = TEGRA_DAIFMT_I2S,
309         },
310         .i2s_param[BT_SCO]      = {
311                 .audio_port_id  = 3,
312                 .is_i2s_master  = 1,
313                 .i2s_mode       = TEGRA_DAIFMT_DSP_A,
314         },
315 };
316
317 static struct platform_device dalmore_audio_device = {
318         .name   = "tegra-snd-rt5640",
319         .id     = 0,
320         .dev    = {
321                 .platform_data = &dalmore_audio_pdata,
322         },
323 };
324
325 static struct platform_device *dalmore_devices[] __initdata = {
326         &tegra_pmu_device,
327         &tegra_rtc_device,
328         &tegra_udc_device,
329 #if defined(CONFIG_TEGRA_AVP)
330         &tegra_avp_device,
331 #endif
332 #if defined(CONFIG_CRYPTO_DEV_TEGRA_SE)
333         &tegra11_se_device,
334 #endif
335         &tegra_ahub_device,
336         &tegra_dam_device0,
337         &tegra_dam_device1,
338         &tegra_dam_device2,
339         &tegra_i2s_device1,
340         &tegra_i2s_device3,
341         &tegra_i2s_device4,
342         &tegra_spdif_device,
343         &spdif_dit_device,
344         &bluetooth_dit_device,
345         &tegra_pcm_device,
346         &dalmore_audio_device,
347         &tegra_hda_device,
348 #if defined(CONFIG_TEGRA_CEC_SUPPORT)
349         &tegra_cec_device,
350 #endif
351 #if defined(CONFIG_CRYPTO_DEV_TEGRA_AES)
352         &tegra_aes_device,
353 #endif
354 };
355
356 #ifdef CONFIG_USB_SUPPORT
357 static struct tegra_usb_platform_data tegra_udc_pdata = {
358         .port_otg = true,
359         .has_hostpc = true,
360         .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
361         .unaligned_dma_buf_supported = false,
362         .op_mode = TEGRA_USB_OPMODE_DEVICE,
363         .u_data.dev = {
364                 .vbus_pmu_irq = 0,
365                 .vbus_gpio = -1,
366                 .charging_supported = false,
367                 .remote_wakeup_supported = false,
368         },
369         .u_cfg.utmi = {
370                 .hssync_start_delay = 0,
371                 .elastic_limit = 16,
372                 .idle_wait_delay = 17,
373                 .term_range_adj = 6,
374                 .xcvr_setup = 8,
375                 .xcvr_lsfslew = 0,
376                 .xcvr_lsrslew = 3,
377                 .xcvr_setup_offset = 0,
378                 .xcvr_use_fuses = 1,
379         },
380 };
381
382 static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
383         .port_otg = true,
384         .has_hostpc = true,
385         .unaligned_dma_buf_supported = false,
386         .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
387         .op_mode = TEGRA_USB_OPMODE_HOST,
388         .u_data.host = {
389                 .vbus_gpio = -1,
390                 .hot_plug = false,
391                 .remote_wakeup_supported = true,
392                 .power_off_on_suspend = true,
393         },
394         .u_cfg.utmi = {
395                 .hssync_start_delay = 0,
396                 .elastic_limit = 16,
397                 .idle_wait_delay = 17,
398                 .term_range_adj = 6,
399                 .xcvr_setup = 15,
400                 .xcvr_lsfslew = 0,
401                 .xcvr_lsrslew = 3,
402                 .xcvr_setup_offset = 0,
403                 .xcvr_use_fuses = 1,
404                 .vbus_oc_map = 0x4,
405         },
406 };
407
408 static struct tegra_usb_platform_data tegra_ehci3_utmi_pdata = {
409         .port_otg = false,
410         .has_hostpc = true,
411         .unaligned_dma_buf_supported = false,
412         .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
413         .op_mode = TEGRA_USB_OPMODE_HOST,
414         .u_data.host = {
415                 .vbus_gpio = -1,
416                 .hot_plug = false,
417                 .remote_wakeup_supported = true,
418                 .power_off_on_suspend = true,
419         },
420         .u_cfg.utmi = {
421         .hssync_start_delay = 0,
422                 .elastic_limit = 16,
423                 .idle_wait_delay = 17,
424                 .term_range_adj = 6,
425                 .xcvr_setup = 8,
426                 .xcvr_lsfslew = 0,
427                 .xcvr_lsrslew = 3,
428                 .xcvr_setup_offset = 0,
429                 .xcvr_use_fuses = 1,
430                 .vbus_oc_map = 0x5,
431         },
432 };
433
434 static struct tegra_usb_otg_data tegra_otg_pdata = {
435         .ehci_device = &tegra_ehci1_device,
436         .ehci_pdata = &tegra_ehci1_utmi_pdata,
437 };
438
439 static void dalmore_usb_init(void)
440 {
441         int usb_port_owner_info = tegra_get_usb_port_owner_info();
442
443         /* Set USB wake sources for dalmore */
444         tegra_set_usb_wake_source();
445
446         if (!(usb_port_owner_info & UTMI1_PORT_OWNER_XUSB)) {
447                 tegra_otg_pdata.is_xhci = false;
448                 tegra_udc_pdata.u_data.dev.is_xhci = false;
449         } else {
450                 tegra_otg_pdata.is_xhci = true;
451                 tegra_udc_pdata.u_data.dev.is_xhci = true;
452         }
453         tegra_otg_device.dev.platform_data = &tegra_otg_pdata;
454         platform_device_register(&tegra_otg_device);
455         /* Setup the udc platform data */
456         tegra_udc_device.dev.platform_data = &tegra_udc_pdata;
457
458         if (!(usb_port_owner_info & UTMI2_PORT_OWNER_XUSB)) {
459                 tegra_ehci3_device.dev.platform_data = &tegra_ehci3_utmi_pdata;
460                 platform_device_register(&tegra_ehci3_device);
461         }
462 }
463
464 static struct tegra_xusb_platform_data xusb_pdata = {
465         .portmap = TEGRA_XUSB_SS_P0 | TEGRA_XUSB_USB2_P1 |
466                         TEGRA_XUSB_USB2_P0,
467 };
468
469 static void dalmore_xusb_init(void)
470 {
471         int usb_port_owner_info = tegra_get_usb_port_owner_info();
472
473         if (!(usb_port_owner_info & UTMI1_PORT_OWNER_XUSB))
474                 xusb_pdata.portmap &= ~TEGRA_XUSB_USB2_P0;
475         if (!(usb_port_owner_info & UTMI2_PORT_OWNER_XUSB))
476                 xusb_pdata.portmap &= ~(TEGRA_XUSB_USB2_P1 | TEGRA_XUSB_SS_P0);
477 }
478
479 static struct gpio modem_gpios[] = { /* Nemo modem */
480         {MODEM_EN, GPIOF_OUT_INIT_HIGH, "MODEM EN"},
481         {MDM_RST, GPIOF_OUT_INIT_LOW, "MODEM RESET"},
482 };
483
484 static struct tegra_usb_platform_data tegra_ehci2_hsic_baseband_pdata = {
485         .port_otg = false,
486         .has_hostpc = true,
487         .unaligned_dma_buf_supported = false,
488         .phy_intf = TEGRA_USB_PHY_INTF_HSIC,
489         .op_mode = TEGRA_USB_OPMODE_HOST,
490         .u_data.host = {
491                 .vbus_gpio = -1,
492                 .hot_plug = false,
493                 .remote_wakeup_supported = true,
494                 .power_off_on_suspend = true,
495         },
496 };
497
498 static int baseband_init(void)
499 {
500         int ret;
501
502         ret = gpio_request_array(modem_gpios, ARRAY_SIZE(modem_gpios));
503         if (ret) {
504                 pr_warn("%s:gpio request failed\n", __func__);
505                 return ret;
506         }
507
508         /* enable pull-down for MDM_COLD_BOOT */
509         tegra_pinmux_set_pullupdown(TEGRA_PINGROUP_KB_COL5,
510                                     TEGRA_PUPD_PULL_DOWN);
511
512         /* export GPIO for user space access through sysfs */
513         gpio_export(MDM_RST, false);
514
515         return 0;
516 }
517
518 static const struct tegra_modem_operations baseband_operations = {
519         .init = baseband_init,
520 };
521
522 static struct tegra_usb_modem_power_platform_data baseband_pdata = {
523         .ops = &baseband_operations,
524         .regulator_name = "vdd_modem_3v3",
525         .wake_gpio = -1,
526         .boot_gpio = MDM_COLDBOOT,
527         .boot_irq_flags = IRQF_TRIGGER_RISING |
528                                     IRQF_TRIGGER_FALLING |
529                                     IRQF_ONESHOT,
530         .autosuspend_delay = 2000,
531         .short_autosuspend_delay = 50,
532         .tegra_ehci_device = &tegra_ehci2_device,
533         .tegra_ehci_pdata = &tegra_ehci2_hsic_baseband_pdata,
534 };
535
536 static struct platform_device icera_nemo_device = {
537         .name = "tegra_usb_modem_power",
538         .id = -1,
539         .dev = {
540                 .platform_data = &baseband_pdata,
541         },
542 };
543
544 static void dalmore_modem_init(void)
545 {
546         int modem_id = tegra_get_modem_id();
547         int usb_port_owner_info = tegra_get_usb_port_owner_info();
548         switch (modem_id) {
549         case TEGRA_BB_NEMO: /* on board i500 HSIC */
550                 if (!(usb_port_owner_info & HSIC1_PORT_OWNER_XUSB)) {
551                         platform_device_register(&icera_nemo_device);
552                 }
553                 break;
554         }
555 }
556
557 #else
558 static void dalmore_usb_init(void) { }
559 static void dalmore_modem_init(void) { }
560 static void dalmore_xusb_init(void) { }
561 #endif
562
563 static void dalmore_audio_init(void)
564 {
565         dalmore_audio_pdata.codec_name = "rt5640.0-001c";
566         dalmore_audio_pdata.codec_dai_name = "rt5640-aif1";
567 }
568
569 static __initdata struct tegra_clk_init_table touch_clk_init_table[] = {
570         /* name         parent          rate            enabled */
571         { "extern2",    "pll_p",        41000000,       false},
572         { "clk_out_2",  "extern2",      40800000,       false},
573         { NULL,         NULL,           0,              0},
574 };
575
576 struct rm_spi_ts_platform_data rm31080ts_dalmore_data = {
577         .gpio_reset = TOUCH_GPIO_RST_RAYDIUM_SPI,
578         .config = 0,
579         .platform_id = RM_PLATFORM_D010,
580         .name_of_clock = "clk_out_2",
581         .name_of_clock_con = "extern2",
582 };
583
584 static struct tegra_spi_device_controller_data dev_cdata = {
585         .rx_clk_tap_delay = 16,
586         .tx_clk_tap_delay = 16,
587 };
588
589 struct spi_board_info rm31080a_dalmore_spi_board[1] = {
590         {
591          .modalias = "rm_ts_spidev",
592          .bus_num = 3,
593          .chip_select = 2,
594          .max_speed_hz = 12 * 1000 * 1000,
595          .mode = SPI_MODE_0,
596          .controller_data = &dev_cdata,
597          .platform_data = &rm31080ts_dalmore_data,
598          },
599 };
600
601 static int __init dalmore_touch_init(void)
602 {
603         tegra_clk_init_from_table(touch_clk_init_table);
604         if (display_board_info.board_id == BOARD_E1582)
605                 rm31080ts_dalmore_data.platform_id = RM_PLATFORM_P005;
606         else
607                 rm31080ts_dalmore_data.platform_id = RM_PLATFORM_D010;
608         mdelay(20);
609         rm31080a_dalmore_spi_board[0].irq = gpio_to_irq(TOUCH_GPIO_IRQ_RAYDIUM_SPI);
610         touch_init_raydium(TOUCH_GPIO_IRQ_RAYDIUM_SPI,
611                                 TOUCH_GPIO_RST_RAYDIUM_SPI,
612                                 &rm31080ts_dalmore_data,
613                                 &rm31080a_dalmore_spi_board[0],
614                                 ARRAY_SIZE(rm31080a_dalmore_spi_board));
615         return 0;
616 }
617
618 #ifdef CONFIG_USE_OF
619 struct of_dev_auxdata dalmore_auxdata_lookup[] __initdata = {
620         OF_DEV_AUXDATA("nvidia,tegra114-sdhci", 0x78000600, "sdhci-tegra.3",
621                                 NULL),
622         OF_DEV_AUXDATA("nvidia,tegra114-sdhci", 0x78000400, "sdhci-tegra.2",
623                                 NULL),
624         OF_DEV_AUXDATA("nvidia,tegra114-sdhci", 0x78000000, "sdhci-tegra.0",
625                                 &dalmore_tegra_sdhci_platform_data0),
626         OF_DEV_AUXDATA("nvidia,tegra114-camera", 0x0, "tegra_camera",
627                                 NULL),
628         OF_DEV_AUXDATA("nvidia,tegra114-host1x", TEGRA_HOST1X_BASE, "host1x",
629                                 NULL),
630         OF_DEV_AUXDATA("nvidia,tegra114-gr3d", TEGRA_GR3D_BASE, "gr3d",
631                                 NULL),
632         OF_DEV_AUXDATA("nvidia,tegra114-gr2d", TEGRA_GR2D_BASE, "gr2d",
633                                 NULL),
634         OF_DEV_AUXDATA("nvidia,tegra114-msenc", TEGRA_MSENC_BASE, "msenc",
635                                 NULL),
636         OF_DEV_AUXDATA("nvidia,tegra114-vi", TEGRA_VI_BASE, "vi",
637                                 NULL),
638         OF_DEV_AUXDATA("nvidia,tegra114-isp", TEGRA_ISP_BASE, "isp",
639                                 NULL),
640         OF_DEV_AUXDATA("nvidia,tegra114-tsec", TEGRA_TSEC_BASE, "tsec",
641                                 NULL),
642
643         T114_I2C_OF_DEV_AUXDATA,
644         T114_SPI_OF_DEV_AUXDATA,
645         OF_DEV_AUXDATA("nvidia,tegra114-apbdma", 0x6000a000, "tegra-apbdma",
646                                 NULL),
647         OF_DEV_AUXDATA("nvidia,tegra114-hsuart", 0x70006000, "serial-tegra.0",
648                                 NULL),
649         OF_DEV_AUXDATA("nvidia,tegra114-hsuart", 0x70006040, "serial-tegra.1",
650                                 NULL),
651         OF_DEV_AUXDATA("nvidia,tegra114-hsuart", 0x70006200, "serial-tegra.2",
652                                 NULL),
653         OF_DEV_AUXDATA("nvidia,tegra114-xhci", 0x70090000, "tegra-xhci",
654                                 &xusb_pdata),
655         {}
656 };
657 #endif
658
659 static void __init tegra_dalmore_early_init(void)
660 {
661         tegra_clk_init_from_table(dalmore_clk_init_table);
662         tegra_clk_verify_parents();
663         tegra_soc_device_init("dalmore");
664 }
665
666 static void __init tegra_dalmore_late_init(void)
667 {
668         dalmore_i2c_init();
669         dalmore_usb_init();
670         dalmore_xusb_init();
671         dalmore_uart_init();
672         dalmore_audio_init();
673         platform_add_devices(dalmore_devices, ARRAY_SIZE(dalmore_devices));
674         tegra_io_dpd_init();
675         dalmore_regulator_init();
676         dalmore_sdhci_init();
677         dalmore_suspend_init();
678         dalmore_emc_init();
679         dalmore_edp_init();
680         isomgr_init();
681         dalmore_touch_init();
682         if (board_info.board_id == BOARD_E1582)
683                 roth_panel_init(board_info.board_id);
684         else
685                 dalmore_panel_init();
686         dalmore_kbc_init();
687         dalmore_pmon_init();
688 #if defined(CONFIG_BT_BLUESLEEP) || defined(CONFIG_BT_BLUESLEEP_MODULE)
689         dalmore_setup_bluesleep();
690         dalmore_setup_bt_rfkill();
691 #elif defined(CONFIG_BLUEDROID_PM) || defined(CONFIG_BLUEDROID_PM_MODULE)
692         dalmore_setup_bluedroid_pm();
693 #endif
694         dalmore_modem_init();
695 #ifdef CONFIG_TEGRA_WDT_RECOVERY
696         tegra_wdt_recovery_init();
697 #endif
698         tegra_serial_debug_init(TEGRA_UARTD_BASE, INT_WDT_CPU, NULL, -1, -1);
699         dalmore_sensors_init();
700         dalmore_soctherm_init();
701         tegra_register_fuse();
702 }
703
704 static void __init tegra_dalmore_dt_init(void)
705 {
706         tegra_get_board_info(&board_info);
707         tegra_get_display_board_info(&display_board_info);
708
709         tegra_dalmore_early_init();
710
711         of_platform_populate(NULL,
712                 of_default_bus_match_table, dalmore_auxdata_lookup,
713                 &platform_bus);
714
715         tegra_dalmore_late_init();
716 }
717
718 static void __init tegra_dalmore_reserve(void)
719 {
720 #if defined(CONFIG_NVMAP_CONVERT_CARVEOUT_TO_IOVMM)
721         /* 1920*1200*4*2 = 18432000 bytes */
722         tegra_reserve(0, SZ_16M + SZ_2M, SZ_16M);
723 #else
724         tegra_reserve(SZ_512M, SZ_16M + SZ_2M, SZ_4M);
725 #endif
726 }
727
728 static const char * const dalmore_dt_board_compat[] = {
729         "nvidia,dalmore",
730         NULL
731 };
732
733 MACHINE_START(DALMORE, "dalmore")
734         .atag_offset    = 0x100,
735         .smp            = smp_ops(tegra_smp_ops),
736         .map_io         = tegra_map_common_io,
737         .reserve        = tegra_dalmore_reserve,
738         .init_early     = tegra11x_init_early,
739         .init_irq       = irqchip_init,
740         .init_time      = clocksource_of_init,
741         .init_machine   = tegra_dalmore_dt_init,
742         .restart        = tegra_assert_system_reset,
743         .dt_compat      = dalmore_dt_board_compat,
744         .init_late      = tegra_init_late,
745 MACHINE_END