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>
RTC Architectural Protocol GUID as defined in DxeCis 0.96.\r
\r
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2017, AMD Inc. All rights reserved.<BR>\r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
// Make sure Division Chain is properly configured,\r
// or RTC clock won't "tick" -- time won't increment\r
//\r
- RegisterA.Data = RTC_INIT_REGISTER_A;\r
+ RegisterA.Data = FixedPcdGet8 (PcdInitialValueRtcRegisterA);\r
RtcWrite (RTC_ADDRESS_REGISTER_A, RegisterA.Data);\r
\r
//\r
//\r
// Clear RTC register D\r
//\r
- RegisterD.Data = RTC_INIT_REGISTER_D;\r
+ RegisterD.Data = FixedPcdGet8 (PcdInitialValueRtcRegisterD);\r
RtcWrite (RTC_ADDRESS_REGISTER_D, RegisterD.Data);\r
\r
//\r
// Set RTC configuration after get original time\r
// The value of bit AIE should be reserved.\r
//\r
- RegisterB.Data = RTC_INIT_REGISTER_B | (RegisterB.Data & BIT5);\r
+ RegisterB.Data = FixedPcdGet8 (PcdInitialValueRtcRegisterB) | (RegisterB.Data & BIT5);\r
RtcWrite (RTC_ADDRESS_REGISTER_B, RegisterB.Data);\r
\r
//\r
Header file for real time clock driver.\r
\r
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2017, AMD Inc. All rights reserved.<BR>\r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
#define RTC_INIT_DAY 1\r
#define RTC_INIT_MONTH 1\r
\r
-//\r
-// Register initial values\r
-//\r
-#define RTC_INIT_REGISTER_A 0x26\r
-#define RTC_INIT_REGISTER_B 0x02\r
-#define RTC_INIT_REGISTER_D 0x0\r
-\r
#pragma pack(1)\r
//\r
// Register A\r
# It will install a tagging protocol with gEfiRealTimeClockArchProtocolGuid.\r
#\r
# Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2017, AMD Inc. All rights reserved.<BR>\r
+#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
## SOMETIMES_CONSUMES ## SystemTable\r
gEfiAcpiTableGuid\r
\r
-[Depex]\r
- gEfiVariableArchProtocolGuid AND gEfiVariableWriteArchProtocolGuid\r
+[FixedPcd]\r
+ gPcAtChipsetPkgTokenSpaceGuid.PcdInitialValueRtcRegisterA ## CONSUMES\r
+ gPcAtChipsetPkgTokenSpaceGuid.PcdInitialValueRtcRegisterB ## CONSUMES\r
+ gPcAtChipsetPkgTokenSpaceGuid.PcdInitialValueRtcRegisterD ## CONSUMES\r
\r
[Pcd]\r
gEfiMdeModulePkgTokenSpaceGuid.PcdRealTimeClockUpdateTimeout ## CONSUMES\r
gPcAtChipsetPkgTokenSpaceGuid.PcdMinimalValidYear ## CONSUMES\r
gPcAtChipsetPkgTokenSpaceGuid.PcdMaximalValidYear ## CONSUMES\r
\r
+[Depex]\r
+ gEfiVariableArchProtocolGuid AND gEfiVariableWriteArchProtocolGuid\r
+\r
[UserExtensions.TianoCore."ExtraFiles"]\r
PcRtcExtra.uni\r