2 ; Provide FSP API entry points.
4 ; Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
5 ; SPDX-License-Identifier: BSD-2-Clause-Patent
11 ; Following functions will be provided in C
13 extern ASM_PFX(FspApiCommon)
14 extern ASM_PFX(FspMultiPhaseSiInitApiHandlerV2)
16 STACK_SAVED_RAX_OFFSET EQU 8 * 7 ; size of a general purpose register * rax index
18 ;----------------------------------------------------------------------------
21 ; This FSP API will notify the FSP about the different phases in the boot
24 ;----------------------------------------------------------------------------
25 global ASM_PFX(NotifyPhaseApi)
26 ASM_PFX(NotifyPhaseApi):
27 mov rax, 2 ; FSP_API_INDEX.NotifyPhaseApiIndex
28 jmp ASM_PFX(FspApiCommon)
30 ;----------------------------------------------------------------------------
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.
36 ;----------------------------------------------------------------------------
37 global ASM_PFX(FspSiliconInitApi)
38 ASM_PFX(FspSiliconInitApi):
39 mov rax, 5 ; FSP_API_INDEX.FspSiliconInitApiIndex
40 jmp ASM_PFX(FspApiCommon)
42 ;----------------------------------------------------------------------------
43 ; FspMultiPhaseSiInitApi API
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.
51 ;----------------------------------------------------------------------------
53 %include "PushPopRegsNasm.inc"
55 global ASM_PFX(FspMultiPhaseSiInitApi)
56 ASM_PFX(FspMultiPhaseSiInitApi):
57 mov rax, 6 ; FSP_API_INDEX.FspMultiPhaseSiInitApiIndex
58 jmp ASM_PFX(FspApiCommon)
60 ;----------------------------------------------------------------------------
61 ; FspApiCommonContinue API
63 ; This is the FSP API common entry point to resume the FSP execution
65 ;----------------------------------------------------------------------------
66 global ASM_PFX(FspApiCommonContinue)
67 ASM_PFX(FspApiCommonContinue):
69 ; Handle FspMultiPhaseSiInitApiIndex API
71 push rdx ; Push a QWORD data for stack alignment
73 cmp rax, 6 ; FSP_API_INDEX.FspMultiPhaseSiInitApiIndex
74 jnz NotMultiPhaseSiInitApi
77 mov rdx, rcx ; move ApiParam to rdx
78 mov rcx, rax ; move ApiIdx to rcx
79 sub rsp, 0x20 ; calling C function may need shadow space
80 call ASM_PFX(FspMultiPhaseSiInitApiHandlerV2)
81 add rsp, 0x20 ; restore shadow space
82 mov qword [rsp + STACK_SAVED_RAX_OFFSET], rax
87 NotMultiPhaseSiInitApi:
91 ;----------------------------------------------------------------------------
94 ; Empty function for WHOLEARCHIVE build option
96 ;----------------------------------------------------------------------------
97 global ASM_PFX(TempRamInitApi)
98 ASM_PFX(TempRamInitApi):
102 ;----------------------------------------------------------------------------
103 ; Module Entrypoint API
104 ;----------------------------------------------------------------------------
105 global ASM_PFX(_ModuleEntryPoint)
106 ASM_PFX(_ModuleEntryPoint):