enable rndis and usb direct mode for v2

This commit is contained in:
Alfonso Gamboa
2022-05-25 23:50:50 -07:00
parent 363985a7bb
commit 0b4f7edf6e
2 changed files with 17 additions and 10 deletions

View File

@@ -210,14 +210,22 @@ fi
if [[ "$ENABLE_USB_DIRECT" == "true" ]]; then
#Set dwc2 ID_PIN driver memory
devmem 0x13500000 32 0x001100cc
devmem 0x10000040 32 0x0b000096
#wipe the bits to set the ID_PIN
devmem 0x10000040 32 0x0b000FFF
host_macaddr=$(echo $HOSTNAME|md5sum|sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/')
if [[ "$V2" == "true" ]]; then
echo connect > /sys/devices/platform/jz-dwc2/dwc2/udc/dwc2/soft_connect
sleep 1
devmem 0x10000040 32 0x0b800096
sleep 1
devmem 0x13500000 32 0x001100cc
else
#Set dwc2 ID_PIN driver memory
devmem 0x13500000 32 0x001100cc
devmem 0x10000040 32 0x0b000096
#wipe the bits to set the ID_PIN, only for the V3.
devmem 0x10000040 32 0x0b000FFF
fi
if [[ "$V2" == "false" ]]; then
insmod /opt/wz_mini/lib/modules/3.10.14__isvp_swan_1.0__/kernel/drivers/usb/gadget/u_ether.ko
insmod /opt/wz_mini/lib/modules/3.10.14__isvp_swan_1.0__/kernel/drivers/usb/gadget/usb_f_ncm.ko