summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg
AgeCommit message (Collapse)AuthorFilesLines
13 daysArmPkg,MdePkg: Move ArmPkg/Chipset/Aarch64[|Mmu].h to MdePkgPierre Gondois1-1/+1
Following the discussion at [1] and as the ArmLib relies on them, move ArmPkg/Chipset/Aarch64[|Mmu].h files to the MdePkg. Update the path to correctly include the moved files. [1] https://edk2.groups.io/g/devel/message/111566 Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
13 daysArmPkg,MdePkg: Move ArmPkg/Chipset/ArmV7[|Mmu].h to MdePkgPierre Gondois3-3/+3
Following the discussion at [1] and as the ArmLib relies on them, move ArmPkg/Chipset/ArmV7[|Mmu].h files to the MdePkg. Update the path to correctly include the moved files. [1] https://edk2.groups.io/g/devel/message/111566 Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-03-08ArmPlatformPkg: auto-generate SEC ProcessLibraryConstructorList() declLaszlo Ersek6-20/+4
Rely on AutoGen for declaring ProcessLibraryConstructorList(). Build-tested with: build -a AARCH64 -b DEBUG \ -m ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf \ -p ArmPlatformPkg/ArmPlatformPkg.dsc -t GCC5 build -a AARCH64 -b DEBUG \ -m ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf \ -p ArmPlatformPkg/ArmPlatformPkg.dsc -t GCC5 build -a AARCH64 -b DEBUG \ -m ArmPlatformPkg/PrePi/PeiMPCore.inf \ -p ArmPlatformPkg/ArmPlatformPkg.dsc -t GCC5 build -a AARCH64 -b DEBUG \ -m ArmPlatformPkg/PrePi/PeiUniCore.inf \ -p ArmPlatformPkg/ArmPlatformPkg.dsc -t GCC5 Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=990 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20240305113843.68812-6-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2024-02-09ArmPlatformPkg: Align PL031 library function headers with return valuesSuqiang Ren1-4/+18
RealTimeClockLib is used to back the runtime services time functions, so align the description of the function return values with the defined values for these services as described in UEFI Spec 2.10. REF: UEFI spec 2.10 section 8 Services ? Runtime Services Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Signed-off-by: Suqiang Ren <suqiangx.ren@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2023-10-24ArmPlatformPkg/PL031RealTimeClockLib: remove needless instance init stepsLaszlo Ersek1-13/+0
RealTimeClockLib instances are consumed by edk2's EmbeddedPkg/RealTimeClockRuntimeDxe driver. In its entry point function InitializeRealTimeClock(), the driver: (1) calls LibRtcInitialize(), (2) sets the GetTime(), SetTime(), GetWakeupTime() and SetWakeupTime() runtime services to its own similarly-named functions -- where those functions wrap the corresponding RealTimeClockLib APIs, (3) installs EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL with a NULL protocol interface. Steps (2) and (3) conform to PI v1.8 sections II-9.7.2.4 through II-9.7.2.7. However, this means that LibRtcInitialize() (of any RealTimeClockLib instance) should not itself (a) set the GetTime(), SetTime(), GetWakeupTime() and SetWakeupTime() runtime services, nor (b) install EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL. The runtime service pointers will be overwritten in step (2) anyway, and step (3) will uselessly install a second (NULL-interface) EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL instance in the protocol database. (The protocol only serves to notify the DXE Foundation about said runtime services being available.) Clean up ArmPlatformPkg/PL031RealTimeClockLib accordingly (it only has code that's redundant for step (3); it does not try to set "gRT" fields). (Note that the lib instance INF file already does not list gEfiRealTimeClockArchProtocolGuid.) Tested with ArmVirtQemu. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4565 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20231020121748.44862-1-lersek@redhat.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> [lersek@redhat.com: shorten patch subject line]
2023-10-18ArmPlatformPkg/PL031RealTimeClockLib: hide LibRtcVirtualNotifyEventLaszlo Ersek1-2/+3
The RealTimeClockLib class header in edk2 mistakenly declares a function called LibRtcVirtualNotifyEvent(). No component ever calls this function crossing module boundaries; all RealTimeClockLib instances in edk2 and edk2-platforms are supposed to register (and do register) their SetVirtualAddressMap() notification functions. Rename LibRtcVirtualNotifyEvent() to VirtualNotifyEvent(), and make it static, in preparation for removing the LibRtcVirtualNotifyEvent() declaration from the lib class header later. Build- and boot-tested with ArmVirtQemu. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20231012091057.108728-3-lersek@redhat.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2023-04-10ArmPlatformPkg: Update code to be more C11 compliant by using __func__Rebecca Cran1-2/+2
__FUNCTION__ is a pre-standard extension that gcc and Visual C++ among others support, while __func__ was standardized in C99. Since it's more standard, replace __FUNCTION__ with __func__ throughout ArmPlatformPkg. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2023-03-30ArmPlatformPkg/PrePeiCore: Make vector table object BTI compatibleArd Biesheuvel1-0/+2
The object file containing the vector table does not contain any callable functions, so it will not be implicitly annotated as BTI compatible on BTI builds. So add the annotation by hand, and use the 'empty' type so we get the GNU ELF note but not the actual BTI opcode. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com> Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
2022-11-06ArmPlatformPkg: Retire NorFlashDxe driverArd Biesheuvel13-3433/+0
The NorFlashDxe driver in ArmPlatformPkg was shared between development platforms built by ARM Ltd, and virtual platforms that were once modeled after Versatile Express, but have very little in common with actual bare metal implementations. Both sides have migrated to a domain specific version of the driver, so we can retire the old one. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
2022-10-25ArmPlatformPkg/PrePeiCore: Print the firmware version early in bootRebecca Cran3-0/+35
Copy code from PrePi to PrePeiCore that prints the firmware version and build date early in the boot process. Signed-off-by: Rebecca Cran <rebecca@quicinc.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Tested-by: Oliver Steffen <osteffen@redhat.com> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2022-10-24ArmPlatformPkg/PrePeiCore: permit entry with the MMU enabledArd Biesheuvel1-11/+13
Some platforms may set up a preliminary ID map in flash and enter EFI with the MMU and caches enabled, as this removes a lot of the complexity around cache coherency. Let's take this into account, and avoid touching the MMU controls or perform cache invalidation when the MMU is enabled at entry. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2022-09-09ArmPlatformPkg/NorFlashDxe: Remove unused debug print specifierMichael Kubacki1-2/+2
These debug messages are repeated in both NorFlashBlockIoReadBlocks() and NorFlashBlockIoWriteBlocks(): "NorFlashBlockIoWriteBlocks(MediaId=0x%x, Lba=%ld, BufferSize=0x%x" "bytes (%d kB), BufferPtr @ 0x%08x)\n" Although this requires 5 arguments, only 4 are provided. The kilobyte value was never given. This change removes that specifier so the 4 arguments match the 4 specifiers in the debug macro. Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2022-09-05ArmPlatformPkg: Remove duplicated wordsPierre Gondois1-1/+1
In an effort to clean the documentation of the above package, remove duplicated words. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.muajwar@arm.com> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2022-09-05ArmPlatformPkg/PrePeiCore: Invoke constructors for SEC phaseRohit Mathew2-2/+16
On platforms that do not have the serial console port pre-initialized prior to the SEC phase and due to the absence of a call to "SerialPortInitialize", this results in missing debug logs. So, call the auto-generated "ProcessLibraryConstructorList" function from SEC phase to have all the dependent library constructors called (this includes a call to "SerialPortInitialize"). Signed-off-by: Rohit Mathew <rohit.mathew@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2022-06-22ArmPlatformPkg: Add PCD for serial debug port interruptThomas Abraham1-0/+1
For Arm platforms that support more that one serial port, one of the serial port can be used for connecting debuggers such as WinDbg. There are PCDs that allow the base address and clock rate to be specified for this debug serial port but not its interrupt number. So add a PCD to specify the interrupt number assigned to the serial debug port controller. Signed-off-by: Thomas Abraham <thomas.abraham@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2022-06-22ArmPlatformPkg: Remove overly verbose DEBUG lines in LcdGraphicsBltRebecca Cran1-12/+0
The DEBUG output in LcdGraphicsBlt is overly verbose, and makes using the console difficult, for example when using the UiApp. Since the extra output should no longer be needed, delete the DEBUG lines. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2022-05-13ArmPlatformPkg: Remove RVCT supportRebecca Cran13-540/+1
RVCT is obsolete and no longer used. Remove support for it. Signed-off-by: Rebecca Cran <quic_rcran@quicinc.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2022-05-03ArmPlatformPkg: Fix EDK2_DSC check in Scripts/MakefileRebecca Cran1-1/+1
With GNU Make 4.2.1, ifeq ($(EDK2_DSC),"") doesn't catch the case where EDK2_DSC isn't defined. So, switch to using ifndef. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2022-05-03ArmPlatformPkg: Fix target initialisation in cmd_load_symbols.pyRebecca Cran1-3/+2
The debugger in Arm Development Studio 2021.2 doesn't work with "ec = debugger.getExecutionContext(0)" because it's subsequently unable to access memory. Fix it by switching to "ec = debugger.getCurrentExecutionContext()". The documentation for waitForStop() says: "It is not needed after a call to stop() because stop() is blocking." So, remove the call to waitForStop. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2022-05-03ArmPlatformPkg: Fix error message in Scripts/Ds5/edk2_debugger.pyRebecca Cran1-1/+1
An error message in Scripts/Ds5/edk2_debugger.py was missing the word 'not'. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2022-01-30ArmPkg: Replace CoreId and ClusterId with Mpidr in ARM_CORE_INFO structRebecca Cran3-6/+10
Remove the ClusterId and CoreId fields in the ARM_CORE_INFO structure in favor of a new Mpidr field. Update code in ArmPlatformPkg/PrePeiCore/MainMPCore and ArmPlatformPkg/PrePi/MainMPCore.c to use the new field and call new macros GET_MPIDR_AFF0 and GET_MPIDR_AFF1 instead. Signed-off-by: Rebecca Cran <rebecca@nuviainc.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2021-12-07ArmPlatformPkg: Apply uncrustify changesMichael Kubacki47-2691/+2875
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the ArmPlatformPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Andrew Fish <afish@apple.com>
2021-12-07ArmPlatformPkg: Change OPTIONAL keyword usage styleMichael D Kinney2-6/+6
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3760 Update all use of ', OPTIONAL' to ' OPTIONAL,' for function params. Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Andrew Fish <afish@apple.com>
2021-12-07ArmPlatformPkg: Change use of EFI_D_* to DEBUG_*Michael D Kinney7-22/+21
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3739 Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines. Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2021-11-30ArmPlatformPkg: Update YAML to ignore specific ECC files/errorsMichael D Kinney1-1/+2
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3749 Update package YAML files to ignore ECC errors that are already present. These issues must be fixed in the future, but should not block source code changes for these known issues. Cc: Leif Lindholm <leif@nuviainc.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
2021-08-03ArmPlatformPkg: Create include file for default key content.Grzegorz Bernacki1-0/+70
This commits add file which can be included by platform Flash Description File. It allows to specify certificate files, which will be embedded into binary file. The content of these files can be used to initialize Secure Boot default keys and databases. Signed-off-by: Grzegorz Bernacki <gjb@semihalf.com> Reviewed-by: Sunny Wang <sunny.wang@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2021-07-19ArmPlatformPkg/Scripts: Infer dll load address from console outputArtem Kopotev2-2/+83
cmd_load_symbols.py can only load symbols from FV. Add the possibility to use UEFI console output to calculate dll load address and send add-symbol-file commands directly to ArmDS debugger dll load address can't be used directly from UEFI output, see comment in DebugPeCoffExtraActionLib: "This may not work correctly if you generate PE/COFF directly as then the Offset would not be required". 1) Use objdump -S module.dll | grep <_ModuleEntryPoint> to get offset in dll (offset) 2) Use Entrypoint=<address> from UEFI console output (entrypoint) 3) dll load address is (entrypoint)-(offset) Signed-off-by: Artem Kopotev <artem.kopotev@arm.com> Tested-by: Pierre Gondois <Pierre.Gondois@arm.com>
2021-06-16ArmPlatformPkg: SpellCheck: Switch spellcheck CI to AuditOnlySean Brogan1-1/+1
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3445 Spellcheck was not covering all specified files due to CSpell v5 and Node v10 incompatibility of current CI pipeline configuration. This change switches the spellcheck for ArmPlatformPkg to AuditOnly to avoid potentially numerous spell errors. The correction action is to be revisited by package maintainers once the tool incompatibility is resolved. Cc: Leif Lindholm <leif@nuviainc.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Signed-off-by: Sean Brogan <sean.brogan@microsoft.com> Signed-off-by: Kun Qin <kuqin12@gmail.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2021-04-28ArmPlatformPkg: Add ArmPlatformPkg.ci.yamlPierre Gondois1-0/+100
Add ArmPlatformPkg.ci.yaml to configure the CI for the ArmPlatformPkg. Cc: Bret Barkelew <bret.barkelew@microsoft.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2021-04-28ArmPlatformPkg: Document libraries in ArmPlatformPkg.decPierre Gondois1-1/+18
This patch documents the libraries advertised in ArmPlatformPkg.dec. Cc: Bret Barkelew <bret.barkelew@microsoft.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2021-04-15ArmPkg: Fix Ecc error 8001 in ChipsetPierre Gondois1-5/+5
This patch fixes the following Ecc reported error: Only capital letters are allowed to be used for #define declarations Edk2 coding standard stating that: "Names starting with one or two underscores, such as _MACRO_GUARD_FILE_NAME_H_, must not be used." the include guard of ArmCortexA5x.h is also updated. Ref: https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification/ 5_source_files/53_include_files# 5-3-5-all-include-file-contents-must-be-protected-by-a-include-guard Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2021-04-15ArmPlatformPkg: Remove package dependency in NorFlashStandaloneMmPierre Gondois1-1/+0
The DependencyCheck available in .pytool detects an unnecessary dependency of the NorFlashStandaloneMm.inf module over the EmbeddedPkg package. This patch removes this dependency. Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Tested-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2021-04-15ArmPlatformPkg: Fix Ecc error 9001Pierre Gondois2-15/+15
This patch fixes the following Ecc reported error: INF/DEC/DSC/FDF file header comment should begin with "## @file" or "# @file" at the very top file Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2021-04-15ArmPlatformPkg: Fix Ecc error 8001Pierre Gondois29-151/+151
This patch fixes the following Ecc reported error: File header doesn't exist File header comment missing the ""Copyright"" Even though a copyright is present in the header file, the leading '*' char prevents the Ecc tool from detecting it. According to the edk2 coding specifcation, section 5.2.3 "File Heading", there should not be leading '*' char. Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2021-03-31ArmPlatformPkg: Consume MdeLibs.dsc.inc for RegisterFilterLibDandan Bi1-0/+2
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246 MdeLibs.dsc.inc was added for some basic/default library instances provided by MdePkg and RegisterFilterLibNull Library was also added into it as the first version of MdeLibs.dsc.inc. So update platform dsc to consume MdeLibs.dsc.inc for RegisterFilterLibNull which will be consumed by IoLib and BaseLib. Cc: Leif Lindholm <leif@nuviainc.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2021-01-18ArmPlatformPkg/NorFlashDxe: use correct PCD accessorsArd Biesheuvel3-8/+9
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>
2021-01-07ArmPlatformPkg: Enable support for flash in 64-bit address spaceVijayenthiran Subramaniam5-23/+92
The existing NOR Flash DXE and StandaloneMm driver supports NOR flash devices connected in the 32-bit address space. Extend these drivers to allow NOR flash devices connected to 64-bit address space to be usable as well. Also, convert the base address and size sanity check from ASSERT() to if condition so that even if the firmware is build in release mode, it can return error if the parameter(s) is/are invalid. Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com> Tested-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
2021-01-04ArmPlatformPkg/NorFlashDxe: implement standalone MM versionMasahisa Kojima3-0/+436
Implement a version of the NOR Flash driver that can execute in standalone MM context. This is used to access the secure variable storage, it only supports EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
2021-01-04ArmPlatformPkg/NorFlashDxe: factor out DXE specific piecesMasahisa Kojima6-1080/+1159
In preparation of creating a standalone MM version of the NOR Flash driver, refactor the existing pieces into a core driver. NorFlashDxe.c has the DXE instantiation code, FVB initialization code and some common functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
2021-01-04ArmPlatformPkg: Fix Ecc error 8005Pierre Gondois3-57/+58
This patch fixes the following Ecc reported error: Variable name does not follow the rules: 1. First character should be upper case 2. Must contain lower case characters 3. No white space characters 4. Global variable name must start with a 'g' Indeed, according to the EDK II C Coding Standards Specification, s5.6.2.2 "Enumerated Types" and s4.3.4 Function and Data Names, elements of an enumerated type shoud be a mixed upper- and lower-case text. A max element is also added, as advised by s5.6.2.2.3 of the same document. Reference: https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification/ Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
2020-12-21ArmPlatformPkg/PL031RealTimeClockLib: cast EfiTimeToEpoch() val. to UINT32Laszlo Ersek1-1/+1
In preparation for changing EfiTimeToEpoch()'s return type to UINTN, cast EfiTimeToEpoch()'s retval to UINT32 explicitly, in LibSetTime(). Currently, this is a no-op, and even after widening the retval, it will make no difference, as LibSetTime() explicitly restricts Time->Year under 2106, given that "the PL031 is a 32-bit counter counting seconds". The patch is made for preventing compiler warnings. Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20201221113657.6779-2-lersek@redhat.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
2020-12-09ArmPlatformPkg: Fix cspell reported spelling/wordingPierre Gondois4-8/+8
The edk2 CI runs the "cspell" spell checker tool. Some words are not recognized by the tool, triggering errors. This patch modifies some spelling/wording detected by cspell. Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
2020-12-09ArmPlatformPkg: Fix Ecc error 8001 in PrePiPierre Gondois1-3/+1
This patch fixes the following Ecc reported error: Only capital letters are allowed to be used for #define declarations The "SerialPrint" macro is definied for the PrePi module residing in the ArmPlatformPkg. It is never used in the module. The macro is thus removed. Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
2020-12-09ArmPlatformPkg: Fix Ecc error 10006 in ArmPlatformPkg.dscPierre Gondois1-1/+4
This patch fixes the following Ecc reported error: There should be no unnecessary inclusion of library classes in the INF file This comes with the additional information: "The Library Class [TimeBaseLib] is not used in any platform" "The Library Class [PL011UartClockLib] is not used in any platform" "The Library Class [PL011UartLib] is not used in any platform" Indeed, the PL011SerialPortLib module requires the PL011UartClockLib and PL011UartLib libraries. The PL031RealTimeClockLib module requires the TimeBaseLib library. ArmPlatformPkg/ArmPlatformPkg.dsc builds the two modules, but doesn't build the required libraries. This patch adds the missing libraries to the [LibraryClasses.common] section. Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
2020-12-09ArmPlatformPkg: Fix Ecc error 10014 in SP805WatchdogDxePierre Gondois1-1/+2
This patch fixes the following Ecc reported error: No used module files found The source file [ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805Watchdog.h] is existing in module directory but it is not described in INF file. Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
2020-12-09ArmPlatformPkg: Fix Ecc error 10014 in PL061GpioDxePierre Gondois1-1/+2
This patch fixes the following Ecc reported error: No used module files found The source file [ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.h] is existing in module directory but it is not described in INF file. Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
2020-12-09ArmPlatformPkg: Fix Ecc error 10014 in LcdGraphicsOutputDxePierre Gondois1-2/+3
This patch fixes the following Ecc reported error: No used module files found The source file [ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h] is existing in module directory but it is not described in INF file. Files in [Sources.common] are also alphabetically re-ordered. Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
2020-12-09ArmPlatformPkg: Fix Ecc error 10016 in LcdPlatformNullLibPierre Gondois1-1/+2
This patch fixes the following Ecc reported error: Module file has FILE_GUID collision with other module file The two .inf files with clashing GUID are: edk2\ArmPlatformPkg\PrePeiCore\PrePeiCoreMPCore.inf edk2\ArmPlatformPkg\Library\LcdPlatformNullLib\LcdPlatformNullLib.inf The PrePeiCoreMPCore module has been imported in 2011 and the LcdPlatformNullLib module has been created in 2017. The PrePeiCoreMPCore has the precedence. Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
2020-12-09ArmPlatformPkg: Fix Ecc error 10016 in PrePiPierre Gondois1-1/+2
This patch fixes the following Ecc reported error: Module file has FILE_GUID collision with other module file The two .inf files with clashing GUID are: edk2\ArmPlatformPkg\PrePi\PeiUniCore.inf edk2\ArmPlatformPkg\PrePi\PeiMPCore.inf Both files seem to have been imported from the previous svn repository as the same time. Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
2020-12-09ArmPlatformPkg: Fix Ecc error 5007 in PL031RealTimeClockLibPierre Gondois1-2/+2
This patch fixes the following Ecc reported error: There should be no initialization of a variable as part of its declaration Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>