xref: /openbmc/qemu/hw/usb/meson.build (revision de6cd759)
106677ce1SPaolo Bonzinihw_usb_modules = {}
206677ce1SPaolo Bonzini
306677ce1SPaolo Bonzini# usb subsystem core
4*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB', if_true: files(
506677ce1SPaolo Bonzini  'bus.c',
606677ce1SPaolo Bonzini  'combined-packet.c',
706677ce1SPaolo Bonzini  'core.c',
806677ce1SPaolo Bonzini  'desc.c',
906677ce1SPaolo Bonzini  'desc-msos.c',
109c3c834bSPhilippe Mathieu-Daudé  'libhw.c',
119c3c834bSPhilippe Mathieu-Daudé  'pcap.c',
1206677ce1SPaolo Bonzini))
1306677ce1SPaolo Bonzini
1406677ce1SPaolo Bonzini# usb host adapters
15*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_UHCI', if_true: files('hcd-uhci.c'))
16*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_OHCI', if_true: files('hcd-ohci.c'))
17*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_OHCI_PCI', if_true: files('hcd-ohci-pci.c'))
18*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_EHCI', if_true: files('hcd-ehci.c'))
19*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_EHCI_PCI', if_true: files('hcd-ehci-pci.c'))
20*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_EHCI_SYSBUS', if_true: files('hcd-ehci.c', 'hcd-ehci-sysbus.c'))
21*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_XHCI', if_true: files('hcd-xhci.c'))
22*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_XHCI_PCI', if_true: files('hcd-xhci-pci.c'))
23*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_XHCI_SYSBUS', if_true: files('hcd-xhci-sysbus.c'))
24*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_XHCI_NEC', if_true: files('hcd-xhci-nec.c'))
25*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_MUSB', if_true: files('hcd-musb.c'))
26*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_DWC2', if_true: files('hcd-dwc2.c'))
27*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_DWC3', if_true: files('hcd-dwc3.c'))
2806677ce1SPaolo Bonzini
29*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_TUSB6010', if_true: files('tusb6010.c'))
30*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_IMX', if_true: files('chipidea.c'))
31*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_IMX_USBPHY', if_true: files('imx-usb-phy.c'))
32*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_VT82C686', if_true: files('vt82c686-uhci-pci.c'))
33*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_XLNX_VERSAL', if_true: files('xlnx-versal-usb2-ctrl-regs.c'))
34*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_XLNX_USB_SUBSYS', if_true: files('xlnx-usb-subsystem.c'))
3506677ce1SPaolo Bonzini
3606677ce1SPaolo Bonzini# emulated usb devices
37*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB', if_true: files('dev-hub.c'))
38*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB', if_true: files('dev-hid.c'))
39*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_TABLET_WACOM', if_true: files('dev-wacom.c'))
40*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_STORAGE_CORE', if_true: files('dev-storage.c'))
41*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_STORAGE_BOT', if_true: files('dev-storage-bot.c'))
42*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_STORAGE_CLASSIC', if_true: files('dev-storage-classic.c'))
43*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_STORAGE_UAS', if_true: files('dev-uas.c'))
44*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_AUDIO', if_true: files('dev-audio.c'))
45*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_SERIAL', if_true: files('dev-serial.c'))
46*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_NETWORK', if_true: files('dev-network.c'))
47*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: ['CONFIG_POSIX', 'CONFIG_USB_STORAGE_MTP'], if_true: files('dev-mtp.c'))
4806677ce1SPaolo Bonzini
4906677ce1SPaolo Bonzini# smartcard
50*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: files('dev-smartcard-reader.c'))
5106677ce1SPaolo Bonzini
525f364c57SPaolo Bonziniif cacard.found()
5306677ce1SPaolo Bonzini  usbsmartcard_ss = ss.source_set()
5406677ce1SPaolo Bonzini  usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD',
5506677ce1SPaolo Bonzini                      if_true: [cacard, files('ccid-card-emulated.c', 'ccid-card-passthru.c')])
5606677ce1SPaolo Bonzini  hw_usb_modules += {'smartcard': usbsmartcard_ss}
5706677ce1SPaolo Bonziniendif
5806677ce1SPaolo Bonzini
590a40bcb7SCésar Belley# U2F
60*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_U2F', if_true: files('u2f.c'))
61*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: ['CONFIG_LINUX', 'CONFIG_USB_U2F'], if_true: [libudev, files('u2f-passthru.c')])
620a40bcb7SCésar Belleyif u2f.found()
63*de6cd759SPhilippe Mathieu-Daudé  system_ss.add(when: 'CONFIG_USB_U2F', if_true: [u2f, files('u2f-emulated.c')])
640a40bcb7SCésar Belleyendif
650a40bcb7SCésar Belley
668caef850SHongren (Zenithal) Zheng# CanoKey
678caef850SHongren (Zenithal) Zhengif canokey.found()
68*de6cd759SPhilippe Mathieu-Daudé  system_ss.add(when: 'CONFIG_USB_CANOKEY', if_true: [canokey, files('canokey.c')])
698caef850SHongren (Zenithal) Zhengendif
708caef850SHongren (Zenithal) Zheng
7106677ce1SPaolo Bonzini# usb redirect
7218f31e60SPaolo Bonziniif usbredir.found()
7306677ce1SPaolo Bonzini  usbredir_ss = ss.source_set()
7406677ce1SPaolo Bonzini  usbredir_ss.add(when: 'CONFIG_USB',
7506677ce1SPaolo Bonzini                  if_true: [usbredir, files('redirect.c', 'quirks.c')])
7606677ce1SPaolo Bonzini  hw_usb_modules += {'redirect': usbredir_ss}
7706677ce1SPaolo Bonziniendif
7806677ce1SPaolo Bonzini
7906677ce1SPaolo Bonzini# usb pass-through
80670b3591SGerd Hoffmannif libusb.found()
81627302afSGerd Hoffmann  usbhost_ss = ss.source_set()
82627302afSGerd Hoffmann  usbhost_ss.add(when: ['CONFIG_USB', libusb],
83f1a74bf9SGerd Hoffmann                 if_true: files('host-libusb.c'))
84627302afSGerd Hoffmann  hw_usb_modules += {'host': usbhost_ss}
85627302afSGerd Hoffmannendif
8606677ce1SPaolo Bonzini
87*de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: ['CONFIG_USB', 'CONFIG_XEN_BUS', libusb], if_true: files('xen-usb.c'))
8806677ce1SPaolo Bonzini
8906677ce1SPaolo Bonzinimodules += { 'hw-usb': hw_usb_modules }
90