USB0/USB1 and gadget

I need some help understanding how usb0 and usb1 are configured for usb gadget. My source of confusion is the fact that the physical USB0 port has two network interfaces associated with it. I have, I think, created a device tree overlay for the BBB that converts the physical USB1 port into a peripheral instead of a host. Now, I want to configure a network interface for the physical USB1, which is not the same as the current usb1, and I don’t know how to do that. Where does usb0/usb1 get defined and associated with a physical port?

For posterity, I’m going to answer some of my own question. am335x_evm.sh sets up the gadget for physical USB0 with the line “echo musb-hdrc.0 > UDC”. The /sys/class/udc directory lists the USB port names – I have musb-hdrc.0 and musb-hdrc.1.

There may be other useful resources, but this gives some info on configuration: Modern USB gadget on Linux & how to integrate it with systemd (Part 1)