summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Protsenko2018-01-12 17:02:01 -0600
committerPraneeth Bajjuri2018-01-12 17:02:32 -0600
commit626cf2cc64beca480fe6238f613f6d9d7b9bd781 (patch)
tree1f1131910842427f0e09614e36c8e71573ef5169
parenta07158ca417cca2b7d02d8a779e0748d213aa502 (diff)
downloaddevice-ti-am57xevm-d-oreo-r6-core-k49-release.tar.gz
device-ti-am57xevm-d-oreo-r6-core-k49-release.tar.xz
device-ti-am57xevm-d-oreo-r6-core-k49-release.zip
am57xevm: Sync USB init script with Hikeyd-oreo-r6-core-released-oreo-r6-core-k49-release
Sync USB init script with Hikey init.common.usb.rc. This patch fixes ADB (when using Android-O with kernel v4.9). Next changes are made: - Add sys.usb.ffs.mtp.ready=1 related changes from Hikey file ("Switch to FunctionFS userspace interface" patch) - Read UDC from /sys/class/udc/ at runtime (remove setting sys.usb.controller property manually, it's already done at runtime) - Remove "on adbd=stopped" trigger: it's already done in system/core/rootdir/init.usb.configfs.rc file Note that there is no need to revert this kernel patch anymore: usb: gadget: f_fs: Fix wrong check on reserved1 of OS_DESC_EXT_COMPAT That was a very old bug related to USB os_desc and fixed in AOSP since then. USB Gadgets are working fine on Android-O with v4.9 kernel now. Change-Id: Ic726e6989633661a8af75b24234caae299c4839e Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
-rw-r--r--init.am57xevmboard.usb.rc55
1 files changed, 25 insertions, 30 deletions
diff --git a/init.am57xevmboard.usb.rc b/init.am57xevmboard.usb.rc
index 501f2ab..7e1e068 100644
--- a/init.am57xevmboard.usb.rc
+++ b/init.am57xevmboard.usb.rc
@@ -1,56 +1,51 @@
1on boot 1on boot
2 mount configfs none /config 2 mount configfs none /config
3 mkdir /config/usb_gadget/g1 0770 shell shell 3 mkdir /config/usb_gadget/g1 0770 shell shell
4 write /config/usb_gadget/g1/idVendor 0x0451
5 write /config/usb_gadget/g1/idProduct 0xD101
6 mkdir /config/usb_gadget/g1/strings/0x409 0770 shell shell 4 mkdir /config/usb_gadget/g1/strings/0x409 0770 shell shell
5 write /config/usb_gadget/g1/bcdUSB 0x0200
6 write /config/usb_gadget/g1/idVendor 0x0451
7 write /config/usb_gadget/g1/bcdDevice 0x0223
8 write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno}
7 write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer} 9 write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer}
8 write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model} 10 write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model}
9 write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno} 11 mkdir /config/usb_gadget/g1/functions/ffs.adb
12 mkdir /config/usb_gadget/g1/functions/ffs.mtp
10 mkdir /config/usb_gadget/g1/configs/b.1 0770 shell shell 13 mkdir /config/usb_gadget/g1/configs/b.1 0770 shell shell
11 mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell 14 mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell
12 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "Conf 1" 15 write /config/usb_gadget/g1/os_desc/b_vendor_code 0x1
16 write /config/usb_gadget/g1/os_desc/qw_sign "MSFT100"
13 write /config/usb_gadget/g1/configs/b.1/MaxPower 120 17 write /config/usb_gadget/g1/configs/b.1/MaxPower 120
14 18 mkdir /dev/usb-ffs 0775 shell shell
15 # Create adb+ffs gadget function
16 mkdir /config/usb_gadget/g1/functions/ffs.adb 0770 shell shell
17 mkdir /dev/usb-ffs 0770 shell shell
18 mkdir /dev/usb-ffs/adb 0770 shell shell 19 mkdir /dev/usb-ffs/adb 0770 shell shell
19 mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000 20 mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000
20 21 mkdir /dev/usb-ffs/mtp 0770 mtp mtp
21 # Create MTP and PTP functions 22 mount functionfs mtp /dev/usb-ffs/mtp rmode=0770,fmode=0660,uid=1024,gid=1024,no_disconnect=1
22 mkdir /config/usb_gadget/g1/functions/mtp.gs0 0770 shell shell 23 setprop sys.usb.mtp.device_type 3
23 mkdir /config/usb_gadget/g1/functions/ptp.gs1 0770 shell shell
24
25 setprop sys.usb.controller 488d0000.usb
26 setprop sys.usb.configfs 1 24 setprop sys.usb.configfs 1
25 symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1
27 26
28on property:sys.usb.config=none && property:sys.usb.configfs=1 27on property:sys.usb.config=none && property:sys.usb.configfs=1
29 write /config/usb_gadget/g1/os_desc/use 0 28 write /config/usb_gadget/g1/os_desc/use 0
30 setprop sys.usb.ffs.ready 0
31 29
32on property:init.svc.adbd=stopped 30on property:sys.usb.ffs.mtp.ready=1 && property:sys.usb.config=mtp && property:sys.usb.configfs=1
33 setprop sys.usb.ffs.ready 0
34
35on property:sys.usb.config=mtp && property:sys.usb.configfs=1
36 write /config/usb_gadget/g1/functions/mtp.gs0/os_desc/interface.MTP/compatible_id "MTP"
37 write /config/usb_gadget/g1/os_desc/use 1
38 write /config/usb_gadget/g1/idProduct 0xD108 31 write /config/usb_gadget/g1/idProduct 0xD108
32 write /config/usb_gadget/g1/os_desc/use 1
33 symlink /config/usb_gadget/g1/functions/ffs.mtp /config/usb_gadget/g1/configs/b.1/f1
39 34
40on property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1 35on property:sys.usb.ffs.ready=1 && property:sys.usb.ffs.mtp.ready=1 && property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1
41 write /config/usb_gadget/g1/functions/mtp.gs0/os_desc/interface.MTP/compatible_id "MTP"
42# write /config/usb_gadget/g1/os_desc/use 1
43 write /config/usb_gadget/g1/idProduct 0xD109 36 write /config/usb_gadget/g1/idProduct 0xD109
44
45on property:sys.usb.config=ptp && property:sys.usb.configfs=1
46 write /config/usb_gadget/g1/functions/ptp.gs1/os_desc/interface.MTP/compatible_id "PTP"
47 write /config/usb_gadget/g1/os_desc/use 1 37 write /config/usb_gadget/g1/os_desc/use 1
48 write /config/usb_gadget/g1/idProduct 0xD10D 38 symlink /config/usb_gadget/g1/functions/ffs.mtp /config/usb_gadget/g1/configs/b.1/f1
49 39
50on property:sys.usb.config=ptp,adb && property:sys.usb.configfs=1 40on property:sys.usb.ffs.mtp.ready=1 && property:sys.usb.config=ptp && property:sys.usb.configfs=1
51 write /config/usb_gadget/g1/functions/ptp.gs1/os_desc/interface.MTP/compatible_id "PTP" 41 write /config/usb_gadget/g1/idProduct 0xD10D
52 write /config/usb_gadget/g1/os_desc/use 1 42 write /config/usb_gadget/g1/os_desc/use 1
43 symlink /config/usb_gadget/g1/functions/ffs.mtp /config/usb_gadget/g1/configs/b.1/f1
44
45on property:sys.usb.ffs.ready=1 && property:sys.usb.ffs.mtp.ready=1 && property:sys.usb.config=ptp,adb && property:sys.usb.configfs=1
53 write /config/usb_gadget/g1/idProduct 0xD10E 46 write /config/usb_gadget/g1/idProduct 0xD10E
47 write /config/usb_gadget/g1/os_desc/use 1
48 symlink /config/usb_gadget/g1/functions/ffs.mtp /config/usb_gadget/g1/configs/b.1/f1
54 49
55on property:sys.usb.config=adb && property:sys.usb.configfs=1 50on property:sys.usb.config=adb && property:sys.usb.configfs=1
56 write /config/usb_gadget/g1/idProduct 0xD101 51 write /config/usb_gadget/g1/idProduct 0xD101