diff options
author | Arnd Bergmann <arnd@arndb.de> | 2011-10-02 10:45:45 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2011-12-12 04:51:41 -0500 |
commit | 2e7fc3ba68e28acbcc9f4ee753be12be84533ba2 (patch) | |
tree | b9071d8c86a3fdf17372a8da82b1706124091ce3 | |
parent | e25bec160158abe86c276d7d206264afc3646281 (diff) |
usb: musb: use a Kconfig choice to pick the right DMA method
The logic to allow only one DMA driver in MUSB is currently
flawed, because it also allows picking no DMA driver at all
and also not selecting PIO mode.
Using a choice statement makes this foolproof for now and
also simplifies the Makefile.
Unfortunately, we will have to revisit this when we start
supporting multiple ARM platforms in a single kernel binary,
because at that point we will actually need to select
multiple DMA drivers and pick the right one at run-time.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r-- | drivers/usb/musb/Kconfig | 57 | ||||
-rw-r--r-- | drivers/usb/musb/Makefile | 26 |
2 files changed, 38 insertions, 45 deletions
diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig index 07a03460a598..b1c8a839799c 100644 --- a/drivers/usb/musb/Kconfig +++ b/drivers/usb/musb/Kconfig | |||
@@ -65,46 +65,57 @@ config USB_MUSB_UX500 | |||
65 | 65 | ||
66 | endchoice | 66 | endchoice |
67 | 67 | ||
68 | config MUSB_PIO_ONLY | 68 | choice |
69 | bool 'Disable DMA (always use PIO)' | 69 | prompt 'MUSB DMA mode' |
70 | depends on USB_MUSB_HDRC | 70 | default USB_UX500_DMA if USB_MUSB_UX500 |
71 | default USB_MUSB_TUSB6010 || USB_MUSB_DA8XX || USB_MUSB_AM35X | 71 | default USB_INVENTRA_DMA if USB_MUSB_OMAP2PLUS || USB_MUSB_BLACKFIN |
72 | default USB_TI_CPPI_DMA if USB_MUSB_DAVINCI | ||
73 | default USB_TUSB_OMAP_DMA if USB_MUSB_TUSB6010 | ||
74 | default MUSB_PIO_ONLY if USB_MUSB_TUSB6010 || USB_MUSB_DA8XX || USB_MUSB_AM35X | ||
72 | help | 75 | help |
73 | All data is copied between memory and FIFO by the CPU. | 76 | Unfortunately, only one option can be enabled here. Ideally one |
74 | DMA controllers are ignored. | 77 | should be able to build all these drivers into one kernel to |
75 | 78 | allow using DMA on multiplatform kernels. | |
76 | Do not select 'n' here unless DMA support for your SOC or board | ||
77 | is unavailable (or unstable). When DMA is enabled at compile time, | ||
78 | you can still disable it at run time using the "use_dma=n" module | ||
79 | parameter. | ||
80 | 79 | ||
81 | config USB_UX500_DMA | 80 | config USB_UX500_DMA |
82 | bool | 81 | bool 'ST Ericsson U8500 and U5500' |
83 | depends on USB_MUSB_HDRC && !MUSB_PIO_ONLY | 82 | depends on USB_MUSB_HDRC |
84 | default USB_MUSB_UX500 | 83 | depends on USB_MUSB_UX500 |
85 | help | 84 | help |
86 | Enable DMA transfers on UX500 platforms. | 85 | Enable DMA transfers on UX500 platforms. |
87 | 86 | ||
88 | config USB_INVENTRA_DMA | 87 | config USB_INVENTRA_DMA |
89 | bool | 88 | bool 'Inventra' |
90 | depends on USB_MUSB_HDRC && !MUSB_PIO_ONLY | 89 | depends on USB_MUSB_HDRC |
91 | default USB_MUSB_OMAP2PLUS || USB_MUSB_BLACKFIN | 90 | depends on USB_MUSB_OMAP2PLUS || USB_MUSB_BLACKFIN |
92 | help | 91 | help |
93 | Enable DMA transfers using Mentor's engine. | 92 | Enable DMA transfers using Mentor's engine. |
94 | 93 | ||
95 | config USB_TI_CPPI_DMA | 94 | config USB_TI_CPPI_DMA |
96 | bool | 95 | bool 'TI CPPI (Davinci)' |
97 | depends on USB_MUSB_HDRC && !MUSB_PIO_ONLY | 96 | depends on USB_MUSB_HDRC |
98 | default USB_MUSB_DAVINCI | 97 | depends on USB_MUSB_DAVINCI |
99 | help | 98 | help |
100 | Enable DMA transfers when TI CPPI DMA is available. | 99 | Enable DMA transfers when TI CPPI DMA is available. |
101 | 100 | ||
102 | config USB_TUSB_OMAP_DMA | 101 | config USB_TUSB_OMAP_DMA |
103 | bool | 102 | bool 'TUSB 6010' |
104 | depends on USB_MUSB_HDRC && !MUSB_PIO_ONLY | 103 | depends on USB_MUSB_HDRC |
105 | depends on USB_MUSB_TUSB6010 | 104 | depends on USB_MUSB_TUSB6010 |
106 | depends on ARCH_OMAP | 105 | depends on ARCH_OMAP |
107 | default y | ||
108 | help | 106 | help |
109 | Enable DMA transfers on TUSB 6010 when OMAP DMA is available. | 107 | Enable DMA transfers on TUSB 6010 when OMAP DMA is available. |
110 | 108 | ||
109 | config MUSB_PIO_ONLY | ||
110 | bool 'Disable DMA (always use PIO)' | ||
111 | depends on USB_MUSB_HDRC | ||
112 | help | ||
113 | All data is copied between memory and FIFO by the CPU. | ||
114 | DMA controllers are ignored. | ||
115 | |||
116 | Do not choose this unless DMA support for your SOC or board | ||
117 | is unavailable (or unstable). When DMA is enabled at compile time, | ||
118 | you can still disable it at run time using the "use_dma=n" module | ||
119 | parameter. | ||
120 | |||
121 | endchoice | ||
diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile index d8fd9d092dec..88bfb9dee4bf 100644 --- a/drivers/usb/musb/Makefile +++ b/drivers/usb/musb/Makefile | |||
@@ -24,25 +24,7 @@ obj-$(CONFIG_USB_MUSB_UX500) += ux500.o | |||
24 | # PIO only, or DMA (several potential schemes). | 24 | # PIO only, or DMA (several potential schemes). |
25 | # though PIO is always there to back up DMA, and for ep0 | 25 | # though PIO is always there to back up DMA, and for ep0 |
26 | 26 | ||
27 | ifneq ($(CONFIG_MUSB_PIO_ONLY),y) | 27 | musb_hdrc-$(CONFIG_USB_INVENTRA_DMA) += musbhsdma.o |
28 | 28 | musb_hdrc-$(CONFIG_USB_TI_CPPI_DMA) += cppi_dma.o | |
29 | ifeq ($(CONFIG_USB_INVENTRA_DMA),y) | 29 | musb_hdrc-$(CONFIG_USB_TUSB_OMAP_DMA) += tusb6010_omap.o |
30 | musb_hdrc-y += musbhsdma.o | 30 | musb_hdrc-$(CONFIG_USB_UX500_DMA) += ux500_dma.o |
31 | |||
32 | else | ||
33 | ifeq ($(CONFIG_USB_TI_CPPI_DMA),y) | ||
34 | musb_hdrc-y += cppi_dma.o | ||
35 | |||
36 | else | ||
37 | ifeq ($(CONFIG_USB_TUSB_OMAP_DMA),y) | ||
38 | musb_hdrc-y += tusb6010_omap.o | ||
39 | |||
40 | else | ||
41 | ifeq ($(CONFIG_USB_UX500_DMA),y) | ||
42 | musb_hdrc-y += ux500_dma.o | ||
43 | |||
44 | endif | ||
45 | endif | ||
46 | endif | ||
47 | endif | ||
48 | endif | ||