[EDIT] Neo2 only 2 USB ports working (female A and "USB2" pin header)


Recommended Posts

I'm testing the nightly image: Armbian_5.32.170704_Nanopineo2_Ubuntu_xenial_dev_4.11.8.img

 

I've soldered 2x female A USB ports to the NanoPi Neo2 as per the pinout

http://wiki.friendlyarm.com/wiki/index.php/NanoPi_NEO2#Diagram.2C_Layout_and_Dimension

 

When I plugged in wifi dongles or USB flash drives, their light comes on, but I get nothing on lsusb and dmesg.

Then I realized I had D+ and D- reversed, so I swapped them for each port, but there's still absolutely nothing when connecting devices to these ports.

(I know that having D+ and D- swapped doesn't cause any damage)

 

Do I need to somehow enable the USB ports in a fex file or in the kernel etc?

Link to post
Share on other sites
Donate and support the project!

Thanks for the quick reply Igor, amazing.

 

I found /boot/dtb/allwinner/overlay

sun50i-h5-usbhost0.dtbo

sun50i-h5-usbhost2.dtbo

sun50i-h5-usbhost3.dtbo

 

These 3 files are all in binary format.

 

Any more hints will be appreciated.

Is there a similar board I can look at for an example?

 

I'm busy working through the link you gave

 

I've read through /boot/dtb/allwinner/overlay/README.sun50i-h5-overlays but just mentions the above 3 usb host ports (a bit strange because the h5 has at least 4 usb ports that I know of) ... unless the microUSB port is not included in these.

Link to post
Share on other sites

Thanks,

 

I added

overlays=usbhost0 usbhost2 usbhost3

to /boot/armbianEnv.txt so it looks like this

verbosity=1
console=both
overlay_prefix=sun50i-h5
rootdev=UUID=c9cfe2c8-bfa6-421a-badc-4e58e9288de2
rootfstype=ext4
overlays=usbhost0 usbhost2 usbhost3

And uboot showed

U-boot loaded from SD
Boot script loaded from mmc
152 bytes read in 151 ms (1000 Bytes/s)
24232 bytes read in 354 ms (66.4 KiB/s)
385 bytes read in 407 ms (0 Bytes/s)
Applying kernel provided DT overlay sun50i-h5-usbhost0.dtbo
385 bytes read in 399 ms (0 Bytes/s)
Applying kernel provided DT overlay sun50i-h5-usbhost2.dtbo
385 bytes read in 390 ms (0 Bytes/s)
Applying kernel provided DT overlay sun50i-h5-usbhost3.dtbo
4179 bytes read in 369 ms (10.7 KiB/s)
Applying kernel provided DT fixup script (sun50i-h5-fixup.scr)
## Executing script at 44000000
5001817 bytes read in 440 ms (10.8 MiB/s)
12285960 bytes read in 869 ms (13.5 MiB/s)
## Loading init Ramdisk from Legacy Image at 4fe00000 ...

And now when I plugin USB devices into the female USB A cables I've soldered to the PCB as per

http://wiki.friendlyarm.com/wiki/index.php/NanoPi_NEO2#Diagram.2C_Layout_and_Dimension

to the port labelled "USB1" I get nothing, but for the port labelled "USB2" I get

[  156.201286] usb 5-1: device descriptor read/64, error -62
[  156.497302] usb 5-1: device descriptor read/64, error -62
[  156.973314] usb 5-1: device descriptor read/64, error -62
[  157.269327] usb 5-1: device descriptor read/64, error -62
[  157.977369] usb 5-1: device not accepting address 20, error -62
[  158.577391] usb 5-1: device not accepting address 21, error -62
[  158.583375] usb usb5-port1: unable to enumerate USB device

So at least there are signs of life for one USB port.

I'm going to check my solder joints again.

 

====


microUSB port didn't work

When powering the NanoPi2 via the UART 5v line from USB (it was a bit underpowered, voltage sagged down to 4.64)
I plugged a (tested working) USB OTG cable into the microUSB and nothing I connected showed up in dmesg.

(for all other tests, the board was powered with 2A microUSB)

The "USB1" (as shown in the pinout diagram) headers were unresponsive in all cases.

 

How to know that your D+ and D- are backwards
I noticed my soldering had left a bit of flux behind on the board, after scratching it off I got a different error in dmesg

[  115.875561] usb 5-1: new low-speed USB device number 2 using ohci-platform
[  116.059563] usb 5-1: device descriptor read/64, error -62
[  116.355565] usb 5-1: device descriptor read/64, error -62
[  116.647578] usb 5-1: new low-speed USB device number 3 using ohci-platform
[  116.831581] usb 5-1: device descriptor read/64, error -62
[  117.127593] usb 5-1: device descriptor read/64, error -62
[  117.419605] usb 5-1: new low-speed USB device number 4 using ohci-platform
[  117.835618] usb 5-1: device not accepting address 4, error -62
[  118.019628] usb 5-1: new low-speed USB device number 5 using ohci-platform
[  118.435638] usb 5-1: device not accepting address 5, error -62
[  118.441516] usb usb5-port1: unable to enumerate USB device

Then I swapped D+ and D- and the "USB2" port worked!

Having 2 working USB ports is enough progress for me, for now. I'm going to leave this issue as is for now.

 

====

 

BTW I also found that with a 5 meter USB extension cable and a hub on the end of it, I couldn't connect 2 wifi adapters to the female USB A port. But if I connect the hub directly to the port I can connect 2 wifi adapters.

Link to post
Share on other sites

@Lope did wrote:

I found /boot/dtb/allwinner/overlay
sun50i-h5-usbhost0.dtbo
sun50i-h5-usbhost2.dtbo
sun50i-h5-usbhost3.dtbo

I've read through /boot/dtb/allwinner/overlay/README.sun50i-h5-overlays but just mentions 
the above 3 usb host ports (a bit strange because the h5 has at least 4 usb ports 
that I know of) ... unless the microUSB port is not included in these.

The "USB1" (as shown in the pinout diagram) headers were unresponsive in all cases.

@Igor at https://github.com/armbian/sunxi-DT-overlays/tree/master/sun50i-h5 is stated that there could be also a sun50i-h5-usbhost1

but at this page are only .dts files.
Do you know where I could find the sun50i-h5-usbhost1.dtbo (isnt in /boot/dtb/allwinner/overlay) because at the NAS Station from FriendlyARM there is in the front a USB Port which doenst seems to be activated) and I think this could the the USB1-Port.

 

FriendlyARM has a Neo2 NAS Image ( http://www.mediafire.com/file/sgdbfv004jihb6e/nanopi-neo2_debian-nas-jessie_4.11.2_20170904.img.zip ) , but it seems that there all dtb's in one:
sun50i-h5-nanopi-neo2.dtb
because inside the binary I could see as ASCI usb0 usb1 usb2 and usb3

Link to post
Share on other sites

I did a binary compare to the file 

sun50i-h5-usbhost0.dtbo  <==> sun50i-h5-usbhost2.dtbo  and

sun50i-h5-usbhost0.dtbo  <==> sun50i-h5-usbhost3.dtbo

with diff -y <(sun50i-h5-usbhost0.dtbo) <(sun50i-h5-usbhost2.dtbo) | colordiff

and they did differ only 2 times in the file with the current usb-number.

 

So I did create (with a hex-editor)  a file with USB1 = sun50i-h5-usbhost1.dtbo

copied this over to the Neo2 and added it to the /boot/armbianEnv.txt

 

In the serial log I did see that u-boot is accessing the new file, but the Neo2 doesnt recognize the USB-Gadgets on this port :(

Devices now get power at this port - but not more signs of life....

 

Scanning mmc 0:1...
Found U-Boot script /boot/boot.scr
3100 bytes read in 220 ms (13.7 KiB/s)
## Executing script at 4fc00000
U-boot loaded from SD
Boot script loaded from mmc
210 bytes read in 191 ms (1000 Bytes/s)
28577 bytes read in 471 ms (58.6 KiB/s)
504 bytes read in 473 ms (1000 Bytes/s)
Applying kernel provided DT overlay sun50i-h5-usbhost0.dtbo
504 bytes read in 699 ms (0 Bytes/s)
Applying kernel provided DT overlay sun50i-h5-usbhost1.dtbo
504 bytes read in 464 ms (1000 Bytes/s)
Applying kernel provided DT overlay sun50i-h5-usbhost2.dtbo
504 bytes read in 456 ms (1000 Bytes/s)
Applying kernel provided DT overlay sun50i-h5-usbhost3.dtbo
4179 bytes read in 436 ms (8.8 KiB/s)
Applying kernel provided DT fixup script (sun50i-h5-fixup.scr)
## Executing script at 44000000
5258115 bytes read in 504 ms (9.9 MiB/s)
12957704 bytes read in 942 ms (13.1 MiB/s)
## Loading init Ramdisk from Legacy Image at 4fe00000 ...
root@nanoneo2:/boot/dtb-4.13.9-sunxi64/allwinner/overlay# diff -y <(xxd sun50i-h5-usbhost0.dtbo) <(xxd sun50i-h5-usbhost2.dtbo) | colordiff

sun50i-h5-usbhost0.dtbo  <==> sun50i-h5-usbhost2.dtbo
000001e0: 6174 7573 0075 7362 7068 7900 6568 6369  atus.usbph   000001e0: 6174 7573 0075 7362 7068 7900 6568 6369  atus.usbph
000001f0: 3000 6f68 6369 3000                      0.ohci0.   | 000001f0: 3200 6f68 6369 3200                      2.ohci2.

sun50i-h5-usbhost0.dtbo  <==> sun50i-h5-usbhost3.dtbo
000001e0: 6174 7573 0075 7362 7068 7900 6568 6369  atus.usbph   000001e0: 6174 7573 0075 7362 7068 7900 6568 6369  atus.usbph
000001f0: 3000 6f68 6369 3000                      0.ohci0.   | 000001f0: 3300 6f68 6369 3300                      3.ohci3.

 

sun50i-h5-usbhost1.dtbo

Link to post
Share on other sites

to check that my Neo2 hardware isnt defective - I did try the NAS Image from FriendlyARM/-Elec and the right USB Port in the Front does work with their image....

 

With their image debian is counting 9 usb-bus:
 

[    0.024594] usbcore: registered new interface driver usbfs
[    0.024630] usbcore: registered new interface driver hub
[    0.024686] usbcore: registered new device driver usb
[    1.340478] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.352368] ehci-platform 1c1a000.usb: EHCI Host Controller
[    1.357959] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[    1.366055] ehci-platform 1c1a000.usb: irq 11, io mem 0x01c1a000
[    1.386236] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[    1.392984] hub 1-0:1.0: USB hub found
[    1.401229] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.412794] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[    1.419426] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 2
[    1.427348] ohci-platform 1c1a400.usb: irq 12, io mem 0x01c1a400
[    1.494797] hub 2-0:1.0: USB hub found
[    1.503044] usbcore: registered new interface driver uas
[    1.508432] usbcore: registered new interface driver usb-storage
[    1.650596] usbcore: registered new interface driver usbhid
[    1.656179] usbhid: USB HID core driver
[    1.961907] ehci-platform 1c1b000.usb: EHCI Host Controller
[    1.967512] ehci-platform 1c1b000.usb: new USB bus registered, assigned bus number 3
[    1.975507] ehci-platform 1c1b000.usb: irq 13, io mem 0x01c1b000
[    1.994232] ehci-platform 1c1b000.usb: USB 2.0 started, EHCI 1.00
[    2.000969] hub 3-0:1.0: USB hub found
[    2.009173] ehci-platform 1c1c000.usb: EHCI Host Controller
[    2.014771] ehci-platform 1c1c000.usb: new USB bus registered, assigned bus number 4
[    2.022702] ehci-platform 1c1c000.usb: irq 15, io mem 0x01c1c000
[    2.042241] ehci-platform 1c1c000.usb: USB 2.0 started, EHCI 1.00
[    2.048826] hub 4-0:1.0: USB hub found
[    2.056986] ehci-platform 1c1d000.usb: EHCI Host Controller
[    2.062575] ehci-platform 1c1d000.usb: new USB bus registered, assigned bus number 5
[    2.070487] ehci-platform 1c1d000.usb: irq 17, io mem 0x01c1d000
[    2.090240] ehci-platform 1c1d000.usb: USB 2.0 started, EHCI 1.00
[    2.090737] hub 5-0:1.0: USB hub found
[    2.091197] ohci-platform 1c1b400.usb: Generic Platform OHCI controller
[    2.091213] ohci-platform 1c1b400.usb: new USB bus registered, assigned bus number 6
[    2.091337] ohci-platform 1c1b400.usb: irq 14, io mem 0x01c1b400
[    2.154723] hub 6-0:1.0: USB hub found
[    2.162889] ohci-platform 1c1c400.usb: Generic Platform OHCI controller
[    2.169520] ohci-platform 1c1c400.usb: new USB bus registered, assigned bus number 7
[    2.177389] ohci-platform 1c1c400.usb: irq 16, io mem 0x01c1c400
[    2.246741] hub 7-0:1.0: USB hub found
[    2.254900] ohci-platform 1c1d400.usb: Generic Platform OHCI controller
[    2.261533] ohci-platform 1c1d400.usb: new USB bus registered, assigned bus number 8
[    2.269425] ohci-platform 1c1d400.usb: irq 18, io mem 0x01c1d400
[    2.334244] usb 3-1: new high-speed USB device number 2 using ehci-platform
[    2.345763] hub 8-0:1.0: USB hub found
[    2.354028] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[    2.364988] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    2.370746] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 9
[    2.379112] hub 9-0:1.0: USB hub found
[    2.405776] usb0-vbus: disabling

