Skip to contentSkip to conversation

omap2 fullspeed usb 1/2

PATCH In review David Brownell 3 participants 4 messages Oct 20, 2006 – Oct 25, 2006

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 omap2 fullspeed usb 1/2

[PATCH] Initial USB support on OMAP2

Initial full speed USB support on OMAP2 platform.
Remaining issues include:

- only usb0 port tested (not usb1, usb2)
- only peripheral/gadget controller tested (not ohci, otg)
- UDC DMA is not working
- clocks are not turned off

Board support is in separate patches.

Also minor omap_udc updates: whitespace fixes, syncing with a few changes from upstream, warning removal.

-------
NOTE: this is just a cleaned up version of the code from Kyungmin, I don't have it behaving yet on H4, and didn't re-test on e.g. OSK.

include/asm-arm/arch-omap/irqs.h +6 -0
Index: h4/include/asm-arm/arch-omap/irqs.h
===================================================================
@@ -269,6 +269,12 @@
 #define INT_24XX_UART1_IRQ	72
 #define INT_24XX_UART2_IRQ	73
 #define INT_24XX_UART3_IRQ	74
+#define INT_24XX_USB_IRQ_GEN	75
+#define INT_24XX_USB_IRQ_NISO	76
+#define INT_24XX_USB_IRQ_ISO	77
+#define INT_24XX_USB_IRQ_HGEN	78
+#define INT_24XX_USB_IRQ_HSOF	79
+#define INT_24XX_USB_IRQ_OTG	80
 #define INT_24XX_MMC_IRQ	83
 
 /* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730) and
include/asm-arm/arch-omap/usb.h +35 -5
Index: h4/include/asm-arm/arch-omap/usb.h
===================================================================
@@ -7,9 +7,27 @@
 
 /*-------------------------------------------------------------------------*/
 
-#define OTG_BASE			0xfffb0400
-#define UDC_BASE			0xfffb4000
-#define OMAP_OHCI_BASE			0xfffba000
+#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
+
+#endif
 
 /*-------------------------------------------------------------------------*/
 
@@ -28,6 +46,7 @@
 #	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_REG		OTG_REG32(0x08)
 #	define	 OTG_EN			(1 << 31)
 #	define	 USBX_SYNCHRO		(1 << 30)
@@ -103,6 +122,7 @@
 
 /*-------------------------------------------------------------------------*/
 
+/* OMAP1 */
 #define	USB_TRANSCEIVER_CTRL_REG	__REG32(0xfffe1000 + 0x0064)
 #	define	CONF_USB2_UNI_R		(1 << 8)
 #	define	CONF_USB1_UNI_R		(1 << 7)
@@ -111,7 +131,17 @@
 #	define	CONF_USB_PWRDN_DM_R	(1 << 2)
 #	define	CONF_USB_PWRDN_DP_R	(1 << 1)
 
-
-
+/* OMAP2 */
+#define	CONTROL_DEVCONF_REG		__REG32(L4_24XX_BASE + 0x0274)
+#	define	USB_UNIDIR			0x0
+#	define	USB_UNIDIR_TLL			0x1
+#	define	USB_BIDIR			0x2
+#	define	USB_BIDIR_TLL			0x3
+#	define	USBT0WRMODEI(x)		((x) << 22)
+#	define	USBT1WRMODEI(x)		((x) << 20)
+#	define	USBT2WRMODEI(x)		((x) << 18)
+#	define	USBT2TLL5PI		(1 << 17)
+#	define	USB0PUENACTLOI		(1 << 16)
+#	define	USBSTANDBYCTRL		(1 << 15)
 
 #endif	/* __ASM_ARCH_OMAP_USB_H */
arch/arm/mach-omap2/Kconfig +1 -0
Index: h4/arch/arm/mach-omap2/Kconfig
===================================================================
@@ -9,6 +9,7 @@ config ARCH_OMAP2420
 	bool "OMAP2420 support"
 	depends on ARCH_OMAP24XX
 	select OMAP_DM_TIMER
+	select ARCH_OMAP_OTG
 
 comment "OMAP Board Type"
 	depends on ARCH_OMAP2
arch/arm/plat-omap/usb.c +161 -42

360 lines not on this page · raw message

drivers/usb/gadget/omap_udc.c +105 -48

348 lines not on this page · raw message

#1 lore raw
Quoted 15 lines

[PATCH] Initial USB support on OMAP2

Initial full speed USB support on OMAP2 platform. Remaining issues include:

- only usb0 port tested (not usb1, usb2)
- only peripheral/gadget controller tested (not ohci, otg)
- UDC DMA is not working
- clocks are not turned off

Board support is in separate patches.

Also minor omap_udc updates: whitespace fixes, syncing with a few changes from upstream, warning removal.

Quoted 6 lines

-------
NOTE: this is just a cleaned up version of the code from Kyungmin, I don't have it behaving yet on H4, and didn't re-test on e.g. OSK.

There's missing patch. We have to modify following line.

--

drivers/usb/gadget/Kconfig +1 -1
index 08c962a..4734e78 100644
@@ -167,7 +167,7 @@ config USB_GADGET_MUSB_HDRC
 
 config USB_GADGET_OMAP
 	boolean "OMAP USB Device Controller"
-	depends on ARCH_OMAP1
+	depends on ARCH_OMAP
 	select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3
 	help
 	   Many Texas Instruments OMAP processors have flexible full
#2 lore raw
Quoted 6 lines · Kyungmin Park
Quoted 4 lines

-------
NOTE: this is just a cleaned up version of the code from Kyungmin, I don't have it behaving yet on H4, and didn't re-test on e.g. OSK.

There's missing patch. We have to modify following line.

Good catch. It got tangled up in the H4 support patch, which I
didn't send, since that also needs "select ISP1301_OMAP" when the OTG port is defined.

Tony, feel free to merge this patch too. :)

Quoted 16 lines

--

drivers/usb/gadget/Kconfig +1 -1
index 08c962a..4734e78 100644
@@ -167,7 +167,7 @@ config USB_GADGET_MUSB_HDRC
 
 config USB_GADGET_OMAP
 	boolean "OMAP USB Device Controller"
-	depends on ARCH_OMAP1
+	depends on ARCH_OMAP
 	select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3
 	help
 	   Many Texas Instruments OMAP processors have flexible full
maintainer
#3 lore raw
Quoted 7 lines · David Brownell
Quoted 5 lines · Kyungmin Park
Quoted 4 lines

-------
NOTE: this is just a cleaned up version of the code from Kyungmin, I don't have it behaving yet on H4, and didn't re-test on e.g. OSK.

Quoted 7 lines
Quoted 1 line

There's missing patch. We have to modify following line.

Good catch. It got tangled up in the H4 support patch, which I
didn't send, since that also needs "select ISP1301_OMAP" when the OTG port is defined.

Tony, feel free to merge this patch too. :)

OK, pushed Kyuingmin's patch you cleaned up + Kyungmin's fix as one patch.

Regards,

Tony