From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web12.3418.1589340002451909772 for ; Tue, 12 May 2020 20:20:02 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=d2MoWbAF; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: eric.dong@intel.com) IronPort-SDR: YrJc1ydp+FarCQWsYGdKhfp+DXUGaYwEOUVpqxb/rnphkQdpyciGRwv+f5S2qbCXdF7U6lOLeL ssfQLNI42X2w== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2020 20:20:01 -0700 IronPort-SDR: ucHbFdzmuIJm01MXWkTn4ASfE+eSOIN6uOE8TkhXiqd9jX87QKHXBdPVgEzYn9UAJ+VzLoBpgF Y6UX8a8rV/OA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,385,1583222400"; d="scan'208";a="262339401" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga003.jf.intel.com with ESMTP; 12 May 2020 20:20:01 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 12 May 2020 20:19:34 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 12 May 2020 20:19:33 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 12 May 2020 20:19:33 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.105) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 12 May 2020 20:19:33 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DB7klKjatd8K7vLJahyUnCtbW2PML6saHV8UIypDbhF2NlYGbpMN2UK4gll+EE4lAGdt3qPHUpPk/Y66k91fM20oZ/VnQoosFappBzqpNm/T95b0Poy5bmM9HwgVqnuGChx1RtwraR5PRLKIPseqi05ZP+0zxpUlM8SwV9x/5h3fs402Qb2PRz3vfGfYq3n5j32d30I7Kn31vsfxg6bZ4W5FNkYP4IBwb1B9U0x/gHEGrqzjBRnw+OsEc1Em7+YSMHhrjWSQ9UMxuzG+KpmxU3Vx4wkn01TV2pYmsOZPsbFf64zDZPNvWlGnGZ/df5h5MGS/W5Oxun9/qPQwGBNYgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TRHZJ1K8K2gNfapplLScwDuhl7Zc98vBnvrbzZOmvdY=; b=cQngfTIQe2azDN6OC+S49/PETAF9SbXBytgsybE4z7EFhhJbfiw9eHoSSzrYD9xdKaYfLoD4fLkQfj2KLS7a4KrkBNn0JZ8qw6wi38FGxxYHsNrXjSpZtfBO0B+u/ZLRKl8jqU9NYVHZArvCffWM6DjbVjEW+niDg1lV91uQ3HwBf0fzLCbaVSwNwVmSwjcbDNUha/Dnr2cw8kxb4KbuA/CbdrzNCoFVBvD/bC3wN75OEFZh+iHErGzDPXlht87NTXWU6+7Z8gMu4WDbT6CK4x6Cw4MXN8lRf/RfS21mExVDL7oM1rew0K6k7/dfnDlV1S8XKx32ERBMMauwo/S14g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TRHZJ1K8K2gNfapplLScwDuhl7Zc98vBnvrbzZOmvdY=; b=d2MoWbAF9Lh3XGRLIEI7Cdig2l9pqXCbDrpP3UjGinFv0gxQC/K1yWhi2ZsT2FoESfGobad9WaWl5sQhDEtUqYwuNgjNQnouFkXxo3S4oqqNGGiZWNihWUf+3P18y0Slh9jUiI43IsunoRMQA1OO8VXBirywn3fGrKzDG74J1/Y= Received: from DM6PR11MB3274.namprd11.prod.outlook.com (2603:10b6:5:b::26) by DM6PR11MB3500.namprd11.prod.outlook.com (2603:10b6:5:6a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.33; Wed, 13 May 2020 03:19:31 +0000 Received: from DM6PR11MB3274.namprd11.prod.outlook.com ([fe80::e1d1:a495:9826:f88b]) by DM6PR11MB3274.namprd11.prod.outlook.com ([fe80::e1d1:a495:9826:f88b%3]) with mapi id 15.20.2979.033; Wed, 13 May 2020 03:19:31 +0000 From: "Dong, Eric" To: "Chiu, Chasel" , "devel@edk2.groups.io" CC: "Ma, Maurice" , "Desimone, Nathaniel L" , "Zeng, Star" Subject: Re: [edk2-devel] [PATCH v7] IntelFsp2Pkg: Support Multi-Phase SiInit and debug handlers. Thread-Topic: [edk2-devel] [PATCH v7] IntelFsp2Pkg: Support Multi-Phase SiInit and debug handlers. Thread-Index: AQHWKNKU9oHLnPI8LU+uULrtbLGKzqilV3+A Date: Wed, 13 May 2020 03:19:31 +0000 Message-ID: References: <20200513025915.12188-1-chasel.chiu@intel.com> In-Reply-To: <20200513025915.12188-1-chasel.chiu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.45] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6770a70d-3509-4964-9076-08d7f6ec741b x-ms-traffictypediagnostic: DM6PR11MB3500: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0402872DA1 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: sKOJo1T9vFAM7dADMKtjyubQZhCn0RlUmOyRV1j31JBSinzaNFvS9hMKSyiApaQGhedqkmjIaGBm2gOj4cxmTxXw2teCFtCkYCJD5bRyIbVPqf2pz3evMwzzhh1cPq/js3c4NWvF4xiqIqz+2suDNv0XbypHhhvKsEJCL3G4kz+5rDsoxGYkCX2AHW72pduDl3rW2c3bILdVBINb3pdR2fVS6Jk+7u1HYLQix3agQMRd51lm0Cr4oSodhZMAFa55+f0qWIF5x3TlEoF/yDBkVmaRsbVgxeWozMvOpKvnabpgPu9iS5YCkdYzeuLvN1FChKT4KyQpI7TSDHGA78Yi/0dYRZkz8wwetu5rG3xt5i/eBnbRYClypNdEJQh9iJCzi80XFa5w84D6wTi0YABEO740JNfvuV08uthvWw+fL8rq53SbBZr6FTyqRVyPvY9GKnediLyUzec6xfSR/ruX81wD9j7HgvnbavU3cOx85Xj4V8SNEMvexdfrnhhnxMwaxctP/6oeHjF5VP3bYVLJtEKz3De2vQTx+0V96BwqaqMqWJsrxJbDlTUGXO8TifVZAFPlZuarxsTaOSRiyqjyANI7CSQ0vRsuTk7tT8f4iws= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB3274.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(6029001)(346002)(376002)(366004)(396003)(136003)(39860400002)(33430700001)(5660300002)(6506007)(478600001)(86362001)(66476007)(316002)(110136005)(7696005)(76116006)(54906003)(66946007)(33656002)(66446008)(66556008)(64756008)(52536014)(19627235002)(33440700001)(30864003)(966005)(26005)(53546011)(8936002)(55016002)(107886003)(4326008)(2906002)(186003)(9686003)(8676002)(71200400001)(579004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: nniyBOHPSt3R6wg+dJ/BG6vHR68qe6LZ+Kx05SwQ3ldHOaK2xJn5qhcKhUuq6UqfqXL98iU5gCyu0YOT2AzsA+eRTbWpRf8OU/u0NwLxYmtvKdWDpGGym2XWd4y6P3DjxVfRmclV/+T23Su9g0b43rrnzmHk+DTDyrDi77QCdh4HlksA4NLXnpPdjUgGKZO+riOg1uGPkuPywfcuBSa5t5bY/T1uyW5aca4+v02Wgl4Tfc/0GJHpRDElLcqWDCMoncegQUo3csU4eEcGuFbine1cBKrI05N/OERHzIoGvlsfMcE8HpZvqJugoWu7mOPs+PPkLICpHuxIxM4BN8S9AXUdvaxoFmuPC334AfeKVnUeHRVdJqxXgxXeFFJ4t6G45JJR+MrkAbYVwi3zaULCdtBWdBOEynf/x2G3DUhREi1g6CUoe0q3eK5y7/Y20QhKA+AMs2GOjRLJTo4ruoPNeV0pR9Z+QeOLxPFl/tmtHT9I1SVH3bX1pZhJjTAzXewy MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 6770a70d-3509-4964-9076-08d7f6ec741b X-MS-Exchange-CrossTenant-originalarrivaltime: 13 May 2020 03:19:31.6133 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: gQMQTiMYTxt5ms0OPWgat5ypdSNtr+M5gzWHyGx3cwRm6Xv2Qn1G+tK2W3aKWEdr7A34pOmWk/BlICdvmy/NSQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3500 Return-Path: eric.dong@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Chasel, I have one comments for your patch. Can you help to add extra notes about = what has been done for each version. In this case, review can know what's c= hanged in different versions. You can add this info in below position (just below "> ---" in below patc= h file, I add a sample in below code), so it will not impact the final chec= k in log. > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Chiu, > Chasel > Sent: Wednesday, May 13, 2020 10:59 AM > To: devel@edk2.groups.io > Cc: Ma, Maurice ; Desimone, Nathaniel L > ; Zeng, Star > Subject: [edk2-devel] [PATCH v7] IntelFsp2Pkg: Support Multi-Phase SiIni= t > and debug handlers. >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2698 >=20 > To enhance FSP silicon initialization flexibility an optional Multi-Phas= e API is > introduced and FSP header needs update for new API offset. Also new > SecCore module created for FspMultiPhaseSiInit API >=20 > New ARCH_UPD introduced for enhancing FSP debug message flexibility now > bootloader can pass its own debug handler function pointer and FSP will = call > the function to handle debug message. >=20 > Cc: Maurice Ma > Cc: Nate DeSimone > Cc: Star Zeng > Signed-off-by: Chasel Chiu > --- Add extra info for different versions here. Just like below sample: V2 changes: 1. .... V1 changes: 1. ... 2. .... Thanks, Eric > IntelFsp2Pkg/FspSecCore/SecFspApiChk.c | = 6 +++--- > IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/PlatformSecLibNull.c | 1= 9 > ++++++++++++++++++- > IntelFsp2Pkg/FspSecCore/Fsp22SecCoreS.inf | 5= 2 > ++++++++++++++++++++++++++++++++++++++++++++++++++++ > IntelFsp2Pkg/FspSecCore/Ia32/Fsp22ApiEntryS.nasm | 9= 9 > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > +++++++++++++++++++++++++++++++++++++++++ > IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryCommon.nasm | = 5 > ++++- > IntelFsp2Pkg/Include/FspEas/FspApi.h | 13= 0 > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > +++++++++++--- > IntelFsp2Pkg/Include/FspGlobalData.h | 1= 0 +++++++--- > IntelFsp2Pkg/Include/Guid/FspHeaderFile.h | 1= 0 ++++++++-- > IntelFsp2Pkg/Include/Library/FspSecPlatformLib.h | 1= 6 > +++++++++++++++- > 9 files changed, 333 insertions(+), 14 deletions(-) >=20 > diff --git a/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c > b/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c > index 8e0595fe9a..1334959005 100644 > --- a/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c > +++ b/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c > @@ -1,6 +1,6 @@ > /** @file >=20 > - Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved. > + Copyright (c) 2016 - 2020, Intel Corporation. All rights > + reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -59,7 +59,7 @@ FspApiCallingCheck ( > Status =3D EFI_UNSUPPORTED; > } > } > - } else if (ApiIdx =3D=3D FspSiliconInitApiIndex) { > + } else if ((ApiIdx =3D=3D FspSiliconInitApiIndex) || (ApiIdx =3D=3D > + FspMultiPhaseSiInitApiIndex)) { > // > // FspSiliconInit check > // > @@ -68,7 +68,7 @@ FspApiCallingCheck ( > } else { > if (FspData->Signature !=3D FSP_GLOBAL_DATA_SIGNATURE) { > Status =3D EFI_UNSUPPORTED; > - } else if (EFI_ERROR (FspUpdSignatureCheck (ApiIdx, ApiParam))) { > + } else if (EFI_ERROR (FspUpdSignatureCheck > + (FspSiliconInitApiIndex, ApiParam))) { > Status =3D EFI_INVALID_PARAMETER; > } > } > diff --git > a/IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/PlatformSecLibNull.c > b/IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/PlatformSecLibNull.c > index f7945b5240..df8c5d121f 100644 > --- a/IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/PlatformSecLibNull.c > +++ b/IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/PlatformSecLibNull.c > @@ -1,7 +1,7 @@ > /** @file > Null instance of Platform Sec Lib. >=20 > - Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved. > + Copyright (c) 2014 - 2020, Intel Corporation. All rights > + reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -25,3 +25,20 @@ FspUpdSignatureCheck ( { > return EFI_SUCCESS; > } > + > +/** > + This function handles FspMultiPhaseSiInitApi. > + > + @param[in] ApiIdx Internal index of the FSP API. > + @param[in] ApiParam Parameter of the FSP API. > + > +**/ > +EFI_STATUS > +EFIAPI > +FspMultiPhaseSiInitApiHandler ( > + IN UINT32 ApiIdx, > + IN VOID *ApiParam > + ) > +{ > + return EFI_SUCCESS; > +} > diff --git a/IntelFsp2Pkg/FspSecCore/Fsp22SecCoreS.inf > b/IntelFsp2Pkg/FspSecCore/Fsp22SecCoreS.inf > new file mode 100644 > index 0000000000..0a24eb2a8b > --- /dev/null > +++ b/IntelFsp2Pkg/FspSecCore/Fsp22SecCoreS.inf > @@ -0,0 +1,52 @@ > +## @file > +# Sec Core for FSP to support MultiPhase (SeparatePhase) SiInitializat= ion. > +# > +# Copyright (c) 2020, Intel Corporation. All rights reserved.
# # > +SPDX-License-Identifier: BSD-2-Clause-Patent # ## > + > +[Defines] > + INF_VERSION =3D 0x00010005 > + BASE_NAME =3D Fsp22SecCoreS > + FILE_GUID =3D DF0FCD70-264A-40BF-BBD4-06C76DB19C= B1 > + MODULE_TYPE =3D SEC > + VERSION_STRING =3D 1.0 > + > +# > +# The following information is for reference only and not required by t= he > build tools. > +# > +# VALID_ARCHITECTURES =3D IA32 > +# > + > +[Sources] > + SecFspApiChk.c > + SecFsp.h > + > +[Sources.IA32] > + Ia32/Stack.nasm > + Ia32/Fsp22ApiEntryS.nasm > + Ia32/FspApiEntryCommon.nasm > + Ia32/FspHelper.nasm > + > +[Binaries.Ia32] > + RAW|Vtf0/Bin/ResetVec.ia32.raw |GCC > + > +[Packages] > + MdePkg/MdePkg.dec > + IntelFsp2Pkg/IntelFsp2Pkg.dec > + > +[LibraryClasses] > + BaseMemoryLib > + DebugLib > + BaseLib > + PciCf8Lib > + SerialPortLib > + FspSwitchStackLib > + FspCommonLib > + FspSecPlatformLib > + > +[Ppis] > + gEfiTemporaryRamSupportPpiGuid ## PRODUC= ES > + > diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/Fsp22ApiEntryS.nasm > b/IntelFsp2Pkg/FspSecCore/Ia32/Fsp22ApiEntryS.nasm > new file mode 100644 > index 0000000000..c5e73a635b > --- /dev/null > +++ b/IntelFsp2Pkg/FspSecCore/Ia32/Fsp22ApiEntryS.nasm > @@ -0,0 +1,99 @@ > +;; @file > +; Provide FSP API entry points. > +; > +; Copyright (c) 2020, Intel Corporation. All rights reserved.
; > +SPDX-License-Identifier: BSD-2-Clause-Patent ;; > + > + SECTION .text > + > +; > +; Following functions will be provided in C ; extern > +ASM_PFX(FspApiCommon) extern > ASM_PFX(FspMultiPhaseSiInitApiHandler) > + > +;---------------------------------------------------------------------- > +------ > +; NotifyPhase API > +; > +; This FSP API will notify the FSP about the different phases in the > +boot ; process ; > +;---------------------------------------------------------------------- > +------ > +global ASM_PFX(NotifyPhaseApi) > +ASM_PFX(NotifyPhaseApi): > + mov eax, 2 ; FSP_API_INDEX.NotifyPhaseApiIndex > + jmp ASM_PFX(FspApiCommon) > + > +;---------------------------------------------------------------------- > +------ > +; FspSiliconInit API > +; > +; This FSP API initializes the CPU and the chipset including the IO ; > +controllers in the chipset to enable normal operation of these devices. > +; > +;---------------------------------------------------------------------- > +------ > +global ASM_PFX(FspSiliconInitApi) > +ASM_PFX(FspSiliconInitApi): > + mov eax, 5 ; FSP_API_INDEX.FspSiliconInitApiIndex > + jmp ASM_PFX(FspApiCommon) > + > +;---------------------------------------------------------------------- > +------ > +; FspMultiPhaseSiInitApi API > +; > +; This FSP API provides multi-phase silicon initialization, which > +brings greater ; modularity beyond the existing FspSiliconInit() API. > +; Increased modularity is achieved by adding an extra API to FSP-S. > +; This allows the bootloader to add board specific initialization steps > +throughout ; the SiliconInit flow as needed. > +; > +;---------------------------------------------------------------------- > +------ > +global ASM_PFX(FspMultiPhaseSiInitApi) > +ASM_PFX(FspMultiPhaseSiInitApi): > + mov eax, 6 ; FSP_API_INDEX.FspMultiPhaseSiInitApiIndex > + jmp ASM_PFX(FspApiCommon) > + > +;---------------------------------------------------------------------- > +------ > +; FspApiCommonContinue API > +; > +; This is the FSP API common entry point to resume the FSP execution ; > +;---------------------------------------------------------------------- > +------ > +global ASM_PFX(FspApiCommonContinue) > +ASM_PFX(FspApiCommonContinue): > + ; > + ; Handle FspMultiPhaseSiInitApiIndex API > + ; > + cmp eax, 6 > + jnz NotMultiPhaseSiInitApi > + > + pushad > + push DWORD [esp + (4 * 8 + 4)] ; push ApiParam > + push eax ; push ApiIdx > + call ASM_PFX(FspMultiPhaseSiInitApiHandler) > + add esp, 8 > + mov dword [esp + (4 * 7)], eax > + popad > + ret > + > +NotMultiPhaseSiInitApi: > + jmp $ > + ret > + > +;---------------------------------------------------------------------- > +------ > +; TempRamInit API > +; > +; Empty function for WHOLEARCHIVE build option ; > +;---------------------------------------------------------------------- > +------ > +global ASM_PFX(TempRamInitApi) > +ASM_PFX(TempRamInitApi): > + jmp $ > + ret > + > +;---------------------------------------------------------------------- > +------ > +; Module Entrypoint API > +;---------------------------------------------------------------------- > +------ > +global ASM_PFX(_ModuleEntryPoint) > +ASM_PFX(_ModuleEntryPoint): > + jmp $ > + > diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryCommon.nasm > b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryCommon.nasm > index bb4451b145..26ae7d9fd3 100644 > --- a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryCommon.nasm > +++ b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryCommon.nasm > @@ -1,7 +1,7 @@ > ;; @file > ; Provide FSP API entry points. > ; > -; Copyright (c) 2016, Intel Corporation. All rights reserved.
> +; Copyright (c) 2016 - 2020, Intel Corporation. All rights > +reserved.
> ; SPDX-License-Identifier: BSD-2-Clause-Patent ;; >=20 > @@ -62,6 +62,9 @@ FspApiCommon2: > cmp eax, 3 ; FspMemoryInit API > jz FspApiCommon3 >=20 > + cmp eax, 6 ; FspMultiPhaseSiInitApiIndex API > + jz FspApiCommon3 > + > call ASM_PFX(AsmGetFspInfoHeader) > jmp ASM_PFX(Loader2PeiSwitchStack) >=20 > diff --git a/IntelFsp2Pkg/Include/FspEas/FspApi.h > b/IntelFsp2Pkg/Include/FspEas/FspApi.h > index dcf489dbe6..ed40f9538c 100644 > --- a/IntelFsp2Pkg/Include/FspEas/FspApi.h > +++ b/IntelFsp2Pkg/Include/FspEas/FspApi.h > @@ -1,8 +1,8 @@ > /** @file > Intel FSP API definition from Intel Firmware Support Package External > - Architecture Specification v2.0. > + Architecture Specification v2.0 - v2.2 >=20 > - Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved. > + Copyright (c) 2014 - 2020, Intel Corporation. All rights > + reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -10,6 +10,8 @@ > #ifndef _FSP_API_H_ > #define _FSP_API_H_ >=20 > +#include > + > /// > /// FSP Reset Status code > /// These are defined in FSP EAS v2.0 section 11.2.2 - OEM Status Code = @@ - > 24,6 +26,65 @@ > #define FSP_STATUS_RESET_REQUIRED_8 0x40000008 > /// @} >=20 > +/// > +/// FSP Event related definition. > +/// > +#define FSP_EVENT_CODE 0xF5000000 > +#define FSP_POST_CODE (FSP_EVENT_CODE | 0x00F80000) > + > +/* > + FSP may optionally include the capability of generating events messag= es to > aid in the debugging of firmware issues. > + These events fall under three catagories: Error, Progress, and Debug. > +The event reporting mechanism follows the > + status code services described in section 6 and 7 of the PI Specifica= tion v1.7 > Volume 3. > + > + @param[in] Type Indicates the type of event being r= eported. > + See MdePkg/Include/Pi/PiStatusCode.= h for the definition > of EFI_STATUS_CODE_TYPE. > + @param[in] Value Describes the current status of a h= ardware or > software entity. > + This includes information about the= class and subclass that > is used to classify the entity as well as an operation. > + For progress events, the operation = is the current activity. > For error events, it is the exception. > + For debug events, it is not defined= at this time. > + See MdePkg/Include/Pi/PiStatusCode.= h for the definition > of EFI_STATUS_CODE_VALUE. > + @param[in] Instance The enumeration of a hardware or so= ftware > entity within the system. > + A system may contain multiple entit= ies that match a > class/subclass pairing. The instance differentiates between them. > + An instance of 0 indicates that ins= tance information is > unavailable, not meaningful, or not relevant. > + Valid instance numbers start with 1= . > + @param[in] *CallerId This parameter can be used to ident= ify the > sub-module within the FSP generating the event. > + This parameter may be NULL. > + @param[in] *Data This optional parameter may be used= to pass > additional data. The contents can have event-specific data. > + For example, the FSP provides a > EFI_STATUS_CODE_STRING_DATA instance to this parameter when sending > debug messages. > + This parameter is NULL when no addi= tional data is > provided. > + > + @retval EFI_SUCCESS The event was handled successfully. > + @retval EFI_INVALID_PARAMETER Input parameters are invalid. > + @retval EFI_DEVICE_ERROR The event handler failed. > +*/ > +typedef > +EFI_STATUS > +(EFIAPI *FSP_EVENT_HANDLER) ( > + IN EFI_STATUS_CODE_TYPE Type, > + IN EFI_STATUS_CODE_VALUE Value, > + IN UINT32 Instance, > + IN OPTIONAL EFI_GUID *CallerId, > + IN OPTIONAL EFI_STATUS_CODE_DATA *Data > + ); > + > +/* > + Handler for FSP-T debug log messages, provided by the bootloader. > + > + @param[in] DebugMessage A pointer to the debug message to b= e > written to the log. > + @param[in] MessageLength Number of bytes to written to the d= ebug > log. > + > + @retval UINT32 The return value indicates the numb= er of bytes > actually written to > + the debug log. If the return value = is less than > MessageLength, > + an error occurred. > +*/ > +typedef > +UINT32 > +(EFIAPI *FSP_DEBUG_HANDLER) ( > + IN CHAR8* DebugMessage, > + IN UINT32 MessageLength > + ); > + > #pragma pack(1) > /// > /// FSP_UPD_HEADER Configuration. > @@ -77,7 +138,12 @@ typedef struct { > /// Current boot mode. > /// > UINT32 BootMode; > - UINT8 Reserved1[8]; > + /// > + /// Optional event handler for the bootloader to be informed of event= s > occurring during FSP execution. > + /// This value is only valid if Revision is >=3D 2. > + /// > + FSP_EVENT_HANDLER *FspEventHandler; > + UINT8 Reserved1[4]; > } FSPM_ARCH_UPD; >=20 > /// > @@ -147,6 +213,40 @@ typedef struct { > FSP_INIT_PHASE Phase; > } NOTIFY_PHASE_PARAMS; >=20 > +/// > +/// Action definition for FspMultiPhaseSiInit API /// typedef enum { > + EnumMultiPhaseGetNumberOfPhases =3D 0x0, > + EnumMultiPhaseExecutePhase =3D 0x1 > +} FSP_MULTI_PHASE_ACTION; > + > +/// > +/// Data structure returned by FSP when bootloader calling /// > +FspMultiPhaseSiInit API with action 0 > (EnumMultiPhaseGetNumberOfPhases) > +/// typedef struct { > + UINT32 NumberOfPhases; > + UINT32 PhasesExecuted; > +} FSP_MULTI_PHASE_GET_NUMBER_OF_PHASES_PARAMS; > + > +/// > +/// FspMultiPhaseSiInit function parameter. > +/// > +/// For action 0 (EnumMultiPhaseGetNumberOfPhases): > +/// - PhaseIndex must be 0. > +/// - MultiPhaseParamPtr should point to an instance of > FSP_MULTI_PHASE_GET_NUMBER_OF_PHASES_PARAMS. > +/// > +/// For action 1 (EnumMultiPhaseExecutePhase): > +/// - PhaseIndex will be the phase that will be executed by FSP. > +/// - MultiPhaseParamPtr shall be NULL. > +/// > +typedef struct { > + IN FSP_MULTI_PHASE_ACTION MultiPhaseAction; > + IN UINT32 PhaseIndex; > + IN OUT VOID *MultiPhaseParamPtr; > +} FSP_MULTI_PHASE_PARAMS; > + > #pragma pack() >=20 > /** > @@ -279,4 +379,28 @@ EFI_STATUS > IN VOID *FspsUpdDataPtr > ); >=20 > +/** > + This FSP API is expected to be called after FspSiliconInit but before > FspNotifyPhase. > + This FSP API provides multi-phase silicon initialization; which > +brings greater modularity > + beyond the existing FspSiliconInit() API. Increased modularity is > +achieved by adding an > + extra API to FSP-S. This allows the bootloader to add board specific > +initialization steps > + throughout the SiliconInit flow as needed. > + > + @param[in,out] FSP_MULTI_PHASE_PARAMS For action - > EnumMultiPhaseGetNumberOfPhases: > + FSP_MULTI_PHASE_PARAMS->Mul= tiPhaseParamPtr > will contain > + how many phases supported b= y FSP. > + For action - EnumMultiPhaseEx= ecutePhase: > + FSP_MULTI_PHASE_PARAMS->Mul= tiPhaseParamPtr > shall be NULL. > + @retval EFI_SUCCESS FSP execution environment was= initialized > successfully. > + @retval EFI_INVALID_PARAMETER Input parameters are invalid. > + @retval EFI_UNSUPPORTED The FSP calling conditions we= re not > met. > + @retval EFI_DEVICE_ERROR FSP initialization failed. > + @retval FSP_STATUS_RESET_REQUIREDx A reset is required. These > status codes will not be returned during S3. > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *FSP_MULTI_PHASE_SI_INIT) ( > + IN FSP_MULTI_PHASE_PARAMS *MultiPhaseSiInitParamPtr > +); > + > #endif > diff --git a/IntelFsp2Pkg/Include/FspGlobalData.h > b/IntelFsp2Pkg/Include/FspGlobalData.h > index 1896b0240a..4fa9f62bed 100644 > --- a/IntelFsp2Pkg/Include/FspGlobalData.h > +++ b/IntelFsp2Pkg/Include/FspGlobalData.h > @@ -1,6 +1,6 @@ > /** @file >=20 > - Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved. > + Copyright (c) 2014 - 2020, Intel Corporation. All rights > + reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -22,6 +22,7 @@ typedef enum { > FspMemoryInitApiIndex, > TempRamExitApiIndex, > FspSiliconInitApiIndex, > + FspMultiPhaseSiInitApiIndex, > FspApiIndexMax > } FSP_API_INDEX; >=20 > @@ -52,10 +53,13 @@ typedef struct { > VOID *SiliconInitUpdPtr; > UINT8 ApiIdx; > UINT8 FspMode; // 0: FSP in API mode; 1: FSP in DISPATC= H mode > - UINT8 Reserved3[30]; > + UINT8 Reserved3[2]; > + UINT32 NumberOfPhases; > + UINT32 PhasesExecuted; > + UINT8 Reserved4[26]; > UINT32 PerfSig; > UINT16 PerfLen; > - UINT16 Reserved4; > + UINT16 Reserved5; > UINT32 PerfIdx; > UINT64 PerfData[32]; > } FSP_GLOBAL_DATA; > diff --git a/IntelFsp2Pkg/Include/Guid/FspHeaderFile.h > b/IntelFsp2Pkg/Include/Guid/FspHeaderFile.h > index 16f43a1273..3474bac1de 100644 > --- a/IntelFsp2Pkg/Include/Guid/FspHeaderFile.h > +++ b/IntelFsp2Pkg/Include/Guid/FspHeaderFile.h > @@ -1,8 +1,8 @@ > /** @file > Intel FSP Header File definition from Intel Firmware Support Package > External > - Architecture Specification v2.0. > + Architecture Specification v2.0 and above. >=20 > - Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved. > + Copyright (c) 2014 - 2020, Intel Corporation. All rights > + reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -110,6 +110,12 @@ typedef struct { > /// Byte 0x44: The offset for the API to initialize the CPU and chips= et. > /// > UINT32 FspSiliconInitEntryOffset; > + /// > + /// Byte 0x48: Offset for the API for the optional Multi-Phase proces= sor > and chipset initialization. > + /// This value is only valid if FSP HeaderRevision is >=3D= 5. > + /// If the value is set to 0x00000000, then this API is no= t available in > this component. > + /// > + UINT32 FspMultiPhaseSiInitEntryOffset; > } FSP_INFO_HEADER; >=20 > /// > diff --git a/IntelFsp2Pkg/Include/Library/FspSecPlatformLib.h > b/IntelFsp2Pkg/Include/Library/FspSecPlatformLib.h > index 4d01b5f6d9..51a0309aed 100644 > --- a/IntelFsp2Pkg/Include/Library/FspSecPlatformLib.h > +++ b/IntelFsp2Pkg/Include/Library/FspSecPlatformLib.h > @@ -1,6 +1,6 @@ > /** @file >=20 > - Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved. > + Copyright (c) 2015 - 2020, Intel Corporation. All rights > + reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -79,4 +79,18 @@ FspUpdSignatureCheck ( > IN VOID *ApiParam > ); >=20 > +/** > + This function handles FspMultiPhaseSiInitApi. > + > + @param[in] ApiIdx Internal index of the FSP API. > + @param[in] ApiParam Parameter of the FSP API. > + > +**/ > +EFI_STATUS > +EFIAPI > +FspMultiPhaseSiInitApiHandler ( > + IN UINT32 ApiIdx, > + IN VOID *ApiParam > + ); > + > #endif > -- > 2.13.3.windows.1 >=20 >=20 >=20