ARM: omap1: move mach/usb.h to include/linux/soc
authorArnd Bergmann <arnd@arndb.de>
Tue, 6 Aug 2019 12:34:31 +0000 (14:34 +0200)
committerArnd Bergmann <arnd@arndb.de>
Thu, 21 Apr 2022 13:00:59 +0000 (15:00 +0200)
The register definitions in this header are used in at least four
different places, with little hope of completely cleaning that up.

Split up the file into a portion that becomes a linux-wide header
under include/linux/soc/ti/, and the parts that are actually only
needed by board files.

Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
20 files changed:
arch/arm/mach-omap1/board-ams-delta.c
arch/arm/mach-omap1/board-generic.c
arch/arm/mach-omap1/board-h2.c
arch/arm/mach-omap1/board-h3.c
arch/arm/mach-omap1/board-htcherald.c
arch/arm/mach-omap1/board-innovator.c
arch/arm/mach-omap1/board-nokia770.c
arch/arm/mach-omap1/board-osk.c
arch/arm/mach-omap1/board-palmte.c
arch/arm/mach-omap1/board-palmtt.c
arch/arm/mach-omap1/board-palmz71.c
arch/arm/mach-omap1/board-sx1.c
arch/arm/mach-omap1/clock_data.c
arch/arm/mach-omap1/include/mach/usb.h [deleted file]
arch/arm/mach-omap1/usb.c
arch/arm/mach-omap1/usb.h [new file with mode: 0644]
drivers/usb/gadget/udc/omap_udc.c
drivers/usb/host/ohci-omap.c
drivers/usb/phy/phy-isp1301-omap.c
include/linux/soc/ti/omap1-usb.h [new file with mode: 0644]

index 12d61ad983958712c462cfb91d400065238dcf56..5b0e99319990b56eb2dc55732b5024b7f6e98e76 100644 (file)
@@ -38,7 +38,7 @@
 #include <mach/mux.h>
 
 #include <mach/hardware.h>
-#include <mach/usb.h>
+#include "usb.h"
 
 #include "ams-delta-fiq.h"
 #include "board-ams-delta.h"
index c625549901154be69d99693c85aae342d89c8e5e..8ef0a9b17e92fd178eca54e0d9e96576dfc11235 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <mach/mux.h>
 
-#include <mach/usb.h>
+#include "usb.h"
 
 #include "common.h"
 
index 977b0b744c22aefb413ea53ecc3c64ca8011d5ad..b8cf0d84f8ab4985260821c8fe1c9f27f0ef24b4 100644 (file)
@@ -42,7 +42,7 @@
 #include "flash.h"
 
 #include <mach/hardware.h>
-#include <mach/usb.h>
+#include "usb.h"
 
 #include "common.h"
 #include "board-h2.h"
index 4249984f9c30948887d5cdd7a3e89068d77c2f27..86260498c344bef58ed29f4213d309f368d8a051 100644 (file)
@@ -45,7 +45,7 @@
 
 #include <mach/hardware.h>
 #include <mach/irqs.h>
-#include <mach/usb.h>
+#include "usb.h"
 
 #include "common.h"
 #include "board-h3.h"
index 258304edf23ea99b851508d9a02e948ce385e6c4..f7220b60eb61714ffefec9d044cde4245219129c 100644 (file)
@@ -31,7 +31,7 @@
 #include "mmc.h"
 
 #include <mach/irqs.h>
-#include <mach/usb.h>
+#include "usb.h"
 
 #include "common.h"
 
index 2425f1bacb338893a36a6a9e2690a5739e1fd04c..e7d6735d4701f893e86678f93d4b5a95c7a08ac1 100644 (file)
@@ -34,7 +34,7 @@
 #include <linux/platform_data/keypad-omap.h>
 
 #include <mach/hardware.h>
-#include <mach/usb.h>
+#include "usb.h"
 
 #include "iomap.h"
 #include "common.h"
