BUG - Bananapi USB not working on Mainline

689 views
Skip to first unread message

David Tulloh

unread,
Dec 15, 2015, 8:47:40 PM12/15/15
to linux...@googlegroups.com
Hi,

I am working on a SinoVoip Bananapi M1

With the current mainline USB does not work. I believe that power to the USB vbus is being disabled during boot.

Failing build v4.4-rc5
Working build v4.2.3

Compiled with
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- sunxi_defconfig menuconfig zImage dtbs

The boot log is attached, debug and CONFIG_REGULATOR_DEBUG were enabled.
The config file is also attached.

I am happy to do further work on the problem but my unfamiliarity with the kernel means I'm flailing in the dark.


David
keyboard_failing.bootlog
keyboard_failing.config

Maxime Ripard

unread,
Dec 16, 2015, 1:34:50 AM12/16/15
to sunxi...@tulloh.id.au, linux...@googlegroups.com, Chen-Yu Tsai, Hans de Goede
Hi,

On Wed, Dec 16, 2015 at 12:47:18PM +1100, David Tulloh wrote:
> Hi,
>
> I am working on a SinoVoip Bananapi M1
>
> With the current mainline USB does not work.

What are you trying to do with USB? Plain USB ? USB OTG? Which port
are you connecting it to?

> I believe that power to the USB vbus is being disabled during boot.

If you're using the micro-USB port and that the device is connected at
boot, yes, that might be the issue.

> Failing build v4.4-rc5
> Working build v4.2.3
>
> Compiled with
> make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- sunxi_defconfig menuconfig
> zImage dtbs

What did you change in menuconfig?

> The boot log is attached, debug and CONFIG_REGULATOR_DEBUG were enabled.

I don't see anything out of the ordinary :/

Thanks,
Maxime

PS: Please have the relevant people and mailing lists in Cc. In this
case, it would have been Hans, Chen-Yu, me and the linux-arm-kernel
mailing list.

--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
signature.asc

David Tulloh

unread,
Dec 16, 2015, 2:15:27 AM12/16/15
to Maxime Ripard, linux...@googlegroups.com, Chen-Yu Tsai, Hans de Goede
Thanks for looking in to this,

On 16 December 2015 at 17:34, Maxime Ripard <maxime...@free-electrons.com> wrote:
Hi,

On Wed, Dec 16, 2015 at 12:47:18PM +1100, David Tulloh wrote:
> Hi,
>
> I am working on a SinoVoip Bananapi M1
>
> With the current mainline USB does not work.

What are you trying to do with USB? Plain USB ? USB OTG? Which port
are you connecting it to?

Plain USB, the ports next to the ethernet port.
I believe they are USB1 and USB2.
On the schematic it is J3.

Attempting to connect a no-name keyboard, which is generally connected during boot but plugging it in later makes no difference. Also using a Turtle Beach audio dongle with power LED.

The keyboard and power LEDs come on towards the end of the U-Boot process but switch off once the kernel starts to boot.

The keyboard is completely non-functional at the login prompt. Standard keys aren't printed in addition to numlock and friends not responding.
 

> I believe that power to the USB vbus is being disabled during boot.

If you're using the micro-USB port and that the device is connected at
boot, yes, that might be the issue.

> Failing build v4.4-rc5
> Working build v4.2.3
>
> Compiled with
> make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- sunxi_defconfig menuconfig
> zImage dtbs

What did you change in menuconfig?

I have tried a few options on and off. I have tested, without noticable change, kernels with all these options not set.
In config matching the attached output I had changed:

CONFIG_KEYBOARD_ATKBD -> not set
Special HID drivers -> not set
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
CONFIG_USB_EHCI_ROOT_HUB_TT=y
CONFIG_USB_EHCI_TT_NEWSCHED not set
CONFIG_IPV6=y
CONFIG_REGULATOR_DEBUG=y

 

> The boot log is attached, debug and CONFIG_REGULATOR_DEBUG were enabled.

