]> git.proxmox.com Git - mirror_edk2.git/commit - ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
ArmPlatformPkg/NorFlashDxe: use correct PCD accessors
authorArd Biesheuvel <ard.biesheuvel@arm.com>
Mon, 11 Jan 2021 10:47:22 +0000 (11:47 +0100)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 18 Jan 2021 11:19:45 +0000 (11:19 +0000)
commit4f214830ce02cf588baba9ae6e7becfd67e5748c
tree74cfc3b2eb042bb96ef335e8316170914503500a
parent7dc277f9e4de5eba0db35af13b7165eb6607ecb9
ArmPlatformPkg/NorFlashDxe: use correct PCD accessors

Commit 8015f3f6d4005d83 ("ArmPlatformPkg: Enable support for flash in
64-bit address space") updated the NorFlash DXE and StMM drivers to
take alternate PCDs into account when discovering the base of the
NOR flash regions.

This introduced a disparity between the declarations of the PCD references
in the .INF files, which permits the use of dynamic PCDs, and the code
itself, which now uses FixedPcdGet() accessors. On platforms that actually
use dynamic PCDs, this results in a build error.

So let's clean this up:
- for the DXE version, use the generic PcdGet() accessors, so dynamic PCDs
  are permitted
- for the standalone MM version, redeclare the PCDs as [FixedPcd] in the
  .INF description, and switch to the FixedPcdGet() accessors.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>
ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashStandaloneMm.c
ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashStandaloneMm.inf