root@FriendlyELEC:/mnt/harddisc/SMB_DATA_SHARE# lsusb
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 152d:0578 JMicron Technology Corp. / JMicron USA Technology Corp.
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 090c:1000 Silicon Motion, Inc. - Taiwan (formerly Feiya Technology Corp.) Flash Drive
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 009 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

and with armbian we do "only" count 7 of 9 usb-bus:

[    0.000000] Kernel command line: root=UUID=27557920-6eb8-4277-8ed1-d112daa16d02 rootwait rootfstype=ext4 console=tty1 console=ttyS0,115200 panic=10 consoleblank=0 loglevel=1 ubootpart=28528764-01 usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u   cgroup_enable=memory swapaccount=1
[    1.274603] usbcore: registered new interface driver usbfs
[    1.274638] usbcore: registered new interface driver hub
[    1.274689] usbcore: registered new device driver usb
[    1.649961] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.650102] ehci-platform 1c1a000.usb: EHCI Host Controller
[    1.650125] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[    1.650562] ehci-platform 1c1a000.usb: irq 9, io mem 0x01c1a000
[    1.663948] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[    1.664629] hub 1-0:1.0: USB hub found
[    1.665129] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.665287] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[    1.665306] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 2
[    1.665479] ohci-platform 1c1a400.usb: irq 10, io mem 0x01c1a400
[    1.728531] hub 2-0:1.0: USB hub found
[    1.729062] usbcore: registered new interface driver usb-storage
[    1.776909] usbcore: registered new interface driver usbhid
[    1.776912] usbhid: USB HID core driver
[    1.916597] ehci-platform 1c1c000.usb: EHCI Host Controller
[    1.916622] ehci-platform 1c1c000.usb: new USB bus registered, assigned bus number 3
[    1.916839] ehci-platform 1c1c000.usb: irq 11, io mem 0x01c1c000
[    1.931950] ehci-platform 1c1c000.usb: USB 2.0 started, EHCI 1.00
[    1.932477] hub 3-0:1.0: USB hub found
[    1.932942] ehci-platform 1c1d000.usb: EHCI Host Controller
[    1.932959] ehci-platform 1c1d000.usb: new USB bus registered, assigned bus number 4
[    1.933119] ehci-platform 1c1d000.usb: irq 13, io mem 0x01c1d000
[    1.947946] ehci-platform 1c1d000.usb: USB 2.0 started, EHCI 1.00
[    1.948365] hub 4-0:1.0: USB hub found
[    1.948763] ohci-platform 1c1c400.usb: Generic Platform OHCI controller
[    1.948779] ohci-platform 1c1c400.usb: new USB bus registered, assigned bus number 5
[    1.948886] ohci-platform 1c1c400.usb: irq 12, io mem 0x01c1c400
[    2.021642] hub 5-0:1.0: USB hub found
[    2.023259] ohci-platform 1c1d400.usb: Generic Platform OHCI controller
[    2.023301] ohci-platform 1c1d400.usb: new USB bus registered, assigned bus number 6
[    2.023527] ohci-platform 1c1d400.usb: irq 14, io mem 0x01c1d400
[    2.084927] hub 6-0:1.0: USB hub found
[    2.086245] usb0-vbus: disabling
[    2.264017] usb 3-1: new high-speed USB device number 2 using ehci-platform
[    2.557267] usbcore: registered new interface driver uas
[    7.329770] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[    7.330299] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    7.330316] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 7
[    7.331824] hub 7-0:1.0: USB hub found

root@nanoneo2:~# lsusb
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 152d:0578 JMicron Technology Corp. / JMicron USA Technology Corp.
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

 

counting/activating is a bit differnet because on debian (from FriedlyARM) the JMircro HDD controller is on Bus 4, while with armbian the controller  (JMicron JMS567) is connected to Bus 3 (but also device 2)

and musb-hdrc Bus 9 against Bus 7

 

For the HDD mass-storage armbian is using the newer uas-module (USB Attached SCSI) while FriendlyArm is using
libcomposite/g_mass_storage/usb_f_mass_storage.

UAS: http://linux-sunxi.org/USB/UAS

 

 

Link to post
Share on other sites
1 hour ago, tkaiser said:

 

What about using dtc (package device-tree-compiler)? Different count of USB ports is most probably related to usb0 (OTG) not enabled by Armbian while FriendlyELEC's 4.11 kernel added the necessary patches and DT bits)

 

Is usbhost0 <> usb0? As overlay usbhost0 is loaded:
 

Applying kernel provided DT overlay sun50i-h5-usbhost0.dtbo
385 bytes read in 399 ms (0 Bytes/s)
Applying kernel provided DT overlay sun50i-h5-usbhost2.dtbo
385 bytes read in 390 ms (0 Bytes/s)
Applying kernel provided DT overlay sun50i-h5-usbhost3.dtbo
4179 bytes read in 369 ms (10.7 KiB/s)