index 11511ae2e0a2509d59fd23cbfb116d3f6d56a38f..e43c852103f55753f6c693ebedd4ec171b4a63b4 100644 (file)
@@ -31,7 +31,7 @@
 #include <mach/mux.h>
 
 #include <mach/hardware.h>
-#include <mach/usb.h>
+#include "usb.h"
 
 #include "common.h"
 #include "clock.h"
index e18b6f13300eb152b6aa102d62a712255f2f19fb..b627a4351cf0aee20999cee51f365ccc93e0e4d4 100644 (file)
@@ -52,7 +52,7 @@
 #include <mach/tc.h>
 
 #include <mach/hardware.h>
-#include <mach/usb.h>
+#include "usb.h"
 
 #include "common.h"
 
index ce6f0fcd9d12556ffc991a24285ca29a3b325489..4ac981c5cf7442fa5a3f6b300a63b0cbf8342a5f 100644 (file)
@@ -38,7 +38,7 @@
 #include <linux/platform_data/keypad-omap.h>
 
 #include <mach/hardware.h>
-#include <mach/usb.h>
+#include "usb.h"
 
 #include "mmc.h"
 #include "common.h"
index 8a08311c4e0593571b358514cc1c26a48f2f0f04..e48ae5fbe1b107ff44cb203fd51d653f2b37c990 100644 (file)
@@ -38,7 +38,7 @@
 #include <linux/platform_data/keypad-omap.h>
 
 #include <mach/hardware.h>
-#include <mach/usb.h>
+#include "usb.h"
 
 #include "common.h"
 
index 034e5bc6a02963b673f63d2d9257fc251e5c72ec..37db0ab315286b41fe0cf4aaf54771aa575006f5 100644 (file)
@@ -40,7 +40,7 @@
 #include <linux/platform_data/keypad-omap.h>
 
 #include <mach/hardware.h>
-#include <mach/usb.h>
+#include "usb.h"
 
 #include "common.h"
 
index bb9ec345e2047d8c08aaceef042d1cba086432f0..0965b1b689ec36c64ab2b471b719f366b7722905 100644 (file)
@@ -38,7 +38,7 @@
 #include "board-sx1.h"
 
 #include <mach/hardware.h>
-#include <mach/usb.h>
+#include "usb.h"
 
 #include "common.h"
 
index 3ebcd96efbff8cd5a694f215e36490c8a58e3146..ef46c5f67cf9778ed0a08986742341987c4b0568 100644 (file)
@@ -22,7 +22,7 @@
 #include "soc.h"
 
 #include <mach/hardware.h>
-#include <mach/usb.h>   /* for OTG_BASE */
+#include "usb.h"   /* for OTG_BASE */
 
 #include "iomap.h"
 #include "clock.h"
diff --git a/arch/arm/mach-omap1/include/mach/usb.h b/arch/arm/mach-omap1/include/mach/usb.h
deleted file mode 100644 (file)
index 5429d86..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * FIXME correct answer depends on hmc_mode,
- * as does (on omap1) any nonzero value for config->otg port number
- */
-#if IS_ENABLED(CONFIG_USB_OMAP)
-#define        is_usb0_device(config)  1
-#else
-#define        is_usb0_device(config)  0
-#endif
-
-#include <linux/platform_data/usb-omap1.h>
-
-#if IS_ENABLED(CONFIG_USB_SUPPORT)
-void omap1_usb_init(struct omap_usb_config *pdata);
-#else
-static inline void omap1_usb_init(struct omap_usb_config *pdata)
-{
-}
-#endif
-
-#define OMAP1_OTG_BASE                 0xfffb0400
-#define OMAP1_UDC_BASE                 0xfffb4000
-#define OMAP1_OHCI_BASE                        0xfffba000
-
-#define OMAP2_OHCI_BASE                        0x4805e000
-#define OMAP2_UDC_BASE                 0x4805e200
-#define OMAP2_OTG_BASE                 0x4805e300
-#define OTG_BASE                       OMAP1_OTG_BASE
-#define UDC_BASE                       OMAP1_UDC_BASE
-#define OMAP_OHCI_BASE                 OMAP1_OHCI_BASE
-
-/*
- * OTG and transceiver registers, for OMAPs starting with ARM926
- */
-#define OTG_REV                                (OTG_BASE + 0x00)
-#define OTG_SYSCON_1                   (OTG_BASE + 0x04)
-#      define   USB2_TRX_MODE(w)       (((w)>>24)&0x07)
-#      define   USB1_TRX_MODE(w)       (((w)>>20)&0x07)
-#      define   USB0_TRX_MODE(w)       (((w)>>16)&0x07)
-#      define   OTG_IDLE_EN            (1 << 15)
-#      define   HST_IDLE_EN            (1 << 14)
-#      define   DEV_IDLE_EN            (1 << 13)
-#      define   OTG_RESET_DONE         (1 << 2)
-#      define   OTG_SOFT_RESET         (1 << 1)
-#define OTG_SYSCON_2                   (OTG_BASE + 0x08)
-#      define   OTG_EN                 (1 << 31)
-#      define   USBX_SYNCHRO           (1 << 30)
-#      define   OTG_MST16              (1 << 29)
-#      define   SRP_GPDATA             (1 << 28)
-#      define   SRP_GPDVBUS            (1 << 27)
-#      define   SRP_GPUVBUS(w)         (((w)>>24)&0x07)
-#      define   A_WAIT_VRISE(w)        (((w)>>20)&0x07)
-#      define   B_ASE_BRST(w)          (((w)>>16)&0x07)
-#      define   SRP_DPW                (1 << 14)
-#      define   SRP_DATA               (1 << 13)
-#      define   SRP_VBUS               (1 << 12)
-#      define   OTG_PADEN              (1 << 10)
-#      define   HMC_PADEN              (1 << 9)
-#      define   UHOST_EN               (1 << 8)
-#      define   HMC_TLLSPEED           (1 << 7)
-#      define   HMC_TLLATTACH          (1 << 6)
-#      define   OTG_HMC(w)             (((w)>>0)&0x3f)
-#define OTG_CTRL                       (OTG_BASE + 0x0c)
-#      define   OTG_USB2_EN            (1 << 29)
-#      define   OTG_USB2_DP            (1 << 28)
-#      define   OTG_USB2_DM            (1 << 27)
-#      define   OTG_USB1_EN            (1 << 26)
-#      define   OTG_USB1_DP            (1 << 25)
-#      define   OTG_USB1_DM            (1 << 24)
-#      define   OTG_USB0_EN            (1 << 23)
-#      define   OTG_USB0_DP            (1 << 22)
-#      define   OTG_USB0_DM            (1 << 21)
-#      define   OTG_ASESSVLD           (1 << 20)
-#      define   OTG_BSESSEND           (1 << 19)
-#      define   OTG_BSESSVLD           (1 << 18)
-#      define   OTG_VBUSVLD            (1 << 17)
-#      define   OTG_ID                 (1 << 16)
-#      define   OTG_DRIVER_SEL         (1 << 15)
-#      define   OTG_A_SETB_HNPEN       (1 << 12)
-#      define   OTG_A_BUSREQ           (1 << 11)
-#      define   OTG_B_HNPEN            (1 << 9)
-#      define   OTG_B_BUSREQ           (1 << 8)
-#      define   OTG_BUSDROP            (1 << 7)
-#      define   OTG_PULLDOWN           (1 << 5)
-#      define   OTG_PULLUP             (1 << 4)
-#      define   OTG_DRV_VBUS           (1 << 3)
-#      define   OTG_PD_VBUS            (1 << 2)
-#      define   OTG_PU_VBUS            (1 << 1)
-#      define   OTG_PU_ID              (1 << 0)
-#define OTG_IRQ_EN                     (OTG_BASE + 0x10)       /* 16-bit */
-#      define   DRIVER_SWITCH          (1 << 15)
-#      define   A_VBUS_ERR             (1 << 13)
-#      define   A_REQ_TMROUT           (1 << 12)
-#      define   A_SRP_DETECT           (1 << 11)
-#      define   B_HNP_FAIL             (1 << 10)
-#      define   B_SRP_TMROUT           (1 << 9)
-#      define   B_SRP_DONE             (1 << 8)
-#      define   B_SRP_STARTED          (1 << 7)
-#      define   OPRT_CHG               (1 << 0)
-#define OTG_IRQ_SRC                    (OTG_BASE + 0x14)       /* 16-bit */
-       // same bits as in IRQ_EN
-#define OTG_OUTCTRL                    (OTG_BASE + 0x18)       /* 16-bit */
-#      define   OTGVPD                 (1 << 14)
-#      define   OTGVPU                 (1 << 13)
-#      define   OTGPUID                (1 << 12)
-#      define   USB2VDR                (1 << 10)
-#      define   USB2PDEN               (1 << 9)
-#      define   USB2PUEN               (1 << 8)
-#      define   USB1VDR                (1 << 6)
-#      define   USB1PDEN               (1 << 5)
-#      define   USB1PUEN               (1 << 4)
-#      define   USB0VDR                (1 << 2)
-#      define   USB0PDEN               (1 << 1)
-#      define   USB0PUEN               (1 << 0)
-#define OTG_TEST                       (OTG_BASE + 0x20)       /* 16-bit */
-#define OTG_VENDOR_CODE                        (OTG_BASE + 0xfc)       /* 16-bit */
-
-/*-------------------------------------------------------------------------*/
-
-/* OMAP1 */
-#define        USB_TRANSCEIVER_CTRL            (0xfffe1000 + 0x0064)
-#      define  CONF_USB2_UNI_R         (1 << 8)
-#      define  CONF_USB1_UNI_R         (1 << 7)
-#      define  CONF_USB_PORT0_R(x)     (((x)>>4)&0x7)
-#      define  CONF_USB0_ISOLATE_R     (1 << 3)
-#      define  CONF_USB_PWRDN_DM_R     (1 << 2)
-#      define  CONF_USB_PWRDN_DP_R     (1 << 1)
index e60831c82b789fac6860517d1734d740e019ef4c..fa658054fc579d38020cb1bcb7cd2238c5185bc9 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <mach/mux.h>
 
