Re: [PATCH v2 5/5] test: x86: add test for uefi usb io
Ahmad Fatoum <[email protected]>
| Newsgroups | org.infradead.lists.barebox |
|---|---|
| Message-ID | <[email protected]> |
Hi, On 8/17/26 10:47 AM, Fabian Pflug wrote: > Check, that the EFI-USB-IO controller will create a USB Network device > in barebox. The device has currently no driver, but is available > nevertheless. Thanks for adding a test! > > Signed-off-by: Fabian Pflug <[email protected]> Reviewed-by: Ahmad Fatoum <[email protected]> Cheers, Ahmad > --- > drivers/usb/host/efi-io-protocol.c | 15 ++++++++++++--- > test/x86/pc@efi_defconfig.yaml | 9 ++++++++- > 2 files changed, 20 insertions(+), 4 deletions(-) > > diff --git a/drivers/usb/host/efi-io-protocol.c b/drivers/usb/host/efi-io-protocol.c > index 8207d33dcf..fdd21f24a0 100644 > --- a/drivers/usb/host/efi-io-protocol.c > +++ b/drivers/usb/host/efi-io-protocol.c > @@ -145,6 +145,16 @@ static int efi_get_usb_string(struct efi_usb_io_protocol *protocol, u16 lang_id, > return 0; > } > > +static void print_usb_device_info(struct device *dev) > +{ > + struct usb_device *usb_dev = container_of(dev, struct usb_device, dev); > + > + dev_info(dev, "Bus %03d Device %03d: ID %04x:%04x %s\n", > + usb_dev->host->busnum, usb_dev->devnum, > + usb_dev->descriptor->idVendor, usb_dev->descriptor->idProduct, > + usb_dev->prod); > +} > + > static int create_usb_device(struct efi_usb_io_priv *priv) > { > struct usb_host *host = &priv->host; > @@ -256,9 +266,8 @@ static int create_usb_device(struct efi_usb_io_priv *priv) > if (err) > goto out_err; > > - dev_info(&dev->dev, "Bus %03d Device %03d: ID %04x:%04x %s\n", > - dev->host->busnum, dev->devnum, dev->descriptor->idVendor, > - dev->descriptor->idProduct, dev->prod); > + print_usb_device_info(&dev->dev); > + devinfo_add(&dev->dev, print_usb_device_info); > > err = register_device(&dev->dev); > if (err) { > diff --git a/test/x86/pc@efi_defconfig.yaml b/test/x86/pc@efi_defconfig.yaml > index 2c077d5509..4feabb232d 100644 > --- a/test/x86/pc@efi_defconfig.yaml > +++ b/test/x86/pc@efi_defconfig.yaml > @@ -8,7 +8,11 @@ targets: > memory: 1024M > kernel: barebox.efi > display: qemu-default > - extra_args: '-bios OVMF.fd' > + extra_args: > > + -bios OVMF.fd > + -device qemu-xhci,id=xhci > + -device usb-net,netdev=usb0,bus=xhci.0 > + -netdev user,id=usb0 > BareboxDriver: > prompt: 'barebox@[^:]+:[^ ]+ ' > bootstring: 'commandline:' > @@ -16,6 +20,7 @@ targets: > features: > - pci > devices: > + usb1: 'usb1: Bus 001 Device 000: ID 0525:a4a2 RNDIS/QEMU USB Network Device' > fb0: 'Type: primary' > fbconsole0: 'Parent: fb0' > wdog0: 'Parent: efi-wdt' > @@ -25,6 +30,8 @@ targets: > acpi-APIC0: 'Signature: APIC (Multiple APIC Description Table)' > runner: > kconfig_add: > + - CONFIG_USB_HOST=y > + - CONFIG_USB_EFI_IO_PROTOCOL=y > - CONFIG_DRIVER_SERIAL_NS16550=y > - CONFIG_CONSOLE_ACTIVATE_FIRST=y # avoid duplicate output > images: > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |