Commit Graph

1465 Commits

Author SHA1 Message Date
Ard Biesheuvel
ff5e2c5c4c Platform/Overdrive: add missing resolution for FileHandleLib
Changes to the core EDK2 repository have caused the build for
Overdrive to break. Move the existing FileHandleLib resolution
to global scope to get things working again.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Leif Lindholm <leif.lindholm@linaro.org>
2019-11-28 15:50:07 +01:00
Michael Kubacki
04889ec119 Maintainers.txt: Update maintainers for Simics packages
David Y Wei is no longer available as a maintainer. David is removed
as a maintainer for the following packages:
 * Platform/Intel/SimicsOpenBoardPkg
 * Silicon/Intel/SimicsIch10Pkg
 * Silicon/Intel/SimicsX58SktPkg

Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Agyeman Prince <prince.agyeman@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2019-11-27 17:14:20 -08:00
Ard Biesheuvel
110d011628 Platform/RPi3: Add acpiview to the builtin UEFI Shell
acpiview is a UEFI shell command that can be used to inspect and
validate ACPI tables from the pre-OS environment. Let's add it to
our build of the shell.

Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2019-11-26 17:04:04 +00:00
Ard Biesheuvel
e9db04631b Platform/RPi3: Disable DEBUG output at runtime for the RTC driver
Using DEBUG () at runtime can crash the OS if we don't take care to
inhibit serial output to MMIO mapped UARTs that we don't inform the
OS about via the memory map.

So use a version of DebugLib that does exactly that for the RTC
driver.

Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2019-11-26 17:03:56 +00:00
Nate DeSimone
0d076ec2a2 MinPlatformPkg: Remove BoardInitLib dependency from PlatformSecLib
SecFspWrapperPlatformSecLib contains the implementation of
SecPlatformDisableTemporaryMemory(), which SecMain in UefiCpuPkg will
call as part of its implementation of EFI_PEI_TEMPORARY_RAM_DONE_PPI.
For platforms that use FSP, the implementation of
SecPlatformDisableTemporaryMemory() can be made generic since the chipset
specifics will be contained in FspTempRamExit().

The Minimum Platform Specification provides the BoardPkg two
interface hook points, BoardInitBeforeTempRamExit() and
BoardInitAfterTempRamExit() which must be called during
SecPlatformDisableTemporaryMemory(). Due to EFI_PEI_TEMPORARY_RAM_DONE_PPI
being a special case of a PPI that is implemented in SEC, these two
functions are the only ones in BoardInitLib that need to be called
by SEC.

Linking BoardInitLib with SEC places many restrictions on the
implementation of that library. The features available to SEC phase
code are very minimal. Since this code runs during PEI phase, these
restrictions are not actually required.

Instead of directly linking with BoardInitLib,
SecPlatformDisableTemporaryMemory() shall call BoardInitLib indirectly
through a PPI (PLATFORM_INIT_TEMP_RAM_EXIT_PPI.) This PPI is produced
by PlatformInitPreMem, which implements the other BoardInitLib calls
already, so this change should also slightly reduce the size of the
final binary image since less PE/COFF images will need to link with
BoardInitLib.

Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
2019-11-22 14:49:05 -08:00
Nate DeSimone
eed57c639f KabylakeOpenBoardPkg: Remove SecFspWrapperPlatformSecLib override
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
2019-11-22 14:48:43 -08:00
Nate DeSimone
e095bc11c4 KabylakeOpenBoardPkg: Add support for PcdFspDispatchModeUseFspPeiMain
If PcdFspDispatchModeUseFspPeiMain is FALSE, then the BoardPkg
should include PeiMain in FvPreMemory.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
2019-11-22 14:48:21 -08:00
Nate DeSimone
6da580ba73 MinPlatformPkg: Coding style cleanups in MinPlatformPkg.dec
Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
2019-11-22 14:48:00 -08:00
Nate DeSimone
9759d8767b MinPlatformPkg: FSP Dispatch Mode Support for PlatformSecLib
Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
2019-11-22 14:47:33 -08:00
Nate DeSimone
75a46163f8 WhiskeylakeOpenBoardPkg: Remove SecFspWrapperPlatformSecLib override
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
2019-11-22 14:47:05 -08:00
Nate DeSimone
d58953352b WhiskeylakeOpenBoardPkg: Whitespace cleanup in BoardInitLib
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
2019-11-22 14:46:32 -08:00
Nate DeSimone
8257adb159 WhiskeylakeOpenBoardPkg: Add SiliconInitLib APIs to BoardInitLib
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
2019-11-22 14:46:08 -08:00
Nate DeSimone
ad201bed9e CoffeelakeSiliconPkg: Add SiliconInitLib
SiliconInitLib contains Silicon Init APIs that can be reused
by BoardInitLib. It is expected that several implementations
of BoardInitLib exist for a given SOC, these APIs allow the
various BoardInitLib implementations to reuse common silicon
initialization code. This matches the implementation already
found in KabylakeSiliconPkg. This change also adds halting
the TCO watch dog timer to PEI, which was previously done in SEC.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
2019-11-22 14:45:41 -08:00
Nate DeSimone
478de9bc3e CoffeeLakeSiliconPkg: TcoWdtHob.h Cleanup
Removes duplicate EFI_HOB_GENERIC_HEADER and EFI_HOB_GUID_TYPE
definitions from TcoWdtHob.h

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
2019-11-22 14:45:13 -08:00
Nate DeSimone
cd76662a7e CoffeeLakeSiliconPkg: Move TcoWdtHob.h
Moves TcoWdtHob.h from WhiskeylakeOpenBoardPkg to CoffeelakeSiliconPkg.
Oddly, gTcoWdtHobGuid was defined in CoffeelakeSiliconPkg/SiPkg.dec
while the HOB definition itself was in WhiskeylakeOpenBoardPkg,
this change cleans up the disparity.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
2019-11-22 14:44:01 -08:00
Nate DeSimone
fed1ba9c91 KabylakeSiliconPkg: Cleanup old comments
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
2019-11-22 14:43:12 -08:00
Nate DeSimone
ef29fb4af9 KabylakeOpenBoardPkg: Update location of SiliconInitLib
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
2019-11-22 14:41:24 -08:00
Nate DeSimone
8c14c7a1a7 KabylakeSiliconPkg: Change MODULE_TYPE of SiliconInitLib to PEIM
This library contains PEI phase only code. For example,
ClearIchSmiAndWake() calls PeiServicesGetBootMode().
Accordingly, this library should have never been marked as
a BASE library.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
2019-11-22 14:36:24 -08:00
Pete Batard
61b6c05bdf Platform/RPi: Clean up and improve early memory init
This patch improves memory initialization for the Raspberry Pi Platform by:

