linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] omap legacy full speed usb cleanup for v3.6
@ 2012-05-21 19:00 Tony Lindgren
  2012-05-21 19:01 ` [PATCH 1/4] ARM: OMAP3: There is no FS USB controller on omap3 Tony Lindgren
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Tony Lindgren @ 2012-05-21 19:00 UTC (permalink / raw)
  To: linux-arm-kernel

Hi all,

This series removes the old legacy fulls speed support for
omap2 as it's pretty much only used for omap1 only.

For omap2, only n8x0 seems to have active development, and
that has the external high speed tusb chip instead.

This allows removes the last user of omap_read/write for omap2+,
removes cpu_is_omapxxx usage under drivers/usb except for omap1,
simplifies the plat/usb.h allowing further clean-up, simplifies
the DMA engine conversion by one driver, and so on.

The patches are against today's linux next branch.

Regards,

Tony


---

Tony Lindgren (4):
      ARM: OMAP3: There is no FS USB controller on omap3
      ARM: OMAP2: Remove legacy USB FS support
      ARM: OMAP: Make FS USB omap1 only
      USB: Remove omap2 support from omap_udc.c


 arch/arm/mach-omap1/board-ams-delta.c   |    2 
 arch/arm/mach-omap1/board-generic.c     |    4 
 arch/arm/mach-omap1/board-h2.c          |    2 
 arch/arm/mach-omap1/board-h3.c          |    2 
 arch/arm/mach-omap1/board-htcherald.c   |    2 
 arch/arm/mach-omap1/board-innovator.c   |    2 
 arch/arm/mach-omap1/board-nokia770.c    |    2 
 arch/arm/mach-omap1/board-osk.c         |    2 
 arch/arm/mach-omap1/board-palmte.c      |    2 
 arch/arm/mach-omap1/board-palmtt.c      |    2 
 arch/arm/mach-omap1/board-palmz71.c     |    2 
 arch/arm/mach-omap1/board-sx1.c         |    2 
 arch/arm/mach-omap1/board-voiceblue.c   |    3 
 arch/arm/mach-omap1/clock_data.c        |    3 
 arch/arm/mach-omap1/include/mach/usb.h  |  165 ++++++++++++++
 arch/arm/mach-omap1/usb.c               |  116 ++++++++++
 arch/arm/mach-omap2/Kconfig             |    3 
 arch/arm/mach-omap2/Makefile            |    3 
 arch/arm/mach-omap2/board-2430sdp.c     |   11 -
 arch/arm/mach-omap2/board-apollon.c     |   18 --
 arch/arm/mach-omap2/board-h4.c          |   13 -
 arch/arm/mach-omap2/usb-fs.c            |  359 -------------------------------
 arch/arm/plat-omap/Makefile             |    2 
 arch/arm/plat-omap/include/plat/board.h |   38 ---
 arch/arm/plat-omap/include/plat/usb.h   |  196 -----------------
 arch/arm/plat-omap/usb.c                |  145 -------------
 drivers/usb/gadget/Kconfig              |    2 
 drivers/usb/gadget/omap_udc.c           |  116 ++--------
 drivers/usb/host/Kconfig                |    2 
 drivers/usb/host/ohci-omap.c            |    7 -
 drivers/usb/otg/isp1301_omap.c          |    2 
 31 files changed, 333 insertions(+), 897 deletions(-)
 create mode 100644 arch/arm/mach-omap1/include/mach/usb.h
 delete mode 100644 arch/arm/mach-omap2/usb-fs.c
 delete mode 100644 arch/arm/plat-omap/usb.c

-- 
Signature

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/4] ARM: OMAP3: There is no FS USB controller on omap3
  2012-05-21 19:00 [PATCH 0/4] omap legacy full speed usb cleanup for v3.6 Tony Lindgren
@ 2012-05-21 19:01 ` Tony Lindgren
  2012-05-22  7:06   ` Felipe Balbi
  2012-05-21 19:01 ` [PATCH 2/4] ARM: OMAP2: Remove legacy USB FS support Tony Lindgren
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Tony Lindgren @ 2012-05-21 19:01 UTC (permalink / raw)
  To: linux-arm-kernel

We should not select ARCH_OMAP_OTG as the hardware does not
have the legacy FS (Full Speed) USB interface.

Cc: linux-usb at vger.kernel.org
Cc: Felipe Balbi <balbi@ti.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/Kconfig |    1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 4cf5142..0e4dd67 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -76,7 +76,6 @@ config SOC_OMAP3430
 	bool "OMAP3430 support"
 	depends on ARCH_OMAP3
 	default y
-	select ARCH_OMAP_OTG
 
 config SOC_TI81XX
 	bool "TI81XX support"

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/4] ARM: OMAP2: Remove legacy USB FS support
  2012-05-21 19:00 [PATCH 0/4] omap legacy full speed usb cleanup for v3.6 Tony Lindgren
  2012-05-21 19:01 ` [PATCH 1/4] ARM: OMAP3: There is no FS USB controller on omap3 Tony Lindgren
@ 2012-05-21 19:01 ` Tony Lindgren
  2012-05-22  7:07   ` Felipe Balbi
  2012-05-21 19:01 ` [PATCH 3/4] ARM: OMAP: Make FS USB omap1 only Tony Lindgren
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Tony Lindgren @ 2012-05-21 19:01 UTC (permalink / raw)
  To: linux-arm-kernel

The FS (Full Speed) USB controller is available on 2420 and 2430,
but not being used.

Out of the 2420 based boards only Nokia N8X0 are seeing active
development and they have external HS (High Speed) TUSB controller.
On omap 2430sdp there is MUSB HS controller, so there's no need
to use the legacy USB FS controller.

That leaves only H4 and Apollon boards that could use the FS USB
controller. As both H4 and Apollon boards are old proprietary
development boards, it's unlikely that we have any active
developers working on those boards using the USB.

So remove the FS USB support for omap2 machines. Patches are
welcome if somebody wants to instead fix it all up to the
current standards.

Cc: linux-usb at vger.kernel.org
Cc: Felipe Balbi <balbi@ti.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/Kconfig         |    2 
 arch/arm/mach-omap2/Makefile        |    3 
 arch/arm/mach-omap2/board-2430sdp.c |   11 -
 arch/arm/mach-omap2/board-apollon.c |   18 --
 arch/arm/mach-omap2/board-h4.c      |   13 -
 arch/arm/mach-omap2/usb-fs.c        |  359 -----------------------------------
 6 files changed, 406 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/usb-fs.c

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 0e4dd67..042f157 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -64,13 +64,11 @@ config SOC_OMAP2420
 	depends on ARCH_OMAP2
 	default y
 	select OMAP_DM_TIMER
-	select ARCH_OMAP_OTG
 
 config SOC_OMAP2430
 	bool "OMAP2430 support"
 	depends on ARCH_OMAP2
 	default y
-	select ARCH_OMAP_OTG
 
 config SOC_OMAP3430
 	bool "OMAP3430 support"
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index fa742f3..664224f 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -244,9 +244,6 @@ obj-y					+= $(omap-flash-y) $(omap-flash-m)
 omap-hsmmc-$(CONFIG_MMC_OMAP_HS)	:= hsmmc.o
 obj-y					+= $(omap-hsmmc-m) $(omap-hsmmc-y)
 
-
-usbfs-$(CONFIG_ARCH_OMAP_OTG)		:= usb-fs.o
-obj-y					+= $(usbfs-m) $(usbfs-y)
 obj-y					+= usb-musb.o
 obj-y					+= omap_phy_internal.o
 
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index 99ca6ba..6523aea 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -254,16 +254,6 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
 	{}	/* Terminator */
 };
 
-static struct omap_usb_config sdp2430_usb_config __initdata = {
-	.otg		= 1,
-#ifdef  CONFIG_USB_GADGET_OMAP
-	.hmc_mode	= 0x0,
-#elif   defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
-	.hmc_mode	= 0x1,
-#endif
-	.pins[0]	= 3,
-};
-
 #ifdef CONFIG_OMAP_MUX
 static struct omap_board_mux board_mux[] __initdata = {
 	{ .reg_offset = OMAP_MUX_TERMINATOR },
@@ -280,7 +270,6 @@ static void __init omap_2430sdp_init(void)
 	omap_serial_init();
 	omap_sdrc_init(NULL, NULL);
 	omap_hsmmc_init(mmc);
-	omap2_usbfs_init(&sdp2430_usb_config);
 
 	omap_mux_init_signal("usb0hs_stp", OMAP_PULL_ENA | OMAP_PULL_UP);
 	usb_musb_init(NULL);
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
index 502c31e..519bcd3 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -35,7 +35,6 @@
 #include <asm/mach/flash.h>
 
 #include <plat/led.h>
-#include <plat/usb.h>
 #include <plat/board.h>
 #include "common.h"
 #include <plat/gpmc.h>
@@ -253,13 +252,6 @@ out:
 	clk_put(gpmc_fck);
 }
 
-static struct omap_usb_config apollon_usb_config __initdata = {
-	.register_dev	= 1,
-	.hmc_mode	= 0x14,	/* 0:dev 1:host1 2:disable */
-
-	.pins[0]	= 6,
-};
-
 static struct panel_generic_dpi_data apollon_panel_data = {
 	.name			= "apollon",
 };
@@ -297,15 +289,6 @@ static void __init apollon_led_init(void)
 	gpio_request_array(apollon_gpio_leds, ARRAY_SIZE(apollon_gpio_leds));
 }
 
-static void __init apollon_usb_init(void)
-{
-	/* USB device */
-	/* DEVICE_SUSPEND */
-	omap_mux_init_signal("mcbsp2_clkx.gpio_12", 0);
-	gpio_request_one(12, GPIOF_OUT_INIT_LOW, "USB suspend");
-	omap2_usbfs_init(&apollon_usb_config);
-}
-
 #ifdef CONFIG_OMAP_MUX
 static struct omap_board_mux board_mux[] __initdata = {
 	{ .reg_offset = OMAP_MUX_TERMINATOR },
@@ -321,7 +304,6 @@ static void __init omap_apollon_init(void)
 	apollon_init_smc91x();
 	apollon_led_init();
 	apollon_flash_init();
-	apollon_usb_init();
 
 	/* REVISIT: where's the correct place */
 	omap_mux_init_signal("sys_nirq", OMAP_PULL_ENA | OMAP_PULL_UP);
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 876becf..ace2048 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -32,7 +32,6 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include <plat/usb.h>
 #include <plat/board.h>
 #include "common.h"
 #include <plat/menelaus.h>
@@ -329,17 +328,6 @@ static void __init h4_init_flash(void)
 	h4_flash_resource.end	= base + SZ_64M - 1;
 }
 
-static struct omap_usb_config h4_usb_config __initdata = {
-	/* S1.10 OFF -- usb "download port"
-	 * usb0 switched to Mini-B port and isp1105 transceiver;
-	 * S2.POS3 = ON, S2.POS4 = OFF ... to enable battery charging
-	 */
-	.register_dev	= 1,
-	.pins[0]	= 3,
-/*	.hmc_mode	= 0x14,*/	/* 0:dev 1:host 2:disable */
-	.hmc_mode	= 0x00,		/* 0:dev|otg 1:disable 2:disable */
-};
-
 static struct at24_platform_data m24c01 = {
 	.byte_len	= SZ_1K / 8,
 	.page_size	= 16,
@@ -381,7 +369,6 @@ static void __init omap_h4_init(void)
 			ARRAY_SIZE(h4_i2c_board_info));
 
 	platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices));
-	omap2_usbfs_init(&h4_usb_config);
 	omap_serial_init();
 	omap_sdrc_init(NULL, NULL);
 	h4_init_flash();
