2 * arch/arm/mach-tegra/board-ardbeg.c
4 * Copyright (c) 2013-2014, NVIDIA CORPORATION. All rights reserved.
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.
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
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.
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/i2c/i2c-hid.h>
29 #include <linux/dma-mapping.h>
30 #include <linux/delay.h>
31 #include <linux/i2c-tegra.h>
32 #include <linux/gpio.h>
33 #include <linux/input.h>
34 #include <linux/platform_data/tegra_usb.h>
35 #include <linux/spi/spi.h>
36 #include <linux/spi/rm31080a_ts.h>
37 #include <linux/maxim_sti.h>
38 #include <linux/memblock.h>
39 #include <linux/spi/spi-tegra.h>
40 #include <linux/nfc/pn544.h>
41 #include <linux/rfkill-gpio.h>
42 #include <linux/skbuff.h>
43 #include <linux/ti_wilink_st.h>
44 #include <linux/regulator/consumer.h>
45 #include <linux/smb349-charger.h>
46 #include <linux/max17048_battery.h>
47 #include <linux/leds.h>
48 #include <linux/i2c/at24.h>
49 #include <linux/of_platform.h>
50 #include <linux/i2c.h>
51 #include <linux/i2c-tegra.h>
52 #include <linux/platform_data/serial-tegra.h>
53 #include <linux/edp.h>
54 #include <linux/usb/tegra_usb_phy.h>
55 #include <linux/mfd/palmas.h>
56 #include <linux/clk/tegra.h>
57 #include <media/tegra_dtv.h>
58 #include <linux/clocksource.h>
59 #include <linux/irqchip.h>
60 #include <linux/irqchip/tegra.h>
61 #include <linux/tegra-soc.h>
62 #include <linux/tegra_fiq_debugger.h>
63 #include <linux/platform_data/tegra_usb_modem_power.h>
64 #include <linux/platform_data/tegra_ahci.h>
65 #include <linux/irqchip/tegra.h>
66 #include <sound/max98090.h>
68 #include <mach/irqs.h>
69 #include <mach/pinmux.h>
70 #include <mach/pinmux-t12.h>
71 #include <mach/io_dpd.h>
73 #include <mach/isomgr.h>
74 #include <mach/tegra_asoc_pdata.h>
76 #include <mach/tegra_usb_pad_ctrl.h>
78 #include <asm/mach-types.h>
79 #include <asm/mach/arch.h>
80 #include <mach/gpio-tegra.h>
81 #include <mach/xusb.h>
84 #include "board-ardbeg.h"
85 #include "board-common.h"
86 #include "board-touch-raydium.h"
87 #include "board-touch-maxim_sti.h"
91 #include "gpio-names.h"
94 #include "tegra-board-id.h"
95 #include "tegra-of-dev-auxdata.h"
97 static struct board_info board_info, display_board_info;
99 static struct resource ardbeg_bluedroid_pm_resources[] = {
101 .name = "shutdown_gpio",
102 .start = TEGRA_GPIO_PR1,
103 .end = TEGRA_GPIO_PR1,
104 .flags = IORESOURCE_IO,
108 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
111 .name = "gpio_ext_wake",
112 .start = TEGRA_GPIO_PEE1,
113 .end = TEGRA_GPIO_PEE1,
114 .flags = IORESOURCE_IO,
117 .name = "gpio_host_wake",
118 .start = TEGRA_GPIO_PU6,
119 .end = TEGRA_GPIO_PU6,
120 .flags = IORESOURCE_IO,
123 .name = "reset_gpio",
124 .start = TEGRA_GPIO_PX1,
125 .end = TEGRA_GPIO_PX1,
126 .flags = IORESOURCE_IO,
130 static struct platform_device ardbeg_bluedroid_pm_device = {
131 .name = "bluedroid_pm",
133 .num_resources = ARRAY_SIZE(ardbeg_bluedroid_pm_resources),
134 .resource = ardbeg_bluedroid_pm_resources,
137 static noinline void __init ardbeg_setup_bluedroid_pm(void)
139 ardbeg_bluedroid_pm_resources[1].start =
140 ardbeg_bluedroid_pm_resources[1].end =
141 gpio_to_irq(TEGRA_GPIO_PU6);
142 platform_device_register(&ardbeg_bluedroid_pm_device);
145 static struct i2c_board_info __initdata rt5639_board_info = {
146 I2C_BOARD_INFO("rt5639", 0x1c),
149 static struct max98090_eq_cfg max98090_eq_cfg[] = {
152 static struct max98090_pdata norrin_max98090_pdata = {
153 /* Equalizer Configuration */
154 .eq_cfg = max98090_eq_cfg,
155 .eq_cfgcnt = ARRAY_SIZE(max98090_eq_cfg),
157 /* Microphone Configuration */
158 .digmic_left_mode = 1,
159 .digmic_right_mode = 1,
162 static struct i2c_board_info __initdata max98090_board_info = {
163 I2C_BOARD_INFO("max98090", 0x10),
164 .platform_data = &norrin_max98090_pdata,
167 static __initdata struct tegra_clk_init_table ardbeg_clk_init_table[] = {
168 /* name parent rate enabled */
169 { "pll_m", NULL, 0, false},
170 { "hda", "pll_p", 108000000, false},
171 { "hda2codec_2x", "pll_p", 48000000, false},
172 { "pwm", "pll_p", 48000000, false},
173 { "pll_a", "pll_p_out1", 282240000, false},
174 { "i2s1", "pll_a_out0", 0, false},
175 { "i2s3", "pll_a_out0", 0, false},
176 { "i2s4", "pll_a_out0", 0, false},
177 { "spdif_out", "pll_a_out0", 0, false},
178 { "d_audio", "pll_a_out0", 12288000, false},
179 { "dam0", "clk_m", 12000000, false},
180 { "dam1", "clk_m", 12000000, false},
181 { "dam2", "clk_m", 12000000, false},
182 { "audio1", "i2s1_sync", 0, false},
183 { "audio3", "i2s3_sync", 0, false},
184 { "vi_sensor", "pll_p", 150000000, false},
185 { "vi_sensor2", "pll_p", 150000000, false},
186 { "cilab", "pll_p", 150000000, false},
187 { "cilcd", "pll_p", 150000000, false},
188 { "cile", "pll_p", 150000000, false},
189 { "i2c1", "pll_p", 3200000, false},
190 { "i2c2", "pll_p", 3200000, false},
191 { "i2c3", "pll_p", 3200000, false},
192 { "i2c4", "pll_p", 3200000, false},
193 { "i2c5", "pll_p", 3200000, false},
194 { "sbc1", "pll_p", 25000000, false},
195 { "sbc2", "pll_p", 25000000, false},
196 { "sbc3", "pll_p", 25000000, false},
197 { "sbc4", "pll_p", 25000000, false},
198 { "sbc5", "pll_p", 25000000, false},
199 { "sbc6", "pll_p", 25000000, false},
200 { "uarta", "pll_p", 408000000, false},
201 { "uartb", "pll_p", 408000000, false},
202 { "uartc", "pll_p", 408000000, false},
203 { "uartd", "pll_p", 408000000, false},
207 static struct i2c_hid_platform_data i2c_keyboard_pdata = {
208 .hid_descriptor_address = 0x0,
211 static struct i2c_board_info __initdata i2c_keyboard_board_info = {
212 I2C_BOARD_INFO("hid", 0x3B),
213 .platform_data = &i2c_keyboard_pdata,
216 static struct i2c_hid_platform_data i2c_touchpad_pdata = {
217 .hid_descriptor_address = 0x20,
220 static struct i2c_board_info __initdata i2c_touchpad_board_info = {
221 I2C_BOARD_INFO("hid", 0x2C),
222 .platform_data = &i2c_touchpad_pdata,
225 static void ardbeg_i2c_init(void)
227 struct board_info board_info;
228 tegra_get_board_info(&board_info);
230 if (board_info.board_id == BOARD_PM374) {
231 i2c_register_board_info(0, &max98090_board_info, 1);
232 } else if (board_info.board_id != BOARD_PM359)
233 i2c_register_board_info(0, &rt5639_board_info, 1);
235 if (board_info.board_id == BOARD_PM359 ||
236 board_info.board_id == BOARD_PM358 ||
237 board_info.board_id == BOARD_PM363 ||
238 board_info.board_id == BOARD_PM374) {
239 i2c_keyboard_board_info.irq = gpio_to_irq(I2C_KB_IRQ);
240 i2c_register_board_info(1, &i2c_keyboard_board_info , 1);
242 i2c_touchpad_board_info.irq = gpio_to_irq(I2C_TP_IRQ);
243 i2c_register_board_info(1, &i2c_touchpad_board_info , 1);
247 #ifndef CONFIG_USE_OF
248 static struct platform_device *ardbeg_uart_devices[] __initdata = {
254 static struct tegra_serial_platform_data ardbeg_uarta_pdata = {
255 .dma_req_selector = 8,
256 .modem_interrupt = false,
259 static struct tegra_serial_platform_data ardbeg_uartb_pdata = {
260 .dma_req_selector = 9,
261 .modem_interrupt = false,
264 static struct tegra_serial_platform_data ardbeg_uartc_pdata = {
265 .dma_req_selector = 10,
266 .modem_interrupt = false,
270 static struct tegra_serial_platform_data ardbeg_uartd_pdata = {
271 .dma_req_selector = 19,
272 .modem_interrupt = false,
275 static struct tegra_asoc_platform_data ardbeg_audio_pdata_rt5639 = {
276 .gpio_hp_det = TEGRA_GPIO_HP_DET,
277 .gpio_ldo1_en = TEGRA_GPIO_LDO_EN,
279 .gpio_int_mic_en = -1,
280 .gpio_ext_mic_en = -1,
285 .i2s_param[HIFI_CODEC] = {
288 .i2s_mode = TEGRA_DAIFMT_I2S,
293 .i2s_param[BT_SCO] = {
296 .i2s_mode = TEGRA_DAIFMT_DSP_A,
298 .i2s_param[BASEBAND] = {
301 .i2s_mode = TEGRA_DAIFMT_I2S,
309 static struct tegra_asoc_platform_data norrin_audio_pdata_max98090 = {
310 .gpio_hp_det = NORRIN_GPIO_HP_DET,
311 .gpio_ext_mic_en = TEGRA_GPIO_HP_DET,
314 .edp_states = {1080, 842, 0},
315 .i2s_param[HIFI_CODEC] = {
318 .i2s_mode = TEGRA_DAIFMT_I2S,
323 .i2s_param[BT_SCO] = {
326 .i2s_mode = TEGRA_DAIFMT_DSP_A,
333 static void ardbeg_audio_init(void)
335 struct board_info board_info;
336 tegra_get_board_info(&board_info);
337 if (board_info.board_id == BOARD_PM359 ||
338 board_info.board_id == BOARD_PM358 ||
339 board_info.board_id == BOARD_PM370 ||
340 board_info.board_id == BOARD_PM374 ||
341 board_info.board_id == BOARD_PM375 ||
342 board_info.board_id == BOARD_PM377 ||
343 board_info.board_id == BOARD_PM363) {
345 ardbeg_audio_pdata_rt5639.gpio_hp_det = TEGRA_GPIO_HP_DET;
346 ardbeg_audio_pdata_rt5639.gpio_hp_det_active_high = 1;
347 if (board_info.board_id != BOARD_PM363)
348 ardbeg_audio_pdata_rt5639.gpio_ldo1_en = -1;
352 if (board_info.board_id == BOARD_E1762 ||
353 board_info.board_id == BOARD_P1761 ||
354 board_info.board_id == BOARD_E1922) {
355 ardbeg_audio_pdata_rt5639.gpio_hp_det =
357 ardbeg_audio_pdata_rt5639.use_codec_jd_irq = true;
359 ardbeg_audio_pdata_rt5639.gpio_hp_det =
361 ardbeg_audio_pdata_rt5639.use_codec_jd_irq = false;
363 ardbeg_audio_pdata_rt5639.gpio_hp_det_active_high = 0;
364 ardbeg_audio_pdata_rt5639.gpio_ldo1_en = TEGRA_GPIO_LDO_EN;
367 if (board_info.board_id == BOARD_E1971) {
368 ardbeg_audio_pdata_rt5639.gpio_hp_det = TEGRA_GPIO_CDC_IRQ;
369 ardbeg_audio_pdata_rt5639.use_codec_jd_irq = true;
370 ardbeg_audio_pdata_rt5639.gpio_hp_det_active_high = 0;
371 ardbeg_audio_pdata_rt5639.gpio_ldo1_en = TEGRA_GPIO_LDO_EN;
374 ardbeg_audio_pdata_rt5639.codec_name = "rt5639.0-001c";
375 ardbeg_audio_pdata_rt5639.codec_dai_name = "rt5639-aif1";
377 norrin_audio_pdata_max98090.codec_name = "max98090.0-0010";
378 norrin_audio_pdata_max98090.codec_dai_name = "HiFi";
381 static struct platform_device ardbeg_audio_device_rt5639 = {
382 .name = "tegra-snd-rt5639",
385 .platform_data = &ardbeg_audio_pdata_rt5639,
389 static struct platform_device norrin_audio_device_max98090 = {
390 .name = "tegra-snd-max98090",
393 .platform_data = &norrin_audio_pdata_max98090,
397 static void __init ardbeg_uart_init(void)
400 #ifndef CONFIG_USE_OF
401 tegra_uarta_device.dev.platform_data = &ardbeg_uarta_pdata;
402 tegra_uartb_device.dev.platform_data = &ardbeg_uartb_pdata;
403 tegra_uartc_device.dev.platform_data = &ardbeg_uartc_pdata;
404 platform_add_devices(ardbeg_uart_devices,
405 ARRAY_SIZE(ardbeg_uart_devices));
407 tegra_uartd_device.dev.platform_data = &ardbeg_uartd_pdata;
408 if (!is_tegra_debug_uartport_hs()) {
409 int debug_port_id = uart_console_debug_init(3);
410 if (debug_port_id < 0)
413 #ifdef CONFIG_TEGRA_FIQ_DEBUGGER
414 tegra_serial_debug_init(TEGRA_UARTD_BASE, INT_WDT_CPU, NULL, -1, -1);
416 platform_device_register(uart_console_debug_device);
419 tegra_uartd_device.dev.platform_data = &ardbeg_uartd_pdata;
420 platform_device_register(&tegra_uartd_device);
424 static struct resource tegra_rtc_resources[] = {
426 .start = TEGRA_RTC_BASE,
427 .end = TEGRA_RTC_BASE + TEGRA_RTC_SIZE - 1,
428 .flags = IORESOURCE_MEM,
433 .flags = IORESOURCE_IRQ,
437 static struct platform_device tegra_rtc_device = {
440 .resource = tegra_rtc_resources,
441 .num_resources = ARRAY_SIZE(tegra_rtc_resources),
444 static struct platform_device *ardbeg_devices[] __initdata = {
447 #if defined(CONFIG_TEGRA_WAKEUP_MONITOR)
448 &tegratab_tegra_wakeup_monitor_device,
451 #if defined(CONFIG_TEGRA_WATCHDOG)
454 #if defined(CONFIG_TEGRA_AVP)
457 #if defined(CONFIG_CRYPTO_DEV_TEGRA_SE) && !defined(CONFIG_USE_OF)
470 &bluetooth_dit_device,
471 &baseband_dit_device,
473 &tegra_offload_device,
474 &tegra30_avp_audio_device,
475 #if defined(CONFIG_CRYPTO_DEV_TEGRA_AES)
478 &tegra_hier_ictlr_device,
481 static struct tegra_usb_platform_data tegra_udc_pdata = {
484 .unaligned_dma_buf_supported = false,
485 .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
486 .op_mode = TEGRA_USB_OPMODE_DEVICE,
490 .charging_supported = true,
491 .remote_wakeup_supported = false,
494 .hssync_start_delay = 0,
496 .idle_wait_delay = 17,
501 .xcvr_setup_offset = 0,
506 static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
509 .unaligned_dma_buf_supported = true,
510 .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
511 .op_mode = TEGRA_USB_OPMODE_HOST,
515 .remote_wakeup_supported = true,
516 .power_off_on_suspend = true,
519 .hssync_start_delay = 0,
521 .idle_wait_delay = 17,
526 .xcvr_setup_offset = 0,
529 .xcvr_hsslew_lsb = 2,
533 static struct tegra_usb_platform_data tegra_ehci2_utmi_pdata = {
536 .unaligned_dma_buf_supported = true,
537 .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
538 .op_mode = TEGRA_USB_OPMODE_HOST,
542 .remote_wakeup_supported = true,
543 .power_off_on_suspend = true,
546 .hssync_start_delay = 0,
548 .idle_wait_delay = 17,
553 .xcvr_setup_offset = 0,
559 static struct tegra_usb_platform_data tegra_ehci3_utmi_pdata = {
562 .unaligned_dma_buf_supported = true,
563 .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
564 .op_mode = TEGRA_USB_OPMODE_HOST,
568 .remote_wakeup_supported = true,
569 .power_off_on_suspend = true,
572 .hssync_start_delay = 0,
574 .idle_wait_delay = 17,
579 .xcvr_setup_offset = 0,
585 static struct gpio modem_gpios[] = { /* Bruce modem */
586 {MODEM_EN, GPIOF_OUT_INIT_HIGH, "MODEM EN"},
587 {MDM_RST, GPIOF_OUT_INIT_LOW, "MODEM RESET"},
588 {MDM_SAR0, GPIOF_OUT_INIT_LOW, "MODEM SAR0"},
591 static struct tegra_usb_platform_data tegra_ehci2_hsic_baseband_pdata = {
594 .unaligned_dma_buf_supported = true,
595 .phy_intf = TEGRA_USB_PHY_INTF_HSIC,
596 .op_mode = TEGRA_USB_OPMODE_HOST,
600 .remote_wakeup_supported = true,
601 .power_off_on_suspend = true,
605 static struct tegra_usb_platform_data tegra_ehci2_hsic_smsc_hub_pdata = {
608 .unaligned_dma_buf_supported = true,
609 .phy_intf = TEGRA_USB_PHY_INTF_HSIC,
610 .op_mode = TEGRA_USB_OPMODE_HOST,
614 .remote_wakeup_supported = true,
615 .power_off_on_suspend = true,
620 static struct tegra_usb_otg_data tegra_otg_pdata = {
621 .ehci_device = &tegra_ehci1_device,
622 .ehci_pdata = &tegra_ehci1_utmi_pdata,
625 static void ardbeg_usb_init(void)
627 int usb_port_owner_info = tegra_get_usb_port_owner_info();
628 int modem_id = tegra_get_modem_id();
629 struct board_info bi;
630 tegra_get_pmu_board_info(&bi);
632 if (board_info.sku == 1100 || board_info.board_id == BOARD_P1761 ||
633 board_info.board_id == BOARD_E1784)
634 tegra_ehci1_utmi_pdata.u_data.host.turn_off_vbus_on_lp0 = true;
636 if (board_info.board_id == BOARD_PM359 ||
637 board_info.board_id == BOARD_PM358 ||
638 board_info.board_id == BOARD_PM370 ||
639 board_info.board_id == BOARD_PM374 ||
640 board_info.board_id == BOARD_PM375 ||
641 board_info.board_id == BOARD_PM377 ||
642 board_info.board_id == BOARD_PM363) {
644 /* Host cable is detected through AMS PMU Interrupt */
645 if (board_info.major_revision >= 'A' &&
646 board_info.major_revision <= 'D' &&
647 board_info.board_id == BOARD_PM375) {
648 tegra_udc_pdata.id_det_type = TEGRA_USB_VIRTUAL_ID;
649 tegra_ehci1_utmi_pdata.id_det_type =
650 TEGRA_USB_VIRTUAL_ID;
652 tegra_udc_pdata.id_det_type = TEGRA_USB_PMU_ID;
653 tegra_ehci1_utmi_pdata.id_det_type = TEGRA_USB_PMU_ID;
655 tegra_ehci1_utmi_pdata.id_extcon_dev_name = "as3722-extcon";
660 * TN8 supports vbus changing and it can handle
661 * vbus voltages larger then 5V. Enable this.
663 if (board_info.board_id == BOARD_P1761 ||
664 board_info.board_id == BOARD_E1784 ||
665 board_info.board_id == BOARD_E1780) {
668 * Set the maximum voltage that can be supplied
669 * over USB vbus that the board supports if we use
670 * a quick charge 2 wall charger.
672 tegra_udc_pdata.qc2_voltage = TEGRA_USB_QC2_9V;
673 tegra_udc_pdata.u_data.dev.qc2_current_limit_ma = 1200;
675 /* charger needs to be set to 2A - h/w will do 1.8A */
676 tegra_udc_pdata.u_data.dev.dcp_current_limit_ma = 2000;
679 switch (bi.board_id) {
681 /* Host cable is detected through PMU Interrupt */
682 tegra_udc_pdata.id_det_type = TEGRA_USB_PMU_ID;
683 tegra_ehci1_utmi_pdata.id_det_type = TEGRA_USB_PMU_ID;
684 tegra_ehci1_utmi_pdata.id_extcon_dev_name =
692 /* Device cable is detected through PMU Interrupt */
693 tegra_udc_pdata.support_pmu_vbus = true;
694 tegra_udc_pdata.vbus_extcon_dev_name = "palmas-extcon";
695 tegra_ehci1_utmi_pdata.support_pmu_vbus = true;
696 tegra_ehci1_utmi_pdata.vbus_extcon_dev_name =
698 /* Host cable is detected through PMU Interrupt */
699 tegra_udc_pdata.id_det_type = TEGRA_USB_PMU_ID;
700 tegra_ehci1_utmi_pdata.id_det_type = TEGRA_USB_PMU_ID;
701 tegra_ehci1_utmi_pdata.id_extcon_dev_name =
705 /* Enable Y-Cable support */
706 if (bi.board_id == BOARD_P1761)
707 tegra_ehci1_utmi_pdata.u_data.host.support_y_cable =
711 if (!(usb_port_owner_info & UTMI1_PORT_OWNER_XUSB)) {
712 tegra_otg_pdata.is_xhci = false;
713 tegra_udc_pdata.u_data.dev.is_xhci = false;
715 tegra_otg_pdata.is_xhci = true;
716 tegra_udc_pdata.u_data.dev.is_xhci = true;
718 tegra_otg_device.dev.platform_data = &tegra_otg_pdata;
719 platform_device_register(&tegra_otg_device);
720 /* Setup the udc platform data */
721 tegra_udc_device.dev.platform_data = &tegra_udc_pdata;
723 if (!(usb_port_owner_info & UTMI2_PORT_OWNER_XUSB)) {
725 if ((bi.board_id != BOARD_P1761) &&
726 (bi.board_id != BOARD_E1922) &&
727 (bi.board_id != BOARD_E1784)) {
728 tegra_ehci2_device.dev.platform_data =
729 &tegra_ehci2_utmi_pdata;
730 platform_device_register(&tegra_ehci2_device);
735 if (!(usb_port_owner_info & UTMI2_PORT_OWNER_XUSB)) {
736 if ((bi.board_id != BOARD_P1761) &&
737 (bi.board_id != BOARD_E1922) &&
738 (bi.board_id != BOARD_E1784)) {
739 tegra_ehci3_device.dev.platform_data =
740 &tegra_ehci3_utmi_pdata;
741 platform_device_register(&tegra_ehci3_device);
747 static struct tegra_xusb_platform_data xusb_pdata = {
748 .portmap = TEGRA_XUSB_SS_P0 | TEGRA_XUSB_USB2_P0 | TEGRA_XUSB_SS_P1 |
749 TEGRA_XUSB_USB2_P1 | TEGRA_XUSB_USB2_P2,
752 #ifdef CONFIG_TEGRA_XUSB_PLATFORM
753 static void ardbeg_xusb_init(void)
755 int usb_port_owner_info = tegra_get_usb_port_owner_info();
757 xusb_pdata.lane_owner = (u8) tegra_get_lane_owner_info();
759 if (board_info.board_id == BOARD_PM359 ||
760 board_info.board_id == BOARD_PM358 ||
761 board_info.board_id == BOARD_PM374 ||
762 board_info.board_id == BOARD_PM370 ||
763 board_info.board_id == BOARD_PM363) {
764 if (board_info.board_id == BOARD_PM374 ||
765 board_info.board_id == BOARD_PM370)
766 pr_info("Norrin. 0x%x\n", board_info.board_id);
768 pr_info("Laguna. 0x%x\n", board_info.board_id);
770 if (!(usb_port_owner_info & UTMI1_PORT_OWNER_XUSB))
771 xusb_pdata.portmap &= ~(TEGRA_XUSB_USB2_P0 |
774 if (!(usb_port_owner_info & UTMI2_PORT_OWNER_XUSB))
775 xusb_pdata.portmap &= ~(TEGRA_XUSB_USB2_P1 |
776 TEGRA_XUSB_SS_P1 | TEGRA_XUSB_USB2_P2);
778 /* FIXME Add for UTMIP2 when have odmdata assigend */
779 } else if (board_info.board_id == BOARD_PM375) {
780 if (!(usb_port_owner_info & UTMI1_PORT_OWNER_XUSB))
781 xusb_pdata.portmap &= ~(TEGRA_XUSB_USB2_P0);
782 if (!(usb_port_owner_info & UTMI2_PORT_OWNER_XUSB))
783 xusb_pdata.portmap &= ~(TEGRA_XUSB_USB2_P2 |
784 TEGRA_XUSB_USB2_P1 | TEGRA_XUSB_SS_P0);
785 xusb_pdata.portmap &= ~(TEGRA_XUSB_SS_P1);
788 if (board_info.board_id == BOARD_E1781) {
789 pr_info("Shield ERS-S. 0x%x\n", board_info.board_id);
791 if (!(usb_port_owner_info & UTMI1_PORT_OWNER_XUSB))
792 xusb_pdata.portmap &= ~(TEGRA_XUSB_USB2_P0);
794 if (!(usb_port_owner_info & UTMI2_PORT_OWNER_XUSB))
795 xusb_pdata.portmap &= ~(
796 TEGRA_XUSB_USB2_P1 | TEGRA_XUSB_SS_P0 |
797 TEGRA_XUSB_USB2_P2 | TEGRA_XUSB_SS_P1);
799 pr_info("Shield ERS 0x%x\n", board_info.board_id);
801 if (!(usb_port_owner_info & UTMI1_PORT_OWNER_XUSB))
802 xusb_pdata.portmap &= ~(TEGRA_XUSB_USB2_P0 |
805 if (!(usb_port_owner_info & UTMI2_PORT_OWNER_XUSB))
806 xusb_pdata.portmap &= ~(TEGRA_XUSB_USB2_P1 |
807 TEGRA_XUSB_USB2_P2 | TEGRA_XUSB_SS_P1);
809 /* FIXME Add for UTMIP2 when have odmdata assigend */
812 if (usb_port_owner_info & HSIC1_PORT_OWNER_XUSB)
813 xusb_pdata.portmap |= TEGRA_XUSB_HSIC_P0;
815 if (usb_port_owner_info & HSIC2_PORT_OWNER_XUSB)
816 xusb_pdata.portmap |= TEGRA_XUSB_HSIC_P1;
820 static int baseband_init(void)
824 ret = gpio_request_array(modem_gpios, ARRAY_SIZE(modem_gpios));
826 pr_warn("%s:gpio request failed\n", __func__);
830 /* enable pull-down for MDM_COLD_BOOT */
831 tegra_pinmux_set_pullupdown(TEGRA_PINGROUP_ULPI_DATA4,
832 TEGRA_PUPD_PULL_DOWN);
834 /* Release modem reset to start boot */
835 gpio_set_value(MDM_RST, 1);
837 /* export GPIO for user space access through sysfs */
838 gpio_export(MDM_RST, false);
839 gpio_export(MDM_SAR0, false);
844 static const struct tegra_modem_operations baseband_operations = {
845 .init = baseband_init,
848 static struct tegra_usb_modem_power_platform_data baseband_pdata = {
849 .ops = &baseband_operations,
850 .regulator_name = "vdd_wwan_mdm",
852 .boot_gpio = MDM_COLDBOOT,
853 .boot_irq_flags = IRQF_TRIGGER_RISING |
854 IRQF_TRIGGER_FALLING |
856 .autosuspend_delay = 2000,
857 .short_autosuspend_delay = 50,
858 .tegra_ehci_device = &tegra_ehci2_device,
859 .tegra_ehci_pdata = &tegra_ehci2_hsic_baseband_pdata,
860 .mdm_power_report_gpio = MDM_POWER_REPORT,
861 .mdm_power_irq_flags = IRQF_TRIGGER_RISING |
862 IRQF_TRIGGER_FALLING |
866 static struct platform_device icera_bruce_device = {
867 .name = "tegra_usb_modem_power",
870 .platform_data = &baseband_pdata,
874 static void ardbeg_modem_init(void)
876 int modem_id = tegra_get_modem_id();
877 struct board_info board_info;
878 struct board_info pmu_board_info;
879 int usb_port_owner_info = tegra_get_usb_port_owner_info();
881 tegra_get_board_info(&board_info);
882 tegra_get_pmu_board_info(&pmu_board_info);
883 pr_info("%s: modem_id = %d\n", __func__, modem_id);
887 if (!(usb_port_owner_info & HSIC1_PORT_OWNER_XUSB)) {
888 /* Set specific USB wake source for Ardbeg */
889 if (board_info.board_id == BOARD_E1780)
890 tegra_set_wake_source(42, INT_USB2);
891 if (pmu_board_info.board_id == BOARD_E1736 ||
892 pmu_board_info.board_id == BOARD_E1769 ||
893 pmu_board_info.board_id == BOARD_E1936)
894 baseband_pdata.regulator_name = NULL;
895 platform_device_register(&icera_bruce_device);
898 case TEGRA_BB_HSIC_HUB: /* HSIC hub */
899 if (!(usb_port_owner_info & HSIC1_PORT_OWNER_XUSB)) {
900 tegra_ehci2_device.dev.platform_data =
901 &tegra_ehci2_hsic_smsc_hub_pdata;
902 /* Set specific USB wake source for Ardbeg */
903 if (board_info.board_id == BOARD_E1780)
904 tegra_set_wake_source(42, INT_USB2);
905 platform_device_register(&tegra_ehci2_device);
907 xusb_pdata.pretend_connect_0 = true;
915 static struct of_dev_auxdata ardbeg_auxdata_lookup[] __initdata = {
916 T124_SPI_OF_DEV_AUXDATA,
917 OF_DEV_AUXDATA("nvidia,tegra124-apbdma", 0x60020000, "tegra-apbdma",
919 OF_DEV_AUXDATA("nvidia,tegra124-se", 0x70012000, "tegra12-se", NULL),
920 OF_DEV_AUXDATA("nvidia,tegra124-host1x", TEGRA_HOST1X_BASE, "host1x",
922 OF_DEV_AUXDATA("nvidia,tegra124-gk20a", TEGRA_GK20A_BAR0_BASE,
924 #ifdef CONFIG_ARCH_TEGRA_VIC
925 OF_DEV_AUXDATA("nvidia,tegra124-vic", TEGRA_VIC_BASE, "vic03.0", NULL),
927 OF_DEV_AUXDATA("nvidia,tegra124-msenc", TEGRA_MSENC_BASE, "msenc",
929 OF_DEV_AUXDATA("nvidia,tegra124-vi", TEGRA_VI_BASE, "vi.0", NULL),
930 OF_DEV_AUXDATA("nvidia,tegra124-isp", TEGRA_ISP_BASE, "isp.0", NULL),
931 OF_DEV_AUXDATA("nvidia,tegra124-isp", TEGRA_ISPB_BASE, "isp.1", NULL),
932 OF_DEV_AUXDATA("nvidia,tegra124-tsec", TEGRA_TSEC_BASE, "tsec", NULL),
933 OF_DEV_AUXDATA("nvidia,tegra114-hsuart", 0x70006000, "serial-tegra.0",
935 OF_DEV_AUXDATA("nvidia,tegra114-hsuart", 0x70006040, "serial-tegra.1",
937 OF_DEV_AUXDATA("nvidia,tegra114-hsuart", 0x70006200, "serial-tegra.2",
939 T124_I2C_OF_DEV_AUXDATA,
940 OF_DEV_AUXDATA("nvidia,tegra124-xhci", 0x70090000, "tegra-xhci",
942 OF_DEV_AUXDATA("nvidia,tegra124-dc", TEGRA_DISPLAY_BASE, "tegradc.0",
944 OF_DEV_AUXDATA("nvidia,tegra124-dc", TEGRA_DISPLAY2_BASE, "tegradc.1",
946 OF_DEV_AUXDATA("nvidia,tegra124-nvavp", 0x60001000, "nvavp",
948 OF_DEV_AUXDATA("nvidia,tegra124-pwm", 0x7000a000, "tegra-pwm", NULL),
949 OF_DEV_AUXDATA("nvidia,tegra124-dfll", 0x70110000, "tegra_cl_dvfs",
951 OF_DEV_AUXDATA("nvidia,tegra132-dfll", 0x70040084, "tegra_cl_dvfs",
953 OF_DEV_AUXDATA("nvidia,tegra124-efuse", TEGRA_FUSE_BASE, "tegra-fuse",
955 OF_DEV_AUXDATA("nvidia,tegra124-camera", 0, "pcl-generic",
957 OF_DEV_AUXDATA("nvidia,tegra114-ahci-sata", 0x70027000, "tegra-sata.0",
963 struct maxim_sti_pdata maxim_sti_pdata = {
964 .touch_fusion = "/vendor/bin/touch_fusion",
965 .config_file = "/vendor/firmware/touch_fusion.cfg",
966 .fw_name = "maxim_fp35.bin",
967 .nl_family = TF_FAMILY_NAME,
969 .chip_access_method = 2,
970 .default_reset_state = 0,
973 .gpio_reset = TOUCH_GPIO_RST_MAXIM_STI_SPI,
974 .gpio_irq = TOUCH_GPIO_IRQ_MAXIM_STI_SPI
977 struct maxim_sti_pdata maxim_sti_pdata_rd = {
978 .touch_fusion = "/vendor/bin/touch_fusion_rd",
979 .config_file = "/vendor/firmware/touch_fusion.cfg",
980 .fw_name = "maxim_fp35.bin",
981 .nl_family = TF_FAMILY_NAME,
983 .chip_access_method = 2,
984 .default_reset_state = 0,
987 .gpio_reset = TOUCH_GPIO_RST_MAXIM_STI_SPI,
988 .gpio_irq = TOUCH_GPIO_IRQ_MAXIM_STI_SPI
991 static struct tegra_spi_device_controller_data maxim_dev_cdata = {
992 .rx_clk_tap_delay = 0,
993 .is_hw_based_cs = true,
994 .tx_clk_tap_delay = 0,
997 struct spi_board_info maxim_sti_spi_board = {
998 .modalias = MAXIM_STI_NAME,
999 .bus_num = TOUCH_SPI_ID,
1000 .chip_select = TOUCH_SPI_CS,
1001 .max_speed_hz = 12 * 1000 * 1000,
1003 .platform_data = &maxim_sti_pdata,
1004 .controller_data = &maxim_dev_cdata,
1007 static __initdata struct tegra_clk_init_table touch_clk_init_table[] = {
1008 /* name parent rate enabled */
1009 { "extern2", "pll_p", 41000000, false},
1010 { "clk_out_2", "extern2", 40800000, false},
1011 { NULL, NULL, 0, 0},
1014 static struct rm_spi_ts_platform_data rm31080ts_ardbeg_data = {
1015 .gpio_reset = TOUCH_GPIO_RST_RAYDIUM_SPI,
1017 .platform_id = RM_PLATFORM_A010,
1018 .name_of_clock = "clk_out_2",
1019 .name_of_clock_con = "extern2",
1022 static struct rm_spi_ts_platform_data rm31080ts_tn8_data = {
1023 .gpio_reset = TOUCH_GPIO_RST_RAYDIUM_SPI,
1025 .platform_id = RM_PLATFORM_T008,
1026 .name_of_clock = "clk_out_2",
1027 .name_of_clock_con = "extern2",
1030 static struct rm_spi_ts_platform_data rm31080ts_tn8_p1765_data = {
1031 .gpio_reset = TOUCH_GPIO_RST_RAYDIUM_SPI,
1033 .platform_id = RM_PLATFORM_T008_2,
1034 .name_of_clock = "clk_out_2",
1035 .name_of_clock_con = "extern2",
1038 static struct rm_spi_ts_platform_data rm31080ts_norrin_data = {
1039 .gpio_reset = TOUCH_GPIO_RST_RAYDIUM_SPI,
1041 .platform_id = RM_PLATFORM_P140,
1042 .name_of_clock = "clk_out_2",
1043 .name_of_clock_con = "extern2",
1046 struct rm_spi_ts_platform_data rm31080ts_t132loki_data = {
1047 .gpio_reset = TOUCH_GPIO_RST_RAYDIUM_SPI,
1049 .platform_id = RM_PLATFORM_L005,
1050 .name_of_clock = "clk_out_2",
1051 .name_of_clock_con = "extern2",
1054 struct rm_spi_ts_platform_data rm31080ts_t132loki_data_jdi_5 = {
1055 .gpio_reset = TOUCH_GPIO_RST_RAYDIUM_SPI,
1057 .platform_id = RM_PLATFORM_L005,
1058 .name_of_clock = "clk_out_2",
1059 .name_of_clock_con = "extern2",
1060 .gpio_sensor_select0 = false,
1061 .gpio_sensor_select1 = true,
1063 static struct tegra_spi_device_controller_data dev_cdata = {
1064 .rx_clk_tap_delay = 0,
1065 .tx_clk_tap_delay = 16,
1068 static struct spi_board_info rm31080a_ardbeg_spi_board[1] = {
1070 .modalias = "rm_ts_spidev",
1071 .bus_num = TOUCH_SPI_ID,
1072 .chip_select = TOUCH_SPI_CS,
1073 .max_speed_hz = 12 * 1000 * 1000,
1075 .controller_data = &dev_cdata,
1076 .platform_data = &rm31080ts_ardbeg_data,
1080 static struct spi_board_info rm31080a_tn8_spi_board[1] = {
1082 .modalias = "rm_ts_spidev",
1083 .bus_num = TOUCH_SPI_ID,
1084 .chip_select = TOUCH_SPI_CS,
1085 .max_speed_hz = 18 * 1000 * 1000,
1087 .controller_data = &dev_cdata,
1088 .platform_data = &rm31080ts_tn8_data,
1092 static struct spi_board_info rm31080a_tn8_p1765_spi_board[1] = {
1094 .modalias = "rm_ts_spidev",
1095 .bus_num = TOUCH_SPI_ID,
1096 .chip_select = TOUCH_SPI_CS,
1097 .max_speed_hz = 18 * 1000 * 1000,
1099 .controller_data = &dev_cdata,
1100 .platform_data = &rm31080ts_tn8_p1765_data,
1104 static struct spi_board_info rm31080a_norrin_spi_board[1] = {
1106 .modalias = "rm_ts_spidev",
1107 .bus_num = NORRIN_TOUCH_SPI_ID,
1108 .chip_select = NORRIN_TOUCH_SPI_CS,
1109 .max_speed_hz = 12 * 1000 * 1000,
1111 .controller_data = &dev_cdata,
1112 .platform_data = &rm31080ts_norrin_data,
1116 static int __init ardbeg_touch_init(void)
1118 tegra_get_board_info(&board_info);
1120 if (tegra_get_touch_vendor_id() == MAXIM_TOUCH) {
1121 pr_info("%s init maxim touch\n", __func__);
1122 #if defined(CONFIG_TOUCHSCREEN_MAXIM_STI) || \
1123 defined(CONFIG_TOUCHSCREEN_MAXIM_STI_MODULE)
1124 if (tegra_get_touch_panel_id() == TOUCHPANEL_TN7)
1125 maxim_sti_spi_board.platform_data = &maxim_sti_pdata_rd;
1126 (void)touch_init_maxim_sti(&maxim_sti_spi_board);
1128 } else if (tegra_get_touch_vendor_id() == RAYDIUM_TOUCH) {
1129 pr_info("%s init raydium touch\n", __func__);
1130 tegra_clk_init_from_table(touch_clk_init_table);
1131 if (board_info.board_id == BOARD_PM374) {
1132 rm31080a_norrin_spi_board[0].irq =
1133 gpio_to_irq(TOUCH_GPIO_IRQ_RAYDIUM_SPI);
1134 touch_init_raydium(TOUCH_GPIO_IRQ_RAYDIUM_SPI,
1135 TOUCH_GPIO_RST_RAYDIUM_SPI,
1136 &rm31080ts_norrin_data,
1137 &rm31080a_norrin_spi_board[0],
1138 ARRAY_SIZE(rm31080a_norrin_spi_board));
1139 } else if ((board_info.board_id == BOARD_P2530) ||
1140 (board_info.board_id == BOARD_E2548)) {
1141 if (board_info.sku == BOARD_SKU_FOSTER)
1143 if (tegra_get_touch_panel_id() == TOUCHPANEL_LOKI_JDI5)
1144 rm31080a_ardbeg_spi_board[0].platform_data =
1145 &rm31080ts_t132loki_data_jdi_5;
1147 rm31080a_ardbeg_spi_board[0].platform_data =
1148 &rm31080ts_t132loki_data;
1149 if (board_info.fab >= 0xa3) {
1150 rm31080ts_t132loki_data.name_of_clock = NULL;
1151 rm31080ts_t132loki_data.name_of_clock_con = NULL;
1153 tegra_clk_init_from_table(touch_clk_init_table);
1154 rm31080a_ardbeg_spi_board[0].irq =
1155 gpio_to_irq(TOUCH_GPIO_IRQ_RAYDIUM_SPI);
1156 touch_init_raydium(TOUCH_GPIO_IRQ_RAYDIUM_SPI,
1157 TOUCH_GPIO_RST_RAYDIUM_SPI,
1158 &rm31080ts_t132loki_data,
1159 &rm31080a_ardbeg_spi_board[0],
1160 ARRAY_SIZE(rm31080a_ardbeg_spi_board));
1161 } else if (board_info.board_id == BOARD_P1761) {
1162 rm31080a_tn8_spi_board[0].irq =
1163 gpio_to_irq(TOUCH_GPIO_IRQ_RAYDIUM_SPI);
1164 touch_init_raydium(TOUCH_GPIO_IRQ_RAYDIUM_SPI,
1165 TOUCH_GPIO_RST_RAYDIUM_SPI,
1166 &rm31080ts_tn8_data,
1167 &rm31080a_tn8_spi_board[0],
1168 ARRAY_SIZE(rm31080a_tn8_spi_board));
1169 } else if (board_info.board_id == BOARD_P1765) {
1170 rm31080a_tn8_p1765_spi_board[0].irq =
1171 gpio_to_irq(TOUCH_GPIO_IRQ_RAYDIUM_SPI);
1172 touch_init_raydium(TOUCH_GPIO_IRQ_RAYDIUM_SPI,
1173 TOUCH_GPIO_RST_RAYDIUM_SPI,
1174 &rm31080ts_tn8_p1765_data,
1175 &rm31080a_tn8_p1765_spi_board[0],
1176 ARRAY_SIZE(rm31080a_tn8_p1765_spi_board));
1178 rm31080a_ardbeg_spi_board[0].irq =
1179 gpio_to_irq(TOUCH_GPIO_IRQ_RAYDIUM_SPI);
1180 touch_init_raydium(TOUCH_GPIO_IRQ_RAYDIUM_SPI,
1181 TOUCH_GPIO_RST_RAYDIUM_SPI,
1182 &rm31080ts_ardbeg_data,
1183 &rm31080a_ardbeg_spi_board[0],
1184 ARRAY_SIZE(rm31080a_ardbeg_spi_board));
1190 static void __init ardbeg_sysedp_init(void)
1192 struct board_info bi;
1194 tegra_get_board_info(&bi);
1196 switch (bi.board_id) {
1198 if (bi.sku == 1100) {
1199 tn8_new_sysedp_init();
1202 shield_new_sysedp_init();
1209 tn8_new_sysedp_init();
1220 static void __init ardbeg_sysedp_dynamic_capping_init(void)
1222 struct board_info bi;
1224 tegra_get_board_info(&bi);
1226 switch (bi.board_id) {
1229 tn8_sysedp_dynamic_capping_init();
1231 shield_sysedp_dynamic_capping_init();
1238 tn8_sysedp_dynamic_capping_init();
1249 static void __init ardbeg_sysedp_batmon_init(void)
1251 struct board_info bi;
1253 if (!IS_ENABLED(CONFIG_SYSEDP_FRAMEWORK))
1256 tegra_get_board_info(&bi);
1258 switch (bi.board_id) {
1261 shield_sysedp_batmon_init();
1274 static void __init edp_init(void)
1276 struct board_info bi;
1278 tegra_get_board_info(&bi);
1280 switch (bi.board_id) {
1306 static void __init tegra_ardbeg_early_init(void)
1308 ardbeg_sysedp_init();
1309 tegra_clk_init_from_table(ardbeg_clk_init_table);
1310 tegra_clk_verify_parents();
1311 if (of_machine_is_compatible("nvidia,jetson-tk1"))
1312 tegra_soc_device_init("jetson-tk1");
1313 else if (of_machine_is_compatible("nvidia,laguna"))
1314 tegra_soc_device_init("laguna");
1315 else if (of_machine_is_compatible("nvidia,tn8"))
1316 tegra_soc_device_init("tn8");
1317 else if (of_machine_is_compatible("nvidia,ardbeg_sata"))
1318 tegra_soc_device_init("ardbeg_sata");
1319 else if (of_machine_is_compatible("nvidia,norrin"))
1320 tegra_soc_device_init("norrin");
1321 else if (of_machine_is_compatible("nvidia,bowmore"))
1322 tegra_soc_device_init("bowmore");
1323 else if (of_machine_is_compatible("nvidia,t132loki"))
1324 tegra_soc_device_init("t132loki");
1326 tegra_soc_device_init("ardbeg");
1329 static struct tegra_dtv_platform_data ardbeg_dtv_pdata = {
1330 .dma_req_selector = 11,
1333 static void __init ardbeg_dtv_init(void)
1335 tegra_dtv_device.dev.platform_data = &ardbeg_dtv_pdata;
1336 platform_device_register(&tegra_dtv_device);
1339 static struct tegra_io_dpd pexbias_io = {
1341 .io_dpd_reg_index = 0,
1344 static struct tegra_io_dpd pexclk1_io = {
1346 .io_dpd_reg_index = 0,
1349 static struct tegra_io_dpd pexclk2_io = {
1351 .io_dpd_reg_index = 0,
1355 static void __init tegra_ardbeg_late_init(void)
1357 struct board_info board_info;
1358 tegra_get_board_info(&board_info);
1359 pr_info("board_info: id:sku:fab:major:minor = 0x%04x:0x%04x:0x%02x:0x%02x:0x%02x\n",
1360 board_info.board_id, board_info.sku,
1361 board_info.fab, board_info.major_revision,
1362 board_info.minor_revision);
1364 if (board_info.board_id == BOARD_E2548 ||
1365 board_info.board_id == BOARD_P2530)
1367 #ifndef CONFIG_MACH_EXUMA
1368 ardbeg_display_init();
1372 ardbeg_modem_init();
1373 #ifdef CONFIG_TEGRA_XUSB_PLATFORM
1377 ardbeg_audio_init();
1378 platform_add_devices(ardbeg_devices, ARRAY_SIZE(ardbeg_devices));
1379 if (board_info.board_id == BOARD_PM374) /* Norrin ERS */
1380 platform_device_register(&norrin_audio_device_max98090);
1381 else if (board_info.board_id != BOARD_PM359)
1382 platform_device_register(&ardbeg_audio_device_rt5639);
1383 tegra_io_dpd_init();
1384 if (board_info.board_id == BOARD_E2548 ||
1385 board_info.board_id == BOARD_P2530)
1388 ardbeg_sdhci_init();
1390 if (board_info.board_id == BOARD_PM359 ||
1391 board_info.board_id == BOARD_PM358 ||
1392 board_info.board_id == BOARD_PM370 ||
1393 board_info.board_id == BOARD_PM375 ||
1394 board_info.board_id == BOARD_PM377 ||
1395 board_info.board_id == BOARD_PM363)
1396 laguna_regulator_init();
1397 else if (board_info.board_id == BOARD_PM374)
1398 norrin_regulator_init();
1399 else if (board_info.board_id == BOARD_E2548 ||
1400 board_info.board_id == BOARD_P2530)
1401 loki_regulator_init();
1403 ardbeg_regulator_init();
1405 ardbeg_suspend_init();
1407 if ((board_info.board_id == BOARD_PM374) ||
1408 (board_info.board_id == BOARD_E1971) ||
1409 (board_info.board_id == BOARD_E1973))
1411 else if (board_info.board_id == BOARD_E2548 ||
1412 board_info.board_id == BOARD_P2530)
1419 ardbeg_touch_init();
1420 if (board_info.board_id == BOARD_E2548 ||
1421 board_info.board_id == BOARD_P2530)
1424 ardbeg_panel_init();
1426 /* put PEX pads into DPD mode to save additional power */
1427 tegra_io_dpd_enable(&pexbias_io);
1428 tegra_io_dpd_enable(&pexclk1_io);
1429 tegra_io_dpd_enable(&pexclk2_io);
1431 if (board_info.board_id == BOARD_E2548 ||
1432 board_info.board_id == BOARD_P2530)
1435 #ifdef CONFIG_TEGRA_WDT_RECOVERY
1436 tegra_wdt_recovery_init();
1440 if (board_info.board_id == BOARD_PM374 ||
1441 board_info.board_id == BOARD_PM359 ||
1442 board_info.board_id == BOARD_PM358 ||
1443 board_info.board_id == BOARD_PM370 ||
1444 board_info.board_id == BOARD_PM375 ||
1445 board_info.board_id == BOARD_PM377 ||
1446 board_info.board_id == BOARD_PM363) {
1447 ardbeg_sensors_init();
1448 norrin_soctherm_init();
1449 } else if (board_info.board_id == BOARD_E2548 ||
1450 board_info.board_id == BOARD_P2530) {
1451 loki_sensors_init();
1453 loki_soctherm_init();
1455 ardbeg_sensors_init();
1456 ardbeg_soctherm_init();
1459 ardbeg_setup_bluedroid_pm();
1460 ardbeg_sysedp_dynamic_capping_init();
1461 ardbeg_sysedp_batmon_init();
1464 static void __init tegra_ardbeg_init_early(void)
1466 tegra_get_board_info(&board_info);
1467 if (board_info.board_id == BOARD_E2548 ||
1468 board_info.board_id == BOARD_P2530)
1469 loki_rail_alignment_init();
1471 ardbeg_rail_alignment_init();
1472 tegra12x_init_early();
1475 static void __init tegra_ardbeg_dt_init(void)
1477 tegra_get_board_info(&board_info);
1478 tegra_get_display_board_info(&display_board_info);
1480 tegra_ardbeg_early_init();
1481 #ifdef CONFIG_NVMAP_USE_CMA_FOR_CARVEOUT
1482 carveout_linear_set(&tegra_generic_cma_dev);
1483 carveout_linear_set(&tegra_vpr_cma_dev);
1485 #ifdef CONFIG_USE_OF
1486 ardbeg_camera_auxdata(ardbeg_auxdata_lookup);
1487 of_platform_populate(NULL,
1488 of_default_bus_match_table, ardbeg_auxdata_lookup,
1491 tegra_get_board_info(&board_info);
1492 pr_info("board_info: id:sku:fab:major:minor = 0x%04x:0x%04x:0x%02x:0x%02x:0x%02x\n",
1493 board_info.board_id, board_info.sku,
1494 board_info.fab, board_info.major_revision,
1495 board_info.minor_revision);
1497 tegra_ardbeg_late_init();
1500 static void __init tegra_ardbeg_reserve(void)
1502 #ifdef CONFIG_TEGRA_HDMI_PRIMARY
1504 #endif /* CONFIG_TEGRA_HDMI_PRIMARY */
1506 #if defined(CONFIG_NVMAP_CONVERT_CARVEOUT_TO_IOVMM) || \
1507 defined(CONFIG_TEGRA_NO_CARVEOUT)
1508 ulong carveout_size = 0;
1509 ulong fb2_size = SZ_16M;
1511 ulong carveout_size = SZ_1G;
1512 ulong fb2_size = SZ_4M;
1514 ulong fb1_size = SZ_16M + SZ_2M;
1515 ulong vpr_size = 186 * SZ_1M;
1517 #ifdef CONFIG_FRAMEBUFFER_CONSOLE
1518 /* support FBcon on 4K monitors */
1519 fb2_size = SZ_64M + SZ_8M; /* 4096*2160*4*2 = 70778880 bytes */
1520 #endif /* CONFIG_FRAMEBUFFER_CONSOLE */
1522 #ifdef CONFIG_TEGRA_HDMI_PRIMARY
1524 fb1_size = fb2_size;
1526 #endif /* CONFIG_TEGRA_HDMI_PRIMARY */
1528 tegra_reserve4(carveout_size, fb1_size, fb2_size, vpr_size);
1531 static const char * const ardbeg_dt_board_compat[] = {
1536 static const char * const laguna_dt_board_compat[] = {
1541 static const char * const tn8_dt_board_compat[] = {
1546 static const char * const ardbeg_sata_dt_board_compat[] = {
1547 "nvidia,ardbeg_sata",
1551 static const char * const norrin_dt_board_compat[] = {
1556 static const char * const bowmore_dt_board_compat[] = {
1561 static const char * const loki_dt_board_compat[] = {
1566 static const char * const jetson_dt_board_compat[] = {
1567 "nvidia,jetson-tk1",
1571 #ifdef CONFIG_ARCH_TEGRA_13x_SOC
1572 DT_MACHINE_START(LOKI, "t132loki")
1573 .atag_offset = 0x100,
1574 .smp = smp_ops(tegra_smp_ops),
1575 .map_io = tegra_map_common_io,
1576 .reserve = tegra_ardbeg_reserve,
1577 .init_early = tegra_ardbeg_init_early,
1578 .init_irq = irqchip_init,
1579 .init_time = clocksource_of_init,
1580 .init_machine = tegra_ardbeg_dt_init,
1581 .restart = tegra_assert_system_reset,
1582 .dt_compat = loki_dt_board_compat,
1583 .init_late = tegra_init_late
1587 DT_MACHINE_START(LAGUNA, "laguna")
1588 .atag_offset = 0x100,
1589 .smp = smp_ops(tegra_smp_ops),
1590 .map_io = tegra_map_common_io,
1591 .reserve = tegra_ardbeg_reserve,
1592 .init_early = tegra_ardbeg_init_early,
1593 .init_irq = irqchip_init,
1594 .init_time = clocksource_of_init,
1595 .init_machine = tegra_ardbeg_dt_init,
1596 .restart = tegra_assert_system_reset,
1597 .dt_compat = laguna_dt_board_compat,
1598 .init_late = tegra_init_late
1601 DT_MACHINE_START(TN8, "tn8")
1602 .atag_offset = 0x100,
1603 .smp = smp_ops(tegra_smp_ops),
1604 .map_io = tegra_map_common_io,
1605 .reserve = tegra_ardbeg_reserve,
1606 .init_early = tegra_ardbeg_init_early,
1607 .init_irq = irqchip_init,
1608 .init_time = clocksource_of_init,
1609 .init_machine = tegra_ardbeg_dt_init,
1610 .restart = tegra_assert_system_reset,
1611 .dt_compat = tn8_dt_board_compat,
1612 .init_late = tegra_init_late
1615 DT_MACHINE_START(NORRIN, "norrin")
1616 .atag_offset = 0x100,
1617 .smp = smp_ops(tegra_smp_ops),
1618 .map_io = tegra_map_common_io,
1619 .reserve = tegra_ardbeg_reserve,
1620 .init_early = tegra_ardbeg_init_early,
1621 .init_irq = irqchip_init,
1622 .init_time = clocksource_of_init,
1623 .init_machine = tegra_ardbeg_dt_init,
1624 .restart = tegra_assert_system_reset,
1625 .dt_compat = norrin_dt_board_compat,
1626 .init_late = tegra_init_late
1629 DT_MACHINE_START(BOWMORE, "bowmore")
1630 .atag_offset = 0x100,
1631 .smp = smp_ops(tegra_smp_ops),
1632 .map_io = tegra_map_common_io,
1633 .reserve = tegra_ardbeg_reserve,
1634 .init_early = tegra_ardbeg_init_early,
1635 .init_irq = irqchip_init,
1636 .init_time = clocksource_of_init,
1637 .init_machine = tegra_ardbeg_dt_init,
1638 .restart = tegra_assert_system_reset,
1639 .dt_compat = bowmore_dt_board_compat,
1640 .init_late = tegra_init_late
1643 DT_MACHINE_START(ARDBEG, "ardbeg")
1644 .atag_offset = 0x100,
1645 .smp = smp_ops(tegra_smp_ops),
1646 .map_io = tegra_map_common_io,
1647 .reserve = tegra_ardbeg_reserve,
1648 .init_early = tegra_ardbeg_init_early,
1649 .init_irq = irqchip_init,
1650 .init_time = clocksource_of_init,
1651 .init_machine = tegra_ardbeg_dt_init,
1652 .restart = tegra_assert_system_reset,
1653 .dt_compat = ardbeg_dt_board_compat,
1654 .init_late = tegra_init_late
1657 DT_MACHINE_START(ARDBEG_SATA, "ardbeg_sata")
1658 .atag_offset = 0x100,
1659 .smp = smp_ops(tegra_smp_ops),
1660 .map_io = tegra_map_common_io,
1661 .reserve = tegra_ardbeg_reserve,
1662 .init_early = tegra_ardbeg_init_early,
1663 .init_irq = irqchip_init,
1664 .init_time = clocksource_of_init,
1665 .init_machine = tegra_ardbeg_dt_init,
1666 .restart = tegra_assert_system_reset,
1667 .dt_compat = ardbeg_sata_dt_board_compat,
1668 .init_late = tegra_init_late
1672 DT_MACHINE_START(JETSON_TK1, "jetson-tk1")
1673 .atag_offset = 0x100,
1674 .smp = smp_ops(tegra_smp_ops),
1675 .map_io = tegra_map_common_io,
1676 .reserve = tegra_ardbeg_reserve,
1677 .init_early = tegra_ardbeg_init_early,
1678 .init_irq = irqchip_init,
1679 .init_time = clocksource_of_init,
1680 .init_machine = tegra_ardbeg_dt_init,
1681 .restart = tegra_assert_system_reset,
1682 .dt_compat = jetson_dt_board_compat,
1683 .init_late = tegra_init_late