xref: /openbmc/qemu/hw/usb/meson.build (revision d7c1523f)
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'))
2406677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_XHCI_NEC', if_true: files('hcd-xhci-nec.c'))
2506677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_MUSB', if_true: files('hcd-musb.c'))
2606677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_DWC2', if_true: files('hcd-dwc2.c'))
2706677ce1SPaolo Bonzini
2806677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_TUSB6010', if_true: files('tusb6010.c'))
2906677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_IMX', if_true: files('chipidea.c'))
3006677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_IMX_USBPHY', if_true: files('imx-usb-phy.c'))
3106677ce1SPaolo Bonzini
3206677ce1SPaolo Bonzini# emulated usb devices
3306677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB', if_true: files('dev-hub.c'))
3406677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB', if_true: files('dev-hid.c'))
3506677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_TABLET_WACOM', if_true: files('dev-wacom.c'))
3606677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_STORAGE_BOT', if_true: files('dev-storage.c'))
3706677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_STORAGE_UAS', if_true: files('dev-uas.c'))
3806677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_AUDIO', if_true: files('dev-audio.c'))
3906677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_SERIAL', if_true: files('dev-serial.c'))
4006677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_NETWORK', if_true: files('dev-network.c'))
4106677ce1SPaolo Bonzinisoftmmu_ss.add(when: ['CONFIG_POSIX', 'CONFIG_USB_STORAGE_MTP'], if_true: files('dev-mtp.c'))
4206677ce1SPaolo Bonzini
4306677ce1SPaolo Bonzini# smartcard
4406677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: files('dev-smartcard-reader.c'))
4506677ce1SPaolo Bonzini
4606677ce1SPaolo Bonziniif config_host.has_key('CONFIG_SMARTCARD')
4706677ce1SPaolo Bonzini  usbsmartcard_ss = ss.source_set()
4806677ce1SPaolo Bonzini  usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD',
4906677ce1SPaolo Bonzini                      if_true: [cacard, files('ccid-card-emulated.c', 'ccid-card-passthru.c')])
5006677ce1SPaolo Bonzini  hw_usb_modules += {'smartcard': usbsmartcard_ss}
5106677ce1SPaolo Bonziniendif
5206677ce1SPaolo Bonzini
530a40bcb7SCésar Belley# U2F
540a40bcb7SCésar Belleysoftmmu_ss.add(when: 'CONFIG_USB_U2F', if_true: files('u2f.c'))
55*d7c1523fSCésar Belleysoftmmu_ss.add(when: ['CONFIG_LINUX', 'CONFIG_USB_U2F'], if_true: [libudev, files('u2f-passthru.c')])
560a40bcb7SCésar Belleyif u2f.found()
570a40bcb7SCésar Belley  softmmu_ss.add(when: 'CONFIG_USB_U2F', if_true: [u2f, files('u2f-emulated.c')])
580a40bcb7SCésar Belleyendif
590a40bcb7SCésar Belley
6006677ce1SPaolo Bonzini# usb redirect
6106677ce1SPaolo Bonziniif config_host.has_key('CONFIG_USB_REDIR')
6206677ce1SPaolo Bonzini  usbredir_ss = ss.source_set()
6306677ce1SPaolo Bonzini  usbredir_ss.add(when: 'CONFIG_USB',
6406677ce1SPaolo Bonzini                  if_true: [usbredir, files('redirect.c', 'quirks.c')])
6506677ce1SPaolo Bonzini  hw_usb_modules += {'redirect': usbredir_ss}
6606677ce1SPaolo Bonziniendif
6706677ce1SPaolo Bonzini
6806677ce1SPaolo Bonzini# usb pass-through
6906677ce1SPaolo Bonzinisoftmmu_ss.add(when: ['CONFIG_USB', 'CONFIG_USB_LIBUSB', libusb],
7006677ce1SPaolo Bonzini               if_true: files('host-libusb.c'),
7106677ce1SPaolo Bonzini               if_false: files('host-stub.c'))
7206677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_ALL', if_true: files('host-stub.c'))
7306677ce1SPaolo Bonzini
7406677ce1SPaolo Bonzinisoftmmu_ss.add(when: ['CONFIG_USB', 'CONFIG_XEN', libusb], if_true: files('xen-usb.c'))
7506677ce1SPaolo Bonzini
7606677ce1SPaolo Bonzinimodules += { 'hw-usb': hw_usb_modules }
77