hi all,
I read the other topic about "Banana Pi USB OTG" in preparation of trying to enable USB OTG (device mode actually) on a Banana Pi M2 (A31s). When my Pi arrived yesterday, I performed the following steps:
downloaded latest Jessie Vanilla image from http://www.armbian.com/banana-pi-m2/, burned to SD, installed (without any problems)
ran apt-get update & upgrade
I now have "uname -r" -> "4.4.1-sunxi", and "dpkg -l" lists "linux-*-next-sunxi" (*=dtb|firmware|headers|image) in version 5.01.
I was happy to find that the g_* kernel modules were present (with the exception of g_zero), but
root@bananapim2:~# modprobe g_hid
modprobe: ERROR: could not insert 'g_hid': No such device
OK, so i checked the Device Tree file /boot/dtb/sun6i-a31s-sinovoip-bpi-m2.dtb
To decompile it, I ran:
dtc -I dtb sun6i-a31s-sinovoip-bpi-m2.dtb -O dts -o sun6i-a31s-sinovoip-bpi-m2.dts
When checking the DTS file, i found the musb controller, which was disabled:
usb@01c19000 {
compatible = "allwinner,sun6i-a31-musb";
reg = <0x1c19000 0x400>;
clocks = <0x10 0x18>;
resets = <0x11 0x18>;
interrupts = <0x0 0x47 0x4>;
interrupt-names = "mc";
phys = <0x1d 0x0>;
phy-names = "usb";
extcon = <0x1d 0x0>;
status = "disabled";
};
So I changed the "disabled" into "okay" and added dr_mode="otg" to the DTS:
usb@01c19000 {
compatible = "allwinner,sun6i-a31-musb";
reg = <0x1c19000 0x400>;
clocks = <0x10 0x18>;
resets = <0x11 0x18>;
interrupts = <0x0 0x47 0x4>;
interrupt-names = "mc";
phys = <0x1d 0x0>;
phy-names = "usb";
extcon = <0x1d 0x0>;
dr_mode = "otg";
status = "okay";
};
Then i compiled it back into the DTB file:
dtc -I dts sun6i-a31s-sinovoip-bpi-m2.dts -O dtb -o sun6i-a31s-sinovoip-bpi-m2.dtb
After a reboot, the modprobe problem is still there. Also in dmesg, nothing shows up about musb:
root@bananapim2:/boot/dtb# dmesg | grep "usb"
[ 3.203261] usbcore: registered new interface driver usbfs
[ 3.203316] usbcore: registered new interface driver hub
[ 3.203380] usbcore: registered new device driver usb
[ 3.388457] ehci-platform 1c1a000.usb: EHCI Host Controller
[ 3.388487] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[ 3.388738] ehci-platform 1c1a000.usb: irq 31, io mem 0x01c1a000
[ 3.404952] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[ 3.405229] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 3.405241] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 3.405250] usb usb1: Product: EHCI Host Controller
[ 3.405259] usb usb1: Manufacturer: Linux 4.4.1-sunxi ehci_hcd
[ 3.405267] usb usb1: SerialNumber: 1c1a000.usb
[ 3.406519] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[ 3.406544] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 2
[ 3.406657] ohci-platform 1c1a400.usb: irq 32, io mem 0x01c1a400
[ 3.469165] usb usb2: New USB device found, idVendor=1d6b, idProduct=0001
[ 3.469177] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 3.469185] usb usb2: Product: Generic Platform OHCI controller
[ 3.469194] usb usb2: Manufacturer: Linux 4.4.1-sunxi ohci_hcd
[ 3.469202] usb usb2: SerialNumber: 1c1a400.usb
[ 3.470269] usbcore: registered new interface driver usb-storage
[ 3.506676] usbcore: registered new interface driver usbhid
[ 3.506682] usbhid: USB HID core driver
[ 3.724966] usb 1-1: new high-speed USB device number 2 using ehci-platform
[ 3.875545] usb 1-1: New USB device found, idVendor=1a40, idProduct=0101
[ 3.875558] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[ 3.875567] usb 1-1: Product: USB 2.0 Hub
[ 4.174962] usb 1-1.3: new low-speed USB device number 3 using ehci-platform
[ 4.314881] usb 1-1.3: New USB device found, idVendor=046a, idProduct=0011
[ 4.314902] usb 1-1.3: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 4.327046] input: HID 046a:0011 as /devices/platform/soc@01c00000/1c1a000.usb/usb1/1-1/1-1.3/1-1.3:1.0/0003:046A:0011.0001/input/input0
[ 4.385300] hid-generic 0003:046A:0011.0001: input,hidraw0: USB HID v1.11 Keyboard [HID 046a:0011] on usb-1c1a000.usb-1.3/input0
So is musb currently still disabled for a reason on BPi-M2 (Igor mentioned such in the other thread in March) ? Or am I doing something wrong?
Hardware setup wise, I just connected the microUSB to my notebooks A port (power seems sufficient) using a normal cable.
Ah yeah, and big thanks Igor for this awesome distro and the community for bringing insight about usb OTG mode.
regards,
Paul