Skip to content

Commit 69cb1ec

Browse files
Eric Bénardgregkh
authored andcommitted
mxc_udc: add workaround for ENGcm09152 for i.MX35
this patch gives the possibility to workaround bug ENGcm09152 on i.MX35 when the hardware workaround is also implemented on the board. It covers the workaround described on page 25 of the following Errata : http://cache.freescale.com/files/dsp/doc/errata/IMX35CE.pdf Signed-off-by: Eric Bénard <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0f266ab commit 69cb1ec

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

arch/arm/mach-mx3/mach-cpuimx35.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ static struct mxc_usbh_platform_data usbh1_pdata = {
155155
static struct fsl_usb2_platform_data otg_device_pdata = {
156156
.operating_mode = FSL_USB2_DR_DEVICE,
157157
.phy_mode = FSL_USB2_PHY_UTMI,
158+
.workaround = FLS_USB2_WORKAROUND_ENGCM09152,
158159
};
159160

160161
static int otg_mode_host;

drivers/usb/gadget/fsl_mxc_udc.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
static struct clk *mxc_ahb_clk;
2323
static struct clk *mxc_usb_clk;
2424

25+
/* workaround ENGcm09152 for i.MX35 */
26+
#define USBPHYCTRL_OTGBASE_OFFSET 0x608
27+
#define USBPHYCTRL_EVDO (1 << 23)
28+
2529
int fsl_udc_clk_init(struct platform_device *pdev)
2630
{
2731
struct fsl_usb2_platform_data *pdata;
@@ -84,6 +88,17 @@ int fsl_udc_clk_init(struct platform_device *pdev)
8488
void fsl_udc_clk_finalize(struct platform_device *pdev)
8589
{
8690
struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data;
91+
#if defined(CONFIG_ARCH_MX35)
92+
unsigned int v;
93+
94+
/* workaround ENGcm09152 for i.MX35 */
95+
if (pdata->workaround & FLS_USB2_WORKAROUND_ENGCM09152) {
96+
v = readl(MX35_IO_ADDRESS(MX35_OTG_BASE_ADDR +
97+
USBPHYCTRL_OTGBASE_OFFSET));
98+
writel(v | USBPHYCTRL_EVDO, MX35_IO_ADDRESS(MX35_OTG_BASE_ADDR +
99+
USBPHYCTRL_OTGBASE_OFFSET));
100+
}
101+
#endif
87102

88103
/* ULPI transceivers don't need usbpll */
89104
if (pdata->phy_mode == FSL_USB2_PHY_ULPI) {

include/linux/fsl_devices.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ struct fsl_usb2_platform_data {
6666
enum fsl_usb2_operating_modes operating_mode;
6767
enum fsl_usb2_phy_modes phy_mode;
6868
unsigned int port_enables;
69+
unsigned int workaround;
6970

7071
int (*init)(struct platform_device *);
7172
void (*exit)(struct platform_device *);
@@ -84,6 +85,8 @@ struct fsl_usb2_platform_data {
8485
#define FSL_USB2_PORT0_ENABLED 0x00000001
8586
#define FSL_USB2_PORT1_ENABLED 0x00000002
8687

88+
#define FLS_USB2_WORKAROUND_ENGCM09152 (1 << 0)
89+
8790
struct spi_device;
8891

8992
struct fsl_spi_platform_data {

0 commit comments

Comments
 (0)