summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hsu <mhsu@nvidia.com>2011-08-10 11:59:27 -0700
committerVarun Colbert <vcolbert@nvidia.com>2011-09-07 17:43:09 -0700
commit675f98979d6c6a281631d6590be5c7b6e5352b6f (patch)
treea198103f289bd31f307274314eec05be7825611c
parent0e5b68619d03e7413d5c718f98d0820f3c534e86 (diff)
arm: tegra: enterprise: Add drivers for flashless XMM modem
XMM modem requires GPIO power on sequence before modem software can be downloaded to it. BUG 828389 Change-Id: I236f70638e0ef028d72fe8ec471fabfd4bfffc5b Reviewed-on: http://git-master/r/46801 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/Kconfig16
-rw-r--r--arch/arm/mach-tegra/Makefile6
-rw-r--r--arch/arm/mach-tegra/board-cardhu.c4
-rw-r--r--arch/arm/mach-tegra/board-enterprise-pinmux.c10
-rw-r--r--arch/arm/mach-tegra/board-enterprise.c88
-rw-r--r--arch/arm/mach-tegra/board-enterprise.h20
6 files changed, 136 insertions, 8 deletions
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index 1f4e62251d21..aa5bac53714d 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -322,3 +322,19 @@ config TEGRA_USB_MODEM_POWER
help
This option enables support for out-of_band remote wakeup, selective
suspend and system suspend/resume.
+
+config TEGRA_BB_XMM_POWER
+ bool "Enable power driver for XMM modem"
+ default n
+ help
+ Enables power driver which controls gpio signals to XMM modem.
+
+config TEGRA_BB_XMM_POWER2
+ tristate "Enable power driver for XMM modem (flashless)"
+ default n
+ help
+ Enables power driver which controls gpio signals to XMM modem
+ (in flashless configuration). User-mode application must
+ insert this LKM to initiate 2nd USB enumeration power sequence
+ - after modem software has been downloaded to flashless device.
+
diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile
index 20eac9b90491..04c6ef50dda3 100644
--- a/arch/arm/mach-tegra/Makefile
+++ b/arch/arm/mach-tegra/Makefile
@@ -147,8 +147,6 @@ obj-${CONFIG_MACH_CARDHU} += board-cardhu-sensors.o
obj-${CONFIG_MACH_CARDHU} += board-touch.o
obj-${CONFIG_MACH_CARDHU} += board-cardhu-memory.o
obj-${CONFIG_MACH_CARDHU} += board-cardhu-powermon.o
-obj-${CONFIG_MACH_CARDHU} += baseband-xmm-power.o
-obj-m += baseband-xmm-power2.o
obj-${CONFIG_MACH_TEGRA_ENTERPRISE} += board-enterprise.o
obj-${CONFIG_MACH_TEGRA_ENTERPRISE} += board-enterprise-panel.o
@@ -160,3 +158,7 @@ obj-${CONFIG_MACH_TEGRA_ENTERPRISE} += board-enterprise-power.o
obj-${CONFIG_MACH_TEGRA_ENTERPRISE} += board-enterprise-baseband.o
obj-${CONFIG_MACH_TEGRA_ENTERPRISE} += board-enterprise-kbc.o
obj-${CONFIG_MACH_TEGRA_ENTERPRISE} += board-enterprise-sensors.o
+
+obj-${CONFIG_TEGRA_BB_XMM_POWER} += baseband-xmm-power.o
+obj-${CONFIG_TEGRA_BB_XMM_POWER2} += baseband-xmm-power2.o
+
diff --git a/arch/arm/mach-tegra/board-cardhu.c b/arch/arm/mach-tegra/board-cardhu.c
index bf7e4d13d004..52e0efc0991d 100644
--- a/arch/arm/mach-tegra/board-cardhu.c
+++ b/arch/arm/mach-tegra/board-cardhu.c
@@ -859,13 +859,17 @@ static struct tegra_otg_platform_data tegra_otg_pdata = {
static int cardu_usb_hsic_postsupend(void)
{
+#ifdef CONFIG_TEGRA_BB_XMM_POWER
baseband_xmm_set_power_status(BBXMM_PS_L2);
+#endif
return 0;
}
static int cardu_usb_hsic_preresume(void)
{
+#ifdef CONFIG_TEGRA_BB_XMM_POWER
baseband_xmm_set_power_status(BBXMM_PS_L2TOL0);
+#endif
return 0;
}
diff --git a/arch/arm/mach-tegra/board-enterprise-pinmux.c b/arch/arm/mach-tegra/board-enterprise-pinmux.c
index 30aa124bbca4..6dd1a8ccf0ed 100644
--- a/arch/arm/mach-tegra/board-enterprise-pinmux.c
+++ b/arch/arm/mach-tegra/board-enterprise-pinmux.c
@@ -190,15 +190,15 @@ static __initdata struct tegra_pingroup_config enterprise_pinmux[] = {
DEFAULT_PINMUX(DAP3_SCLK, I2S2, NORMAL, NORMAL, INPUT),
DEFAULT_PINMUX(GPIO_PV2, RSVD1, NORMAL, NORMAL, OUTPUT),
DEFAULT_PINMUX(GPIO_PV3, RSVD1, NORMAL, NORMAL, OUTPUT),
- DEFAULT_PINMUX(LCD_PWR1, DISPLAYA, NORMAL, NORMAL, INPUT),
+ DEFAULT_PINMUX(LCD_PWR1, DISPLAYA, NORMAL, NORMAL, OUTPUT),
DEFAULT_PINMUX(LCD_PWR2, DISPLAYA, NORMAL, NORMAL, INPUT),
DEFAULT_PINMUX(LCD_CS0_N, DISPLAYA, NORMAL, NORMAL, INPUT),
DEFAULT_PINMUX(LCD_DC0, DISPLAYA, NORMAL, NORMAL, INPUT),
DEFAULT_PINMUX(LCD_DE, DISPLAYA, NORMAL, NORMAL, INPUT),
- DEFAULT_PINMUX(LCD_D0, DISPLAYA, NORMAL, NORMAL, INPUT),
- DEFAULT_PINMUX(LCD_D1, DISPLAYA, NORMAL, NORMAL, INPUT),
+ DEFAULT_PINMUX(LCD_D0, DISPLAYA, NORMAL, NORMAL, OUTPUT),
+ DEFAULT_PINMUX(LCD_D1, DISPLAYA, NORMAL, NORMAL, OUTPUT),
DEFAULT_PINMUX(LCD_D2, DISPLAYA, NORMAL, NORMAL, INPUT),
- DEFAULT_PINMUX(LCD_D3, DISPLAYA, NORMAL, NORMAL, INPUT),
+ DEFAULT_PINMUX(LCD_D3, DISPLAYA, NORMAL, NORMAL, OUTPUT),
DEFAULT_PINMUX(LCD_D4, DISPLAYA, NORMAL, NORMAL, INPUT),
DEFAULT_PINMUX(LCD_D5, DISPLAYA, NORMAL, NORMAL, INPUT),
DEFAULT_PINMUX(LCD_D6, RSVD1, NORMAL, NORMAL, INPUT),
@@ -242,7 +242,7 @@ static __initdata struct tegra_pingroup_config enterprise_pinmux[] = {
DEFAULT_PINMUX(GPIO_PU1, UARTA, NORMAL, NORMAL, INPUT),
DEFAULT_PINMUX(GPIO_PU2, UARTA, NORMAL, NORMAL, INPUT),
DEFAULT_PINMUX(GPIO_PU3, UARTA, NORMAL, NORMAL, OUTPUT),
- DEFAULT_PINMUX(GPIO_PU5, PWM2, NORMAL, NORMAL, OUTPUT),
+ DEFAULT_PINMUX(GPIO_PU5, PWM2, NORMAL, NORMAL, INPUT),
DEFAULT_PINMUX(GPIO_PU6, PWM3, NORMAL, NORMAL, OUTPUT),
DEFAULT_PINMUX(DAP4_FS, I2S3, NORMAL, NORMAL, INPUT),
DEFAULT_PINMUX(DAP4_DIN, I2S3, NORMAL, NORMAL, INPUT),
diff --git a/arch/arm/mach-tegra/board-enterprise.c b/arch/arm/mach-tegra/board-enterprise.c
index 45ec2abab994..f7dd0a1b01ae 100644
--- a/arch/arm/mach-tegra/board-enterprise.c
+++ b/arch/arm/mach-tegra/board-enterprise.c
@@ -57,6 +57,7 @@
#include "board.h"
#include "clock.h"
#include "board-enterprise.h"
+#include "baseband-xmm-power.h"
#include "devices.h"
#include "gpio-names.h"
#include "fuse.h"
@@ -752,6 +753,22 @@ static struct usb_phy_plat_data tegra_usb_phy_pdata[] = {
},
};
+static struct tegra_uhsic_config uhsic_phy_config = {
+ .enable_gpio = -1,
+ .reset_gpio = -1,
+ .sync_start_delay = 9,
+ .idle_wait_delay = 17,
+ .term_range_adj = 0,
+ .elastic_underrun_limit = 16,
+ .elastic_overrun_limit = 16,
+};
+
+static struct tegra_ehci_platform_data tegra_ehci_uhsic_pdata = {
+ .phy_type = TEGRA_USB_PHY_TYPE_HSIC,
+ .phy_config = &uhsic_phy_config,
+ .operating_mode = TEGRA_USB_HOST,
+ .power_down_on_bus_suspend = 1,
+};
static struct tegra_ehci_platform_data tegra_ehci_pdata[] = {
[0] = {
@@ -828,6 +845,22 @@ static struct tegra_otg_platform_data tegra_otg_pdata = {
static char usb_serial_num[SERIAL_NUMBER_LENGTH];
#endif
+static int enterprise_usb_hsic_postsupend(void)
+{
+#ifdef CONFIG_TEGRA_BB_XMM_POWER
+ baseband_xmm_set_power_status(BBXMM_PS_L2);
+#endif
+ return 0;
+}
+
+static int enterprise_usb_hsic_preresume(void)
+{
+#ifdef CONFIG_TEGRA_BB_XMM_POWER
+ baseband_xmm_set_power_status(BBXMM_PS_L2TOL0);
+#endif
+ return 0;
+}
+
static void enterprise_usb_init(void)
{
#ifdef CONFIG_USB_ANDROID_RNDIS
@@ -867,6 +900,37 @@ static void enterprise_gps_init(void)
tegra_gpio_enable(TEGRA_GPIO_PE5);
}
+static struct baseband_power_platform_data tegra_baseband_power_data = {
+ .baseband_type = BASEBAND_XMM,
+ .modem = {
+ .xmm = {
+ .bb_rst = XMM_GPIO_BB_RST,
+ .bb_on = XMM_GPIO_BB_ON,
+ .ipc_bb_wake = XMM_GPIO_IPC_BB_WAKE,
+ .ipc_ap_wake = XMM_GPIO_IPC_AP_WAKE,
+ .ipc_hsic_active = XMM_GPIO_IPC_HSIC_ACTIVE,
+ .ipc_hsic_sus_req = XMM_GPIO_IPC_HSIC_SUS_REQ,
+ .hsic_device = &tegra_ehci2_device,
+ },
+ },
+};
+
+static struct platform_device tegra_baseband_power_device = {
+ .name = "baseband_xmm_power",
+ .id = -1,
+ .dev = {
+ .platform_data = &tegra_baseband_power_data,
+ },
+};
+
+static struct platform_device tegra_baseband_power2_device = {
+ .name = "baseband_xmm_power2",
+ .id = -1,
+ .dev = {
+ .platform_data = &tegra_baseband_power_data,
+ },
+};
+
static void enterprise_baseband_init(void)
{
int modem_id = tegra_get_modem_id();
@@ -875,7 +939,29 @@ static void enterprise_baseband_init(void)
case 1: /* PH450 ULPI */
enterprise_modem_init();
break;
- case 2: /* 6260 HSIC */
+ case 2: /* XMM6260 HSIC */
+ /* xmm baseband - do not switch off phy during suspend */
+ tegra_ehci_uhsic_pdata.power_down_on_bus_suspend = 0;
+ uhsic_phy_config.postsuspend = enterprise_usb_hsic_postsupend;
+ uhsic_phy_config.preresume = enterprise_usb_hsic_preresume;
+ /* baseband-power.ko will register ehci2 device */
+ tegra_ehci2_device.dev.platform_data
+ = &tegra_ehci_uhsic_pdata;
+ /* enable XMM6260 baseband gpio(s) */
+ tegra_gpio_enable(tegra_baseband_power_data.modem.generic
+ .mdm_reset);
+ tegra_gpio_enable(tegra_baseband_power_data.modem.generic
+ .mdm_on);
+ tegra_gpio_enable(tegra_baseband_power_data.modem.generic
+ .ap2mdm_ack);
+ tegra_gpio_enable(tegra_baseband_power_data.modem.generic
+ .mdm2ap_ack);
+ tegra_gpio_enable(tegra_baseband_power_data.modem.generic
+ .ap2mdm_ack2);
+ tegra_gpio_enable(tegra_baseband_power_data.modem.generic
+ .mdm2ap_ack2);
+ platform_device_register(&tegra_baseband_power_device);
+ platform_device_register(&tegra_baseband_power2_device);
break;
}
}
diff --git a/arch/arm/mach-tegra/board-enterprise.h b/arch/arm/mach-tegra/board-enterprise.h
index 7a92e8cd4351..d5f6bda883b7 100644
--- a/arch/arm/mach-tegra/board-enterprise.h
+++ b/arch/arm/mach-tegra/board-enterprise.h
@@ -75,7 +75,27 @@ int enterprise_edp_init(void);
#define CAM_FLASH_MAX_TORCH_AMP 7
#define CAM_FLASH_MAX_FLASH_AMP 7
+/* Baseband GPIO addresses */
+
+#define BB_GPIO_MDM_PWRON_AP2BB TEGRA_GPIO_PE0 /* LCD_D0 */
+#define BB_GPIO_RESET_AP2BB TEGRA_GPIO_PE1 /* LCD_D1 */
+#define BB_GPIO_LCD_PWR1 TEGRA_GPIO_PC1
+#define BB_GPIO_LCD_PWR2 TEGRA_GPIO_PC6
+#define BB_GPIO_HS1_AP2BB TEGRA_GPIO_PE3 /* LCD_D3 */
+#define BB_GPIO_HS1_BB2AP TEGRA_GPIO_PU5
+
+#define XMM_GPIO_BB_ON BB_GPIO_MDM_PWRON_AP2BB
+#define XMM_GPIO_BB_RST BB_GPIO_RESET_AP2BB
+#define XMM_GPIO_IPC_HSIC_ACTIVE BB_GPIO_LCD_PWR1
+#define XMM_GPIO_IPC_HSIC_SUS_REQ BB_GPIO_LCD_PWR2
+#define XMM_GPIO_IPC_BB_WAKE BB_GPIO_HS1_AP2BB
+#define XMM_GPIO_IPC_AP_WAKE BB_GPIO_HS1_BB2AP
+
+/* Board IDs */
+
#define BOARD_1205 (0x0C05)
#define BOARD_E1197 (0x0B61)
#define ENTERPRISE_FAB_A01 (0x01)
+#define SKU_BATTERY_SUPPORT 0x1
+
#endif