xref: /openbmc/qemu/hw/usb/meson.build (revision e29c7db1)
106677ce1SPaolo Bonzinihw_usb_modules = {}
206677ce1SPaolo Bonzini
306677ce1SPaolo Bonzini# usb subsystem core
406677ce1SPaolo Bonzinisoftmmu_ss.add(files(
506677ce1SPaolo Bonzini  'bus.c',
606677ce1SPaolo Bonzini  'combined-packet.c',
706677ce1SPaolo Bonzini  'core.c',
806677ce1SPaolo Bonzini  'libhw.c'
906677ce1SPaolo Bonzini))
1006677ce1SPaolo Bonzini
1106677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB', if_true: files(
1206677ce1SPaolo Bonzini  'desc.c',
1306677ce1SPaolo Bonzini  'desc-msos.c',
1406677ce1SPaolo Bonzini))
1506677ce1SPaolo Bonzini
1606677ce1SPaolo Bonzini# usb host adapters
1706677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_UHCI', if_true: files('hcd-uhci.c'))
1806677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_OHCI', if_true: files('hcd-ohci.c'))
1906677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_OHCI_PCI', if_true: files('hcd-ohci-pci.c'))
2006677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_EHCI', if_true: files('hcd-ehci.c'))
2106677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_EHCI_PCI', if_true: files('hcd-ehci-pci.c'))
2206677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_EHCI_SYSBUS', if_true: files('hcd-ehci.c', 'hcd-ehci-sysbus.c'))
2306677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_XHCI', if_true: files('hcd-xhci.c'))
24755fba11SSai Pavan Boddusoftmmu_ss.add(when: 'CONFIG_USB_XHCI_PCI', if_true: files('hcd-xhci-pci.c'))
25f00ff136SSai Pavan Boddusoftmmu_ss.add(when: 'CONFIG_USB_XHCI_SYSBUS', if_true: files('hcd-xhci-sysbus.c'))
2606677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_XHCI_NEC', if_true: files('hcd-xhci-nec.c'))
2706677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_MUSB', if_true: files('hcd-musb.c'))
2806677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_DWC2', if_true: files('hcd-dwc2.c'))
298bbe61f3SVikram Garhwalsoftmmu_ss.add(when: 'CONFIG_USB_DWC3', if_true: files('hcd-dwc3.c'))
3006677ce1SPaolo Bonzini
3106677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_TUSB6010', if_true: files('tusb6010.c'))
3206677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_IMX', if_true: files('chipidea.c'))
3306677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_IMX_USBPHY', if_true: files('imx-usb-phy.c'))
3450e76a73SSai Pavan Bodduspecific_ss.add(when: 'CONFIG_XLNX_VERSAL', if_true: files('xlnx-versal-usb2-ctrl-regs.c'))
35*e29c7db1SSai Pavan Bodduspecific_ss.add(when: 'CONFIG_XLNX_USB_SUBSYS', if_true: files('xlnx-usb-subsystem.c'))
3606677ce1SPaolo Bonzini
3706677ce1SPaolo Bonzini# emulated usb devices
3806677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB', if_true: files('dev-hub.c'))
3906677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB', if_true: files('dev-hid.c'))
4006677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_TABLET_WACOM', if_true: files('dev-wacom.c'))
4106677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_STORAGE_BOT', if_true: files('dev-storage.c'))
4206677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_STORAGE_UAS', if_true: files('dev-uas.c'))
4306677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_AUDIO', if_true: files('dev-audio.c'))
4406677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_SERIAL', if_true: files('dev-serial.c'))
4506677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_NETWORK', if_true: files('dev-network.c'))
4606677ce1SPaolo Bonzinisoftmmu_ss.add(when: ['CONFIG_POSIX', 'CONFIG_USB_STORAGE_MTP'], if_true: files('dev-mtp.c'))
4706677ce1SPaolo Bonzini
4806677ce1SPaolo Bonzini# smartcard
4906677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: files('dev-smartcard-reader.c'))
5006677ce1SPaolo Bonzini
5106677ce1SPaolo Bonziniif config_host.has_key('CONFIG_SMARTCARD')
5206677ce1SPaolo Bonzini  usbsmartcard_ss = ss.source_set()
5306677ce1SPaolo Bonzini  usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD',
5406677ce1SPaolo Bonzini                      if_true: [cacard, files('ccid-card-emulated.c', 'ccid-card-passthru.c')])
5506677ce1SPaolo Bonzini  hw_usb_modules += {'smartcard': usbsmartcard_ss}
5606677ce1SPaolo Bonziniendif
5706677ce1SPaolo Bonzini
580a40bcb7SCésar Belley# U2F
590a40bcb7SCésar Belleysoftmmu_ss.add(when: 'CONFIG_USB_U2F', if_true: files('u2f.c'))
60d7c1523fSCésar Belleysoftmmu_ss.add(when: ['CONFIG_LINUX', 'CONFIG_USB_U2F'], if_true: [libudev, files('u2f-passthru.c')])
610a40bcb7SCésar Belleyif u2f.found()
620a40bcb7SCésar Belley  softmmu_ss.add(when: 'CONFIG_USB_U2F', if_true: [u2f, files('u2f-emulated.c')])
630a40bcb7SCésar Belleyendif
640a40bcb7SCésar Belley
6506677ce1SPaolo Bonzini# usb redirect
6606677ce1SPaolo Bonziniif config_host.has_key('CONFIG_USB_REDIR')
6706677ce1SPaolo Bonzini  usbredir_ss = ss.source_set()
6806677ce1SPaolo Bonzini  usbredir_ss.add(when: 'CONFIG_USB',
6906677ce1SPaolo Bonzini                  if_true: [usbredir, files('redirect.c', 'quirks.c')])
7006677ce1SPaolo Bonzini  hw_usb_modules += {'redirect': usbredir_ss}
7106677ce1SPaolo Bonziniendif
7206677ce1SPaolo Bonzini
7306677ce1SPaolo Bonzini# usb pass-through
7406677ce1SPaolo Bonzinisoftmmu_ss.add(when: ['CONFIG_USB', 'CONFIG_USB_LIBUSB', libusb],
7506677ce1SPaolo Bonzini               if_true: files('host-libusb.c'),
7606677ce1SPaolo Bonzini               if_false: files('host-stub.c'))
7706677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_ALL', if_true: files('host-stub.c'))
7806677ce1SPaolo Bonzini
7906677ce1SPaolo Bonzinisoftmmu_ss.add(when: ['CONFIG_USB', 'CONFIG_XEN', libusb], if_true: files('xen-usb.c'))
8006677ce1SPaolo Bonzini
8106677ce1SPaolo Bonzinimodules += { 'hw-usb': hw_usb_modules }
82