Commit Graph

37 Commits

Author SHA1 Message Date
Ruiyu Ni c8ecaaf5e3 PcAtChipsetPkg/PcRtc: Fix a NULL pointer deference issue
When a platform which doesn't support ACPI 1.0 (no XSDT) and FADT
is not produced at the first time when ACPI table is published,
GetCenturyRtcAddress() unconditionally deference Rsdp->RsdtAddress
but Rsdp->RsdtAddress is 0 in this case.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
2016-07-27 10:27:16 +08:00
Ruiyu Ni 96fcfdbfb0 PcAtChipsetPkg/PcRtc: Fix a stack corruption issue
In 32bit environment, ScanTableInSDT() incorrectly copies 8 bytes
of data to 4-byte pointer Table, which causes the stack corruption.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
2016-07-27 10:27:11 +08:00
Ruiyu Ni e38ab18a49 PcAtChipsetPkg/PcRtc: get century RTC address in entry point
When ACPI table is installed before PcRtc driver runs,
the ACPI table installation callback isn't called which causes the
century value isn't written to the CMOS.
The patch calls GetCenturyRtcAddress() in entry point to fix
the bug.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Anbazhagan Baraneedharan <anbazhagan@hp.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Cc: Star Zeng <star.zeng@intel.com>
2016-05-23 09:59:11 +08:00
Ruiyu Ni 9e11e9225a PcAtChipsetPkg/PcRtc: move ACPI parsing code to GetCenturyRtcAddress
The patch moves ACPI parsing code to a separate function
GetCenturyRtcAddress() and the next patch will call this
function in driver entry point.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Anbazhagan Baraneedharan <anbazhagan@hp.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Cc: Star Zeng <star.zeng@intel.com>
2016-05-23 09:59:11 +08:00
Ruiyu Ni 0119b06607 MdeModulePkg/PcRtc: Still create timezone variable when Daylight != 0
The patch fixes a regression bug caused by last check-in which
causes Daylight setting cannot be set when timezone is unspecified.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-02-03 16:13:18 +08:00
Ruiyu Ni bf46bd4618 PcAtChipsetPkg/Rtc: Don't unnecessarily create timezone variable.
When SetTime() is called with EFI_UNSPECIFIED_TIMEZONE, the code
can optimally not create the private timezone variable because
absence of timezone variable indicates the timezone is unspecified.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19783 6f19259b-4bc3-4df7-8a09-765794883524
2016-02-01 02:32:44 +00:00
Ruiyu Ni a087ab7484 PcAtChipsetPkg/PcRtc: Modify INF file content to follow INF spec
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Shumin Qiu <Shumin.Qiu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19515 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-24 06:36:57 +00:00
Ruiyu Ni 0e3f62b64f PcAtChipsetPkg/PcRtc: Add assertion to pass static code checker
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Shumin Qiu <Shumin.Qiu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19514 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-24 06:36:43 +00:00
Ruiyu Ni 689b78c890 PcAtChipsetPkg/PcRtc: Fix GCC build failure.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19477 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-23 02:23:54 +00:00
Ruiyu Ni 41628cbc7c PcAtChipsetPkg/Rtc: Fix a UEFI Win7 boot hang issue
The patch updates the Century value in CMOS location specified
by FADT.Century to avoid UEFI Win7 hang during booting.
Per the ACPI spec if the FADT.Century is zero, it's not needed
to store the century value in CMOS. But UEFI Win7 treats the
Century storage is optional only when FADT.Century is 0x80.
While Linux strictly follows the ACPI spec and treats Century
storage is optional when FADT.Century is 0.
So if a platform wants to support both UEFI Win7 and Linux,
it needs to report FADT.Century to a traditional value which
doesn't equal to 0 or 0x80 (0x32 mostly). And RTC driver is
enhanced to save the century value to the location specified
by FADT.Century.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19442 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-22 13:52:47 +00:00
Jordan Justen 627f9650c4 PcAtChipsetPkg: Convert all .uni files to utf-8
To convert these files I ran:

$ python3 BaseTools/Scripts/ConvertUni.py PcAtChipsetPkg

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19260 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-15 04:57:25 +00:00
Ruiyu Ni 3e2744e41f PcRtc: Fix PcRtcInit() to not clear RegisterB Hour Format bit (BIT1) sometimes
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17848 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-07 05:41:43 +00:00
Ruiyu Ni fe32096778 PcAtChipsetPkg/PcRtc: Fix a Y2K bug
The original driver cannot handle the case when system time runs from 1999/12/31 23:59:59
to 2000/1/1 0:0:0.
A simple test to set system time to 1999/12/31 23:59:59 can expose this bug.
The patch limits the driver to only support year in 100 range and decide the century value based
on the supporting range: Century either equals to PcdMinimalYear / 100 or equals to PcdMinimalYear / 100 + 1.

The patch passed the Y2K test.
However with year range [1998, 2097], when system time is 2097/12/31 23:59:59,
the next second system time will become 1998/1/1 0:0:0. I think it's a acceptable limitation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17624 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-11 07:14:18 +00:00
Elvin Li 1e5fff631b Added 2 new PCDs for minimal and maximal valid year in RTC.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Elvin Li <elvin.li@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16642 6f19259b-4bc3-4df7-8a09-765794883524
2015-01-23 04:49:00 +00:00
Shumin Qiu 944d79b754 PcAtChipsetPkg: Refine the format of meta data files.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Shumin Qiu <shumin.qiu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>






git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16626 6f19259b-4bc3-4df7-8a09-765794883524
2015-01-20 07:31:57 +00:00
Elvin Li d431bf6e56 Initialize alarm register in PcRtc module entrypoint to make UEFI SCT GetWakeupTime pass.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Elvin Li <elvin.li@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Eric Jin <eric.jin@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16425 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-25 03:38:20 +00:00
Gao, Liming 0ac6a4df55 PcAtChipsetPkg: Convert non DOS format files to DOS format and rename the same module name.
1. Module UNI and Package UNI files are not DOS format. Convert them to DOS format.
2. BaseAcpiTimerLib and DxeAcpiTimerLib has the same module name. Update them to the different name, and add the module uni file with the updated module name. 

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gao, Liming <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16046 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-03 08:48:29 +00:00
Qiu, Shumin 968ac38f12 PcAtChipsetPkg: INF/DEC file updates to EDK II packages
2. Add MODULE_UNI_FILE file that contains the localized Abstract and Description of a module.
a. Addresses an information gap between INF files and the UEFI Distribution Packaging Specification XML schema
b. There will be an associated update to UPT in BaseTools to consume MODULE_UNI_FILE and associated UNI file during UDP creation that performs the INF -> XML conversion.
c. There will be an associated update to UPT in BaseTools to produce MODULE_UNI_FILE and associated UNI file during UDP installation that performs the XML -> INF conversion.