but not usbhost1 (OTG?)

 

I did take a look at
https://github.com/armbian/sunxi-DT-overlays/tree/master/sun50i-h5   and

https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo2.dts

 

Impotant seems to be the part

&uart0 {
	pinctrl-names = "default";
	pinctrl-0 = <&uart0_pins_a>;
	status = "okay";
};

&usb_otg {
	dr_mode = "otg";
	status = "okay";
};

&usbphy {
	/* USB Type-A port's VBUS is always on */
	usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
	usb0_vbus-supply = <&reg_usb0_vbus>;
	status = "okay";
};

but as I aslo did read otg (or a part) seems alread be enabled because of
 

[    7.330299] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    7.330316] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 7
[    7.331824] hub 7-0:1.0: USB hub found

I have no experience with kernel-baking and patches :(

Link to post
Share on other sites

@guidol nice work.

Don't be afraid of compiling the kernel. I've compiled kernels with modified drivers for x86_64 tons of times, never for ARM but it's just a matter of changing architecture. There must be tons of guides around.

Once you've got the source tree it's a simple matter of finding the source and changing it, then compiling. It's best to cross compile from a fast PC because if you compile on an H5 etc it'll be a lot slower. On a crappy old dual core 2nd gen i7 I compiled the 4.x kernel in about 20 mins.

 

I'd love to have 3/4 USB ports (instead of just 2/4) working but I can't get involved with it at the moment.

Link to post
Share on other sites

Can you post a picture of your wiring etc? Usb ports are differential connections which require non-standard wiring to work reliably.  You might get lucky using breadboard wiring (DuPont wires) but when it's not working do not assume your wiring is good enough...

Link to post
Share on other sites
On 25.9.2017 at 3:32 PM, Lope said:

overlays=usbhost0 usbhost2 usbhost3

The above is what you would do on an Orange Pi Zero or on a NanoPi Duo. On a NEO usb3 is already active so you need

overlays=usbhost1 usbhost2

to get the 2 USB ports on pin headers working. For the Micro USB port please follow discussion here: https://forum.armbian.com/topic/5558-default-overlays/?tab=comments#comment-42525

 

 

 

Link to post
Share on other sites

Today I did a manual compare of the USB-entrys of the dmesg.
Sorting the USB-entrys to EHCI,OHCI and i-mem-address - while ignoring the usb and hub numbers (they just count upwards).
 

And only the follwing was different, what in the other dmesg isnt included armbian <==> friendlyARM:

 

This is only in the friendlyarm dmesg:
 

EHCI Host Controller io mem 0x01c1b000
OHCI controller      io mem 0x01c1b400

but also the chronological sequence is another ("register driver uas" and  "usb0-vbus: disabling") - maybe it isnt the otg? 
and only the sequence loading the drivers gives a different "usb-layout"?

Because in the NAS-schematic

http://wiki.friendlyarm.com/wiki/images/7/7b/SCHEMATIC_1-bay_NAS_Dock_v1.2.pdf

I could only found 2 USB-Ports USB-1-(Plus/Minus) and USB-2-(Plus/Minus)

Also the Neo2 Pin-Out shows me for the Connection to the NAS-Board only 2 USB-Ports and the 
NAS-Board hasnt any additional USB-Chips on the board.

 

This 2 code-snippets are best viewed side-by-side.


armbian:
 

usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb

USB 2.0 EHCI io mem 0x01c1a000
USB 1.0 OHCI io mem 0x01c1a400


usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver usbhid



USB 2.0 EHCI io mem 0x01c1c000
USB 2.0 EHCI io mem 0x01c1d000


USB 1.0 OHCI io mem 0x01c1c400
USB 1.0 OHCI io mem 0x01c1d400

usb0-vbus: disabling


usb 3-1: new high-speed USB device number 2 using ehci-platform

usbcore: registered new interface driver uas

usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto found, using dummy regulator
musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
musb-hdrc musb-hdrc.1.auto: new USB bus registered
USB hub found

and the friendlyarm-image:
 

usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb

USB 2.0 EHCI io mem 0x01c1a000
USB 1.1 OHCI io mem 0x01c1a400

usbcore: registered new interface driver uas
usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver usbhid

USB 2.0 EHCI io mem 0x01c1b000

USB 2.0 EHCI io mem 0x01c1c000
USB 2.0 EHCI io mem 0x01c1d000

USB 1.0 OHCI io mem 0x01c1b400

USB 1.0 OHCI io mem 0x01c1c400
USB 1.0 OHCI io mem 0x01c1d400



usb 3-1: new high-speed USB device number 2 using ehci-platform



usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
musb-hdrc musb-hdrc.1.auto: new USB bus registered
USB hub found

usb0-vbus: disabling

 

NEO2_pinout-02.jpg

Link to post
Share on other sites
1 hour ago, guidol said:

EHCI Host Controller io mem 0x01c1b000

https://github.com/friendlyarm/linux/blob/sunxi-4.11.y/arch/arm/boot/dts/sunxi-h3-h5.dtsi#L281-L290

1 hour ago, guidol said:

OHCI controller io mem 0x01c1b400

https://github.com/friendlyarm/linux/blob/sunxi-4.11.y/arch/arm/boot/dts/sunxi-h3-h5.dtsi#L292-L302

 

That's usb1 and for whatever reasons neither @Lope nor you want to load the respective usbhost1 DT overlay in /boot/armbianEnv.txt.

 

BTW: I hope with latest commit this will be fixed on future Armbian images. 

 

Edit: Though usb1 is disabled in sunxi-h3-h5.dtsi (as requested by sunxi kernel maintainers for reasons I really don't understand) it's enabled by FriendlyELEC in the device DT settings: https://github.com/friendlyarm/linux/blob/sunxi-4.11.y/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo2.dts (and the same can be done using the usbhost1 DT overlay in Armbian)

Link to post
Share on other sites
3 hours ago, tkaiser said:

https://github.com/friendlyarm/linux/blob/sunxi-4.11.y/arch/arm/boot/dts/sunxi-h3-h5.dtsi#L281-L290

https://github.com/friendlyarm/linux/blob/sunxi-4.11.y/arch/arm/boot/dts/sunxi-h3-h5.dtsi#L292-L302

That's usb1 and for whatever reasons neither @Lope nor you want to load the respective usbhost1 DT overlay in /boot/armbianEnv.txt.

 

BTW: I hope with latest commit this will be fixed on future Armbian images. 

 

Edit: Though usb1 is disabled in sunxi-h3-h5.dtsi (as requested by sunxi kernel maintainers for reasons I really don't understand) it's enabled by FriendlyELEC in the device DT settings: https://github.com/friendlyarm/linux/blob/sunxi-4.11.y/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo2.dts (and the same can be done using the usbhost1 DT overlay in Armbian)

yes - the .dtsi files above looks very fine....
I did try usbhost1 via /boot/armbianEnv.txt

Applying kernel provided DT overlay sun50i-h5-usbhost1.dtbo
504 bytes read in 464 ms (1000 Bytes/s)

but without success :(
Would be fun to test the new "latest commit" when they arrive as binary :)

We would see the difference between the sunxi maintainers ans FriendlyELEC..

PS: In near future I will use one Neo2-NAS with armbian and one with FriendlyELEC-Image, because I ordered for my 2nd Neo2 also the NAS-case :)

For the price is a very good countervalue :)

Link to post
Share on other sites
1 hour ago, guidol said:

but without success

 

That's bad. Thanks for reporting. Unfortunately I'm close to clueless wrt the overlay implementation so maybe we get some insights once @zador.blood.stained might look into.

 

1 hour ago, guidol said:

Would be fun to test the new "latest commit" when they arrive as binary

No, that was just adding usbhost1 to armbianEnv.txt so if your manual change followed by a reboot doesn't work the 'fix' is none (or just a preparation)

Link to post
Share on other sites
34 minutes ago, tkaiser said:

Unfortunately I'm close to clueless wrt the overlay implementation so maybe we get some insights once @zador.blood.stained might look into.

Hm. According to schematics Opi Zero+2 H5 doesn't wire USB port 1 anywhere, and Opi PC2 and Prime have USB1 enabled by default.

And since I also don't see anything that would resemble an amrbianmonitor -u support link and a serial console log from u-boot I don't think I have anything I can look into.

 

It is possible to check that overlays are applied correctly in /proc/device-tree and probably somewhere in /sys too.

Link to post
Share on other sites

OPi Zero+2 H5

 

overlays=usbhost2 usbhost3

root@orangepizeroplus2:~# lsusb -t
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
root@orangepizeroplus2:~#

overlays=usbhost1 usbhost2 usbhost3

root@orangepizeroplus2:~# lsusb -t
/:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
root@orangepizeroplus2:~#

Exposed ports seem to work fine for me (used a PC rear panel USB extension bracket)

[  111.555851] usb 2-1: new high-speed USB device number 2 using ehci-platform
[  111.710539] usb-storage 2-1:1.0: USB Mass Storage device detected
[  111.711437] scsi host0: usb-storage 2-1:1.0
[  111.726915] usbcore: registered new interface driver uas
[  113.052187] scsi 0:0:0:0: Direct-Access     JetFlash Transcend 8GB    1100 PQ: 0 ANSI: 6
[  113.053239] sd 0:0:0:0: Attached scsi generic sg0 type 0
[  113.053709] sd 0:0:0:0: [sda] 15425536 512-byte logical blocks: (7.90 GB/7.36 GiB)
[  113.054545] sd 0:0:0:0: [sda] Write Protect is off
[  113.054557] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
[  113.055409] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  113.064741]  sda: sda1
[  113.068921] sd 0:0:0:0: [sda] Attached SCSI removable disk
[  113.227899] BTRFS: device fsid 00083559-80b8-4b9d-9b56-e34e6a7452b4 devid 1 transid 152 /dev/sda1

 

