]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFsp2Pkg/FspSecCore/Ia32/Fsp24ApiEntryS.nasm
IntelFsp2Pkg: Adopt FSP 2.4 MultiPhase functions.
[mirror_edk2.git] / IntelFsp2Pkg / FspSecCore / Ia32 / Fsp24ApiEntryS.nasm
CommitLineData
3d35a6c2
CC
1;; @file\r
2; Provide FSP API entry points.\r
3;\r
4; Copyright (c) 2020, 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(FspMultiPhaseSiInitApiHandlerV2)\r
15\r
16STACK_SAVED_EAX_OFFSET EQU 4 * 7 ; size of a general purpose register * eax 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
27 mov eax, 2 ; FSP_API_INDEX.NotifyPhaseApiIndex\r
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
39 mov eax, 5 ; FSP_API_INDEX.FspSiliconInitApiIndex\r
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
52global ASM_PFX(FspMultiPhaseSiInitApi)\r
53ASM_PFX(FspMultiPhaseSiInitApi):\r
54 mov eax, 6 ; FSP_API_INDEX.FspMultiPhaseSiInitApiIndex\r
55 jmp ASM_PFX(FspApiCommon)\r
56\r
57;----------------------------------------------------------------------------\r
58; FspApiCommonContinue API\r
59;\r
60; This is the FSP API common entry point to resume the FSP execution\r
61;\r
62;----------------------------------------------------------------------------\r
63global ASM_PFX(FspApiCommonContinue)\r
64ASM_PFX(FspApiCommonContinue):\r
65 ;\r
66 ; Handle FspMultiPhaseSiInitApiIndex API\r
67 ;\r
68 cmp eax, 6 ; FspMultiPhaseSiInitApiIndex\r
69 jnz NotMultiPhaseSiInitApi\r
70\r
71 pushad\r
72 push DWORD [esp + (4 * 8 + 4)] ; push ApiParam\r
73 push eax ; push ApiIdx\r
74 call ASM_PFX(FspMultiPhaseSiInitApiHandlerV2)\r
75 add esp, 8\r
76 mov dword [esp + STACK_SAVED_EAX_OFFSET], eax\r
77 popad\r
78 ret\r
79\r
80NotMultiPhaseSiInitApi:\r
81 jmp $\r
82 ret\r
83\r
84;----------------------------------------------------------------------------\r
85; TempRamInit API\r
86;\r
87; Empty function for WHOLEARCHIVE build option\r
88;\r
89;----------------------------------------------------------------------------\r
90global ASM_PFX(TempRamInitApi)\r
91ASM_PFX(TempRamInitApi):\r
92 jmp $\r
93 ret\r
94\r
95;----------------------------------------------------------------------------\r
96; Module Entrypoint API\r
97;----------------------------------------------------------------------------\r
98global ASM_PFX(_ModuleEntryPoint)\r
99ASM_PFX(_ModuleEntryPoint):\r
100 jmp $\r
101\r