xref: /freebsd/stand/usb/usbcore.mk (revision d0b2dbfa)
1ca987d46SWarner Losh#
2ca987d46SWarner Losh#
38427dd08SHans Petter Selasky# Copyright (c) 2013-2020 Hans Petter Selasky.
4ca987d46SWarner Losh# Copyright (c) 2014 SRI International
5ca987d46SWarner Losh# All rights reserved.
6ca987d46SWarner Losh#
7ca987d46SWarner Losh# This software was developed by SRI International and the University of
8ca987d46SWarner Losh# Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
9ca987d46SWarner Losh# ("CTSRD"), as part of the DARPA CRASH research programme.
10ca987d46SWarner Losh#
11ca987d46SWarner Losh# Redistribution and use in source and binary forms, with or without
12ca987d46SWarner Losh# modification, are permitted provided that the following conditions
13ca987d46SWarner Losh# are met:
14ca987d46SWarner Losh# 1. Redistributions of source code must retain the above copyright
15ca987d46SWarner Losh#    notice, this list of conditions and the following disclaimer.
16ca987d46SWarner Losh# 2. Redistributions in binary form must reproduce the above copyright
17ca987d46SWarner Losh#    notice, this list of conditions and the following disclaimer in the
18ca987d46SWarner Losh#    documentation and/or other materials provided with the distribution.
19ca987d46SWarner Losh#
20ca987d46SWarner Losh# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
21ca987d46SWarner Losh# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22ca987d46SWarner Losh# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23ca987d46SWarner Losh# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
24ca987d46SWarner Losh# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25ca987d46SWarner Losh# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26ca987d46SWarner Losh# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27ca987d46SWarner Losh# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28ca987d46SWarner Losh# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29ca987d46SWarner Losh# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30ca987d46SWarner Losh# SUCH DAMAGE.
31ca987d46SWarner Losh#
32ca987d46SWarner Losh
33ca987d46SWarner LoshUSBCOREDIR:=	${.PARSEDIR}
340cd0d30aSHans Petter SelaskyS=${USBCOREDIR}/../../sys
35ca987d46SWarner Losh
36ca987d46SWarner LoshMACHDEP_DIRS=
37ca987d46SWarner Losh
38ca987d46SWarner Losh.if defined(HAVE_EXYNOS_EHCI)
39ca987d46SWarner LoshMACHDEP_DIRS+=	${S}/arm/samsung/exynos
40ca987d46SWarner Losh.endif
41ca987d46SWarner Losh
42ca987d46SWarner Losh.PATH: \
43ca987d46SWarner Losh	${USBCOREDIR} \
44ca987d46SWarner Losh	${USBCOREDIR}/storage \
45ca987d46SWarner Losh	${S}/dev/usb \
46ca987d46SWarner Losh	${S}/dev/usb/controller \
47ca987d46SWarner Losh	${S}/dev/usb/serial \
48ca987d46SWarner Losh	${S}/dev/usb/storage \
49ca987d46SWarner Losh	${S}/dev/usb/template \
50ca987d46SWarner Losh	${MACHDEP_DIRS}
51ca987d46SWarner Losh.undef S
52ca987d46SWarner Losh
53ca987d46SWarner LoshUSB_POOL_SIZE?=	131072
54ca987d46SWarner Losh
55ca987d46SWarner LoshCFLAGS+=	-DUSB_MSCTEST_BULK_SIZE=65536
56ca987d46SWarner LoshCFLAGS+=	-DUSB_POOL_SIZE=${USB_POOL_SIZE}
57ca987d46SWarner Losh
58ca987d46SWarner Losh
59ca987d46SWarner Losh#
60ca987d46SWarner Losh# BUSDMA implementation
61ca987d46SWarner Losh#
62ca987d46SWarner LoshSRCS+=	usb_busdma_loader.c
63ca987d46SWarner Losh
64ca987d46SWarner Losh#
65ca987d46SWarner Losh# USB controller drivers
66ca987d46SWarner Losh#
67ca987d46SWarner Losh
68ca987d46SWarner LoshKSRCS+=	usb_controller.c
69ca987d46SWarner Losh
70ca987d46SWarner Losh.if defined(HAVE_AT91DCI)
71ca987d46SWarner LoshCFLAGS += -DUSB_PCI_PROBE_LIST="\"at91dci\""
72ca987d46SWarner LoshKSRCS+=	at91dci.c
73ca987d46SWarner Losh.endif
74ca987d46SWarner Losh
75ca987d46SWarner Losh.if defined(HAVE_ATMEGADCI)
76ca987d46SWarner LoshCFLAGS += -DUSB_PCI_PROBE_LIST="\"atmegadci\""
77ca987d46SWarner LoshKSRCS+=	atmegadci.c
78ca987d46SWarner Losh.endif
79ca987d46SWarner Losh
80ca987d46SWarner Losh.if defined(HAVE_AVR32DCI)
81ca987d46SWarner LoshCFLAGS += -DUSB_PCI_PROBE_LIST="\"avr32dci\""
82ca987d46SWarner LoshKSRCS+=	avr32dci.c
83ca987d46SWarner Losh.endif
84ca987d46SWarner Losh
85ca987d46SWarner Losh.if defined(HAVE_DWCOTG)
86ca987d46SWarner LoshCFLAGS += -DUSB_PCI_PROBE_LIST="\"dwcotg\""
87ca987d46SWarner LoshKSRCS+=	dwcotg.c
88ca987d46SWarner Losh.endif
89ca987d46SWarner Losh
90ca987d46SWarner Losh.if defined(HAVE_MUSBOTG)
91ca987d46SWarner LoshCFLAGS += -DUSB_PCI_PROBE_LIST="\"musbotg\""
92ca987d46SWarner LoshKSRCS+=	musbotg.c
93ca987d46SWarner Losh.endif
94ca987d46SWarner Losh
95ca987d46SWarner Losh.if defined(HAVE_EHCI)
96ca987d46SWarner LoshCFLAGS += -DUSB_PCI_PROBE_LIST="\"ehci\""
97ca987d46SWarner LoshKSRCS+=	ehci.c
98ca987d46SWarner Losh.endif
99ca987d46SWarner Losh
100ca987d46SWarner Losh.if defined(HAVE_EXYNOS_EHCI)
101ca987d46SWarner LoshCFLAGS += -DUSB_PCI_PROBE_LIST="\"combiner\", \"pad\", \"ehci\""
102ca987d46SWarner LoshKSRCS+=	ehci.c
103ca987d46SWarner LoshKSRCS+=	exynos5_combiner.c
104ca987d46SWarner LoshKSRCS+=	exynos5_pad.c
105ca987d46SWarner LoshKSRCS+=	exynos5_ehci.c
106ca987d46SWarner Losh.endif
107ca987d46SWarner Losh
108ca987d46SWarner Losh.if defined(HAVE_OHCI)
109ca987d46SWarner LoshCFLAGS += -DUSB_PCI_PROBE_LIST="\"ohci\""
110ca987d46SWarner LoshKSRCS+=	ohci.c
111ca987d46SWarner Losh.endif
112ca987d46SWarner Losh
113ca987d46SWarner Losh.if defined(HAVE_UHCI)
114ca987d46SWarner LoshCFLAGS += -DUSB_PCI_PROBE_LIST="\"uhci\""
115ca987d46SWarner LoshKSRCS+=	uhci.c
116ca987d46SWarner Losh.endif
117ca987d46SWarner Losh
118ca987d46SWarner Losh.if defined(HAVE_XHCI)
119ca987d46SWarner LoshCFLAGS += -DUSB_PCI_PROBE_LIST="\"xhci\""
120ca987d46SWarner LoshKSRCS+=	xhci.c
121ca987d46SWarner Losh.endif
122ca987d46SWarner Losh
123ca987d46SWarner Losh.if defined(HAVE_USS820DCI)
124ca987d46SWarner LoshCFLAGS += -DUSB_PCI_PROBE_LIST="\"uss820dci\""
125ca987d46SWarner LoshKSRCS+=	uss820dci.c
126ca987d46SWarner Losh.endif
127ca987d46SWarner Losh
128ca987d46SWarner Losh#
129ca987d46SWarner Losh# USB core and templates
130ca987d46SWarner Losh#
131ca987d46SWarner LoshKSRCS+=	usb_core.c
132ca987d46SWarner LoshKSRCS+=	usb_debug.c
133ca987d46SWarner LoshKSRCS+=	usb_device.c
134ca987d46SWarner LoshKSRCS+=	usb_dynamic.c
135ca987d46SWarner LoshKSRCS+=	usb_error.c
136ca987d46SWarner LoshKSRCS+=	usb_handle_request.c
137ca987d46SWarner LoshKSRCS+=	usb_hid.c
138ca987d46SWarner LoshKSRCS+=	usb_hub.c
139ca987d46SWarner LoshKSRCS+=	usb_lookup.c
140ca987d46SWarner LoshKSRCS+=	usb_msctest.c
141ca987d46SWarner LoshKSRCS+=	usb_parse.c
142ca987d46SWarner LoshKSRCS+=	usb_request.c
143ca987d46SWarner LoshKSRCS+=	usb_transfer.c
144ca987d46SWarner LoshKSRCS+=	usb_util.c
145ca987d46SWarner LoshKSRCS+=	usb_template.c
146ca987d46SWarner LoshKSRCS+=	usb_template_cdce.c
147ca987d46SWarner LoshKSRCS+=	usb_template_msc.c
148ca987d46SWarner LoshKSRCS+=	usb_template_mtp.c
149ca987d46SWarner LoshKSRCS+=	usb_template_modem.c
150ca987d46SWarner LoshKSRCS+=	usb_template_mouse.c
151ca987d46SWarner LoshKSRCS+=	usb_template_kbd.c
152ca987d46SWarner LoshKSRCS+=	usb_template_audio.c
153ca987d46SWarner LoshKSRCS+=	usb_template_phone.c
154ca987d46SWarner LoshKSRCS+=	usb_template_serialnet.c
155ca987d46SWarner LoshKSRCS+=	usb_template_midi.c
1568427dd08SHans Petter SelaskyKSRCS+=	usb_template_multi.c
1578427dd08SHans Petter SelaskyKSRCS+=	usb_template_cdceem.c
158ca987d46SWarner Losh
159ca987d46SWarner Losh#
160ca987d46SWarner Losh# USB mass storage support
161ca987d46SWarner Losh#
162ca987d46SWarner LoshSRCS+=	umass_common.c
163ca987d46SWarner Losh
164ca987d46SWarner Losh.if defined(HAVE_UMASS_LOADER)
165ca987d46SWarner LoshCFLAGS+=        -I${.CURDIR}/../common
166ca987d46SWarner LoshSRCS+=  umass_loader.c
167ca987d46SWarner Losh.endif
168ca987d46SWarner Losh
169