Link to post
Share on other sites
14 hours ago, pzw said:

Can you post a picture of your wiring etc? Usb ports are differential connections which require non-standard wiring to work reliably.  You might get lucky using breadboard wiring (DuPont wires) but when it's not working do not assume your wiring is good enough...

Can you take a photograph of your wiring?

Link to post
Share on other sites

Here the differences by a Neo2 with 1-Bay-NAS:


armbian has loaded as module:

musb_hdrc,  uas

EHCI Bus ? - 0x01c1b000 MISSING (usbhost1 not available or hex-patched usbhost1 loaded but port not activated)

EHCI Bus 3 - 0x01c1c000

 

FriendlyELEC has loaded the follwoing moduls for storage: 

libcomposite, g_mass_storage, usb_f_mass_storage

but shows also musb-hdrc and uas in dmesg

EHCI Bus 3 - 0x01c1b000

EHCI Bus 4 - 0x01c1c000

 

armbian: 

lsusb -t armbian (overlay usbhost2 usbhost3)
root@nanoneo2:~# lsusb -t
/:  Bus 07.Port 1: Dev 1, Class=root_hub, Driver=musb-hdrc/1p, 480M
/:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=uas, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M

[    1.920677] ehci-platform 1c1c000.usb: EHCI Host Controller
[    1.920703] ehci-platform 1c1c000.usb: new USB bus registered, assigned bus number 3
[    1.920919] ehci-platform 1c1c000.usb: irq 11, io mem 0x01c1c000
[    1.935956] ehci-platform 1c1c000.usb: USB 2.0 started, EHCI 1.00