I don't see anything out of the ordinary :/

Thanks,
Maxime

PS: Please have the relevant people and mailing lists in Cc. In this
case, it would have been Hans, Chen-Yu, me and the linux-arm-kernel
mailing list.

Thanks, I'll know for next time.


David

Karsten Merker

unread,
Dec 17, 2015, 4:48:32 PM12/17/15
to sunxi...@tulloh.id.au, d...@linux-sunxi.org
On Wed, Dec 16, 2015 at 12:47:18PM +1100, David Tulloh wrote:

> I am working on a SinoVoip Bananapi M1
>
> With the current mainline USB does not work. I believe that power to the USB
> vbus is being disabled during boot.
>
> Failing build v4.4-rc5
> Working build v4.2.3

Hello,

I don't have a kernel 4.4-rc5 build handy now, but I have just
tried a kernel 4.4-rc4 with a .config based on the default Debian
kernel configuration on a LeMaker BananaPi (which should be the
same hardware as your SinoVoip Bananapi M1). A USB keyboard
works without problems in this setup. I can try a 4.4-rc5 build
during the next days, but perhaps you could give my .config
a try on your hardware in the meantime.

From the kernel log:
[ 0.103252] reg-fixed-voltage usb0-vbus: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/usb0_vbus_pin@0, deferring probe
[ 0.103312] reg-fixed-voltage usb1-vbus: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/usb1_vbus_pin@0, deferring probe
[ 0.103347] reg-fixed-voltage usb2-vbus: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/usb2_vbus_pin@0, deferring probe
[ 0.104312] reg-fixed-voltage gmac-3v3: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/gmac_power_pin@0, deferring probe
[ 0.106634] vgaarb: loaded
[ 0.107280] usbcore: registered new interface driver usbfs
[ 0.107358] usbcore: registered new interface driver hub
[ 0.107486] usbcore: registered new device driver usb
[...]
[ 1.403736] vcc3v0: disabling
[ 1.403747] vcc3v3: disabling
[ 1.403755] vcc5v0: disabling
[ 1.403763] usb0-vbus: disabling
[ 1.403772] usb1-vbus: disabling
[ 1.403785] usb2-vbus: disabling
[ 1.403794] gmac-3v3: disabling
[ 1.405661] Freeing unused kernel memory: 844K (c09bb000 - c0a8e000)
[...]
[ 5.056351] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 5.060268] ehci-platform: EHCI generic platform driver
[ 5.065366] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 5.068821] ohci-platform: OHCI generic platform driver
[ 5.102832] sunxi-wdt 1c20c90.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[ 5.174364] axp20x 0-0034: AXP20x variant AXP209 found
[ 5.191994] axp20x 0-0034: AXP20X driver loaded
[ 5.351286] Adding 696316k swap on /dev/mmcblk0p5. Priority:-1 extents:1 across:696316k SSFS
[ 5.712343] ehci-platform 1c14000.usb: EHCI Host Controller
[ 5.712805] ehci-platform 1c14000.usb: new USB bus registered, assigned bus number 1
[ 5.713032] ehci-platform 1c14000.usb: irq 29, io mem 0x01c14000
[ 5.722566] ehci-platform 1c14000.usb: USB 2.0 started, EHCI 1.00
[ 5.723051] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 5.723067] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 5.723078] usb usb1: Product: EHCI Host Controller
[ 5.723087] usb usb1: Manufacturer: Linux 4.4.0-rc4-armmp-lpae+ ehci_hcd
[ 5.723097] usb usb1: SerialNumber: 1c14000.usb
[ 5.724227] hub 1-0:1.0: USB hub found
[ 5.724330] hub 1-0:1.0: 1 port detected
[ 5.725916] ehci-platform 1c1c000.usb: EHCI Host Controller
[ 5.726391] ehci-platform 1c1c000.usb: new USB bus registered, assigned bus number 2
[ 5.726611] EXT4-fs (mmcblk0p1): mounting ext2 file system using the ext4 subsystem
[ 5.730806] ehci-platform 1c1c000.usb: irq 33, io mem 0x01c1c000
[ 5.742512] ehci-platform 1c1c000.usb: USB 2.0 started, EHCI 1.00
[ 5.742859] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[ 5.742872] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 5.742882] usb usb2: Product: EHCI Host Controller
[ 5.742892] usb usb2: Manufacturer: Linux 4.4.0-rc4-armmp-lpae+ ehci_hcd
[ 5.742901] usb usb2: SerialNumber: 1c1c000.usb
[ 5.743874] hub 2-0:1.0: USB hub found
[ 5.743934] hub 2-0:1.0: 1 port detected
[ 5.745296] ohci-platform 1c14400.usb: Generic Platform OHCI controller
[ 5.747160] ohci-platform 1c14400.usb: new USB bus registered, assigned bus number 3
[ 5.747465] ohci-platform 1c14400.usb: irq 30, io mem 0x01c14400
[ 5.806746] usb usb3: New USB device found, idVendor=1d6b, idProduct=0001
[ 5.806771] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 5.806782] usb usb3: Product: Generic Platform OHCI controller
[ 5.806791] usb usb3: Manufacturer: Linux 4.4.0-rc4-armmp-lpae+ ohci_hcd
[ 5.806801] usb usb3: SerialNumber: 1c14400.usb
[ 5.807774] hub 3-0:1.0: USB hub found
[ 5.807836] hub 3-0:1.0: 1 port detected
[ 5.809230] ohci-platform 1c1c400.usb: Generic Platform OHCI controller
[ 5.818142] ohci-platform 1c1c400.usb: new USB bus registered, assigned bus number 4
[ 5.818387] ohci-platform 1c1c400.usb: irq 34, io mem 0x01c1c400
[ 5.834732] EXT4-fs (mmcblk0p1): mounted filesystem without journal. Opts: (null)
[ 5.878852] usb usb4: New USB device found, idVendor=1d6b, idProduct=0001
[ 5.878876] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 5.878887] usb usb4: Product: Generic Platform OHCI controller
[ 5.878897] usb usb4: Manufacturer: Linux 4.4.0-rc4-armmp-lpae+ ohci_hcd
[ 5.878906] usb usb4: SerialNumber: 1c1c400.usb
[ 5.879892] hub 4-0:1.0: USB hub found
[ 5.879966] hub 4-0:1.0: 1 port detected
[ 6.282576] usb 3-1: new low-speed USB device number 2 using ohci-platform
[ 6.331479] RX IPC Checksum Offload disabled
[ 6.331507] No MAC Management Counters available
[ 6.486633] usb 3-1: New USB device found, idVendor=xxxx, idProduct=yyyy
[ 6.486657] usb 3-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 6.495625] random: nonblocking pool is initialized
[ 6.682759] input: HID xxxx:yyyy as /devices/platform/soc@01c00000/1c14400.usb/usb3/3-1/3-1:1.0/0003:xxxx:yyyy.0001/input/input0
[ 6.709379] hid-generic 0003:xxxx:yyyy.0001: input,hidraw0: USB HID v1.10 Keyboard [HID xxxx:yyyy] on usb-1c14400.usb-1/input0
[ 6.722008] input: HID xxxx:yyyy as /devices/platform/soc@01c00000/1c14400.usb/usb3/3-1/3-1:1.1/0003:xxxx:yyyy.0002/input/input1
[ 6.722831] hid-generic 0003:xxxx:yyyy.0002: input,hidraw1: USB HID v1.10 Device [HID xxxx:yyyy] on usb-1c14400.usb-1/input1

