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