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