Regards,
Karsten
--
Gem. Par. 28 Abs. 4 Bundesdatenschutzgesetz widerspreche ich der Nutzung
sowie der Weitergabe meiner personenbezogenen Daten für Zwecke der
Werbung sowie der Markt- oder Meinungsforschung.
config-4.4.0-rc4-armmp-lpae+

m.sile...@gmail.com

unread,
Dec 18, 2015, 3:22:43 PM12/18/15
to linux-sunxi, Chen-Yu Tsai, Hans de Goede, Maxime Ripard, linux-ar...@lists.infradead.org
Hi,
I can confirm there is an issue with USB (not OTG) on the Bananapi in Linux 4.4-rc5. I just compiled and booted a 4.4-rc5 kernel image with a new dtb - or be more precise, I failed to boot it because the kernel couldn't mount the usb drives that I listed in my fstab. The defconfig I used was basically the same that I use for my 4.1.y kernels which is based on sunxi_defconfig but adds a lot more stuff like drivers, netfilter, etc (I merged the changes that happened in sunxi_defconfig between 4.1 and 4.4, though).

I haven't had the time yet to look into it further to bisect the issue. I also haven't tried any other kernel versions between 4.1.15 and 4.4-rc5, so I can't say when the problem slipped in. I just can say that there is an issue on my Lemaker Bananapi. The symptoms are the same as descrived by David. My usb drives don't seem the get power anymore once the kernel boots.

