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