3. Add Module Extra UNI file that provides the localized Name of a module.
a. [UserExtensions.TianoCore."ExtraFiles"] provides an easy method for a module to specify extra files not listed in [Sources] or [Binaries] sections to be added to a UDP without having to list the files in the UPT package information data file.
b. There will be an associated update to UPT in BaseTools to package up files listed in [UserExtensions.TianoCore."ExtraFiles"] during UDP creation.
c. UNI file contains localized name of a module to go along with the localized Abstract and Description from the MODULE_UNI_FILE.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu, Shumin <shumin.qiu@intel.com>
Reviewed-by: Gao, Liming <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15943 6f19259b-4bc3-4df7-8a09-765794883524
2014-08-28 05:18:38 +00:00
Qiu, Shumin 546f14bf7a PcAtChipsetPkg: INF/DEC file updates to EDK II packages
1. Usage information in INF file comment blocks are either incomplete or incorrect.  
This includes usage information for Protocols/PPIs/GUIDs/PCDs/HOBs/Events/BootModes.  
The syntax for usage information in comment blocks is defined in the EDK II Module Information (INF) Specification

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu, Shumin <shumin.qiu@intel.com>
Reviewed-by: Gao, Liming <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15942 6f19259b-4bc3-4df7-8a09-765794883524
2014-08-28 05:17:22 +00:00
Elvin Li 0e991a2f87 Did proper error handling when SetVariable failed, and put RTC write operation at the behind of SetVariable, if SetVariable failed, RTC content could not be changed.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Elvin Li <elvin.li@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15338 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-19 02:42:36 +00:00
li-elvin 44d52203a6 Add missing status code in several modules.
Signed-off-by: Li Elvin <elvin.li@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
Reviewed-by: Ni Ruiyu <ruiyu.ni@intel.com>
Reviewed-by: Gao Liming <liming.gao@intel.com>
Reviewed-by: Tian Feng <feng.tian@intel.com>
Reviewed-by: Fan Jeff <jeff.fan@intel.com>


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13891 6f19259b-4bc3-4df7-8a09-765794883524
2012-10-30 04:25:20 +00:00
erictian ffa1e7834c PcAtChipsetPkg/RTC: Fix a bug in RtcGetWakeUpTime() which may cause its return value wrong
Signed-off-by: Tian Feng <feng.tian@intel.com>
Reviewed-by:   Jin Eric  <Eric.Jin@intel.com>


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13637 6f19259b-4bc3-4df7-8a09-765794883524
2012-08-15 04:38:15 +00:00
erictian 6ff84d99d3 PcAtChipsetPkg: install RTC ARCH protocol even if RTC h/w is functioning incorrectly.
signed-off-by: erictian
reviewed-by: mdkinney

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12756 6f19259b-4bc3-4df7-8a09-765794883524
2011-11-22 06:11:16 +00:00
erictian 9bb1fced77 PcAtChipsetPkg: install RTC ARCH protocol even if the "RTC" variable is corrupted.
signed-off-by: erictian
reviewed-by: hhtian

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12734 6f19259b-4bc3-4df7-8a09-765794883524
2011-11-17 08:35:08 +00:00
erictian e02c57b63b PcAtChipsetPkg: Do right sign extension to avoid a wrong daylight value saving into "RTC" variable
signed-off-by: erictian
reviewed-by: niruiyu

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12732 6f19259b-4bc3-4df7-8a09-765794883524
2011-11-17 06:43:01 +00:00
erictian f1e20ed402 fix GCC build failure. make function definition same with declaration.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11044 6f19259b-4bc3-4df7-8a09-765794883524
2010-11-12 05:14:15 +00:00
erictian aca70749de fix build error
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11024 6f19259b-4bc3-4df7-8a09-765794883524
2010-11-10 07:23:12 +00:00
erictian 7018623cd4 store Year/Month/Day to variable in SetWakeupTime() because PCAT RTC Alarm registers has not corresponding Y/M/D alarm register.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11021 6f19259b-4bc3-4df7-8a09-765794883524
2010-11-10 03:18:21 +00:00
ydong10 24115e4492 RefRefine soma code to make code run safely.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10885 6f19259b-4bc3-4df7-8a09-765794883524
2010-09-17 10:42:10 +00:00
hhtian 95d48e8299 Update the copyright notice format
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10426 6f19259b-4bc3-4df7-8a09-765794883524
2010-04-24 12:07:51 +00:00
klu2 18c97f53ea Refine the file/function comments to follow doxygen format
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10359 6f19259b-4bc3-4df7-8a09-765794883524
2010-04-12 04:38:44 +00:00
lgao4 1ae301da81 Correct copyright to 2010.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10120 6f19259b-4bc3-4df7-8a09-765794883524
2010-02-28 11:37:55 +00:00
lgao4 7b202cb0f9 1. Correct File header to ## @file
2. Remove unnecessary .common] postfix on section.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10051 6f19259b-4bc3-4df7-8a09-765794883524
2010-02-23 23:58:38 +00:00
gikidy 558bfebb99 For pass all compilers.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9015 6f19259b-4bc3-4df7-8a09-765794883524
2009-07-27 09:08:49 +00:00
gikidy 2ba53a4f23 Add Nanosecond initialize when CMOS clear for ConvertRtcTimeToEfiTime can not initialize it.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9014 6f19259b-4bc3-4df7-8a09-765794883524
2009-07-27 09:00:41 +00:00
rsun3 6bfa178cca Fixed 2 bugs in the RTC driver of PcAtChipsetPkg.
1. RtcTimeFieldsValid() has bug checking the validity of TIME fields, which causes SetTime() will not return EFI_INVALID_PARAMETER when it is fed with invliad time fields.
2. Logical error in handling Time Zone and Day Light Saving.GetTime() won't return Time Zone and Day Light Saving set by last SetTime() call.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8948 6f19259b-4bc3-4df7-8a09-765794883524
2009-07-15 06:17:57 +00:00
klu2 345e5a6556 Move PcatRealTimeClockRuntimeDxe driver to PcAtChipsetPkg
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8766 6f19259b-4bc3-4df7-8a09-765794883524
2009-07-07 02:48:17 +00:00