I'll try to find time to look into it in more detail over the weekend and provide configs and logs.

Regards,

Timo

Maxime Ripard

unread,
Dec 18, 2015, 3:48:05 PM12/18/15
to David Tulloh, linux...@googlegroups.com, Chen-Yu Tsai, Hans de Goede
On Wed, Dec 16, 2015 at 06:15:06PM +1100, David Tulloh wrote:
> Thanks for looking in to this,
>
> On 16 December 2015 at 17:34, Maxime Ripard <
> maxime...@free-electrons.com> wrote:
>
> > Hi,
> >
> > On Wed, Dec 16, 2015 at 12:47:18PM +1100, David Tulloh wrote:
> > > Hi,
> > >
> > > I am working on a SinoVoip Bananapi M1
> > >
> > > With the current mainline USB does not work.
> >
> > What are you trying to do with USB? Plain USB ? USB OTG? Which port
> > are you connecting it to?
> >
>
> Plain USB, the ports next to the ethernet port.
> I believe they are USB1 and USB2.
> On the schematic it is J3.

Ok. So it's not related to usb0-vbus. This one is for the OTG.
Do you have CONFIG_USB_HID?

Thanks,
Maxime
signature.asc

m.sile...@gmail.com

unread,
Dec 19, 2015, 2:15:59 PM12/19/15
to linux-sunxi, we...@csie.org, hdeg...@redhat.com, maxime...@free-electrons.com, linux-ar...@lists.infradead.org, m.sile...@gmail.com
Hi again,

Am Freitag, 18. Dezember 2015 21:22:43 UTC+1 schrieb m.sile...@gmail.com:
> I can confirm there is an issue with USB (not OTG) on the Bananapi in Linux 4.4-rc5. I just compiled and booted a 4.4-rc5 kernel image with a new dtb - or be more precise, I failed to boot it because the kernel couldn't mount the usb drives that I listed in my fstab. The defconfig I used was basically the same that I use for my 4.1.y kernels which is based on sunxi_defconfig but adds a lot more stuff like drivers, netfilter, etc (I merged the changes that happened in sunxi_defconfig between 4.1 and 4.4, though).
>
> I haven't had the time yet to look into it further to bisect the issue. I also haven't tried any other kernel versions between 4.1.15 and 4.4-rc5, so I can't say when the problem slipped in. I just can say that there is an issue on my Lemaker Bananapi. The symptoms are the same as descrived by David. My usb drives don't seem the get power anymore once the kernel boots.
>
> I'll try to find time to look into it in more detail over the weekend and provide configs and logs.
>

so, I did some more testing. I took a second Lemaker Bananpi with two usb devices attached (a flash drive and a sd card reader) and compiled several kernel images along with their device tree blobs to figure out which version introduced the issue.

I tested linux 4.2, 4.3, 4.4-rc1 and 4.4-rc5. The U-Boot version used was 2015.10. I took the same defconfig for all builds.

