Am 17.02.2017 um 17:22 schrieb Matthijs van Duin matthijsvanduin@gmail.com:
Also, USB is not considered a "permanent boot device", which means it is *only* considered at cold boot and ignored at warm boot.
Interesting to know!
Is the shoulder button not working for card selection a similar issue?
I don't kow if the gpio controllers are warm-reset-insensitive, I'd need to check.
Did you do a warm reset or cold reset?
I've done all sorts of stuff. I still have nothing resembling a mental model of what's going on.
I also have no such model...
I found a tiny piece of new information while checking the Palmas bits for poweroff. There are things like a battery debouncing detector. And auto-warm-start or however it was called. And, most importantly, in my register data sheet, the initial settings are not documented and referred to the OTG setup. That is something I don't know. So maybe we should read out the Palmas once in MLO and note what the initial state is (except those bits which are already modified by MLO).
Maybe this gives us some hints. Also to a subtle bug ED has noticed several times when unplugging the USB cables that the OMAP5 simply freezes with panel and omapdss being still on. But with overlay of some moiré pattern.
I suspect that the battery did momentarily loose contact - but the Palmas didn't switch off so that the OMAP5 lost memory or CPU state.
All this has no direct relation to the µSD/eMMC switch because it is controlled by OMAP5 gpios, but it may have an influence if the OMAP gets a warm/cold reset etc.
Maybe the OMAP5 keeps the switch state of the last attempt during a warm reset. This completely disables the shoulder button for card selection completely until we do a cold reset.
Easy to check, but I don't dare rebooting my pyra now since I've just hooked it up to JTAG again for some testing.
No problem, please do JTAG first! That is something which I can't help with.
Asking palmas to power-cycle the system (i2c mw 48 a0 3) does work of course.
For the GTA04 we have a poweroff command doing a similar thing for the twl4030.
Yes it would be nice to be able to type "poweroff" instead of that command above ;-)
Have added this!
Fortunately, someone already added the poweroff command option to cmd/boot.c which calls do_poweroff(). Enabling needs to #define CONFIG_CMD_POWEROFF in old style include file.
But the do_poweroff isn't defined anywhere - except in our private gta04 commands...
So I had to write a new poweroff i2c command to the palmas.c driver.
Here it is:
http://git.goldelico.com/?p=gta04-uboot.git;a=shortlog;h=refs/heads/letux-20...
Additionally I have cherry-picked some more of your patches and manually picked some defconfig changes. Now, I can also use the ums command.
I can also recommend CONFIG_DM_I2C btw, it has the benefit of tracking "current bus" state separately for the CLI, which means you no longer run the risk of getting palmas regulator errors while using the 'mmc' command because you typed "i2c dev 1" earlier. (I was a bit surprised when that happened...)
Ok, I see!
I also made life more convenient by allowing stateless use of the i2c command in the CLI: https://github.com/mvduin/u-boot/commit/11ee63376e521f574c584c81dc0df9d33078...
I am not sure if we should add too many such private extensions to u-boot core code. On one hand they are very useful, on the other hand we should tink about upstreaming them... So I will review them a little.
BR, Nikolaus