xref: /freebsd/stand/usb/usbcore.mk (revision 2e3507c25e42292b45a5482e116d278f5515d04d)
1#
2#
3# Copyright (c) 2013-2020 Hans Petter Selasky.
4# Copyright (c) 2014 SRI International
5# All rights reserved.
6#
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.
10#
11# Redistribution and use in source and binary forms, with or without
12# modification, are permitted provided that the following conditions
13# are met:
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.
19#
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
30# SUCH DAMAGE.
31#
32
33USBCOREDIR:=	${.PARSEDIR}
34S=${USBCOREDIR}/../../sys
35
36MACHDEP_DIRS=
37
38.if defined(HAVE_EXYNOS_EHCI)
39MACHDEP_DIRS+=	${S}/arm/samsung/exynos
40.endif
41
42.PATH: \
43	${USBCOREDIR} \
44	${USBCOREDIR}/storage \
45	${S}/dev/usb \
46	${S}/dev/usb/controller \
47	${S}/dev/usb/serial \
48	${S}/dev/usb/storage \
49	${S}/dev/usb/template \
50	${MACHDEP_DIRS}
51.undef S
52
53USB_POOL_SIZE?=	131072
54
55CFLAGS+=	-DUSB_MSCTEST_BULK_SIZE=65536
56CFLAGS+=	-DUSB_POOL_SIZE=${USB_POOL_SIZE}
57
58
59#
60# BUSDMA implementation
61#
62SRCS+=	usb_busdma_loader.c
63
64#
65# USB controller drivers
66#
67
68KSRCS+=	usb_controller.c
69
70.if defined(HAVE_AT91DCI)
71CFLAGS += -DUSB_PCI_PROBE_LIST="\"at91dci\""
72KSRCS+=	at91dci.c
73.endif
74
75.if defined(HAVE_ATMEGADCI)
76CFLAGS += -DUSB_PCI_PROBE_LIST="\"atmegadci\""
77KSRCS+=	atmegadci.c
78.endif
79
80.if defined(HAVE_AVR32DCI)
81CFLAGS += -DUSB_PCI_PROBE_LIST="\"avr32dci\""
82KSRCS+=	avr32dci.c
83.endif
84
85.if defined(HAVE_DWCOTG)
86CFLAGS += -DUSB_PCI_PROBE_LIST="\"dwcotg\""
87KSRCS+=	dwcotg.c
88.endif
89
90.if defined(HAVE_MUSBOTG)
91CFLAGS += -DUSB_PCI_PROBE_LIST="\"musbotg\""
92KSRCS+=	musbotg.c
93.endif
94
95.if defined(HAVE_EHCI)
96CFLAGS += -DUSB_PCI_PROBE_LIST="\"ehci\""
97KSRCS+=	ehci.c
98.endif
99
100.if defined(HAVE_EXYNOS_EHCI)
101CFLAGS += -DUSB_PCI_PROBE_LIST="\"combiner\", \"pad\", \"ehci\""
102KSRCS+=	ehci.c
103KSRCS+=	exynos5_combiner.c
104KSRCS+=	exynos5_pad.c
105KSRCS+=	exynos5_ehci.c
106.endif
107
108.if defined(HAVE_OHCI)
109CFLAGS += -DUSB_PCI_PROBE_LIST="\"ohci\""
110KSRCS+=	ohci.c
111.endif
112
113.if defined(HAVE_UHCI)
114CFLAGS += -DUSB_PCI_PROBE_LIST="\"uhci\""
115KSRCS+=	uhci.c
116.endif
117
118.if defined(HAVE_XHCI)
119CFLAGS += -DUSB_PCI_PROBE_LIST="\"xhci\""
120KSRCS+=	xhci.c
121.endif
122
123.if defined(HAVE_USS820DCI)
124CFLAGS += -DUSB_PCI_PROBE_LIST="\"uss820dci\""
125KSRCS+=	uss820dci.c
126.endif
127
128#
129# USB core and templates
130#
131KSRCS+=	usb_core.c
132KSRCS+=	usb_debug.c
133KSRCS+=	usb_device.c
134KSRCS+=	usb_dynamic.c
135KSRCS+=	usb_error.c
136KSRCS+=	usb_handle_request.c
137KSRCS+=	usb_hid.c
138KSRCS+=	usb_hub.c
139KSRCS+=	usb_lookup.c
140KSRCS+=	usb_msctest.c
141KSRCS+=	usb_parse.c
142KSRCS+=	usb_request.c
143KSRCS+=	usb_transfer.c
144KSRCS+=	usb_util.c
145KSRCS+=	usb_template.c
146KSRCS+=	usb_template_cdce.c
147KSRCS+=	usb_template_msc.c
148KSRCS+=	usb_template_mtp.c
149KSRCS+=	usb_template_modem.c
150KSRCS+=	usb_template_mouse.c
151KSRCS+=	usb_template_kbd.c
152KSRCS+=	usb_template_audio.c
153KSRCS+=	usb_template_phone.c
154KSRCS+=	usb_template_serialnet.c
155KSRCS+=	usb_template_midi.c
156KSRCS+=	usb_template_multi.c
157KSRCS+=	usb_template_cdceem.c
158
159#
160# USB mass storage support
161#
162SRCS+=	umass_common.c
163
164.if defined(HAVE_UMASS_LOADER)
165CFLAGS+=        -I${.CURDIR}/../common
166SRCS+=  umass_loader.c
167.endif
168
169