Module                  Size  Used by
fuse                   98304  2
sun8i_codec_analog     28672  0
snd_soc_core          151552  1 sun8i_codec_analog
snd_pcm_dmaengine      16384  1 snd_soc_core
sun4i_gpadc_iio        16384  0
iio_hwmon              16384  0
sunxi                  20480  0
musb_hdrc              94208  1 sunxi
industrialio           65536  2 iio_hwmon,sun4i_gpadc_iio
uas                    24576  1

friendlyarm:

root@FriendlyELEC:~# lsusb -t
/:  Bus 09.Port 1: Dev 1, Class=root_hub, Driver=musb-hdrc/1p, 480M
/:  Bus 08.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 07.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=uas, 480M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M

[    1.961748] ehci-platform 1c1b000.usb: EHCI Host Controller
[    1.967353] ehci-platform 1c1b000.usb: new USB bus registered, assigned bus number 3
[    1.975350] ehci-platform 1c1b000.usb: irq 13, io mem 0x01c1b000
[    1.994357] ehci-platform 1c1b000.usb: USB 2.0 started, EHCI 1.00

[    2.009218] ehci-platform 1c1c000.usb: EHCI Host Controller
[    2.014815] ehci-platform 1c1c000.usb: new USB bus registered, assigned bus number 4
[    2.022752] ehci-platform 1c1c000.usb: irq 15, io mem 0x01c1c000
[    2.042369] ehci-platform 1c1c000.usb: USB 2.0 started, EHCI 1.00


root@FriendlyELEC:~# lsusb
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 152d:0578 JMicron Technology Corp. / JMicron USA Technology Corp.
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 058f:9380 Alcor Micro Corp. Flash Drive
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 009 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

root@FriendlyELEC:~# lsmod
Module                  Size  Used by
ir_lirc_codec          16384  0
lirc_dev               20480  1 ir_lirc_codec
sunxi_cir              16384  0
rc_core                32768  4 ir_lirc_codec,lirc_dev,sunxi_cir
rtc_ds1307             20480  0
g_mass_storage         16384  0
usb_f_mass_storage     36864  2 g_mass_storage
libcomposite           45056  2 g_mass_storage,usb_f_mass_storage
fuse                   90112  1

 

Link to post
Share on other sites
3 minutes ago, guidol said:

overlay usbhost2 usbhost3

Why? I explained a few times in the meantime that with NanoPi NEO usbhost1 is needed while usbhost3 is enabled by default anyway. And please remember what @zador.blood.stained said:

