audk/ArmPlatformPkg
Laszlo Ersek d85bf54b7f ArmPlatformPkg/PL031RealTimeClockLib: remove needless instance init steps
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-24 16:05:00 +00:00
..
Drivers ArmPlatformPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
Include/Library ArmPlatformPkg: Retire NorFlashDxe driver 2022-11-06 15:21:12 +00:00
Library ArmPlatformPkg/PL031RealTimeClockLib: remove needless instance init steps 2023-10-24 16:05:00 +00:00
MemoryInitPei ArmPlatformPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PlatformPei ArmPlatformPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PrePeiCore ArmPlatformPkg/PrePeiCore: Make vector table object BTI compatible 2023-03-30 11:05:22 +00:00
PrePi ArmPlatformPkg: Remove RVCT support 2022-05-13 14:58:54 +00:00
Scripts ArmPlatformPkg: Remove RVCT support 2022-05-13 14:58:54 +00:00
ArmPlatformPkg.ci.yaml ArmPlatformPkg: Update YAML to ignore specific ECC files/errors 2021-11-30 14:19:07 +00:00
ArmPlatformPkg.dec ArmPlatformPkg: Retire NorFlashDxe driver 2022-11-06 15:21:12 +00:00
ArmPlatformPkg.dsc ArmPlatformPkg: Retire NorFlashDxe driver 2022-11-06 15:21:12 +00:00
SecureBootDefaultKeys.fdf.inc ArmPlatformPkg: Create include file for default key content. 2021-08-03 07:26:41 +00:00