USB: msm72k_otg: disable BAM mode

In BAM mode, USB core does posted writes on AHB bus, when it moves
the received setup packet to the memory. This might lead HW to fail in
copying the setup packet into the memory, before software reads. This
leads data corruption in setup packet and might lead USB re-enumeration.

If we don't use BAM mode for USB, then we should explicitly disable
the USB BAM mode by setting bit-13 of USB_GEN_CONFIG register. This
would prevent posted writes and resolves the above issue.

Signed-off-by: Chandra Devireddy <cdevired@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-msm8x60.c b/arch/arm/mach-msm/board-msm8x60.c
index 045d363..10bd65b 100644
--- a/arch/arm/mach-msm/board-msm8x60.c
+++ b/arch/arm/mach-msm/board-msm8x60.c
@@ -1383,6 +1383,7 @@
 	.pemp_level		 = PRE_EMPHASIS_WITH_20_PERCENT,
 	.cdr_autoreset		 = CDR_AUTO_RESET_DISABLE,
 	.se1_gating		 = SE1_GATING_DISABLE,
+	.bam_disable		 = 1,
 #ifdef CONFIG_USB_EHCI_MSM_72K
 	.pmic_id_notif_init = msm_hsusb_pmic_id_notif_init,
 #endif
diff --git a/arch/arm/mach-msm/include/mach/msm_hsusb.h b/arch/arm/mach-msm/include/mach/msm_hsusb.h
index 3fefd52..115c10a 100644
--- a/arch/arm/mach-msm/include/mach/msm_hsusb.h
+++ b/arch/arm/mach-msm/include/mach/msm_hsusb.h
@@ -135,7 +135,7 @@
 	int			phy_reset_sig_inverted;
 	int			phy_can_powercollapse;
 	int			pclk_required_during_lpm;
-
+	int			bam_disable;
 	/* HSUSB core in 8660 has the capability to gate the
 	 * pclk when not being used. Though this feature is
 	 * now being disabled because of H/w issues
diff --git a/arch/arm/mach-msm/include/mach/msm_hsusb_hw.h b/arch/arm/mach-msm/include/mach/msm_hsusb_hw.h
index 69cfb7d..82542b2 100644
--- a/arch/arm/mach-msm/include/mach/msm_hsusb_hw.h
+++ b/arch/arm/mach-msm/include/mach/msm_hsusb_hw.h
@@ -25,6 +25,8 @@
 #define USB_HWRXBUF          (MSM_USB_BASE + 0x0014)
 #define USB_AHB_BURST        (MSM_USB_BASE + 0x0090)
 #define USB_AHB_MODE         (MSM_USB_BASE + 0x0098)
+#define USB_GEN_CONFIG       (MSM_USB_BASE + 0x009C)
+#define USB_BAM_DISABLE      (1 << 13)
 #define USB_ROC_AHB_MODE     (MSM_USB_BASE + 0x0090)
 #define USB_SBUSCFG          (MSM_USB_BASE + 0x0090)