From: Alice Guo <[email protected]>

Move USB PHY related register definitions from ehci-mx6.c to the common
regs-usbphy.h header file to enable sharing across different USB
drivers.

Signed-off-by: Alice Guo <[email protected]>
---
 arch/arm/include/asm/mach-imx/regs-usbphy.h |  3 +++
 drivers/usb/host/ehci-mx6.c                 | 15 +--------------
 2 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/arch/arm/include/asm/mach-imx/regs-usbphy.h 
b/arch/arm/include/asm/mach-imx/regs-usbphy.h
index 2b18ec20f3f..543c825f9c3 100644
--- a/arch/arm/include/asm/mach-imx/regs-usbphy.h
+++ b/arch/arm/include/asm/mach-imx/regs-usbphy.h
@@ -22,4 +22,7 @@
 #define USBPHY_CTRL_CLKGATE                            (1 << 30)
 #define USBPHY_CTRL_SFTRST                             (1 << 31)
 
+#define USBNC_PHY_STATUS_OFFSET        0x23C
+#define USBNC_PHYSTATUS_ID_DIG BIT(4) /* otg_id status */
+
 #endif /* __REGS_USBPHY_H__ */
diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c
index 8f01b29c74e..cfaf49d67f0 100644
--- a/drivers/usb/host/ehci-mx6.c
+++ b/drivers/usb/host/ehci-mx6.c
@@ -17,6 +17,7 @@
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/clock.h>
 #include <asm/mach-imx/iomux-v3.h>
+#include <asm/mach-imx/regs-usbphy.h>
 #include <asm/mach-imx/sys_proto.h>
 #include <dm.h>
 #include <asm/mach-types.h>
@@ -36,18 +37,6 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define USB_H1_CTRL_OFFSET     0x04
 
-#define USBPHY_CTRL                            0x00000030
-#define USBPHY_CTRL_SET                                0x00000034
-#define USBPHY_CTRL_CLR                                0x00000038
-#define USBPHY_CTRL_TOG                                0x0000003c
-
-#define USBPHY_PWD                             0x00000000
-#define USBPHY_CTRL_SFTRST                     0x80000000
-#define USBPHY_CTRL_CLKGATE                    0x40000000
-#define USBPHY_CTRL_ENUTMILEVEL3               0x00008000
-#define USBPHY_CTRL_ENUTMILEVEL2               0x00004000
-#define USBPHY_CTRL_OTG_ID                     0x08000000
-
 #define ANADIG_USB2_CHRG_DETECT_EN_B           0x00100000
 #define ANADIG_USB2_CHRG_DETECT_CHK_CHRG_B     0x00080000
 
@@ -57,8 +46,6 @@ DECLARE_GLOBAL_DATA_PTR;
 #define ANADIG_USB2_PLL_480_CTRL_EN_USB_CLKS   0x00000040
 
 #define USBNC_OFFSET           0x200
-#define USBNC_PHY_STATUS_OFFSET        0x23C
-#define USBNC_PHYSTATUS_ID_DIG (1 << 4) /* otg_id status */
 #define USBNC_PHYCFG2_ACAENB   (1 << 4) /* otg_id detection enable */
 #define UCTRL_PWR_POL          (1 << 9) /* OTG Polarity of Power Pin */
 #define UCTRL_OVER_CUR_POL     (1 << 8) /* OTG Polarity of Overcurrent */

-- 
2.43.0

Reply via email to