xref: /openbmc/qemu/hw/usb/meson.build (revision d0f0cd5b)
1hw_usb_modules = {}
2
3# usb subsystem core
4system_ss.add(when: 'CONFIG_USB', if_true: files(
5  'bus.c',
6  'combined-packet.c',
7  'core.c',
8  'desc.c',
9  'desc-msos.c',
10  'libhw.c',
11  'pcap.c',
12), if_false: files('bus-stub.c'))
13
14# usb host adapters
15system_ss.add(when: 'CONFIG_USB_UHCI', if_true: files('hcd-uhci.c'))
16system_ss.add(when: 'CONFIG_USB_OHCI', if_true: files('hcd-ohci.c'))
17system_ss.add(when: 'CONFIG_USB_OHCI_PCI', if_true: files('hcd-ohci-pci.c'))
18system_ss.add(when: 'CONFIG_USB_OHCI_SYSBUS', if_true: files('hcd-ohci-sysbus.c'))
19system_ss.add(when: 'CONFIG_USB_EHCI', if_true: files('hcd-ehci.c'))
20system_ss.add(when: 'CONFIG_USB_EHCI_PCI', if_true: files('hcd-ehci-pci.c'))
21system_ss.add(when: 'CONFIG_USB_EHCI_SYSBUS', if_true: files('hcd-ehci-sysbus.c'))
22system_ss.add(when: 'CONFIG_USB_XHCI', if_true: files('hcd-xhci.c'))
23system_ss.add(when: 'CONFIG_USB_XHCI_PCI', if_true: files('hcd-xhci-pci.c'))
24system_ss.add(when: 'CONFIG_USB_XHCI_SYSBUS', if_true: files('hcd-xhci-sysbus.c'))
25system_ss.add(when: 'CONFIG_USB_XHCI_NEC', if_true: files('hcd-xhci-nec.c'))
26system_ss.add(when: 'CONFIG_USB_DWC2', if_true: files('hcd-dwc2.c'))
27system_ss.add(when: 'CONFIG_USB_DWC3', if_true: files('hcd-dwc3.c'))
28
29system_ss.add(when: 'CONFIG_IMX', if_true: files('chipidea.c'))
30system_ss.add(when: 'CONFIG_IMX_USBPHY', if_true: files('imx-usb-phy.c'))
31system_ss.add(when: 'CONFIG_VT82C686', if_true: files('vt82c686-uhci-pci.c'))
32system_ss.add(when: 'CONFIG_XLNX_VERSAL', if_true: files('xlnx-versal-usb2-ctrl-regs.c'))
33system_ss.add(when: 'CONFIG_XLNX_USB_SUBSYS', if_true: files('xlnx-usb-subsystem.c'))
34
35# emulated usb devices
36system_ss.add(when: 'CONFIG_USB_HUB', if_true: files('dev-hub.c'))
37system_ss.add(when: 'CONFIG_USB_HID', if_true: files('dev-hid.c'))
38system_ss.add(when: 'CONFIG_USB_TABLET_WACOM', if_true: files('dev-wacom.c'))
39system_ss.add(when: 'CONFIG_USB_STORAGE_CORE', if_true: files('dev-storage.c'))
40system_ss.add(when: 'CONFIG_USB_STORAGE_BOT', if_true: files('dev-storage-bot.c'))
41system_ss.add(when: 'CONFIG_USB_STORAGE_CLASSIC', if_true: files('dev-storage-classic.c'))
42system_ss.add(when: 'CONFIG_USB_STORAGE_UAS', if_true: files('dev-uas.c'))
43system_ss.add(when: 'CONFIG_USB_AUDIO', if_true: files('dev-audio.c'))
44system_ss.add(when: 'CONFIG_USB_SERIAL', if_true: files('dev-serial.c'))
45system_ss.add(when: 'CONFIG_USB_NETWORK', if_true: files('dev-network.c'))
46if host_os != 'windows'
47  system_ss.add(when: 'CONFIG_USB_STORAGE_MTP', if_true: files('dev-mtp.c'))
48endif
49
50# smartcard
51system_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: files('dev-smartcard-reader.c'))
52
53if cacard.found()
54  usbsmartcard_ss = ss.source_set()
55  usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD',
56                      if_true: [cacard, files('ccid-card-emulated.c', 'ccid-card-passthru.c')])
57  hw_usb_modules += {'smartcard': usbsmartcard_ss}
58endif
59
60# U2F
61system_ss.add(when: 'CONFIG_USB_U2F', if_true: files('u2f.c'))
62if host_os == 'linux'
63  system_ss.add(when: 'CONFIG_USB_U2F', if_true: [libudev, files('u2f-passthru.c')])
64endif
65if u2f.found()
66  system_ss.add(when: 'CONFIG_USB_U2F', if_true: [u2f, files('u2f-emulated.c')])
67endif
68
69# CanoKey
70if canokey.found()
71  system_ss.add(when: 'CONFIG_USB_CANOKEY', if_true: [canokey, files('canokey.c')])
72endif
73
74# usb redirect
75if usbredir.found()
76  usbredir_ss = ss.source_set()
77  usbredir_ss.add(when: 'CONFIG_USB',
78                  if_true: [usbredir, files('redirect.c', 'quirks.c')])
79  hw_usb_modules += {'redirect': usbredir_ss}
80endif
81
82# usb pass-through
83if libusb.found()
84  usbhost_ss = ss.source_set()
85  usbhost_ss.add(when: ['CONFIG_USB', libusb],
86                 if_true: files('host-libusb.c'))
87  hw_usb_modules += {'host': usbhost_ss}
88endif
89
90system_ss.add(when: ['CONFIG_USB', 'CONFIG_XEN_BUS', libusb], if_true: files('xen-usb.c'))
91
92modules += { 'hw-usb': hw_usb_modules }
93