summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2bf87d8)
There are two FSP images at different locations in a flash (one factory version is read only and other in updatable version)
TempRamInit, FspMemoryInit and TempRamExit are executed from factory version and FspSiliconInit/NotifyPhase will be executed from updatable version.
Also update FSP specification version to v1.1.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Ma, Maurice" <maurice.ma@intel.com>
Reviewed-by: "Yao, Jiewen" <Jiewen.Yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17248
6f19259b-4bc3-4df7-8a09-
765794883524
12 files changed:
; Following functions will be provided in PlatformSecLib\r
;\r
EXTERN GetFspBaseAddress:PROC\r
; Following functions will be provided in PlatformSecLib\r
;\r
EXTERN GetFspBaseAddress:PROC\r
+EXTERN GetFspInfoHdr:PROC\r
EXTERN GetBootFirmwareVolumeOffset: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
EXTERN LoadMicrocode(LoadMicrocodeDefault):PROC\r
EXTERN SecPlatformInit(SecPlatformInitDefault):PROC\r
EXTERN SecCarInit:PROC\r
- ; CPUID/DeviceID check\r
- ; and Sec Platform Init\r
;\r
CALL_MMX SecPlatformInit\r
cmp eax, 0\r
;\r
CALL_MMX SecPlatformInit\r
cmp eax, 0\r
jz @F\r
cmp eax, 3 ; FspMemoryInit API\r
jz @F\r
jz @F\r
cmp eax, 3 ; FspMemoryInit API\r
jz @F\r
- jmp Pei2LoaderSwitchStack\r
+\r
+ call GetFspInfoHdr\r
+ jmp Loader2PeiSwitchStack\r
- ; Store the address in FSP which will return control to the BL\r
+ ; Place holder to store the FspInfoHeader pointer\r
+ push eax\r
+\r
+ ;\r
+ ; Update the FspInfoHeader pointer\r
+ ;\r
+ push eax\r
+ call GetFspInfoHdr\r
+ mov [esp + 4], eax\r
+ pop eax\r
\r
;\r
; Create a Task Frame in the stack for the Boot Loader\r
\r
;\r
; Create a Task Frame in the stack for the Boot Loader\r
; Pass Control into the PEI Core\r
;\r
call SecStartup\r
; Pass Control into the PEI Core\r
;\r
call SecStartup\r
#\r
# Following functions will be provided in PlatformSecLib\r
#\r
#\r
# Following functions will be provided in PlatformSecLib\r
#\r
+ASM_GLOBAL ASM_PFX(GetFspBaseAddress)\r
+ASM_GLOBAL ASM_PFX(GetFspInfoHdr)\r
ASM_GLOBAL ASM_PFX(GetBootFirmwareVolumeOffset)\r
ASM_GLOBAL ASM_PFX(GetBootFirmwareVolumeOffset)\r
-ASM_GLOBAL ASM_PFX(Pei2LoaderSwitchStack)\r
+ASM_GLOBAL ASM_PFX(Loader2PeiSwitchStack)\r
- # CPUID/DeviceID check\r
- # and Sec Platform Init\r
#\r
movl $TempRamInitApiL1, %esi #CALL_MMX SecPlatformInit\r
movd %esi, %mm7\r
#\r
movl $TempRamInitApiL1, %esi #CALL_MMX SecPlatformInit\r
movd %esi, %mm7\r
jz FspApiCommonL2\r
cmpl $0x03, %eax # FspMemoryInit API\r
jz FspApiCommonL2\r
jz FspApiCommonL2\r
cmpl $0x03, %eax # FspMemoryInit API\r
jz FspApiCommonL2\r
- jmp Pei2LoaderSwitchStack\r
+ call ASM_PFX(GetFspInfoHdr)\r
+ jmp Loader2PeiSwitchStack\r
- # Store the address in FSP which will return control to the BL\r
+ # Place holder to store the FspInfoHeader pointer\r
- pushl $FspApiCommonExit\r
+ pushl %eax\r
+\r
+ #\r
+ # Update the FspInfoHeader pointer\r
+ #\r
+ pushl %eax\r
+ call ASM_PFX(GetFspInfoHdr)\r
+ movl %eax, 4(%esp)\r
+ popl %eax\r
\r
#\r
# Create a Task Frame in the stack for the Boot Loader\r
\r
#\r
# Create a Task Frame in the stack for the Boot Loader\r
# Pass Control into the PEI Core\r
#\r
call ASM_PFX(SecStartup)\r
# Pass Control into the PEI Core\r
#\r
call ASM_PFX(SecStartup)\r
FspApiCommonExit:\r
ret\r
\r
FspApiCommonExit:\r
ret\r
\r
.model flat,C\r
.code\r
\r
.model flat,C\r
.code\r
\r
-FspInfoHeaderRelativeOff PROC NEAR PRIVATE\r
+FspInfoHeaderRelativeOff PROC NEAR PUBLIC\r
;\r
; This value will be pached by the build script\r
;\r
;\r
; This value will be pached by the build script\r
;\r
ret\r
GetFspBaseAddress ENDP\r
\r
ret\r
GetFspBaseAddress ENDP\r
\r
+GetFspInfoHdr PROC NEAR PUBLIC\r
+ mov eax, GetFspBaseAddress\r
+ sub eax, dword ptr [FspInfoHeaderRelativeOff]\r
+ ret\r
+GetFspInfoHdr ENDP\r
+\r
END
\ No newline at end of file
END
\ No newline at end of file
mov (%eax), %eax\r
ret\r
\r
mov (%eax), %eax\r
ret\r
\r
+ASM_GLOBAL ASM_PFX(GetFspInfoHdr)\r
+ASM_PFX(GetFspInfoHdr):\r
+ mov $GetFspBaseAddress, %eax\r
+ sub $FspInfoHeaderRelativeOff, %eax\r
+ ret\r
/** @file\r
Intel FSP API definition from Intel Firmware Support Package External\r
/** @file\r
Intel FSP API definition from Intel Firmware Support Package External\r
- Architecture Specification, April 2014, revision 001.\r
+ Architecture Specification v1.1, April 2015, revision 001.\r
\r
Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
\r
Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
/** @file\r
Intel FSP Info Header definition from Intel Firmware Support Package External\r
/** @file\r
Intel FSP Info Header definition from Intel Firmware Support Package External\r
- Architecture Specification, April 2014, revision 001.\r
+ Architecture Specification v1.1, April 2015, revision 001.\r
\r
Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
\r
Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
/** @file\r
Intel FSP Header File Guid definition from Intel Firmware Support Package External\r
/** @file\r
Intel FSP Header File Guid definition from Intel Firmware Support Package External\r
- Architecture Specification, April 2014, revision 001.\r
+ Architecture Specification v1.1, April 2015, revision 001.\r
- Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
/** @file\r
Intel FSP Hob Guid definition from Intel Firmware Support Package External\r
/** @file\r
Intel FSP Hob Guid definition from Intel Firmware Support Package External\r
- Architecture Specification, April 2014, revision 001.\r
+ Architecture Specification v1.1, April 2015, revision 001.\r
\r
Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
\r
Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
+/**\r
+ This function gets the FSP info header pointer from the API context.\r
+\r
+ @retval FspInfoHeader FSP info header pointer\r
+**/\r
+FSP_INFO_HEADER *\r
+EFIAPI\r
+GetFspInfoHeaderFromApiContext (\r
+ VOID\r
+ );\r
+\r
/**\r
This function gets the VPD data pointer.\r
\r
/**\r
This function gets the VPD data pointer.\r
\r
// API Parameter +0x34\r
// API return address +0x30\r
//\r
// API Parameter +0x34\r
// API return address +0x30\r
//\r
-// push offset exit +0x2C\r
+// push FspInfoHeader +0x2C\r
// pushfd +0x28\r
// cli\r
// pushad +0x24\r
// pushfd +0x28\r
// cli\r
// pushad +0x24\r
UINT32 Ecx;\r
UINT32 Eax;\r
UINT16 Flags[2];\r
UINT32 Ecx;\r
UINT32 Eax;\r
UINT16 Flags[2];\r
+ UINT32 FspInfoHeader;\r
UINT32 ApiRet;\r
UINT32 ApiParam;\r
} CONTEXT_STACK;\r
UINT32 ApiRet;\r
UINT32 ApiParam;\r
} CONTEXT_STACK;\r
return GetFspGlobalDataPointer()->FspInfoHeader;\r
}\r
\r
return GetFspGlobalDataPointer()->FspInfoHeader;\r
}\r
\r
+/**\r
+ This function gets the FSP info header pointer using the API stack context.\r
+\r
+ @retval FspInfoHeader FSP info header pointer using the API stack context\r
+**/\r
+FSP_INFO_HEADER *\r
+EFIAPI\r
+GetFspInfoHeaderFromApiContext (\r
+ VOID\r
+ )\r
+{\r
+ FSP_GLOBAL_DATA *FspData;\r
+\r
+ FspData = GetFspGlobalDataPointer ();\r
+ return (FSP_INFO_HEADER *)(*(UINT32 *)(UINTN)(FspData->CoreStack + CONTEXT_STACK_OFFSET(FspInfoHeader)));\r
+}\r
+\r
/**\r
This function gets the VPD data pointer.\r
\r
/**\r
This function gets the VPD data pointer.\r
\r
;------------------------------------------------------------------------------\r
;\r
;------------------------------------------------------------------------------\r
;\r
-; Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
; This program and the accompanying materials\r
; are licensed and made available under the terms and conditions of the BSD License\r
; which accompanies this distribution. The full text of the license may be found at\r
; This program and the accompanying materials\r
; are licensed and made available under the terms and conditions of the BSD License\r
; which accompanies this distribution. The full text of the license may be found at\r
;------------------------------------------------------------------------------\r
EXTERNDEF C MeasurePoint:PROC\r
Pei2LoaderSwitchStack PROC C PUBLIC\r
;------------------------------------------------------------------------------\r
EXTERNDEF C MeasurePoint:PROC\r
Pei2LoaderSwitchStack PROC C PUBLIC\r
- jmp Loader2PeiSwitchStack\r
+ xor eax, eax\r
+ jmp FspSwitchStack\r
Pei2LoaderSwitchStack ENDP\r
\r
;------------------------------------------------------------------------------\r
Pei2LoaderSwitchStack ENDP\r
\r
;------------------------------------------------------------------------------\r
; VOID\r
; )\r
;------------------------------------------------------------------------------\r
; VOID\r
; )\r
;------------------------------------------------------------------------------\r
-EXTERNDEF C SwapStack:PROC\r
Loader2PeiSwitchStack PROC C PUBLIC\r
Loader2PeiSwitchStack PROC C PUBLIC\r
+ jmp FspSwitchStack\r
+Loader2PeiSwitchStack ENDP\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT32\r
+; EFIAPI\r
+; FspSwitchStack (\r
+; VOID\r
+; )\r
+;------------------------------------------------------------------------------\r
+EXTERNDEF C SwapStack:PROC\r
+FspSwitchStack PROC C PUBLIC\r
; Save current contexts\r
; Save current contexts\r
add esp, 8\r
popad\r
popfd\r
add esp, 8\r
popad\r
popfd\r
-Loader2PeiSwitchStack ENDP\r
#------------------------------------------------------------------------------\r
ASM_GLOBAL ASM_PFX(Pei2LoaderSwitchStack)\r
ASM_PFX(Pei2LoaderSwitchStack):\r
#------------------------------------------------------------------------------\r
ASM_GLOBAL ASM_PFX(Pei2LoaderSwitchStack)\r
ASM_PFX(Pei2LoaderSwitchStack):\r
- jmp ASM_PFX(Loader2PeiSwitchStack)\r
+ xorl %eax, %eax\r
+ jmp ASM_PFX(FspSwitchStack)\r
\r
#------------------------------------------------------------------------------\r
# UINT32\r
# EFIAPI\r
# Loader2PeiSwitchStack (\r
\r
#------------------------------------------------------------------------------\r
# UINT32\r
# EFIAPI\r
# Loader2PeiSwitchStack (\r
# )\r
#------------------------------------------------------------------------------\r
ASM_GLOBAL ASM_PFX(Loader2PeiSwitchStack)\r
ASM_PFX(Loader2PeiSwitchStack):\r
# )\r
#------------------------------------------------------------------------------\r
ASM_GLOBAL ASM_PFX(Loader2PeiSwitchStack)\r
ASM_PFX(Loader2PeiSwitchStack):\r
+ jmp ASM_PFX(FspSwitchStack)\r
+\r
+#------------------------------------------------------------------------------\r
+# UINT32\r
+# EFIAPI\r
+# FspSwitchStack (\r
+# VOID\r
+# )\r
+#------------------------------------------------------------------------------\r
+ASM_GLOBAL ASM_PFX(FspSwitchStack)\r
+ASM_PFX(FspSwitchStack):\r
#\r
#Save current contexts\r
#\r
#\r
#Save current contexts\r
#\r
add $0x08,%esp\r
popa\r
popf\r
add $0x08,%esp\r
popa\r
popf\r