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}
39 ${USBCOREDIR}/storage \
41 ${S}/dev/usb/controller \
43 ${S}/dev/usb/storage \
47 CFLAGS+= -DUSB_MSCTEST_BULK_SIZE=65536
48 CFLAGS+= -DUSB_POOL_SIZE=131072
51 # BUSDMA implementation
53 SRCS+= usb_busdma_loader.c
56 # USB controller drivers
59 KSRCS+= usb_controller.c
61 .if defined(HAVE_AT91DCI)
62 CFLAGS += -DUSB_PCI_PROBE_LIST="\"at91dci\""
66 .if defined(HAVE_ATMEGADCI)
67 CFLAGS += -DUSB_PCI_PROBE_LIST="\"atmegadci\""
71 .if defined(HAVE_AVR32DCI)
72 CFLAGS += -DUSB_PCI_PROBE_LIST="\"avr32dci\""
76 .if defined(HAVE_DWCOTG)
77 CFLAGS += -DUSB_PCI_PROBE_LIST="\"dwcotg\""
81 .if defined(HAVE_MUSBOTG)
82 CFLAGS += -DUSB_PCI_PROBE_LIST="\"musbotg\""
86 .if defined(HAVE_EHCI)
87 CFLAGS += -DUSB_PCI_PROBE_LIST="\"ehci\""
91 .if defined(HAVE_OHCI)
92 CFLAGS += -DUSB_PCI_PROBE_LIST="\"ohci\""
96 .if defined(HAVE_UHCI)
97 CFLAGS += -DUSB_PCI_PROBE_LIST="\"uhci\""
101 .if defined(HAVE_XHCI)
102 CFLAGS += -DUSB_PCI_PROBE_LIST="\"xhci\""
106 .if defined(HAVE_USS820DCI)
107 CFLAGS += -DUSB_PCI_PROBE_LIST="\"uss820dci\""
111 .if defined(HAVE_SAF1761OTG)
112 CFLAGS += -DUSB_PCI_PROBE_LIST="\"saf1761otg\""
113 CFLAGS += -DUSB_PCI_MEMORY_ADDRESS=0x900000007f100000ULL
114 CFLAGS += -DUSB_PCI_MEMORY_SIZE=0x40000U
115 KSRCS+= saf1761_otg.c
116 KSRCS+= saf1761_otg_boot.c
120 # USB core and templates
125 KSRCS+= usb_dynamic.c
127 KSRCS+= usb_handle_request.c
131 KSRCS+= usb_msctest.c
133 KSRCS+= usb_request.c
134 KSRCS+= usb_transfer.c
136 KSRCS+= usb_template.c
137 KSRCS+= usb_template_cdce.c
138 KSRCS+= usb_template_msc.c
139 KSRCS+= usb_template_mtp.c
140 KSRCS+= usb_template_modem.c
141 KSRCS+= usb_template_mouse.c
142 KSRCS+= usb_template_kbd.c
143 KSRCS+= usb_template_audio.c
144 KSRCS+= usb_template_phone.c
145 KSRCS+= usb_template_serialnet.c
148 # USB mass storage support
150 SRCS+= umass_common.c
152 .if defined(HAVE_UMASS_LOADER)
153 CFLAGS+= -I${.CURDIR}/../common
154 SRCS+= umass_loader.c