ARM: tegra: pcie: Remove dock detect variable
[linux-3.10.git] / arch / arm / mach-tegra / board-macallan.c
1 /*
2  * arch/arm/mach-tegra/board-macallan.c
3  *
4  * Copyright (c) 2013, 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/usb/tegra_usb_phy.h>
35 #include <linux/spi/spi.h>
36 #include <linux/spi/rm31080a_ts.h>
37 #include <linux/memblock.h>
38 #include <linux/spi/spi-tegra.h>
39 #include <linux/nfc/pn544.h>
40 #include <linux/skbuff.h>
41 #include <linux/ti_wilink_st.h>
42 #include <linux/regulator/consumer.h>
43 #include <linux/smb349-charger.h>
44 #include <linux/max17048_battery.h>
45 #include <linux/leds.h>
46 #include <linux/i2c/at24.h>
47 #include <linux/of_platform.h>
48 #include <linux/edp.h>
49 #include <linux/clk/tegra.h>
50 #include <linux/tegra-soc.h>
51 #include <linux/clocksource.h>
52 #include <linux/irqchip.h>
53 #include <linux/irqchip/tegra.h>
54 #include <linux/tegra_fiq_debugger.h>
55
56 #include <mach/irqs.h>
57 #include <mach/pinmux.h>
58 #include <mach/pinmux-t11.h>
59 #include <mach/io_dpd.h>
60 #include <mach/i2s.h>
61 #include <mach/isomgr.h>
62 #include <mach/tegra_asoc_pdata.h>
63 #include <asm/mach-types.h>
64 #include <asm/mach/arch.h>
65 #include <mach/gpio-tegra.h>
66 #include <linux/platform_data/tegra_usb_modem_power.h>
67
68 #include "board-touch-raydium.h"
69 #include "board.h"
70 #include "board-common.h"
71 #include "clock.h"
72 #include "board-macallan.h"
73 #include "devices.h"
74 #include "gpio-names.h"
75 #include "iomap.h"
76 #include "pm.h"
77 #include "common.h"
78 #include "tegra-board-id.h"
79 #include "tegra-of-dev-auxdata.h"
80
81 static struct board_info board_info, display_board_info;
82
83 #if defined CONFIG_TI_ST || defined CONFIG_TI_ST_MODULE
84 struct ti_st_plat_data macallan_wilink_pdata = {
85         .nshutdown_gpio = TEGRA_GPIO_PQ7,
86         .dev_name = BLUETOOTH_UART_DEV_NAME,
87         .flow_cntrl = 1,
88         .baud_rate = 3000000,
89 };
90
91 static struct platform_device wl128x_device = {
92         .name           = "kim",
93         .id             = -1,
94         .dev.platform_data = &macallan_wilink_pdata,
95 };
96
97 static struct platform_device btwilink_device = {
98         .name = "btwilink",
99         .id = -1,
100 };
101
102 static noinline void __init macallan_bt_st(void)
103 {
104         pr_info("macallan_bt_st");
105
106         platform_device_register(&wl128x_device);
107         platform_device_register(&btwilink_device);
108 }
109
110 static struct resource macallan_st_host_wake_resources[] = {
111         [0] = {
112                 .name = "host_wake",
113                 .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
114         },
115 };
116
117 static struct platform_device macallan_st_host_wake_device = {
118         .name           = "st_host_wake",
119         .id             = 0,
120         .num_resources  = ARRAY_SIZE(macallan_st_host_wake_resources),
121         .resource       = macallan_st_host_wake_resources,
122 };
123
124 static noinline void __init macallan_tegra_setup_st_host_wake(void)
125 {
126         macallan_st_host_wake_resources[0].start =
127                 macallan_st_host_wake_resources[0].end =
128                 gpio_to_irq(TEGRA_GPIO_PU6);
129         platform_device_register(&macallan_st_host_wake_device);
130 }
131 #endif
132
133 static __initdata struct tegra_clk_init_table macallan_clk_init_table[] = {
134         /* name         parent          rate            enabled */
135         { "pll_m",      NULL,           0,              false},
136         { "hda",        "pll_p",        108000000,      false},
137         { "hda2codec_2x", "pll_p",      48000000,       false},
138         { "pwm",        "pll_p",        3187500,        false},
139         { "blink",      "clk_32k",      32768,          true},
140         { "i2s1",       "pll_a_out0",   0,              false},
141         { "i2s3",       "pll_a_out0",   0,              false},
142         { "i2s4",       "pll_a_out0",   0,              false},
143         { "spdif_out",  "pll_a_out0",   0,              false},
144         { "d_audio",    "clk_m",        12000000,       false},
145         { "dam0",       "clk_m",        12000000,       false},
146         { "dam1",       "clk_m",        12000000,       false},
147         { "dam2",       "clk_m",        12000000,       false},
148         { "audio1",     "i2s1_sync",    0,              false},
149         { "audio3",     "i2s3_sync",    0,              false},
150         /* Setting vi_sensor-clk to true for validation purpose, will imapact
151          * power, later set to be false.*/
152         { "vi_sensor",  "pll_p",        150000000,      false},
153         { "cilab",      "pll_p",        150000000,      false},
154         { "cilcd",      "pll_p",        150000000,      false},
155         { "cile",       "pll_p",        150000000,      false},
156         { "i2c1",       "pll_p",        3200000,        false},
157         { "i2c2",       "pll_p",        3200000,        false},
158         { "i2c3",       "pll_p",        3200000,        false},
159         { "i2c4",       "pll_p",        3200000,        false},
160         { "i2c5",       "pll_p",        3200000,        false},
161         { NULL,         NULL,           0,              0},
162 };
163
164 #ifndef CONFIG_USE_OF
165 static struct tegra_i2c_platform_data macallan_i2c1_platform_data = {
166         .bus_clk_rate   = 100000,
167         .scl_gpio       = TEGRA_GPIO_I2C1_SCL,
168         .sda_gpio       = TEGRA_GPIO_I2C1_SDA,
169 };
170
171 static struct tegra_i2c_platform_data macallan_i2c2_platform_data = {
172         .bus_clk_rate   = 100000,
173         .is_clkon_always = true,
174         .scl_gpio       = TEGRA_GPIO_I2C2_SCL,
175         .sda_gpio       = TEGRA_GPIO_I2C2_SDA,
176 };
177
178 static struct tegra_i2c_platform_data macallan_i2c3_platform_data = {
179         .bus_clk_rate   = 400000,
180         .scl_gpio       = TEGRA_GPIO_I2C3_SCL,
181         .sda_gpio       = TEGRA_GPIO_I2C3_SDA,
182 };
183
184 static struct tegra_i2c_platform_data macallan_i2c4_platform_data = {
185         .bus_clk_rate   = 10000,
186         .scl_gpio       = TEGRA_GPIO_I2C4_SCL,
187         .sda_gpio       = TEGRA_GPIO_I2C4_SDA,
188 };
189
190 static struct tegra_i2c_platform_data macallan_i2c5_platform_data = {
191         .bus_clk_rate   = 400000,
192         .scl_gpio       = TEGRA_GPIO_I2C5_SCL,
193         .sda_gpio       = TEGRA_GPIO_I2C5_SDA,
194 };
195 #endif
196
197 static struct i2c_board_info __initdata rt5640_board_info = {
198         I2C_BOARD_INFO("rt5640", 0x1c),
199 };
200
201 static struct pn544_i2c_platform_data nfc_pdata = {
202         .irq_gpio = TEGRA_GPIO_PW2,
203         .ven_gpio = TEGRA_GPIO_PQ3,
204         .firm_gpio = TEGRA_GPIO_PH0,
205 };
206
207 static struct i2c_board_info __initdata nfc_board_info = {
208         I2C_BOARD_INFO("pn544", 0x28),
209         .platform_data = &nfc_pdata,
210 };
211
212 static void macallan_i2c_init(void)
213 {
214 #ifndef CONFIG_USE_OF
215         tegra11_i2c_device1.dev.platform_data = &macallan_i2c1_platform_data;
216         tegra11_i2c_device2.dev.platform_data = &macallan_i2c2_platform_data;
217         tegra11_i2c_device3.dev.platform_data = &macallan_i2c3_platform_data;
218         tegra11_i2c_device4.dev.platform_data = &macallan_i2c4_platform_data;
219         tegra11_i2c_device5.dev.platform_data = &macallan_i2c5_platform_data;
220
221         platform_device_register(&tegra11_i2c_device5);
222         platform_device_register(&tegra11_i2c_device4);
223         platform_device_register(&tegra11_i2c_device3);
224         platform_device_register(&tegra11_i2c_device2);
225         platform_device_register(&tegra11_i2c_device1);
226 #endif
227
228         nfc_board_info.irq = gpio_to_irq(TEGRA_GPIO_PW2);
229         i2c_register_board_info(0, &nfc_board_info, 1);
230         i2c_register_board_info(0, &rt5640_board_info, 1);
231 }
232
233 static struct platform_device *macallan_uart_devices[] __initdata = {
234         &tegra_uarta_device,
235         &tegra_uartb_device,
236         &tegra_uartc_device,
237         &tegra_uartd_device,
238 };
239
240 static void __init uart_debug_init(void)
241 {
242         int debug_port_id;
243
244         debug_port_id = uart_console_debug_init(3);
245         if (debug_port_id < 0)
246                 return;
247
248         macallan_uart_devices[debug_port_id] = uart_console_debug_device;
249 }
250
251 static void __init macallan_uart_init(void)
252 {
253         /* Register low speed only if it is selected */
254         if (!is_tegra_debug_uartport_hs())
255                 uart_debug_init();
256
257         platform_add_devices(macallan_uart_devices,
258                                 ARRAY_SIZE(macallan_uart_devices));
259 }
260
261 static struct resource tegra_rtc_resources[] = {
262         [0] = {
263                 .start = TEGRA_RTC_BASE,
264                 .end = TEGRA_RTC_BASE + TEGRA_RTC_SIZE - 1,
265                 .flags = IORESOURCE_MEM,
266         },
267         [1] = {
268                 .start = INT_RTC,
269                 .end = INT_RTC,
270                 .flags = IORESOURCE_IRQ,
271         },
272 };
273
274 static struct platform_device tegra_rtc_device = {
275         .name = "tegra_rtc",
276         .id   = -1,
277         .resource = tegra_rtc_resources,
278         .num_resources = ARRAY_SIZE(tegra_rtc_resources),
279 };
280
281 static struct tegra_asoc_platform_data macallan_audio_pdata = {
282         .gpio_spkr_en           = TEGRA_GPIO_SPKR_EN,
283         .gpio_hp_det            = TEGRA_GPIO_HP_DET,
284         .gpio_hp_mute           = -1,
285         .gpio_int_mic_en        = TEGRA_GPIO_INT_MIC_EN,
286         .gpio_ext_mic_en        = TEGRA_GPIO_EXT_MIC_EN,
287         .gpio_ldo1_en           = TEGRA_GPIO_LDO1_EN,
288         .gpio_codec1 = TEGRA_GPIO_CODEC1_EN,
289         .gpio_codec2 = TEGRA_GPIO_CODEC2_EN,
290         .gpio_codec3 = TEGRA_GPIO_CODEC3_EN,
291         .i2s_param[HIFI_CODEC]  = {
292                 .audio_port_id  = 1,
293                 .is_i2s_master  = 1,
294                 .i2s_mode       = TEGRA_DAIFMT_I2S,
295         },
296         .i2s_param[BT_SCO]      = {
297                 .audio_port_id  = 3,
298                 .is_i2s_master  = 1,
299                 .i2s_mode       = TEGRA_DAIFMT_DSP_A,
300         },
301 };
302
303 static struct platform_device macallan_audio_device = {
304         .name   = "tegra-snd-rt5640",
305         .id     = 0,
306         .dev    = {
307                 .platform_data = &macallan_audio_pdata,
308         },
309 };
310
311 static struct platform_device *macallan_devices[] __initdata = {
312         &tegra_pmu_device,
313         &tegra_rtc_device,
314         &tegra_udc_device,
315 #if defined(CONFIG_TEGRA_AVP)
316         &tegra_avp_device,
317 #endif
318 #if defined(CONFIG_CRYPTO_DEV_TEGRA_SE)
319         &tegra11_se_device,
320 #endif
321         &tegra_ahub_device,
322         &tegra_dam_device0,
323         &tegra_dam_device1,
324         &tegra_dam_device2,
325         &tegra_i2s_device1,
326         &tegra_i2s_device3,
327         &tegra_i2s_device4,
328         &tegra_spdif_device,
329         &spdif_dit_device,
330         &bluetooth_dit_device,
331         &macallan_audio_device,
332         &tegra_hda_device,
333 #if defined(CONFIG_CRYPTO_DEV_TEGRA_AES)
334         &tegra_aes_device,
335 #endif
336 };
337
338 #ifdef CONFIG_USB_SUPPORT
339 static struct tegra_usb_platform_data tegra_udc_pdata = {
340         .port_otg = true,
341         .has_hostpc = true,
342         .support_pmu_vbus = true,
343         .id_det_type = TEGRA_USB_PMU_ID,
344         .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
345         .op_mode = TEGRA_USB_OPMODE_DEVICE,
346         .vbus_extcon_dev_name = "palmas-extcon",
347         .u_data.dev = {
348                 .vbus_pmu_irq = 0,
349                 .vbus_gpio = -1,
350                 .charging_supported = false,
351                 .remote_wakeup_supported = false,
352         },
353         .u_cfg.utmi = {
354                 .hssync_start_delay = 0,
355                 .elastic_limit = 16,
356                 .idle_wait_delay = 17,
357                 .term_range_adj = 6,
358                 .xcvr_setup = 8,
359                 .xcvr_lsfslew = 0,
360                 .xcvr_lsrslew = 3,
361                 .xcvr_setup_offset = 0,
362                 .xcvr_use_fuses = 1,
363         },
364 };
365
366 static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
367         .port_otg = true,
368         .has_hostpc = true,
369         .support_pmu_vbus = true,
370         .id_det_type = TEGRA_USB_PMU_ID,
371         .unaligned_dma_buf_supported = false,
372         .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
373         .op_mode = TEGRA_USB_OPMODE_HOST,
374         .vbus_extcon_dev_name = "palmas-extcon",
375         .id_extcon_dev_name = "palmas-extcon",
376         .u_data.host = {
377                 .vbus_gpio = -1,
378                 .hot_plug = false,
379                 .remote_wakeup_supported = true,
380                 .power_off_on_suspend = true,
381         },
382         .u_cfg.utmi = {
383                 .hssync_start_delay = 0,
384                 .elastic_limit = 16,
385                 .idle_wait_delay = 17,
386                 .term_range_adj = 6,
387                 .xcvr_setup = 15,
388                 .xcvr_lsfslew = 0,
389                 .xcvr_lsrslew = 3,
390                 .xcvr_setup_offset = 0,
391                 .xcvr_use_fuses = 1,
392                 .vbus_oc_map = 0x4,
393         },
394 };
395
396 static struct tegra_usb_otg_data tegra_otg_pdata = {
397         .ehci_device = &tegra_ehci1_device,
398         .ehci_pdata = &tegra_ehci1_utmi_pdata,
399 };
400
401 static void macallan_usb_init(void)
402 {
403         int usb_port_owner_info = tegra_get_usb_port_owner_info();
404
405         /* Set USB wake sources for macallan */
406         tegra_set_usb_wake_source();
407
408         if (!(usb_port_owner_info & UTMI1_PORT_OWNER_XUSB)) {
409                 tegra_otg_device.dev.platform_data = &tegra_otg_pdata;
410                 platform_device_register(&tegra_otg_device);
411                 /* Setup the udc platform data */
412                 tegra_udc_device.dev.platform_data = &tegra_udc_pdata;
413         }
414 }
415
416 static struct gpio modem_gpios[] = { /* Nemo modem */
417         {MODEM_EN, GPIOF_OUT_INIT_HIGH, "MODEM EN"},
418         {MDM_RST, GPIOF_OUT_INIT_LOW, "MODEM RESET"},
419 };
420
421 static struct tegra_usb_platform_data tegra_ehci2_hsic_baseband_pdata = {
422         .port_otg = false,
423         .has_hostpc = true,
424         .unaligned_dma_buf_supported = false,
425         .phy_intf = TEGRA_USB_PHY_INTF_HSIC,
426         .op_mode = TEGRA_USB_OPMODE_HOST,
427         .u_data.host = {
428                 .vbus_gpio = -1,
429                 .hot_plug = false,
430                 .remote_wakeup_supported = true,
431                 .power_off_on_suspend = true,
432         },
433 };
434
435 static int baseband_init(void)
436 {
437         int ret;
438
439         ret = gpio_request_array(modem_gpios, ARRAY_SIZE(modem_gpios));
440         if (ret) {
441                 pr_warn("%s:gpio request failed\n", __func__);
442                 return ret;
443         }
444
445         /* enable pull-down for MDM_COLD_BOOT */
446         tegra_pinmux_set_pullupdown(TEGRA_PINGROUP_ULPI_DATA4,
447                                     TEGRA_PUPD_PULL_DOWN);
448
449         /* export GPIO for user space access through sysfs */
450         gpio_export(MDM_RST, false);
451
452         return 0;
453 }
454
455 static const struct tegra_modem_operations baseband_operations = {
456         .init = baseband_init,
457 };
458
459 static struct tegra_usb_modem_power_platform_data baseband_pdata = {
460         .ops = &baseband_operations,
461         .wake_gpio = -1,
462         .boot_gpio = MDM_COLDBOOT,
463         .boot_irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
464         .autosuspend_delay = 2000,
465         .short_autosuspend_delay = 50,
466         .tegra_ehci_device = &tegra_ehci2_device,
467         .tegra_ehci_pdata = &tegra_ehci2_hsic_baseband_pdata,
468 };
469
470 static struct platform_device icera_nemo_device = {
471         .name = "tegra_usb_modem_power",
472         .id = -1,
473         .dev = {
474                 .platform_data = &baseband_pdata,
475         },
476 };
477
478 static void macallan_modem_init(void)
479 {
480         int modem_id = tegra_get_modem_id();
481         int usb_port_owner_info = tegra_get_usb_port_owner_info();
482         switch (modem_id) {
483         case TEGRA_BB_NEMO: /* on board i500 HSIC */
484                 if (!(usb_port_owner_info & HSIC1_PORT_OWNER_XUSB))
485                         platform_device_register(&icera_nemo_device);
486                 break;
487         }
488 }
489
490 #else
491 static void macallan_usb_init(void) { }
492 static void macallan_modem_init(void) { }
493 #endif
494
495 static void macallan_audio_init(void)
496 {
497         macallan_audio_pdata.codec_name = "rt5640.0-001c";
498         macallan_audio_pdata.codec_dai_name = "rt5640-aif1";
499 }
500
501
502 static __initdata struct tegra_clk_init_table touch_clk_init_table[] = {
503         /* name         parent          rate            enabled */
504         { "extern2",    "pll_p",        41000000,       false},
505         { "clk_out_2",  "extern2",      40800000,       false},
506         { NULL,         NULL,           0,              0},
507 };
508
509 struct rm_spi_ts_platform_data rm31080ts_macallan_data = {
510         .gpio_reset = TOUCH_GPIO_RST_RAYDIUM_SPI,
511         .config = 0,
512         .platform_id = RM_PLATFORM_D010,
513         .name_of_clock = "clk_out_2",
514         .name_of_clock_con = "extern2",
515 };
516
517 static struct tegra_spi_device_controller_data dev_cdata = {
518         .rx_clk_tap_delay = 16,
519         .tx_clk_tap_delay = 16,
520 };
521
522 struct spi_board_info rm31080a_macallan_spi_board[1] = {
523         {
524          .modalias = "rm_ts_spidev",
525          .bus_num = 0,
526          .chip_select = 0,
527          .max_speed_hz = 12 * 1000 * 1000,
528          .mode = SPI_MODE_0,
529          .controller_data = &dev_cdata,
530          .platform_data = &rm31080ts_macallan_data,
531          },
532 };
533
534 static int __init macallan_touch_init(void)
535 {
536         tegra_clk_init_from_table(touch_clk_init_table);
537         if (display_board_info.board_id == BOARD_E1582)
538                 rm31080ts_macallan_data.platform_id = RM_PLATFORM_P005;
539         else
540                 rm31080ts_macallan_data.platform_id = RM_PLATFORM_D010;
541         mdelay(20);
542         rm31080a_macallan_spi_board[0].irq = gpio_to_irq(TOUCH_GPIO_IRQ_RAYDIUM_SPI);
543         touch_init_raydium(TOUCH_GPIO_IRQ_RAYDIUM_SPI,
544                                 TOUCH_GPIO_RST_RAYDIUM_SPI,
545                                 &rm31080ts_macallan_data,
546                                 &rm31080a_macallan_spi_board[0],
547                                 ARRAY_SIZE(rm31080a_macallan_spi_board));
548         return 0;
549 }
550
551 #ifdef CONFIG_USE_OF
552 struct of_dev_auxdata macallan_auxdata_lookup[] __initdata = {
553         OF_DEV_AUXDATA("nvidia,tegra114-sdhci", 0x78000600, "sdhci-tegra.3",
554                                 NULL),
555         OF_DEV_AUXDATA("nvidia,tegra114-sdhci", 0x78000400, "sdhci-tegra.2",
556                                 NULL),
557         OF_DEV_AUXDATA("nvidia,tegra114-sdhci", 0x78000000, "sdhci-tegra.0",
558                                 &macallan_tegra_sdhci_platform_data0),
559         OF_DEV_AUXDATA("nvidia,tegra114-camera", 0x0, "tegra_camera",
560                                 NULL),
561         OF_DEV_AUXDATA("nvidia,tegra114-host1x", TEGRA_HOST1X_BASE, "host1x",
562                                 NULL),
563         OF_DEV_AUXDATA("nvidia,tegra114-gr3d", TEGRA_GR3D_BASE, "gr3d",
564                                 NULL),
565         OF_DEV_AUXDATA("nvidia,tegra114-gr2d", TEGRA_GR2D_BASE, "gr2d",
566                                 NULL),
567         OF_DEV_AUXDATA("nvidia,tegra114-msenc", TEGRA_MSENC_BASE, "msenc",
568                                 NULL),
569         OF_DEV_AUXDATA("nvidia,tegra114-vi", TEGRA_VI_BASE, "vi",
570                                 NULL),
571         OF_DEV_AUXDATA("nvidia,tegra114-isp", TEGRA_ISP_BASE, "isp",
572                                 NULL),
573         OF_DEV_AUXDATA("nvidia,tegra114-tsec", TEGRA_TSEC_BASE, "tsec",
574                                 NULL),
575
576         OF_DEV_AUXDATA("nvidia,tegra114-i2c", 0x7000c000, "tegra11-i2c.0",
577                                 NULL),
578         OF_DEV_AUXDATA("nvidia,tegra114-i2c", 0x7000c400, "tegra11-i2c.1",
579                                 NULL),
580         OF_DEV_AUXDATA("nvidia,tegra114-i2c", 0x7000c500, "tegra11-i2c.2",
581                                 NULL),
582         OF_DEV_AUXDATA("nvidia,tegra114-i2c", 0x7000c700, "tegra11-i2c.3",
583                                 NULL),
584         OF_DEV_AUXDATA("nvidia,tegra114-i2c", 0x7000d000, "tegra11-i2c.4",
585                                 NULL),
586         T114_SPI_OF_DEV_AUXDATA,
587
588         {}
589 };
590 #endif
591
592 static void __init tegra_macallan_early_init(void)
593 {
594         macallan_sysedp_init();
595         tegra_clk_init_from_table(macallan_clk_init_table);
596         tegra_clk_verify_parents();
597         tegra_soc_device_init("macallan");
598 }
599
600
601 static void __init tegra_macallan_late_init(void)
602 {
603         platform_device_register(&tegra114_pinctrl_device);
604         macallan_pinmux_init();
605         macallan_i2c_init();
606         macallan_usb_init();
607         macallan_uart_init();
608         macallan_audio_init();
609         platform_add_devices(macallan_devices, ARRAY_SIZE(macallan_devices));
610         //tegra_ram_console_debug_init();
611         tegra_io_dpd_init();
612         macallan_regulator_init();
613         macallan_sdhci_init();
614         macallan_suspend_init();
615         macallan_emc_init();
616         macallan_edp_init();
617         isomgr_init();
618         macallan_touch_init();
619         macallan_panel_init();
620         macallan_kbc_init();
621         macallan_pmon_init();
622 #if defined CONFIG_TI_ST || defined CONFIG_TI_ST_MODULE
623         macallan_bt_st();
624         macallan_tegra_setup_st_host_wake();
625 #endif
626         macallan_modem_init();
627 #ifdef CONFIG_TEGRA_WDT_RECOVERY
628         tegra_wdt_recovery_init();
629 #endif
630         tegra_serial_debug_init(TEGRA_UARTD_BASE, INT_WDT_CPU, NULL, -1, -1);
631         macallan_sensors_init();
632         macallan_soctherm_init();
633         tegra_register_fuse();
634         macallan_sysedp_core_init();
635         macallan_sysedp_psydepl_init();
636 }
637
638 static void __init macallan_ramconsole_reserve(unsigned long size)
639 {
640         tegra_ram_console_debug_reserve(SZ_1M);
641 }
642
643 static void __init tegra_macallan_dt_init(void)
644 {
645         tegra_get_board_info(&board_info);
646         tegra_get_display_board_info(&display_board_info);
647
648         tegra_macallan_early_init();
649
650 #ifdef CONFIG_USE_OF
651         of_platform_populate(NULL,
652                 of_default_bus_match_table, macallan_auxdata_lookup,
653                 &platform_bus);
654 #else
655         platform_device_register(&tegra_gpio_device);
656 #endif
657
658         tegra_macallan_late_init();
659 }
660
661 static void __init tegra_macallan_reserve(void)
662 {
663 #if defined(CONFIG_NVMAP_CONVERT_CARVEOUT_TO_IOVMM)
664         /* 1920*1200*4*2 = 18432000 bytes */
665         tegra_reserve(0, SZ_16M + SZ_2M, SZ_16M + SZ_2M);
666 #else
667         tegra_reserve(SZ_128M, SZ_16M + SZ_2M, SZ_16M + SZ_2M);
668 #endif
669         macallan_ramconsole_reserve(SZ_1M);
670 }
671
672 static const char * const macallan_dt_board_compat[] = {
673         "nvidia,macallan",
674         NULL
675 };
676
677 MACHINE_START(MACALLAN, "macallan")
678         .atag_offset    = 0x100,
679         .smp            = smp_ops(tegra_smp_ops),
680         .map_io         = tegra_map_common_io,
681         .reserve        = tegra_macallan_reserve,
682         .init_early     = tegra11x_init_early,
683         .init_irq       = irqchip_init,
684         .init_time      = clocksource_of_init,
685         .init_machine   = tegra_macallan_dt_init,
686         .restart        = tegra_assert_system_reset,
687         .dt_compat      = macallan_dt_board_compat,
688 MACHINE_END