Using VideoCore mailbox data to reserve only the regions that are actually
mapped. Especially, besides the base RAM size, which was already set using
VideoCore data, we can set the GPU/VideoCore base address as well as the
extended RAM, which is the memory beyond 1 GB that is available on models
such as the Raspberry Pi 4 (for the 2GB or 4GB versions).

Introducing a new PcdExtendedMemoryBase PCD for the base address of the
extended memory region, which currently cannot be retrieved from VideoCore
(MBOX_GET_ARM_MEMSIZE still only returns a single region on Bcm2711).

Introducing a new RpiPlatformGetVirtualMemoryInfo() companion call to
ArmPlatformGetVirtualMemoryMap() that allows us greatly simplify the
registration of each segment in MemoryPeim() as well as making it easier
to maintain for future models.

We also fix SoC register space that should have been marked as reserved
but wasn't until now and remove the unreferenced mSystemMemoryEnd extern
in MemoryInitPeiLib.c.

RaspberryPiMem.c incorporates some code from ArmJunoMem.c.

Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2019-11-19 18:17:55 +00:00
Pete Batard
24cc66af82 Platform/RPi: Read more variables from VideoCore during early init
Besides the base memory size, we can read the GPU/VideoCore base as
well as the model during early init, which we'll need for improving
the memory mapping.

This patch adds the retrieval of these variables, as well as some
early debug display of their values (which can be useful) and also
removes unused variables such as mGPUMemoryBase and mGPUMemoryLength.

Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2019-11-19 18:17:09 +00:00
Pete Batard
1cd9a49eb4 Silicon/Broadcom: Add Bcm2711 header
Bcm2711 is the SoC used by the Raspberry Pi 4. For the most part it
is backward compatible with the Bcm283x SoC used by older models but
some new Bcm2711 registers have been introduced such as the ones for
PCIe.

We therefore introduce a new Bcm27xx module, which contains only the
base address for the new registers for now (set from a PCD as is the
case for Bcm283x) but which should get populated further as we add
support for the Raspberry Pi 4.

Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
2019-11-19 18:16:42 +00:00
Samer El-Haj-Mahmoud
151562f82d Platform/RPi: Use offsets for Bcm238x SoC register addresses
Remove hardcoded base addresses for Mailbox, Watchdog, SDIO and
DW2 USB and use an offset indexed on PcdBcm283xRegistersAddress
instead. This is needed in preparation for adding Raspberry Pi 4
support.

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-11-19 18:15:16 +00:00
Samer El-Haj-Mahmoud
e46085f14e Platform/RPi: Replace Bcm283x SoC base register address with a PCD
Define BCM2836_SOC_REGISTERS from PcdBcm283xRegistersAddress. This is
needed in preparation for adding Raspberry Pi 4 support, since the two
Pi's have a different base addresses for the Bcm283x specific registers.

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-11-19 18:13:57 +00: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
Samer El-Haj-Mahmoud
352fab3b5c Platform/RPi: Add missing model name
Add a missing entry for the "Raspberry Pi Compute Module 3+" in
RpiFirmwareGetModelName ().

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
2019-11-19 18:12:17 +00:00