arm: tegra: cardhu: pcie support for cardhu bsp
Jay Agarwal [Mon, 5 Dec 2011 08:55:38 +0000 (13:55 +0530)]
Enabling PCIE support in cardhu board.
Fixes bug: 637871

Reviewed-on: http://git-master/r/34474
(cherry picked from commit bde3e58d998b6e76934152219b8803327cea2fad)

Change-Id: I18c548b458ad3d17ec07d2ec5b16fd83897b44b1
Signed-off-by: Krishna Kishore <kthota@nvidia.com>
Reviewed-on: http://git-master/r/62072
Reviewed-by: Lokesh Pathak <lpathak@nvidia.com>
Tested-by: Lokesh Pathak <lpathak@nvidia.com>

Rebase-Id: Rfae7cfb6a0e4419a40b7f525217726c4ddb71312

arch/arm/mach-tegra/board-cardhu-pinmux.c
arch/arm/mach-tegra/board-cardhu.c
arch/arm/mach-tegra/board-cardhu.h

index 1b736a4..b836ccf 100644 (file)
@@ -441,6 +441,8 @@ static __initdata struct tegra_pingroup_config cardhu_pinmux_cardhu[] = {
        DEFAULT_PINMUX(GMI_CS1_N,       GMI,             PULL_UP,   TRISTATE,   INPUT),
        /*TP_IRQ*/
        DEFAULT_PINMUX(GMI_CS4_N,       GMI,             PULL_UP,   NORMAL,     INPUT),
+       /*PCIE dock detect*/
+       DEFAULT_PINMUX(GPIO_PU4,        PWM1,            PULL_UP,   NORMAL,     INPUT),
 };
 
 static __initdata struct tegra_pingroup_config cardhu_pinmux_cardhu_a03[] = {
index 8aa7846..95e849c 100644 (file)
@@ -37,6 +37,7 @@
 #include <linux/i2c/atmel_mxt_ts.h>
 #include <linux/tegra_uart.h>
 #include <linux/spi-tegra.h>
+#include <linux/nfc/pn544.h>
 
 #include <sound/wm8903.h>
 
@@ -51,8 +52,8 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <mach/usb_phy.h>
-#include <linux/nfc/pn544.h>
 #include <mach/thermal.h>
+#include <mach/pci.h>
 
 #include "board.h"
 #include "clock.h"
@@ -838,6 +839,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;
@@ -945,6 +971,7 @@ static void __init tegra_cardhu_init(void)
        cardhu_emc_init();
        tegra_release_bootloader_fb();
        cardhu_nfc_init();
+       cardhu_pci_init();
 }
 
 static void __init tegra_cardhu_reserve(void)
index 5c8dcb4..38dae9f 100644 (file)
 /* TPS6591x IRQs */
 #define TPS6591X_IRQ_BASE      TEGRA_NR_IRQS
 #define TPS6591X_IRQ_END       (TPS6591X_IRQ_BASE + 18)
+#define DOCK_DETECT_GPIO TEGRA_GPIO_PU4
 
 /* RICOH583 IRQs */
 #define RICOH583_IRQ_BASE      TEGRA_NR_IRQS