As was discovered by TI ( I guess end of last year, at least it was the first time some related info was included in the SDK release documentation) there is a risk of damaging the SD-card on the AM5748 eval-kits in the case when a faster SD-mode is used (one which uses 1.8V IO voltage, e.g. SDR104) and Linux suddenly reboots without a power cycle. Scenario like this:
- Linux host system negotiates e.g. SDR104 mode after startup
- IO voltage starts at 3.3V and after negotiation is dropped to 1.8V as per specification
- SD card is running in SDR104 mode during operation
- Unexpected crash and reboot of Linux occurs (e.g due to a watchdog timeout because of a SW bug or an intentional “soft” reboot, “ctrl-alt-delete”)
- CPU makes a soft restart, without power-cycling the SD card
- Hence SD card remains in SDR104 mode
- Linux boots again and 3.3V is applied as IO voltage communicating with the SD card.
- SD card is damaged due to still being in SDR104 mode when host applies 3.3V on the IO lines
The solution TI implemented in latter SDK releases was simply to not allow anything faster that HS mode, which limits to 25MB/s and uses 3.3V only (change in device tree settings). This far we have used the same strategy on our CPU-module with AM5748, but this is a performance-limiting factor of course, and we want to be able to run SDR104 mode in the end as this greatly improves flash performance. In order to remove this potential failure we must make sure the Vdd to SD-card is cycled every time Linux reboots.
In order for tthis to be implemented we need some way of being sure we capture all reboots and make sure they initiate a power-cycle of the SD card.
From a SW perspective it basically boils down to two different scenarios:
- Normal reboot, requested by SW (e.g. reboot commando issued for some reason, as far as we understand Linux the ends up in these commands: https://linux.die.net/man/8/reboot
http://man7.org/linux/man-pages/man2/reboot.2.html - A reboot due to watchdog timeout (using the Sitara core watchdogs)
Could you please elaborate on how the reboot commands are implemented in the TI SDK distro? Will they eventually end up in a complete reboot, starting from MLO/Uboot in the primary boot-source, or something “higher up”, e.g. just rebooting from Linux Kernel? As far as we can see something is changing the setting in the PMIC in order to change the LDO1 back to 3.3V from 1.8V during the reboot process (if SDR104 mode was used during normal execution).
Our SD implementation is basically equivalent to the one used on the AM5748 dev-kit. As I see it we need to implement some type of “gating” of SD Vdd which we make sure cycles the SD power (and possibly cycles the IO voltage at the same time). But we need to find some mechanism that can initiate this process early in the boot-stage.
BR Jimmy