PcAtChipsetPkg: Add PCD for RTC default year

Add PcdRtcDefaultYear to specify the default year to use when
the RTC is in an invalid state. Make sure PcdRtcDefaultYear is
>= PcdMinimalValidYear and <= PcdMaximalValidYear.  Set the
default value for this PCD to PcdMinimalValidYear to preserve
the existing behavior. A platform DSC file can override this
default value setting.

Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
This commit is contained in:
Michael D Kinney
2023-03-25 19:41:38 -07:00
committed by mergify[bot]
parent b1db096575
commit d55d73152e
4 changed files with 13 additions and 2 deletions

View File

@@ -317,7 +317,7 @@ PcRtcInit (
Time.Hour = RTC_INIT_HOUR;
Time.Day = RTC_INIT_DAY;
Time.Month = RTC_INIT_MONTH;
Time.Year = PcdGet16 (PcdMinimalValidYear);
Time.Year = PcdGet16 (PcdRtcDefaultYear);
Time.Nanosecond = 0;
Time.TimeZone = EFI_UNSPECIFIED_TIMEZONE;
Time.Daylight = 0;
@@ -357,7 +357,7 @@ PcRtcInit (
Time.Hour = RTC_INIT_HOUR;
Time.Day = RTC_INIT_DAY;
Time.Month = RTC_INIT_MONTH;
Time.Year = PcdGet16 (PcdMinimalValidYear);
Time.Year = PcdGet16 (PcdRtcDefaultYear);
Time.Nanosecond = 0;
Time.TimeZone = Global->SavedTimeZone;
Time.Daylight = Global->Daylight;