msm8930 sglte: Add support for GSBI10 for serial console
This change adds GSBI10 UARTDM device and required resource
(its GPIOs and clocks) with their configurations for 8930
SGLTE EVT1 for serial console functionality.
CRs-Fixed: 459320
Change-Id: I14b9300c1a92cba5c1477aa35be0c83d4b46730f
Signed-off-by: Saket Saurabh <ssaurabh@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-8930.c b/arch/arm/mach-msm/board-8930.c
index 5e26455..6ad1cb9 100644
--- a/arch/arm/mach-msm/board-8930.c
+++ b/arch/arm/mach-msm/board-8930.c
@@ -2360,7 +2360,6 @@
static struct platform_device *early_common_devices[] __initdata = {
&msm8960_device_dmov,
&msm_device_smd,
- &msm8960_device_uart_gsbi5,
&msm_device_uart_dm6,
&msm_device_saw_core0,
&msm_device_saw_core1,
@@ -2510,8 +2509,27 @@
&msm_lowlatency_pcm,
};
+#define GSBI_DUAL_MODE_CODE 0x60
+#define MSM_GSBI10_PHYS 0x1A200000
+
static void __init msm8930_i2c_init(void)
{
+ int minor_ver = SOCINFO_VERSION_MINOR(socinfo_get_platform_version());
+ int major_ver = SOCINFO_VERSION_MAJOR(socinfo_get_platform_version());
+ void __iomem *gsbi_mem;
+
+ if (machine_is_msm8930_evt() &&
+ (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE)) {
+ if (major_ver == 1 && minor_ver == 0) {
+ gsbi_mem = ioremap_nocache(MSM_GSBI10_PHYS, 4);
+ writel_relaxed(GSBI_DUAL_MODE_CODE, gsbi_mem);
+ /* Ensure protocol code is written before proceeding */
+ wmb();
+ iounmap(gsbi_mem);
+ msm8960_i2c_qup_gsbi10_pdata.use_gsbi_shared_mode = 1;
+ }
+ }
+
msm8960_device_qup_i2c_gsbi4.dev.platform_data =
&msm8960_i2c_qup_gsbi4_pdata;
@@ -2930,6 +2948,8 @@
static void __init msm8930_cdp_init(void)
{
int i, reg_size = 0;
+ int minor_ver = SOCINFO_VERSION_MINOR(socinfo_get_platform_version());
+ int major_ver = SOCINFO_VERSION_MAJOR(socinfo_get_platform_version());
if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917)
msm8930_pm8917_pdata_fixup();
if (meminfo_init(SYS_MEMORY, SZ_256M) < 0)
@@ -2985,6 +3005,17 @@
msm_device_uart_dm9.dev.platform_data = &msm_uart_dm9_pdata;
#endif
platform_device_register(&msm_device_uart_dm9);
+
+ /* For 8930 SGLTE serial console */
+ if (major_ver == 1) {
+ if (minor_ver == 0)
+ /* Add UART Serial for EVT1 device */
+ platform_device_register(
+ &msm8930_device_uart_gsbi10);
+ }
+ } else {
+ /* For 8930 Standalone serial console */
+ platform_device_register(&msm8960_device_uart_gsbi5);
}
msm_otg_pdata.phy_init_seq = hsusb_phy_init_seq;