]> git.proxmox.com Git - mirror_edk2.git/commit
ArmVirtPkg/NorFlashQemuLib: discover NOR flash banks dynamically
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 21 Nov 2018 11:58:27 +0000 (12:58 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 26 Nov 2018 16:57:41 +0000 (17:57 +0100)
commit72e514c90730253a71ba871a0297446018aece65
treefe0b596a3c14e473d0580286d07b8e7d158095b4
parent32f5975770c309723ebb17642f89bbf9670955fd
ArmVirtPkg/NorFlashQemuLib: discover NOR flash banks dynamically

NorFlashQemuLib is one of the last remaining drivers in ArmVirtPkg
that are not based on the device tree received from QEMU.

For ArmVirtQemu, this does not really matter, given that the NOR
flash banks are always the same: the PEI code is linked to execute
in place from flash bank #0, and the fixed varstore PCDs refer to
flash bank #1 directly.

However, ArmVirtQemuKernel can execute at any offset, permitting it
to be used as an intermediary loader when running QEMU with secure
world emulation enabled, in which case NOR flash bank #0 is secure
only and contains the secure world firmware. In this case,
NorFlashQemuLib should not expose the first flash bank at all.

To prevent introducing too much internal knowledge about which flash
bank is accessible under which circumstances, let's switch to using
the DTB to decide which flash banks to expose to the NOR flash driver.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c
ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf