mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-28 08:04:07 +02:00
PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe: Replace RTC macros
Use FixedPCD's to set platform-specific values for RTC registers. Specifically, the replaced macros are: 1) RTC_INIT_REGISTER_A 2) RTC_INIT_REGISTER_B 3) RTC_INIT_REGISTER_D Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Leo Duran <leo.duran@amd.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
This commit is contained in:
parent
e78aab9d2f
commit
8794bf26c6
@ -2,6 +2,8 @@
|
|||||||
RTC Architectural Protocol GUID as defined in DxeCis 0.96.
|
RTC Architectural Protocol GUID as defined in DxeCis 0.96.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||||
|
Copyright (c) 2017, AMD Inc. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -128,7 +130,7 @@ PcRtcInit (
|
|||||||
// Make sure Division Chain is properly configured,
|
// Make sure Division Chain is properly configured,
|
||||||
// or RTC clock won't "tick" -- time won't increment
|
// or RTC clock won't "tick" -- time won't increment
|
||||||
//
|
//
|
||||||
RegisterA.Data = RTC_INIT_REGISTER_A;
|
RegisterA.Data = FixedPcdGet8 (PcdInitialValueRtcRegisterA);
|
||||||
RtcWrite (RTC_ADDRESS_REGISTER_A, RegisterA.Data);
|
RtcWrite (RTC_ADDRESS_REGISTER_A, RegisterA.Data);
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -144,7 +146,7 @@ PcRtcInit (
|
|||||||
//
|
//
|
||||||
// Clear RTC register D
|
// Clear RTC register D
|
||||||
//
|
//
|
||||||
RegisterD.Data = RTC_INIT_REGISTER_D;
|
RegisterD.Data = FixedPcdGet8 (PcdInitialValueRtcRegisterD);
|
||||||
RtcWrite (RTC_ADDRESS_REGISTER_D, RegisterD.Data);
|
RtcWrite (RTC_ADDRESS_REGISTER_D, RegisterD.Data);
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -176,7 +178,7 @@ PcRtcInit (
|
|||||||
// Set RTC configuration after get original time
|
// Set RTC configuration after get original time
|
||||||
// The value of bit AIE should be reserved.
|
// The value of bit AIE should be reserved.
|
||||||
//
|
//
|
||||||
RegisterB.Data = RTC_INIT_REGISTER_B | (RegisterB.Data & BIT5);
|
RegisterB.Data = FixedPcdGet8 (PcdInitialValueRtcRegisterB) | (RegisterB.Data & BIT5);
|
||||||
RtcWrite (RTC_ADDRESS_REGISTER_B, RegisterB.Data);
|
RtcWrite (RTC_ADDRESS_REGISTER_B, RegisterB.Data);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
Header file for real time clock driver.
|
Header file for real time clock driver.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||||
|
Copyright (c) 2017, AMD Inc. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -75,13 +77,6 @@ extern PC_RTC_MODULE_GLOBALS mModuleGlobal;
|
|||||||
#define RTC_INIT_DAY 1
|
#define RTC_INIT_DAY 1
|
||||||
#define RTC_INIT_MONTH 1
|
#define RTC_INIT_MONTH 1
|
||||||
|
|
||||||
//
|
|
||||||
// Register initial values
|
|
||||||
//
|
|
||||||
#define RTC_INIT_REGISTER_A 0x26
|
|
||||||
#define RTC_INIT_REGISTER_B 0x02
|
|
||||||
#define RTC_INIT_REGISTER_D 0x0
|
|
||||||
|
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
//
|
//
|
||||||
// Register A
|
// Register A
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
# It will install a tagging protocol with gEfiRealTimeClockArchProtocolGuid.
|
# It will install a tagging protocol with gEfiRealTimeClockArchProtocolGuid.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||||
|
# Copyright (c) 2017, AMD Inc. All rights reserved.<BR>
|
||||||
|
#
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
# which accompanies this distribution. The full text of the license may be found at
|
# which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -66,13 +68,18 @@
|
|||||||
## SOMETIMES_CONSUMES ## SystemTable
|
## SOMETIMES_CONSUMES ## SystemTable
|
||||||
gEfiAcpiTableGuid
|
gEfiAcpiTableGuid
|
||||||
|
|
||||||
[Depex]
|
[FixedPcd]
|
||||||
gEfiVariableArchProtocolGuid AND gEfiVariableWriteArchProtocolGuid
|
gPcAtChipsetPkgTokenSpaceGuid.PcdInitialValueRtcRegisterA ## CONSUMES
|
||||||
|
gPcAtChipsetPkgTokenSpaceGuid.PcdInitialValueRtcRegisterB ## CONSUMES
|
||||||
|
gPcAtChipsetPkgTokenSpaceGuid.PcdInitialValueRtcRegisterD ## CONSUMES
|
||||||
|
|
||||||
[Pcd]
|
[Pcd]
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdRealTimeClockUpdateTimeout ## CONSUMES
|
gEfiMdeModulePkgTokenSpaceGuid.PcdRealTimeClockUpdateTimeout ## CONSUMES
|
||||||
gPcAtChipsetPkgTokenSpaceGuid.PcdMinimalValidYear ## CONSUMES
|
gPcAtChipsetPkgTokenSpaceGuid.PcdMinimalValidYear ## CONSUMES
|
||||||
gPcAtChipsetPkgTokenSpaceGuid.PcdMaximalValidYear ## CONSUMES
|
gPcAtChipsetPkgTokenSpaceGuid.PcdMaximalValidYear ## CONSUMES
|
||||||
|
|
||||||
|
[Depex]
|
||||||
|
gEfiVariableArchProtocolGuid AND gEfiVariableWriteArchProtocolGuid
|
||||||
|
|
||||||
[UserExtensions.TianoCore."ExtraFiles"]
|
[UserExtensions.TianoCore."ExtraFiles"]
|
||||||
PcRtcExtra.uni
|
PcRtcExtra.uni
|
||||||
|
Loading…
x
Reference in New Issue
Block a user