The break seems to have occured between 4.3 and 4.4-rc1, meaning that both 4.2 and 4.3 work fine, but with 4.4-rc1 and 4.4-rc5 the USB devices get turned off during boot.

The defconfig, full configs and the corresponding dmesg output for 4.3 (USB working) and 4.4-rc1 (USB *not* working) can be found here:
http://pastebin.com/HYwCGwcx (config 4.3)
http://pastebin.com/hbW7iLEh (dmesg 4.3)
http://pastebin.com/tKMSXMCW (config 4.4-rc1)
http://pastebin.com/g5NXw42t (dmesg 4.4-rc1)
http://pastebin.com/kW8MjcTq (defconfig, used for all builds)

What caught my eye here are these lines in the 4.4-rc1 dmesg output:
[ 0.539619] usb0-vbus: disabling
[ 0.539641] usb1-vbus: disabling
[ 0.539664] usb2-vbus: disabling

When I submitted the patch to enable the regulators on Bananapi and tested the patch on some linux-next build at that time, I didn't see those in my kernel log. So maybe there was another change leading to that?

As David described as well, the LEDs on my flash drive and my card reader get turned on during the U-Boot phase. When the kernel is loading, they stay on (or keep blinking) with linux 4.3 and earlier. In 4.4-rc1 and later they both turn off, once the kernel is loading.

Interesting enough, though, the power does not seem to be lost completly. Because if I unplug the card reader once linux 4.4-rc1 has fully booted, and plug it back in, the LED turns on again but the device does not show up in /dev/ and is not mountable. The flash drive stays dark even with this unplugging/plugging cycle.


Regards,

Timo

Hans de Goede

unread,
Dec 19, 2015, 2:38:08 PM12/19/15
to linux-sunxi
Hi,

The sunxi usb-phy driver now requires extcon (due to the added otg support), maybe the defconfig is not enabling extcon and thereby you are not getting the sunxi usb-phy driver build, or not build-in at least ?

Can you edit .config after the make defconfig and see what the value for CONFIG_PHY_SUN4I_USB is ?

Regards,

Hans

m.sile...@gmail.com

unread,
Dec 19, 2015, 4:39:38 PM12/19/15
to linux-sunxi, Maxime Ripard, Chen-Yu Tsai, linux-ar...@lists.infradead.org
Hi,

Am Samstag, 19. Dezember 2015 20:38:08 UTC+1 schrieb Hans de Goede:
> The sunxi usb-phy driver now requires extcon (due to the added otg support), maybe the defconfig is not enabling extcon and thereby you are not getting the sunxi usb-phy driver build, or not build-in at least ?
>
> Can you edit .config after the make defconfig and see what the value for CONFIG_PHY_SUN4I_USB is ?

I found the solution! The problem is CONFIG_AXP20X_POWER which was introduced in 4.4-rc1 but defaults to no and not set in sunxi_defconfig. Adding CONFIG_AXP20X_POWER=y to sunxi_defconfig solves that and get's my USB devices working again on linux 4.4-rc5. I actually brought that up on IRC once, but at that time nobody seemed to know so I forgot it again.

Anyway, wouldn't it be a better to just have it automatically be selected when e.g. CONFIG_PHY_SUN4I_USB or something else that depends on it is enabled?

Regards,

Timo

David Tulloh

unread,
Dec 20, 2015, 2:38:52 AM12/20/15
to m.sile...@gmail.com, linux-sunxi, Maxime Ripard, Chen-Yu Tsai, linux-ar...@lists.infradead.org
On 20 December 2015 at 08:39, <m.sile...@gmail.com> wrote:
I found the solution! The problem is CONFIG_AXP20X_POWER which was introduced in 4.4-rc1 but defaults to no and not set in sunxi_defconfig. Adding CONFIG_AXP20X_POWER=y to sunxi_defconfig solves that and get's my USB devices working again on linux 4.4-rc5. I actually brought that up on IRC once, but at that time nobody seemed to know so I forgot it again.

 
Thanks Timo,

