Guest26750 has quit [Remote host closed the connection]
captainSail_ has joined #linux-sunxi
captainSail_ is now known as captainSail
<captainSail>
Hi! My name is Max, and I am part of a team developing a RTOS for microcontrollers based on Allwinner processors
<captainSail>
We have implemented a USB driver library that works well on several platforms, but for some reason, it fails to operate correctly on the Allwinner A40i. When connecting a high-speed device, the system hangs during the reset phase. Specifically, the reset bit in the port status register does not clear, and the enable bit is never set
<captainSail>
To debug the issue, I’ve carefully reviewed the Linux kernel source as a reference for PLL, USB PHY, EHCI/OHCI, and even power management settings. Our current implementation closely follows the Linux initialization sequence, yet the problem persists under our OS
<captainSail>
Since the same hardware successfully runs Linux with full USB functionality, I believe the issue is not hardware-related. I also connected an oscilloscope to the D+/D- lines and monitored the controller's behavior under our OS during the reset phase. The physical reset appears to be executed correctly, but I'm not entirely sure whether the hub and device successfully negotiate the transition to high-speed mode afterward...
<captainSail>
If anyone has encountered a similar issue, I would greatly appreciate any advice. Thank you in advance!
<paulk>
you've probably already looked at it but there's some glue in addition to traditional ehci/ohci
psydroid|2 has quit []
<paulk>
you might also look at u-boot which also supports usb host on sunxi
aggi_ has quit []
apritzel has joined #linux-sunxi
Schimsalabim has quit [Read error: Connection reset by peer]
Schimsalabim has joined #linux-sunxi
ing_warn has joined #linux-sunxi
ing_warn has quit []
<captainSail>
thanks, paulk
ing_warn has joined #linux-sunxi
dsimic is now known as Guest26760
dsimic has joined #linux-sunxi
Guest26760 has quit [Ping timeout: 480 seconds]
<ing_warn>
Hi! Currently migrating an old A20 board from kernel 5.4.47 to 6.16. Works well overall but it fails to bring up mass_storage and acm usb gadgets. On the board I see "musb-hdrc musb-hdrc.1.auto: request (ptrval) not queued to ep1in" every 30s while pc side keeps resetting the USB device. Didn't see anything obvious when comparing kernel config and devicetrees.
<apritzel>
ing_warn: there is probably indeed something fishy with USB gadgets. Can you try kernels in between, somewhat crude bisecting?
<ing_warn>
Short test with 6.6.91 showed the same result. Dmesg looks pretty much the same except for "usb_phy_generic usb_phy_generic.0.auto: dummy supplies not allowed for exclusive requests (id=vbus)" which seems to be regulator... this project doesn't really care that much about regulators tbh. Any advice is highly appreciated. Thanks!
<apritzel>
ing_warn: well, the kernel and the board certainly care about regulators ;-)
<apritzel>
captainSail: indeed looking into U-Boot code is often more helpful to figure out how hardware needs to be configured
<apritzel>
captainSail: the glue logic in the EHCI/OCHI code is generic, e.g. it's for all ARM platforms, basically meaning: just enable all those clocks and resets, and init the PHY (which you wouldn't need to do explicitly on PCI)
<apritzel>
but the core of the EHCI/OCHI code should be generic
<apritzel>
and then there is of course the USB-PHY to setup, where most SoCs tend to need their special quirks
<ing_warn>
apritzel: haha, very true. everything relevant for the board should be set and I would have expected this "dummy supplies not allowed" message to be moreless a warning(?). I can try to fix that as well if you think it might be related. Otherwise bisecting kernel versions would be a logical next step if nothing else comes to mind.
<captainSail>
apritzel: Speaking of PHY. The A40 documentation does not describe this module, as well as the documentation for many allwinner processors. All this time I have been setting up PHY based on the read/write log in linux. Is there ANY description of this module?
<captainSail>
Otherwise I'm already setting up everything you mentioned. Anyway I'll look into u-boot, thanks
chewitt has joined #linux-sunxi
<apritzel>
ing_warn: yes, it looks like a warning, but if you look at the code, it bails out with some error value. Got some reports of that lately, but I don't think anybody looked at this so far
<apritzel>
captainSail: the A40 is special when it comes to OTG, we don't officially support that even. But you are talking about EHCI/OCHI host, not MUSB, right?
<captainSail>
apritzel: sure
<captainSail>
Well, I've built the latest u-boot and tried connecting a regular USB flash drive. Surprisingly, there's the same issue in u-boot — the reset fails to complete
<apritzel>
captainSail: interesting. I am pretty sure that still worked not so long ago. Can you try v2025.01?
<captainSail>
apritzel: I took the commit from 09.03.25 on the master branch
<ing_warn>
apritzel: thanks for your help, think I made it one step further. Getting rid of this issue requires enabling &usb_power_supply and adding "usb0_vbus_power-supply = <&usb_power_supply>;" to &usbphy. This has been added to the orangepi dt YEARS ago but isn't used in others(e.g. lime2). Gadgets not working yet but I have a different error now :-)
dsimic has quit [Quit: Going offline for now]
dsimic has joined #linux-sunxi
JohnDoe_71Rus has joined #linux-sunxi
<ing_warn>
apritzel: nevermind, celebrated too early. this just managed to tie it to the axp while the axp20x_usb_power module wasn't loaded, therefore the error didn't appear because it was still waiting for the supply.
hentai has quit [Ping timeout: 480 seconds]
jakllsch_ has quit [Ping timeout: 480 seconds]
captainSail has quit [Remote host closed the connection]
hentai has joined #linux-sunxi
tlwoerner has quit [Quit: Leaving]
tlwoerner has joined #linux-sunxi
<Jookia>
i have a board that has a removable SD card but removing it can cause 'data error, sending stop command, send stop command failed' then the mmc bus to hang. i'm also getting command errors with SD cards that the mainline kernel doesn't seem to have
<apritzel>
Jookia: does the card detect not work then?
<Jookia>
it does work, yes
radxanaoki has quit [Quit: radxanaoki]
apritzel has quit [Remote host closed the connection]
apritzel has joined #linux-sunxi
<Jookia>
removing the card gives an 'mmc0: card aaaa removed'
<Jookia>
i changed some dt flags to be a bit more like the bsp and that seems to have fixed the mmc bus hang with the card removal. not sure
<apritzel>
"dt flags to be a bit more like the bsp" does NOT sound good ...
<Jookia>
mainly i added 'cap-sd-highspeed;
<Jookia>
and broken-cd. though i don't know what that means
<Jookia>
i also added max-frequency stuff
apritzel has quit [Remote host closed the connection]
<Jookia>
yeah i think the broken-cd fixes the cd thing. i'm not sure why
apritzel has joined #linux-sunxi
<Jookia>
i'm going to put down the other sd card errors to 'bad sd card'
<Jookia>
the BSP might be more 'tolerant' of it somehow
<apritzel>
Jookia: broken-cd means "broken card detect", that means the kernel does not rely on any GPIO to detect a card, but polls the data lines
<Jookia>
hmm. i guess it's broken then since broken-cd works better
<apritzel>
it's quite simple: if the card detection pin is not working, or not wired up in the first place, you specify this property: we do this in mainline DTs, where needed
<Jookia>
what does 'not working' mean though, like ... it's there, but it just seems slow
vagrantc has joined #linux-sunxi
<apritzel>
what board is that?
Schimsalabim has quit [Ping timeout: 480 seconds]
Schimsalabim has joined #linux-sunxi
<apritzel>
is the card detect switch weirdly place, so it triggers to late, when the card already lost contact?
<apritzel>
placed*
<apritzel>
Jookia: oh, and cap-sd-highspeed is BSP snake-oil: we always enable that in the driver
<Jookia>
ooh interesting
<Jookia>
yeah in the end i think it was broken-cd
jakllsch has joined #linux-sunxi
psydroid|2 has joined #linux-sunxi
chewitt has quit [Quit: Zzz..]
Hypfer is now known as Guest26776
Hypfer has joined #linux-sunxi
Guest26776 has quit [Read error: No route to host]
colinsane has joined #linux-sunxi
Hypfer has quit [Read error: Connection reset by peer]
Hypfer has joined #linux-sunxi
apritzel has quit [Ping timeout: 480 seconds]
hentai has quit [Quit: SIGTERM]
Schimsalabim has quit [Read error: Connection reset by peer]
Schimsalabim has joined #linux-sunxi
apritzel has joined #linux-sunxi
loki6667 has quit []
loki666 has joined #linux-sunxi
testaccount has joined #linux-sunxi
<Lightsword>
apritzel, so if I want to make an efuse that's normally hidden viewable by linux would that be something to modify in TF-A?