aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3
diff options
context:
space:
mode:
authorGeorge Cherian <george.cherian@ti.com>2014-07-16 09:07:05 -0400
committerFelipe Balbi <balbi@ti.com>2014-07-16 10:35:30 -0400
commitca632a0d2fec10e62377a78a424d68c90f2e4345 (patch)
treea7e782fd3f15b1d93ee03f28557861ba6b3fac53 /drivers/usb/dwc3
parent66847062a6e33fa54b98714c7c954353e2596645 (diff)
usb: dwc3: omap: remove x_major calculation from revision register
Remove the x_major calculation logic from the wrapper revision register to differentiate between OMAP5 and AM437x. This was done to find the register offsets of wrapper register. Now that We do it using dt compatible, remove the whole logic. Signed-off-by: George Cherian <george.cherian@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r--drivers/usb/dwc3/dwc3-omap.c39
1 files changed, 7 insertions, 32 deletions
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index 4af4c3567656..25a6075ef319 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -77,10 +77,6 @@
77#define USBOTGSS_DEV_EBC_EN 0x0110 77#define USBOTGSS_DEV_EBC_EN 0x0110
78#define USBOTGSS_DEBUG_OFFSET 0x0600 78#define USBOTGSS_DEBUG_OFFSET 0x0600
79 79
80/* REVISION REGISTER */
81#define USBOTGSS_REVISION_XMAJOR(reg) ((reg >> 8) & 0x7)
82#define USBOTGSS_REVISION_XMAJOR1 1
83#define USBOTGSS_REVISION_XMAJOR2 2
84/* SYSCONFIG REGISTER */ 80/* SYSCONFIG REGISTER */
85#define USBOTGSS_SYSCONFIG_DMADISABLE (1 << 16) 81#define USBOTGSS_SYSCONFIG_DMADISABLE (1 << 16)
86 82
@@ -129,7 +125,6 @@ struct dwc3_omap {
129 u32 irq_eoi_offset; 125 u32 irq_eoi_offset;
130 u32 debug_offset; 126 u32 debug_offset;
131 u32 irq0_offset; 127 u32 irq0_offset;
132 u32 revision;
133 128
134 u32 dma_status:1; 129 u32 dma_status:1;
135 130
@@ -397,7 +392,6 @@ static int dwc3_omap_probe(struct platform_device *pdev)
397 int irq; 392 int irq;
398 393
399 int utmi_mode = 0; 394 int utmi_mode = 0;
400 int x_major;
401 395
402 u32 reg; 396 u32 reg;
403 397
@@ -448,32 +442,13 @@ static int dwc3_omap_probe(struct platform_device *pdev)
448 goto err0; 442 goto err0;
449 } 443 }
450 444
451 reg = dwc3_omap_readl(omap->base, USBOTGSS_REVISION); 445 /*
452 omap->revision = reg; 446 * Differentiate between OMAP5 and AM437x.
453 x_major = USBOTGSS_REVISION_XMAJOR(reg); 447 *
454 448 * For OMAP5(ES2.0) and AM437x wrapper revision is same, even
455 /* Differentiate between OMAP5 and AM437x */ 449 * though there are changes in wrapper register offsets.
456 switch (x_major) { 450 *
457 case USBOTGSS_REVISION_XMAJOR1: 451 * Using dt compatible to differentiate AM437x.
458 case USBOTGSS_REVISION_XMAJOR2:
459 omap->irq_eoi_offset = 0;
460 omap->irq0_offset = 0;
461 omap->irqmisc_offset = 0;
462 omap->utmi_otg_offset = 0;
463 omap->debug_offset = 0;
464 break;
465 default:
466 /* Default to the latest revision */
467 omap->irq_eoi_offset = USBOTGSS_EOI_OFFSET;
468 omap->irq0_offset = USBOTGSS_IRQ0_OFFSET;
469 omap->irqmisc_offset = USBOTGSS_IRQMISC_OFFSET;
470 omap->utmi_otg_offset = USBOTGSS_UTMI_OTG_OFFSET;
471 omap->debug_offset = USBOTGSS_DEBUG_OFFSET;
472 break;
473 }
474
475 /* For OMAP5(ES2.0) and AM437x x_major is 2 even though there are
476 * changes in wrapper registers, Using dt compatible for aegis
477 */ 452 */
478 453
479 if (of_device_is_compatible(node, "ti,am437x-dwc3")) { 454 if (of_device_is_compatible(node, "ti,am437x-dwc3")) {