Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7c925546 authored by Felipe Balbi's avatar Felipe Balbi
Browse files

usb: musb: add Kconfig options for each glue layer



This will make things simpler when choosing which
glue layer to compile. It avoids a lot of magic
around the "default" Kconfig option and lets the
user choose what exactly s/he wants to compile.

Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 7421107b
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -46,8 +46,7 @@ static struct device *mmc_device;
#define TUSB6010_GPIO_ENABLE	0
#define TUSB6010_DMACHAN	0x3f

#if defined(CONFIG_USB_TUSB6010) || \
	defined(CONFIG_USB_TUSB6010_MODULE)
#ifdef CONFIG_USB_MUSB_TUSB6010
/*
 * Enable or disable power to TUSB6010. When enabling, turn on 3.3 V and
 * 1.5 V voltage regulators of PM companion chip. Companion chip will then
@@ -134,7 +133,7 @@ static void __init n8x0_usb_init(void)

static void __init n8x0_usb_init(void) {}

#endif /*CONFIG_USB_TUSB6010 */
#endif /*CONFIG_USB_MUSB_TUSB6010 */


static struct omap2_mcspi_device_config p54spi_mcspi_config = {
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@
#include <mach/am35xx.h>
#include <plat/usb.h>

#ifdef CONFIG_USB_MUSB_SOC
#if defined(CONFIG_USB_MUSB_OMAP2PLUS) || defined (CONFIG_USB_MUSB_AM35X)

static struct resource musb_resources[] = {
	[0] = { /* start and end set dynamically */
+25 −45
Original line number Diff line number Diff line
@@ -32,55 +32,35 @@ config USB_MUSB_HDRC
	  To compile this driver as a module, choose M here; the
	  module will be called "musb_hdrc".

config USB_MUSB_SOC
	boolean
choice
	prompt "Platform Glue Layer"
	depends on USB_MUSB_HDRC
	default y if ARCH_DAVINCI
	default y if ARCH_OMAP2430
	default y if ARCH_OMAP3
	default y if ARCH_OMAP4
	default y if (BF54x && !BF544)
	default y if (BF52x && !BF522 && !BF523)

comment "DaVinci 35x and 644x USB support"
	depends on USB_MUSB_HDRC && ARCH_DAVINCI_DMx
config USB_MUSB_DAVINCI
	bool "DaVinci"
	depends on ARCH_DAVINCI_DMx

comment "DA8xx/OMAP-L1x USB support"
	depends on USB_MUSB_HDRC && ARCH_DAVINCI_DA8XX
config USB_MUSB_DA8XX
	bool "DA8xx/OMAP-L1x"
	depends on ARCH_DAVINCI_DA8XX

comment "OMAP 243x high speed USB support"
	depends on USB_MUSB_HDRC && ARCH_OMAP2430
config USB_MUSB_TUSB6010
	bool "TUSB6010"
	depends on ARCH_OMAP

comment "OMAP 343x high speed USB support"
	depends on USB_MUSB_HDRC && ARCH_OMAP3
config USB_MUSB_OMAP2PLUS
	bool "OMAP2430 and onwards"
	depends on ARCH_OMAP2PLUS

comment "OMAP 44xx high speed USB support"
	depends on USB_MUSB_HDRC && ARCH_OMAP4
config USB_MUSB_AM35X
	bool "AM35x"
	depends on ARCH_OMAP

comment "Blackfin high speed USB Support"
	depends on USB_MUSB_HDRC && ((BF54x && !BF544) || (BF52x && !BF522 && !BF523))
config USB_MUSB_BLACKFIN
	bool "Blackfin"
	depends on (BF54x && !BF544) || (BF52x && ! BF522 && !BF523)

config USB_MUSB_AM35X
	bool
	depends on USB_MUSB_HDRC && !ARCH_OMAP2430 && !ARCH_OMAP4
	select NOP_USB_XCEIV
	default MACH_OMAP3517EVM
	help
	  Select this option if your platform is based on AM35x. As
	  AM35x has an updated MUSB with CPPI4.1 DMA so this config
	  is introduced to differentiate musb ip between OMAP3x and
	  AM35x platforms.

config USB_TUSB6010
	boolean "TUSB 6010 support"
	depends on USB_MUSB_HDRC && !USB_MUSB_SOC
	select NOP_USB_XCEIV
	default y
	help
	  The TUSB 6010 chip, from Texas Instruments, connects a discrete
	  HDRC core using a 16-bit parallel bus (NOR flash style) or VLYNQ
	  (a high speed serial link).  It can use system-specific external
	  DMA controllers.
endchoice

choice
	prompt "Driver Mode"
@@ -158,7 +138,7 @@ config USB_MUSB_HDRC_HCD
config MUSB_PIO_ONLY
	bool 'Disable DMA (always use PIO)'
	depends on USB_MUSB_HDRC
	default USB_TUSB6010 || ARCH_DAVINCI_DA8XX || USB_MUSB_AM35X
	default USB_MUSB_TUSB6010 || USB_MUSB_DA8XX || USB_MUSB_AM35X
	help
	  All data is copied between memory and FIFO by the CPU.
	  DMA controllers are ignored.
@@ -171,21 +151,21 @@ config MUSB_PIO_ONLY
config USB_INVENTRA_DMA
	bool
	depends on USB_MUSB_HDRC && !MUSB_PIO_ONLY
	default ARCH_OMAP2430 || ARCH_OMAP3 || BLACKFIN || ARCH_OMAP4
	default USB_MUSB_OMAP2PLUS || USB_MUSB_BLACKFIN
	help
	  Enable DMA transfers using Mentor's engine.

config USB_TI_CPPI_DMA
	bool
	depends on USB_MUSB_HDRC && !MUSB_PIO_ONLY
	default ARCH_DAVINCI
	default USB_MUSB_DAVINCI
	help
	  Enable DMA transfers when TI CPPI DMA is available.

config USB_TUSB_OMAP_DMA
	bool
	depends on USB_MUSB_HDRC && !MUSB_PIO_ONLY
	depends on USB_TUSB6010
	depends on USB_MUSB_TUSB6010
	depends on ARCH_OMAP
	default y
	help
+9 −12
Original line number Diff line number Diff line
@@ -8,22 +8,19 @@ obj-$(CONFIG_USB_MUSB_HDRC) += musb_hdrc.o

musb_hdrc-y := musb_core.o

musb_hdrc-$(CONFIG_ARCH_DAVINCI_DMx)		+= davinci.o
musb_hdrc-$(CONFIG_ARCH_DAVINCI_DA8XX)		+= da8xx.o
musb_hdrc-$(CONFIG_USB_TUSB6010)		+= tusb6010.o
musb_hdrc-$(CONFIG_ARCH_OMAP2430)		+= omap2430.o
ifeq ($(CONFIG_USB_MUSB_AM35X),y)
	musb_hdrc-$(CONFIG_ARCH_OMAP3430)	+= am35x.o
else
	musb_hdrc-$(CONFIG_ARCH_OMAP3430)	+= omap2430.o
endif
musb_hdrc-$(CONFIG_ARCH_OMAP4)			+= omap2430.o
musb_hdrc-$(CONFIG_BF54x)			+= blackfin.o
musb_hdrc-$(CONFIG_BF52x)			+= blackfin.o
musb_hdrc-$(CONFIG_USB_GADGET_MUSB_HDRC)	+= musb_gadget_ep0.o musb_gadget.o
musb_hdrc-$(CONFIG_USB_MUSB_HDRC_HCD)		+= musb_virthub.o musb_host.o
musb_hdrc-$(CONFIG_DEBUG_FS)			+= musb_debugfs.o

# Hardware Glue Layer

musb_hdrc-$(CONFIG_USB_MUSB_DAVINCI)		+= davinci.o
musb_hdrc-$(CONFIG_USB_MUSB_DA8XX)		+= da8xx.o
musb_hdrc-$(CONFIG_USB_MUSB_TUSB6010)		+= tusb6010.o
musb_hdrc-$(CONFIG_USB_MUSB_OMAP2PLUS)		+= omap2430.o
musb_hdrc-$(CONFIG_USB_MUSB_AM35X)		+= am35x.o
musb_hdrc-$(CONFIG_USB_MUSB_BLACKFIN)		+= blackfin.o

# the kconfig must guarantee that only one of the
# possible I/O schemes will be enabled at a time ...
# PIO only, or DMA (several potential schemes).
+4 −5
Original line number Diff line number Diff line
@@ -230,7 +230,7 @@ static struct otg_io_access_ops musb_ulpi_access = {

/*-------------------------------------------------------------------------*/

#if !defined(CONFIG_USB_TUSB6010) && !defined(CONFIG_BLACKFIN)
#if !defined(CONFIG_USB_MUSB_TUSB6010) && !defined(CONFIG_USB_MUSB_BLACKFIN)

/*
 * Load an endpoint's FIFO
@@ -1068,9 +1068,8 @@ static void musb_shutdown(struct platform_device *pdev)
 * We don't currently use dynamic fifo setup capability to do anything
 * more than selecting one of a bunch of predefined configurations.
 */
#if defined(CONFIG_USB_TUSB6010) || \
	defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) \
	|| defined(CONFIG_ARCH_OMAP4)
#if defined(CONFIG_USB_MUSB_TUSB6010) || defined(CONFIG_USB_MUSB_OMAP2PLUS) \
	|| defined(CONFIG_USB_MUSB_AM35X)
static ushort __initdata fifo_mode = 4;
#else
static ushort __initdata fifo_mode = 2;
@@ -1495,7 +1494,7 @@ static int __init musb_core_init(u16 musb_type, struct musb *musb)
		struct musb_hw_ep	*hw_ep = musb->endpoints + i;

		hw_ep->fifo = MUSB_FIFO_OFFSET(i) + mbase;
#ifdef CONFIG_USB_TUSB6010
#ifdef CONFIG_USB_MUSB_TUSB6010
		hw_ep->fifo_async = musb->async + 0x400 + MUSB_FIFO_OFFSET(i);
		hw_ep->fifo_sync = musb->sync + 0x400 + MUSB_FIFO_OFFSET(i);
		hw_ep->fifo_sync_va =
Loading