diff options
Diffstat (limited to 'recipes-support/libusbgx/files')
-rw-r--r-- | recipes-support/libusbgx/files/apalis-imx6/g1.schema | 68 | ||||
-rw-r--r-- | recipes-support/libusbgx/files/colibri-imx6/g1.schema | 68 | ||||
-rw-r--r-- | recipes-support/libusbgx/files/colibri-imx7/g1.schema | 68 | ||||
-rw-r--r-- | recipes-support/libusbgx/files/colibri-vf/g1.schema | 68 | ||||
-rw-r--r-- | recipes-support/libusbgx/files/usbg.service | 17 |
5 files changed, 289 insertions, 0 deletions
diff --git a/recipes-support/libusbgx/files/apalis-imx6/g1.schema b/recipes-support/libusbgx/files/apalis-imx6/g1.schema new file mode 100644 index 0000000..c09d478 --- /dev/null +++ b/recipes-support/libusbgx/files/apalis-imx6/g1.schema @@ -0,0 +1,68 @@ +attrs : +{ + bcdUSB = 0x200; + bDeviceClass = 0x2; + bDeviceSubClass = 0x0; + bDeviceProtocol = 0x0; + bMaxPacketSize0 = 0x40; + idVendor = 0x1D6B; + idProduct = 0x104; + bcdDevice = 0x401; +}; +os_descs : +{ + config = "c_1"; + use = 1; + qw_sign = "MSFT100"; + b_vendor_code = 0xCD; +}; +strings = ( + { + lang = 0x409; + manufacturer = "Toradex"; + product = "Toradex Apalis iMX6"; + serialnumber = "00000000"; + } ); +functions : +{ + rndis_usb0 : + { + instance = "usb0"; + type = "rndis"; + attrs : + { + dev_addr = "00:14:2d:ff:ff:ff"; + host_addr = "00:14:2d:ff:ff:fe"; + qmult = 5; + }; + os_descs = ( + { + interface = "rndis"; + compatible_id = "RNDIS"; + sub_compatible_id = "5162001"; + } ); + }; +}; +configs : +{ + c_1 : + { + id = 1; + name = "c"; + attrs : + { + bmAttributes = 0xC0; + bMaxPower = 0x1; + }; + strings = ( + { + lang = 0x409; + configuration = "RNDIS"; + } ); + functions = ( + { + name = "rndis.usb0"; + function = "rndis_usb0"; + } ); + }; +}; diff --git a/recipes-support/libusbgx/files/colibri-imx6/g1.schema b/recipes-support/libusbgx/files/colibri-imx6/g1.schema new file mode 100644 index 0000000..eda33be --- /dev/null +++ b/recipes-support/libusbgx/files/colibri-imx6/g1.schema @@ -0,0 +1,68 @@ +attrs : +{ + bcdUSB = 0x200; + bDeviceClass = 0x2; + bDeviceSubClass = 0x0; + bDeviceProtocol = 0x0; + bMaxPacketSize0 = 0x40; + idVendor = 0x1D6B; + idProduct = 0x104; + bcdDevice = 0x401; +}; +os_descs : +{ + config = "c_1"; + use = 1; + qw_sign = "MSFT100"; + b_vendor_code = 0xCD; +}; +strings = ( + { + lang = 0x409; + manufacturer = "Toradex"; + product = "Toradex Colibri iMX6"; + serialnumber = "00000000"; + } ); +functions : +{ + rndis_usb0 : + { + instance = "usb0"; + type = "rndis"; + attrs : + { + dev_addr = "00:14:2d:ff:ff:ff"; + host_addr = "00:14:2d:ff:ff:fe"; + qmult = 5; + }; + os_descs = ( + { + interface = "rndis"; + compatible_id = "RNDIS"; + sub_compatible_id = "5162001"; + } ); + }; +}; +configs : +{ + c_1 : + { + id = 1; + name = "c"; + attrs : + { + bmAttributes = 0xC0; + bMaxPower = 0x1; + }; + strings = ( + { + lang = 0x409; + configuration = "RNDIS"; + } ); + functions = ( + { + name = "rndis.usb0"; + function = "rndis_usb0"; + } ); + }; +}; diff --git a/recipes-support/libusbgx/files/colibri-imx7/g1.schema b/recipes-support/libusbgx/files/colibri-imx7/g1.schema new file mode 100644 index 0000000..cbfa505 --- /dev/null +++ b/recipes-support/libusbgx/files/colibri-imx7/g1.schema @@ -0,0 +1,68 @@ +attrs : +{ + bcdUSB = 0x200; + bDeviceClass = 0x2; + bDeviceSubClass = 0x0; + bDeviceProtocol = 0x0; + bMaxPacketSize0 = 0x40; + idVendor = 0x1D6B; + idProduct = 0x104; + bcdDevice = 0x401; +}; +os_descs : +{ + config = "c_1"; + use = 1; + qw_sign = "MSFT100"; + b_vendor_code = 0xCD; +}; +strings = ( + { + lang = 0x409; + manufacturer = "Toradex"; + product = "Toradex Colibri iMX7"; + serialnumber = "00000000"; + } ); +functions : +{ + rndis_usb0 : + { + instance = "usb0"; + type = "rndis"; + attrs : + { + dev_addr = "00:14:2d:ff:ff:ff"; + host_addr = "00:14:2d:ff:ff:fe"; + qmult = 5; + }; + os_descs = ( + { + interface = "rndis"; + compatible_id = "RNDIS"; + sub_compatible_id = "5162001"; + } ); + }; +}; +configs : +{ + c_1 : + { + id = 1; + name = "c"; + attrs : + { + bmAttributes = 0xC0; + bMaxPower = 0x1; + }; + strings = ( + { + lang = 0x409; + configuration = "RNDIS"; + } ); + functions = ( + { + name = "rndis.usb0"; + function = "rndis_usb0"; + } ); + }; +}; diff --git a/recipes-support/libusbgx/files/colibri-vf/g1.schema b/recipes-support/libusbgx/files/colibri-vf/g1.schema new file mode 100644 index 0000000..8f3cff8 --- /dev/null +++ b/recipes-support/libusbgx/files/colibri-vf/g1.schema @@ -0,0 +1,68 @@ +attrs : +{ + bcdUSB = 0x200; + bDeviceClass = 0x2; + bDeviceSubClass = 0x0; + bDeviceProtocol = 0x0; + bMaxPacketSize0 = 0x40; + idVendor = 0x1D6B; + idProduct = 0x104; + bcdDevice = 0x401; +}; +os_descs : +{ + config = "c_1"; + use = 1; + qw_sign = "MSFT100"; + b_vendor_code = 0xCD; +}; +strings = ( + { + lang = 0x409; + manufacturer = "Toradex"; + product = "Toradex Colibri VF50/VF61"; + serialnumber = "00000000"; + } ); +functions : +{ + rndis_usb0 : + { + instance = "usb0"; + type = "rndis"; + attrs : + { + dev_addr = "00:14:2d:ff:ff:ff"; + host_addr = "00:14:2d:ff:ff:fe"; + qmult = 5; + }; + os_descs = ( + { + interface = "rndis"; + compatible_id = "RNDIS"; + sub_compatible_id = "5162001"; + } ); + }; +}; +configs : +{ + c_1 : + { + id = 1; + name = "c"; + attrs : + { + bmAttributes = 0xC0; + bMaxPower = 0x1; + }; + strings = ( + { + lang = 0x409; + configuration = "RNDIS"; + } ); + functions = ( + { + name = "rndis.usb0"; + function = "rndis_usb0"; + } ); + }; +}; diff --git a/recipes-support/libusbgx/files/usbg.service b/recipes-support/libusbgx/files/usbg.service new file mode 100644 index 0000000..a4e6f80 --- /dev/null +++ b/recipes-support/libusbgx/files/usbg.service @@ -0,0 +1,17 @@ +[Unit] +Description=Load default USB gadget schema g1.schema +ConditionPathExists=/etc/usbg/g1.schema +Before=systemd-networkd.service + +[Service] +Type=oneshot +ExecStart=/usr/bin/gadget-import g1 /etc/usbg/g1.schema +ExecStartPost=/bin/sh -c '/bin/echo $((0x4000+$(cat /proc/device-tree/toradex,product-id))) > \ + /sys/kernel/config/usb_gadget/g1/idProduct' +ExecStartPost=/bin/sh -c '/bin/cat /proc/device-tree/serial-number > \ + /sys/kernel/config/usb_gadget/g1/strings/0x409/serialnumber' +ExecStartPost=/bin/sh -c '/bin/echo `ls /sys/class/udc/` > \ + /sys/kernel/config/usb_gadget/g1/UDC' + +[Install] +WantedBy=multi-user.target |