-#include <mach/usb.h>
+#include "usb.h"
 
 #include "common.h"
 
diff --git a/arch/arm/mach-omap1/usb.h b/arch/arm/mach-omap1/usb.h
new file mode 100644 (file)
index 0000000..08c9344
--- /dev/null
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * fixme correct answer depends on hmc_mode,
+ * as does (on omap1) any nonzero value for config->otg port number
+ */
+#include <linux/platform_data/usb-omap1.h>
+#include <linux/soc/ti/omap1-usb.h>
+
+#if IS_ENABLED(CONFIG_USB_OMAP)
+#define        is_usb0_device(config)  1
+#else
+#define        is_usb0_device(config)  0
+#endif
+
+#if IS_ENABLED(CONFIG_USB_SUPPORT)
+void omap1_usb_init(struct omap_usb_config *pdata);
+#else
+static inline void omap1_usb_init(struct omap_usb_config *pdata)
+{
+}
+#endif
+
+#define OMAP1_OHCI_BASE                        0xfffba000
+#define OMAP2_OHCI_BASE                        0x4805e000
+#define OMAP_OHCI_BASE                 OMAP1_OHCI_BASE
index 2d9815dad2ff15abab3325a871841e673a4cde71..b1da584585cfbb222da58ad72fa4c3c616f69417 100644 (file)
@@ -40,8 +40,9 @@
 #include <asm/mach-types.h>
 
 #include <linux/omap-dma.h>
+#include <linux/platform_data/usb-omap1.h>
 
-#include <mach/usb.h>
+#include <linux/soc/ti/omap1-usb.h>
 
 #include "omap_udc.h"
 
