]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFsp2Pkg/FspSecCore/Ia32/Fsp24ApiEntryS.nasm
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / IntelFsp2Pkg / FspSecCore / Ia32 / Fsp24ApiEntryS.nasm
1 ;; @file
2 ; Provide FSP API entry points.
3 ;
4 ; Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
5 ; SPDX-License-Identifier: BSD-2-Clause-Patent
6 ;;
7
8 SECTION .text
9
10 ;
11 ; Following functions will be provided in C
12 ;
13 extern ASM_PFX(FspApiCommon)
14 extern ASM_PFX(FspMultiPhaseSiInitApiHandlerV2)
15
16 STACK_SAVED_EAX_OFFSET EQU 4 * 7 ; size of a general purpose register * eax index
17
18 ;----------------------------------------------------------------------------
19 ; NotifyPhase API
20 ;
21 ; This FSP API will notify the FSP about the different phases in the boot
22 ; process
23 ;
24 ;----------------------------------------------------------------------------
25 global ASM_PFX(NotifyPhaseApi)
26 ASM_PFX(NotifyPhaseApi):
27 mov eax, 2 ; FSP_API_INDEX.NotifyPhaseApiIndex
28 jmp ASM_PFX(FspApiCommon)
29
30 ;----------------------------------------------------------------------------
31 ; FspSiliconInit API
32 ;
33 ; This FSP API initializes the CPU and the chipset including the IO
34 ; controllers in the chipset to enable normal operation of these devices.
35 ;
36 ;----------------------------------------------------------------------------
37 global ASM_PFX(FspSiliconInitApi)
38 ASM_PFX(FspSiliconInitApi):
39 mov eax, 5 ; FSP_API_INDEX.FspSiliconInitApiIndex
40 jmp ASM_PFX(FspApiCommon)
41
42 ;----------------------------------------------------------------------------
43 ; FspMultiPhaseSiInitApi API
44 ;
45 ; This FSP API provides multi-phase silicon initialization, which brings greater
46 ; modularity beyond the existing FspSiliconInit() API.
47 ; Increased modularity is achieved by adding an extra API to FSP-S.
48 ; This allows the bootloader to add board specific initialization steps throughout
49 ; the SiliconInit flow as needed.
50 ;
51 ;----------------------------------------------------------------------------
52 global ASM_PFX(FspMultiPhaseSiInitApi)
53 ASM_PFX(FspMultiPhaseSiInitApi):
54 mov eax, 6 ; FSP_API_INDEX.FspMultiPhaseSiInitApiIndex
55 jmp ASM_PFX(FspApiCommon)
56
57 ;----------------------------------------------------------------------------
58 ; FspApiCommonContinue API
59 ;
60 ; This is the FSP API common entry point to resume the FSP execution
61 ;
62 ;----------------------------------------------------------------------------
63 global ASM_PFX(FspApiCommonContinue)
64 ASM_PFX(FspApiCommonContinue):
65 ;
66 ; Handle FspMultiPhaseSiInitApiIndex API
67 ;
68 cmp eax, 6 ; FspMultiPhaseSiInitApiIndex
69 jnz NotMultiPhaseSiInitApi
70
71 pushad
72 push DWORD [esp + (4 * 8 + 4)] ; push ApiParam
73 push eax ; push ApiIdx
74 call ASM_PFX(FspMultiPhaseSiInitApiHandlerV2)
75 add esp, 8
76 mov dword [esp + STACK_SAVED_EAX_OFFSET], eax
77 popad
78 ret
79
80 NotMultiPhaseSiInitApi:
81 jmp $
82 ret
83
84 ;----------------------------------------------------------------------------
85 ; TempRamInit API
86 ;
87 ; Empty function for WHOLEARCHIVE build option
88 ;
89 ;----------------------------------------------------------------------------
90 global ASM_PFX(TempRamInitApi)
91 ASM_PFX(TempRamInitApi):
92 jmp $
93 ret
94
95 ;----------------------------------------------------------------------------
96 ; Module Entrypoint API
97 ;----------------------------------------------------------------------------
98 global ASM_PFX(_ModuleEntryPoint)
99 ASM_PFX(_ModuleEntryPoint):
100 jmp $
101