3 # Copyright (c) 2013-2020 Hans Petter Selasky.
4 # Copyright (c) 2014 SRI International
7 # This software was developed by SRI International and the University of
8 # Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
9 # ("CTSRD"), as part of the DARPA CRASH research programme.
11 # Redistribution and use in source and binary forms, with or without
12 # modification, are permitted provided that the following conditions
14 # 1. Redistributions of source code must retain the above copyright
15 # notice, this list of conditions and the following disclaimer.
16 # 2. Redistributions in binary form must reproduce the above copyright
17 # notice, this list of conditions and the following disclaimer in the
18 # documentation and/or other materials provided with the distribution.
20 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
21 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
24 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 USBCOREDIR:= ${.PARSEDIR}
34 S=${USBCOREDIR}/../../sys
38 .if defined(HAVE_EXYNOS_EHCI)
39 MACHDEP_DIRS+= ${S}/arm/samsung/exynos
44 ${USBCOREDIR}/storage \
46 ${S}/dev/usb/controller \
48 ${S}/dev/usb/storage \
49 ${S}/dev/usb/template \
53 USB_POOL_SIZE?= 131072
55 CFLAGS+= -DUSB_MSCTEST_BULK_SIZE=65536
56 CFLAGS+= -DUSB_POOL_SIZE=${USB_POOL_SIZE}
60 # BUSDMA implementation
62 SRCS+= usb_busdma_loader.c
65 # USB controller drivers
68 KSRCS+= usb_controller.c
70 .if defined(HAVE_AT91DCI)
71 CFLAGS += -DUSB_PCI_PROBE_LIST="\"at91dci\""
75 .if defined(HAVE_ATMEGADCI)
76 CFLAGS += -DUSB_PCI_PROBE_LIST="\"atmegadci\""
80 .if defined(HAVE_AVR32DCI)
81 CFLAGS += -DUSB_PCI_PROBE_LIST="\"avr32dci\""
85 .if defined(HAVE_DWCOTG)
86 CFLAGS += -DUSB_PCI_PROBE_LIST="\"dwcotg\""
90 .if defined(HAVE_MUSBOTG)
91 CFLAGS += -DUSB_PCI_PROBE_LIST="\"musbotg\""
95 .if defined(HAVE_EHCI)
96 CFLAGS += -DUSB_PCI_PROBE_LIST="\"ehci\""
100 .if defined(HAVE_EXYNOS_EHCI)
101 CFLAGS += -DUSB_PCI_PROBE_LIST="\"combiner\", \"pad\", \"ehci\""
103 KSRCS+= exynos5_combiner.c
104 KSRCS+= exynos5_pad.c
105 KSRCS+= exynos5_ehci.c
108 .if defined(HAVE_OHCI)
109 CFLAGS += -DUSB_PCI_PROBE_LIST="\"ohci\""
113 .if defined(HAVE_UHCI)
114 CFLAGS += -DUSB_PCI_PROBE_LIST="\"uhci\""
118 .if defined(HAVE_XHCI)
119 CFLAGS += -DUSB_PCI_PROBE_LIST="\"xhci\""
123 .if defined(HAVE_USS820DCI)
124 CFLAGS += -DUSB_PCI_PROBE_LIST="\"uss820dci\""
129 # USB core and templates
134 KSRCS+= usb_dynamic.c
136 KSRCS+= usb_handle_request.c
140 KSRCS+= usb_msctest.c
142 KSRCS+= usb_request.c
143 KSRCS+= usb_transfer.c
145 KSRCS+= usb_template.c
146 KSRCS+= usb_template_cdce.c
147 KSRCS+= usb_template_msc.c
148 KSRCS+= usb_template_mtp.c
149 KSRCS+= usb_template_modem.c
150 KSRCS+= usb_template_mouse.c
151 KSRCS+= usb_template_kbd.c
152 KSRCS+= usb_template_audio.c
153 KSRCS+= usb_template_phone.c
154 KSRCS+= usb_template_serialnet.c
155 KSRCS+= usb_template_midi.c
156 KSRCS+= usb_template_multi.c
157 KSRCS+= usb_template_cdceem.c
160 # USB mass storage support
162 SRCS+= umass_common.c
164 .if defined(HAVE_UMASS_LOADER)
165 CFLAGS+= -I${.CURDIR}/../common
166 SRCS+= umass_loader.c