diff options
author | Felipe Balbi <balbi@ti.com> | 2010-12-01 07:23:48 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2010-12-10 03:21:09 -0500 |
commit | 7c925546427a0428b84bc5ba1f28b3698e492072 (patch) | |
tree | 753685c16953aef4d8cdc148c7c2d1f9bd189fb0 | |
parent | 7421107b293cace2fc081731306d447ecd8517ab (diff) |
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: Felipe Balbi <balbi@ti.com>
-rw-r--r-- | arch/arm/mach-omap2/board-n8x0.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-omap2/usb-musb.c | 2 | ||||
-rw-r--r-- | drivers/usb/musb/Kconfig | 70 | ||||
-rw-r--r-- | drivers/usb/musb/Makefile | 21 | ||||
-rw-r--r-- | drivers/usb/musb/musb_core.c | 9 | ||||
-rw-r--r-- | drivers/usb/musb/musb_core.h | 8 | ||||
-rw-r--r-- | drivers/usb/musb/musb_io.h | 4 | ||||
-rw-r--r-- | drivers/usb/musb/musb_regs.h | 4 |
8 files changed, 49 insertions, 74 deletions
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c index e823c7042ab3..62e3ea007c76 100644 --- a/arch/arm/mach-omap2/board-n8x0.c +++ b/arch/arm/mach-omap2/board-n8x0.c | |||
@@ -46,8 +46,7 @@ static struct device *mmc_device; | |||
46 | #define TUSB6010_GPIO_ENABLE 0 | 46 | #define TUSB6010_GPIO_ENABLE 0 |
47 | #define TUSB6010_DMACHAN 0x3f | 47 | #define TUSB6010_DMACHAN 0x3f |
48 | 48 | ||
49 | #if defined(CONFIG_USB_TUSB6010) || \ | 49 | #ifdef CONFIG_USB_MUSB_TUSB6010 |
50 | defined(CONFIG_USB_TUSB6010_MODULE) | ||
51 | /* | 50 | /* |
52 | * Enable or disable power to TUSB6010. When enabling, turn on 3.3 V and | 51 | * Enable or disable power to TUSB6010. When enabling, turn on 3.3 V and |
53 | * 1.5 V voltage regulators of PM companion chip. Companion chip will then | 52 | * 1.5 V voltage regulators of PM companion chip. Companion chip will then |
@@ -134,7 +133,7 @@ err: | |||
134 | 133 | ||
135 | static void __init n8x0_usb_init(void) {} | 134 | static void __init n8x0_usb_init(void) {} |
136 | 135 | ||
137 | #endif /*CONFIG_USB_TUSB6010 */ | 136 | #endif /*CONFIG_USB_MUSB_TUSB6010 */ |
138 | 137 | ||
139 | 138 | ||
140 | static struct omap2_mcspi_device_config p54spi_mcspi_config = { | 139 | static struct omap2_mcspi_device_config p54spi_mcspi_config = { |
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c index 8dae0fa5905e..ed0e85c3764f 100644 --- a/arch/arm/mach-omap2/usb-musb.c +++ b/arch/arm/mach-omap2/usb-musb.c | |||
@@ -31,7 +31,7 @@ | |||
31 | #include <mach/am35xx.h> | 31 | #include <mach/am35xx.h> |
32 | #include <plat/usb.h> | 32 | #include <plat/usb.h> |
33 | 33 | ||
34 | #ifdef CONFIG_USB_MUSB_SOC | 34 | #if defined(CONFIG_USB_MUSB_OMAP2PLUS) || defined (CONFIG_USB_MUSB_AM35X) |
35 | 35 | ||
36 | static struct resource musb_resources[] = { | 36 | static struct resource musb_resources[] = { |
37 | [0] = { /* start and end set dynamically */ | 37 | [0] = { /* start and end set dynamically */ |
diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig index 341a37a469bd..7119d900a479 100644 --- a/drivers/usb/musb/Kconfig +++ b/drivers/usb/musb/Kconfig | |||
@@ -32,55 +32,35 @@ config USB_MUSB_HDRC | |||
32 | To compile this driver as a module, choose M here; the | 32 | To compile this driver as a module, choose M here; the |
33 | module will be called "musb_hdrc". | 33 | module will be called "musb_hdrc". |
34 | 34 | ||
35 | config USB_MUSB_SOC | 35 | choice |
36 | boolean | 36 | prompt "Platform Glue Layer" |
37 | depends on USB_MUSB_HDRC | 37 | depends on USB_MUSB_HDRC |
38 | default y if ARCH_DAVINCI | ||
39 | default y if ARCH_OMAP2430 | ||
40 | default y if ARCH_OMAP3 | ||
41 | default y if ARCH_OMAP4 | ||
42 | default y if (BF54x && !BF544) | ||
43 | default y if (BF52x && !BF522 && !BF523) | ||
44 | 38 | ||
45 | comment "DaVinci 35x and 644x USB support" | 39 | config USB_MUSB_DAVINCI |
46 | depends on USB_MUSB_HDRC && ARCH_DAVINCI_DMx | 40 | bool "DaVinci" |
41 | depends on ARCH_DAVINCI_DMx | ||
47 | 42 | ||
48 | comment "DA8xx/OMAP-L1x USB support" | 43 | config USB_MUSB_DA8XX |
49 | depends on USB_MUSB_HDRC && ARCH_DAVINCI_DA8XX | 44 | bool "DA8xx/OMAP-L1x" |
45 | depends on ARCH_DAVINCI_DA8XX | ||
50 | 46 | ||
51 | comment "OMAP 243x high speed USB support" | 47 | config USB_MUSB_TUSB6010 |
52 | depends on USB_MUSB_HDRC && ARCH_OMAP2430 | 48 | bool "TUSB6010" |
49 | depends on ARCH_OMAP | ||
53 | 50 | ||
54 | comment "OMAP 343x high speed USB support" | 51 | config USB_MUSB_OMAP2PLUS |
55 | depends on USB_MUSB_HDRC && ARCH_OMAP3 | 52 | bool "OMAP2430 and onwards" |
53 | depends on ARCH_OMAP2PLUS | ||
56 | 54 | ||
57 | comment "OMAP 44xx high speed USB support" | 55 | config USB_MUSB_AM35X |
58 | depends on USB_MUSB_HDRC && ARCH_OMAP4 | 56 | bool "AM35x" |
57 | depends on ARCH_OMAP | ||
59 | 58 | ||
60 | comment "Blackfin high speed USB Support" | 59 | config USB_MUSB_BLACKFIN |
61 | depends on USB_MUSB_HDRC && ((BF54x && !BF544) || (BF52x && !BF522 && !BF523)) | 60 | bool "Blackfin" |
61 | depends on (BF54x && !BF544) || (BF52x && ! BF522 && !BF523) | ||
62 | 62 | ||
63 | config USB_MUSB_AM35X | 63 | endchoice |
64 | bool | ||
65 | depends on USB_MUSB_HDRC && !ARCH_OMAP2430 && !ARCH_OMAP4 | ||
66 | select NOP_USB_XCEIV | ||
67 | default MACH_OMAP3517EVM | ||
68 | help | ||
69 | Select this option if your platform is based on AM35x. As | ||
70 | AM35x has an updated MUSB with CPPI4.1 DMA so this config | ||
71 | is introduced to differentiate musb ip between OMAP3x and | ||
72 | AM35x platforms. | ||
73 | |||
74 | config USB_TUSB6010 | ||
75 | boolean "TUSB 6010 support" | ||
76 | depends on USB_MUSB_HDRC && !USB_MUSB_SOC | ||
77 | select NOP_USB_XCEIV | ||
78 | default y | ||
79 | help | ||
80 | The TUSB 6010 chip, from Texas Instruments, connects a discrete | ||
81 | HDRC core using a 16-bit parallel bus (NOR flash style) or VLYNQ | ||
82 | (a high speed serial link). It can use system-specific external | ||
83 | DMA controllers. | ||
84 | 64 | ||
85 | choice | 65 | choice |
86 | prompt "Driver Mode" | 66 | prompt "Driver Mode" |
@@ -158,7 +138,7 @@ config USB_MUSB_HDRC_HCD | |||
158 | config MUSB_PIO_ONLY | 138 | config MUSB_PIO_ONLY |
159 | bool 'Disable DMA (always use PIO)' | 139 | bool 'Disable DMA (always use PIO)' |
160 | depends on USB_MUSB_HDRC | 140 | depends on USB_MUSB_HDRC |
161 | default USB_TUSB6010 || ARCH_DAVINCI_DA8XX || USB_MUSB_AM35X | 141 | default USB_MUSB_TUSB6010 || USB_MUSB_DA8XX || USB_MUSB_AM35X |
162 | help | 142 | help |
163 | All data is copied between memory and FIFO by the CPU. | 143 | All data is copied between memory and FIFO by the CPU. |
164 | DMA controllers are ignored. | 144 | DMA controllers are ignored. |
@@ -171,21 +151,21 @@ config MUSB_PIO_ONLY | |||
171 | config USB_INVENTRA_DMA | 151 | config USB_INVENTRA_DMA |
172 | bool | 152 | bool |
173 | depends on USB_MUSB_HDRC && !MUSB_PIO_ONLY | 153 | depends on USB_MUSB_HDRC && !MUSB_PIO_ONLY |
174 | default ARCH_OMAP2430 || ARCH_OMAP3 || BLACKFIN || ARCH_OMAP4 | 154 | default USB_MUSB_OMAP2PLUS || USB_MUSB_BLACKFIN |
175 | help | 155 | help |
176 | Enable DMA transfers using Mentor's engine. | 156 | Enable DMA transfers using Mentor's engine. |
177 | 157 | ||
178 | config USB_TI_CPPI_DMA | 158 | config USB_TI_CPPI_DMA |
179 | bool | 159 | bool |
180 | depends on USB_MUSB_HDRC && !MUSB_PIO_ONLY | 160 | depends on USB_MUSB_HDRC && !MUSB_PIO_ONLY |
181 | default ARCH_DAVINCI | 161 | default USB_MUSB_DAVINCI |
182 | help | 162 | help |
183 | Enable DMA transfers when TI CPPI DMA is available. | 163 | Enable DMA transfers when TI CPPI DMA is available. |
184 | 164 | ||
185 | config USB_TUSB_OMAP_DMA | 165 | config USB_TUSB_OMAP_DMA |
186 | bool | 166 | bool |
187 | depends on USB_MUSB_HDRC && !MUSB_PIO_ONLY | 167 | depends on USB_MUSB_HDRC && !MUSB_PIO_ONLY |
188 | depends on USB_TUSB6010 | 168 | depends on USB_MUSB_TUSB6010 |
189 | depends on ARCH_OMAP | 169 | depends on ARCH_OMAP |
190 | default y | 170 | default y |
191 | help | 171 | help |
diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile index ce164e8998d8..52d18dbefcfa 100644 --- a/drivers/usb/musb/Makefile +++ b/drivers/usb/musb/Makefile | |||
@@ -8,22 +8,19 @@ obj-$(CONFIG_USB_MUSB_HDRC) += musb_hdrc.o | |||
8 | 8 | ||
9 | musb_hdrc-y := musb_core.o | 9 | musb_hdrc-y := musb_core.o |
10 | 10 | ||
11 | musb_hdrc-$(CONFIG_ARCH_DAVINCI_DMx) += davinci.o | ||
12 | musb_hdrc-$(CONFIG_ARCH_DAVINCI_DA8XX) += da8xx.o | ||
13 | musb_hdrc-$(CONFIG_USB_TUSB6010) += tusb6010.o | ||
14 | musb_hdrc-$(CONFIG_ARCH_OMAP2430) += omap2430.o | ||
15 | ifeq ($(CONFIG_USB_MUSB_AM35X),y) | ||
16 | musb_hdrc-$(CONFIG_ARCH_OMAP3430) += am35x.o | ||
17 | else | ||
18 | musb_hdrc-$(CONFIG_ARCH_OMAP3430) += omap2430.o | ||
19 | endif | ||
20 | musb_hdrc-$(CONFIG_ARCH_OMAP4) += omap2430.o | ||
21 | musb_hdrc-$(CONFIG_BF54x) += blackfin.o | ||
22 | musb_hdrc-$(CONFIG_BF52x) += blackfin.o | ||
23 | musb_hdrc-$(CONFIG_USB_GADGET_MUSB_HDRC) += musb_gadget_ep0.o musb_gadget.o | 11 | musb_hdrc-$(CONFIG_USB_GADGET_MUSB_HDRC) += musb_gadget_ep0.o musb_gadget.o |
24 | musb_hdrc-$(CONFIG_USB_MUSB_HDRC_HCD) += musb_virthub.o musb_host.o | 12 | musb_hdrc-$(CONFIG_USB_MUSB_HDRC_HCD) += musb_virthub.o musb_host.o |
25 | musb_hdrc-$(CONFIG_DEBUG_FS) += musb_debugfs.o | 13 | musb_hdrc-$(CONFIG_DEBUG_FS) += musb_debugfs.o |
26 | 14 | ||
15 | # Hardware Glue Layer | ||
16 | |||
17 | musb_hdrc-$(CONFIG_USB_MUSB_DAVINCI) += davinci.o | ||
18 | musb_hdrc-$(CONFIG_USB_MUSB_DA8XX) += da8xx.o | ||
19 | musb_hdrc-$(CONFIG_USB_MUSB_TUSB6010) += tusb6010.o | ||
20 | musb_hdrc-$(CONFIG_USB_MUSB_OMAP2PLUS) += omap2430.o | ||
21 | musb_hdrc-$(CONFIG_USB_MUSB_AM35X) += am35x.o | ||
22 | musb_hdrc-$(CONFIG_USB_MUSB_BLACKFIN) += blackfin.o | ||
23 | |||
27 | # the kconfig must guarantee that only one of the | 24 | # the kconfig must guarantee that only one of the |
28 | # possible I/O schemes will be enabled at a time ... | 25 | # possible I/O schemes will be enabled at a time ... |
29 | # PIO only, or DMA (several potential schemes). | 26 | # PIO only, or DMA (several potential schemes). |
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 5abcfe6ab2ee..8df1c583f19d 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
@@ -230,7 +230,7 @@ static struct otg_io_access_ops musb_ulpi_access = { | |||
230 | 230 | ||
231 | /*-------------------------------------------------------------------------*/ | 231 | /*-------------------------------------------------------------------------*/ |
232 | 232 | ||
233 | #if !defined(CONFIG_USB_TUSB6010) && !defined(CONFIG_BLACKFIN) | 233 | #if !defined(CONFIG_USB_MUSB_TUSB6010) && !defined(CONFIG_USB_MUSB_BLACKFIN) |
234 | 234 | ||
235 | /* | 235 | /* |
236 | * Load an endpoint's FIFO | 236 | * Load an endpoint's FIFO |
@@ -1068,9 +1068,8 @@ static void musb_shutdown(struct platform_device *pdev) | |||
1068 | * We don't currently use dynamic fifo setup capability to do anything | 1068 | * We don't currently use dynamic fifo setup capability to do anything |
1069 | * more than selecting one of a bunch of predefined configurations. | 1069 | * more than selecting one of a bunch of predefined configurations. |
1070 | */ | 1070 | */ |
1071 | #if defined(CONFIG_USB_TUSB6010) || \ | 1071 | #if defined(CONFIG_USB_MUSB_TUSB6010) || defined(CONFIG_USB_MUSB_OMAP2PLUS) \ |
1072 | defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) \ | 1072 | || defined(CONFIG_USB_MUSB_AM35X) |
1073 | || defined(CONFIG_ARCH_OMAP4) | ||
1074 | static ushort __initdata fifo_mode = 4; | 1073 | static ushort __initdata fifo_mode = 4; |
1075 | #else | 1074 | #else |
1076 | static ushort __initdata fifo_mode = 2; | 1075 | static ushort __initdata fifo_mode = 2; |
@@ -1495,7 +1494,7 @@ static int __init musb_core_init(u16 musb_type, struct musb *musb) | |||
1495 | struct musb_hw_ep *hw_ep = musb->endpoints + i; | 1494 | struct musb_hw_ep *hw_ep = musb->endpoints + i; |
1496 | 1495 | ||
1497 | hw_ep->fifo = MUSB_FIFO_OFFSET(i) + mbase; | 1496 | hw_ep->fifo = MUSB_FIFO_OFFSET(i) + mbase; |
1498 | #ifdef CONFIG_USB_TUSB6010 | 1497 | #ifdef CONFIG_USB_MUSB_TUSB6010 |
1499 | hw_ep->fifo_async = musb->async + 0x400 + MUSB_FIFO_OFFSET(i); | 1498 | hw_ep->fifo_async = musb->async + 0x400 + MUSB_FIFO_OFFSET(i); |
1500 | hw_ep->fifo_sync = musb->sync + 0x400 + MUSB_FIFO_OFFSET(i); | 1499 | hw_ep->fifo_sync = musb->sync + 0x400 + MUSB_FIFO_OFFSET(i); |
1501 | hw_ep->fifo_sync_va = | 1500 | hw_ep->fifo_sync_va = |
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index cb393e4a3722..9594b9d1d27b 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h | |||
@@ -222,7 +222,7 @@ enum musb_g_ep0_state { | |||
222 | #endif | 222 | #endif |
223 | 223 | ||
224 | /* TUSB mapping: "flat" plus ep0 special cases */ | 224 | /* TUSB mapping: "flat" plus ep0 special cases */ |
225 | #if defined(CONFIG_USB_TUSB6010) | 225 | #if defined(CONFIG_USB_MUSB_TUSB6010) |
226 | #define musb_ep_select(_mbase, _epnum) \ | 226 | #define musb_ep_select(_mbase, _epnum) \ |
227 | musb_writeb((_mbase), MUSB_INDEX, (_epnum)) | 227 | musb_writeb((_mbase), MUSB_INDEX, (_epnum)) |
228 | #define MUSB_EP_OFFSET MUSB_TUSB_OFFSET | 228 | #define MUSB_EP_OFFSET MUSB_TUSB_OFFSET |
@@ -293,7 +293,7 @@ struct musb_hw_ep { | |||
293 | void __iomem *fifo; | 293 | void __iomem *fifo; |
294 | void __iomem *regs; | 294 | void __iomem *regs; |
295 | 295 | ||
296 | #ifdef CONFIG_USB_TUSB6010 | 296 | #ifdef CONFIG_USB_MUSB_TUSB6010 |
297 | void __iomem *conf; | 297 | void __iomem *conf; |
298 | #endif | 298 | #endif |
299 | 299 | ||
@@ -310,7 +310,7 @@ struct musb_hw_ep { | |||
310 | struct dma_channel *tx_channel; | 310 | struct dma_channel *tx_channel; |
311 | struct dma_channel *rx_channel; | 311 | struct dma_channel *rx_channel; |
312 | 312 | ||
313 | #ifdef CONFIG_USB_TUSB6010 | 313 | #ifdef CONFIG_USB_MUSB_TUSB6010 |
314 | /* TUSB has "asynchronous" and "synchronous" dma modes */ | 314 | /* TUSB has "asynchronous" and "synchronous" dma modes */ |
315 | dma_addr_t fifo_async; | 315 | dma_addr_t fifo_async; |
316 | dma_addr_t fifo_sync; | 316 | dma_addr_t fifo_sync; |
@@ -432,7 +432,7 @@ struct musb { | |||
432 | void __iomem *ctrl_base; | 432 | void __iomem *ctrl_base; |
433 | void __iomem *mregs; | 433 | void __iomem *mregs; |
434 | 434 | ||
435 | #ifdef CONFIG_USB_TUSB6010 | 435 | #ifdef CONFIG_USB_MUSB_TUSB6010 |
436 | dma_addr_t async; | 436 | dma_addr_t async; |
437 | dma_addr_t sync; | 437 | dma_addr_t sync; |
438 | void __iomem *sync_va; | 438 | void __iomem *sync_va; |
diff --git a/drivers/usb/musb/musb_io.h b/drivers/usb/musb/musb_io.h index b06e9ef00cfc..03c6ccdbb3be 100644 --- a/drivers/usb/musb/musb_io.h +++ b/drivers/usb/musb/musb_io.h | |||
@@ -74,7 +74,7 @@ static inline void musb_writel(void __iomem *addr, unsigned offset, u32 data) | |||
74 | { __raw_writel(data, addr + offset); } | 74 | { __raw_writel(data, addr + offset); } |
75 | 75 | ||
76 | 76 | ||
77 | #ifdef CONFIG_USB_TUSB6010 | 77 | #ifdef CONFIG_USB_MUSB_TUSB6010 |
78 | 78 | ||
79 | /* | 79 | /* |
80 | * TUSB6010 doesn't allow 8-bit access; 16-bit access is the minimum. | 80 | * 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) | |||
114 | static inline void musb_writeb(void __iomem *addr, unsigned offset, u8 data) | 114 | static inline void musb_writeb(void __iomem *addr, unsigned offset, u8 data) |
115 | { __raw_writeb(data, addr + offset); } | 115 | { __raw_writeb(data, addr + offset); } |
116 | 116 | ||
117 | #endif /* CONFIG_USB_TUSB6010 */ | 117 | #endif /* CONFIG_USB_MUSB_TUSB6010 */ |
118 | 118 | ||
119 | #else | 119 | #else |
120 | 120 | ||
diff --git a/drivers/usb/musb/musb_regs.h b/drivers/usb/musb/musb_regs.h index 244267527a60..9cb5fe044438 100644 --- a/drivers/usb/musb/musb_regs.h +++ b/drivers/usb/musb/musb_regs.h | |||
@@ -234,7 +234,7 @@ | |||
234 | #define MUSB_TESTMODE 0x0F /* 8 bit */ | 234 | #define MUSB_TESTMODE 0x0F /* 8 bit */ |
235 | 235 | ||
236 | /* Get offset for a given FIFO from musb->mregs */ | 236 | /* Get offset for a given FIFO from musb->mregs */ |
237 | #ifdef CONFIG_USB_TUSB6010 | 237 | #ifdef CONFIG_USB_MUSB_TUSB6010 |
238 | #define MUSB_FIFO_OFFSET(epnum) (0x200 + ((epnum) * 0x20)) | 238 | #define MUSB_FIFO_OFFSET(epnum) (0x200 + ((epnum) * 0x20)) |
239 | #else | 239 | #else |
240 | #define MUSB_FIFO_OFFSET(epnum) (0x20 + ((epnum) * 4)) | 240 | #define MUSB_FIFO_OFFSET(epnum) (0x20 + ((epnum) * 4)) |
@@ -295,7 +295,7 @@ | |||
295 | #define MUSB_FLAT_OFFSET(_epnum, _offset) \ | 295 | #define MUSB_FLAT_OFFSET(_epnum, _offset) \ |
296 | (0x100 + (0x10*(_epnum)) + (_offset)) | 296 | (0x100 + (0x10*(_epnum)) + (_offset)) |
297 | 297 | ||
298 | #ifdef CONFIG_USB_TUSB6010 | 298 | #ifdef CONFIG_USB_MUSB_TUSB6010 |
299 | /* TUSB6010 EP0 configuration register is special */ | 299 | /* TUSB6010 EP0 configuration register is special */ |
300 | #define MUSB_TUSB_OFFSET(_epnum, _offset) \ | 300 | #define MUSB_TUSB_OFFSET(_epnum, _offset) \ |
301 | (0x10 + _offset) | 301 | (0x10 + _offset) |