Newer
Older
AMI-Aptio-BIOS-Reversed / IioCfgUpdateDxeLightningRidgeEXECB4 / IioCfgUpdateDxeLightningRidgeEXECB4.md
@Ajax Dong Ajax Dong 2 days ago 3 KB Init

IioCfgUpdateDxeLightningRidgeEXECB4

Function Table

Address Name Description
DebugLogPrint
DebugAssertHandler
ReadUnaligned64
CompareGuid
RegisterIioConfigPlatformData
_ModuleEntryPoint
Global data: IIO configuration platform data header
This 48-byte structure is the Platform IIO config descriptor dispatched to
each UBA protocol instance. The bifurcation mapping table follows at the
byte offset indicated by BifurMapEntryCount acting as the offset (0x3C).
STATIC CONST IIO_CFG_PLATFORM_DATA_HEADER mIioCfgPlatformData = {
0x4F494950 .Revision = 1
3424 bytes total config
60 bifurcation entries (offset 0x3C)
1292 slot config entries
3120 SMBUS config entries
252 reserved
Static variables
GUID definitions used by this driver
The HOB list is identified by gEfiHobListGuid, but the specific HOB
entry this driver looks for matches the GUID at 0xC18.
STATIC CONST EFI_GUID mIioCfgHobTargetGuid = IIO_CFG_HOB_GUID;
Debug protocol lookup (cached)
CMOS debug output
Access CMOS debug routing register
IoWrite8 **(0x70, (IoRead8 (0x70) & 0x80) 0x4B);**
If value == 0, check MMIO-based debug enable
if (CmosValue == 0) {
Route to UBA protocol debug output if available
UbaProtocol = GetUbaConfigProtocol ();
Protocol interface at offset +8 is the DebugPrint function
ASSERT handler
but here we call it in ASSERT mode (no VA_LIST needed)
Unaligned memory access
GUID comparison (as two UINT64 values)
HOB list retrieval
Return cached result
if (mIioCfgHobList != NULL) {
SystemTable HOB fields:
HobCount = (UINTN )((UINT8 *)gST + 0x68);
Linear scan through HOB array (each entry 24 bytes)
for (Index = 0; Index < HobCount; Index++) {
Compare GUID at HOB entry offset 0
if (ReadUnaligned64 ((UINT8 )HobArray + Index 24) == TargetGuid0 &&
Found -- data pointer at HOB entry offset 0x10
mIioCfgHobList = *(VOID )((UINT8 )HobArray + Index 24 + 0x10);**
HOB not found trigger assertion
DebugLogPrint (0x80000000, L"\nASSERT_EFI_ERROR (Status = %r)\n");
IIO configuration platform data registration
Locate the UBA IIO configuration protocol
Status = gBS->LocateProtocol (
Register config data for each IIO stack GUID
Protocol function at offset +0x10 = SetPlatformData(This, RegisterGuid, DataBuffer, DataSize)
Status = ((EFI_STATUS (EFIAPI *)(
This EFI_GUID *, // Register GUID
Data buffer
Data size
48 bytes
Second stack registration
Driver entry point
Initialize global UEFI service pointer cache
gImageHandle = ImageHandle;
Retrieve the IIO configuration HOB list (locates HOBs in SystemTable)
GetIioConfigHobList ();
Print platform identification string
DebugLogPrint (0x80000000, "UBA:IioCfgUpdate-TypeLightningRidgeEXECB4\n");
Register IIO configuration platform data
return RegisterIioConfigPlatformData ();

Generated by HR650X BIOS Decompilation Project