4 # Copyright (c) 2013 Hans Petter Selasky.
5 # Copyright (c) 2014 SRI International
8 # This software was developed by SRI International and the University of
9 # Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
10 # ("CTSRD"), as part of the DARPA CRASH research programme.
12 # Redistribution and use in source and binary forms, with or without
13 # modification, are permitted provided that the following conditions
15 # 1. Redistributions of source code must retain the above copyright
16 # notice, this list of conditions and the following disclaimer.
17 # 2. Redistributions in binary form must reproduce the above copyright
18 # notice, this list of conditions and the following disclaimer in the
19 # documentation and/or other materials provided with the distribution.
21 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
22 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
25 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 USBCOREDIR:= ${.PARSEDIR}
35 S=${USBCOREDIR}/../../sys
39 .if defined(HAVE_EXYNOS_EHCI)
40 MACHDEP_DIRS+= ${S}/arm/samsung/exynos
45 ${USBCOREDIR}/storage \
47 ${S}/dev/usb/controller \
49 ${S}/dev/usb/storage \
50 ${S}/dev/usb/template \
54 USB_POOL_SIZE?= 131072
56 CFLAGS+= -DUSB_MSCTEST_BULK_SIZE=65536
57 CFLAGS+= -DUSB_POOL_SIZE=${USB_POOL_SIZE}
61 # BUSDMA implementation
63 SRCS+= usb_busdma_loader.c
66 # USB controller drivers
69 KSRCS+= usb_controller.c
71 .if defined(HAVE_AT91DCI)
72 CFLAGS += -DUSB_PCI_PROBE_LIST="\"at91dci\""
76 .if defined(HAVE_ATMEGADCI)
77 CFLAGS += -DUSB_PCI_PROBE_LIST="\"atmegadci\""
81 .if defined(HAVE_AVR32DCI)
82 CFLAGS += -DUSB_PCI_PROBE_LIST="\"avr32dci\""
86 .if defined(HAVE_DWCOTG)
87 CFLAGS += -DUSB_PCI_PROBE_LIST="\"dwcotg\""
91 .if defined(HAVE_MUSBOTG)
92 CFLAGS += -DUSB_PCI_PROBE_LIST="\"musbotg\""
96 .if defined(HAVE_EHCI)
97 CFLAGS += -DUSB_PCI_PROBE_LIST="\"ehci\""
101 .if defined(HAVE_EXYNOS_EHCI)
102 CFLAGS += -DUSB_PCI_PROBE_LIST="\"combiner\", \"pad\", \"ehci\""
104 KSRCS+= exynos5_combiner.c
105 KSRCS+= exynos5_pad.c
106 KSRCS+= exynos5_ehci.c
109 .if defined(HAVE_OHCI)
110 CFLAGS += -DUSB_PCI_PROBE_LIST="\"ohci\""
114 .if defined(HAVE_UHCI)
115 CFLAGS += -DUSB_PCI_PROBE_LIST="\"uhci\""
119 .if defined(HAVE_XHCI)
120 CFLAGS += -DUSB_PCI_PROBE_LIST="\"xhci\""
124 .if defined(HAVE_USS820DCI)
125 CFLAGS += -DUSB_PCI_PROBE_LIST="\"uss820dci\""
129 .if defined(HAVE_SAF1761OTG)
130 CFLAGS += -DUSB_PCI_PROBE_LIST="\"saf1761otg\""
131 CFLAGS += -DUSB_PCI_MEMORY_ADDRESS=0x900000007f100000ULL
132 CFLAGS += -DUSB_PCI_MEMORY_SIZE=0x40000U
133 KSRCS+= saf1761_otg.c
134 KSRCS+= saf1761_otg_boot.c
138 # USB core and templates
143 KSRCS+= usb_dynamic.c
145 KSRCS+= usb_handle_request.c
149 KSRCS+= usb_msctest.c
151 KSRCS+= usb_request.c
152 KSRCS+= usb_transfer.c
154 KSRCS+= usb_template.c
155 KSRCS+= usb_template_cdce.c
156 KSRCS+= usb_template_msc.c
157 KSRCS+= usb_template_mtp.c
158 KSRCS+= usb_template_modem.c
159 KSRCS+= usb_template_mouse.c
160 KSRCS+= usb_template_kbd.c
161 KSRCS+= usb_template_audio.c
162 KSRCS+= usb_template_phone.c
163 KSRCS+= usb_template_serialnet.c
164 KSRCS+= usb_template_midi.c
167 # USB mass storage support
169 SRCS+= umass_common.c
171 .if defined(HAVE_UMASS_LOADER)
172 CFLAGS+= -I${.CURDIR}/../common
173 SRCS+= umass_loader.c