-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve SDhost driver to fail gracefully when no card is present #14
Comments
A stupid solution would be try 200 or so times and then assume no card there |
something like that, yeah |
The log in pftf/RPi4#77 seems interesting. Notably that consistent "ERRI MmcStatus 0x18040" being an indicator of card absent. The alternative which comes to mind is adding something to the command-line to tell it to skip trying MMC. |
I kind of maybe unrelated question, but from what I had gathered the in-CPU bootloader only looks for stuff to boot on the sdcard, so how can you get this UEFI bios running, without an sdcard? |
That is not the case. The Pi 3 and Pi 4 on-die bootloader code is able to perform a lookup for boot files that reside on a USB drive. If you use a recent EEPROM with a recent |
cool, i thought it didn't do that, you learn something new everyday ain't that right? |
The Raspberry Pi 3 and Pi 4 platforms (with latest EEPROM) can boot straight from USB, without the need for an SD card being present. However, the IsCardPresent () calls from the ArasanMmcHost and SdHost drivers are currently hardwired to return TRUE, which results in straight to USB boot failing due to the SD drivers looping on errors while trying to poke at a non-existent card... Ideally, we would use the Card Detect signal from the uSD slot, to report on the presence or absence of a card, but the Raspberry Pi Foundation did not wire those signals in the Pi 2 and subsequent models, leaving us with only potentially interfering SD commands as means to perform card detection. As a result of this, we are left with no other choice but limit detection to occurring only once, prior to formal SD card init, and then return the detected value for subsequent calls. This, however, is more than good enough for the intended purpose, which is to allow straight to USB boot. The sequence is a simplified variant of the identification code in MmcDxe. Tested on Raspberry Pi 2B, 3B and CM3 (for both SD controllers) and Pi 4 (for Arasan, as that's the only controller available today) Addresses pftf/RPi3#13, pftf/RPi3#14, pftf/RPi4#37. Co-authored-by: Andrei Warkentin <andrey.warkentin@gmail.com> Signed-off-by: Pete Batard <pete@akeo.ie> Reviewed-by: Andrei Warkentin <andrey.warkentin@gmail.com> Tested-by: Andrei Warkentin <andrey.warkentin@gmail.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
Booting UEFI from USB or network still requires an SD card, because the SDhost driver will loop forever on I/O errors. Unfortunately the Pi Foundation didn't wire up the card detect pin so we have to do something more creative.
The text was updated successfully, but these errors were encountered: