]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
usb: musb: add Kconfig options for each glue layer
authorFelipe Balbi <balbi@ti.com>
Wed, 1 Dec 2010 12:23:48 +0000 (14:23 +0200)
committerFelipe Balbi <balbi@ti.com>
Fri, 10 Dec 2010 08:21:09 +0000 (10:21 +0200)
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: Felipe Balbi <balbi@ti.com>
arch/arm/mach-omap2/board-n8x0.c
arch/arm/mach-omap2/usb-musb.c
drivers/usb/musb/Kconfig
drivers/usb/musb/Makefile
drivers/usb/musb/musb_core.c
drivers/usb/musb/musb_core.h
drivers/usb/musb/musb_io.h
drivers/usb/musb/musb_regs.h

index e823c7042ab31271145959530454b05dfb7830eb..62e3ea007c76d7e5595c9003e656cb81bfe652d0 100644 (file)
@@ -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 @@ err:
 
 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 = {
index 8dae0fa5905e185976513f29235cc352614b3718..ed0e85c3764f3a5f7cbd9a20a8924e76059219a0 100644 (file)
@@ -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 */
index 341a37a469bdd0314ccc2d5c568175b0dca0216f..7119d900a479bd577e316041ae980e88ba3e0cab 100644 (file)
@@ -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
index ce164e8998d8c6923c103126f98bcfef1f423ad0..52d18dbefcfa81479101db6d62e6f56e10390fad 100644 (file)
@@ -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).
index 5abcfe6ab2ee5e5b6c821c2944e594e58e3db1bc..8df1c583f19d844c9d024aa48fadd9d8a0145a58 100644 (file)
@@ -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 =
index cb393e4a372259a9ab9fed99374a0fa4bedaf83a..9594b9d1d27b78126d91f99644dcb2e7950d619a 100644 (file)
@@ -222,7 +222,7 @@ enum musb_g_ep0_state {
 #endif
 
 /* TUSB mapping: "flat" plus ep0 special cases */
-#if    defined(CONFIG_USB_TUSB6010)
+#if    defined(CONFIG_USB_MUSB_TUSB6010)
 #define musb_ep_select(_mbase, _epnum) \
        musb_writeb((_mbase), MUSB_INDEX, (_epnum))
 #define        MUSB_EP_OFFSET                  MUSB_TUSB_OFFSET
@@ -293,7 +293,7 @@ struct musb_hw_ep {
        void __iomem            *fifo;
        void __iomem            *regs;
 
-#ifdef CONFIG_USB_TUSB6010
+#ifdef CONFIG_USB_MUSB_TUSB6010
        void __iomem            *conf;
 #endif
 
@@ -310,7 +310,7 @@ struct musb_hw_ep {
        struct dma_channel      *tx_channel;
        struct dma_channel      *rx_channel;
 
-#ifdef CONFIG_USB_TUSB6010
+#ifdef CONFIG_USB_MUSB_TUSB6010
        /* TUSB has "asynchronous" and "synchronous" dma modes */
        dma_addr_t              fifo_async;
        dma_addr_t              fifo_sync;
@@ -432,7 +432,7 @@ struct musb {
        void __iomem            *ctrl_base;
        void __iomem            *mregs;
 
-#ifdef CONFIG_USB_TUSB6010
+#ifdef CONFIG_USB_MUSB_TUSB6010
        dma_addr_t              async;
        dma_addr_t              sync;
        void __iomem            *sync_va;
index b06e9ef00cfc1582d3694cfa40c4fbc1a9a6732f..03c6ccdbb3be14470dbe5e87b12d953f0b69b6a9 100644 (file)
@@ -74,7 +74,7 @@ static inline void musb_writel(void __iomem *addr, unsigned offset, u32 data)
        { __raw_writel(data, addr + offset); }
 
 
-#ifdef CONFIG_USB_TUSB6010
+#ifdef CONFIG_USB_MUSB_TUSB6010
 
 /*
  * TUSB6010 doesn't allow 8-bit access; 16-bit access is the minimum.
@@ -114,7 +114,7 @@ static inline u8 musb_readb(const void __iomem *addr, unsigned offset)
 static inline void musb_writeb(void __iomem *addr, unsigned offset, u8 data)
        { __raw_writeb(data, addr + offset); }
 
-#endif /* CONFIG_USB_TUSB6010 */
+#endif /* CONFIG_USB_MUSB_TUSB6010 */
 
 #else
 
index 244267527a60b1421ea7c70a814388dde6951f7f..9cb5fe0444383f4b827a4be6ab1109b5edcfed7a 100644 (file)
 #define MUSB_TESTMODE          0x0F    /* 8 bit */
 
 /* Get offset for a given FIFO from musb->mregs */
-#ifdef CONFIG_USB_TUSB6010
+#ifdef CONFIG_USB_MUSB_TUSB6010
 #define MUSB_FIFO_OFFSET(epnum)        (0x200 + ((epnum) * 0x20))
 #else
 #define MUSB_FIFO_OFFSET(epnum)        (0x20 + ((epnum) * 4))
 #define MUSB_FLAT_OFFSET(_epnum, _offset)      \
        (0x100 + (0x10*(_epnum)) + (_offset))
 
-#ifdef CONFIG_USB_TUSB6010
+#ifdef CONFIG_USB_MUSB_TUSB6010
 /* TUSB6010 EP0 configuration register is special */
 #define MUSB_TUSB_OFFSET(_epnum, _offset)      \
        (0x10 + _offset)