You've already forked edk2-platforms
mirror of
https://github.com/Dasharo/edk2-platforms.git
synced 2026-03-06 14:51:43 -08:00
https://bugzilla.tianocore.org/show_bug.cgi?id=1552 Add Cmos related libraries to BoardModulePkg. Totally two library have been added, one is CmosAccessLib and the other is PlatformCmosAccessLib. PlatformCmosAccessLib will be used by CmosAccessLib. These two libraries provide the generic operations for CMOS access. APIs exports by PlatformCmosAccessLib include: PlatformCmosGetEntry PlatformCmosGetNmiState APIs exports by CmosAccessLib include: CmosRead8 CmosWrite8 CmosRead16 CmosWrite16 CmosRead32 CmosWrite32 CmosInit Cc: Michael Kubacki <michael.a.kubacki@intel.com> Cc: Sai Chaganty <rangasai.v.chaganty@intel.com> Cc: Oram Isaac W <isaac.w.oram@intel.com> Sign-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Signed-off-by: Eric Dong <eric.dong@intel.com>
69 lines
1.7 KiB
C
69 lines
1.7 KiB
C
/** @file
|
|
Platform CMOS Access Library Header File.
|
|
|
|
Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
|
|
**/
|
|
|
|
#ifndef _PLATFORM_CMOS_ACCESS_LIB_H_
|
|
#define _PLATFORM_CMOS_ACCESS_LIB_H_
|
|
|
|
///
|
|
/// Flag indicating checksum calculation doesn't include this location.
|
|
/// NOTE: If a location isn't shown in platform CMOS entry table,
|
|
/// it means checksum calculation doesn't include the location.
|
|
///
|
|
#define CMOS_EXCLUDE_FROM_CHECKSUM BIT0
|
|
|
|
///
|
|
/// Flag indicating initialization doesn't cover this location.
|
|
/// NOTE: If a location isn't shown in platform CMOS entry table,
|
|
/// it means the location is initialized with CMOS_DEFAULT_VALUE (0).
|
|
///
|
|
#define CMOS_EXCLUDE_FROM_INIT_DATA BIT1
|
|
|
|
///
|
|
/// Flag indicating the location cannot be accessed.
|
|
/// NOTE: 0x0 ~ 0xD is implictly inaccessible.
|
|
///
|
|
#define CMOS_EXCLUDE_FROM_ACCESS (BIT3 | CMOS_EXCLUDE_FROM_CHECKSUM | CMOS_EXCLUDE_FROM_INIT_DATA)
|
|
|
|
///
|
|
/// Flag indicating the checksum location
|
|
/// NOTE: At most two entries can have this flag set.
|
|
///
|
|
#define CMOS_CHECKSUM_LOCATION (BIT2 | CMOS_EXCLUDE_FROM_CHECKSUM | CMOS_EXCLUDE_FROM_INIT_DATA)
|
|
|
|
#define CMOS_DEFAULT_VALUE 0x00
|
|
|
|
typedef struct {
|
|
UINT8 Address;
|
|
UINT8 DefaultValue;
|
|
UINT8 Attributes;
|
|
} CMOS_ENTRY;
|
|
|
|
/**
|
|
Return the platform CMOS entries.
|
|
|
|
@param [out] EntryCount Return the count of platform CMOS entries.
|
|
|
|
@return Platform CMOS entries.
|
|
**/
|
|
CMOS_ENTRY *
|
|
EFIAPI
|
|
PlatformCmosGetEntry (
|
|
OUT UINTN *EntryCount
|
|
);
|
|
|
|
/**
|
|
Return the NMI enable status.
|
|
**/
|
|
BOOLEAN
|
|
EFIAPI
|
|
PlatformCmosGetNmiState (
|
|
VOID
|
|
);
|
|
|
|
#endif // _PLATFORM_CMOS_ACCESS_LIB_H_
|