index 45dcf8292072697930b024a4008afa2ea7e60e9e..7be1ffefc40e67d2242edfe727887d8b0e9ce937 100644 (file)
@@ -25,6 +25,8 @@
 #include <linux/module.h>
 #include <linux/usb/otg.h>
 #include <linux/platform_device.h>
+#include <linux/platform_data/usb-omap1.h>
+#include <linux/soc/ti/omap1-usb.h>
 #include <linux/signal.h>
 #include <linux/usb.h>
 #include <linux/usb/hcd.h>
@@ -37,8 +39,6 @@
 #include <mach/mux.h>
 
 #include <mach/hardware.h>
-#include <mach/usb.h>
-
 
 #define DRIVER_DESC "OHCI OMAP driver"
 
index 190699b38b41ecde0ac9ae5ff13050ca29be6ffd..88aade82b82b9ff9f42e85bde136d269e9e1bd0b 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <mach/mux.h>
 
-#include <mach/usb.h>
+#include <linux/soc/ti/omap1-usb.h>
 
 #undef VERBOSE
 
diff --git a/include/linux/soc/ti/omap1-usb.h b/include/linux/soc/ti/omap1-usb.h
new file mode 100644 (file)
index 0000000..6748869
--- /dev/null
@@ -0,0 +1,116 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __SOC_TI_OMAP1_USB
+#define __SOC_TI_OMAP1_USB
+/*
+ * Constants in this file are used all over the place, in platform
+ * code, as well as the udc, phy and ohci drivers.
+ * This is not a great design, but unlikely to get fixed after
+ * such a long time. Don't do this elsewhere.
+ */
+
+#define OMAP1_OTG_BASE                 0xfffb0400
+#define OMAP1_UDC_BASE                 0xfffb4000
+
+#define OMAP2_UDC_BASE                 0x4805e200
+#define OMAP2_OTG_BASE                 0x4805e300
+#define OTG_BASE                       OMAP1_OTG_BASE
+#define UDC_BASE                       OMAP1_UDC_BASE
+
+/*
+ * OTG and transceiver registers, for OMAPs starting with ARM926
+ */
+#define OTG_REV                                (OTG_BASE + 0x00)
+#define OTG_SYSCON_1                   (OTG_BASE + 0x04)
+#      define   USB2_TRX_MODE(w)       (((w)>>24)&0x07)
+#      define   USB1_TRX_MODE(w)       (((w)>>20)&0x07)
+#      define   USB0_TRX_MODE(w)       (((w)>>16)&0x07)
+#      define   OTG_IDLE_EN            (1 << 15)
+#      define   HST_IDLE_EN            (1 << 14)
+#      define   DEV_IDLE_EN            (1 << 13)
+#      define   OTG_RESET_DONE         (1 << 2)
+#      define   OTG_SOFT_RESET         (1 << 1)
+#define OTG_SYSCON_2                   (OTG_BASE + 0x08)
+#      define   OTG_EN                 (1 << 31)
+#      define   USBX_SYNCHRO           (1 << 30)
+#      define   OTG_MST16              (1 << 29)
+#      define   SRP_GPDATA             (1 << 28)
+#      define   SRP_GPDVBUS            (1 << 27)
+#      define   SRP_GPUVBUS(w)         (((w)>>24)&0x07)
+#      define   A_WAIT_VRISE(w)        (((w)>>20)&0x07)
+#      define   B_ASE_BRST(w)          (((w)>>16)&0x07)
+#      define   SRP_DPW                (1 << 14)
+#      define   SRP_DATA               (1 << 13)
+#      define   SRP_VBUS               (1 << 12)
+#      define   OTG_PADEN              (1 << 10)
+#      define   HMC_PADEN              (1 << 9)
+#      define   UHOST_EN               (1 << 8)
+#      define   HMC_TLLSPEED           (1 << 7)
+#      define   HMC_TLLATTACH          (1 << 6)
+#      define   OTG_HMC(w)             (((w)>>0)&0x3f)
+#define OTG_CTRL                       (OTG_BASE + 0x0c)
+#      define   OTG_USB2_EN            (1 << 29)
+#      define   OTG_USB2_DP            (1 << 28)
+#      define   OTG_USB2_DM            (1 << 27)
+#      define   OTG_USB1_EN            (1 << 26)
+#      define   OTG_USB1_DP            (1 << 25)
+#      define   OTG_USB1_DM            (1 << 24)
+#      define   OTG_USB0_EN            (1 << 23)
+#      define   OTG_USB0_DP            (1 << 22)
+#      define   OTG_USB0_DM            (1 << 21)
+#      define   OTG_ASESSVLD           (1 << 20)
+#      define   OTG_BSESSEND           (1 << 19)
+#      define   OTG_BSESSVLD           (1 << 18)
+#      define   OTG_VBUSVLD            (1 << 17)
+#      define   OTG_ID                 (1 << 16)
+#      define   OTG_DRIVER_SEL         (1 << 15)
+#      define   OTG_A_SETB_HNPEN       (1 << 12)
+#      define   OTG_A_BUSREQ           (1 << 11)
+#      define   OTG_B_HNPEN            (1 << 9)
+#      define   OTG_B_BUSREQ           (1 << 8)
+#      define   OTG_BUSDROP            (1 << 7)
+#      define   OTG_PULLDOWN           (1 << 5)
+#      define   OTG_PULLUP             (1 << 4)
+#      define   OTG_DRV_VBUS           (1 << 3)
+#      define   OTG_PD_VBUS            (1 << 2)
+#      define   OTG_PU_VBUS            (1 << 1)
+#      define   OTG_PU_ID              (1 << 0)
+#define OTG_IRQ_EN                     (OTG_BASE + 0x10)       /* 16-bit */
+#      define   DRIVER_SWITCH          (1 << 15)
+#      define   A_VBUS_ERR             (1 << 13)
+#      define   A_REQ_TMROUT           (1 << 12)
+#      define   A_SRP_DETECT           (1 << 11)
+#      define   B_HNP_FAIL             (1 << 10)
+#      define   B_SRP_TMROUT           (1 << 9)
+#      define   B_SRP_DONE             (1 << 8)
+#      define   B_SRP_STARTED          (1 << 7)
+#      define   OPRT_CHG               (1 << 0)
+#define OTG_IRQ_SRC                    (OTG_BASE + 0x14)       /* 16-bit */
+       // same bits as in IRQ_EN
+#define OTG_OUTCTRL                    (OTG_BASE + 0x18)       /* 16-bit */
+#      define   OTGVPD                 (1 << 14)
+#      define   OTGVPU                 (1 << 13)
+#      define   OTGPUID                (1 << 12)
+#      define   USB2VDR                (1 << 10)
+#      define   USB2PDEN               (1 << 9)
+#      define   USB2PUEN               (1 << 8)
+#      define   USB1VDR                (1 << 6)
+#      define   USB1PDEN               (1 << 5)
+#      define   USB1PUEN               (1 << 4)
+#      define   USB0VDR                (1 << 2)
+#      define   USB0PDEN               (1 << 1)
+#      define   USB0PUEN               (1 << 0)
+#define OTG_TEST                       (OTG_BASE + 0x20)       /* 16-bit */
+#define OTG_VENDOR_CODE                        (OTG_BASE + 0xfc)       /* 16-bit */
+
+/*-------------------------------------------------------------------------*/
+
+/* OMAP1 */
+#define        USB_TRANSCEIVER_CTRL            (0xfffe1000 + 0x0064)
+#      define  CONF_USB2_UNI_R         (1 << 8)
+#      define  CONF_USB1_UNI_R         (1 << 7)
+#      define  CONF_USB_PORT0_R(x)     (((x)>>4)&0x7)
+#      define  CONF_USB0_ISOLATE_R     (1 << 3)
+#      define  CONF_USB_PWRDN_DM_R     (1 << 2)
+#      define  CONF_USB_PWRDN_DP_R     (1 << 1)
+
+#endif