6 Commits

Author SHA1 Message Date
Jeremy Linton
fe59663f0a Platform/RaspberryPi: Add further mailbox helpers
Lets add some further mailbox helpers and convert the existing
RpiFirmwareSetLed into a generic SetGpio() function.

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Reviewed-by: Andrei Warkentin <awarkentin@vmware.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
2021-01-08 10:42:13 +01:00
Pete Batard
225426271b Platform/RaspberryPi/Drivers: Add SD/(e)MMC card detection
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>
2020-07-14 15:41:45 +01:00
Andrei Warkentin
dae68d51c5 Platform/RaspberryPi4: notify VPU to load xHCI firmware before XhciDxe binds
Newer Pi 4 boards (such as 8GiB variant) no longer carry a SPI
EEPROM with the VLI805 (USB) controller firmware. So, ask the
VPU firmare to load the image it has into the controller
specified by BDF.

This is benign on non-8GiB boards (reloading that firmware if
VPU fw is new enough or doing nothing on old VPU firmware).

Tested on 4GB. Also have a positive test report for an 8GB board
from a forum member.

Signed-off-by: Andrei Warkentin <andrey.warkentin@gmail.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
2020-06-01 12:08:39 +02:00
Andrei Warkentin
639b1d5fd9 Platform/RPi: Add firmware call to read installed memory size
Add a new RPiFirmwareGetModelInstalledMB () call in RpiFirmwareDxe
to return the amount of detected installed RAM on the system (in MB).

Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2020-03-03 15:06:19 +01:00
Samer El-Haj-Mahmoud
837450ff11 Platform/RPi: Add model family detection
Add GetModelFamily to RASPBERRY_PI_FIRMWARE_PROTOCOL.

This uses the board revision to return a numeric value representing
the RPi family (1=RPi, 2=RPi2, 3=RPi3 and 4=RPi4).

Knowing the Pi family will help us set the SD card routing when we
introduce support for the Pi 4 and should also be easier to maintain
than if using individual model detection.

Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2019-11-19 18:12:39 +00:00
Pete Batard
03f36b8fcf Platforms/RPi3: Restructure platform in preparation for Pi 4
In preparation for adding Raspberry Pi 4 support, the Pi 3 platform
is restructured by factorizing all the drivers and libraries that are
going to be commonly used by the two platforms.

Because much of the Pi 4 SoC is an extension of the Pi 3 one this
means that almost everything, except the ACPI tables, is moved up
into a new common RaspberryPi/ subdirectory that will serve both
platforms. The .dec is also moved to this directory, under a new
RaspberryPi.dec name, and existing references to it are updated.

This commit requires the edk2-non-osi in use to contain commit 243e55f622ea
in order to build.

Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2019-10-21 15:32:32 +01:00