diff --git a/arch/arm/mach-omap2/usb-fs.c b/arch/arm/mach-omap2/usb-fs.c
deleted file mode 100644
index 1481078..0000000
--- a/arch/arm/mach-omap2/usb-fs.c
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
- * Platform level USB initialization for FS USB OTG controller on omap1 and 24xx
- *
- * Copyright (C) 2004 Texas Instruments, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/errno.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/clk.h>
-#include <linux/err.h>
-
-#include <asm/irq.h>
-
-#include <plat/usb.h>
-#include <plat/board.h>
-
-#include "control.h"
-#include "mux.h"
-
-#define INT_USB_IRQ_GEN		INT_24XX_USB_IRQ_GEN
-#define INT_USB_IRQ_NISO	INT_24XX_USB_IRQ_NISO
-#define INT_USB_IRQ_ISO		INT_24XX_USB_IRQ_ISO
-#define INT_USB_IRQ_HGEN	INT_24XX_USB_IRQ_HGEN
-#define INT_USB_IRQ_OTG		INT_24XX_USB_IRQ_OTG
-
-#if defined(CONFIG_ARCH_OMAP2)
-
-#ifdef	CONFIG_USB_GADGET_OMAP
-
-static struct resource udc_resources[] = {
-	/* order is significant! */
-	{		/* registers */
-		.start		= UDC_BASE,
-		.end		= UDC_BASE + 0xff,
-		.flags		= IORESOURCE_MEM,
-	}, {		/* general IRQ */
-		.start		= INT_USB_IRQ_GEN,
-		.flags		= IORESOURCE_IRQ,
-	}, {		/* PIO IRQ */
-		.start		= INT_USB_IRQ_NISO,
-		.flags		= IORESOURCE_IRQ,
-	}, {		/* SOF IRQ */
-		.start		= INT_USB_IRQ_ISO,
-		.flags		= IORESOURCE_IRQ,
-	},
-};
-
-static u64 udc_dmamask = ~(u32)0;
-
-static struct platform_device udc_device = {
-	.name		= "omap_udc",
-	.id		= -1,
-	.dev = {
-		.dma_mask		= &udc_dmamask,
-		.coherent_dma_mask	= 0xffffffff,
-	},
-	.num_resources	= ARRAY_SIZE(udc_resources),
-	.resource	= udc_resources,
-};
-
-static inline void udc_device_init(struct omap_usb_config *pdata)
-{
-	pdata->udc_device = &udc_device;
-}
-
-#else
-
-static inline void udc_device_init(struct omap_usb_config *pdata)
-{
-}
-
-#endif
-
-#if	defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
-
-/* The dmamask must be set for OHCI to work */
-static u64 ohci_dmamask = ~(u32)0;
-
-static struct resource ohci_resources[] = {
-	{
-		.start	= OMAP_OHCI_BASE,
-		.end	= OMAP_OHCI_BASE + 0xff,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_USB_IRQ_HGEN,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct platform_device ohci_device = {
-	.name			= "ohci",
-	.id			= -1,
-	.dev = {
-		.dma_mask		= &ohci_dmamask,
-		.coherent_dma_mask	= 0xffffffff,
-	},
-	.num_resources	= ARRAY_SIZE(ohci_resources),
-	.resource		= ohci_resources,
-};
-
-static inline void ohci_device_init(struct omap_usb_config *pdata)
-{
-	pdata->ohci_device = &ohci_device;
-}
-
-#else
-
-static inline void ohci_device_init(struct omap_usb_config *pdata)
-{
-}
-
-#endif
-
-#if	defined(CONFIG_USB_OTG) && defined(CONFIG_ARCH_OMAP_OTG)
-
-static struct resource otg_resources[] = {
-	/* order is significant! */
-	{
-		.start		= OTG_BASE,
-		.end		= OTG_BASE + 0xff,
-		.flags		= IORESOURCE_MEM,
-	}, {
-		.start		= INT_USB_IRQ_OTG,
-		.flags		= IORESOURCE_IRQ,
-	},
-};
-
-static struct platform_device otg_device = {
-	.name		= "omap_otg",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(otg_resources),
-	.resource	= otg_resources,
-};
-
-static inline void otg_device_init(struct omap_usb_config *pdata)
-{
-	pdata->otg_device = &otg_device;
-}
-
-#else
-
-static inline void otg_device_init(struct omap_usb_config *pdata)
-{
-}
-
-#endif
-
-static void omap2_usb_devconf_clear(u8 port, u32 mask)
-{
-	u32 r;
-
-	r = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
-	r &= ~USBTXWRMODEI(port, mask);
-	omap_ctrl_writel(r, OMAP2_CONTROL_DEVCONF0);
-}
-
-static void omap2_usb_devconf_set(u8 port, u32 mask)
-{
-	u32 r;
-
-	r = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
-	r |= USBTXWRMODEI(port, mask);
-	omap_ctrl_writel(r, OMAP2_CONTROL_DEVCONF0);
-}
-
-static void omap2_usb2_disable_5pinbitll(void)
-{
-	u32 r;
-
-	r = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
-	r &= ~(USBTXWRMODEI(2, USB_BIDIR_TLL) | USBT2TLL5PI);
-	omap_ctrl_writel(r, OMAP2_CONTROL_DEVCONF0);
-}
-
-static void omap2_usb2_enable_5pinunitll(void)
-{
-	u32 r;
-
-	r = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
-	r |= USBTXWRMODEI(2, USB_UNIDIR_TLL) | USBT2TLL5PI;
-	omap_ctrl_writel(r, OMAP2_CONTROL_DEVCONF0);
-}
-
-static u32 __init omap2_usb0_init(unsigned nwires, unsigned is_device)
-{
-	u32	syscon1 = 0;
-
-	omap2_usb_devconf_clear(0, USB_BIDIR_TLL);
-
-	if (nwires == 0)
-		return 0;
-
-	if (is_device)
-		omap_mux_init_signal("usb0_puen", 0);
-
-	omap_mux_init_signal("usb0_dat", 0);
-	omap_mux_init_signal("usb0_txen", 0);
-	omap_mux_init_signal("usb0_se0", 0);
-	if (nwires != 3)
-		omap_mux_init_signal("usb0_rcv", 0);
-
-	switch (nwires) {
-	case 3:
-		syscon1 = 2;
-		omap2_usb_devconf_set(0, USB_BIDIR);
-		break;
-	case 4:
-		syscon1 = 1;
-		omap2_usb_devconf_set(0, USB_BIDIR);
-		break;
-	case 6:
-		syscon1 = 3;
-		omap_mux_init_signal("usb0_vp", 0);
-		omap_mux_init_signal("usb0_vm", 0);
-		omap2_usb_devconf_set(0, USB_UNIDIR);
-		break;
-	default:
-		printk(KERN_ERR "illegal usb%d %d-wire transceiver\n",
-			0, nwires);
-	}
-
-	return syscon1 << 16;
-}
-
-static u32 __init omap2_usb1_init(unsigned nwires)
-{
-	u32	syscon1 = 0;
-
-	omap2_usb_devconf_clear(1, USB_BIDIR_TLL);
-
-	if (nwires == 0)
-		return 0;
-
-	/* NOTE:  board-specific code must set up pin muxing for usb1,
-	 * since each signal could come out on either of two balls.
-	 */
-
-	switch (nwires) {
-	case 2:
-		/* NOTE: board-specific code must override this setting if
-		 * this TLL link is not using DP/DM
-		 */
-		syscon1 = 1;
-		omap2_usb_devconf_set(1, USB_BIDIR_TLL);
-		break;
-	case 3:
-		syscon1 = 2;
-		omap2_usb_devconf_set(1, USB_BIDIR);
-		break;
-	case 4:
-		syscon1 = 1;
-		omap2_usb_devconf_set(1, USB_BIDIR);
-		break;
-	case 6:
-	default:
-		printk(KERN_ERR "illegal usb%d %d-wire transceiver\n",
-			1, nwires);
-	}
-
-	return syscon1 << 20;
-}
-
-static u32 __init omap2_usb2_init(unsigned nwires, unsigned alt_pingroup)
-{
-	u32	syscon1 = 0;
-
-	omap2_usb2_disable_5pinbitll();
-	alt_pingroup = 0;
-
-	/* NOTE omap1 erratum: must leave USB2_UNI_R set if usb0 in use */
-	if (alt_pingroup || nwires == 0)
-		return 0;
-
-	omap_mux_init_signal("usb2_dat", 0);
-	omap_mux_init_signal("usb2_se0", 0);
-	if (nwires > 2)
-		omap_mux_init_signal("usb2_txen", 0);
-	if (nwires > 3)
-		omap_mux_init_signal("usb2_rcv", 0);
-
-	switch (nwires) {
-	case 2:
-		/* NOTE: board-specific code must override this setting if
-		 * this TLL link is not using DP/DM
-		 */
-		syscon1 = 1;
-		omap2_usb_devconf_set(2, USB_BIDIR_TLL);
-		break;
-	case 3:
-		syscon1 = 2;
-		omap2_usb_devconf_set(2, USB_BIDIR);
-		break;
-	case 4:
-		syscon1 = 1;
-		omap2_usb_devconf_set(2, USB_BIDIR);
-		break;
-	case 5:
-		/* NOTE: board-specific code must mux this setting depending
-		 * on TLL link using DP/DM.  Something must also
-		 * set up OTG_SYSCON2.HMC_TLL{ATTACH,SPEED}
-		 * 2420: hdq_sio.usb2_tllse0 or vlynq_rx0.usb2_tllse0
-		 * 2430: hdq_sio.usb2_tllse0 or sdmmc2_dat0.usb2_tllse0
-		 */
-
-		syscon1 = 3;
-		omap2_usb2_enable_5pinunitll();
-		break;
-	case 6:
-	default:
-		printk(KERN_ERR "illegal usb%d %d-wire transceiver\n",
-			2, nwires);
-	}
-
-	return syscon1 << 24;
-}
-
-void __init omap2_usbfs_init(struct omap_usb_config *pdata)
-{
-	struct clk *ick;
-
-	if (!cpu_is_omap24xx())
-		return;
-
-	ick = clk_get(NULL, "usb_l4_ick");
-	if (IS_ERR(ick))
-		return;
-
-	clk_enable(ick);
-	pdata->usb0_init = omap2_usb0_init;
-	pdata->usb1_init = omap2_usb1_init;
-	pdata->usb2_init = omap2_usb2_init;
-	udc_device_init(pdata);
-	ohci_device_init(pdata);
-	otg_device_init(pdata);
-	omap_otg_init(pdata);
-	clk_disable(ick);
-	clk_put(ick);
-}
-
-#endif

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/4] ARM: OMAP: Make FS USB omap1 only
  2012-05-21 19:00 [PATCH 0/4] omap legacy full speed usb cleanup for v3.6 Tony Lindgren
  2012-05-21 19:01 ` [PATCH 1/4] ARM: OMAP3: There is no FS USB controller on omap3 Tony Lindgren
  2012-05-21 19:01 ` [PATCH 2/4] ARM: OMAP2: Remove legacy USB FS support Tony Lindgren
@ 2012-05-21 19:01 ` Tony Lindgren
  2012-05-22  7:08   ` Felipe Balbi
  2012-05-21 19:01 ` [PATCH 4/4] USB: Remove omap2 support from omap_udc.c Tony Lindgren
  2012-05-24 20:02 ` [PATCH 0/4] omap legacy full speed usb cleanup for v3.6 Paul Walmsley
  4 siblings, 1 reply; 13+ messages in thread
From: Tony Lindgren @ 2012-05-21 19:01 UTC (permalink / raw)
  To: linux-arm-kernel

As the FS USB code is not being actively used for omap2+
there's no point keeping it around for omap2+.

Let's make the FS USB platform init code omap1 only so
we can remove the last user of omap_read/write for omap2+,
and simplify things for further USB, DMA, and device tree
related work.

While at it, also group the mach includes for the related
drivers.

Cc: linux-usb at vger.kernel.org
Cc: Felipe Balbi <balbi@ti.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap1/board-ams-delta.c   |    2 
 arch/arm/mach-omap1/board-generic.c     |    4 -
 arch/arm/mach-omap1/board-h2.c          |    2 
 arch/arm/mach-omap1/board-h3.c          |    2 
 arch/arm/mach-omap1/board-htcherald.c   |    2 
 arch/arm/mach-omap1/board-innovator.c   |    2 
 arch/arm/mach-omap1/board-nokia770.c    |    2 
 arch/arm/mach-omap1/board-osk.c         |    2 
 arch/arm/mach-omap1/board-palmte.c      |    2 
 arch/arm/mach-omap1/board-palmtt.c      |    2 
 arch/arm/mach-omap1/board-palmz71.c     |    2 
 arch/arm/mach-omap1/board-sx1.c         |    2 
 arch/arm/mach-omap1/board-voiceblue.c   |    3 
 arch/arm/mach-omap1/clock_data.c        |    3 
 arch/arm/mach-omap1/include/mach/usb.h  |  165 ++++++++++++++++++++++++++
 arch/arm/mach-omap1/usb.c               |  116 ++++++++++++++++++
 arch/arm/plat-omap/Makefile             |    2 
 arch/arm/plat-omap/include/plat/board.h |   38 ------
 arch/arm/plat-omap/include/plat/usb.h   |  196 -------------------------------
 arch/arm/plat-omap/usb.c                |  145 -----------------------
 drivers/usb/gadget/Kconfig              |    2 
 drivers/usb/gadget/omap_udc.c           |    3 
 drivers/usb/host/Kconfig                |    2 
 drivers/usb/host/ohci-omap.c            |    7 +
 drivers/usb/otg/isp1301_omap.c          |    2 
 25 files changed, 310 insertions(+), 400 deletions(-)
 create mode 100644 arch/arm/mach-omap1/include/mach/usb.h
 delete mode 100644 arch/arm/plat-omap/usb.c

diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index f2f8a58..c534698 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -37,12 +37,12 @@
 #include <plat/board-ams-delta.h>
 #include <plat/keypad.h>
 #include <plat/mux.h>
-#include <plat/usb.h>
 #include <plat/board.h>
 
 #include <mach/hardware.h>
 #include <mach/ams-delta-fiq.h>
 #include <mach/camera.h>
+#include <mach/usb.h>
 
 #include "iomap.h"
 #include "common.h"
diff --git a/arch/arm/mach-omap1/board-generic.c b/arch/arm/mach-omap1/board-generic.c
index e75e2d5..6ec385e 100644
--- a/arch/arm/mach-omap1/board-generic.c
+++ b/arch/arm/mach-omap1/board-generic.c
@@ -23,8 +23,10 @@
 #include <asm/mach/map.h>
 
 #include <plat/mux.h>
-#include <plat/usb.h>
 #include <plat/board.h>
+
+#include <mach/usb.h>
+
 #include "common.h"
 
 /* assume no Mini-AB port */
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index a28e989..44a4ab1 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -40,11 +40,11 @@
 #include <plat/dma.h>
 #include <plat/tc.h>
 #include <plat/irda.h>
-#include <plat/usb.h>
 #include <plat/keypad.h>
 #include <plat/flash.h>
 
 #include <mach/hardware.h>
+#include <mach/usb.h>
 
 #include "common.h"
 #include "board-h2.h"
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index 108a864..86cb5a0 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -40,13 +40,13 @@
 
 #include <plat/mux.h>
 #include <plat/tc.h>
-#include <plat/usb.h>
 #include <plat/keypad.h>
 #include <plat/dma.h>
 #include <plat/flash.h>
 
 #include <mach/hardware.h>
 #include <mach/irqs.h>
+#include <mach/usb.h>
 
 #include "common.h"
 #include "board-h3.h"
diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c
index 118a9d4..b3f6e94 100644
--- a/arch/arm/mach-omap1/board-htcherald.c
+++ b/arch/arm/mach-omap1/board-htcherald.c
@@ -44,10 +44,10 @@
 #include <plat/omap7xx.h>
 #include <plat/board.h>
 #include <plat/keypad.h>
-#include <plat/usb.h>
 #include <plat/mmc.h>
 
 #include <mach/irqs.h>
+#include <mach/usb.h>
 
 #include "common.h"
 
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index 7970223..f21c296 100644
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -35,11 +35,11 @@
 #include <plat/flash.h>
 #include <plat/fpga.h>
 #include <plat/tc.h>
-#include <plat/usb.h>
 #include <plat/keypad.h>
 #include <plat/mmc.h>
 
 #include <mach/hardware.h>
+#include <mach/usb.h>
 
 #include "iomap.h"
 #include "common.h"
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index 7212ae9..4007a372 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -26,7 +26,6 @@
 #include <asm/mach/map.h>
 
 #include <plat/mux.h>
-#include <plat/usb.h>
 #include <plat/board.h>
 #include <plat/keypad.h>
 #include <plat/lcd_mipid.h>
@@ -34,6 +33,7 @@
 #include <plat/clock.h>
 
 #include <mach/hardware.h>
+#include <mach/usb.h>
 
 #include "common.h"
 
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index da8d872..8784705 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -45,11 +45,11 @@
 #include <asm/mach/map.h>
 
 #include <plat/flash.h>
-#include <plat/usb.h>
 #include <plat/mux.h>
 #include <plat/tc.h>
 
 #include <mach/hardware.h>
+#include <mach/usb.h>
 
 #include "common.h"
 
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index 949b62a..26bcb9d 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -35,7 +35,6 @@
 
 #include <plat/flash.h>
 #include <plat/mux.h>
-#include <plat/usb.h>
 #include <plat/tc.h>
 #include <plat/dma.h>
 #include <plat/board.h>
@@ -43,6 +42,7 @@
 #include <plat/keypad.h>
 
 #include <mach/hardware.h>
+#include <mach/usb.h>
 
 #include "common.h"
 
diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c
index 7f1e1cf..4d09944 100644
--- a/arch/arm/mach-omap1/board-palmtt.c
+++ b/arch/arm/mach-omap1/board-palmtt.c
@@ -35,7 +35,6 @@
 #include <plat/led.h>
 #include <plat/flash.h>
 #include <plat/mux.h>
-#include <plat/usb.h>
 #include <plat/dma.h>
 #include <plat/tc.h>
 #include <plat/board.h>
@@ -43,6 +42,7 @@
 #include <plat/keypad.h>
 
 #include <mach/hardware.h>
+#include <mach/usb.h>
 
 #include "common.h"
 
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c
index 3c71c6b..cc71a26 100644
--- a/arch/arm/mach-omap1/board-palmz71.c
+++ b/arch/arm/mach-omap1/board-palmz71.c
@@ -37,7 +37,6 @@
 
 #include <plat/flash.h>
 #include <plat/mux.h>
-#include <plat/usb.h>
 #include <plat/dma.h>
 #include <plat/tc.h>
 #include <plat/board.h>
@@ -45,6 +44,7 @@
 #include <plat/keypad.h>
 
 #include <mach/hardware.h>
+#include <mach/usb.h>
 
 #include "common.h"
 
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c
index 3b7b82b..8c665bd 100644
--- a/arch/arm/mach-omap1/board-sx1.c
+++ b/arch/arm/mach-omap1/board-sx1.c
@@ -37,13 +37,13 @@
 #include <plat/mux.h>
 #include <plat/dma.h>
 #include <plat/irda.h>
-#include <plat/usb.h>
 #include <plat/tc.h>
 #include <plat/board.h>
 #include <plat/keypad.h>
 #include <plat/board-sx1.h>
 
 #include <mach/hardware.h>
+#include <mach/usb.h>
 
 #include "common.h"
 
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
index afd67f0..3497769 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -35,9 +35,10 @@
 #include <plat/flash.h>
 #include <plat/mux.h>
 #include <plat/tc.h>
-#include <plat/usb.h>
+#include <plat/board.h>
 
 #include <mach/hardware.h>
+#include <mach/usb.h>
 
 #include "common.h"
 
diff --git a/arch/arm/mach-omap1/clock_data.c b/arch/arm/mach-omap1/clock_data.c
index c6ce93f..c007d80 100644
--- a/arch/arm/mach-omap1/clock_data.c
+++ b/arch/arm/mach-omap1/clock_data.c
@@ -25,10 +25,11 @@
 #include <plat/clock.h>
 #include <plat/cpu.h>
 #include <plat/clkdev_omap.h>
+#include <plat/board.h>
 #include <plat/sram.h>	/* for omap_sram_reprogram_clock() */
-#include <plat/usb.h>   /* for OTG_BASE */
 
 #include <mach/hardware.h>
+#include <mach/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
new file mode 100644
index 0000000..753cd5c
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/usb.h
@@ -0,0 +1,165 @@
+/*
+ * FIXME correct answer depends on hmc_mode,
+ * as does (on omap1) any nonzero value for config->otg port number
+ */
+#ifdef	CONFIG_USB_GADGET_OMAP
+#define	is_usb0_device(config)	1
+#else
+#define	is_usb0_device(config)	0
+#endif
+
+struct omap_usb_config {
+	/* Configure drivers according to the connectors on your board:
+	 *  - "A" connector (rectagular)
+	 *	... for host/OHCI use, set "register_host".
+	 *  - "B" connector (squarish) or "Mini-B"
+	 *	... for device/gadget use, set "register_dev".
+	 *  - "Mini-AB" connector (very similar to Mini-B)
+	 *	... for OTG use as device OR host, initialize "otg"
+	 */
+	unsigned	register_host:1;
+	unsigned	register_dev:1;
+	u8		otg;	/* port number, 1-based:  usb1 == 2 */
+
+	u8		hmc_mode;
+
+	/* implicitly true if otg:  host supports remote wakeup? */
+	u8		rwc;
+
+	/* signaling pins used to talk to transceiver on usbN:
+	 *  0 == usbN unused
+	 *  2 == usb0-only, using internal transceiver
+	 *  3 == 3 wire bidirectional
+	 *  4 == 4 wire bidirectional
+	 *  6 == 6 wire unidirectional (or TLL)
+	 */
+	u8		pins[3];
+
+	struct platform_device *udc_device;
+	struct platform_device *ohci_device;
+	struct platform_device *otg_device;
+
+	u32 (*usb0_init)(unsigned nwires, unsigned is_device);
+	u32 (*usb1_init)(unsigned nwires);
+	u32 (*usb2_init)(unsigned nwires, unsigned alt_pingroup);
+
+	int (*ocpi_enable)(void);
+};
+
+void omap_otg_init(struct omap_usb_config *config);
+
+#if defined(CONFIG_USB) || defined(CONFIG_USB_MODULE)
+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)
diff --git a/arch/arm/mach-omap1/usb.c b/arch/arm/mach-omap1/usb.c
index e61afd9..65f8817 100644
--- a/arch/arm/mach-omap1/usb.c
+++ b/arch/arm/mach-omap1/usb.c
@@ -27,7 +27,8 @@
 #include <asm/irq.h>
 
 #include <plat/mux.h>
-#include <plat/usb.h>
+
+#include <mach/usb.h>
 
 #include "common.h"
 
@@ -55,6 +56,119 @@
 #define INT_USB_IRQ_HGEN	INT_USB_HHC_1
 #define INT_USB_IRQ_OTG		IH2_BASE + 8
 
+#ifdef	CONFIG_ARCH_OMAP_OTG
+
+void __init
+omap_otg_init(struct omap_usb_config *config)
+{
+	u32		syscon;
+	int		alt_pingroup = 0;
+
+	/* NOTE:  no bus or clock setup (yet?) */
+
+	syscon = omap_readl(OTG_SYSCON_1) & 0xffff;
+	if (!(syscon & OTG_RESET_DONE))
+		pr_debug("USB resets not complete?\n");
+
+	//omap_writew(0, OTG_IRQ_EN);
+
+	/* pin muxing and transceiver pinouts */
+	if (config->pins[0] > 2)	/* alt pingroup 2 */
+		alt_pingroup = 1;
+	syscon |= config->usb0_init(config->pins[0], is_usb0_device(config));
+	syscon |= config->usb1_init(config->pins[1]);
+	syscon |= config->usb2_init(config->pins[2], alt_pingroup);
+	pr_debug("OTG_SYSCON_1 = %08x\n", omap_readl(OTG_SYSCON_1));
+	omap_writel(syscon, OTG_SYSCON_1);
+
+	syscon = config->hmc_mode;
+	syscon |= USBX_SYNCHRO | (4 << 16) /* B_ASE0_BRST */;
+#ifdef	CONFIG_USB_OTG
+	if (config->otg)
+		syscon |= OTG_EN;
+#endif
+	if (cpu_class_is_omap1())
+		pr_debug("USB_TRANSCEIVER_CTRL = %03x\n",
+			 omap_readl(USB_TRANSCEIVER_CTRL));
+	pr_debug("OTG_SYSCON_2 = %08x\n", omap_readl(OTG_SYSCON_2));
+	omap_writel(syscon, OTG_SYSCON_2);
+
+	printk("USB: hmc %d", config->hmc_mode);
+	if (!alt_pingroup)
+		printk(", usb2 alt %d wires", config->pins[2]);
+	else if (config->pins[0])
+		printk(", usb0 %d wires%s", config->pins[0],
+			is_usb0_device(config) ? " (dev)" : "");
+	if (config->pins[1])
+		printk(", usb1 %d wires", config->pins[1]);
+	if (!alt_pingroup && config->pins[2])
+		printk(", usb2 %d wires", config->pins[2]);
+	if (config->otg)
+		printk(", Mini-AB on usb%d", config->otg - 1);
+	printk("\n");
+
+	if (cpu_class_is_omap1()) {
+		u16 w;
+
+		/* leave USB clocks/controllers off until needed */
+		w = omap_readw(ULPD_SOFT_REQ);
+		w &= ~SOFT_USB_CLK_REQ;
+		omap_writew(w, ULPD_SOFT_REQ);
+
+		w = omap_readw(ULPD_CLOCK_CTRL);
+		w &= ~USB_MCLK_EN;
+		w |= DIS_USB_PVCI_CLK;
+		omap_writew(w, ULPD_CLOCK_CTRL);
+	}
+	syscon = omap_readl(OTG_SYSCON_1);
+	syscon |= HST_IDLE_EN|DEV_IDLE_EN|OTG_IDLE_EN;
+
+#ifdef	CONFIG_USB_GADGET_OMAP
+	if (config->otg || config->register_dev) {
+		struct platform_device *udc_device = config->udc_device;
+		int status;
+
+		syscon &= ~DEV_IDLE_EN;
+		udc_device->dev.platform_data = config;
+		status = platform_device_register(udc_device);
+		if (status)
+			pr_debug("can't register UDC device, %d\n", status);
+	}
+#endif
+
+#if	defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
+	if (config->otg || config->register_host) {
+		struct platform_device *ohci_device = config->ohci_device;
+		int status;
+
+		syscon &= ~HST_IDLE_EN;
+		ohci_device->dev.platform_data = config;
+		status = platform_device_register(ohci_device);
+		if (status)
+			pr_debug("can't register OHCI device, %d\n", status);
+	}
+#endif
+
+#ifdef	CONFIG_USB_OTG
+	if (config->otg) {
+		struct platform_device *otg_device = config->otg_device;
+		int status;
+
+		syscon &= ~OTG_IDLE_EN;
+		otg_device->dev.platform_data = config;
+		status = platform_device_register(otg_device);
+		if (status)
+			pr_debug("can't register OTG device, %d\n", status);
+	}
+#endif
+	pr_debug("OTG_SYSCON_1 = %08x\n", omap_readl(OTG_SYSCON_1));
+	omap_writel(syscon, OTG_SYSCON_1);
+}
+
+#else
+void omap_otg_init(struct omap_usb_config *config) {}
+#endif
+
 #ifdef	CONFIG_USB_GADGET_OMAP
 
 static struct resource udc_resources[] = {
diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile
index ed8605f..6d87532 100644
--- a/arch/arm/plat-omap/Makefile
+++ b/arch/arm/plat-omap/Makefile
@@ -4,7 +4,7 @@
 
 # Common support
 obj-y := common.o sram.o clock.o devices.o dma.o mux.o \
-	 usb.o fb.o counter_32k.o
+	 fb.o counter_32k.o
 obj-m :=
 obj-n :=
 obj-  :=
diff --git a/arch/arm/plat-omap/include/plat/board.h b/arch/arm/plat-omap/include/plat/board.h
index 4814c5b..e62f20a 100644
--- a/arch/arm/plat-omap/include/plat/board.h
+++ b/arch/arm/plat-omap/include/plat/board.h
@@ -57,44 +57,6 @@ struct omap_camera_sensor_config {
 	int (*power_off)(void * data);
 };
 
-struct omap_usb_config {
-	/* Configure drivers according to the connectors on your board:
-	 *  - "A" connector (rectagular)
-	 *	... for host/OHCI use, set "register_host".
-	 *  - "B" connector (squarish) or "Mini-B"
-	 *	... for device/gadget use, set "register_dev".
-	 *  - "Mini-AB" connector (very similar to Mini-B)
-	 *	... for OTG use as device OR host, initialize "otg"
-	 */
-	unsigned	register_host:1;
-	unsigned	register_dev:1;
-	u8		otg;	/* port number, 1-based:  usb1 == 2 */
-
-	u8		hmc_mode;
-
-	/* implicitly true if otg:  host supports remote wakeup? */
-	u8		rwc;
-
-	/* signaling pins used to talk to transceiver on usbN:
-	 *  0 == usbN unused
-	 *  2 == usb0-only, using internal transceiver
-	 *  3 == 3 wire bidirectional
-	 *  4 == 4 wire bidirectional
-	 *  6 == 6 wire unidirectional (or TLL)
-	 */
-	u8		pins[3];
-
-	struct platform_device *udc_device;
-	struct platform_device *ohci_device;
-	struct platform_device *otg_device;
-
-	u32 (*usb0_init)(unsigned nwires, unsigned is_device);
-	u32 (*usb1_init)(unsigned nwires);
-	u32 (*usb2_init)(unsigned nwires, unsigned alt_pingroup);
-
-	int (*ocpi_enable)(void);
-};
-
 struct omap_lcd_config {
 	char panel_name[16];
 	char ctrl_name[16];
diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h
index 762eeb0..548a4c8 100644
--- a/arch/arm/plat-omap/include/plat/usb.h
+++ b/arch/arm/plat-omap/include/plat/usb.h
@@ -44,6 +44,8 @@ struct usbhs_omap_board_data {
 	struct regulator		*regulator[OMAP3_HS_USB_PORTS];
 };
 
+#ifdef CONFIG_ARCH_OMAP2PLUS
+
 struct ehci_hcd_omap_platform_data {
 	enum usbhs_omap_port_mode	port_mode[OMAP3_HS_USB_PORTS];
 	int				reset_gpio_port[OMAP3_HS_USB_PORTS];
@@ -64,26 +66,6 @@ struct usbhs_omap_platform_data {
 };
 /*-------------------------------------------------------------------------*/
 
-#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
-
-#ifdef CONFIG_ARCH_OMAP1
-
-#define OTG_BASE			OMAP1_OTG_BASE
-#define UDC_BASE			OMAP1_UDC_BASE
-#define OMAP_OHCI_BASE			OMAP1_OHCI_BASE
-
-#else
-
-#define OTG_BASE			OMAP2_OTG_BASE
-#define UDC_BASE			OMAP2_UDC_BASE
-#define OMAP_OHCI_BASE			OMAP2_OHCI_BASE
-
 struct omap_musb_board_data {
 	u8	interface_type;
 	u8	mode;
@@ -107,44 +89,6 @@ extern int omap4430_phy_init(struct device *dev);
 extern int omap4430_phy_exit(struct device *dev);
 extern int omap4430_phy_suspend(struct device *dev, int suspend);
 
-/*
- * NOTE: Please update omap USB drivers to use ioremap + read/write
- */
-
-#define OMAP2_L4_IO_OFFSET	0xb2000000
-#define OMAP2_L4_IO_ADDRESS(pa)	IOMEM((pa) + OMAP2_L4_IO_OFFSET)
-
-static inline u8 omap_readb(u32 pa)
-{
-	return __raw_readb(OMAP2_L4_IO_ADDRESS(pa));
-}
-
-static inline u16 omap_readw(u32 pa)
-{
-	return __raw_readw(OMAP2_L4_IO_ADDRESS(pa));
-}
-
-static inline u32 omap_readl(u32 pa)
-{
-	return __raw_readl(OMAP2_L4_IO_ADDRESS(pa));
-}
-
-static inline void omap_writeb(u8 v, u32 pa)
-{
-	__raw_writeb(v, OMAP2_L4_IO_ADDRESS(pa));
-}
-
-
-static inline void omap_writew(u16 v, u32 pa)
-{
-	__raw_writew(v, OMAP2_L4_IO_ADDRESS(pa));
-}
-
-static inline void omap_writel(u32 v, u32 pa)
-{
-	__raw_writel(v, OMAP2_L4_IO_ADDRESS(pa));
-}
-
 #endif
 
 extern void am35x_musb_reset(void);
@@ -153,142 +97,6 @@ extern void am35x_musb_clear_irq(void);
 extern void am35x_set_mode(u8 musb_mode);
 extern void ti81xx_musb_phy_power(u8 on);
 
-/*
- * FIXME correct answer depends on hmc_mode,
- * as does (on omap1) any nonzero value for config->otg port number
- */
-#ifdef	CONFIG_USB_GADGET_OMAP
-#define	is_usb0_device(config)	1
-#else
-#define	is_usb0_device(config)	0
-#endif
-
-void omap_otg_init(struct omap_usb_config *config);
-
-#if defined(CONFIG_USB) || defined(CONFIG_USB_MODULE)
-void omap1_usb_init(struct omap_usb_config *pdata);
-#else
-static inline void omap1_usb_init(struct omap_usb_config *pdata)
-{
-}
-#endif
-
-#if defined(CONFIG_ARCH_OMAP_OTG) || defined(CONFIG_ARCH_OMAP_OTG_MODULE)
-void omap2_usbfs_init(struct omap_usb_config *pdata);
-#else
-static inline void omap2_usbfs_init(struct omap_usb_config *pdata)
-{
-}
-#endif
-
-/*-------------------------------------------------------------------------*/
-
-/*
- * 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)
-
-/* OMAP2 */
-#	define	USB_UNIDIR			0x0
-#	define	USB_UNIDIR_TLL			0x1
-#	define	USB_BIDIR			0x2
-#	define	USB_BIDIR_TLL			0x3
-#	define	USBTXWRMODEI(port, x)	((x) << (22 - (port * 2)))
-#	define	USBT2TLL5PI		(1 << 17)
-#	define	USB0PUENACTLOI		(1 << 16)
-#	define	USBSTANDBYCTRL		(1 << 15)
 /* AM35x */
 /* USB 2.0 PHY Control */
 #define CONF2_PHY_GPIOMODE	(1 << 23)
diff --git a/arch/arm/plat-omap/usb.c b/arch/arm/plat-omap/usb.c
deleted file mode 100644
index daa0327..0000000
--- a/arch/arm/plat-omap/usb.c
+++ /dev/null
@@ -1,145 +0,0 @@
- /*
- * arch/arm/plat-omap/usb.c -- platform level USB initialization
- *
- * Copyright (C) 2004 Texas Instruments, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#undef	DEBUG
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/io.h>
-
-#include <plat/usb.h>
-#include <plat/board.h>
-
-#include <mach/hardware.h>
-
-#ifdef	CONFIG_ARCH_OMAP_OTG
-
-void __init
-omap_otg_init(struct omap_usb_config *config)
-{
-	u32		syscon;
-	int		alt_pingroup = 0;
-
-	/* NOTE:  no bus or clock setup (yet?) */
-
-	syscon = omap_readl(OTG_SYSCON_1) & 0xffff;
-	if (!(syscon & OTG_RESET_DONE))
-		pr_debug("USB resets not complete?\n");
-
-	//omap_writew(0, OTG_IRQ_EN);
-
-	/* pin muxing and transceiver pinouts */
-	if (config->pins[0] > 2)	/* alt pingroup 2 */
-		alt_pingroup = 1;
-	syscon |= config->usb0_init(config->pins[0], is_usb0_device(config));
-	syscon |= config->usb1_init(config->pins[1]);
-	syscon |= config->usb2_init(config->pins[2], alt_pingroup);
-	pr_debug("OTG_SYSCON_1 = %08x\n", omap_readl(OTG_SYSCON_1));
-	omap_writel(syscon, OTG_SYSCON_1);
-
-	syscon = config->hmc_mode;
-	syscon |= USBX_SYNCHRO | (4 << 16) /* B_ASE0_BRST */;
-#ifdef	CONFIG_USB_OTG
-	if (config->otg)
-		syscon |= OTG_EN;
-#endif
-	if (cpu_class_is_omap1())
-		pr_debug("USB_TRANSCEIVER_CTRL = %03x\n",
-			 omap_readl(USB_TRANSCEIVER_CTRL));
-	pr_debug("OTG_SYSCON_2 = %08x\n", omap_readl(OTG_SYSCON_2));
-	omap_writel(syscon, OTG_SYSCON_2);
-
-	printk("USB: hmc %d", config->hmc_mode);
-	if (!alt_pingroup)
-		printk(", usb2 alt %d wires", config->pins[2]);
-	else if (config->pins[0])
-		printk(", usb0 %d wires%s", config->pins[0],
-			is_usb0_device(config) ? " (dev)" : "");
-	if (config->pins[1])
-		printk(", usb1 %d wires", config->pins[1]);
-	if (!alt_pingroup && config->pins[2])
-		printk(", usb2 %d wires", config->pins[2]);
-	if (config->otg)
-		printk(", Mini-AB on usb%d", config->otg - 1);
-	printk("\n");
-
-	if (cpu_class_is_omap1()) {
-		u16 w;
-
-		/* leave USB clocks/controllers off until needed */
-		w = omap_readw(ULPD_SOFT_REQ);
-		w &= ~SOFT_USB_CLK_REQ;
-		omap_writew(w, ULPD_SOFT_REQ);
-
-		w = omap_readw(ULPD_CLOCK_CTRL);
-		w &= ~USB_MCLK_EN;
-		w |= DIS_USB_PVCI_CLK;
-		omap_writew(w, ULPD_CLOCK_CTRL);
-	}
-	syscon = omap_readl(OTG_SYSCON_1);
-	syscon |= HST_IDLE_EN|DEV_IDLE_EN|OTG_IDLE_EN;
-
-#ifdef	CONFIG_USB_GADGET_OMAP
-	if (config->otg || config->register_dev) {
-		struct platform_device *udc_device = config->udc_device;
-		int status;
-
-		syscon &= ~DEV_IDLE_EN;
-		udc_device->dev.platform_data = config;
-		status = platform_device_register(udc_device);
-		if (status)
-			pr_debug("can't register UDC device, %d\n", status);
-	}
-#endif
-
-#if	defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
-	if (config->otg || config->register_host) {
-		struct platform_device *ohci_device = config->ohci_device;
-		int status;
-
-		syscon &= ~HST_IDLE_EN;
-		ohci_device->dev.platform_data = config;
-		status = platform_device_register(ohci_device);
-		if (status)
-			pr_debug("can't register OHCI device, %d\n", status);
-	}
-#endif
-
-#ifdef	CONFIG_USB_OTG
-	if (config->otg) {
-		struct platform_device *otg_device = config->otg_device;
-		int status;
-
-		syscon &= ~OTG_IDLE_EN;
-		otg_device->dev.platform_data = config;
-		status = platform_device_register(otg_device);
-		if (status)
-			pr_debug("can't register OTG device, %d\n", status);
-	}
-#endif
-	pr_debug("OTG_SYSCON_1 = %08x\n", omap_readl(OTG_SYSCON_1));
-	omap_writel(syscon, OTG_SYSCON_1);
-}
-
-#else
-void omap_otg_init(struct omap_usb_config *config) {}
-#endif
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index bddc8fd..271ca16 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -185,7 +185,7 @@ config USB_FUSB300
 
 config USB_OMAP
 	tristate "OMAP USB Device Controller"
-	depends on ARCH_OMAP
+	depends on ARCH_OMAP1
 	select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_OMAP_H4_OTG
 	select USB_OTG_UTILS if ARCH_OMAP
 	help
diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
index 7ba3246..2acf06c 100644
--- a/drivers/usb/gadget/omap_udc.c
+++ b/drivers/usb/gadget/omap_udc.c
@@ -44,7 +44,8 @@
 #include <asm/mach-types.h>
 
 #include <plat/dma.h>
-#include <plat/usb.h>
+
+#include <mach/usb.h>
 
 #include "omap_udc.h"
 
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 83e58df..dcfaaa9 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -308,7 +308,7 @@ config USB_OHCI_HCD
 
 config USB_OHCI_HCD_OMAP1
 	bool "OHCI support for OMAP1/2 chips"
-	depends on USB_OHCI_HCD && (ARCH_OMAP1 || ARCH_OMAP2)
+	depends on USB_OHCI_HCD && ARCH_OMAP1
 	default y
 	---help---
 	  Enables support for the OHCI controller on OMAP1/2 chips.
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index 9ce35d0..b02c344 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -20,14 +20,15 @@
 #include <linux/clk.h>
 #include <linux/gpio.h>
 
-#include <mach/hardware.h>
 #include <asm/io.h>
 #include <asm/mach-types.h>
 
 #include <plat/mux.h>
-#include <mach/irqs.h>
 #include <plat/fpga.h>
-#include <plat/usb.h>
+
+#include <mach/hardware.h>
+#include <mach/irqs.h>
+#include <mach/usb.h>
 
 
 /* OMAP-1510 OHCI has its own MMU for DMA */
diff --git a/drivers/usb/otg/isp1301_omap.c b/drivers/usb/otg/isp1301_omap.c
index 70cf5d7..e0558df 100644
--- a/drivers/usb/otg/isp1301_omap.c
+++ b/drivers/usb/otg/isp1301_omap.c
@@ -36,9 +36,9 @@
 #include <asm/irq.h>
 #include <asm/mach-types.h>
 
-#include <plat/usb.h>
 #include <plat/mux.h>
 
+#include <mach/usb.h>
 
 #ifndef	DEBUG
 #undef	VERBOSE

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 4/4] USB: Remove omap2 support from omap_udc.c
  2012-05-21 19:00 [PATCH 0/4] omap legacy full speed usb cleanup for v3.6 Tony Lindgren
                   ` (2 preceding siblings ...)
  2012-05-21 19:01 ` [PATCH 3/4] ARM: OMAP: Make FS USB omap1 only Tony Lindgren
@ 2012-05-21 19:01 ` Tony Lindgren
  2012-05-22  7:09   ` Felipe Balbi
  2012-05-24 20:02 ` [PATCH 0/4] omap legacy full speed usb cleanup for v3.6 Paul Walmsley
  4 siblings, 1 reply; 13+ messages in thread
From: Tony Lindgren @ 2012-05-21 19:01 UTC (permalink / raw)
  To: linux-arm-kernel

There are no active users of this code for omap2 as
the boards in use have either TUSB or MUSB controller.

While at it, also fix warnings related to uninitialized
dc_clk and hhc_clk.

Cc: linux-usb at vger.kernel.org
Cc: Felipe Balbi <balbi@ti.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/usb/gadget/omap_udc.c |  113 ++++++++---------------------------------
 1 file changed, 23 insertions(+), 90 deletions(-)

diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
index 2acf06c..913587f 100644
--- a/drivers/usb/gadget/omap_udc.c
+++ b/drivers/usb/gadget/omap_udc.c
@@ -62,9 +62,6 @@
 
 #define	DMA_ADDR_INVALID	(~(dma_addr_t)0)
 
-#define OMAP2_DMA_CH(ch)	(((ch) - 1) << 1)
-#define OMAP24XX_DMA(name, ch)	(OMAP24XX_DMA_##name + OMAP2_DMA_CH(ch))
-
 /*
  * The OMAP UDC needs _very_ early endpoint setup:  before enabling the
  * D+ pullup to allow enumeration.  That's too early for the gadget
@@ -537,12 +534,8 @@ static void next_in_dma(struct omap_ep *ep, struct omap_req *req)
 				: OMAP_DMA_SYNC_ELEMENT;
 	int		dma_trigger = 0;
 
-	if (cpu_is_omap24xx())
-		dma_trigger = OMAP24XX_DMA(USB_W2FC_TX0, ep->dma_channel);
-
 	/* measure length in either bytes or packets */
 	if ((cpu_is_omap16xx() && length <= UDC_TXN_TSC)
-			|| (cpu_is_omap24xx() && length < ep->maxpacket)
 			|| (cpu_is_omap15xx() && length < ep->maxpacket)) {
 		txdma_ctrl = UDC_TXN_EOT | length;
 		omap_set_dma_transfer_params(ep->lch, OMAP_DMA_DATA_TYPE_S8,
@@ -601,28 +594,14 @@ static void next_out_dma(struct omap_ep *ep, struct omap_req *req)
 	int dma_trigger = 0;
 	u16 w;
 
-	if (cpu_is_omap24xx())
-		dma_trigger = OMAP24XX_DMA(USB_W2FC_RX0, ep->dma_channel);
-
-	/* NOTE:  we filtered out "short reads" before, so we know
-	 * the buffer has only whole numbers of packets.
-	 * except MODE SELECT(6) sent the 24 bytes data in OMAP24XX DMA mode
-	 */
-	if (cpu_is_omap24xx() && packets < ep->maxpacket) {
-		omap_set_dma_transfer_params(ep->lch, OMAP_DMA_DATA_TYPE_S8,
-				packets, 1, OMAP_DMA_SYNC_ELEMENT,
-				dma_trigger, 0);
-		req->dma_bytes = packets;
-	} else {
-		/* set up this DMA transfer, enable the fifo, start */
-		packets /= ep->ep.maxpacket;
-		packets = min(packets, (unsigned)UDC_RXN_TC + 1);
-		req->dma_bytes = packets * ep->ep.maxpacket;
-		omap_set_dma_transfer_params(ep->lch, OMAP_DMA_DATA_TYPE_S16,
-				ep->ep.maxpacket >> 1, packets,
-				OMAP_DMA_SYNC_ELEMENT,
-				dma_trigger, 0);
-	}
+	/* set up this DMA transfer, enable the fifo, start */
+	packets /= ep->ep.maxpacket;
+	packets = min(packets, (unsigned)UDC_RXN_TC + 1);
+	req->dma_bytes = packets * ep->ep.maxpacket;
+	omap_set_dma_transfer_params(ep->lch, OMAP_DMA_DATA_TYPE_S16,
+			ep->ep.maxpacket >> 1, packets,
+			OMAP_DMA_SYNC_ELEMENT,
+			dma_trigger, 0);
 	omap_set_dma_dest_params(ep->lch, OMAP_DMA_PORT_EMIFF,
 		OMAP_DMA_AMODE_POST_INC, req->req.dma + req->req.actual,
 		0, 0);
@@ -761,10 +740,7 @@ static void dma_channel_claim(struct omap_ep *ep, unsigned channel)
 	ep->dma_channel = channel;
 
 	if (is_in) {
-		if (cpu_is_omap24xx())
-			dma_channel = OMAP24XX_DMA(USB_W2FC_TX0, channel);
-		else
-			dma_channel = OMAP_DMA_USB_W2FC_TX0 - 1 + channel;
+		dma_channel = OMAP_DMA_USB_W2FC_TX0 - 1 + channel;
 		status = omap_request_dma(dma_channel,
 			ep->ep.name, dma_error, ep, &ep->lch);
 		if (status == 0) {
@@ -781,11 +757,7 @@ static void dma_channel_claim(struct omap_ep *ep, unsigned channel)
 				0, 0);
 		}
 	} else {
-		if (cpu_is_omap24xx())
-			dma_channel = OMAP24XX_DMA(USB_W2FC_RX0, channel);
-		else
-			dma_channel = OMAP_DMA_USB_W2FC_RX0 - 1 + channel;
-
+		dma_channel = OMAP_DMA_USB_W2FC_RX0 - 1 + channel;
 		status = omap_request_dma(dma_channel,
 			ep->ep.name, dma_error, ep, &ep->lch);
 		if (status == 0) {
@@ -809,7 +781,7 @@ static void dma_channel_claim(struct omap_ep *ep, unsigned channel)
 		omap_disable_dma_irq(ep->lch, OMAP_DMA_BLOCK_IRQ);
 
 		/* channel type P: hw synch (fifo) */
-		if (cpu_class_is_omap1() && !cpu_is_omap15xx())
+		if (!cpu_is_omap15xx())
 			omap_set_dma_channel_mode(ep->lch, OMAP_DMA_LCH_P);
 	}
 
@@ -929,13 +901,11 @@ omap_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
 
 	/* this isn't bogus, but OMAP DMA isn't the only hardware to
 	 * have a hard time with partial packet reads...  reject it.
-	 * Except OMAP2 can handle the small packets.
 	 */
 	if (use_dma
 			&& ep->has_dma
 			&& ep->bEndpointAddress != 0
 			&& (ep->bEndpointAddress & USB_DIR_IN) == 0
-			&& !cpu_class_is_omap2()
 			&& (req->req.length % ep->ep.maxpacket) != 0) {
 		DBG("%s, no partial packet OUT reads\n", __func__);
 		return -EMSGSIZE;
@@ -2091,10 +2061,6 @@ static inline int machine_without_vbus_sense(void)
 {
 	return (machine_is_omap_innovator()
 		|| machine_is_omap_osk()
-		|| machine_is_omap_apollon()
-#ifndef CONFIG_MACH_OMAP_H4_OTG
-		|| machine_is_omap_h4()
-#endif
 		|| machine_is_sx1()
 		|| cpu_is_omap7xx() /* No known omap7xx boards with vbus sense */
 		);
@@ -2308,12 +2274,9 @@ static int proc_otg_show(struct seq_file *s)
 	u32		trans = 0;
 	char		*ctrl_name = "(UNKNOWN)";
 
-	/* XXX This needs major revision for OMAP2+ */
 	tmp = omap_readl(OTG_REV);
-	if (cpu_class_is_omap1()) {
-		ctrl_name = "tranceiver_ctrl";
-		trans = omap_readw(USB_TRANSCEIVER_CTRL);
-	}
+	ctrl_name = "tranceiver_ctrl";
+	trans = omap_readw(USB_TRANSCEIVER_CTRL);
 	seq_printf(s, "\nOTG rev %d.%d, %s %05x\n",
 		tmp >> 4, tmp & 0xf, ctrl_name, trans);
 	tmp = omap_readw(OTG_SYSCON_1);
@@ -2400,14 +2363,12 @@ static int proc_udc_show(struct seq_file *s, void *_)
 		HMC,
 		udc->transceiver
 			? udc->transceiver->label
-			: ((cpu_is_omap1710() || cpu_is_omap24xx())
+			: (cpu_is_omap1710() 
 				? "external" : "(none)"));
-	if (cpu_class_is_omap1()) {
-		seq_printf(s, "ULPD control %04x req %04x status %04x\n",
-			omap_readw(ULPD_CLOCK_CTRL),
-			omap_readw(ULPD_SOFT_REQ),
-			omap_readw(ULPD_STATUS_REQ));
-	}
+	seq_printf(s, "ULPD control %04x req %04x status %04x\n",
+		omap_readw(ULPD_CLOCK_CTRL),
+		omap_readw(ULPD_SOFT_REQ),
+		omap_readw(ULPD_STATUS_REQ));
 
 	/* OTG controller registers */
 	if (!cpu_is_omap15xx())
@@ -2592,7 +2553,7 @@ omap_ep_setup(char *name, u8 addr, u8 type,
 		 * and ignored for PIO-IN on newer chips
 		 * (for more reliable behavior)
 		 */
-		if (!use_dma || cpu_is_omap15xx() || cpu_is_omap24xx())
+		if (!use_dma || cpu_is_omap15xx())
 			dbuf = 0;
 
 		switch (maxp) {
@@ -2796,8 +2757,8 @@ static int __init omap_udc_probe(struct platform_device *pdev)
 	struct usb_phy		*xceiv = NULL;
 	const char		*type = NULL;
 	struct omap_usb_config	*config = pdev->dev.platform_data;
-	struct clk		*dc_clk;
-	struct clk		*hhc_clk;
+	struct clk		*dc_clk = NULL;
+	struct clk		*hhc_clk = NULL;
 
 	/* NOTE:  "knows" the order of the resources! */
 	if (!request_mem_region(pdev->resource[0].start,
@@ -2817,16 +2778,6 @@ static int __init omap_udc_probe(struct platform_device *pdev)
 		udelay(100);
 	}
 
-	if (cpu_is_omap24xx()) {
-		dc_clk = clk_get(&pdev->dev, "usb_fck");
-		hhc_clk = clk_get(&pdev->dev, "usb_l4_ick");
-		BUG_ON(IS_ERR(dc_clk) || IS_ERR(hhc_clk));
-		/* can't use omap_udc_enable_clock yet */
-		clk_enable(dc_clk);
-		clk_enable(hhc_clk);
-		udelay(100);
-	}
-
 	if (cpu_is_omap7xx()) {
 		dc_clk = clk_get(&pdev->dev, "usb_dc_ck");
 		hhc_clk = clk_get(&pdev->dev, "l3_ocpi_ck");
@@ -2876,14 +2827,6 @@ static int __init omap_udc_probe(struct platform_device *pdev)
 
 		hmc = HMC_1610;
 
-		if (cpu_is_omap24xx()) {
-			/* this could be transceiverless in one of the
-			 * "we don't need to know" modes.
-			 */
-			type = "external";
-			goto known;
-		}
-
 		switch (hmc) {
 		case 0:			/* POWERUP DEFAULT == 0 */
 		case 4:
@@ -2922,7 +2865,7 @@ bad_on_1710:
 			goto cleanup0;
 		}
 	}
-known:
+
 	INFO("hmc mode %d, %s transceiver\n", hmc, type);
 
 	/* a "gadget" abstracts/virtualizes the controller */
@@ -2976,16 +2919,6 @@ known:
 		clk_disable(dc_clk);
 	}
 
-	if (cpu_is_omap24xx()) {
-		udc->dc_clk = dc_clk;
-		udc->hhc_clk = hhc_clk;
-		/* FIXME OMAP2 don't release hhc & dc clock */
-#if 0
-		clk_disable(hhc_clk);
-		clk_disable(dc_clk);
-#endif
-	}
-
 	create_proc_file();
 	status = device_add(&udc->gadget.dev);
 	if (status)
@@ -3014,7 +2947,7 @@ cleanup0:
 	if (xceiv)
 		usb_put_transceiver(xceiv);
 
-	if (cpu_is_omap16xx() || cpu_is_omap24xx() || cpu_is_omap7xx()) {
+	if (cpu_is_omap16xx() || cpu_is_omap7xx()) {
 		clk_disable(hhc_clk);
 		clk_disable(dc_clk);
 		clk_put(hhc_clk);

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 1/4] ARM: OMAP3: There is no FS USB controller on omap3
  2012-05-21 19:01 ` [PATCH 1/4] ARM: OMAP3: There is no FS USB controller on omap3 Tony Lindgren
@ 2012-05-22  7:06   ` Felipe Balbi
  0 siblings, 0 replies; 13+ messages in thread
From: Felipe Balbi @ 2012-05-22  7:06 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 21, 2012 at 12:01:02PM -0700, Tony Lindgren wrote:
> We should not select ARCH_OMAP_OTG as the hardware does not
> have the legacy FS (Full Speed) USB interface.
> 
> Cc: linux-usb at vger.kernel.org
> Cc: Felipe Balbi <balbi@ti.com>

Acked-by: Felipe Balbi <balbi@ti.com>

> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm/mach-omap2/Kconfig |    1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
> index 4cf5142..0e4dd67 100644
> --- a/arch/arm/mach-omap2/Kconfig
> +++ b/arch/arm/mach-omap2/Kconfig
> @@ -76,7 +76,6 @@ config SOC_OMAP3430
>  	bool "OMAP3430 support"
>  	depends on ARCH_OMAP3
>  	default y
> -	select ARCH_OMAP_OTG
>  
>  config SOC_TI81XX
>  	bool "TI81XX support"
> 

-- 
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120522/bbf79609/attachment.sig>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 2/4] ARM: OMAP2: Remove legacy USB FS support
  2012-05-21 19:01 ` [PATCH 2/4] ARM: OMAP2: Remove legacy USB FS support Tony Lindgren
@ 2012-05-22  7:07   ` Felipe Balbi
  0 siblings, 0 replies; 13+ messages in thread
From: Felipe Balbi @ 2012-05-22  7:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 21, 2012 at 12:01:06PM -0700, Tony Lindgren wrote:
> The FS (Full Speed) USB controller is available on 2420 and 2430,
> but not being used.
> 
> Out of the 2420 based boards only Nokia N8X0 are seeing active
> development and they have external HS (High Speed) TUSB controller.
> On omap 2430sdp there is MUSB HS controller, so there's no need
> to use the legacy USB FS controller.
> 
> That leaves only H4 and Apollon boards that could use the FS USB
> controller. As both H4 and Apollon boards are old proprietary
> development boards, it's unlikely that we have any active
> developers working on those boards using the USB.
> 
> So remove the FS USB support for omap2 machines. Patches are
> welcome if somebody wants to instead fix it all up to the
> current standards.
> 
> Cc: linux-usb at vger.kernel.org
> Cc: Felipe Balbi <balbi@ti.com>

Acked-by: Felipe Balbi <balbi@ti.com>

> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm/mach-omap2/Kconfig         |    2 
>  arch/arm/mach-omap2/Makefile        |    3 
>  arch/arm/mach-omap2/board-2430sdp.c |   11 -
>  arch/arm/mach-omap2/board-apollon.c |   18 --
>  arch/arm/mach-omap2/board-h4.c      |   13 -
>  arch/arm/mach-omap2/usb-fs.c        |  359 -----------------------------------
>  6 files changed, 406 deletions(-)
>  delete mode 100644 arch/arm/mach-omap2/usb-fs.c
> 
> diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
> index 0e4dd67..042f157 100644
> --- a/arch/arm/mach-omap2/Kconfig
> +++ b/arch/arm/mach-omap2/Kconfig
> @@ -64,13 +64,11 @@ config SOC_OMAP2420
>  	depends on ARCH_OMAP2
>  	default y
>  	select OMAP_DM_TIMER
> -	select ARCH_OMAP_OTG
>  
>  config SOC_OMAP2430
>  	bool "OMAP2430 support"
>  	depends on ARCH_OMAP2
>  	default y
> -	select ARCH_OMAP_OTG
>  
>  config SOC_OMAP3430
>  	bool "OMAP3430 support"
> diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
> index fa742f3..664224f 100644
> --- a/arch/arm/mach-omap2/Makefile
> +++ b/arch/arm/mach-omap2/Makefile
> @@ -244,9 +244,6 @@ obj-y					+= $(omap-flash-y) $(omap-flash-m)
>  omap-hsmmc-$(CONFIG_MMC_OMAP_HS)	:= hsmmc.o
>  obj-y					+= $(omap-hsmmc-m) $(omap-hsmmc-y)
>  
> -
> -usbfs-$(CONFIG_ARCH_OMAP_OTG)		:= usb-fs.o
> -obj-y					+= $(usbfs-m) $(usbfs-y)
>  obj-y					+= usb-musb.o
>  obj-y					+= omap_phy_internal.o
>  
> diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
> index 99ca6ba..6523aea 100644
> --- a/arch/arm/mach-omap2/board-2430sdp.c
> +++ b/arch/arm/mach-omap2/board-2430sdp.c
> @@ -254,16 +254,6 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
>  	{}	/* Terminator */
>  };
>  
> -static struct omap_usb_config sdp2430_usb_config __initdata = {
> -	.otg		= 1,
> -#ifdef  CONFIG_USB_GADGET_OMAP
> -	.hmc_mode	= 0x0,
> -#elif   defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
> -	.hmc_mode	= 0x1,
> -#endif
> -	.pins[0]	= 3,
> -};
> -
>  #ifdef CONFIG_OMAP_MUX
>  static struct omap_board_mux board_mux[] __initdata = {
>  	{ .reg_offset = OMAP_MUX_TERMINATOR },
> @@ -280,7 +270,6 @@ static void __init omap_2430sdp_init(void)
>  	omap_serial_init();
>  	omap_sdrc_init(NULL, NULL);
>  	omap_hsmmc_init(mmc);
> -	omap2_usbfs_init(&sdp2430_usb_config);
>  
>  	omap_mux_init_signal("usb0hs_stp", OMAP_PULL_ENA | OMAP_PULL_UP);
>  	usb_musb_init(NULL);
> diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
> index 502c31e..519bcd3 100644
> --- a/arch/arm/mach-omap2/board-apollon.c
> +++ b/arch/arm/mach-omap2/board-apollon.c
> @@ -35,7 +35,6 @@
>  #include <asm/mach/flash.h>
>  
>  #include <plat/led.h>
> -#include <plat/usb.h>
>  #include <plat/board.h>
>  #include "common.h"
>  #include <plat/gpmc.h>
> @@ -253,13 +252,6 @@ out:
>  	clk_put(gpmc_fck);
>  }
>  
> -static struct omap_usb_config apollon_usb_config __initdata = {
> -	.register_dev	= 1,
> -	.hmc_mode	= 0x14,	/* 0:dev 1:host1 2:disable */
> -
> -	.pins[0]	= 6,
> -};
> -
>  static struct panel_generic_dpi_data apollon_panel_data = {
>  	.name			= "apollon",
>  };
> @@ -297,15 +289,6 @@ static void __init apollon_led_init(void)
>  	gpio_request_array(apollon_gpio_leds, ARRAY_SIZE(apollon_gpio_leds));
>  }
>  
> -static void __init apollon_usb_init(void)
> -{
> -	/* USB device */
> -	/* DEVICE_SUSPEND */
> -	omap_mux_init_signal("mcbsp2_clkx.gpio_12", 0);
> -	gpio_request_one(12, GPIOF_OUT_INIT_LOW, "USB suspend");
> -	omap2_usbfs_init(&apollon_usb_config);
> -}
> -
>  #ifdef CONFIG_OMAP_MUX
>  static struct omap_board_mux board_mux[] __initdata = {
>  	{ .reg_offset = OMAP_MUX_TERMINATOR },
> @@ -321,7 +304,6 @@ static void __init omap_apollon_init(void)
>  	apollon_init_smc91x();
>  	apollon_led_init();
>  	apollon_flash_init();
> -	apollon_usb_init();
>  
>  	/* REVISIT: where's the correct place */
>  	omap_mux_init_signal("sys_nirq", OMAP_PULL_ENA | OMAP_PULL_UP);
> diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
> index 876becf..ace2048 100644
> --- a/arch/arm/mach-omap2/board-h4.c
> +++ b/arch/arm/mach-omap2/board-h4.c
> @@ -32,7 +32,6 @@
>  #include <asm/mach/arch.h>
>  #include <asm/mach/map.h>
>  
> -#include <plat/usb.h>
>  #include <plat/board.h>
>  #include "common.h"
>  #include <plat/menelaus.h>
> @@ -329,17 +328,6 @@ static void __init h4_init_flash(void)
>  	h4_flash_resource.end	= base + SZ_64M - 1;
>  }
>  
> -static struct omap_usb_config h4_usb_config __initdata = {
> -	/* S1.10 OFF -- usb "download port"
> -	 * usb0 switched to Mini-B port and isp1105 transceiver;
> -	 * S2.POS3 = ON, S2.POS4 = OFF ... to enable battery charging
> -	 */
> -	.register_dev	= 1,
> -	.pins[0]	= 3,
> -/*	.hmc_mode	= 0x14,*/	/* 0:dev 1:host 2:disable */
> -	.hmc_mode	= 0x00,		/* 0:dev|otg 1:disable 2:disable */
> -};
> -
>  static struct at24_platform_data m24c01 = {
>  	.byte_len	= SZ_1K / 8,
>  	.page_size	= 16,
> @@ -381,7 +369,6 @@ static void __init omap_h4_init(void)
>  			ARRAY_SIZE(h4_i2c_board_info));
>  
>  	platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices));
> -	omap2_usbfs_init(&h4_usb_config);
>  	omap_serial_init();
>  	omap_sdrc_init(NULL, NULL);
>  	h4_init_flash();
> diff --git a/arch/arm/mach-omap2/usb-fs.c b/arch/arm/mach-omap2/usb-fs.c
> deleted file mode 100644
> index 1481078..0000000
> --- a/arch/arm/mach-omap2/usb-fs.c
> +++ /dev/null
> @@ -1,359 +0,0 @@
> -/*
> - * Platform level USB initialization for FS USB OTG controller on omap1 and 24xx
> - *
> - * Copyright (C) 2004 Texas Instruments, Inc.
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License as published by
> - * the Free Software Foundation; either version 2 of the License, or
> - * (at your option) any later version.
> - *
> - * This program is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> - * GNU General Public License for more details.
> - *
> - * You should have received a copy of the GNU General Public License
> - * along with this program; if not, write to the Free Software
> - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
> - */
> -
> -#include <linux/module.h>
> -#include <linux/kernel.h>
> -#include <linux/types.h>
> -#include <linux/errno.h>
> -#include <linux/init.h>
> -#include <linux/platform_device.h>
> -#include <linux/clk.h>
> -#include <linux/err.h>
> -
> -#include <asm/irq.h>
> -
> -#include <plat/usb.h>
> -#include <plat/board.h>
> -
> -#include "control.h"
> -#include "mux.h"
> -
> -#define INT_USB_IRQ_GEN		INT_24XX_USB_IRQ_GEN
> -#define INT_USB_IRQ_NISO	INT_24XX_USB_IRQ_NISO
> -#define INT_USB_IRQ_ISO		INT_24XX_USB_IRQ_ISO
> -#define INT_USB_IRQ_HGEN	INT_24XX_USB_IRQ_HGEN
> -#define INT_USB_IRQ_OTG		INT_24XX_USB_IRQ_OTG
> -
> -#if defined(CONFIG_ARCH_OMAP2)
> -
> -#ifdef	CONFIG_USB_GADGET_OMAP
> -
> -static struct resource udc_resources[] = {
> -	/* order is significant! */
> -	{		/* registers */
> -		.start		= UDC_BASE,
> -		.end		= UDC_BASE + 0xff,
> -		.flags		= IORESOURCE_MEM,
> -	}, {		/* general IRQ */
> -		.start		= INT_USB_IRQ_GEN,
> -		.flags		= IORESOURCE_IRQ,
> -	}, {		/* PIO IRQ */
> -		.start		= INT_USB_IRQ_NISO,
> -		.flags		= IORESOURCE_IRQ,
> -	}, {		/* SOF IRQ */
> -		.start		= INT_USB_IRQ_ISO,
> -		.flags		= IORESOURCE_IRQ,
> -	},
> -};
> -
> -static u64 udc_dmamask = ~(u32)0;
> -
> -static struct platform_device udc_device = {
> -	.name		= "omap_udc",
> -	.id		= -1,
> -	.dev = {
> -		.dma_mask		= &udc_dmamask,
> -		.coherent_dma_mask	= 0xffffffff,
> -	},
> -	.num_resources	= ARRAY_SIZE(udc_resources),
> -	.resource	= udc_resources,
> -};
> -
> -static inline void udc_device_init(struct omap_usb_config *pdata)
> -{
> -	pdata->udc_device = &udc_device;
> -}
> -
> -#else
> -
> -static inline void udc_device_init(struct omap_usb_config *pdata)
> -{
> -}
> -
> -#endif
> -
> -#if	defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
> -
> -/* The dmamask must be set for OHCI to work */
> -static u64 ohci_dmamask = ~(u32)0;
> -
> -static struct resource ohci_resources[] = {
> -	{
> -		.start	= OMAP_OHCI_BASE,
> -		.end	= OMAP_OHCI_BASE + 0xff,
> -		.flags	= IORESOURCE_MEM,
> -	},
> -	{
> -		.start	= INT_USB_IRQ_HGEN,
> -		.flags	= IORESOURCE_IRQ,
> -	},
> -};
> -
> -static struct platform_device ohci_device = {
> -	.name			= "ohci",
> -	.id			= -1,
> -	.dev = {
> -		.dma_mask		= &ohci_dmamask,
> -		.coherent_dma_mask	= 0xffffffff,
> -	},
> -	.num_resources	= ARRAY_SIZE(ohci_resources),
> -	.resource		= ohci_resources,
> -};
> -
> -static inline void ohci_device_init(struct omap_usb_config *pdata)
> -{
> -	pdata->ohci_device = &ohci_device;
> -}
> -
> -#else
> -
> -static inline void ohci_device_init(struct omap_usb_config *pdata)
> -{
> -}
> -
> -#endif
> -
> -#if	defined(CONFIG_USB_OTG) && defined(CONFIG_ARCH_OMAP_OTG)
> -
> -static struct resource otg_resources[] = {
> -	/* order is significant! */
> -	{
> -		.start		= OTG_BASE,
> -		.end		= OTG_BASE + 0xff,
> -		.flags		= IORESOURCE_MEM,
> -	}, {
> -		.start		= INT_USB_IRQ_OTG,
> -		.flags		= IORESOURCE_IRQ,
> -	},
> -};
> -
> -static struct platform_device otg_device = {
> -	.name		= "omap_otg",
> -	.id		= -1,
> -	.num_resources	= ARRAY_SIZE(otg_resources),
> -	.resource	= otg_resources,
> -};
> -
> -static inline void otg_device_init(struct omap_usb_config *pdata)
> -{
> -	pdata->otg_device = &otg_device;
> -}
> -
> -#else
> -
> -static inline void otg_device_init(struct omap_usb_config *pdata)
> -{
> -}
> -
> -#endif
> -
> -static void omap2_usb_devconf_clear(u8 port, u32 mask)
> -{
> -	u32 r;
> -
> -	r = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
> -	r &= ~USBTXWRMODEI(port, mask);
> -	omap_ctrl_writel(r, OMAP2_CONTROL_DEVCONF0);
> -}
> -
> -static void omap2_usb_devconf_set(u8 port, u32 mask)
> -{
> -	u32 r;
> -
> -	r = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
> -	r |= USBTXWRMODEI(port, mask);
> -	omap_ctrl_writel(r, OMAP2_CONTROL_DEVCONF0);
> -}
> -
> -static void omap2_usb2_disable_5pinbitll(void)
> -{
> -	u32 r;
> -
> -	r = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
> -	r &= ~(USBTXWRMODEI(2, USB_BIDIR_TLL) | USBT2TLL5PI);
> -	omap_ctrl_writel(r, OMAP2_CONTROL_DEVCONF0);
> -}
> -
> -static void omap2_usb2_enable_5pinunitll(void)
> -{
> -	u32 r;
> -
> -	r = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
> -	r |= USBTXWRMODEI(2, USB_UNIDIR_TLL) | USBT2TLL5PI;
> -	omap_ctrl_writel(r, OMAP2_CONTROL_DEVCONF0);
> -}
> -
> -static u32 __init omap2_usb0_init(unsigned nwires, unsigned is_device)
> -{
> -	u32	syscon1 = 0;
> -
> -	omap2_usb_devconf_clear(0, USB_BIDIR_TLL);
> -
> -	if (nwires == 0)
> -		return 0;
> -
> -	if (is_device)
> -		omap_mux_init_signal("usb0_puen", 0);
> -
> -	omap_mux_init_signal("usb0_dat", 0);
> -	omap_mux_init_signal("usb0_txen", 0);
> -	omap_mux_init_signal("usb0_se0", 0);
> -	if (nwires != 3)
> -		omap_mux_init_signal("usb0_rcv", 0);
> -
> -	switch (nwires) {
> -	case 3:
> -		syscon1 = 2;
> -		omap2_usb_devconf_set(0, USB_BIDIR);
> -		break;
> -	case 4:
> -		syscon1 = 1;
> -		omap2_usb_devconf_set(0, USB_BIDIR);
> -		break;
> -	case 6:
> -		syscon1 = 3;
> -		omap_mux_init_signal("usb0_vp", 0);
> -		omap_mux_init_signal("usb0_vm", 0);
> -		omap2_usb_devconf_set(0, USB_UNIDIR);
> -		break;
> -	default:
> -		printk(KERN_ERR "illegal usb%d %d-wire transceiver\n",
> -			0, nwires);
> -	}
> -
> -	return syscon1 << 16;
> -}
> -
> -static u32 __init omap2_usb1_init(unsigned nwires)
> -{
> -	u32	syscon1 = 0;
> -
> -	omap2_usb_devconf_clear(1, USB_BIDIR_TLL);
> -
> -	if (nwires == 0)
> -		return 0;
> -
> -	/* NOTE:  board-specific code must set up pin muxing for usb1,
> -	 * since each signal could come out on either of two balls.
> -	 */
> -
> -	switch (nwires) {
> -	case 2:
> -		/* NOTE: board-specific code must override this setting if
> -		 * this TLL link is not using DP/DM
> -		 */
> -		syscon1 = 1;
> -		omap2_usb_devconf_set(1, USB_BIDIR_TLL);
> -		break;
> -	case 3:
> -		syscon1 = 2;
> -		omap2_usb_devconf_set(1, USB_BIDIR);
> -		break;
> -	case 4:
> -		syscon1 = 1;
> -		omap2_usb_devconf_set(1, USB_BIDIR);
> -		break;
> -	case 6:
> -	default:
> -		printk(KERN_ERR "illegal usb%d %d-wire transceiver\n",
> -			1, nwires);
> -	}
> -
> -	return syscon1 << 20;
> -}
> -
> -static u32 __init omap2_usb2_init(unsigned nwires, unsigned alt_pingroup)
> -{
> -	u32	syscon1 = 0;
> -
> -	omap2_usb2_disable_5pinbitll();
> -	alt_pingroup = 0;
> -
> -	/* NOTE omap1 erratum: must leave USB2_UNI_R set if usb0 in use */
> -	if (alt_pingroup || nwires == 0)
> -		return 0;
> -
> -	omap_mux_init_signal("usb2_dat", 0);
> -	omap_mux_init_signal("usb2_se0", 0);
> -	if (nwires > 2)
> -		omap_mux_init_signal("usb2_txen", 0);
> -	if (nwires > 3)
> -		omap_mux_init_signal("usb2_rcv", 0);
> -
> -	switch (nwires) {
> -	case 2:
> -		/* NOTE: board-specific code must override this setting if
> -		 * this TLL link is not using DP/DM
> -		 */
> -		syscon1 = 1;
> -		omap2_usb_devconf_set(2, USB_BIDIR_TLL);
> -		break;
> -	case 3:
> -		syscon1 = 2;
> -		omap2_usb_devconf_set(2, USB_BIDIR);
> -		break;
> -	case 4:
> -		syscon1 = 1;
> -		omap2_usb_devconf_set(2, USB_BIDIR);
> -		break;
> -	case 5:
> -		/* NOTE: board-specific code must mux this setting depending
> -		 * on TLL link using DP/DM.  Something must also
> -		 * set up OTG_SYSCON2.HMC_TLL{ATTACH,SPEED}
> -		 * 2420: hdq_sio.usb2_tllse0 or vlynq_rx0.usb2_tllse0
> -		 * 2430: hdq_sio.usb2_tllse0 or sdmmc2_dat0.usb2_tllse0
> -		 */
> -
> -		syscon1 = 3;
> -		omap2_usb2_enable_5pinunitll();
> -		break;
> -	case 6:
> -	default:
> -		printk(KERN_ERR "illegal usb%d %d-wire transceiver\n",
> -			2, nwires);
> -	}
> -
> -	return syscon1 << 24;
> -}
> -
> -void __init omap2_usbfs_init(struct omap_usb_config *pdata)
> -{
> -	struct clk *ick;
> -
> -	if (!cpu_is_omap24xx())
> -		return;
> -
> -	ick = clk_get(NULL, "usb_l4_ick");
> -	if (IS_ERR(ick))
> -		return;
> -
> -	clk_enable(ick);
> -	pdata->usb0_init = omap2_usb0_init;
> -	pdata->usb1_init = omap2_usb1_init;
> -	pdata->usb2_init = omap2_usb2_init;
> -	udc_device_init(pdata);
> -	ohci_device_init(pdata);
> -	otg_device_init(pdata);
> -	omap_otg_init(pdata);
> -	clk_disable(ick);
> -	clk_put(ick);
> -}
> -
> -#endif
> 

-- 
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120522/82ca019b/attachment-0001.sig>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 3/4] ARM: OMAP: Make FS USB omap1 only
  2012-05-21 19:01 ` [PATCH 3/4] ARM: OMAP: Make FS USB omap1 only Tony Lindgren
@ 2012-05-22  7:08   ` Felipe Balbi
  2012-05-22 16:07     ` Tony Lindgren
  0 siblings, 1 reply; 13+ messages in thread
From: Felipe Balbi @ 2012-05-22  7:08 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 21, 2012 at 12:01:09PM -0700, Tony Lindgren wrote:
> As the FS USB code is not being actively used for omap2+
> there's no point keeping it around for omap2+.
> 
> Let's make the FS USB platform init code omap1 only so
> we can remove the last user of omap_read/write for omap2+,
> and simplify things for further USB, DMA, and device tree
> related work.
> 
> While at it, also group the mach includes for the related
> drivers.
> 
> Cc: linux-usb at vger.kernel.org
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>

Acked-by: Felipe Balbi <balbi@ti.com>

Are you planning to send this on v3.5 or v3.6 ? I guess it's too late
for v3.5 ?!?

> ---
>  arch/arm/mach-omap1/board-ams-delta.c   |    2 
>  arch/arm/mach-omap1/board-generic.c     |    4 -
>  arch/arm/mach-omap1/board-h2.c          |    2 
>  arch/arm/mach-omap1/board-h3.c          |    2 
>  arch/arm/mach-omap1/board-htcherald.c   |    2 
>  arch/arm/mach-omap1/board-innovator.c   |    2 
>  arch/arm/mach-omap1/board-nokia770.c    |    2 
>  arch/arm/mach-omap1/board-osk.c         |    2 
>  arch/arm/mach-omap1/board-palmte.c      |    2 
>  arch/arm/mach-omap1/board-palmtt.c      |    2 
>  arch/arm/mach-omap1/board-palmz71.c     |    2 
>  arch/arm/mach-omap1/board-sx1.c         |    2 
>  arch/arm/mach-omap1/board-voiceblue.c   |    3 
>  arch/arm/mach-omap1/clock_data.c        |    3 
>  arch/arm/mach-omap1/include/mach/usb.h  |  165 ++++++++++++++++++++++++++
>  arch/arm/mach-omap1/usb.c               |  116 ++++++++++++++++++
>  arch/arm/plat-omap/Makefile             |    2 
>  arch/arm/plat-omap/include/plat/board.h |   38 ------
>  arch/arm/plat-omap/include/plat/usb.h   |  196 -------------------------------
>  arch/arm/plat-omap/usb.c                |  145 -----------------------
>  drivers/usb/gadget/Kconfig              |    2 
>  drivers/usb/gadget/omap_udc.c           |    3 
>  drivers/usb/host/Kconfig                |    2 
>  drivers/usb/host/ohci-omap.c            |    7 +
>  drivers/usb/otg/isp1301_omap.c          |    2 
>  25 files changed, 310 insertions(+), 400 deletions(-)
>  create mode 100644 arch/arm/mach-omap1/include/mach/usb.h
>  delete mode 100644 arch/arm/plat-omap/usb.c
> 
> diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
> index f2f8a58..c534698 100644
> --- a/arch/arm/mach-omap1/board-ams-delta.c
> +++ b/arch/arm/mach-omap1/board-ams-delta.c
> @@ -37,12 +37,12 @@
>  #include <plat/board-ams-delta.h>
>  #include <plat/keypad.h>
>  #include <plat/mux.h>
> -#include <plat/usb.h>
>  #include <plat/board.h>
>  
>  #include <mach/hardware.h>
>  #include <mach/ams-delta-fiq.h>
>  #include <mach/camera.h>
> +#include <mach/usb.h>
>  
>  #include "iomap.h"
>  #include "common.h"
> diff --git a/arch/arm/mach-omap1/board-generic.c b/arch/arm/mach-omap1/board-generic.c
> index e75e2d5..6ec385e 100644
> --- a/arch/arm/mach-omap1/board-generic.c
> +++ b/arch/arm/mach-omap1/board-generic.c
> @@ -23,8 +23,10 @@
>  #include <asm/mach/map.h>
>  
>  #include <plat/mux.h>
> -#include <plat/usb.h>
>  #include <plat/board.h>
> +
> +#include <mach/usb.h>
> +
>  #include "common.h"
>  
>  /* assume no Mini-AB port */
> diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
> index a28e989..44a4ab1 100644
> --- a/arch/arm/mach-omap1/board-h2.c
> +++ b/arch/arm/mach-omap1/board-h2.c
> @@ -40,11 +40,11 @@
>  #include <plat/dma.h>
>  #include <plat/tc.h>
>  #include <plat/irda.h>
> -#include <plat/usb.h>
>  #include <plat/keypad.h>
>  #include <plat/flash.h>
>  
>  #include <mach/hardware.h>
> +#include <mach/usb.h>
>  
>  #include "common.h"
>  #include "board-h2.h"
> diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
> index 108a864..86cb5a0 100644
> --- a/arch/arm/mach-omap1/board-h3.c
> +++ b/arch/arm/mach-omap1/board-h3.c
> @@ -40,13 +40,13 @@
>  
>  #include <plat/mux.h>
>  #include <plat/tc.h>
> -#include <plat/usb.h>
>  #include <plat/keypad.h>
>  #include <plat/dma.h>
>  #include <plat/flash.h>
>  
>  #include <mach/hardware.h>
>  #include <mach/irqs.h>
> +#include <mach/usb.h>
>  
>  #include "common.h"
>  #include "board-h3.h"
> diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c
> index 118a9d4..b3f6e94 100644
> --- a/arch/arm/mach-omap1/board-htcherald.c
> +++ b/arch/arm/mach-omap1/board-htcherald.c
> @@ -44,10 +44,10 @@
>  #include <plat/omap7xx.h>
>  #include <plat/board.h>
>  #include <plat/keypad.h>
> -#include <plat/usb.h>
>  #include <plat/mmc.h>
>  
>  #include <mach/irqs.h>
> +#include <mach/usb.h>
>  
>  #include "common.h"
>  
> diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
> index 7970223..f21c296 100644
> --- a/arch/arm/mach-omap1/board-innovator.c
> +++ b/arch/arm/mach-omap1/board-innovator.c
> @@ -35,11 +35,11 @@
>  #include <plat/flash.h>
>  #include <plat/fpga.h>
>  #include <plat/tc.h>
> -#include <plat/usb.h>
>  #include <plat/keypad.h>
>  #include <plat/mmc.h>
>  
>  #include <mach/hardware.h>
> +#include <mach/usb.h>
>  
>  #include "iomap.h"
>  #include "common.h"
> diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
> index 7212ae9..4007a372 100644
> --- a/arch/arm/mach-omap1/board-nokia770.c
> +++ b/arch/arm/mach-omap1/board-nokia770.c
> @@ -26,7 +26,6 @@
>  #include <asm/mach/map.h>
>  
>  #include <plat/mux.h>
> -#include <plat/usb.h>
>  #include <plat/board.h>
>  #include <plat/keypad.h>
>  #include <plat/lcd_mipid.h>
> @@ -34,6 +33,7 @@
>  #include <plat/clock.h>
>  
>  #include <mach/hardware.h>
> +#include <mach/usb.h>
>  
>  #include "common.h"
>  
> diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
> index da8d872..8784705 100644
> --- a/arch/arm/mach-omap1/board-osk.c
> +++ b/arch/arm/mach-omap1/board-osk.c
> @@ -45,11 +45,11 @@
>  #include <asm/mach/map.h>
>  
>  #include <plat/flash.h>
> -#include <plat/usb.h>
>  #include <plat/mux.h>
>  #include <plat/tc.h>
>  
>  #include <mach/hardware.h>
> +#include <mach/usb.h>
>  
>  #include "common.h"
>  
> diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
> index 949b62a..26bcb9d 100644
> --- a/arch/arm/mach-omap1/board-palmte.c
> +++ b/arch/arm/mach-omap1/board-palmte.c
> @@ -35,7 +35,6 @@
>  
>  #include <plat/flash.h>
>  #include <plat/mux.h>
> -#include <plat/usb.h>
>  #include <plat/tc.h>
>  #include <plat/dma.h>
>  #include <plat/board.h>
> @@ -43,6 +42,7 @@
>  #include <plat/keypad.h>
>  
>  #include <mach/hardware.h>
> +#include <mach/usb.h>
>  
>  #include "common.h"
>  
> diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c
> index 7f1e1cf..4d09944 100644
> --- a/arch/arm/mach-omap1/board-palmtt.c
> +++ b/arch/arm/mach-omap1/board-palmtt.c
> @@ -35,7 +35,6 @@
>  #include <plat/led.h>
>  #include <plat/flash.h>
>  #include <plat/mux.h>
> -#include <plat/usb.h>
>  #include <plat/dma.h>
>  #include <plat/tc.h>
>  #include <plat/board.h>
> @@ -43,6 +42,7 @@
>  #include <plat/keypad.h>
>  
>  #include <mach/hardware.h>
> +#include <mach/usb.h>
>  
>  #include "common.h"
>  
> diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c
> index 3c71c6b..cc71a26 100644
> --- a/arch/arm/mach-omap1/board-palmz71.c
> +++ b/arch/arm/mach-omap1/board-palmz71.c
> @@ -37,7 +37,6 @@
>  
>  #include <plat/flash.h>
>  #include <plat/mux.h>
> -#include <plat/usb.h>
>  #include <plat/dma.h>
>  #include <plat/tc.h>
>  #include <plat/board.h>
> @@ -45,6 +44,7 @@
>  #include <plat/keypad.h>
>  
>  #include <mach/hardware.h>
> +#include <mach/usb.h>
>  
>  #include "common.h"
>  
> diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c
> index 3b7b82b..8c665bd 100644
> --- a/arch/arm/mach-omap1/board-sx1.c
> +++ b/arch/arm/mach-omap1/board-sx1.c
> @@ -37,13 +37,13 @@
>  #include <plat/mux.h>
>  #include <plat/dma.h>
>  #include <plat/irda.h>
> -#include <plat/usb.h>
>  #include <plat/tc.h>
>  #include <plat/board.h>
>  #include <plat/keypad.h>
>  #include <plat/board-sx1.h>
>  
>  #include <mach/hardware.h>
> +#include <mach/usb.h>
>  
>  #include "common.h"
>  
> diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
> index afd67f0..3497769 100644
> --- a/arch/arm/mach-omap1/board-voiceblue.c
> +++ b/arch/arm/mach-omap1/board-voiceblue.c
> @@ -35,9 +35,10 @@
>  #include <plat/flash.h>
>  #include <plat/mux.h>
>  #include <plat/tc.h>
> -#include <plat/usb.h>
> +#include <plat/board.h>
>  
>  #include <mach/hardware.h>
> +#include <mach/usb.h>
>  
>  #include "common.h"
>  
> diff --git a/arch/arm/mach-omap1/clock_data.c b/arch/arm/mach-omap1/clock_data.c
> index c6ce93f..c007d80 100644
> --- a/arch/arm/mach-omap1/clock_data.c
> +++ b/arch/arm/mach-omap1/clock_data.c
> @@ -25,10 +25,11 @@
>  #include <plat/clock.h>
>  #include <plat/cpu.h>
>  #include <plat/clkdev_omap.h>
> +#include <plat/board.h>
>  #include <plat/sram.h>	/* for omap_sram_reprogram_clock() */
> -#include <plat/usb.h>   /* for OTG_BASE */
>  
>  #include <mach/hardware.h>
> +#include <mach/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
> new file mode 100644
> index 0000000..753cd5c
> --- /dev/null
> +++ b/arch/arm/mach-omap1/include/mach/usb.h
> @@ -0,0 +1,165 @@
> +/*
> + * FIXME correct answer depends on hmc_mode,
> + * as does (on omap1) any nonzero value for config->otg port number
> + */
> +#ifdef	CONFIG_USB_GADGET_OMAP
> +#define	is_usb0_device(config)	1
> +#else
> +#define	is_usb0_device(config)	0
> +#endif
> +
> +struct omap_usb_config {
> +	/* Configure drivers according to the connectors on your board:
> +	 *  - "A" connector (rectagular)
> +	 *	... for host/OHCI use, set "register_host".
> +	 *  - "B" connector (squarish) or "Mini-B"
> +	 *	... for device/gadget use, set "register_dev".
> +	 *  - "Mini-AB" connector (very similar to Mini-B)
> +	 *	... for OTG use as device OR host, initialize "otg"
> +	 */
> +	unsigned	register_host:1;
> +	unsigned	register_dev:1;
> +	u8		otg;	/* port number, 1-based:  usb1 == 2 */
> +
> +	u8		hmc_mode;
> +
> +	/* implicitly true if otg:  host supports remote wakeup? */
> +	u8		rwc;
> +
> +	/* signaling pins used to talk to transceiver on usbN:
> +	 *  0 == usbN unused
> +	 *  2 == usb0-only, using internal transceiver
> +	 *  3 == 3 wire bidirectional
> +	 *  4 == 4 wire bidirectional
> +	 *  6 == 6 wire unidirectional (or TLL)
> +	 */
> +	u8		pins[3];
> +
> +	struct platform_device *udc_device;
> +	struct platform_device *ohci_device;
> +	struct platform_device *otg_device;
> +
> +	u32 (*usb0_init)(unsigned nwires, unsigned is_device);
> +	u32 (*usb1_init)(unsigned nwires);
> +	u32 (*usb2_init)(unsigned nwires, unsigned alt_pingroup);
> +
> +	int (*ocpi_enable)(void);
> +};
> +
> +void omap_otg_init(struct omap_usb_config *config);
> +
> +#if defined(CONFIG_USB) || defined(CONFIG_USB_MODULE)
> +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)
> diff --git a/arch/arm/mach-omap1/usb.c b/arch/arm/mach-omap1/usb.c
> index e61afd9..65f8817 100644
> --- a/arch/arm/mach-omap1/usb.c
> +++ b/arch/arm/mach-omap1/usb.c
> @@ -27,7 +27,8 @@
>  #include <asm/irq.h>
>  
>  #include <plat/mux.h>
> -#include <plat/usb.h>
> +
> +#include <mach/usb.h>
>  
>  #include "common.h"
>  
> @@ -55,6 +56,119 @@
>  #define INT_USB_IRQ_HGEN	INT_USB_HHC_1
>  #define INT_USB_IRQ_OTG		IH2_BASE + 8
>  
> +#ifdef	CONFIG_ARCH_OMAP_OTG
> +
> +void __init
> +omap_otg_init(struct omap_usb_config *config)
> +{
> +	u32		syscon;
> +	int		alt_pingroup = 0;
> +
> +	/* NOTE:  no bus or clock setup (yet?) */
> +
> +	syscon = omap_readl(OTG_SYSCON_1) & 0xffff;
> +	if (!(syscon & OTG_RESET_DONE))
> +		pr_debug("USB resets not complete?\n");
> +
> +	//omap_writew(0, OTG_IRQ_EN);
> +
> +	/* pin muxing and transceiver pinouts */
> +	if (config->pins[0] > 2)	/* alt pingroup 2 */
> +		alt_pingroup = 1;
> +	syscon |= config->usb0_init(config->pins[0], is_usb0_device(config));
> +	syscon |= config->usb1_init(config->pins[1]);
> +	syscon |= config->usb2_init(config->pins[2], alt_pingroup);
> +	pr_debug("OTG_SYSCON_1 = %08x\n", omap_readl(OTG_SYSCON_1));
> +	omap_writel(syscon, OTG_SYSCON_1);
> +
> +	syscon = config->hmc_mode;
> +	syscon |= USBX_SYNCHRO | (4 << 16) /* B_ASE0_BRST */;
> +#ifdef	CONFIG_USB_OTG
> +	if (config->otg)
> +		syscon |= OTG_EN;
> +#endif
> +	if (cpu_class_is_omap1())
> +		pr_debug("USB_TRANSCEIVER_CTRL = %03x\n",
> +			 omap_readl(USB_TRANSCEIVER_CTRL));
> +	pr_debug("OTG_SYSCON_2 = %08x\n", omap_readl(OTG_SYSCON_2));
> +	omap_writel(syscon, OTG_SYSCON_2);
> +
> +	printk("USB: hmc %d", config->hmc_mode);
> +	if (!alt_pingroup)
> +		printk(", usb2 alt %d wires", config->pins[2]);
> +	else if (config->pins[0])
> +		printk(", usb0 %d wires%s", config->pins[0],
> +			is_usb0_device(config) ? " (dev)" : "");
> +	if (config->pins[1])
> +		printk(", usb1 %d wires", config->pins[1]);
> +	if (!alt_pingroup && config->pins[2])
> +		printk(", usb2 %d wires", config->pins[2]);
> +	if (config->otg)
> +		printk(", Mini-AB on usb%d", config->otg - 1);
> +	printk("\n");
> +
> +	if (cpu_class_is_omap1()) {
> +		u16 w;
> +
> +		/* leave USB clocks/controllers off until needed */
> +		w = omap_readw(ULPD_SOFT_REQ);
> +		w &= ~SOFT_USB_CLK_REQ;
> +		omap_writew(w, ULPD_SOFT_REQ);
> +
> +		w = omap_readw(ULPD_CLOCK_CTRL);
> +		w &= ~USB_MCLK_EN;
> +		w |= DIS_USB_PVCI_CLK;
> +		omap_writew(w, ULPD_CLOCK_CTRL);
> +	}
> +	syscon = omap_readl(OTG_SYSCON_1);
> +	syscon |= HST_IDLE_EN|DEV_IDLE_EN|OTG_IDLE_EN;
> +
> +#ifdef	CONFIG_USB_GADGET_OMAP
> +	if (config->otg || config->register_dev) {
> +		struct platform_device *udc_device = config->udc_device;
> +		int status;
> +
> +		syscon &= ~DEV_IDLE_EN;
> +		udc_device->dev.platform_data = config;
> +		status = platform_device_register(udc_device);
> +		if (status)
> +			pr_debug("can't register UDC device, %d\n", status);
> +	}
> +#endif
> +
> +#if	defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
> +	if (config->otg || config->register_host) {
> +		struct platform_device *ohci_device = config->ohci_device;
> +		int status;
> +
> +		syscon &= ~HST_IDLE_EN;
> +		ohci_device->dev.platform_data = config;
> +		status = platform_device_register(ohci_device);
> +		if (status)
> +			pr_debug("can't register OHCI device, %d\n", status);
> +	}
> +#endif
> +
> +#ifdef	CONFIG_USB_OTG
> +	if (config->otg) {
> +		struct platform_device *otg_device = config->otg_device;
> +		int status;
> +
> +		syscon &= ~OTG_IDLE_EN;
> +		otg_device->dev.platform_data = config;
> +		status = platform_device_register(otg_device);
> +		if (status)
> +			pr_debug("can't register OTG device, %d\n", status);
> +	}
> +#endif
> +	pr_debug("OTG_SYSCON_1 = %08x\n", omap_readl(OTG_SYSCON_1));
> +	omap_writel(syscon, OTG_SYSCON_1);
> +}
> +
> +#else
> +void omap_otg_init(struct omap_usb_config *config) {}
> +#endif
> +
>  #ifdef	CONFIG_USB_GADGET_OMAP
>  
>  static struct resource udc_resources[] = {
> diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile
> index ed8605f..6d87532 100644
> --- a/arch/arm/plat-omap/Makefile
> +++ b/arch/arm/plat-omap/Makefile
> @@ -4,7 +4,7 @@
>  
>  # Common support
>  obj-y := common.o sram.o clock.o devices.o dma.o mux.o \
> -	 usb.o fb.o counter_32k.o
> +	 fb.o counter_32k.o
>  obj-m :=
>  obj-n :=
>  obj-  :=
> diff --git a/arch/arm/plat-omap/include/plat/board.h b/arch/arm/plat-omap/include/plat/board.h
> index 4814c5b..e62f20a 100644
> --- a/arch/arm/plat-omap/include/plat/board.h
> +++ b/arch/arm/plat-omap/include/plat/board.h
> @@ -57,44 +57,6 @@ struct omap_camera_sensor_config {
>  	int (*power_off)(void * data);
>  };
>  
> -struct omap_usb_config {
> -	/* Configure drivers according to the connectors on your board:
> -	 *  - "A" connector (rectagular)
> -	 *	... for host/OHCI use, set "register_host".
> -	 *  - "B" connector (squarish) or "Mini-B"
> -	 *	... for device/gadget use, set "register_dev".
> -	 *  - "Mini-AB" connector (very similar to Mini-B)
> -	 *	... for OTG use as device OR host, initialize "otg"
> -	 */
> -	unsigned	register_host:1;
> -	unsigned	register_dev:1;
> -	u8		otg;	/* port number, 1-based:  usb1 == 2 */
> -
> -	u8		hmc_mode;
> -
> -	/* implicitly true if otg:  host supports remote wakeup? */
> -	u8		rwc;
> -
> -	/* signaling pins used to talk to transceiver on usbN:
> -	 *  0 == usbN unused
> -	 *  2 == usb0-only, using internal transceiver
> -	 *  3 == 3 wire bidirectional
> -	 *  4 == 4 wire bidirectional
> -	 *  6 == 6 wire unidirectional (or TLL)
> -	 */
> -	u8		pins[3];
> -
> -	struct platform_device *udc_device;
> -	struct platform_device *ohci_device;
> -	struct platform_device *otg_device;
> -
> -	u32 (*usb0_init)(unsigned nwires, unsigned is_device);
> -	u32 (*usb1_init)(unsigned nwires);
> -	u32 (*usb2_init)(unsigned nwires, unsigned alt_pingroup);
> -
> -	int (*ocpi_enable)(void);
> -};
> -
>  struct omap_lcd_config {
>  	char panel_name[16];
>  	char ctrl_name[16];
> diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h
> index 762eeb0..548a4c8 100644
> --- a/arch/arm/plat-omap/include/plat/usb.h
> +++ b/arch/arm/plat-omap/include/plat/usb.h
> @@ -44,6 +44,8 @@ struct usbhs_omap_board_data {
>  	struct regulator		*regulator[OMAP3_HS_USB_PORTS];
>  };
>  
> +#ifdef CONFIG_ARCH_OMAP2PLUS
> +
>  struct ehci_hcd_omap_platform_data {
>  	enum usbhs_omap_port_mode	port_mode[OMAP3_HS_USB_PORTS];
>  	int				reset_gpio_port[OMAP3_HS_USB_PORTS];
> @@ -64,26 +66,6 @@ struct usbhs_omap_platform_data {
>  };
>  /*-------------------------------------------------------------------------*/
>  
> -#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
> -
> -#ifdef CONFIG_ARCH_OMAP1
> -
> -#define OTG_BASE			OMAP1_OTG_BASE
> -#define UDC_BASE			OMAP1_UDC_BASE
> -#define OMAP_OHCI_BASE			OMAP1_OHCI_BASE
> -
> -#else
> -
> -#define OTG_BASE			OMAP2_OTG_BASE
> -#define UDC_BASE			OMAP2_UDC_BASE
> -#define OMAP_OHCI_BASE			OMAP2_OHCI_BASE
> -
>  struct omap_musb_board_data {
>  	u8	interface_type;
>  	u8	mode;
> @@ -107,44 +89,6 @@ extern int omap4430_phy_init(struct device *dev);
>  extern int omap4430_phy_exit(struct device *dev);
>  extern int omap4430_phy_suspend(struct device *dev, int suspend);
>  
> -/*
> - * NOTE: Please update omap USB drivers to use ioremap + read/write
> - */
> -
> -#define OMAP2_L4_IO_OFFSET	0xb2000000
> -#define OMAP2_L4_IO_ADDRESS(pa)	IOMEM((pa) + OMAP2_L4_IO_OFFSET)
> -
> -static inline u8 omap_readb(u32 pa)
> -{
> -	return __raw_readb(OMAP2_L4_IO_ADDRESS(pa));
> -}
> -
> -static inline u16 omap_readw(u32 pa)
> -{
> -	return __raw_readw(OMAP2_L4_IO_ADDRESS(pa));
> -}
> -
> -static inline u32 omap_readl(u32 pa)
> -{
> -	return __raw_readl(OMAP2_L4_IO_ADDRESS(pa));
> -}
> -
> -static inline void omap_writeb(u8 v, u32 pa)
> -{
> -	__raw_writeb(v, OMAP2_L4_IO_ADDRESS(pa));
> -}
> -
> -
> -static inline void omap_writew(u16 v, u32 pa)
> -{
> -	__raw_writew(v, OMAP2_L4_IO_ADDRESS(pa));
> -}
> -
> -static inline void omap_writel(u32 v, u32 pa)
> -{
> -	__raw_writel(v, OMAP2_L4_IO_ADDRESS(pa));
> -}
> -
>  #endif
>  
>  extern void am35x_musb_reset(void);
> @@ -153,142 +97,6 @@ extern void am35x_musb_clear_irq(void);
>  extern void am35x_set_mode(u8 musb_mode);
>  extern void ti81xx_musb_phy_power(u8 on);
>  
> -/*
> - * FIXME correct answer depends on hmc_mode,
> - * as does (on omap1) any nonzero value for config->otg port number
> - */
> -#ifdef	CONFIG_USB_GADGET_OMAP
> -#define	is_usb0_device(config)	1
> -#else
> -#define	is_usb0_device(config)	0
> -#endif
> -
> -void omap_otg_init(struct omap_usb_config *config);
> -
> -#if defined(CONFIG_USB) || defined(CONFIG_USB_MODULE)
> -void omap1_usb_init(struct omap_usb_config *pdata);
> -#else
> -static inline void omap1_usb_init(struct omap_usb_config *pdata)
> -{
> -}
> -#endif
> -
> -#if defined(CONFIG_ARCH_OMAP_OTG) || defined(CONFIG_ARCH_OMAP_OTG_MODULE)
> -void omap2_usbfs_init(struct omap_usb_config *pdata);
> -#else
> -static inline void omap2_usbfs_init(struct omap_usb_config *pdata)
> -{
> -}
> -#endif
> -
> -/*-------------------------------------------------------------------------*/
> -
> -/*
> - * 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)
> -
> -/* OMAP2 */
> -#	define	USB_UNIDIR			0x0
> -#	define	USB_UNIDIR_TLL			0x1
> -#	define	USB_BIDIR			0x2
> -#	define	USB_BIDIR_TLL			0x3
> -#	define	USBTXWRMODEI(port, x)	((x) << (22 - (port * 2)))
> -#	define	USBT2TLL5PI		(1 << 17)
> -#	define	USB0PUENACTLOI		(1 << 16)
> -#	define	USBSTANDBYCTRL		(1 << 15)
>  /* AM35x */
>  /* USB 2.0 PHY Control */
>  #define CONF2_PHY_GPIOMODE	(1 << 23)
> diff --git a/arch/arm/plat-omap/usb.c b/arch/arm/plat-omap/usb.c
> deleted file mode 100644
> index daa0327..0000000
> --- a/arch/arm/plat-omap/usb.c
> +++ /dev/null
> @@ -1,145 +0,0 @@
> - /*
> - * arch/arm/plat-omap/usb.c -- platform level USB initialization
> - *
> - * Copyright (C) 2004 Texas Instruments, Inc.
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License as published by
> - * the Free Software Foundation; either version 2 of the License, or
> - * (at your option) any later version.
> - *
> - * This program is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> - * GNU General Public License for more details.
> - *
> - * You should have received a copy of the GNU General Public License
> - * along with this program; if not, write to the Free Software
> - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
> - */
> -
> -#undef	DEBUG
> -
> -#include <linux/module.h>
> -#include <linux/kernel.h>
> -#include <linux/init.h>
> -#include <linux/platform_device.h>
> -#include <linux/io.h>
> -
> -#include <plat/usb.h>
> -#include <plat/board.h>
> -
> -#include <mach/hardware.h>
> -
> -#ifdef	CONFIG_ARCH_OMAP_OTG
> -
> -void __init
> -omap_otg_init(struct omap_usb_config *config)
> -{
> -	u32		syscon;
> -	int		alt_pingroup = 0;
> -
> -	/* NOTE:  no bus or clock setup (yet?) */
> -
> -	syscon = omap_readl(OTG_SYSCON_1) & 0xffff;
> -	if (!(syscon & OTG_RESET_DONE))
> -		pr_debug("USB resets not complete?\n");
> -
> -	//omap_writew(0, OTG_IRQ_EN);
> -
> -	/* pin muxing and transceiver pinouts */
> -	if (config->pins[0] > 2)	/* alt pingroup 2 */
> -		alt_pingroup = 1;
> -	syscon |= config->usb0_init(config->pins[0], is_usb0_device(config));
> -	syscon |= config->usb1_init(config->pins[1]);
> -	syscon |= config->usb2_init(config->pins[2], alt_pingroup);
> -	pr_debug("OTG_SYSCON_1 = %08x\n", omap_readl(OTG_SYSCON_1));
> -	omap_writel(syscon, OTG_SYSCON_1);
> -
> -	syscon = config->hmc_mode;
> -	syscon |= USBX_SYNCHRO | (4 << 16) /* B_ASE0_BRST */;
> -#ifdef	CONFIG_USB_OTG
> -	if (config->otg)
> -		syscon |= OTG_EN;
> -#endif
> -	if (cpu_class_is_omap1())
> -		pr_debug("USB_TRANSCEIVER_CTRL = %03x\n",
> -			 omap_readl(USB_TRANSCEIVER_CTRL));
> -	pr_debug("OTG_SYSCON_2 = %08x\n", omap_readl(OTG_SYSCON_2));
> -	omap_writel(syscon, OTG_SYSCON_2);
> -
> -	printk("USB: hmc %d", config->hmc_mode);
> -	if (!alt_pingroup)
> -		printk(", usb2 alt %d wires", config->pins[2]);
> -	else if (config->pins[0])
> -		printk(", usb0 %d wires%s", config->pins[0],
> -			is_usb0_device(config) ? " (dev)" : "");
> -	if (config->pins[1])
> -		printk(", usb1 %d wires", config->pins[1]);
> -	if (!alt_pingroup && config->pins[2])
> -		printk(", usb2 %d wires", config->pins[2]);
> -	if (config->otg)
> -		printk(", Mini-AB on usb%d", config->otg - 1);
> -	printk("\n");
> -
> -	if (cpu_class_is_omap1()) {
> -		u16 w;
> -
> -		/* leave USB clocks/controllers off until needed */
> -		w = omap_readw(ULPD_SOFT_REQ);
> -		w &= ~SOFT_USB_CLK_REQ;
> -		omap_writew(w, ULPD_SOFT_REQ);
> -
> -		w = omap_readw(ULPD_CLOCK_CTRL);
> -		w &= ~USB_MCLK_EN;
> -		w |= DIS_USB_PVCI_CLK;
> -		omap_writew(w, ULPD_CLOCK_CTRL);
> -	}
> -	syscon = omap_readl(OTG_SYSCON_1);
> -	syscon |= HST_IDLE_EN|DEV_IDLE_EN|OTG_IDLE_EN;
> -
> -#ifdef	CONFIG_USB_GADGET_OMAP
> -	if (config->otg || config->register_dev) {
> -		struct platform_device *udc_device = config->udc_device;
> -		int status;
> -
> -		syscon &= ~DEV_IDLE_EN;
> -		udc_device->dev.platform_data = config;
> -		status = platform_device_register(udc_device);
> -		if (status)
> -			pr_debug("can't register UDC device, %d\n", status);
> -	}
> -#endif
> -
> -#if	defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
> -	if (config->otg || config->register_host) {
> -		struct platform_device *ohci_device = config->ohci_device;
> -		int status;
> -
> -		syscon &= ~HST_IDLE_EN;
> -		ohci_device->dev.platform_data = config;
> -		status = platform_device_register(ohci_device);
> -		if (status)
> -			pr_debug("can't register OHCI device, %d\n", status);
> -	}
> -#endif
> -
> -#ifdef	CONFIG_USB_OTG
> -	if (config->otg) {
> -		struct platform_device *otg_device = config->otg_device;
> -		int status;
> -
> -		syscon &= ~OTG_IDLE_EN;
> -		otg_device->dev.platform_data = config;
> -		status = platform_device_register(otg_device);
> -		if (status)
> -			pr_debug("can't register OTG device, %d\n", status);
> -	}
> -#endif
> -	pr_debug("OTG_SYSCON_1 = %08x\n", omap_readl(OTG_SYSCON_1));
> -	omap_writel(syscon, OTG_SYSCON_1);
> -}
> -
> -#else
> -void omap_otg_init(struct omap_usb_config *config) {}
> -#endif
> diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
> index bddc8fd..271ca16 100644
> --- a/drivers/usb/gadget/Kconfig
> +++ b/drivers/usb/gadget/Kconfig
> @@ -185,7 +185,7 @@ config USB_FUSB300
>  
>  config USB_OMAP
>  	tristate "OMAP USB Device Controller"
> -	depends on ARCH_OMAP
> +	depends on ARCH_OMAP1
>  	select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_OMAP_H4_OTG
>  	select USB_OTG_UTILS if ARCH_OMAP
>  	help
> diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
> index 7ba3246..2acf06c 100644
> --- a/drivers/usb/gadget/omap_udc.c
> +++ b/drivers/usb/gadget/omap_udc.c
> @@ -44,7 +44,8 @@
>  #include <asm/mach-types.h>
>  
>  #include <plat/dma.h>
> -#include <plat/usb.h>
> +
> +#include <mach/usb.h>
>  
>  #include "omap_udc.h"
>  
> diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
> index 83e58df..dcfaaa9 100644
> --- a/drivers/usb/host/Kconfig
> +++ b/drivers/usb/host/Kconfig
> @@ -308,7 +308,7 @@ config USB_OHCI_HCD
>  
>  config USB_OHCI_HCD_OMAP1
>  	bool "OHCI support for OMAP1/2 chips"
> -	depends on USB_OHCI_HCD && (ARCH_OMAP1 || ARCH_OMAP2)
> +	depends on USB_OHCI_HCD && ARCH_OMAP1
>  	default y
>  	---help---
>  	  Enables support for the OHCI controller on OMAP1/2 chips.
> diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
> index 9ce35d0..b02c344 100644
> --- a/drivers/usb/host/ohci-omap.c
> +++ b/drivers/usb/host/ohci-omap.c
> @@ -20,14 +20,15 @@
>  #include <linux/clk.h>
>  #include <linux/gpio.h>
>  
> -#include <mach/hardware.h>
>  #include <asm/io.h>
>  #include <asm/mach-types.h>
>  
>  #include <plat/mux.h>
> -#include <mach/irqs.h>
>  #include <plat/fpga.h>
> -#include <plat/usb.h>
> +
> +#include <mach/hardware.h>
> +#include <mach/irqs.h>
> +#include <mach/usb.h>
>  
>  
>  /* OMAP-1510 OHCI has its own MMU for DMA */
> diff --git a/drivers/usb/otg/isp1301_omap.c b/drivers/usb/otg/isp1301_omap.c
> index 70cf5d7..e0558df 100644
> --- a/drivers/usb/otg/isp1301_omap.c
> +++ b/drivers/usb/otg/isp1301_omap.c
> @@ -36,9 +36,9 @@
>  #include <asm/irq.h>
>  #include <asm/mach-types.h>
>  
> -#include <plat/usb.h>
>  #include <plat/mux.h>
>  
> +#include <mach/usb.h>
>  
>  #ifndef	DEBUG
>  #undef	VERBOSE
> 

-- 
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120522/230da5a6/attachment-0001.sig>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 4/4] USB: Remove omap2 support from omap_udc.c
  2012-05-21 19:01 ` [PATCH 4/4] USB: Remove omap2 support from omap_udc.c Tony Lindgren
@ 2012-05-22  7:09   ` Felipe Balbi
  2012-05-22 16:06     ` Tony Lindgren
  0 siblings, 1 reply; 13+ messages in thread
From: Felipe Balbi @ 2012-05-22  7:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 21, 2012 at 12:01:11PM -0700, Tony Lindgren wrote:
> There are no active users of this code for omap2 as
> the boards in use have either TUSB or MUSB controller.
> 
> While at it, also fix warnings related to uninitialized
> dc_clk and hhc_clk.
> 
> Cc: linux-usb at vger.kernel.org
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>

This one doesn't depend on the rest of the series, I can take it myself
to v3.6 or you can take it with your series:

Acked-by: Felipe Balbi <balbi@ti.com>

> ---
>  drivers/usb/gadget/omap_udc.c |  113 ++++++++---------------------------------
>  1 file changed, 23 insertions(+), 90 deletions(-)
> 
> diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
> index 2acf06c..913587f 100644
> --- a/drivers/usb/gadget/omap_udc.c
> +++ b/drivers/usb/gadget/omap_udc.c
> @@ -62,9 +62,6 @@
>  
>  #define	DMA_ADDR_INVALID	(~(dma_addr_t)0)
>  
> -#define OMAP2_DMA_CH(ch)	(((ch) - 1) << 1)
> -#define OMAP24XX_DMA(name, ch)	(OMAP24XX_DMA_##name + OMAP2_DMA_CH(ch))
> -
>  /*
>   * The OMAP UDC needs _very_ early endpoint setup:  before enabling the
>   * D+ pullup to allow enumeration.  That's too early for the gadget
> @@ -537,12 +534,8 @@ static void next_in_dma(struct omap_ep *ep, struct omap_req *req)
>  				: OMAP_DMA_SYNC_ELEMENT;
>  	int		dma_trigger = 0;
>  
> -	if (cpu_is_omap24xx())
> -		dma_trigger = OMAP24XX_DMA(USB_W2FC_TX0, ep->dma_channel);
> -
>  	/* measure length in either bytes or packets */
>  	if ((cpu_is_omap16xx() && length <= UDC_TXN_TSC)
> -			|| (cpu_is_omap24xx() && length < ep->maxpacket)
>  			|| (cpu_is_omap15xx() && length < ep->maxpacket)) {
>  		txdma_ctrl = UDC_TXN_EOT | length;
>  		omap_set_dma_transfer_params(ep->lch, OMAP_DMA_DATA_TYPE_S8,
> @@ -601,28 +594,14 @@ static void next_out_dma(struct omap_ep *ep, struct omap_req *req)
>  	int dma_trigger = 0;
>  	u16 w;
>  
> -	if (cpu_is_omap24xx())
> -		dma_trigger = OMAP24XX_DMA(USB_W2FC_RX0, ep->dma_channel);
> -
> -	/* NOTE:  we filtered out "short reads" before, so we know
> -	 * the buffer has only whole numbers of packets.
> -	 * except MODE SELECT(6) sent the 24 bytes data in OMAP24XX DMA mode
> -	 */
> -	if (cpu_is_omap24xx() && packets < ep->maxpacket) {
> -		omap_set_dma_transfer_params(ep->lch, OMAP_DMA_DATA_TYPE_S8,
> -				packets, 1, OMAP_DMA_SYNC_ELEMENT,
> -				dma_trigger, 0);
> -		req->dma_bytes = packets;
> -	} else {
> -		/* set up this DMA transfer, enable the fifo, start */
> -		packets /= ep->ep.maxpacket;
> -		packets = min(packets, (unsigned)UDC_RXN_TC + 1);
> -		req->dma_bytes = packets * ep->ep.maxpacket;
> -		omap_set_dma_transfer_params(ep->lch, OMAP_DMA_DATA_TYPE_S16,
> -				ep->ep.maxpacket >> 1, packets,
> -				OMAP_DMA_SYNC_ELEMENT,
> -				dma_trigger, 0);
> -	}
> +	/* set up this DMA transfer, enable the fifo, start */
> +	packets /= ep->ep.maxpacket;
> +	packets = min(packets, (unsigned)UDC_RXN_TC + 1);
> +	req->dma_bytes = packets * ep->ep.maxpacket;
> +	omap_set_dma_transfer_params(ep->lch, OMAP_DMA_DATA_TYPE_S16,
> +			ep->ep.maxpacket >> 1, packets,
> +			OMAP_DMA_SYNC_ELEMENT,
> +			dma_trigger, 0);
>  	omap_set_dma_dest_params(ep->lch, OMAP_DMA_PORT_EMIFF,
>  		OMAP_DMA_AMODE_POST_INC, req->req.dma + req->req.actual,
>  		0, 0);
> @@ -761,10 +740,7 @@ static void dma_channel_claim(struct omap_ep *ep, unsigned channel)
>  	ep->dma_channel = channel;
>  
>  	if (is_in) {
> -		if (cpu_is_omap24xx())
> -			dma_channel = OMAP24XX_DMA(USB_W2FC_TX0, channel);
> -		else
> -			dma_channel = OMAP_DMA_USB_W2FC_TX0 - 1 + channel;
> +		dma_channel = OMAP_DMA_USB_W2FC_TX0 - 1 + channel;
>  		status = omap_request_dma(dma_channel,
>  			ep->ep.name, dma_error, ep, &ep->lch);
>  		if (status == 0) {
> @@ -781,11 +757,7 @@ static void dma_channel_claim(struct omap_ep *ep, unsigned channel)
>  				0, 0);
>  		}
>  	} else {
> -		if (cpu_is_omap24xx())
> -			dma_channel = OMAP24XX_DMA(USB_W2FC_RX0, channel);
> -		else
> -			dma_channel = OMAP_DMA_USB_W2FC_RX0 - 1 + channel;
> -
> +		dma_channel = OMAP_DMA_USB_W2FC_RX0 - 1 + channel;
>  		status = omap_request_dma(dma_channel,
>  			ep->ep.name, dma_error, ep, &ep->lch);
>  		if (status == 0) {
> @@ -809,7 +781,7 @@ static void dma_channel_claim(struct omap_ep *ep, unsigned channel)
>  		omap_disable_dma_irq(ep->lch, OMAP_DMA_BLOCK_IRQ);
>  
>  		/* channel type P: hw synch (fifo) */
> -		if (cpu_class_is_omap1() && !cpu_is_omap15xx())
> +		if (!cpu_is_omap15xx())
>  			omap_set_dma_channel_mode(ep->lch, OMAP_DMA_LCH_P);
>  	}
>  
> @@ -929,13 +901,11 @@ omap_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
>  
>  	/* this isn't bogus, but OMAP DMA isn't the only hardware to
>  	 * have a hard time with partial packet reads...  reject it.
> -	 * Except OMAP2 can handle the small packets.
>  	 */
>  	if (use_dma
>  			&& ep->has_dma
>  			&& ep->bEndpointAddress != 0
>  			&& (ep->bEndpointAddress & USB_DIR_IN) == 0
> -			&& !cpu_class_is_omap2()
>  			&& (req->req.length % ep->ep.maxpacket) != 0) {
>  		DBG("%s, no partial packet OUT reads\n", __func__);
>  		return -EMSGSIZE;
> @@ -2091,10 +2061,6 @@ static inline int machine_without_vbus_sense(void)
>  {
>  	return (machine_is_omap_innovator()
>  		|| machine_is_omap_osk()
> -		|| machine_is_omap_apollon()
> -#ifndef CONFIG_MACH_OMAP_H4_OTG
> -		|| machine_is_omap_h4()
> -#endif
>  		|| machine_is_sx1()
>  		|| cpu_is_omap7xx() /* No known omap7xx boards with vbus sense */
>  		);
> @@ -2308,12 +2274,9 @@ static int proc_otg_show(struct seq_file *s)
>  	u32		trans = 0;
>  	char		*ctrl_name = "(UNKNOWN)";
>  
> -	/* XXX This needs major revision for OMAP2+ */
>  	tmp = omap_readl(OTG_REV);
> -	if (cpu_class_is_omap1()) {
> -		ctrl_name = "tranceiver_ctrl";
> -		trans = omap_readw(USB_TRANSCEIVER_CTRL);
> -	}
> +	ctrl_name = "tranceiver_ctrl";
> +	trans = omap_readw(USB_TRANSCEIVER_CTRL);
>  	seq_printf(s, "\nOTG rev %d.%d, %s %05x\n",
>  		tmp >> 4, tmp & 0xf, ctrl_name, trans);
>  	tmp = omap_readw(OTG_SYSCON_1);
> @@ -2400,14 +2363,12 @@ static int proc_udc_show(struct seq_file *s, void *_)
>  		HMC,
>  		udc->transceiver
>  			? udc->transceiver->label
> -			: ((cpu_is_omap1710() || cpu_is_omap24xx())
> +			: (cpu_is_omap1710() 
>  				? "external" : "(none)"));
> -	if (cpu_class_is_omap1()) {
> -		seq_printf(s, "ULPD control %04x req %04x status %04x\n",
> -			omap_readw(ULPD_CLOCK_CTRL),
> -			omap_readw(ULPD_SOFT_REQ),
> -			omap_readw(ULPD_STATUS_REQ));
> -	}
> +	seq_printf(s, "ULPD control %04x req %04x status %04x\n",
> +		omap_readw(ULPD_CLOCK_CTRL),
> +		omap_readw(ULPD_SOFT_REQ),
> +		omap_readw(ULPD_STATUS_REQ));
>  
>  	/* OTG controller registers */
>  	if (!cpu_is_omap15xx())
> @@ -2592,7 +2553,7 @@ omap_ep_setup(char *name, u8 addr, u8 type,
>  		 * and ignored for PIO-IN on newer chips
>  		 * (for more reliable behavior)
>  		 */
> -		if (!use_dma || cpu_is_omap15xx() || cpu_is_omap24xx())
> +		if (!use_dma || cpu_is_omap15xx())
>  			dbuf = 0;
>  
>  		switch (maxp) {
> @@ -2796,8 +2757,8 @@ static int __init omap_udc_probe(struct platform_device *pdev)
>  	struct usb_phy		*xceiv = NULL;
>  	const char		*type = NULL;
>  	struct omap_usb_config	*config = pdev->dev.platform_data;
> -	struct clk		*dc_clk;
> -	struct clk		*hhc_clk;
> +	struct clk		*dc_clk = NULL;
> +	struct clk		*hhc_clk = NULL;
>  
>  	/* NOTE:  "knows" the order of the resources! */
>  	if (!request_mem_region(pdev->resource[0].start,
> @@ -2817,16 +2778,6 @@ static int __init omap_udc_probe(struct platform_device *pdev)
>  		udelay(100);
>  	}
>  
> -	if (cpu_is_omap24xx()) {
> -		dc_clk = clk_get(&pdev->dev, "usb_fck");
> -		hhc_clk = clk_get(&pdev->dev, "usb_l4_ick");
> -		BUG_ON(IS_ERR(dc_clk) || IS_ERR(hhc_clk));
> -		/* can't use omap_udc_enable_clock yet */
> -		clk_enable(dc_clk);
> -		clk_enable(hhc_clk);
> -		udelay(100);
> -	}
> -
>  	if (cpu_is_omap7xx()) {
>  		dc_clk = clk_get(&pdev->dev, "usb_dc_ck");
>  		hhc_clk = clk_get(&pdev->dev, "l3_ocpi_ck");
> @@ -2876,14 +2827,6 @@ static int __init omap_udc_probe(struct platform_device *pdev)
>  
>  		hmc = HMC_1610;
>  
> -		if (cpu_is_omap24xx()) {
> -			/* this could be transceiverless in one of the
> -			 * "we don't need to know" modes.
> -			 */
> -			type = "external";
> -			goto known;
> -		}
> -
>  		switch (hmc) {
>  		case 0:			/* POWERUP DEFAULT == 0 */
>  		case 4:
> @@ -2922,7 +2865,7 @@ bad_on_1710:
>  			goto cleanup0;
>  		}
>  	}
> -known:
> +
>  	INFO("hmc mode %d, %s transceiver\n", hmc, type);
>  
>  	/* a "gadget" abstracts/virtualizes the controller */
> @@ -2976,16 +2919,6 @@ known:
>  		clk_disable(dc_clk);
>  	}
>  
> -	if (cpu_is_omap24xx()) {
> -		udc->dc_clk = dc_clk;
> -		udc->hhc_clk = hhc_clk;
> -		/* FIXME OMAP2 don't release hhc & dc clock */
> -#if 0
> -		clk_disable(hhc_clk);
> -		clk_disable(dc_clk);
> -#endif
> -	}
> -
>  	create_proc_file();
>  	status = device_add(&udc->gadget.dev);
>  	if (status)
> @@ -3014,7 +2947,7 @@ cleanup0:
>  	if (xceiv)
>  		usb_put_transceiver(xceiv);
>  
> -	if (cpu_is_omap16xx() || cpu_is_omap24xx() || cpu_is_omap7xx()) {
> +	if (cpu_is_omap16xx() || cpu_is_omap7xx()) {
>  		clk_disable(hhc_clk);
>  		clk_disable(dc_clk);
>  		clk_put(hhc_clk);
> 

-- 
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120522/ceb8fbc2/attachment.sig>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 4/4] USB: Remove omap2 support from omap_udc.c
  2012-05-22  7:09   ` Felipe Balbi
@ 2012-05-22 16:06     ` Tony Lindgren
  0 siblings, 0 replies; 13+ messages in thread
From: Tony Lindgren @ 2012-05-22 16:06 UTC (permalink / raw)
  To: linux-arm-kernel

* Felipe Balbi <balbi@ti.com> [120522 00:15]:
> On Mon, May 21, 2012 at 12:01:11PM -0700, Tony Lindgren wrote:
> > There are no active users of this code for omap2 as
> > the boards in use have either TUSB or MUSB controller.
> > 
> > While at it, also fix warnings related to uninitialized
> > dc_clk and hhc_clk.
> > 
> > Cc: linux-usb at vger.kernel.org
> > Cc: Felipe Balbi <balbi@ti.com>
> > Cc: Kyungmin Park <kyungmin.park@samsung.com>
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
> 
> This one doesn't depend on the rest of the series, I can take it myself
> to v3.6 or you can take it with your series:

Yes you can take this one.

Thanks,

Tony

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 3/4] ARM: OMAP: Make FS USB omap1 only
  2012-05-22  7:08   ` Felipe Balbi
@ 2012-05-22 16:07     ` Tony Lindgren
  0 siblings, 0 replies; 13+ messages in thread
From: Tony Lindgren @ 2012-05-22 16:07 UTC (permalink / raw)
  To: linux-arm-kernel

* Felipe Balbi <balbi@ti.com> [120522 00:14]:
> On Mon, May 21, 2012 at 12:01:09PM -0700, Tony Lindgren wrote:
> > As the FS USB code is not being actively used for omap2+
> > there's no point keeping it around for omap2+.
> > 
> > Let's make the FS USB platform init code omap1 only so
> > we can remove the last user of omap_read/write for omap2+,
> > and simplify things for further USB, DMA, and device tree
> > related work.
> > 
> > While at it, also group the mach includes for the related
> > drivers.
> > 
> > Cc: linux-usb at vger.kernel.org
> > Cc: Felipe Balbi <balbi@ti.com>
> > Cc: Kyungmin Park <kyungmin.park@samsung.com>
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
> 
> Acked-by: Felipe Balbi <balbi@ti.com>
> 
> Are you planning to send this on v3.5 or v3.6 ? I guess it's too late
> for v3.5 ?!?

First one I can merge as a fix, patches 2 and 3 for v3.6, then
patch 4 up to you, I suggest v3.6.

Regards,

Tony

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 0/4] omap legacy full speed usb cleanup for v3.6
  2012-05-21 19:00 [PATCH 0/4] omap legacy full speed usb cleanup for v3.6 Tony Lindgren
                   ` (3 preceding siblings ...)
  2012-05-21 19:01 ` [PATCH 4/4] USB: Remove omap2 support from omap_udc.c Tony Lindgren
@ 2012-05-24 20:02 ` Paul Walmsley
  2012-05-25  7:22   ` Tony Lindgren
  4 siblings, 1 reply; 13+ messages in thread
From: Paul Walmsley @ 2012-05-24 20:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 21 May 2012, Tony Lindgren wrote:

> This series removes the old legacy fulls speed support for
> omap2 as it's pretty much only used for omap1 only.
> 
> For omap2, only n8x0 seems to have active development, and
> that has the external high speed tusb chip instead.

Just FYI, full speed host USB exists on OMAP4.  It's in section 23.13 of 
the TRM and we have a hwmod for it.  No idea if anyone is actually using 
it.


- Paul

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 0/4] omap legacy full speed usb cleanup for v3.6
  2012-05-24 20:02 ` [PATCH 0/4] omap legacy full speed usb cleanup for v3.6 Paul Walmsley
@ 2012-05-25  7:22   ` Tony Lindgren
  0 siblings, 0 replies; 13+ messages in thread
From: Tony Lindgren @ 2012-05-25  7:22 UTC (permalink / raw)
  To: linux-arm-kernel

* Paul Walmsley <paul@pwsan.com> [120524 23:05]:
> On Mon, 21 May 2012, Tony Lindgren wrote:
> 
> > This series removes the old legacy fulls speed support for
> > omap2 as it's pretty much only used for omap1 only.
> > 
> > For omap2, only n8x0 seems to have active development, and
> > that has the external high speed tusb chip instead.
> 
> Just FYI, full speed host USB exists on OMAP4.  It's in section 23.13 of 
> the TRM and we have a hwmod for it.  No idea if anyone is actually using 
> it.

Interesting, so it's back on omap4 for some legacy compability reasons
i guess. It's not mentioned for omap3 at all, but maybe it's lurking
around there somewhere too.

Looking at the omap4 TRM, looks like there are two instances of OHCI:
The HS OHCI/EHCI controller, and the legacy FS OHCI only controller.
The legacy one is using separate transceiver pins (usbc1_*) from the
HS OHCI/EHCI controller pins (usbb[12]_*).

As the OHCI registers are standard, I'd assume it would be possible
to make the FS USB instance to work with the mach-omap2/usb-host.c
and drivers/usb/host/ohci-omap3.c driver. So it should still be OK
to remove the code in this series.

I doubt that anybody would want to use the legacy FS OHCI controller
instead of the HS OHCI/EHCI controller though.. If somebody
is actually using the legacy controller at usbc1_* pins, please
respond. 

Regards,

Tony

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-05-25  7:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-21 19:00 [PATCH 0/4] omap legacy full speed usb cleanup for v3.6 Tony Lindgren
2012-05-21 19:01 ` [PATCH 1/4] ARM: OMAP3: There is no FS USB controller on omap3 Tony Lindgren
2012-05-22  7:06   ` Felipe Balbi
2012-05-21 19:01 ` [PATCH 2/4] ARM: OMAP2: Remove legacy USB FS support Tony Lindgren
2012-05-22  7:07   ` Felipe Balbi
2012-05-21 19:01 ` [PATCH 3/4] ARM: OMAP: Make FS USB omap1 only Tony Lindgren
2012-05-22  7:08   ` Felipe Balbi
2012-05-22 16:07     ` Tony Lindgren
2012-05-21 19:01 ` [PATCH 4/4] USB: Remove omap2 support from omap_udc.c Tony Lindgren
2012-05-22  7:09   ` Felipe Balbi
2012-05-22 16:06     ` Tony Lindgren
2012-05-24 20:02 ` [PATCH 0/4] omap legacy full speed usb cleanup for v3.6 Paul Walmsley
2012-05-25  7:22   ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).