;\r
; Following functions will be provided in PlatformSecLib\r
;\r
-EXTERN GetFspBaseAddress:PROC\r
+EXTERN AsmGetFspBaseAddress:PROC\r
+EXTERN AsmGetFspInfoHeader:PROC\r
EXTERN GetBootFirmwareVolumeOffset:PROC\r
-EXTERN Pei2LoaderSwitchStack:PROC\r
+EXTERN Loader2PeiSwitchStack:PROC\r
EXTERN LoadMicrocode(LoadMicrocodeDefault):PROC\r
EXTERN SecPlatformInit(SecPlatformInitDefault):PROC\r
EXTERN SecCarInit:PROC\r
mov ecx, MSR_IA32_PLATFORM_ID\r
rdmsr\r
mov ecx, edx\r
- shr ecx, 50-32\r
- and ecx, 7h\r
+ shr ecx, 50-32 ; shift (50d-32d=18d=0x12) bits\r
+ and ecx, 7h ; platform id at bit[52..50]\r
mov edx, 1\r
shl edx, cl\r
\r
mov eax, dword ptr [esp + 4]\r
cmp eax, 0\r
mov eax, 80000002h\r
- jz NemInitExit\r
+ jz TempRamInitExit\r
\r
;\r
- ; CPUID/DeviceID check\r
- ; and Sec Platform Init\r
+ ; Sec Platform Init\r
;\r
CALL_MMX SecPlatformInit\r
cmp eax, 0\r
- jnz NemInitExit\r
- \r
+ jnz TempRamInitExit\r
+\r
; Load microcode\r
LOAD_ESP\r
CALL_MMX LoadMicrocode\r
LOAD_ESP\r
CALL_MMX SecCarInit\r
cmp eax, 0\r
- jnz NemInitExit\r
+ jnz TempRamInitExit\r
\r
LOAD_ESP\r
CALL_MMX EstablishStackFsp\r
\r
LXMMN xmm6, eax, 3 ;Restore microcode status if no CAR init error from ECX-SLOT 3 in xmm6.\r
\r
-NemInitExit:\r
+TempRamInitExit:\r
;\r
; Load EBP, EBX, ESI, EDI & ESP from XMM7 & XMM6\r
;\r
; Verify the calling condition\r
;\r
pushad\r
- push [esp + 4 * 8 + 4]\r
- push eax\r
+ push [esp + 4 * 8 + 4] ; push ApiParam\r
+ push eax ; push ApiIdx\r
call FspApiCallingCheck\r
add esp, 8\r
cmp eax, 0\r
jz @F\r
cmp eax, 3 ; FspMemoryInit API\r
jz @F\r
- jmp Pei2LoaderSwitchStack\r
+\r
+ call AsmGetFspInfoHeader\r
+ jmp Loader2PeiSwitchStack\r
\r
@@:\r
;\r
;\r
\r
;\r
- ; Store the address in FSP which will return control to the BL\r
+ ; Place holder to store the FspInfoHeader pointer\r
+ ;\r
+ push eax\r
+\r
+ ;\r
+ ; Update the FspInfoHeader pointer\r
;\r
- push offset exit\r
+ push eax\r
+ call AsmGetFspInfoHeader\r
+ mov [esp + 4], eax\r
+ pop eax\r
\r
;\r
; Create a Task Frame in the stack for the Boot Loader\r
;\r
; Pass entry point of the PEI core\r
;\r
- call GetFspBaseAddress\r
+ call AsmGetFspBaseAddress\r
mov edi, eax\r
add edi, PcdGet32 (PcdFspAreaSize) \r
sub edi, 20h\r
;\r
; Pass BFV into the PEI Core\r
; It uses relative address to calucate the actual boot FV base\r
- ; For FSP impleantion with single FV, PcdFlashFvRecoveryBase and\r
+ ; For FSP implementation with single FV, PcdFspBootFirmwareVolumeBase and\r
; PcdFspAreaBaseAddress are the same. For FSP with mulitple FVs,\r
; they are different. The code below can handle both cases.\r
;\r
- call GetFspBaseAddress\r
+ call AsmGetFspBaseAddress\r
mov edi, eax\r
call GetBootFirmwareVolumeOffset\r
add eax, edi\r
; Pass Control into the PEI Core\r
;\r
call SecStartup\r
-\r
+ add esp, 4\r
exit:\r
ret\r
\r