Changes between Version 9 and Version 10 of uboot


Ignore:
Timestamp:
12/01/2025 07:52:04 PM (4 days ago)
Author:
Tim Harvey
Comment:

added USB ethernet gadget instructions

Legend:

Unmodified
Added
Removed
Modified
  • uboot

    v9 v10  
    704704
    705705
     706[=#ethgadget]
     707==== USB Ethernet Gadget
     708The USB ethernet gadget support allows you to use a USB connection to a host PC as an ethernet device and can be very handy if you are on a board that lacks an ethernet jack.
     709
     710For this support you must have the 'usb_ether' driver enabled (CONFIG_USB_ETHER) and use the bind command (CONFIG_CMD_BIND) to bind it to a USB host that supports dual-role. The binding of the driver requires you to know the device-tree path of the host.
     711
     712This is enabled on the Venice bootloaders and can be used as such on boards that have a dual role controller with a USB OTG or Type-C connector:
     713 - IMX8MM boards (GW71xx/GW72xx/GW73xx/GW74xx):
     714{{{#!bash
     715bind /soc@0/bus@32c00000/usb@32e40000 usb_ether && setenv ethact usb@32e40000
     716}}}
     717 - IMX8MP boards (GW71xx/GW72xx/GW73xx/GW74xx):
     718{{{#!bash
     719bind /soc@0/usb@32f10100/usb@38100000 usb_ether && setenv ethact usb@38100000
     720}}}
     721
     722After binding the driver a new network interface will be available (named per the dt path above):
     723{{{#!bash
     724setenv ipaddr 10.0.0.2
     725setenv netmask 255.255.255.0
     726ping 10.0.0.1
     727}}}
     728
     729on a connected Linux host PC you will see usb0 enumerate and can do a 'sudo ifconfig usb0 10.0.0.1' at which point the ping will complete. Note that the USB device will not enumerate on the host PC until you use a network operation in U-Boot therefore you are likely best configuring your host PC for a static IP upon device recognition so the uboot operations do not time out while you are setting up your network with something like:
     730{{{#!bash
     731cat << EOF > /etc/udev/rules.d/70-usb-ethernet.rules
     732SUBSYSTEM=="net", ACTION=="add", ATTR{idVendor}=="0525", ATTR{idProduct}=="a4a5", NAME="eth_usb"
     733EOF
     734udevadm control --reload-rules
     735udevadm trigger
     736cat << EOF >> /etc/network/interfaces
     737auto eth1
     738iface eth1 inet static
     739   address 10.0.0.1
     740   netmask 255.255.255.0
     741EOF
     742}}}
     743
     744
    706745[=#gadgetums]
    707746==== USB Mass Storage (UMS) Gadget
     
    714753 * expose mmc device 0 on USB host controller 0 as a USB Mass Storage device:
    715754{{{#!bash
    716 usb start && ums 0 mmc 0
     755ums 0 mmc 0
    717756}}}
    718757