/*
* arch/arm/mach-tegra/board-pluto.c
*
- * Copyright (c) 2012-2013, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2012-2013, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
#include <linux/gpio.h>
#include <linux/input.h>
#include <linux/platform_data/tegra_usb.h>
-#include <linux/platform_data/tegra_xusb.h>
#include <linux/spi/spi.h>
#include <linux/spi/rm31080a_ts.h>
-#include <linux/tegra_uart.h>
+#include <linux/platform_data/serial-tegra.h>
#include <linux/memblock.h>
#include <linux/spi/spi-tegra.h>
#include <linux/nfc/pn544.h>
#include <linux/mfd/max8831.h>
#include <linux/of_platform.h>
#include <linux/a2220.h>
-#include <linux/edp.h>
#include <linux/mfd/tlv320aic3262-registers.h>
#include <linux/mfd/tlv320aic3xxx-core.h>
#include <linux/usb/tegra_usb_phy.h>
+#include <linux/clk/tegra.h>
+#include <linux/clocksource.h>
+#include <linux/irqchip.h>
-#include <asm/hardware/gic.h>
-
-#include <mach/clk.h>
#include <mach/irqs.h>
#include <mach/pinmux.h>
#include <mach/pinmux-t11.h>
#include <mach/tegra-bb-power.h>
#include <mach/tegra_wakeup_monitor.h>
#include <linux/platform_data/tegra_usb_modem_power.h>
+#include <mach/xusb.h>
#include "board.h"
#include "board-common.h"
{ "sbc5", "pll_p", 25000000, false},
{ "sbc6", "pll_p", 25000000, false},
{ "extern3", "clk_m", 12000000, false},
+ { "dsia", "pll_d2_out0", 0, false},
+ { "uarta", "pll_p", 408000000, false},
+ { "uartb", "pll_p", 408000000, false},
+ { "uartc", "pll_p", 408000000, false},
+ { "uartd", "pll_p", 408000000, false},
{ NULL, NULL, 0, 0},
};
platform_device_register(&tegra11_i2c_device5);
platform_device_register(&tegra11_i2c_device4);
+#ifndef CONFIG_OF
platform_device_register(&tegra11_i2c_device3);
+#endif
platform_device_register(&tegra11_i2c_device2);
platform_device_register(&tegra11_i2c_device1);
-
- i2c_register_board_info(0, &pluto_codec_a2220_info, 1);
- i2c_register_board_info(0, &cs42l73_board_info, 1);
- i2c_register_board_info(0, &pluto_codec_aic326x_info, 1);
pluto_i2c_bus3_board_info[0].irq = gpio_to_irq(TEGRA_GPIO_PW2);
i2c_register_board_info(0, pluto_i2c_bus3_board_info, 1);
i2c_register_board_info(0, &pluto_codec_aic326x_info, 1);
+ i2c_register_board_info(0, &pluto_codec_a2220_info, 1);
+ i2c_register_board_info(0, &cs42l73_board_info, 1);
}
-static struct platform_device *pluto_uart_devices[] __initdata = {
- &tegra_uarta_device,
- &tegra_uartb_device,
- &tegra_uartc_device,
- &tegra_uartd_device,
-};
-static struct uart_clk_parent uart_parent_clk[] = {
- [0] = {.name = "clk_m"},
- [1] = {.name = "pll_p"},
-#ifndef CONFIG_TEGRA_PLLM_RESTRICTED
- [2] = {.name = "pll_m"},
-#endif
+static struct tegra_serial_platform_data pluto_uartd_pdata = {
+ .dma_req_selector = 19,
+ .modem_interrupt = false,
};
-static struct tegra_uart_platform_data pluto_uart_pdata;
-static struct tegra_uart_platform_data pluto_loopback_uart_pdata;
-
-static void __init uart_debug_init(void)
+static void __init pluto_uart_init(void)
{
int debug_port_id;
- debug_port_id = uart_console_debug_init(3);
- if (debug_port_id < 0)
- return;
- pluto_uart_devices[debug_port_id] = uart_console_debug_device;
-}
+ /* Register low speed only if it is selected */
+ if (!is_tegra_debug_uartport_hs()) {
+ debug_port_id = uart_console_debug_init(3);
+ if (debug_port_id < 0)
+ return;
-static void __init pluto_uart_init(void)
-{
- struct clk *c;
- int i;
-
- for (i = 0; i < ARRAY_SIZE(uart_parent_clk); ++i) {
- c = tegra_get_clock_by_name(uart_parent_clk[i].name);
- if (IS_ERR_OR_NULL(c)) {
- pr_err("Not able to get the clock for %s\n",
- uart_parent_clk[i].name);
- continue;
- }
- uart_parent_clk[i].parent_clk = c;
- uart_parent_clk[i].fixed_clk_rate = clk_get_rate(c);
- }
- pluto_uart_pdata.parent_clk_list = uart_parent_clk;
- pluto_uart_pdata.parent_clk_count = ARRAY_SIZE(uart_parent_clk);
- pluto_loopback_uart_pdata.parent_clk_list = uart_parent_clk;
- pluto_loopback_uart_pdata.parent_clk_count =
- ARRAY_SIZE(uart_parent_clk);
- pluto_loopback_uart_pdata.is_loopback = true;
- tegra_uarta_device.dev.platform_data = &pluto_uart_pdata;
- tegra_uartb_device.dev.platform_data = &pluto_uart_pdata;
- tegra_uartc_device.dev.platform_data = &pluto_uart_pdata;
- tegra_uartd_device.dev.platform_data = &pluto_uart_pdata;
+ platform_device_register(uart_console_debug_device);
- /* Register low speed only if it is selected */
- if (!is_tegra_debug_uartport_hs())
- uart_debug_init();
+ } else {
+ tegra_uartd_device.dev.platform_data = &pluto_uartd_pdata;
+ platform_device_register(&tegra_uartd_device);
+ }
- platform_add_devices(pluto_uart_devices,
- ARRAY_SIZE(pluto_uart_devices));
}
static struct resource tegra_rtc_resources[] = {
.edp_states = {1776, 888, 0},
.i2s_param[HIFI_CODEC] = {
.audio_port_id = 1,
- .is_i2s_master = 1,
+ .is_i2s_master = 0,
.i2s_mode = TEGRA_DAIFMT_I2S,
.sample_size = 16,
.rate = 48000,
&tegra_i2s_device4,
&tegra_spdif_device,
&spdif_dit_device,
+ &pluto_audio_aic326x_device,
&bluetooth_dit_device,
&baseband_dit_device,
#if defined(CONFIG_TEGRA_WAKEUP_MONITOR)
&pluto_tegra_wakeup_monitor_device,
#endif
&pluto_audio_device,
- &pluto_audio_aic326x_device,
&tegra_hda_device,
#if defined(CONFIG_CRYPTO_DEV_TEGRA_AES)
&tegra_aes_device,
static struct tegra_usb_platform_data tegra_udc_pdata = {
.port_otg = true,
.has_hostpc = true,
- .id_det_type = TEGRA_USB_VIRTUAL_ID,
+ .id_det_type = TEGRA_USB_PMU_ID,
+ .unaligned_dma_buf_supported = false,
.phy_intf = TEGRA_USB_PHY_INTF_UTMI,
.op_mode = TEGRA_USB_OPMODE_DEVICE,
.u_data.dev = {
.idle_wait_delay = 17,
.term_range_adj = 6,
.xcvr_setup = 8,
- .xcvr_lsfslew = 2,
- .xcvr_lsrslew = 2,
+ .xcvr_lsfslew = 0,
+ .xcvr_lsrslew = 3,
.xcvr_setup_offset = 0,
.xcvr_use_fuses = 1,
},
static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
.port_otg = true,
.has_hostpc = true,
- .id_det_type = TEGRA_USB_VIRTUAL_ID,
+ .id_det_type = TEGRA_USB_PMU_ID,
.unaligned_dma_buf_supported = false,
.phy_intf = TEGRA_USB_PHY_INTF_UTMI,
.op_mode = TEGRA_USB_OPMODE_HOST,
.idle_wait_delay = 17,
.term_range_adj = 6,
.xcvr_setup = 15,
- .xcvr_lsfslew = 2,
- .xcvr_lsrslew = 2,
+ .xcvr_lsfslew = 0,
+ .xcvr_lsrslew = 3,
.xcvr_setup_offset = 0,
.xcvr_use_fuses = 1,
.vbus_oc_map = 0x7,
static struct tegra_usb_otg_data tegra_otg_pdata = {
.ehci_device = &tegra_ehci1_device,
.ehci_pdata = &tegra_ehci1_utmi_pdata,
+ .id_extcon_dev_name = "MAX77665_MUIC_ID",
};
static struct regulator *baseband_reg;
}
baseband_reg = regulator_get(NULL, "vdd_core_bb");
- if (IS_ERR_OR_NULL(baseband_reg))
+ if (IS_ERR(baseband_reg))
pr_warn("%s: baseband regulator get failed\n", __func__);
- else
- regulator_enable(baseband_reg);
+ else {
+ if (regulator_enable(baseband_reg) != 0)
+ pr_warn("baseband regulator enable failed\n");
+ }
/* enable pull-up for MDM1 UART RX */
tegra_pinmux_set_pullupdown(TEGRA_PINGROUP_GPIO_PU1,
.ops = &baseband_operations,
.wake_gpio = -1,
.boot_gpio = MDM_COLDBOOT,
- .boot_irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+ .boot_irq_flags = IRQF_TRIGGER_RISING |
+ IRQF_TRIGGER_FALLING |
+ IRQF_ONESHOT,
.autosuspend_delay = 2000,
.short_autosuspend_delay = 50,
.tegra_ehci_device = &tegra_ehci2_device,
int usb_port_owner_info = tegra_get_usb_port_owner_info();
if (!(usb_port_owner_info & UTMI1_PORT_OWNER_XUSB)) {
- tegra_otg_device.dev.platform_data = &tegra_otg_pdata;
- platform_device_register(&tegra_otg_device);
-
- /* Setup the udc platform data */
- tegra_udc_device.dev.platform_data = &tegra_udc_pdata;
+ tegra_otg_pdata.is_xhci = false;
+ tegra_udc_pdata.u_data.dev.is_xhci = false;
+ } else {
+ tegra_otg_pdata.is_xhci = true;
+ tegra_udc_pdata.u_data.dev.is_xhci = true;
}
+ tegra_otg_device.dev.platform_data = &tegra_otg_pdata;
+ platform_device_register(&tegra_otg_device);
+
+ /* Setup the udc platform data */
+ tegra_udc_device.dev.platform_data = &tegra_udc_pdata;
}
static void pluto_modem_init(void)
}
}
-static struct tegra_xusb_pad_data xusb_padctl_data = {
- .pad_mux = (0x1 << 0),
- .port_cap = (0x1 << 0),
- .snps_oc_map = (0x1ff << 0),
- .usb2_oc_map = (0x3c << 0),
- .ss_port_map = (0x1 << 0),
- .oc_det = (0x3f << 10),
- .rx_wander = (0xf << 4),
- .rx_eq = (0x3070 << 8),
- .cdr_cntl = (0x26 << 24),
- .dfe_cntl = 0x002008EE,
- .hs_slew = (0xE << 6),
- .ls_rslew = (0x3 << 14),
- .otg_pad0_ctl0 = (0x0 << 19),
- .otg_pad1_ctl0 = (0x7 << 19),
- .otg_pad0_ctl1 = (0x3 << 0),
- .otg_pad1_ctl1 = (0x4 << 0),
- .hs_disc_lvl = (0x5 << 2),
- .hsic_pad0_ctl0 = (0x00 << 8),
- .hsic_pad0_ctl1 = (0x00 << 8),
+static struct tegra_xusb_board_data xusb_bdata = {
+ .portmap = TEGRA_XUSB_SS_P0 | TEGRA_XUSB_USB2_P0,
+ /* ss_portmap[0:3] = SS0 map, ss_portmap[4:7] = SS1 map */
+ .ss_portmap = (TEGRA_XUSB_SS_PORT_MAP_USB2_P0 << 0),
+ .uses_external_pmic = true,
+ .supply = {
+ .utmi_vbuses = {
+ NULL, "usb_vbus", NULL
+ },
+ .s3p3v = "hvdd_usb",
+ .s1p8v = "avdd_usb_pll",
+ .vddio_hsic = "vddio_hsic",
+ .s1p05v = "avddio_usb",
+ },
};
static void pluto_xusb_init(void)
{
int usb_port_owner_info = tegra_get_usb_port_owner_info();
- if (usb_port_owner_info & UTMI1_PORT_OWNER_XUSB) {
- u32 usb_calib0 = tegra_fuse_readl(FUSE_SKU_USB_CALIB_0);
-
- pr_info("dalmore_xusb_init: usb_calib0 = 0x%08x\n", usb_calib0);
- /*
- * read from usb_calib0 and pass to driver
- * set HS_CURR_LEVEL (PAD0) = usb_calib0[5:0]
- * set TERM_RANGE_ADJ = usb_calib0[10:7]
- * set HS_SQUELCH_LEVEL = usb_calib0[12:11]
- * set HS_IREF_CAP = usb_calib0[14:13]
- * set HS_CURR_LEVEL (PAD1) = usb_calib0[20:15]
- */
-
- xusb_padctl_data.hs_curr_level_pad0 = (usb_calib0 >> 0) & 0x3f;
- xusb_padctl_data.hs_term_range_adj = (usb_calib0 >> 7) & 0xf;
- xusb_padctl_data.hs_squelch_level = (usb_calib0 >> 11) & 0x3;
- xusb_padctl_data.hs_iref_cap = (usb_calib0 >> 13) & 0x3;
- xusb_padctl_data.hs_curr_level_pad1 = (usb_calib0 >> 15) & 0x3f;
-
- tegra_xhci_device.dev.platform_data = &xusb_padctl_data;
- platform_device_register(&tegra_xhci_device);
- }
+ if (usb_port_owner_info & UTMI1_PORT_OWNER_XUSB)
+ tegra_xusb_init(&xusb_bdata);
}
#else
static void pluto_usb_init(void) { }
static int __init pluto_touch_init(void)
{
tegra_clk_init_from_table(touch_clk_init_table);
- if (tegra_get_touch_id() == RAYDIUM_TOUCH) {
+ if (tegra_get_touch_vendor_id() == RAYDIUM_TOUCH) {
pr_info("%s: initializing raydium\n", __func__);
rm31080a_pluto_spi_board[0].irq =
gpio_to_irq(TOUCH_GPIO_IRQ_RAYDIUM_SPI);
return 0;
}
-#ifdef CONFIG_EDP_FRAMEWORK
-static struct edp_manager battery_edp_manager = {
- .name = "battery",
- .max = 20000
-};
-
-static void __init pluto_battery_edp_init(void)
-{
- struct edp_governor *g;
- int r;
-
- r = edp_register_manager(&battery_edp_manager);
- if (r)
- goto err_ret;
-
- /* start with priority governor */
- g = edp_get_governor("priority");
- if (!g) {
- r = -EFAULT;
- goto err_ret;
- }
-
- r = edp_set_governor(&battery_edp_manager, g);
- if (r)
- goto err_ret;
-
- return;
-
-err_ret:
- pr_err("Battery EDP init failed with error %d\n", r);
- WARN_ON(1);
-}
-#else
-static inline void pluto_battery_edp_init(void) {}
-#endif
-
#ifdef CONFIG_USE_OF
struct of_dev_auxdata pluto_auxdata_lookup[] __initdata = {
- OF_DEV_AUXDATA("nvidia,tegra114-apbdma", 0x6000a000, "tegra-dma", NULL),
+ OF_DEV_AUXDATA("nvidia,tegra114-apbdma", 0x6000a000, "tegra-apbdma",
+ NULL),
OF_DEV_AUXDATA("nvidia,tegra114-sdhci", 0x78000600, "sdhci-tegra.3",
NULL),
OF_DEV_AUXDATA("nvidia,tegra114-sdhci", 0x78000400, "sdhci-tegra.2",
NULL),
OF_DEV_AUXDATA("nvidia,tegra114-spi", 0x7000de00, "spi-tegra114.5",
NULL),
+ OF_DEV_AUXDATA("nvidia,tegra114-kbc", 0x7000e200, "tegra-kbc",
+ NULL),
+ OF_DEV_AUXDATA("nvidia,tegra114-hsuart", 0x70006000, "serial-tegra.0",
+ NULL),
+ OF_DEV_AUXDATA("nvidia,tegra114-hsuart", 0x70006040, "serial-tegra.1",
+ NULL),
+ OF_DEV_AUXDATA("nvidia,tegra114-hsuart", 0x70006200, "serial-tegra.2",
+ NULL),
+ OF_DEV_AUXDATA("nvidia,tegra114-pwm", TEGRA_PWFM_BASE, "tegra-pwm",
+ NULL),
+ OF_DEV_AUXDATA("pwm-backlight", NULL, "pwm-backlight",
+ NULL),
{}
};
#endif
+static void __init pluto_dtv_init(void)
+{
+ platform_device_register(&tegra_dtv_device);
+}
+
static void __init tegra_pluto_early_init(void)
{
- pluto_battery_edp_init();
+ pluto_sysedp_init();
tegra_clk_init_from_table(pluto_clk_init_table);
tegra_clk_verify_parents();
tegra_soc_device_init("tegra_pluto");
tegra_io_dpd_init();
pluto_sdhci_init();
pluto_regulator_init();
+ pluto_dtv_init();
pluto_suspend_init();
pluto_touch_init();
pluto_emc_init();
#elif defined CONFIG_BLUEDROID_PM
pluto_setup_bluedroid_pm();
#endif
- tegra_release_bootloader_fb();
pluto_modem_init();
#ifdef CONFIG_TEGRA_WDT_RECOVERY
tegra_wdt_recovery_init();
tegra_serial_debug_init(TEGRA_UARTD_BASE, INT_WDT_CPU, NULL, -1, -1);
pluto_soctherm_init();
tegra_register_fuse();
+ pluto_sysedp_core_init();
+ pluto_sysedp_psydepl_init();
}
static void __init pluto_ramconsole_reserve(unsigned long size)
.map_io = tegra_map_common_io,
.reserve = tegra_pluto_reserve,
.init_early = tegra11x_init_early,
- .init_irq = tegra_dt_init_irq,
- .handle_irq = gic_handle_irq,
- .timer = &tegra_sys_timer,
+ .init_irq = irqchip_init,
+ .init_time = clocksource_of_init,
.init_machine = tegra_pluto_dt_init,
.restart = tegra_assert_system_reset,
.dt_compat = pluto_dt_board_compat,
+ .init_late = tegra_init_late
MACHINE_END