I can confirm that adding CONFIG_AXP20X_POWER=y to sunxi_defconfig works for me as well.

I need to check my emails more often, I just spent several hours narrowing this down but not quite reaching the solution.

Karsten's working config posted earlier defines CONFIG_AXP20X_POWER=m.


David

m.sile...@gmail.com

unread,
Dec 22, 2015, 9:42:10 AM12/22/15
to linux-sunxi, m.sile...@gmail.com, maxime...@free-electrons.com, we...@csie.org, linux-ar...@lists.infradead.org, Hans de Goede
Hi Hans,
Hi Maxime,

Am Sonntag, 20. Dezember 2015 08:38:52 UTC+1 schrieb David Tulloh:
> On 20 December 2015 at 08:39, <m.sile...@gmail.com> wrote:
>
> I found the solution! The problem is CONFIG_AXP20X_POWER which was introduced in 4.4-rc1 but defaults to no and not set in sunxi_defconfig. Adding CONFIG_AXP20X_POWER=y to sunxi_defconfig solves that and get's my USB devices working again on linux 4.4-rc5. I actually brought that up on IRC once, but at that time nobody seemed to know so I forgot it again.
>
> Thanks Timo,
>
> I can confirm that adding CONFIG_AXP20X_POWER=y to sunxi_defconfig works for me as well.

Is this considered an issue worthwhile to be addressed before the release of 4.4?

The way I see it is that USB support is broken on A10/20 in mainline for anybody who builds on sunxi_defconfig or multi_v7_defconfig at the moment.

I think we should either have CONFIG_PHY_SUN4I_USB select CONFIG_AXP20X_POWER automatically (my preferred solution) or at least add it to sunxi_defconfig and multi_v7_defconfig.

I'd be glad to submit a short patch for it depending on your viewpoint.

Best wishes and happy holidays,

Timo

Maxime Ripard

unread,
Dec 27, 2015, 4:40:45 PM12/27/15
to m.sile...@gmail.com, linux-sunxi, we...@csie.org, linux-ar...@lists.infradead.org, Hans de Goede
Hi,

On Tue, Dec 22, 2015 at 06:42:07AM -0800, m.sile...@gmail.com wrote:
> Am Sonntag, 20. Dezember 2015 08:38:52 UTC+1 schrieb David Tulloh:
> > On 20 December 2015 at 08:39, <m.sile...@gmail.com> wrote:
> >
> > I found the solution! The problem is CONFIG_AXP20X_POWER which was
> > introduced in 4.4-rc1 but defaults to no and not set in
> > sunxi_defconfig. Adding CONFIG_AXP20X_POWER=y to sunxi_defconfig
> > solves that and get's my USB devices working again on linux
> > 4.4-rc5. I actually brought that up on IRC once, but at that time
> > nobody seemed to know so I forgot it again.
> >
> > Thanks Timo,
> >
> > I can confirm that adding CONFIG_AXP20X_POWER=y to sunxi_defconfig
> > works for me as well.
>
> Is this considered an issue worthwhile to be addressed before the
> release of 4.4?
>
> The way I see it is that USB support is broken on A10/20 in mainline
> for anybody who builds on sunxi_defconfig or multi_v7_defconfig at
> the moment.

I don't consider it a "release blocker". The defconfig is just what it
says: a default configuration. It's not a one-size-fits-all
configuration.

> I think we should either have CONFIG_PHY_SUN4I_USB select
> CONFIG_AXP20X_POWER automatically (my preferred solution)

It actually depends on the board, so no.

> or at least add it to sunxi_defconfig and multi_v7_defconfig.

Feel free to send a patch for it to a...@kernel.org in addition to the
usual recipients (Chen-Yu, LAKML and myself), and make it clear that
you want them to apply it.

Thanks!
signature.asc
Reply all
Reply to author
Forward
0 new messages