Add ram console device to cardhu
[linux-2.6.git] / arch / arm / mach-tegra / board-cardhu.c
index d27bde7..b576a23 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * arch/arm/mach-tegra/board-cardhu.c
  *
- * Copyright (c) 2011, NVIDIA Corporation.
+ * Copyright (c) 2011-2012, NVIDIA Corporation.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 #include <linux/spi/spi.h>
 #include <linux/i2c/atmel_mxt_ts.h>
 #include <linux/tegra_uart.h>
+#include <linux/memblock.h>
 #include <linux/spi-tegra.h>
+#include <linux/nfc/pn544.h>
 
 #include <sound/wm8903.h>
+#include <sound/max98095.h>
+#include <media/tegra_dtv.h>
 
 #include <mach/clk.h>
 #include <mach/iomap.h>
 #include <mach/iomap.h>
 #include <mach/io.h>
 #include <mach/i2s.h>
+#include <mach/tegra_asoc_pdata.h>
 #include <mach/tegra_wm8903_pdata.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <mach/usb_phy.h>
+#include <mach/thermal.h>
+#include <mach/pci.h>
 
 #include "board.h"
 #include "clock.h"
 #include "fuse.h"
 #include "pm.h"
 #include "baseband-xmm-power.h"
+#include "wdt-recovery.h"
 