13 hours ago, zador.blood.stained said:

I also don't see anything that would resemble an amrbianmonitor -u support link and a serial console log from u-boot I don't think I have anything I can look into.

 

It is possible to check that overlays are applied correctly in /proc/device-tree and probably somewhere in /sys too

 

Link to post
Share on other sites
7 minutes ago, tkaiser said:
13 hours ago, zador.blood.stained said:

It is possible to check that overlays are applied correctly in /proc/device-tree and probably somewhere in /sys too

 

root@orangepizeroplus2:~# cat /proc/device-tree/soc/usb@01c1b000/status; echo
okay
root@orangepizeroplus2:~# cat /proc/device-tree/soc/usb@01c1b400/status; echo
okay
root@orangepizeroplus2:~#

 

Link to post
Share on other sites
2 hours ago, tkaiser said:

Why? I explained a few times in the meantime that with NanoPi NEO usbhost1 is needed while usbhost3 is enabled by default anyway. And please remember what @zador.blood.stained said:

 

I did read it, but in the normal image isnt a usbhost1-overlay-file :( - that did I wrote more than one time.
The hex-patchted usbhost1 from me is loaded via u-boot:

Applying kernel provided DT overlay sun50i-h5-usbhost1.dtbo
504 bytes read in 464 ms (1000 Bytes/s)

 

but the usbhost1 doesnt seems to be enabled:

root@nanoneo2:~# cat /proc/device-tree/soc/usb@01c1b000/status; echo
disabled
root@nanoneo2:~# cat /proc/device-tree/soc/usb@01c1b400/status; echo
disabled

 

I also did try all usbhost alone - and could see that usbhost3 is also loaded without overlay-entry.

The additional USB to usbhost3 is loaded with usbhost2 (sata JMS567), but -my- usbhost1 doesnt enbale anything

(because it is disabled anywhere in the kernel)

 

Neo2_u-boot.txt

Link to post
Share on other sites
58 minutes ago, zador.blood.stained said:

I just downloaded the latest (linux-dtb-next-sunxi64_5.34.171103_arm64.deb) and one of the previous (linux-dtb-next-sunxi64_5.34.171101_arm64.deb) nightly dtb packages from here and they both contain sun50i-h5-usbhost1.dtbo

@zador.blood.stained 

 Ahhhhh :) Well - All right! Now Iam VERY happy :)

some time ago I downloaded the Install-Image and then updated it until 5.34.171029 nightly Ubuntu 

(without getting  a usbhost1 via the update)

 

After your Message I updated to  5.34.171103 nightly Ubuntu  (normally I update often) and the usbhost1 is there - !and working! :)

The frontright USB port is now working like on the FriendlyELEC Image :)

 

root@nanoneo2:/# uname -a
Linux nanoneo2 4.13.10-sunxi64 #89 SMP Thu Nov 2 01:57:43 CET 2017 aarch64 aarch64 aarch64 GNU/Linux

root@nanoneo2:/# cat /proc/device-tree/soc/usb@01c1b000/status; echo
okay

root@nanoneo2:/# cat /proc/device-tree/soc/usb@01c1b400/status; echo
okay

root@nanoneo2:/# lsusb -t
/:  Bus 09.Port 1: Dev 1, Class=root_hub, Driver=musb-hdrc/1p, 480M
/:  Bus 08.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 07.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=uas, 480M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M


[    1.934068] ehci-platform 1c1b000.usb: EHCI Host Controller
[    1.934103] ehci-platform 1c1b000.usb: new USB bus registered, assigned bus number 3
[    1.934356] ehci-platform 1c1b000.usb: irq 11, io mem 0x01c1b000
[    1.948854] ehci-platform 1c1b000.usb: USB 2.0 started, EHCI 1.00

[    1.981702] ohci-platform 1c1b400.usb: Generic Platform OHCI controller
[    1.981723] ohci-platform 1c1b400.usb: new USB bus registered, assigned bus number 6
[    1.981850] ohci-platform 1c1b400.usb: irq 12, io mem 0x01c1b400

MANY MANY Thanks to all who have this made possible :) 

Now its time for me to spend AGAIN some money to the armbian-project :) @Igor [DONE!]


 

Link to post
Share on other sites

Guys, I see you are discussing something connected to the topic I'm very interested in, but unfortunately I'm not very fluent in all those things. 

 

Our project at this moment is based on NanoPi Neo2 Plus boards. We have a requirement to be able to connect NanoPi to PC directly using USB cable and organize datatransfer to/from device somehow. Is it possible for this device to act as a mass storage device or even g_ether(?) so PC could connect to Nano?

 

Link to post
Share on other sites
Guest
This topic is now closed to further replies.