27STATIC BOOLEAN mQ35SmramAtDefaultSmbase;
37 mQ35TsegMbytes =
PcdGet16 (PcdQ35TsegMbytes);
48 mQ35SmramAtDefaultSmbase =
PcdGetBool (PcdQ35SmramAtDefaultSmbase);
67 OUT BOOLEAN *LockState,
68 OUT BOOLEAN *OpenState
71 UINT8 SmramVal, EsmramcVal;
73 SmramVal =
PciRead8 (DRAMC_REGISTER_Q35 (MCH_SMRAM));
74 EsmramcVal =
PciRead8 (DRAMC_REGISTER_Q35 (MCH_ESMRAMC));
76 *LockState = !!(SmramVal & MCH_SMRAM_D_LCK);
77 *OpenState = !(EsmramcVal & MCH_ESMRAMC_T_EN);
93 OUT BOOLEAN *LockState,
94 OUT BOOLEAN *OpenState
101 DRAMC_REGISTER_Q35 (MCH_ESMRAMC),
102 (UINT8)((~(UINT32)MCH_ESMRAMC_T_EN) & 0xff)
107 return EFI_DEVICE_ERROR;
115 OUT BOOLEAN *LockState,
116 OUT BOOLEAN *OpenState
122 PciOr8 (DRAMC_REGISTER_Q35 (MCH_ESMRAMC), MCH_ESMRAMC_T_EN);
126 return EFI_DEVICE_ERROR;
134 OUT BOOLEAN *LockState,
135 IN OUT BOOLEAN *OpenState
139 return EFI_DEVICE_ERROR;
145 PciOr8 (DRAMC_REGISTER_Q35 (MCH_ESMRAMC), MCH_ESMRAMC_T_EN);
146 PciOr8 (DRAMC_REGISTER_Q35 (MCH_SMRAM), MCH_SMRAM_D_LCK);
151 if (mQ35SmramAtDefaultSmbase) {
153 DRAMC_REGISTER_Q35 (MCH_DEFAULT_SMBASE_CTL),
154 MCH_DEFAULT_SMBASE_LCK
159 if (*OpenState || !*LockState) {
160 return EFI_DEVICE_ERROR;
167SmramAccessGetCapabilities (
181 DescriptorBlock = GET_GUID_HOB_DATA (GuidHob);
182 ASSERT (DescriptorBlock);
186 if (*SmramMapSize < BufferSize) {
187 *SmramMapSize = BufferSize;
188 return EFI_BUFFER_TOO_SMALL;
194 *SmramMapSize = BufferSize;
VOID *EFIAPI GetFirstGuidHob(IN CONST EFI_GUID *Guid)
UINT8 EFIAPI PciRead8(IN UINTN Address)
UINT8 EFIAPI PciAnd8(IN UINTN Address, IN UINT8 AndData)
UINT8 EFIAPI PciOr8(IN UINTN Address, IN UINT8 OrData)
UINT8 EFIAPI PciWrite8(IN UINTN Address, IN UINT8 Value)
#define PcdGet16(TokenName)
#define PcdGetBool(TokenName)
VOID InitQ35SmramAtDefaultSmbase(VOID)
VOID GetStates(OUT BOOLEAN *LockState, OUT BOOLEAN *OpenState)
VOID InitQ35TsegMbytes(VOID)
EFI_PHYSICAL_ADDRESS CpuStart
EFI_PHYSICAL_ADDRESS PhysicalStart
UINT32 NumberOfSmmReservedRegions
EFI_SMRAM_DESCRIPTOR Descriptor[1]