+static unsigned long ramconsole_start;
+static unsigned long ramconsole_size;
+
+/* All units are in millicelsius */
+static struct tegra_thermal_data thermal_data = {
+       .temp_throttle = 85000,
+       .temp_shutdown = 90000,
+       .temp_offset = TDIODE_OFFSET, /* temps based on tdiode */
+#ifdef CONFIG_TEGRA_EDP_LIMITS
+       .edp_offset = TDIODE_OFFSET,  /* edp based on tdiode */
+       .hysteresis_edp = 3000,
+#endif
+#ifdef CONFIG_TEGRA_THERMAL_SYSFS
+       .tc1 = 0,
+       .tc2 = 1,
+       .passive_delay = 2000,
+#else
+       .hysteresis_throttle = 1000,
+#endif
+};
 
 /* !!!TODO: Change for cardhu (Taken from Ventana) */
 static struct tegra_utmip_config utmi_phy_config[] = {
@@ -185,16 +213,43 @@ static inline void tegra_setup_bluesleep(void) { }
 
 static __initdata struct tegra_clk_init_table cardhu_clk_init_table[] = {
        /* name         parent          rate            enabled */
-       { "pll_m",      NULL,           0,              true},
+       { "pll_m",      NULL,           0,              false},
        { "hda",        "pll_p",        108000000,      false},
        { "hda2codec_2x","pll_p",       48000000,       false},
        { "pwm",        "pll_p",        3187500,        false},
        { "blink",      "clk_32k",      32768,          true},
+       { "i2s0",       "pll_a_out0",   0,              false},
        { "i2s1",       "pll_a_out0",   0,              false},
+       { "i2s3",       "pll_a_out0",   0,              false},
+       { "spdif_out",  "pll_a_out0",   0,              false},
+       { "d_audio",    "clk_m",        12000000,       false},
+       { "dam0",       "clk_m",        12000000,       false},
+       { "dam1",       "clk_m",        12000000,       false},
+       { "dam2",       "clk_m",        12000000,       false},
+       { "audio1",     "i2s1_sync",    0,              false},
+       { "audio3",     "i2s3_sync",    0,              false},
        { "vi_sensor",  "pll_p",        150000000,      false},
+       { "i2c1",       "pll_p",        3200000,        false},
+       { "i2c2",       "pll_p",        3200000,        false},
+       { "i2c3",       "pll_p",        3200000,        false},
+       { "i2c4",       "pll_p",        3200000,        false},
+       { "i2c5",       "pll_p",        3200000,        false},
        { NULL,         NULL,           0,              0},
 };
 
+static struct pn544_i2c_platform_data nfc_pdata = {
+       .irq_gpio = TEGRA_GPIO_PX0,
+       .ven_gpio = TEGRA_GPIO_PP3,
+       .firm_gpio = TEGRA_GPIO_PO7,
+       };
+
+static struct i2c_board_info __initdata cardhu_i2c_bus3_board_info[] = {
+       {
+               I2C_BOARD_INFO("pn544", 0x28),
+               .platform_data = &nfc_pdata,
+               .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_PX0),
+       },
+};
 static struct tegra_i2c_platform_data cardhu_i2c1_platform_data = {
        .adapter_nr     = 0,
        .bus_count      = 1,
@@ -256,18 +311,121 @@ static struct wm8903_platform_data cardhu_wm8903_pdata = {
        .micdet_delay = 100,
        .gpio_base = CARDHU_GPIO_WM8903(0),
        .gpio_cfg = {
-               WM8903_GPIO_NO_CONFIG,
-               WM8903_GPIO_NO_CONFIG,
+               (WM8903_GPn_FN_DMIC_LR_CLK_OUTPUT << WM8903_GP1_FN_SHIFT),
+               (WM8903_GPn_FN_DMIC_LR_CLK_OUTPUT << WM8903_GP2_FN_SHIFT) |
+                       WM8903_GP2_DIR,
                0,
                WM8903_GPIO_NO_CONFIG,
                WM8903_GPIO_NO_CONFIG,
        },
 };
 
-static struct i2c_board_info __initdata wm8903_board_info = {
+/* Equalizer filter coefs generated from the MAXIM MAX98095
+ * evkit software tool */
+static struct max98095_eq_cfg max98095_eq_cfg[] = {
+       {
+               .name = "FLAT",
+               .rate = 44100,
+               .band1 = {0x2000, 0xC002, 0x4000, 0x00E9, 0x0000},
+               .band2 = {0x2000, 0xC00F, 0x4000, 0x02BC, 0x0000},
+               .band3 = {0x2000, 0xC0A7, 0x4000, 0x0916, 0x0000},
+               .band4 = {0x2000, 0xC5C2, 0x4000, 0x1A87, 0x0000},
+               .band5 = {0x2000, 0xF6B0, 0x4000, 0x3F51, 0x0000},
+       },
+       {
+               .name = "LOWPASS1K",
+               .rate = 44100,
+               .band1 = {0x205D, 0xC001, 0x3FEF, 0x002E, 0x02E0},
+               .band2 = {0x5B9A, 0xC093, 0x3AB2, 0x088B, 0x1981},
+               .band3 = {0x0D22, 0xC170, 0x26EA, 0x0D79, 0x32CF},
+               .band4 = {0x0894, 0xC612, 0x01B3, 0x1B34, 0x3FFA},
+               .band5 = {0x0815, 0x3FFF, 0xCF78, 0x0000, 0x29B7},
+       },
+       { /* BASS=-12dB, TREBLE=+9dB, Fc=5KHz */
+               .name = "HIBOOST",
+               .rate = 44100,
+               .band1 = {0x0815, 0xC001, 0x3AA4, 0x0003, 0x19A2},
+               .band2 = {0x0815, 0xC103, 0x092F, 0x0B55, 0x3F56},
+               .band3 = {0x0E0A, 0xC306, 0x1E5C, 0x136E, 0x3856},
+               .band4 = {0x2459, 0xF665, 0x0CAA, 0x3F46, 0x3EBB},
+               .band5 = {0x5BBB, 0x3FFF, 0xCEB0, 0x0000, 0x28CA},
+       },
+       { /* BASS=12dB, TREBLE=+12dB */
+               .name = "LOUD12DB",
+               .rate = 44100,
+               .band1 = {0x7FC1, 0xC001, 0x3EE8, 0x0020, 0x0BC7},
+               .band2 = {0x51E9, 0xC016, 0x3C7C, 0x033F, 0x14E9},
+               .band3 = {0x1745, 0xC12C, 0x1680, 0x0C2F, 0x3BE9},
+               .band4 = {0x4536, 0xD7E2, 0x0ED4, 0x31DD, 0x3E42},
+               .band5 = {0x7FEF, 0x3FFF, 0x0BAB, 0x0000, 0x3EED},
+       },
+       {
+               .name = "FLAT",
+               .rate = 16000,
+               .band1 = {0x2000, 0xC004, 0x4000, 0x0141, 0x0000},
+               .band2 = {0x2000, 0xC033, 0x4000, 0x0505, 0x0000},
+               .band3 = {0x2000, 0xC268, 0x4000, 0x115F, 0x0000},
+               .band4 = {0x2000, 0xDA62, 0x4000, 0x33C6, 0x0000},
+               .band5 = {0x2000, 0x4000, 0x4000, 0x0000, 0x0000},
+       },
+       {
+               .name = "LOWPASS1K",
+               .rate = 16000,
+               .band1 = {0x2000, 0xC004, 0x4000, 0x0141, 0x0000},
+               .band2 = {0x5BE8, 0xC3E0, 0x3307, 0x15ED, 0x26A0},
+               .band3 = {0x0F71, 0xD15A, 0x08B3, 0x2BD0, 0x3F67},
+               .band4 = {0x0815, 0x3FFF, 0xCF78, 0x0000, 0x29B7},
+               .band5 = {0x0815, 0x3FFF, 0xCF78, 0x0000, 0x29B7},
+       },
+       { /* BASS=-12dB, TREBLE=+9dB, Fc=2KHz */
+               .name = "HIBOOST",
+               .rate = 16000,
+               .band1 = {0x0815, 0xC001, 0x3BD2, 0x0009, 0x16BF},
+               .band2 = {0x080E, 0xC17E, 0xF653, 0x0DBD, 0x3F43},
+               .band3 = {0x0F80, 0xDF45, 0xEE33, 0x36FE, 0x3D79},
+               .band4 = {0x590B, 0x3FF0, 0xE882, 0x02BD, 0x3B87},
+               .band5 = {0x4C87, 0xF3D0, 0x063F, 0x3ED4, 0x3FB1},
+       },
+       { /* BASS=12dB, TREBLE=+12dB */
+               .name = "LOUD12DB",
+               .rate = 16000,
+               .band1 = {0x7FC1, 0xC001, 0x3D07, 0x0058, 0x1344},
+               .band2 = {0x2DA6, 0xC013, 0x3CF1, 0x02FF, 0x138B},
+               .band3 = {0x18F1, 0xC08E, 0x244D, 0x0863, 0x34B5},
+               .band4 = {0x2BE0, 0xF385, 0x04FD, 0x3EC5, 0x3FCE},
+               .band5 = {0x7FEF, 0x4000, 0x0BAB, 0x0000, 0x3EED},
+       },
+};
+
+static struct max98095_pdata cardhu_max98095_pdata = {
+       /* equalizer configuration */
+       .eq_cfg = max98095_eq_cfg,
+       .eq_cfgcnt = ARRAY_SIZE(max98095_eq_cfg),
+
+       /* Biquad filter response configuration */
+       .bq_cfg = NULL,
+       .bq_cfgcnt = 0,
+
+       /* microphone configuration */
+       .digmic_left_mode = 1,
+       .digmic_right_mode = 1,
+};
+
+static struct i2c_board_info __initdata cardhu_codec_wm8903_info = {
        I2C_BOARD_INFO("wm8903", 0x1a),
+       .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_CDC_IRQ),
        .platform_data = &cardhu_wm8903_pdata,
+};
+
+static struct i2c_board_info __initdata cardhu_codec_aic326x_info = {
+       I2C_BOARD_INFO("aic3262-codec", 0x18),
+       .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_CDC_IRQ),
+};
+
+static struct i2c_board_info __initdata cardhu_codec_max98095_info = {
+       I2C_BOARD_INFO("max98095", 0x10),
        .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_CDC_IRQ),
