# IioCfgUpdateDxeLightningRidgeEXECB1

## Function Table

| Address | Name | Description |
|---------|------|-------------|
|  | **ReturnNotFound** |  |
|  | **DebugPrint** |  |
|  | **DebugAssert** |  |
|  | **IsHobListGuid** |  |
|  | **ReadUnaligned64** |  |
|  | **RegisterIioConfig** |  |
|  | **_ModuleEntryPoint** |  |
| Module | **Globals** |  |
| Cached | **debug protocol interface (initialized on first use).** |  |
| VOID | ***gDebugProtocol = NULL;** |  |
| Cached | **HOB list pointer (initialized on first use).** |  |
| VOID | ***gHobList = NULL;** |  |
| GUID | **Definitions (instances)** |  |
| EFI_HOB_LIST_GUID | **instance - used to locate HOB list in configuration table.** |  |
| EFI_GUID | **gEfiHobListGuid = EFI_HOB_LIST_GUID;** |  |
| UBA | **Board-Type Protocol GUID - interface to register configuration data.** |  |
| EFI_GUID | **gUbaBoardTypeProtocolGuid = UBA_BOARD_TYPE_PROTOCOL_GUID;** |  |
| UBA | **IIO Config Update protocol GUIDs (one per CPU socket).** |  |
| static | **EFI_GUID gIioCfgUpdateProtocolGuid[IIO_CFG_UPDATE_PROTOCOL_COUNT] = {** |  |
| UBA | **Debug Protocol GUID - protocol for debug output.** |  |
| EFI_GUID | **gUbaDebugProtocolGuid = UBA_DEBUG_PROTOCOL_GUID;** |  |
| IIO | **Configuration Table** |  |
| UBA_IIO_CFG_UPDATE_PROTOCOL | **- The IIO configuration protocol structure** |  |
| that | **is registered for each CPU socket on this platform.** |  |
| This | **structure describes the IIO configuration table layout:** |  |
| STATIC | **CONST UBA_IIO_CFG_UPDATE_PROTOCOL mIioCfgProtocol = {** |  |
| IIO | **configuration table for LightningRidgeEXECB1.** |  |
| This | **table contains 21 entries of 12 bytes each (252 bytes total)** |  |
| with | **the remaining space (0x50C - 252 = 1040 bytes) being padding/reserved.** |  |
| Each | **entry configures an IIO register/port for a specific socket function.** |  |
| Entry | **format (UBA_IIO_CFG_UPDATE_TABLE_ENTRY):** |  |
| Byte | **0: Type (function/register selector)** |  |
| Byte | **1: SubType (sub-function or qualifier)** |  |
| Bytes | **2-3: Reserved** |  |
| Bytes | **4-7: Reserved** |  |
| Byte | **8: Value (target data)** |  |
| Byte | **9: Port (target port/address)** |  |
| Bytes | **10-11: Reserved** |  |
| The | **0xFF bytes in the reserved fields indicate "don't care" / unchecked.** |  |
| The | **board config protocol performs the actual IIO register programming** |  |
| based | **on these entries.** |  |
| STATIC | **CONST UINT8 mIioCfgTable[0x50C] = {** |  |
| Static | **Data: UBA Board Config Table** |  |
| UBA | **board configuration lookup table at offset 0xD60.** |  |
| This | **small table provides a mapping between UBA protocol indices and** |  |
| board | **configuration data. Format is 12 bytes per entry.** |  |
| For | **LightningRidgeEXECB1, this table contains 20 entries mapping** |  |
| STATIC | **CONST UINT8 mUbaBoardConfigTable[] = {** |  |
| Function | **Implementations** |  |
| Check | **cache first** |  |
| Raise | **TPL to TPL_HIGH_LEVEL (31) for critical section** |  |
| Check | **if HOB allocation size indicates a multi-package platform** |  |
| Restore | **TPL and return NULL - protocol not available on this platform** |  |
| Locate | **the UBA Debug protocol** |  |
| Restore | **TPL** |  |
| Get | **the DebugLib protocol interface** |  |
| Read | **CMOS register 0x4B to get board type** |  |
| Port | **0x70 = index, port 0x71 = data** |  |
| Determine | **the board type value** |  |
| When | **CMOS byte is 0, read from MMIO register and derive board type** |  |
| Board | **type 0 is reserved/invalid (subtract 1 to get index)** |  |
| Valid | **board types are 1, 2, 3 -> indices 0, 1, 2** |  |
| Determine | **debug mask based on board type index** |  |
| Check | **if the requested error level is enabled by the board's debug mask** |  |
| Call | **the DebugLib protocol's output function (offset 0x08)** |  |
| Call | **the DebugLib protocol's assert handler (offset 0x08)** |  |
| The | **assert handler takes (FileName, LineNumber, Description)** |  |
| Read | **the target GUID as two 64-bit values** |  |
| Compare | **against EFI_HOB_LIST_GUID (7739F24C-93D7-11D4-9A3A-0090273FC14D)** |  |
| First | **8 bytes: 0xD411D7934CF23977 (little-endian: 7739F24C-93D7-11D4)** |  |
| Second | **8 bytes: 0x4DC13F2790003A9A (little-endian: 9A3A-0090273FC14D)** |  |
| Trigger | **debug assertion via DebugLib** |  |
| Read | **8 bytes from potentially unaligned address** |  |
| Check | **if already cached** |  |
| Initialize | **to NULL** |  |
| Linear | **scan through configuration table entries** |  |
| Found | **the HOB list** |  |
| If | **HOB list was not found, trigger assertion** |  |
| Print | **debug banner identifying this module** |  |
| Locate | **the UBA board-type protocol** |  |
| Register | **IIO configuration protocol for each CPU socket** |  |
| Step | **1: Cache UEFI global variables** |  |
| These | **are set by the UefiBootServicesTableLib and** |  |
| UefiRuntimeServicesTableLib | **libraries at image startup.** |  |
| The | **asserts below validate the pointers are non-NULL.** |  |
| Step | **2: Locate the HOB list** |  |
| The | **HOB list is needed by GetDebugProtocol() to check the HOB** |  |
| allocation | **size before deciding whether to locate the debug protocol.** |  |
| Step | **3: Register IIO configuration protocols** |  |

---
*Generated by HR650X BIOS Decompilation Project*