ARM: DT: Add DT entry for PWMs and Backlight
[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 "fuse.h"
76 #include "iomap.h"
77 #include "pm.h"
78 #include "common.h"
79 #include "tegra-board-id.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         .u_data.dev = {
347                 .vbus_pmu_irq = 0,
348                 .vbus_gpio = -1,
349                 .charging_supported = false,
350                 .remote_wakeup_supported = false,
351         },
352         .u_cfg.utmi = {
353                 .hssync_start_delay = 0,
354                 .elastic_limit = 16,
355                 .idle_wait_delay = 17,
356                 .term_range_adj = 6,
357                 .xcvr_setup = 8,
358                 .xcvr_lsfslew = 0,
359                 .xcvr_lsrslew = 3,
360                 .xcvr_setup_offset = 0,
361                 .xcvr_use_fuses = 1,
362         },
363 };
364
365 static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
366         .port_otg = true,
367         .has_hostpc = true,
368         .support_pmu_vbus = true,
369         .id_det_type = TEGRA_USB_PMU_ID,
370         .unaligned_dma_buf_supported = false,
371         .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
372         .op_mode = TEGRA_USB_OPMODE_HOST,
373         .u_data.host = {
374                 .vbus_gpio = -1,
375                 .hot_plug = false,
376                 .remote_wakeup_supported = true,
377                 .power_off_on_suspend = true,
378         },
379         .u_cfg.utmi = {
380                 .hssync_start_delay = 0,
381                 .elastic_limit = 16,
382                 .idle_wait_delay = 17,
383                 .term_range_adj = 6,
384                 .xcvr_setup = 15,
385                 .xcvr_lsfslew = 0,
386                 .xcvr_lsrslew = 3,
387                 .xcvr_setup_offset = 0,
388                 .xcvr_use_fuses = 1,
389                 .vbus_oc_map = 0x4,
390         },
391 };
392
393 static struct tegra_usb_otg_data tegra_otg_pdata = {
394         .ehci_device = &tegra_ehci1_device,
395         .ehci_pdata = &tegra_ehci1_utmi_pdata,
396         .vbus_extcon_dev_name = "palmas-extcon",
397         .id_extcon_dev_name = "palmas-extcon",
398 };
399
400 static void macallan_usb_init(void)
401 {
402         int usb_port_owner_info = tegra_get_usb_port_owner_info();
403
404         /* Set USB wake sources for macallan */
405         tegra_set_usb_wake_source();
406
407         if (!(usb_port_owner_info & UTMI1_PORT_OWNER_XUSB)) {
408                 tegra_otg_device.dev.platform_data = &tegra_otg_pdata;
409                 platform_device_register(&tegra_otg_device);
410                 /* Setup the udc platform data */
411                 tegra_udc_device.dev.platform_data = &tegra_udc_pdata;
412         }
413 }
414
415 static struct gpio modem_gpios[] = { /* Nemo modem */
416         {MODEM_EN, GPIOF_OUT_INIT_HIGH, "MODEM EN"},
417         {MDM_RST, GPIOF_OUT_INIT_LOW, "MODEM RESET"},
418 };
419
420 static struct tegra_usb_platform_data tegra_ehci2_hsic_baseband_pdata = {
421         .port_otg = false,
422         .has_hostpc = true,
423         .unaligned_dma_buf_supported = false,
424         .phy_intf = TEGRA_USB_PHY_INTF_HSIC,
425         .op_mode = TEGRA_USB_OPMODE_HOST,
426         .u_data.host = {
427                 .vbus_gpio = -1,
428                 .hot_plug = false,
429                 .remote_wakeup_supported = true,
430                 .power_off_on_suspend = true,
431         },
432 };
433
434 static int baseband_init(void)
435 {
436         int ret;
437
438         ret = gpio_request_array(modem_gpios, ARRAY_SIZE(modem_gpios));
439         if (ret) {
440                 pr_warn("%s:gpio request failed\n", __func__);
441                 return ret;
442         }
443
444         /* enable pull-down for MDM_COLD_BOOT */
445         tegra_pinmux_set_pullupdown(TEGRA_PINGROUP_ULPI_DATA4,
446                                     TEGRA_PUPD_PULL_DOWN);
447
448         /* export GPIO for user space access through sysfs */
449         gpio_export(MDM_RST, false);
450
451         return 0;
452 }
453
454 static const struct tegra_modem_operations baseband_operations = {
455         .init = baseband_init,
456 };
457
458 static struct tegra_usb_modem_power_platform_data baseband_pdata = {
459         .ops = &baseband_operations,
460         .wake_gpio = -1,
461         .boot_gpio = MDM_COLDBOOT,
462         .boot_irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
463         .autosuspend_delay = 2000,
464         .short_autosuspend_delay = 50,
465         .tegra_ehci_device = &tegra_ehci2_device,
466         .tegra_ehci_pdata = &tegra_ehci2_hsic_baseband_pdata,
467 };
468
469 static struct platform_device icera_nemo_device = {
470         .name = "tegra_usb_modem_power",
471         .id = -1,
472         .dev = {
473                 .platform_data = &baseband_pdata,
474         },
475 };
476
477 static void macallan_modem_init(void)
478 {
479         int modem_id = tegra_get_modem_id();
480         int usb_port_owner_info = tegra_get_usb_port_owner_info();
481         switch (modem_id) {
482         case TEGRA_BB_NEMO: /* on board i500 HSIC */
483                 if (!(usb_port_owner_info & HSIC1_PORT_OWNER_XUSB))
484                         platform_device_register(&icera_nemo_device);
485                 break;
486         }
487 }
488
489 #else
490 static void macallan_usb_init(void) { }
491 static void macallan_modem_init(void) { }
492 #endif
493
494 static void macallan_audio_init(void)
495 {
496         macallan_audio_pdata.codec_name = "rt5640.0-001c";
497         macallan_audio_pdata.codec_dai_name = "rt5640-aif1";
498 }
499
500
501 static struct platform_device *macallan_spi_devices[] __initdata = {
502         &tegra11_spi_device1,
503 };
504
505 struct spi_clk_parent spi_parent_clk_macallan[] = {
506         [0] = {.name = "pll_p"},
507 #ifndef CONFIG_TEGRA_PLLM_RESTRICTED
508         [1] = {.name = "pll_m"},
509         [2] = {.name = "clk_m"},
510 #else
511         [1] = {.name = "clk_m"},
512 #endif
513 };
514
515 static struct tegra_spi_platform_data macallan_spi_pdata = {
516         .max_dma_buffer         = 16 * 1024,
517         .is_clkon_always        = false,
518         .max_rate               = 25000000,
519 };
520
521 static void __init macallan_spi_init(void)
522 {
523         int i;
524         struct clk *c;
525
526         for (i = 0; i < ARRAY_SIZE(spi_parent_clk_macallan); ++i) {
527                 c = tegra_get_clock_by_name(spi_parent_clk_macallan[i].name);
528                 if (IS_ERR_OR_NULL(c)) {
529                         pr_err("Not able to get the clock for %s\n",
530                                         spi_parent_clk_macallan[i].name);
531                         continue;
532                 }
533                 spi_parent_clk_macallan[i].parent_clk = c;
534                 spi_parent_clk_macallan[i].fixed_clk_rate = clk_get_rate(c);
535         }
536         macallan_spi_pdata.parent_clk_list = spi_parent_clk_macallan;
537         macallan_spi_pdata.parent_clk_count = ARRAY_SIZE(spi_parent_clk_macallan);
538         macallan_spi_pdata.is_dma_based = (tegra_revision == TEGRA_REVISION_A01)
539                                                         ? false : true ;
540         tegra11_spi_device1.dev.platform_data = &macallan_spi_pdata;
541         platform_add_devices(macallan_spi_devices,
542                                 ARRAY_SIZE(macallan_spi_devices));
543 }
544
545 static __initdata struct tegra_clk_init_table touch_clk_init_table[] = {
546         /* name         parent          rate            enabled */
547         { "extern2",    "pll_p",        41000000,       false},
548         { "clk_out_2",  "extern2",      40800000,       false},
549         { NULL,         NULL,           0,              0},
550 };
551
552 struct rm_spi_ts_platform_data rm31080ts_macallan_data = {
553         .gpio_reset = TOUCH_GPIO_RST_RAYDIUM_SPI,
554         .config = 0,
555         .platform_id = RM_PLATFORM_D010,
556         .name_of_clock = "clk_out_2",
557         .name_of_clock_con = "extern2",
558 };
559
560 static struct tegra_spi_device_controller_data dev_cdata = {
561         .rx_clk_tap_delay = 16,
562         .tx_clk_tap_delay = 16,
563 };
564
565 struct spi_board_info rm31080a_macallan_spi_board[1] = {
566         {
567          .modalias = "rm_ts_spidev",
568          .bus_num = 0,
569          .chip_select = 0,
570          .max_speed_hz = 12 * 1000 * 1000,
571          .mode = SPI_MODE_0,
572          .controller_data = &dev_cdata,
573          .platform_data = &rm31080ts_macallan_data,
574          },
575 };
576
577 static int __init macallan_touch_init(void)
578 {
579         tegra_clk_init_from_table(touch_clk_init_table);
580         if (display_board_info.board_id == BOARD_E1582)
581                 rm31080ts_macallan_data.platform_id = RM_PLATFORM_P005;
582         else
583                 rm31080ts_macallan_data.platform_id = RM_PLATFORM_D010;
584         mdelay(20);
585         rm31080a_macallan_spi_board[0].irq = gpio_to_irq(TOUCH_GPIO_IRQ_RAYDIUM_SPI);
586         touch_init_raydium(TOUCH_GPIO_IRQ_RAYDIUM_SPI,
587                                 TOUCH_GPIO_RST_RAYDIUM_SPI,
588                                 &rm31080ts_macallan_data,
589                                 &rm31080a_macallan_spi_board[0],
590                                 ARRAY_SIZE(rm31080a_macallan_spi_board));
591         return 0;
592 }
593
594 #ifdef CONFIG_USE_OF
595 struct of_dev_auxdata macallan_auxdata_lookup[] __initdata = {
596         OF_DEV_AUXDATA("nvidia,tegra114-sdhci", 0x78000600, "sdhci-tegra.3",
597                                 NULL),
598         OF_DEV_AUXDATA("nvidia,tegra114-sdhci", 0x78000400, "sdhci-tegra.2",
599                                 NULL),
600         OF_DEV_AUXDATA("nvidia,tegra114-sdhci", 0x78000000, "sdhci-tegra.0",
601                                 &macallan_tegra_sdhci_platform_data0),
602         OF_DEV_AUXDATA("nvidia,tegra114-camera", 0x0, "tegra_camera",
603                                 NULL),
604         OF_DEV_AUXDATA("nvidia,tegra114-host1x", TEGRA_HOST1X_BASE, "host1x",
605                                 NULL),
606         OF_DEV_AUXDATA("nvidia,tegra114-gr3d", TEGRA_GR3D_BASE, "gr3d",
607                                 NULL),
608         OF_DEV_AUXDATA("nvidia,tegra114-gr2d", TEGRA_GR2D_BASE, "gr2d",
609                                 NULL),
610         OF_DEV_AUXDATA("nvidia,tegra114-msenc", TEGRA_MSENC_BASE, "msenc",
611                                 NULL),
612         OF_DEV_AUXDATA("nvidia,tegra114-vi", TEGRA_VI_BASE, "vi",
613                                 NULL),
614         OF_DEV_AUXDATA("nvidia,tegra114-isp", TEGRA_ISP_BASE, "isp",
615                                 NULL),
616         OF_DEV_AUXDATA("nvidia,tegra114-tsec", TEGRA_TSEC_BASE, "tsec",
617                                 NULL),
618
619         OF_DEV_AUXDATA("nvidia,tegra114-i2c", 0x7000c000, "tegra11-i2c.0",
620                                 NULL),
621         OF_DEV_AUXDATA("nvidia,tegra114-i2c", 0x7000c400, "tegra11-i2c.1",
622                                 NULL),
623         OF_DEV_AUXDATA("nvidia,tegra114-i2c", 0x7000c500, "tegra11-i2c.2",
624                                 NULL),
625         OF_DEV_AUXDATA("nvidia,tegra114-i2c", 0x7000c700, "tegra11-i2c.3",
626                                 NULL),
627         OF_DEV_AUXDATA("nvidia,tegra114-i2c", 0x7000d000, "tegra11-i2c.4",
628                                 NULL),
629         OF_DEV_AUXDATA("nvidia,tegra114-pwm", TEGRA_PWFM_BASE, "tegra-pwm",
630                                 NULL),
631         OF_DEV_AUXDATA("pwm-backlight", NULL, "pwm-backlight",
632                                 NULL),
633         {}
634 };
635 #endif
636
637 static void __init tegra_macallan_early_init(void)
638 {
639         macallan_sysedp_init();
640         tegra_clk_init_from_table(macallan_clk_init_table);
641         tegra_clk_verify_parents();
642         tegra_soc_device_init("macallan");
643 }
644
645
646 static void __init tegra_macallan_late_init(void)
647 {
648         platform_device_register(&tegra_pinmux_device);
649         macallan_pinmux_init();
650         macallan_i2c_init();
651         macallan_spi_init();
652         macallan_usb_init();
653         macallan_uart_init();
654         macallan_audio_init();
655         platform_add_devices(macallan_devices, ARRAY_SIZE(macallan_devices));
656         //tegra_ram_console_debug_init();
657         tegra_io_dpd_init();
658         macallan_regulator_init();
659         macallan_sdhci_init();
660         macallan_suspend_init();
661         macallan_emc_init();
662         macallan_edp_init();
663         isomgr_init();
664         macallan_touch_init();
665         macallan_panel_init();
666         macallan_kbc_init();
667         macallan_pmon_init();
668 #if defined CONFIG_TI_ST || defined CONFIG_TI_ST_MODULE
669         macallan_bt_st();
670         macallan_tegra_setup_st_host_wake();
671 #endif
672         macallan_modem_init();
673 #ifdef CONFIG_TEGRA_WDT_RECOVERY
674         tegra_wdt_recovery_init();
675 #endif
676         tegra_serial_debug_init(TEGRA_UARTD_BASE, INT_WDT_CPU, NULL, -1, -1);
677         macallan_sensors_init();
678         macallan_soctherm_init();
679         tegra_register_fuse();
680         macallan_sysedp_core_init();
681         macallan_sysedp_psydepl_init();
682 }
683
684 static void __init macallan_ramconsole_reserve(unsigned long size)
685 {
686         tegra_ram_console_debug_reserve(SZ_1M);
687 }
688
689 static void __init tegra_macallan_dt_init(void)
690 {
691         tegra_get_board_info(&board_info);
692         tegra_get_display_board_info(&display_board_info);
693
694         tegra_macallan_early_init();
695
696 #ifdef CONFIG_USE_OF
697         of_platform_populate(NULL,
698                 of_default_bus_match_table, macallan_auxdata_lookup,
699                 &platform_bus);
700 #else
701         platform_device_register(&tegra_gpio_device);
702 #endif
703
704         tegra_macallan_late_init();
705 }
706
707 static void __init tegra_macallan_reserve(void)
708 {
709 #if defined(CONFIG_NVMAP_CONVERT_CARVEOUT_TO_IOVMM)
710         /* 1920*1200*4*2 = 18432000 bytes */
711         tegra_reserve(0, SZ_16M + SZ_2M, SZ_16M);
712 #else
713         tegra_reserve(SZ_128M, SZ_16M + SZ_2M, SZ_4M);
714 #endif
715         macallan_ramconsole_reserve(SZ_1M);
716 }
717
718 static const char * const macallan_dt_board_compat[] = {
719         "nvidia,macallan",
720         NULL
721 };
722
723 MACHINE_START(MACALLAN, "macallan")
724         .atag_offset    = 0x100,
725         .smp            = smp_ops(tegra_smp_ops),
726         .map_io         = tegra_map_common_io,
727         .reserve        = tegra_macallan_reserve,
728         .init_early     = tegra11x_init_early,
729         .init_irq       = irqchip_init,
730         .init_time      = clocksource_of_init,
731         .init_machine   = tegra_macallan_dt_init,
732         .restart        = tegra_assert_system_reset,
733         .dt_compat      = macallan_dt_board_compat,
734 MACHINE_END