+       .platform_data = &cardhu_max98095_pdata,
 };
 
 static void cardhu_i2c_init(void)
@@ -284,7 +442,11 @@ static void cardhu_i2c_init(void)
        platform_device_register(&tegra_i2c_device2);
        platform_device_register(&tegra_i2c_device1);
 
-       i2c_register_board_info(4, &wm8903_board_info, 1);
+       i2c_register_board_info(4, &cardhu_codec_wm8903_info, 1);
+       i2c_register_board_info(4, &cardhu_codec_max98095_info, 1);
+       i2c_register_board_info(4, &cardhu_codec_aic326x_info, 1);
+
+       i2c_register_board_info(2, cardhu_i2c_bus3_board_info, 1);
 }
 
 static struct platform_device *cardhu_uart_devices[] __initdata = {
@@ -297,39 +459,92 @@ static struct platform_device *cardhu_uart_devices[] __initdata = {
 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_uart_platform_data cardhu_uart_pdata;
+static struct tegra_uart_platform_data cardhu_loopback_uart_pdata;
 
 static void __init uart_debug_init(void)
 {
        struct board_info board_info;
+       int debug_port_id;
 
        tegra_get_board_info(&board_info);
-       /* UARTB is debug port
-        *       for SLT - E1186/E1187/PM269
-        *       for E1256
-        */
-       if (((board_info.sku & SKU_SLT_ULPI_SUPPORT) &&
-               ((board_info.board_id == BOARD_E1186) ||
-               (board_info.board_id == BOARD_E1187) ||
-               (board_info.board_id == BOARD_PM269))) ||
-               (board_info.board_id == BOARD_E1256)) {
-                       /* UARTB is the debug port. */
-                       pr_info("Selecting UARTB as the debug console\n");
-                       cardhu_uart_devices[1] = &debug_uartb_device;
-                       debug_uart_clk =  clk_get_sys("serial8250.0", "uartb");
-                       debug_uart_port_base = ((struct plat_serial8250_port *)(
-                               debug_uartb_device.dev.platform_data))->mapbase;
-                       return;
+
+       debug_port_id = get_tegra_uart_debug_port_id();
+       if (debug_port_id < 0) {
+               debug_port_id = 0;
+                       /* UARTB is debug port
+                        *       for SLT - E1186/E1187/PM269
+                        *       for E1256/E1257
+                        */
+               if (((board_info.sku & SKU_SLT_ULPI_SUPPORT) &&
+                       ((board_info.board_id == BOARD_E1186) ||
+                       (board_info.board_id == BOARD_E1187) ||
+                       (board_info.board_id == BOARD_PM269))) ||
+                       (board_info.board_id == BOARD_E1256) ||
+                       (board_info.board_id == BOARD_E1257))
+                               debug_port_id = 1;
        }
-       /* UARTA is the debug port. */
-       pr_info("Selecting UARTA as the debug console\n");
-       cardhu_uart_devices[0] = &debug_uarta_device;
-       debug_uart_clk = clk_get_sys("serial8250.0", "uarta");
-       debug_uart_port_base = ((struct plat_serial8250_port *)(
+
+       switch (debug_port_id) {
+       case 0:
+               /* UARTA is the debug port. */
+               pr_info("Selecting UARTA as the debug console\n");
+               cardhu_uart_devices[0] = &debug_uarta_device;
+               debug_uart_clk = clk_get_sys("serial8250.0", "uarta");
+               debug_uart_port_base = ((struct plat_serial8250_port *)(
+                       debug_uarta_device.dev.platform_data))->mapbase;
+               break;
+
+       case 1:
+               /* UARTB is the debug port. */
+               pr_info("Selecting UARTB as the debug console\n");
+               cardhu_uart_devices[1] = &debug_uartb_device;
+               debug_uart_clk =  clk_get_sys("serial8250.0", "uartb");
+               debug_uart_port_base = ((struct plat_serial8250_port *)(
+                       debug_uartb_device.dev.platform_data))->mapbase;
+               break;
+
+       case 2:
+               /* UARTC is the debug port. */
+               pr_info("Selecting UARTC as the debug console\n");
+               cardhu_uart_devices[2] = &debug_uartc_device;
+               debug_uart_clk =  clk_get_sys("serial8250.0", "uartc");
+               debug_uart_port_base = ((struct plat_serial8250_port *)(
+                       debug_uartc_device.dev.platform_data))->mapbase;
+               break;
+
+       case 3:
+               /* UARTD is the debug port. */
+               pr_info("Selecting UARTD as the debug console\n");
+               cardhu_uart_devices[3] = &debug_uartd_device;
+               debug_uart_clk =  clk_get_sys("serial8250.0", "uartd");
+               debug_uart_port_base = ((struct plat_serial8250_port *)(
+                       debug_uartd_device.dev.platform_data))->mapbase;
+               break;
+
+       case 4:
+               /* UARTE is the debug port. */
+               pr_info("Selecting UARTE as the debug console\n");
+               cardhu_uart_devices[4] = &debug_uarte_device;
+               debug_uart_clk =  clk_get_sys("serial8250.0", "uarte");
+               debug_uart_port_base = ((struct plat_serial8250_port *)(
+                       debug_uarte_device.dev.platform_data))->mapbase;
+               break;
+
+       default:
+               pr_info("The debug console id %d is invalid, Assuming UARTA", debug_port_id);
+               cardhu_uart_devices[0] = &debug_uarta_device;
+               debug_uart_clk = clk_get_sys("serial8250.0", "uarta");
+               debug_uart_port_base = ((struct plat_serial8250_port *)(
                        debug_uarta_device.dev.platform_data))->mapbase;
+               break;
+       }
+       return;
 }
 
 static void __init cardhu_uart_init(void)
@@ -349,11 +564,16 @@ static void __init cardhu_uart_init(void)
        }
        cardhu_uart_pdata.parent_clk_list = uart_parent_clk;
        cardhu_uart_pdata.parent_clk_count = ARRAY_SIZE(uart_parent_clk);
+       cardhu_loopback_uart_pdata.parent_clk_list = uart_parent_clk;
+       cardhu_loopback_uart_pdata.parent_clk_count =
+                                               ARRAY_SIZE(uart_parent_clk);
+       cardhu_loopback_uart_pdata.is_loopback = true;
        tegra_uarta_device.dev.platform_data = &cardhu_uart_pdata;
        tegra_uartb_device.dev.platform_data = &cardhu_uart_pdata;
        tegra_uartc_device.dev.platform_data = &cardhu_uart_pdata;
        tegra_uartd_device.dev.platform_data = &cardhu_uart_pdata;
-       tegra_uarte_device.dev.platform_data = &cardhu_uart_pdata;
+       /* UARTE is used for loopback test purpose */
+       tegra_uarte_device.dev.platform_data = &cardhu_loopback_uart_pdata;
 
        /* Register low speed only if it is selected */
        if (!is_tegra_debug_uartport_hs()) {
@@ -391,8 +611,12 @@ static struct platform_device *cardhu_spi_devices[] __initdata = {
 
 struct spi_clk_parent spi_parent_clk[] = {
        [0] = {.name = "pll_p"},
+#ifndef CONFIG_TEGRA_PLLM_RESTRICTED
        [1] = {.name = "pll_m"},
        [2] = {.name = "clk_m"},
+#else
+       [1] = {.name = "clk_m"},
+#endif
 };
 
 static struct tegra_spi_platform_data cardhu_spi_pdata = {
@@ -429,9 +653,21 @@ static void __init cardhu_spi_init(void)
        if (board_info.board_id == BOARD_E1198) {
                tegra_spi_device2.dev.platform_data = &cardhu_spi_pdata;
                platform_device_register(&tegra_spi_device2);
+               tegra_spi_slave_device1.dev.platform_data = &cardhu_spi_pdata;
+               platform_device_register(&tegra_spi_slave_device1);
        }
 }
 
+static void __init cardhu_dtv_init(void)
+{
+       struct board_info board_info;
+
+       tegra_get_board_info(&board_info);
+
+       if (board_info.board_id == BOARD_E1186)
+               platform_device_register(&tegra_dtv_device);
+}
+
 static struct resource tegra_rtc_resources[] = {
        [0] = {
                .start = TEGRA_RTC_BASE,
@@ -452,7 +688,7 @@ static struct platform_device tegra_rtc_device = {
        .num_resources = ARRAY_SIZE(tegra_rtc_resources),
 };
 
-static struct tegra_wm8903_platform_data cardhu_audio_pdata = {
+static struct tegra_wm8903_platform_data cardhu_audio_wm8903_pdata = {
        .gpio_spkr_en           = TEGRA_GPIO_SPKR_EN,
        .gpio_hp_det            = TEGRA_GPIO_HP_DET,
        .gpio_hp_mute           = -1,
@@ -460,22 +696,64 @@ static struct tegra_wm8903_platform_data cardhu_audio_pdata = {
        .gpio_ext_mic_en        = -1,
 };
 
-static struct platform_device cardhu_audio_device = {
+static struct tegra_asoc_platform_data cardhu_audio_max98095_pdata = {
+       .gpio_spkr_en           = -1,
+       .gpio_hp_det            = TEGRA_GPIO_HP_DET,
+       .gpio_hp_mute           = -1,
+       .gpio_int_mic_en        = -1,
+       .gpio_ext_mic_en        = -1,
+};
+
+static struct platform_device cardhu_audio_wm8903_device = {
        .name   = "tegra-snd-wm8903",
        .id     = 0,
        .dev    = {
-               .platform_data  = &cardhu_audio_pdata,
+               .platform_data = &cardhu_audio_wm8903_pdata,
+       },
+};
+
+static struct platform_device cardhu_audio_max98095_device = {
+       .name   = "tegra-snd-max98095",
+       .id     = 0,
+       .dev    = {
+               .platform_data = &cardhu_audio_max98095_pdata,
+       },
+};
+
+static struct tegra_asoc_platform_data cardhu_audio_aic326x_pdata = {
+       .gpio_spkr_en           = -1,
+       .gpio_hp_det            = TEGRA_GPIO_HP_DET,
+       .gpio_hp_mute           = -1,
+       .gpio_int_mic_en        = -1,
+       .gpio_ext_mic_en        = -1,
+};
+
+static struct platform_device cardhu_audio_aic326x_device = {
+       .name   = "tegra-snd-aic326x",
+       .id     = 0,
+       .dev    = {
+               .platform_data  = &cardhu_audio_aic326x_pdata,
+       },
+};
+
+static struct resource ram_console_resources[] = {
+       {
+               .flags = IORESOURCE_MEM,
        },
 };
 
+static struct platform_device ram_console_device = {
+       .name           = "ram_console",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(ram_console_resources),
+       .resource       = ram_console_resources,
+};
+
 static struct platform_device *cardhu_devices[] __initdata = {
        &tegra_pmu_device,
        &tegra_rtc_device,
        &tegra_udc_device,
-#if defined(CONFIG_SND_HDA_TEGRA)
-       &tegra_hda_device,
-#endif
-#if defined(CONFIG_TEGRA_IOVMM_SMMU)
+#if defined(CONFIG_TEGRA_IOVMM_SMMU) ||  defined(CONFIG_TEGRA_IOMMU_SMMU)
        &tegra_smmu_device,
 #endif
        &tegra_wdt_device,
@@ -487,12 +765,25 @@ static struct platform_device *cardhu_devices[] __initdata = {
        &tegra_se_device,
 #endif
        &tegra_ahub_device,
+       &tegra_dam_device0,
+       &tegra_dam_device1,
+       &tegra_dam_device2,
+       &tegra_i2s_device0,
        &tegra_i2s_device1,
+       &tegra_i2s_device3,
+       &tegra_spdif_device,
+       &spdif_dit_device,
+       &bluetooth_dit_device,
+       &baseband_dit_device,
        &tegra_pcm_device,
-       &cardhu_audio_device,
+       &cardhu_audio_wm8903_device,
+       &cardhu_audio_max98095_device,
+       &cardhu_audio_aic326x_device,
+       &tegra_hda_device,
 #if defined(CONFIG_CRYPTO_DEV_TEGRA_AES)
        &tegra_aes_device,
 #endif
+       &ram_console_device,
 };
 
 #define MXT_CONFIG_CRC  0xD62DE8
@@ -610,6 +901,7 @@ static struct tegra_ehci_platform_data tegra_ehci_uhsic_pdata = {
        .phy_config = &uhsic_phy_config,
        .operating_mode = TEGRA_USB_HOST,
        .power_down_on_bus_suspend = 1,
+       .default_enable = true,
 };
 
 static struct tegra_ehci_platform_data tegra_ehci_pdata[] = {
@@ -617,65 +909,27 @@ static struct tegra_ehci_platform_data tegra_ehci_pdata[] = {
                        .phy_config = &utmi_phy_config[0],
                        .operating_mode = TEGRA_USB_HOST,
                        .power_down_on_bus_suspend = 1,
+                       .default_enable = true,
        },
        [1] = {
                        .phy_config = &utmi_phy_config[1],
                        .operating_mode = TEGRA_USB_HOST,
                        .power_down_on_bus_suspend = 1,
+                       .default_enable = true,
        },
        [2] = {
                        .phy_config = &utmi_phy_config[2],
                        .operating_mode = TEGRA_USB_HOST,
                        .power_down_on_bus_suspend = 1,
+                       .hotplug = 1,
+                       .default_enable = true,
        },
 };
 
-static struct platform_device *tegra_usb_otg_host_register(void)
-{
-       struct platform_device *pdev;
-       void *platform_data;
-       int val;
-
-       pdev = platform_device_alloc(tegra_ehci1_device.name,
-               tegra_ehci1_device.id);
-       if (!pdev)
-               return NULL;
-
-       val = platform_device_add_resources(pdev, tegra_ehci1_device.resource,
-               tegra_ehci1_device.num_resources);
-       if (val)
-               goto error;
-
-       pdev->dev.dma_mask =  tegra_ehci1_device.dev.dma_mask;
-       pdev->dev.coherent_dma_mask = tegra_ehci1_device.dev.coherent_dma_mask;
-
-       platform_data = kmalloc(sizeof(struct tegra_ehci_platform_data),
-               GFP_KERNEL);
-       if (!platform_data)
-               goto error;
-
-       memcpy(platform_data, &tegra_ehci_pdata[0],
-                               sizeof(struct tegra_ehci_platform_data));
-       pdev->dev.platform_data = platform_data;
-
-       val = platform_device_add(pdev);
-       if (val)
-               goto error_add;
-
-       return pdev;
-
-error_add:
-       kfree(platform_data);
-error:
-       pr_err("%s: failed to add the host contoller device\n", __func__);
-       platform_device_put(pdev);
-       return NULL;
-}
-
-static void tegra_usb_otg_host_unregister(struct platform_device *pdev)
-{
-       platform_device_unregister(pdev);
-}
+static struct tegra_otg_platform_data tegra_otg_pdata = {
+       .ehci_device = &tegra_ehci1_device,
+       .ehci_pdata = &tegra_ehci_pdata[0],
+};
 
 #ifdef CONFIG_USB_SUPPORT
 static struct usb_phy_plat_data tegra_usb_phy_pdata[] = {
@@ -695,11 +949,6 @@ static struct usb_phy_plat_data tegra_usb_phy_pdata[] = {
        },
 };
 
-static struct tegra_otg_platform_data tegra_otg_pdata = {
-       .host_register = &tegra_usb_otg_host_register,
-       .host_unregister = &tegra_usb_otg_host_unregister,
-};
-
 static void cardhu_usb_init(void)
 {
        struct board_info bi;
@@ -741,6 +990,13 @@ static void cardhu_gps_init(void)
        tegra_gpio_enable(TEGRA_GPIO_PU3);
 }
 
+static void cardhu_nfc_init(void)
+{
+       tegra_gpio_enable(TEGRA_GPIO_PX0);
+       tegra_gpio_enable(TEGRA_GPIO_PP3);
+       tegra_gpio_enable(TEGRA_GPIO_PO7);
+}
+
 static struct baseband_power_platform_data tegra_baseband_power_data = {
        .baseband_type = BASEBAND_XMM,
        .modem = {
@@ -772,6 +1028,31 @@ static struct platform_device tegra_baseband_power2_device = {
        },
 };
 
+
+static struct tegra_pci_platform_data cardhu_pci_platform_data = {
+       .port_status[0] = 1,
+       .port_status[1] = 1,
+       .port_status[2] = 1,
+       .use_dock_detect        = 0,
+       .gpio           = 0,
+};
+
+static void cardhu_pci_init(void)
+{
+       struct board_info board_info;
+
+       tegra_get_board_info(&board_info);
+       if (board_info.board_id == BOARD_E1291) {
+               cardhu_pci_platform_data.port_status[0] = 0;
+               cardhu_pci_platform_data.port_status[1] = 0;
+               cardhu_pci_platform_data.port_status[2] = 1;
+               cardhu_pci_platform_data.use_dock_detect = 1;
+               cardhu_pci_platform_data.gpio = DOCK_DETECT_GPIO;
+       }
+       tegra_pci_device.dev.platform_data = &cardhu_pci_platform_data;
+       platform_device_register(&tegra_pci_device);
+}
+
 static void cardhu_modem_init(void)
 {
        struct board_info board_info;
@@ -780,7 +1061,11 @@ static void cardhu_modem_init(void)
        tegra_get_board_info(&board_info);
        switch (board_info.board_id) {
        case BOARD_E1291:
-               if (board_info.fab < BOARD_FAB_A03) {
+       case BOARD_E1198:
+               if (((board_info.board_id == BOARD_E1291) &&
+                               (board_info.fab < BOARD_FAB_A03)) ||
+                       ((board_info.board_id == BOARD_E1198) &&
+                                       (board_info.fab < BOARD_FAB_A02))) {
                        w_disable_gpio = TEGRA_GPIO_PH5;
                } else {
                        w_disable_gpio = TEGRA_GPIO_PDD5;
@@ -793,15 +1078,18 @@ static void cardhu_modem_init(void)
                else
                        gpio_direction_input(w_disable_gpio);
 
-               /* E1291-A04: Set PERST signal to low */
-               if (board_info.fab >= BOARD_FAB_A04) {
+               /* E1291-A04 & E1198:A02: Set PERST signal to high */
+               if (((board_info.board_id == BOARD_E1291) &&
+                               (board_info.fab >= BOARD_FAB_A04)) ||
+                       ((board_info.board_id == BOARD_E1198) &&
+                                       (board_info.fab >= BOARD_FAB_A02))) {
                        ret = gpio_request(TEGRA_GPIO_PH7, "modem_perst");
                        if (ret < 0) {
                                pr_err("%s(): Error in allocating gpio "
                                        "TEGRA_GPIO_PH7\n", __func__);
                                break;
                        }
-                       gpio_direction_output(TEGRA_GPIO_PH7, 0);
+                       gpio_direction_output(TEGRA_GPIO_PH7, 1);
                        tegra_gpio_enable(TEGRA_GPIO_PH7);
                }
                break;
@@ -836,8 +1124,17 @@ static void cardhu_sata_init(void)
 static void cardhu_sata_init(void) { }
 #endif
 
+static void cardhu_ramconsole_init(void)
+{
+       struct resource *res;
+       res = platform_get_resource(&ram_console_device, IORESOURCE_MEM, 0);
+       res->start = ramconsole_start;
+       res->end = res->start + ramconsole_size - 1;
+}
+
 static void __init tegra_cardhu_init(void)
 {
+       tegra_thermal_init(&thermal_data);
        tegra_clk_init_from_table(cardhu_clk_init_table);
        cardhu_pinmux_init();
        cardhu_i2c_init();
@@ -847,13 +1144,12 @@ static void __init tegra_cardhu_init(void)
        cardhu_edp_init();
 #endif
        cardhu_uart_init();
-       cardhu_tsensor_init();
+       cardhu_ramconsole_init();
        platform_add_devices(cardhu_devices, ARRAY_SIZE(cardhu_devices));
        cardhu_sdhci_init();
        cardhu_regulator_init();
-       cardhu_gpio_switch_regulator_init();
+       cardhu_dtv_init();
        cardhu_suspend_init();
-       cardhu_power_off_init();
        cardhu_touch_init();
        cardhu_gps_init();
        cardhu_modem_init();
@@ -870,12 +1166,27 @@ static void __init tegra_cardhu_init(void)
        cardhu_pins_state_init();
        cardhu_emc_init();
        tegra_release_bootloader_fb();
+       cardhu_nfc_init();
+       cardhu_pci_init();
+#ifdef CONFIG_TEGRA_WDT_RECOVERY
+       tegra_wdt_recovery_init();
+#endif
 }
 
 static void __init tegra_cardhu_reserve(void)
 {
+       long ret;
+       ramconsole_size = SZ_1M;
+       ramconsole_start = memblock_end_of_DRAM() - ramconsole_size;
+       ret = memblock_remove(ramconsole_start, ramconsole_size);
+       if (ret) {
+               ramconsole_size = 0;
+               pr_err("Failed to reserve memory block for ram console\n");
+       }
+
 #if defined(CONFIG_NVMAP_CONVERT_CARVEOUT_TO_IOVMM)
-       tegra_reserve(0, SZ_8M, SZ_8M);
+       /* support 1920X1200 with 24bpp */
+       tegra_reserve(0, SZ_8M + SZ_1M, SZ_8M + SZ_1M);
 #else
        tegra_reserve(SZ_128M, SZ_8M, SZ_8M);
 #endif