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