1 From: Peter Chen <peter.chen@freescale.com>
2 Subject: [PATCH] usb: chipidea: improve kconfig
4 Randy Dunlap <rdunlap@infradead.org> reported this problem
7 > drivers/built-in.o: In function `ci_hdrc_host_init':
8 > (.text+0x2ce75c): undefined reference to `ehci_init_driver'
10 > When USB_EHCI_HCD=m and USB_CHIPIDEA=y.
12 In fact, this problem is existed on all platforms which are using
13 chipidea driver. The root cause of this problem is the chipidea host
14 uses symbol exported from ehci-hcd, but chipidea core
15 does not depends on USB_EHCI_HCD. So, chipidea driver
16 will not be compiled as module if USB_EHCI_HCD=m.
18 It is very hard to give a perfect solution since chipidea core
19 depends on USB || USB_GADGET, and chipdiea host depends on
20 both USB_EHCI_HCD and USB_CHIPIDEA, the same problem exists for
23 To fix this problem, we had to have below assumptions:
25 - If USB_EHCI_HCD=y && USB_GADGET=y, USB_CHIPIDEA can be 'y'.
27 - If USB_EHCI_HCD=m && USB_GADGET=y, USB_CHIPIDEA=m
28 or USB_CHIPIDEA_HOST can't be seen if USB_CHIPIDEA=y.
29 It will cause compile error due to no glue layer for ehci:
31 > error: #error "missing bus glue for ehci-hcd"
33 So, we had to compile USB_CHIPIDEA=m if USB_EHCI_HCD=m,
34 current ehci hcd core guarantee it.
36 - If USB_EHCI_HCD=y && USB_GADGET=m, USB_CHIPIDEA=m
37 or USB_CHIPIDEA_UDC can't be seen if USB_CHIPIDEA=y.
38 Of cos, the gadget will out of working at this situation,
39 so the user had to compile USB_CHIPIDEA=m.
41 - USB_EHCI_HCD=m && USB_GADGET=m, we can't see
42 USB_CHIPIDEA_HOST and USB_CHIPIDEA_UDC unless
45 The reason why it has above assumptions:
46 - If both ehci core and gadget core build as module,
47 the chipidea has to build as module.
48 - If one of ehci core or gadget core is built in, another
49 is built as module, we can only enable the function which
50 is built in, or enable both roles as modules (USB_CHIPIDEA=m),
51 since chipidea core driver takes care of both host and device roles.
53 Signed-off-by: Peter Chen <peter.chen@freescale.com>
54 Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
55 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
57 drivers/usb/chipidea/Kconfig | 6 +++---
58 1 file changed, 3 insertions(+), 3 deletions(-)
60 --- a/drivers/usb/chipidea/Kconfig
61 +++ b/drivers/usb/chipidea/Kconfig
62 @@ -12,15 +12,15 @@ if USB_CHIPIDEA
64 config USB_CHIPIDEA_UDC
65 bool "ChipIdea device controller"
66 - depends on USB_GADGET=y || USB_GADGET=USB_CHIPIDEA
67 + depends on USB_GADGET=y || USB_CHIPIDEA=m
69 Say Y here to enable device controller functionality of the
72 config USB_CHIPIDEA_HOST
73 bool "ChipIdea host controller"
74 - depends on USB=y || USB=USB_CHIPIDEA
75 - depends on USB_EHCI_HCD=y
77 + depends on USB_EHCI_HCD=y || USB_CHIPIDEA=m
78 select USB_EHCI_ROOT_HUB_TT
80 Say Y here to enable host controller functionality of the