From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web09.225.1612914340849160428 for ; Tue, 09 Feb 2021 15:45:40 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=xa9AENue; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: rangasai.v.chaganty@intel.com) IronPort-SDR: uE4VbVeZpSO5RPu+qDopBEfNc20I4FmqBYFdrLoh35Zj2CpDqnMPn2O4zwJtBN82LjO7EInZEh K80e/F+ENZPg== X-IronPort-AV: E=McAfee;i="6000,8403,9890"; a="181206373" X-IronPort-AV: E=Sophos;i="5.81,166,1610438400"; d="scan'208";a="181206373" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2021 15:45:39 -0800 IronPort-SDR: vwkbyj6jQYdAGkSgBzgQY63z5lCs+UjIR55wXsT3yJDPrpuJL0lIEC2LHndjsNaBu9ZZaQCoFE ZYt2SI9lfc6A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,166,1610438400"; d="scan'208";a="398975175" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga007.jf.intel.com with ESMTP; 09 Feb 2021 15:45:38 -0800 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Tue, 9 Feb 2021 15:45:38 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Tue, 9 Feb 2021 15:45:37 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Tue, 9 Feb 2021 15:45:36 -0800 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (104.47.38.51) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Tue, 9 Feb 2021 15:45:22 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PEhglv3L/SOSbbJMd16FD+ELN5UN7WuluOfMEsjIGbs7bSK2Rz1B5XcYX2t440hlluN8fDmWl6PRCjALNj1o0TWoZPoT+wpz3Kkhk8eolmzVFU9JTfOi6KVoPFfM7/KNRQI+s0Hc64hDNoTJprtOKYRZ1zV11HgZ8PJtYIwUSlqPYI9fh9JdXIovde9+ZYdBhL4kQ5TXgbrz6mbIQIup8W/LkO6HPE5296r8fD0BCfFoSDEJrNpxUfulfVuwTG4AgtR4ZMJrw4F14uDoDnUV/fkIjHlX8suLwmQJswtevG+GXA3XTnK6uqFdfs+SPHhDo/5QOeLZ3KeIy5Bqct+Kpw== 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=ixNR0Dj8dwX8i7gqLcufBhSHPmCE15qh3LTT89CYJfE=; b=gkLknnGblZwb836CFJEXWEYqc60z+3RT5SUqtEq+t0n/BcI9Ak2JW5pQEYmHLA04xrb5wD2cf2QgGQcYSLCKSQvrB0Pqy1fnx1hAc4P8tiTfuf66xEkXHcU1mgSX2MO7erbcguLHeK/x2gYzL9NvWZR22Xp0MzYDY3zbl0vryn+kUdhMK6PITSuSq+PAXg1Fv0aUKKPScCFPhXgHHZuKOSWLulvc//lRdKESsla1vACsK+eHMJU9Jzab5DdE4urEZd1vF6qlsreKdfycPqmgTUKPJep55G0eE+TbNdyeqTiGEGE9fL9BG3FpDo0JVkYoMroMFVjn2E/3qeGAr/quFg== 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=ixNR0Dj8dwX8i7gqLcufBhSHPmCE15qh3LTT89CYJfE=; b=xa9AENuel2JxJdppLjSXrJoPRWjTPzG+5hpqTrNqKTpAEZCT6p8Jz/JuYfEFTWoq8WTm1vWWLTglK9mmxItEm2DPpGk0oQ5sXH8s2GaGeLbfXz+1HPRhqcDVXiH03BzMix7ruIibsql1yZQmRJIxAF2QViPqAaaEgTFL3hx0RzQ= Received: from BY5PR11MB4467.namprd11.prod.outlook.com (2603:10b6:a03:1b9::33) by BYAPR11MB2581.namprd11.prod.outlook.com (2603:10b6:a02:cc::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.17; Tue, 9 Feb 2021 23:45:19 +0000 Received: from BY5PR11MB4467.namprd11.prod.outlook.com ([fe80::84a3:28b1:8266:42b8]) by BY5PR11MB4467.namprd11.prod.outlook.com ([fe80::84a3:28b1:8266:42b8%6]) with mapi id 15.20.3825.030; Tue, 9 Feb 2021 23:45:19 +0000 From: "Chaganty, Rangasai V" To: "Luo, Heng" , "devel@edk2.groups.io" CC: "Desimone, Nathaniel L" Subject: Re: [Patch V2 3/8] TigerlakeOpenBoardPkg: Add library instances Thread-Topic: [Patch V2 3/8] TigerlakeOpenBoardPkg: Add library instances Thread-Index: AQHW/sAQCr9RN6SPnk6/i5lQzwWk0qpQfUKg Date: Tue, 9 Feb 2021 23:45:18 +0000 Message-ID: References: <20210209084549.4417-1-heng.luo@intel.com> <20210209084549.4417-3-heng.luo@intel.com> In-Reply-To: <20210209084549.4417-3-heng.luo@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows 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: [50.45.159.74] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e4609731-95b5-4337-3a15-08d8cd54c226 x-ms-traffictypediagnostic: BYAPR11MB2581: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:173; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: slxunJXoHGvkPcFg4tFaqnkCI8kNtpfz5P6MEZSFZQWrFmE46mgD8AAI+zTkP3vyFV0XSq+/G5NCxtOrDfgxeUAJ2uNWO5KhHi1mihzyFg56rkMOuBVBir7A8S/gLM6H7/REsjztnGPe+Yp+zhwKoU6hEYTBaoJInMbvN8nfGIZ24F5O84DofoGlqJ31dxfAyFRyV0rVAYUaj1A4Ii2YMoi+IANmmS9q231umQEqWtnaHThWUny9WwP4+ccw6LhW5ZswRTmTdohGj87S4PQee5zelWSgyJmmzjIcEiG2QR2aFjrGrlKnkxgFyHorNpH/e/ozibGNCdhD+xvoDPxAUAvxdliLPd43zivIRWzgaXcpQx3jBA3CUm2vfaE57W+BBym0WoyFz0tfFJHv/9odxujfyzNbFD0YqK5h+SPESGzpbzncCwBszTNIlHNEYJy5OznEXutnhRq2wdyTr3SGkeshmf9Y6gL2SGRs9pEjHMKYIeXq/JfzOJBSKC1WZPiaeNYUPbq+p8loENT5lRIj3J0PTUD/R3S4dH4lRLij+EvnMcMRVgpNCHn0L/Z2jlJ6MZlyeOCuY1zrswHoa5KE88rCAy93mMzzPhH7/tBRbFBJZ/O6HaDQVzpZbJhoU29jq0pGIHIF/wb2J3PL+r3Faw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR11MB4467.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(39860400002)(346002)(376002)(136003)(366004)(53546011)(83380400001)(55016002)(2906002)(33656002)(6506007)(30864003)(8676002)(66476007)(76116006)(66946007)(66556008)(26005)(107886003)(64756008)(66446008)(19627235002)(186003)(110136005)(52536014)(8936002)(86362001)(4326008)(316002)(966005)(5660300002)(478600001)(71200400001)(7696005)(9686003)(579004)(569008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?gnb4MZviwNx8jmkhjEeIIfqr+2HJL8hLBG5BZGOlVnoX+OPVfkpjTgAyxB3C?= =?us-ascii?Q?oDNtUvdciYNPIyWR2Qg12tV+cGCeQDogOmgl926lp8JZHsSEsCU/Q65BU+Vg?= =?us-ascii?Q?5I+cSckEkgjNcjuM9zwwfKrdaSJ+WLtN9iLVEH3ha9UGuQGaaweufJU2XbGS?= =?us-ascii?Q?ViMtgpo+wbM/iKmjLC5HwEJ4mUJoLCPun55IjNGENIaEZow6day29ZR4YvO0?= =?us-ascii?Q?HSg8qOGWhsewrsl6Q3z8hbqZ08pKbfiABG/3k+yRsrETAMom+tm7ylr0hM+O?= =?us-ascii?Q?0lxCzl13hE/IU5c5i8TuxE04yHSjySlugIjUeDzTJKZLV+4Qtq3NNzO34l0H?= =?us-ascii?Q?oYjvgj3vKT7k5ZpjeJRf9e1YW16zdX47CAfpU2femZhENFA+RdTiQMw97E+9?= =?us-ascii?Q?rXyYUZoK7G3Anfkqp7upY3jfDOaM223aEetMIlNmq8YczCQmtFgLwqXB9EeX?= =?us-ascii?Q?vzrqylnqFKU7q2CPlMZXDl1C4F2Ni8nUwZV5mbYQUwTxOl6GPUe6DZ1ANn6q?= =?us-ascii?Q?B6fx2hsFmyCh5v0nYcNVpiJbS8lmV6/jaApcgwqJ3trEZQ9jc0lKo4FMYa+q?= =?us-ascii?Q?BVn7VxAjxGrkZxrs9RsiqHDogUVcsWt3TgsJl5zx52b+YeR068YR26RhPzmD?= =?us-ascii?Q?rMPIq5kKbgEBFtjA8nUy6bmR47kaXOMZhVgeWIi0Cp+eEMwBH14OZDSDmWuj?= =?us-ascii?Q?YCV557tE6A04ILTBKOAk8+iGKjBQ3DP/tvjKl6INEGgdk4UFAdEFv+JpU4tH?= =?us-ascii?Q?PZWS/1cAsDTJdfS/p9fUjW75mPOG5xSwL+VV5viqggqAkJZSuyyeRWd68bas?= =?us-ascii?Q?Tq18aa3l6zPHMihNm6joSQkRJNXI5lxDNjh+1sgn+EvfBICSrwNnuEjZzCZR?= =?us-ascii?Q?6eYeRlweSbcv4DkHYatl7MuIiF87kpMT2jY1uFly6eE5M4TA7YKLgjWxQCac?= =?us-ascii?Q?JN7oTKUALi7IXgl0b5BSWRQhRAiXbcFd/17l8fGtkiJs3SejbkV2vFyemiGr?= =?us-ascii?Q?TmKpymwkmRH1NeyimE3kx4ggaJ2PHiuhPtTGrSifpfjjZD37Dy3mt35VXIPt?= =?us-ascii?Q?2NozEbz+ke/IkfqBXcAefPV+fmeI9kIUsCbcqBEwGecg+VJk7D9n7q7dcO9A?= =?us-ascii?Q?6/f2tq3B9gALhm2+egQ0vJSisg2CfHhhnDbBwXpsFlxLWXzeixH9TqasSJq4?= =?us-ascii?Q?5XsU4pZM0XQOKP+guw74mae2mnRjxKbAUtlcas2lgtGnTcbWjIX8dD3YAlpD?= =?us-ascii?Q?rSOmMqD1IrL6+Jt+a/ChQXCZDQ0j06nFNOzsemKrqZiMsymbb6aaSVov6YmV?= =?us-ascii?Q?Rr5CR0lfHhtTBwmaKCbSekf2?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BY5PR11MB4467.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e4609731-95b5-4337-3a15-08d8cd54c226 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Feb 2021 23:45:18.9548 (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: MQLtgLL5XvPOSzZ2WHi65OoQJ869Y+SN8SweoazhJ1fufcDbRE37wwUiHHAYUnZdes5AE6GRrIpFtlXR0Jd+Ub1kjfzKd6at0Z2JKOhLSv0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2581 Return-Path: rangasai.v.chaganty@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Sai Chaganty =20 -----Original Message----- From: Luo, Heng =20 Sent: Tuesday, February 09, 2021 12:46 AM To: devel@edk2.groups.io Cc: Chaganty, Rangasai V ; Desimone, Nathani= el L Subject: [Patch V2 3/8] TigerlakeOpenBoardPkg: Add library instances REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3175 Adds the following library instances: * FspWrapper/Library/PeiFspPolicyInitLib * FspWrapper/Library/PeiSiDefaultPolicyInitLib * FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib * Library/BasePlatformHookLib * Library/SmmSpiFlashCommonLib * Policy/Library/DxeSiliconPolicyUpdateLib Cc: Sai Chaganty Cc: Nate DeSimone Signed-off-by: Heng Luo --- Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLi= b/PeiFspCpuPolicyInitLib.c | 79 +++++++++++++++++++= ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLi= b/PeiFspMePolicyInitLib.c | 51 +++++++++++++++++++= ++++++++++++++++++++++++++++++++ Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLi= b/PeiFspMiscUpdInitLib.c | 27 +++++++++++++++++++= ++++++++ Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLi= b/PeiFspPchPolicyInitLib.c | 372 +++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++ Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLi= b/PeiFspPolicyInitLib.c | 308 +++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLi= b/PeiFspPolicyInitLib.h | 187 +++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++++++++++++ Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLi= b/PeiFspPolicyInitLib.inf | 183 +++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++++++++ Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLi= b/PeiFspSaPolicyInitLib.c | 240 +++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLi= b/PeiFspSecurityPolicyInitLib.c | 49 +++++++++++++++++++= ++++++++++++++++++++++++++++++ Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiDefaultPolicy= InitLib/PeiSiDefaultPolicyInitLib.c | 39 +++++++++++++++++++= ++++++++++++++++++++ Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiDefaultPolicy= InitLib/PeiSiDefaultPolicyInitLib.inf | 38 +++++++++++++++++++= +++++++++++++++++++ Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiPreMemDefault= PolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.c | 40 +++++++++++++++++++= +++++++++++++++++++++ Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiPreMemDefault= PolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.inf | 38 +++++++++++++++++++= +++++++++++++++++++ Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/BasePlatf= ormHookLib.c | 391 +++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/BasePlatf= ormHookLib.inf | 51 +++++++++++++++++++= ++++++++++++++++++++++++++++++++ Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SmmSpiFl= ashCommonLib.inf | 49 +++++++++++++++++++= ++++++++++++++++++++++++++++++ Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiFlash= Common.c | 210 +++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++ Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiFlash= CommonSmmLib.c | 58 +++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++ Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdate= Lib/DxeGopPolicyInit.c | 168 +++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdate= Lib/DxePchPolicyInit.c | 61 +++++++++++++++++++= ++++++++++++++++++++++++++++++++++++++++++ Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdate= Lib/DxeSaPolicyInit.c | 61 +++++++++++++++++++= ++++++++++++++++++++++++++++++++++++++++++ Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdate= Lib/DxeSiliconPolicyUpdateLate.c | 97 +++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++ Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdate= Lib/DxeSiliconPolicyUpdateLib.inf | 49 +++++++++++++++++++= ++++++++++++++++++++++++++++++ 23 files changed, 2846 insertions(+) diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFsp= PolicyInitLib/PeiFspCpuPolicyInitLib.c b/Platform/Intel/TigerlakeOpenBoardP= kg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspCpuPolicyInitLib.c new file mode 100644 index 0000000000..1358d6a19b --- /dev/null +++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyI= nitLib/PeiFspCpuPolicyInitLib.c @@ -0,0 +1,79 @@ +/** @file + Implementation of Fsp CPU Policy Initialization. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/** + Performs FSP CPU PEI Policy initialization. + + @param[in][out] FspmUpd Pointer to FSP UPD Data. + + @retval EFI_SUCCESS FSP UPD Data is updated. + @retval EFI_NOT_FOUND Fail to locate required PPI. + @retval Other FSP UPD Data update process fail. +**/ +EFI_STATUS +EFIAPI +PeiFspCpuPolicyInitPreMem ( + IN OUT FSPM_UPD *FspmUpd + ) +{ + CPU_CONFIG_LIB_PREMEM_CONFIG *CpuConfigLibPreMemConfig; + CPU_SECURITY_PREMEM_CONFIG *CpuSecurityPreMemConfig; +#if FixedPcdGet8(PcdFspModeSelection) =3D=3D 0 + EFI_STATUS Status; + SI_PREMEM_POLICY_PPI *SiPreMemPolicyPpi; + SiPreMemPolicyPpi =3D NULL; +#endif + + CpuConfigLibPreMemConfig =3D NULL; + CpuSecurityPreMemConfig =3D NULL; + DEBUG ((DEBUG_INFO | DEBUG_INIT, "FSP Update SiCpuPolicy Pre-Mem Start\n= ")); + +#if FixedPcdGet8(PcdFspModeSelection) =3D=3D 0 + // + // Locate SiPreMemPolicyPpi + // + Status =3D PeiServicesLocatePpi ( + &gSiPreMemPolicyPpiGuid, + 0, + NULL, + (VOID **) &SiPreMemPolicyPpi + ); + if (EFI_ERROR (Status)) { + return EFI_NOT_FOUND; + } + Status =3D GetConfigBlock ((VOID *) SiPreMemPolicyPpi, &gCpuConfigLibPre= MemConfigGuid, (VOID *) &CpuConfigLibPreMemConfig); + DEBUG ((DEBUG_INFO | DEBUG_INIT, "FSP Update SiCpuPolicy Pre-Mem End\n")= ); + Status =3D GetConfigBlock ((VOID *) SiPreMemPolicyPpi, &gCpuSecurityPreM= emConfigGuid, (VOID *) &CpuSecurityPreMemConfig); + ASSERT_EFI_ERROR(Status); +#endif + // + // Cpu Config Lib policies + // + UPDATE_POLICY (FspmUpd->FspmConfig.CpuRatio, CpuConfigLibPreMemConfig->C= puRatio, 0); + DEBUG ((DEBUG_INFO, "BIOS Guard PCD and Policy are disabled\n")); + UPDATE_POLICY (FspmUpd->FspmConfig.BiosGuard, CpuSecurityPreMemConfig->B= iosGuard, 0); + UPDATE_POLICY (FspmUpd->FspmConfig.PrmrrSize, CpuSecurityPreMemConfig->P= rmrrSize, SIZE_1MB); + UPDATE_POLICY (FspmUpd->FspmConfig.EnableC6Dram, CpuSecurityPreMemConfig= ->EnableC6Dram, 1); + + return EFI_SUCCESS; +} diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFsp= PolicyInitLib/PeiFspMePolicyInitLib.c b/Platform/Intel/TigerlakeOpenBoardPk= g/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspMePolicyInitLib.c new file mode 100644 index 0000000000..53b5ef43cd --- /dev/null +++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyI= nitLib/PeiFspMePolicyInitLib.c @@ -0,0 +1,51 @@ +/** @file + Implementation of Fsp Me Policy Initialization. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include +#include + +/** + Performs FSP ME PEI Policy pre mem initialization. + + @param[in][out] FspmUpd Pointer to FSP UPD Data. + + @retval EFI_SUCCESS FSP UPD Data is updated. + @retval EFI_NOT_FOUND Fail to locate required PPI. + @retval Other FSP UPD Data update process fail. +**/ +EFI_STATUS +EFIAPI +PeiFspMePolicyInitPreMem ( + IN OUT FSPM_UPD *FspmUpd + ) +{ + DEBUG ((DEBUG_INFO, "PeiFspMePolicyInitPreMem\n")); + + return EFI_SUCCESS; +} + +/** + Performs FSP ME PEI Policy initialization. + + @param[in][out] FspsUpd Pointer to FSP UPD Data. + + @retval EFI_SUCCESS FSP UPD Data is updated. + @retval EFI_NOT_FOUND Fail to locate required PPI. + @retval Other FSP UPD Data update process fail. +**/ +EFI_STATUS +EFIAPI +PeiFspMePolicyInit ( + IN OUT FSPS_UPD *FspsUpd + ) +{ + DEBUG ((DEBUG_INFO, "PeiFspMePolicyInit \n")); + + return EFI_SUCCESS; +} + diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFsp= PolicyInitLib/PeiFspMiscUpdInitLib.c b/Platform/Intel/TigerlakeOpenBoardPkg= /FspWrapper/Library/PeiFspPolicyInitLib/PeiFspMiscUpdInitLib.c new file mode 100644 index 0000000000..5a12e569d9 --- /dev/null +++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyI= nitLib/PeiFspMiscUpdInitLib.c @@ -0,0 +1,27 @@ +/** @file + Implementation of Fsp Misc UPD Initialization. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include + +#include +#include +/** + Performs FSP Misc UPD initialization. + + @param[in][out] FspmUpd Pointer to FSPM_UPD Data. + + @retval EFI_SUCCESS FSP UPD Data is updated. +**/ +EFI_STATUS +EFIAPI +PeiFspMiscUpdInitPreMem ( + IN OUT FSPM_UPD *FspmUpd + ) +{ + return EFI_SUCCESS; +} + diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFsp= PolicyInitLib/PeiFspPchPolicyInitLib.c b/Platform/Intel/TigerlakeOpenBoardP= kg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPchPolicyInitLib.c new file mode 100644 index 0000000000..67b75d6faf --- /dev/null +++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyI= nitLib/PeiFspPchPolicyInitLib.c @@ -0,0 +1,372 @@ +/** @file + Implementation of Fsp PCH Policy Initialization. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// +// USB limits +// +#define PCH_MAX_USB2_PORTS 16 +#define PCH_MAX_USB3_PORTS 10 + +// +// TypeC port map GPIO pin +// +IOM_AUX_ORI_PAD_CONFIG mIomAuxNullTable[MAX_IOM_AUX_BIAS_COUNT] =3D { + // Pull UP GPIO Pin, Pull Down GPIO pin + {0, 0}, // Port 0 + {0, 0}, // Port 1 + {0, 0}, // Port 2 + {0, 0}, // Port 3 +}; + + +VOID +UpdatePcieClockInfo ( + PCH_PCIE_RP_PREMEM_CONFIG *PcieRpPreMemConfig, + IN FSPM_UPD *FspmUpd, + UINTN Index, + UINT64 Data + ) +{ + PCD64_BLOB Pcd64; + + Pcd64.Blob =3D Data; + DEBUG ((DEBUG_INFO, "UpdatePcieClockInfo ClkIndex %x ClkUsage %x, Suppor= ted %x\n", Index, Pcd64.PcieClock.ClockUsage, Pcd64.PcieClock.ClkReqSupport= ed)); + + UPDATE_POLICY (FspmUpd->FspmConfig.PcieClkSrcUsage[Index], PcieRpPreMemC= onfig->PcieClock[Index].Usage, (UINT8)Pcd64.PcieClock.ClockUsage); + UPDATE_POLICY (FspmUpd->FspmConfig.PcieClkSrcClkReq[Index], PcieRpPreMem= Config->PcieClock[Index].ClkReq, Pcd64.PcieClock.ClkReqSupported ? (UINT8)I= ndex : 0xFF); +} +/** + Performs FSP PCH PEI Policy pre mem initialization. + + @param[in][out] FspmUpd Pointer to FSP UPD Data. + + @retval EFI_SUCCESS FSP UPD Data is updated. + @retval EFI_NOT_FOUND Fail to locate required PPI. + @retval Other FSP UPD Data update process fail. +**/ +EFI_STATUS +EFIAPI +PeiFspPchPolicyInitPreMem ( + IN OUT FSPM_UPD *FspmUpd + ) +{ + UINTN Index; + PCH_PCIE_RP_PREMEM_CONFIG *PcieRpPreMemConfig; + HDAUDIO_PREMEM_CONFIG *HdaPreMemConfig; +#if FixedPcdGet8(PcdFspModeSelection) =3D=3D 0 + SI_PREMEM_POLICY_PPI *SiPreMemPolicy; + EFI_STATUS Status; + + // + // Locate PchPreMemPolicyPpi + // + SiPreMemPolicy =3D NULL; + PcieRpPreMemConfig =3D NULL; + HdaPreMemConfig =3D NULL; + Status =3D PeiServicesLocatePpi ( + &gSiPreMemPolicyPpiGuid, + 0, + NULL, + (VOID **) &SiPreMemPolicy + ); + if (EFI_ERROR (Status)) { + return EFI_NOT_FOUND; + } + + Status =3D GetConfigBlock ((VOID *) SiPreMemPolicy, &gPcieRpPreMemConfig= Guid, (VOID *) &PcieRpPreMemConfig); + ASSERT_EFI_ERROR (Status); + Status =3D GetConfigBlock ((VOID *) SiPreMemPolicy, &gHdAudioPreMemConfi= gGuid, (VOID *) &HdaPreMemConfig); + ASSERT_EFI_ERROR (Status); +#else + PcieRpPreMemConfig =3D NULL; + HdaPreMemConfig =3D NULL; +#endif + + UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 0, PcdGet64 (PcdPcieC= lock0)); + UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 1, PcdGet64 (PcdPcieC= lock1)); + UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 2, PcdGet64 (PcdPcieC= lock2)); + UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 3, PcdGet64 (PcdPcieC= lock3)); + UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 4, PcdGet64 (PcdPcieC= lock4)); + UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 5, PcdGet64 (PcdPcieC= lock5)); + UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 6, PcdGet64 (PcdPcieC= lock6)); + UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 7, PcdGet64 (PcdPcieC= lock7)); + UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 8, PcdGet64 (PcdPcieC= lock8)); + UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 9, PcdGet64 (PcdPcieC= lock9)); + UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 10, PcdGet64 (PcdPcieC= lock10)); + UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 11, PcdGet64 (PcdPcieC= lock11)); + UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 12, PcdGet64 (PcdPcieC= lock12)); + UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 13, PcdGet64 (PcdPcieC= lock13)); + UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 14, PcdGet64 (PcdPcieC= lock14)); + UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 15, PcdGet64 (PcdPcieC= lock15)); + + // + // Update HDA policies + // + UPDATE_POLICY (FspmUpd->FspmConfig.PchHdaIDispLinkTmode, HdaPreMemConfig= ->IDispLinkTmode, 0); + UPDATE_POLICY (FspmUpd->FspmConfig.PchHdaSdiEnable[0], HdaPreMemConfig->= AudioLinkHda.SdiEnable[0], FALSE); + + for (Index =3D 0; Index < GetPchHdaMaxDmicLinkNum (); Index++) { + UPDATE_POLICY (FspmUpd->FspmConfig.PchHdaAudioLinkDmicClockSelect[Inde= x], HdaPreMemConfig->AudioLinkDmic[Index].DmicClockSelect, 0); + } + DEBUG((DEBUG_INFO | DEBUG_INIT, "UpdatePeiPchPolicyPreMem\n")); + return EFI_SUCCESS; +} + +/** + This function updates USB Policy per port OC Pin number + + @param[in] PchUsbConfig Pointer to USB_CONFIG data buffer + @param[in] PortIndex USB Port index + @param[in] Pin OverCurrent pin number +**/ +VOID +UpdateUsb20OverCurrentPolicy ( + IN OUT FSPS_UPD *FspsUpd, + IN USB_CONFIG *UsbConfig, + IN UINT8 PortIndex, + UINT8 Pin +) +{ + if (PortIndex < MAX_USB2_PORTS && ((Pin < USB_OC_MAX_PINS) || (Pin =3D= =3D USB_OC_SKIP))) { + UPDATE_POLICY ( + FspsUpd->FspsConfig.Usb2OverCurrentPin[PortIndex], + UsbConfig->PortUsb20[PortIndex].OverCurrentPin, + Pin + ); + } else { + if (PortIndex >=3D MAX_USB2_PORTS) { + DEBUG ((DEBUG_ERROR, "UpdateUsb20OverCurrentPolicy: USB2 port number= %d is not a valid USB2 port number\n", PortIndex)); + } else { + DEBUG ((DEBUG_ERROR, "UpdateUsb20OverCurrentPolicy: Invalid OverCurr= ent pin specified USB2 port %d\n", PortIndex)); + } + } +} + +/** + This function updates USB Policy per port OC Pin number + + @param[in] PchUsbConfig Pointer to USB_CONFIG data buffer + @param[in] PortIndex USB Port index + @param[in] Pin OverCurrent pin number +**/ +VOID +UpdateUsb30OverCurrentPolicy ( + IN OUT FSPS_UPD *FspsUpd, + IN USB_CONFIG *UsbConfig, + IN UINT8 PortIndex, + UINT8 Pin +) +{ + if (PortIndex < MAX_USB3_PORTS && ((Pin < USB_OC_MAX_PINS) || (Pin =3D= =3D USB_OC_SKIP))) { + UPDATE_POLICY ( + FspsUpd->FspsConfig.Usb3OverCurrentPin[PortIndex], + UsbConfig->PortUsb30[PortIndex].OverCurrentPin, + Pin + ); + } else { + if (PortIndex >=3D MAX_USB2_PORTS) { + DEBUG ((DEBUG_ERROR, "UpdateUsb30OverCurrentPolicy: USB3 port number= %d is not a valid USB3 port number\n", PortIndex)); + } else { + DEBUG ((DEBUG_ERROR, "UpdateUsb30OverCurrentPolicy: Invalid OverCurr= ent pin specified USB3 port %d\n", PortIndex)); + } + } +} + +/** + This function performs PCH USB Platform Policy initialization + + @param[in] PchUsbConfig Pointer to USB_CONFIG data buffer + @param[in] PchSetup Pointer to PCH_SETUP data buffer +**/ +VOID +UpdatePchUsbConfig ( + IN OUT FSPS_UPD *FspsUpd, + IN OUT USB_CONFIG *UsbConfig + ) +{ + UINTN PortIndex; + + UPDATE_POLICY (FspsUpd->FspsConfig.PchUsbOverCurrentEnable, UsbConfig->O= verCurrentEnable, TRUE); + + for (PortIndex =3D 0; PortIndex < GetPchUsb2MaxPhysicalPortNum (); PortI= ndex++) { + UPDATE_POLICY (FspsUpd->FspsConfig.PortUsb20Enable[PortIndex], UsbConf= ig->PortUsb20[PortIndex].Enable, TRUE); + } + for (PortIndex =3D 0; PortIndex < GetPchXhciMaxUsb3PortNum (); PortIndex= ++) { + UPDATE_POLICY (FspsUpd->FspsConfig.PortUsb30Enable[PortIndex], UsbConf= ig->PortUsb30[PortIndex].Enable, TRUE); + } + + UPDATE_POLICY (FspsUpd->FspsConfig.XdciEnable, UsbConfig->XdciConfig.Ena= ble, FALSE); + + // + // Platform Board programming per the layout of each port. + // + UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 0, PcdGet8 (PcdUsb20Ov= erCurrentPinPort0)); + UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 1, PcdGet8 (PcdUsb20Ov= erCurrentPinPort1)); + UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 2, PcdGet8 (PcdUsb20Ov= erCurrentPinPort2)); + UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 3, PcdGet8 (PcdUsb20Ov= erCurrentPinPort3)); + UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 4, PcdGet8 (PcdUsb20Ov= erCurrentPinPort4)); + UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 5, PcdGet8 (PcdUsb20Ov= erCurrentPinPort5)); + UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 6, PcdGet8 (PcdUsb20Ov= erCurrentPinPort6)); + UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 7, PcdGet8 (PcdUsb20Ov= erCurrentPinPort7)); + UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 8, PcdGet8 (PcdUsb20Ov= erCurrentPinPort8)); + UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 9, PcdGet8 (PcdUsb20Ov= erCurrentPinPort9)); + UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig,10, PcdGet8 (PcdUsb20Ov= erCurrentPinPort10)); + UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig,11, PcdGet8 (PcdUsb20Ov= erCurrentPinPort11)); + UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig,12, PcdGet8 (PcdUsb20Ov= erCurrentPinPort12)); + UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig,13, PcdGet8 (PcdUsb20Ov= erCurrentPinPort13)); + UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig,14, PcdGet8 (PcdUsb20Ov= erCurrentPinPort14)); + UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig,15, PcdGet8 (PcdUsb20Ov= erCurrentPinPort15)); + + UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 0, PcdGet8 (PcdUsb30Ov= erCurrentPinPort0)); + UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 1, PcdGet8 (PcdUsb30Ov= erCurrentPinPort1)); + UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 2, PcdGet8 (PcdUsb30Ov= erCurrentPinPort2)); + UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 3, PcdGet8 (PcdUsb30Ov= erCurrentPinPort3)); + UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 4, PcdGet8 (PcdUsb30Ov= erCurrentPinPort4)); + UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 5, PcdGet8 (PcdUsb30Ov= erCurrentPinPort5)); + UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 6, PcdGet8 (PcdUsb30Ov= erCurrentPinPort6)); + UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 7, PcdGet8 (PcdUsb30Ov= erCurrentPinPort7)); + UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 8, PcdGet8 (PcdUsb30Ov= erCurrentPinPort8)); + UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 9, PcdGet8 (PcdUsb30Ov= erCurrentPinPort9)); + +} + +/** + Update CNVi config + + @param[in] SiPolicy Pointer to SI_POLICY_PPI + @param[in] FspsUpd Pointer to FspsUpd structure + @param[in] PchSetup Pointer to PCH_SETUP buffer +**/ +STATIC +VOID +UpdateCnviConfig ( + IN OUT FSPS_UPD *FspsUpd, + IN OUT CNVI_CONFIG *CnviConfig + ) +{ + + UPDATE_POLICY (FspsUpd->FspsConfig.CnviMode, CnviConfig->Mode,= CnviModeDisabled); + UPDATE_POLICY (FspsUpd->FspsConfig.CnviBtCore, CnviConfig->BtCor= e, FALSE); + UPDATE_POLICY (FspsUpd->FspsConfig.CnviBtAudioOffload, CnviConfig->BtAud= ioOffload, 0); +} + +/** + Performs FSP PCH PEI Policy initialization. + + @param[in][out] FspsUpd Pointer to FSP UPD Data. + + @retval EFI_SUCCESS FSP UPD Data is updated. + @retval EFI_NOT_FOUND Fail to locate required PPI. + @retval Other FSP UPD Data update process fail. +**/ +EFI_STATUS +EFIAPI +PeiFspPchPolicyInit ( + IN OUT FSPS_UPD *FspsUpd + ) +{ + UINTN Index; + SATA_CONFIG *SataConfig; + USB_CONFIG *UsbConfig; + TCSS_PEI_CONFIG *TcssConfig; + SERIAL_IO_CONFIG *SerialIoConfig; + CNVI_CONFIG *CnviConfig; +#if FixedPcdGet8(PcdFspModeSelection) =3D=3D 0 + SI_POLICY_PPI *SiPolicy; + EFI_STATUS Status; +#endif + DEBUG ((DEBUG_INFO | DEBUG_INIT, "FSP UpdatePeiPchPolicy\n")); + + SataConfig =3D NULL; + UsbConfig =3D NULL; + TcssConfig =3D NULL; + SerialIoConfig =3D NULL; + CnviConfig =3D NULL; +#if FixedPcdGet8(PcdFspModeSelection) =3D=3D 0 + // + // Locate SiPolicyPpi + // + SiPolicy =3D NULL; + Status =3D PeiServicesLocatePpi ( + &gSiPolicyPpiGuid, + 0, + NULL, + (VOID **) &SiPolicy + ); + if (EFI_ERROR (Status)) { + return EFI_NOT_FOUND; + } + + Status =3D GetConfigBlock ((VOID *) SiPolicy, &gSataConfigGuid, (VOID *)= &SataConfig); + ASSERT_EFI_ERROR (Status); + Status =3D GetConfigBlock ((VOID *) SiPolicy, &gUsbConfigGuid, (VOID *) = &UsbConfig); + ASSERT_EFI_ERROR (Status); + Status =3D GetConfigBlock ((VOID *) SiPolicy, &gTcssPeiConfigGuid, (VOID= *) &TcssConfig); + ASSERT_EFI_ERROR (Status); + Status =3D GetConfigBlock ((VOID *) SiPolicy, &gSerialIoConfigGuid, (VOI= D *) &SerialIoConfig); + ASSERT_EFI_ERROR (Status); + Status =3D GetConfigBlock ((VOID *) SiPolicy, &gCnviConfigGuid, (VOID *)= &CnviConfig); + ASSERT_EFI_ERROR (Status); + if (EFI_ERROR (Status)) { + return Status; + } +#endif + + // + // Update Sata Policies + // + UPDATE_POLICY (FspsUpd->FspsConfig.SataEnable, SataConfig->Enable, TRUE)= ; + UPDATE_POLICY (FspsUpd->FspsConfig.SataMode, SataConfig->SataMode, SataM= odeAhci); + + for (Index =3D 0; Index < PCH_MAX_SATA_PORTS; Index++) { + UPDATE_POLICY (FspsUpd->FspsConfig.SataPortsEnable[Index], SataConfig-= >PortSettings[Index].Enable, TRUE); + } + + // + // Update Pch Usb Config + // + UpdatePchUsbConfig (FspsUpd, UsbConfig); + + // + // I2C + // + for (Index =3D 0; Index < 8; Index++) { + UPDATE_POLICY (FspsUpd->FspsConfig.SerialIoI2cMode[Index], SerialIoCon= fig->I2cDeviceConfig[Index].Mode, 0); + UPDATE_POLICY (FspsUpd->FspsConfig.PchSerialIoI2cPadsTermination[Index= ], SerialIoConfig->I2cDeviceConfig[Index].PadTermination, 0); + } + + UPDATE_POLICY (FspsUpd->FspsConfig.PchSerialIoI2cSdaPinMux[4], SerialIo= Config->I2cDeviceConfig[4].PinMux.Sda, GPIO_VER2_LP_MUXING_SERIALIO_I2C4_S= DA_GPP_H8); + UPDATE_POLICY (FspsUpd->FspsConfig.PchSerialIoI2cSclPinMux[4], SerialIo= Config->I2cDeviceConfig[4].PinMux.Scl, GPIO_VER2_LP_MUXING_SERIALIO_I2C4_S= CL_GPP_H9); + + // + // Type C + // + for (Index =3D 0; Index < MAX_IOM_AUX_BIAS_COUNT; Index++) { + UPDATE_POLICY (FspsUpd->FspsConfig.IomTypeCPortPadCfg[(Index * 2)], = TcssConfig->IomConfig.IomAuxPortPad[Index].GpioPullN, mIomAuxNullTable[In= dex].GpioPullN); + UPDATE_POLICY (FspsUpd->FspsConfig.IomTypeCPortPadCfg[(Index * 2) + 1]= , TcssConfig->IomConfig.IomAuxPortPad[Index].GpioPullP, mIomAuxNullTable[In= dex].GpioPullP); + } + + // + // Cnvi + // + UpdateCnviConfig (FspsUpd, CnviConfig); + + return EFI_SUCCESS; +} diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFsp= PolicyInitLib/PeiFspPolicyInitLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/= FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.c new file mode 100644 index 0000000000..fc523e93d1 --- /dev/null +++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyI= nitLib/PeiFspPolicyInitLib.c @@ -0,0 +1,308 @@ +/** @file + Instance of Fsp Policy Initialization Library. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include +#include +#include +#include + +VOID +EFIAPI +FspPolicyInitPreMem( + IN FSPM_UPD *FspmUpdDataPtr +); + +VOID * +EFIAPI +SiliconPolicyInitPreMem( + IN OUT VOID *FspmUpd +) +{ + DEBUG ((DEBUG_INFO, "FspmUpd - 0x%x\n", FspmUpd)); + FspPolicyInitPreMem ((FSPM_UPD *) FspmUpd); + return FspmUpd; +} + +/** + SiPreMemInstallPolicyReadyPpi installs SiPreMemPolicyReadyPpi. + While installed, RC assumes the Policy is ready and finalized. So please= update and override + any setting before calling this function. + + @retval EFI_SUCCESS The policy is installed. + @retval EFI_OUT_OF_RESOURCES Insufficient resources to create buffer +**/ +EFI_STATUS +EFIAPI +SiPreMemInstallPolicyReadyPpi ( + VOID + ) +{ + EFI_STATUS Status; + EFI_PEI_PPI_DESCRIPTOR *SiPolicyReadyPreMemPpiDesc; + + SiPolicyReadyPreMemPpiDesc =3D (EFI_PEI_PPI_DESCRIPTOR *) AllocateZeroPo= ol (sizeof (EFI_PEI_PPI_DESCRIPTOR)); + if (SiPolicyReadyPreMemPpiDesc =3D=3D NULL) { + ASSERT (FALSE); + return EFI_OUT_OF_RESOURCES; + } + + SiPolicyReadyPreMemPpiDesc->Flags =3D EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_P= EI_PPI_DESCRIPTOR_TERMINATE_LIST; + SiPolicyReadyPreMemPpiDesc->Guid =3D &gSiPreMemPolicyReadyPpiGuid; + SiPolicyReadyPreMemPpiDesc->Ppi =3D NULL; + + // + // Install PreMem Silicon Policy Ready PPI + // + Status =3D PeiServicesInstallPpi (SiPolicyReadyPreMemPpiDesc); + ASSERT_EFI_ERROR (Status); + return Status; +} + +RETURN_STATUS +EFIAPI +SiliconPolicyDonePreMem( + IN VOID *FspmUpd +) +{ + EFI_STATUS Status; +#if FixedPcdGet8(PcdFspModeSelection) =3D=3D 0 + FSPM_ARCH_CONFIG_PPI *FspmArchConfigPpi; + EFI_PEI_PPI_DESCRIPTOR *FspmArchConfigPpiDesc; + + FspmArchConfigPpi =3D (FSPM_ARCH_CONFIG_PPI *) AllocateZeroPool (sizeof = (FSPM_ARCH_CONFIG_PPI)); + if (FspmArchConfigPpi =3D=3D NULL) { + ASSERT (FALSE); + return EFI_OUT_OF_RESOURCES; + } + FspmArchConfigPpi->Revision =3D 1; + FspmArchConfigPpi->NvsBufferPtr =3D NULL; + FspmArchConfigPpi->BootLoaderTolumSize =3D 0; + + FspmArchConfigPpiDesc =3D (EFI_PEI_PPI_DESCRIPTOR *) AllocateZeroPool (s= izeof (EFI_PEI_PPI_DESCRIPTOR)); + if (FspmArchConfigPpiDesc =3D=3D NULL) { + ASSERT (FALSE); + return EFI_OUT_OF_RESOURCES; + } + FspmArchConfigPpiDesc->Flags =3D EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PP= I_DESCRIPTOR_TERMINATE_LIST; + FspmArchConfigPpiDesc->Guid =3D &gFspmArchConfigPpiGuid; + FspmArchConfigPpiDesc->Ppi =3D FspmArchConfigPpi; + // + // Install FSP-M Arch Config PPI + // + Status =3D PeiServicesInstallPpi (FspmArchConfigPpiDesc); + ASSERT_EFI_ERROR (Status); +#endif + + // + // Install Policy Ready PPI + // While installed, RC assumes the Policy is ready and finalized. So ple= ase + // update and override any setting before calling this function. + // + Status =3D SiPreMemInstallPolicyReadyPpi (); + ASSERT_EFI_ERROR (Status); + + DEBUG ((DEBUG_INFO, "Silicon PEI Policy Initialization Done in Pre-Memor= y\n")); + + return Status; +} + +/** + Performs FSP PEI Policy Pre-memory initialization. + + @param[in] FspmUpdDataPtr Pointer to FSPM UPD data. +**/ +VOID +EFIAPI +FspPolicyInitPreMem ( + IN FSPM_UPD *FspmUpdDataPtr + ) +{ + EFI_STATUS Status; + + // + // PCH Pei Fsp Policy Initialization + // + Status =3D PeiFspPchPolicyInitPreMem (FspmUpdDataPtr); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "ERROR - PCH Pei Fsp Policy in Pre-Memory Initial= ization fail, Status =3D %r\n", Status)); + } + + // + // Cpu Pei Fsp Policy Initialization + // + Status =3D PeiFspCpuPolicyInitPreMem (FspmUpdDataPtr); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "ERROR - CPU Pei Fsp Policy in Pre-Memory Initial= ization fail, Status =3D %r\n", Status)); + } + + // + // Security Pei Fsp Policy Initialization + // + Status =3D PeiFspSecurityPolicyInitPreMem (FspmUpdDataPtr); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "ERROR - Security Pei Fsp Policy in Pre-Memory In= itialization fail, Status =3D %r\n", Status)); + } + + // + // ME Pei Fsp Policy Initialization + // + Status =3D PeiFspMePolicyInitPreMem (FspmUpdDataPtr); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "ERROR - ME Pei Fsp Policy in Pre-Memory Initiali= zation fail, Status =3D %r\n", Status)); + } + + // + // SystemAgent Pei Fsp Policy Initialization + // + Status =3D PeiFspSaPolicyInitPreMem (FspmUpdDataPtr); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "ERROR - SystemAgent Pei Fsp Policy in Pre-Memory= Initialization fail, Status =3D %r\n", Status)); + } + + // + // Other Upd Initialization + // + Status =3D PeiFspMiscUpdInitPreMem (FspmUpdDataPtr); + +} + +/** + Performs FSP PEI Policy initialization. + + @param[in][out] FspsUpd Pointer UPD data region + +**/ +VOID +EFIAPI +FspPolicyInit ( + IN OUT FSPS_UPD *FspsUpd + ) +{ + EFI_STATUS Status; + + // + // PCH Pei Fsp Policy Initialization + // + Status =3D PeiFspPchPolicyInit (FspsUpd); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "ERROR - PCH Pei Fsp Policy iInitialization fail,= Status =3D %r\n", Status)); + } + + // + // ME Pei Fsp Policy Initialization + // + Status =3D PeiFspMePolicyInit (FspsUpd); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "ERROR - ME Pei Fsp Policy Initialization fail, S= tatus =3D %r\n", Status)); + } + + // + // SystemAgent Pei Fsp Policy Initialization + // + Status =3D PeiFspSaPolicyInit (FspsUpd); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "ERROR - SystemAgent Pei Fsp Policy Initializatio= n fail, Status =3D %r\n", Status)); + } + + // + // Security Pei Fsp Policy Initialization + // + Status =3D PeiFspSecurityPolicyInit(FspsUpd); + if (EFI_ERROR(Status)) { + DEBUG((DEBUG_ERROR, "ERROR - Security Pei Fsp Policy Initialization fa= il, Status =3D %r\n", Status)); + } + +} + +/** +Performs silicon post-mem policy initialization. + +The meaning of Policy is defined by silicon code. +It could be the raw data, a handle, a PPI, etc. + +The returned data must be used as input data for SiliconPolicyDonePostMem(= ), +and SiliconPolicyUpdateLib.SiliconPolicyUpdatePostMem(). + +1) In FSP path, the input Policy should be FspsUpd. +Value of FspsUpd has been initialized by FSP binary default value. +Only a subset of FspsUpd needs to be updated for different silicon sku. +The return data is same FspsUpd. + +2) In non-FSP path, the input policy could be NULL. +The return data is the initialized policy. + +@param[in, out] Policy Pointer to policy. + +@return the initialized policy. +**/ +VOID * +EFIAPI +SiliconPolicyInitPostMem( + IN OUT VOID *FspsUpd +) +{ + DEBUG ((DEBUG_INFO, "FspsUpd - 0x%x\n", FspsUpd)); + FspPolicyInit ((FSPS_UPD *) FspsUpd); + return FspsUpd; +} + +/** + SiInstallPolicyReadyPpi installs SiPolicyReadyPpi. + While installed, RC assumes the Policy is ready and finalized. So please= update and override + any setting before calling this function. + + @retval EFI_SUCCESS The policy is installed. + @retval EFI_OUT_OF_RESOURCES Insufficient resources to create buffer +**/ +EFI_STATUS +EFIAPI +SiInstallPolicyReadyPpi ( + VOID + ) +{ + EFI_STATUS Status; + EFI_PEI_PPI_DESCRIPTOR *SiPolicyReadyPpiDesc; + + SiPolicyReadyPpiDesc =3D (EFI_PEI_PPI_DESCRIPTOR *) AllocateZeroPool (si= zeof (EFI_PEI_PPI_DESCRIPTOR)); + if (SiPolicyReadyPpiDesc =3D=3D NULL) { + ASSERT (FALSE); + return EFI_OUT_OF_RESOURCES; + } + + SiPolicyReadyPpiDesc->Flags =3D EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI= _DESCRIPTOR_TERMINATE_LIST; + SiPolicyReadyPpiDesc->Guid =3D &gSiPolicyReadyPpiGuid; + SiPolicyReadyPpiDesc->Ppi =3D NULL; + + // + // Install Silicon Policy Ready PPI + // + Status =3D PeiServicesInstallPpi (SiPolicyReadyPpiDesc); + ASSERT_EFI_ERROR (Status); + return Status; +} + +/* +The silicon post-mem policy is finalized. +Silicon code can do initialization based upon the policy data. + +The input Policy must be returned by SiliconPolicyInitPostMem(). + +@param[in] Policy Pointer to policy. + +@retval EFI_SUCCESS The policy is handled consumed by silicon code. +*/ +EFI_STATUS +EFIAPI +SiliconPolicyDonePostMem( + IN OUT VOID *FspsUpd +) +{ + SiInstallPolicyReadyPpi(); + return EFI_SUCCESS; +} + diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFsp= PolicyInitLib/PeiFspPolicyInitLib.h b/Platform/Intel/TigerlakeOpenBoardPkg/= FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.h new file mode 100644 index 0000000000..cce0de0089 --- /dev/null +++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyI= nitLib/PeiFspPolicyInitLib.h @@ -0,0 +1,187 @@ +/** @file + Internal header file for Fsp Policy Initialization Library. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef _PEI_FSP_POLICY_INIT_LIB_H_ +#define _PEI_FSP_POLICY_INIT_LIB_H_ + +#include + +#include +#include + +#include +#include +#include + +/** + Performs FSP PCH PEI Policy pre mem initialization. + + @param[in][out] FspmUpd Pointer to FSP UPD Data. + + @retval EFI_SUCCESS FSP UPD Data is updated. + @retval EFI_NOT_FOUND Fail to locate required PPI. + @retval Other FSP UPD Data update process fail. +**/ +EFI_STATUS +EFIAPI +PeiFspPchPolicyInitPreMem ( + IN OUT FSPM_UPD *FspmUpd + ); + +/** + Performs FSP PCH PEI Policy initialization. + + @param[in][out] FspsUpd Pointer to FSP UPD Data. + + @retval EFI_SUCCESS FSP UPD Data is updated. + @retval EFI_NOT_FOUND Fail to locate required PPI. + @retval Other FSP UPD Data update process fail. +**/ +EFI_STATUS +EFIAPI +PeiFspPchPolicyInit ( + IN OUT FSPS_UPD *FspsUpd + ); + +/** + Performs FSP CPU PEI Policy initialization. + + @param[in][out] FspmUpd Pointer to FSP UPD Data. + + @retval EFI_SUCCESS FSP UPD Data is updated. + @retval EFI_NOT_FOUND Fail to locate required PPI. + @retval Other FSP UPD Data update process fail. +**/ +EFI_STATUS +EFIAPI +PeiFspCpuPolicyInitPreMem ( + IN OUT FSPM_UPD *FspmUpd + ); + +/** +Performs FSP Security PEI Policy initialization. + +@param[in][out] FspmUpd Pointer to FSP UPD Data. + +@retval EFI_SUCCESS FSP UPD Data is updated. +@retval EFI_NOT_FOUND Fail to locate required PPI. +@retval Other FSP UPD Data update process fail. +**/ +EFI_STATUS +EFIAPI +PeiFspSecurityPolicyInitPreMem( +IN OUT FSPM_UPD *FspmUpd +); + +/** + Performs FSP ME PEI Policy pre mem initialization. + + @param[in][out] FspmUpd Pointer to FSP UPD Data. + + @retval EFI_SUCCESS FSP UPD Data is updated. + @retval EFI_NOT_FOUND Fail to locate required PPI. + @retval Other FSP UPD Data update process fail. +**/ +EFI_STATUS +EFIAPI +PeiFspMePolicyInitPreMem ( + IN OUT FSPM_UPD *FspmUpd + ); + +/** + Performs FSP ME PEI Policy initialization. + + @param[in][out] FspsUpd Pointer to FSP UPD Data. + + @retval EFI_SUCCESS FSP UPD Data is updated. + @retval EFI_NOT_FOUND Fail to locate required PPI. + @retval Other FSP UPD Data update process fail. +**/ +EFI_STATUS +EFIAPI +PeiFspMePolicyInit ( + IN OUT FSPS_UPD *FspsUpd + ); + +/** + Performs FSP SA PEI Policy initialization in pre-memory. + + @param[in][out] FspmUpd Pointer to FSP UPD Data. + + @retval EFI_SUCCESS FSP UPD Data is updated. + @retval EFI_NOT_FOUND Fail to locate required PPI. + @retval Other FSP UPD Data update process fail. +**/ +EFI_STATUS +EFIAPI +PeiFspSaPolicyInitPreMem ( + IN OUT FSPM_UPD *FspmUpd + ); + +/** + Performs FSP SA PEI Policy initialization. + + @param[in][out] FspsUpd Pointer to FSP UPD Data. + + @retval EFI_SUCCESS FSP UPD Data is updated. + @retval EFI_NOT_FOUND Fail to locate required PPI. + @retval Other FSP UPD Data update process fail. +**/ +EFI_STATUS +EFIAPI +PeiFspSaPolicyInit ( + IN OUT FSPS_UPD *FspsUpd + ); + + +/** +Performs FSP Security PEI Policy post memory initialization. + +@param[in][out] FspsUpd Pointer to FSP UPD Data. + +@retval EFI_SUCCESS FSP UPD Data is updated. +@retval EFI_NOT_FOUND Fail to locate required PPI. +@retval Other FSP UPD Data update process fail. +**/ +EFI_STATUS +EFIAPI +PeiFspSecurityPolicyInit( +IN OUT FSPS_UPD *FspsUpd +); + +/** + PeiGetSectionFromFv finds the file in FV and gets file Address and Size + + @param[in] NameGuid - File GUID + @param[out] Address - Pointer to the File Address + @param[out] Size - Pointer to File Size + + @retval EFI_SUCCESS Successfull in reading the section fr= om FV +**/ +EFI_STATUS +EFIAPI +PeiGetSectionFromFv ( + IN CONST EFI_GUID NameGuid, + OUT VOID **Address, + OUT UINT32 *Size + ); + +/** + Performs FSP Misc UPD initialization. + + @param[in][out] FspmUpd Pointer to FSPM_UPD Data. + + @retval EFI_SUCCESS FSP UPD Data is updated. +**/ +EFI_STATUS +EFIAPI +PeiFspMiscUpdInitPreMem ( + IN OUT FSPM_UPD *FspmUpd + ); + +#endif // _PEI_FSP_POLICY_INIT_LIB_H_ + diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFsp= PolicyInitLib/PeiFspPolicyInitLib.inf b/Platform/Intel/TigerlakeOpenBoardPk= g/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf new file mode 100644 index 0000000000..9d85d855f5 --- /dev/null +++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyI= nitLib/PeiFspPolicyInitLib.inf @@ -0,0 +1,183 @@ +## @file +# Library functions for Fsp Policy Initialization Library. +# +# Copyright (c) 2021, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +##########################################################################= ###### +# +# Defines Section - statements that will be processed to create a Makefile= . +# +##########################################################################= ###### +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D PeiFspPolicyInitLib + FILE_GUID =3D 2CB87D67-D1A4-4CD3-8CD7-91A1FA1DF6E0 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D SiliconPolicyInitLib + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D IA32 +# + +##########################################################################= ###### +# +# Sources Section - list of files that are required for the build to succe= ed. +# +##########################################################################= ###### + +[Sources] + PeiFspPolicyInitLib.c + PeiFspPchPolicyInitLib.c + PeiFspCpuPolicyInitLib.c + PeiFspMePolicyInitLib.c + PeiFspSaPolicyInitLib.c + PeiFspSecurityPolicyInitLib.c + PeiFspMiscUpdInitLib.c + +##########################################################################= ###### +# +# Package Dependency Section - list of Package files that are required for +# this module. +# +##########################################################################= ###### + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + IntelFsp2Pkg/IntelFsp2Pkg.dec + TigerlakeSiliconPkg/SiPkg.dec + TigerLakeFspBinPkg/TigerLakeFspBinPkg.dec + TigerlakeOpenBoardPkg/OpenBoardPkg.dec + UefiCpuPkg/UefiCpuPkg.dec + IntelSiliconPkg/IntelSiliconPkg.dec + IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec + MinPlatformPkg/MinPlatformPkg.dec + +[LibraryClasses] + BaseMemoryLib + DebugLib + IoLib + PeiServicesLib + ConfigBlockLib + PcdLib + MemoryAllocationLib + PchInfoLib + FspWrapperApiLib + PeiLib + BmpSupportLib + +[Pcd] + gSiPkgTokenSpaceGuid.PcdTsegSize ## CON= SUMES + + gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase ## CON= SUMES + gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize ## CON= SUMES + gIntelFsp2PkgTokenSpaceGuid.PcdFspTemporaryRamSize ## CON= SUMES + gIntelFsp2PkgTokenSpaceGuid.PcdFspReservedBufferSize ## CON= SUMES + gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress ## CON= SUMES + gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress ## CON= SUMES + gIntelFsp2WrapperTokenSpaceGuid.PcdFspsUpdDataAddress ## CON= SUMES + gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress ## CON= SUMES + gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection ## CON= SUMES + # SA Misc Config + gBoardModuleTokenSpaceGuid.PcdSaMiscUserBd ## CON= SUMES + gBoardModuleTokenSpaceGuid.PcdSaMiscMmioSizeAdjustment ## CON= SUMES + gBoardModuleTokenSpaceGuid.PcdMrcSpdData ## CON= SUMES + gBoardModuleTokenSpaceGuid.PcdMrcSpdDataSize ## CON= SUMES + + # SPD Address Table + gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable0 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable1 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable2 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable3 ## CONSUMES + + # PCIe Clock Info + gBoardModuleTokenSpaceGuid.PcdPcieClock0 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdPcieClock1 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdPcieClock2 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdPcieClock3 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdPcieClock4 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdPcieClock5 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdPcieClock6 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdPcieClock7 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdPcieClock8 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdPcieClock9 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdPcieClock10 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdPcieClock11 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdPcieClock12 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdPcieClock13 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdPcieClock14 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdPcieClock15 ## CONSUMES + + # USB 2.0 Port Over Current Pin + gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort0 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort1 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort2 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort3 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort4 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort5 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort6 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort7 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort8 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort9 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort10 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort11 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort12 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort13 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort14 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort15 ## CONSUMES + + # USB 3.0 Port Over Current Pin + gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort0 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort1 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort2 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort3 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort4 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort5 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort6 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort7 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort8 ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort9 ## CONSUMES + + gIntelSiliconPkgTokenSpaceGuid.PcdIntelGraphicsVbtFileGuid ## CONSUMES + + gEfiMdeModulePkgTokenSpaceGuid.PcdS3BootScriptTablePrivateDataPtr ## = CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdS3BootScriptTablePrivateSmmDataPtr ## = CONSUMES + +[Ppis] + gSiPolicyPpiGuid ## CONSUMES + gSiPreMemPolicyPpiGuid ## CONSUMES + gSiPreMemPolicyReadyPpiGuid ## CONSUMES + gSiPolicyReadyPpiGuid ## CONSUMES + gFspmArchConfigPpiGuid ## SOMETIMES_PRODUCES + +[Guids] + gPcieRpPreMemConfigGuid ## CONSUMES + gPchGeneralPreMemConfigGuid ## CONSUMES + gPcieRpPreMemConfigGuid ## CONSUMES + gSataConfigGuid ## CONSUMES + gHdAudioConfigGuid ## CONSUMES + gSataConfigGuid ## CONSUMES + gUsbConfigGuid ## CONSUMES + gSaMiscPeiPreMemConfigGuid ## PRODUCES + gHostBridgePeiPreMemConfigGuid ## CONSUMES + gSaMiscPeiConfigGuid ## PRODUCES + gMemoryConfigNoCrcGuid ## CONSUMES + gSaMiscPeiConfigGuid ## CONSUMES + gGraphicsPeiConfigGuid ## CONSUMES + gMePeiPreMemConfigGuid ## CONSUMES + gMePeiConfigGuid ## CONSUMES + gPchGeneralConfigGuid ## CONSUMES + gCpuConfigGuid ## CONSUMES + gCpuConfigLibPreMemConfigGuid ## CONSUMES + gTcssPeiConfigGuid ## CONSUMES + gSerialIoConfigGuid ## CONSUMES + gCpuSecurityPreMemConfigGuid ## CONSUMES + gTianoLogoGuid ## CONSUMES + gCnviConfigGuid ## CONSUMES + gHdAudioPreMemConfigGuid ## CONSUMES diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFsp= PolicyInitLib/PeiFspSaPolicyInitLib.c b/Platform/Intel/TigerlakeOpenBoardPk= g/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspSaPolicyInitLib.c new file mode 100644 index 0000000000..8f426ddb8d --- /dev/null +++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyI= nitLib/PeiFspSaPolicyInitLib.c @@ -0,0 +1,240 @@ +/** @file + Implementation of Fsp SA Policy Initialization. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/** + Performs FSP SA PEI Policy initialization in pre-memory. + + @param[in][out] FspmUpd Pointer to FSP UPD Data. + + @retval EFI_SUCCESS FSP UPD Data is updated. + @retval EFI_NOT_FOUND Fail to locate required PPI. + @retval Other FSP UPD Data update process fail. +**/ +EFI_STATUS +EFIAPI +PeiFspSaPolicyInitPreMem ( + IN OUT FSPM_UPD *FspmUpd + ) +{ + SA_MISC_PEI_PREMEM_CONFIG *MiscPeiPreMemConfig; + HOST_BRIDGE_PREMEM_CONFIG *HostBridgePreMemConfig; + MEMORY_CONFIG_NO_CRC *MemConfigNoCrc; +#if FixedPcdGet8(PcdFspModeSelection) =3D=3D 0 + EFI_STATUS Status; + SI_PREMEM_POLICY_PPI *SiPreMemPolicyPpi; +#endif + + DEBUG((DEBUG_INFO, "\nUpdating SA Policy in Pre Mem\n")); + MiscPeiPreMemConfig =3D NULL; + HostBridgePreMemConfig =3D NULL; + MemConfigNoCrc =3D NULL; +#if FixedPcdGet8(PcdFspModeSelection) =3D=3D 0 + // + // Locate SiPreMemPolicyPpi + // + SiPreMemPolicyPpi =3D NULL; + Status =3D PeiServicesLocatePpi( + &gSiPreMemPolicyPpiGuid, + 0, + NULL, + (VOID **) &SiPreMemPolicyPpi + ); + ASSERT_EFI_ERROR (Status); + if ((Status =3D=3D EFI_SUCCESS) && (SiPreMemPolicyPpi !=3D NULL)) { + Status =3D GetConfigBlock ((VOID *) SiPreMemPolicyPpi, &gSaMiscPeiPreM= emConfigGuid, (VOID *) &MiscPeiPreMemConfig); + ASSERT_EFI_ERROR (Status); + Status =3D GetConfigBlock((VOID *) SiPreMemPolicyPpi, &gHostBridgePeiP= reMemConfigGuid, (VOID *) &HostBridgePreMemConfig); + ASSERT_EFI_ERROR(Status); + Status =3D GetConfigBlock ((VOID *) SiPreMemPolicyPpi, &gMemoryConfigN= oCrcGuid, (VOID *) &MemConfigNoCrc); + ASSERT_EFI_ERROR (Status); + ZeroMem ((VOID *) MemConfigNoCrc->SpdData->SpdData, sizeof (SPD_DATA_B= UFFER)); + } +#endif + + UPDATE_POLICY (FspmUpd->FspmConfig.SpdAddressTable[0], MiscPeiPreMemConf= ig->SpdAddressTable[0], PcdGet8 (PcdMrcSpdAddressTable0)); + UPDATE_POLICY (FspmUpd->FspmConfig.SpdAddressTable[1], MiscPeiPreMemConf= ig->SpdAddressTable[1], PcdGet8 (PcdMrcSpdAddressTable1)); + UPDATE_POLICY (FspmUpd->FspmConfig.SpdAddressTable[2], MiscPeiPreMemConf= ig->SpdAddressTable[2], PcdGet8 (PcdMrcSpdAddressTable2)); + UPDATE_POLICY (FspmUpd->FspmConfig.SpdAddressTable[3], MiscPeiPreMemConf= ig->SpdAddressTable[3], PcdGet8 (PcdMrcSpdAddressTable3)); + + if (PcdGet32 (PcdMrcSpdData)) { + DEBUG((DEBUG_INFO, "PcdMrcSpdData !=3D NULL, MemConfigNoCrc->SpdData\n= ")); + COPY_POLICY ((VOID *)((FSPM_UPD *) FspmUpd)->FspmConfig.MemorySpdPtr00= 0, (VOID *)MemConfigNoCrc->SpdData->SpdData[0][0][0], (VOID *)(UINTN)PcdGet= 32 (PcdMrcSpdData), PcdGet16(PcdMrcSpdDataSize)); + COPY_POLICY ((VOID *)((FSPM_UPD *) FspmUpd)->FspmConfig.MemorySpdPtr01= 0, (VOID *)MemConfigNoCrc->SpdData->SpdData[0][1][0], (VOID *)(UINTN)PcdGet= 32 (PcdMrcSpdData), PcdGet16(PcdMrcSpdDataSize)); + COPY_POLICY ((VOID *)((FSPM_UPD *) FspmUpd)->FspmConfig.MemorySpdPtr02= 0, (VOID *)MemConfigNoCrc->SpdData->SpdData[0][2][0], (VOID *)(UINTN)PcdGet= 32 (PcdMrcSpdData), PcdGet16(PcdMrcSpdDataSize)); + COPY_POLICY ((VOID *)((FSPM_UPD *) FspmUpd)->FspmConfig.MemorySpdPtr03= 0, (VOID *)MemConfigNoCrc->SpdData->SpdData[0][3][0], (VOID *)(UINTN)PcdGet= 32 (PcdMrcSpdData), PcdGet16(PcdMrcSpdDataSize)); + COPY_POLICY ((VOID *)((FSPM_UPD *) FspmUpd)->FspmConfig.MemorySpdPtr10= 0, (VOID *)MemConfigNoCrc->SpdData->SpdData[1][0][0], (VOID *)(UINTN)PcdGet= 32 (PcdMrcSpdData), PcdGet16(PcdMrcSpdDataSize)); + COPY_POLICY ((VOID *)((FSPM_UPD *) FspmUpd)->FspmConfig.MemorySpdPtr11= 0, (VOID *)MemConfigNoCrc->SpdData->SpdData[1][1][0], (VOID *)(UINTN)PcdGet= 32 (PcdMrcSpdData), PcdGet16(PcdMrcSpdDataSize)); + COPY_POLICY ((VOID *)((FSPM_UPD *) FspmUpd)->FspmConfig.MemorySpdPtr12= 0, (VOID *)MemConfigNoCrc->SpdData->SpdData[1][2][0], (VOID *)(UINTN)PcdGet= 32 (PcdMrcSpdData), PcdGet16(PcdMrcSpdDataSize)); + COPY_POLICY ((VOID *)((FSPM_UPD *) FspmUpd)->FspmConfig.MemorySpdPtr13= 0, (VOID *)MemConfigNoCrc->SpdData->SpdData[1][3][0], (VOID *)(UINTN)PcdGet= 32 (PcdMrcSpdData), PcdGet16(PcdMrcSpdDataSize)); + } + UPDATE_POLICY (((FSPM_UPD *) FspmUpd)->FspmConfig.TsegSize, Mi= scPeiPreMemConfig->TsegSize, PcdGet32 (PcdTsegSize)); + UPDATE_POLICY (((FSPM_UPD *) FspmUpd)->FspmConfig.UserBd, Mi= scPeiPreMemConfig->UserBd, PcdGet8 (PcdSaMiscUserBd)); + UPDATE_POLICY (((FSPM_UPD *) FspmUpd)->FspmConfig.MmioSizeAdjustment, Ho= stBridgePreMemConfig->MmioSizeAdjustment, PcdGet16 (PcdSaMiscMmioSizeAdjust= ment)); + + return EFI_SUCCESS; +} + + +/** + Performs FSP SA PEI Policy initialization. + + @param[in][out] FspsUpd Pointer to FSP UPD Data. + + @retval EFI_SUCCESS FSP UPD Data is updated. + @retval EFI_NOT_FOUND Fail to locate required PPI. + @retval Other FSP UPD Data update process fail. +**/ +EFI_STATUS +EFIAPI +UpdateGraphics( + IN OUT FSPS_UPD *FspsUpd, + GRAPHICS_PEI_CONFIG *GtConfig + ) +{ + EFI_STATUS Status; + VOID *Buffer; + UINT32 Size; + EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Blt; + UINTN BltSize; + UINTN Height; + UINTN Width; + + DEBUG((DEBUG_INFO, "\nUpdating SA Policy in Post Mem\n")); + UPDATE_POLICY (FspsUpd->FspsConfig.PeiGraphicsPeimInit, GtConfig->PeiGra= phicsPeimInit, 1); + + Size =3D 0; + Buffer =3D NULL; + PeiGetSectionFromAnyFv(PcdGetPtr(PcdIntelGraphicsVbtFileGuid), EFI_SECTI= ON_RAW, 0, &Buffer, &Size); + DEBUG((DEBUG_INFO, "Vbt Pointer from PeiGetSectionFromAnyFv is 0x%x\n", = Buffer)); + DEBUG((DEBUG_INFO, "Vbt Size from PeiGetSectionFromAnyFv is 0x%x\n", Siz= e)); +#if FixedPcdGet8(PcdFspModeSelection) =3D=3D 1 + FspsUpd->FspsConfig.GraphicsConfigPtr =3D (UINT32)(UINTN)Buffer; +#else + GtConfig->GraphicsConfigPtr =3D Buffer; +#endif + + Size =3D 0; + Buffer =3D NULL; + PeiGetSectionFromAnyFv(&gTianoLogoGuid, EFI_SECTION_RAW, 0, &Buffer, &Si= ze); + DEBUG((DEBUG_INFO, "LogoPtr from PeiGetSectionFromAnyFv is 0x%x\n", Buff= er)); + DEBUG((DEBUG_INFO, "LogoSize from PeiGetSectionFromAnyFv is 0x%x\n", Siz= e)); +#if FixedPcdGet8(PcdFspModeSelection) =3D=3D 1 + FspsUpd->FspsConfig.LogoPtr =3D (UINT32)Buffer; + FspsUpd->FspsConfig.LogoSize =3D Size; +#else + GtConfig->LogoPtr =3D Buffer; + GtConfig->LogoSize =3D Size; +#endif + + if (Buffer !=3D NULL) { + Blt =3D NULL; + Status =3D TranslateBmpToGopBlt ( + Buffer, + Size, + &Blt, + &BltSize, + &Height, + &Width + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "TranslateBmpToGopBlt, Status =3D %r\n", Stat= us)); + ASSERT_EFI_ERROR (Status); + return Status; + } + + UPDATE_POLICY(FspsUpd->FspsConfig.BltBufferSize, GtConfig->BltBufferS= ize, BltSize); + UPDATE_POLICY(FspsUpd->FspsConfig.LogoPixelWidth, GtConfig->LogoPixel= Width, Width); + UPDATE_POLICY(FspsUpd->FspsConfig.LogoPixelHeight, GtConfig->LogoPixe= lHeight, Height); +#if FixedPcdGet8(PcdFspModeSelection) =3D=3D 1 + FspsUpd->FspsConfig.BltBufferAddress =3D (UINT32) Blt; +#else + GtConfig->BltBufferAddress =3D (VOID *) Blt; +#endif + } + + return EFI_SUCCESS; +} + +/** + Performs FSP SA PEI Policy initialization. + + @param[in][out] FspsUpd Pointer to FSP UPD Data. + + @retval EFI_SUCCESS FSP UPD Data is updated. + @retval EFI_NOT_FOUND Fail to locate required PPI. + @retval Other FSP UPD Data update process fail. +**/ +EFI_STATUS +EFIAPI +PeiFspSaPolicyInit ( + IN OUT FSPS_UPD *FspsUpd + ) +{ +#if FixedPcdGet8(PcdFspModeSelection) =3D=3D 0 + EFI_STATUS Status; + SI_POLICY_PPI *SiPolicyPpi; +#endif + SA_MISC_PEI_CONFIG *MiscPeiConfig; + GRAPHICS_PEI_CONFIG *GtConfig; + + MiscPeiConfig =3D NULL; + GtConfig =3D NULL; + +#if FixedPcdGet8(PcdFspModeSelection) =3D=3D 0 + // + // Locate SiPolicyPpi + // + SiPolicyPpi =3D NULL; + Status =3D PeiServicesLocatePpi( + &gSiPolicyPpiGuid, + 0, + NULL, + (VOID **)&SiPolicyPpi + ); + if ((Status =3D=3D EFI_SUCCESS) && (SiPolicyPpi !=3D NULL)) { + MiscPeiConfig =3D NULL; + Status =3D GetConfigBlock ((VOID *) SiPolicyPpi, &gSaMiscPeiConfigGuid= , (VOID *) &MiscPeiConfig); + ASSERT_EFI_ERROR (Status); + + GtConfig =3D NULL; + Status =3D GetConfigBlock ((VOID *) SiPolicyPpi, &gGraphicsPeiConfigGu= id, (VOID *) &GtConfig); + ASSERT_EFI_ERROR (Status); + + } +#endif + + DEBUG ((DEBUG_INFO | DEBUG_INIT, "FSP Wrapper UpdatePeiSaPolicy\n")); + + // + // Update UPD: VBT & LogoPtr + // + UpdateGraphics(FspsUpd, GtConfig); + + return EFI_SUCCESS; +} + diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFsp= PolicyInitLib/PeiFspSecurityPolicyInitLib.c b/Platform/Intel/TigerlakeOpenB= oardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspSecurityPolicyInitLib.= c new file mode 100644 index 0000000000..91a60a6bd3 --- /dev/null +++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyI= nitLib/PeiFspSecurityPolicyInitLib.c @@ -0,0 +1,49 @@ +/** @file + Implementation of Fsp Security Policy Initialization. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include +#include + +/** + Performs FSP Security PEI Policy initialization. + + @param[in][out] FspmUpd Pointer to FSP UPD Data. + + @retval EFI_SUCCESS FSP UPD Data is updated. + @retval EFI_NOT_FOUND Fail to locate required PPI. + @retval Other FSP UPD Data update process fail. +**/ +EFI_STATUS +EFIAPI +PeiFspSecurityPolicyInitPreMem ( + IN OUT FSPM_UPD *FspmUpd + ) +{ + DEBUG ((DEBUG_INFO | DEBUG_INIT, "FSP Update SecurityPolicy Pre-Mem End\= n")); + + return EFI_SUCCESS; +} + +/** + Performs FSP Security PEI Policy post memory initialization. + + @param[in][out] FspsUpd Pointer to FSP UPD Data. + + @retval EFI_SUCCESS FSP UPD Data is updated. + @retval EFI_NOT_FOUND Fail to locate required PPI. + @retval Other FSP UPD Data update process fail. +**/ +EFI_STATUS +EFIAPI +PeiFspSecurityPolicyInit ( + IN OUT FSPS_UPD *FspsUpd + ) +{ + return EFI_SUCCESS; +} + diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiD= efaultPolicyInitLib/PeiSiDefaultPolicyInitLib.c b/Platform/Intel/TigerlakeO= penBoardPkg/FspWrapper/Library/PeiSiDefaultPolicyInitLib/PeiSiDefaultPolicy= InitLib.c new file mode 100644 index 0000000000..b864753258 --- /dev/null +++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiDefaultP= olicyInitLib/PeiSiDefaultPolicyInitLib.c @@ -0,0 +1,39 @@ +/** @file + Instance of Fsp Policy Initialization Library. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include +#include +#include + +EFI_STATUS +EFIAPI +PeiSiDefaultPolicyInitLibConstructor ( + VOID + ) +{ + EFI_STATUS Status; + PEI_SI_DEFAULT_POLICY_INIT_PPI *PeiSiDefaultPolicyInitPpi; + + // + // Locate Policy init PPI to install default silicon policy + // + Status =3D PeiServicesLocatePpi ( + &gSiDefaultPolicyInitPpiGuid, + 0, + NULL, + (VOID **) &PeiSiDefaultPolicyInitPpi + ); + ASSERT_EFI_ERROR (Status); + if (PeiSiDefaultPolicyInitPpi =3D=3D NULL) { + return Status; + } + Status =3D PeiSiDefaultPolicyInitPpi->PeiPolicyInit (); + ASSERT_EFI_ERROR (Status); + + return Status; +} diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiD= efaultPolicyInitLib/PeiSiDefaultPolicyInitLib.inf b/Platform/Intel/Tigerlak= eOpenBoardPkg/FspWrapper/Library/PeiSiDefaultPolicyInitLib/PeiSiDefaultPoli= cyInitLib.inf new file mode 100644 index 0000000000..bcad97c267 --- /dev/null +++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiDefaultP= olicyInitLib/PeiSiDefaultPolicyInitLib.inf @@ -0,0 +1,38 @@ +## @file +# Library functions for Fsp Policy Initialization Library. +# +# Copyright (c) 2021, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +##########################################################################= ###### +# +# Defines Section - statements that will be processed to create a Makefile= . +# +##########################################################################= ###### +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D PeiSiDefaultPolicyInitLib + FILE_GUID =3D ADA1D87B-6891-453C-A0DB-92D4CFD46693 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D NULL + CONSTRUCTOR =3D PeiSiDefaultPolicyInitLibConstructor + +[Packages] + MdePkg/MdePkg.dec + TigerlakeSiliconPkg/SiPkg.dec + +[Sources] + PeiSiDefaultPolicyInitLib.c + +[LibraryClasses] + PeiServicesLib + DebugLib + +[Ppis] + gSiDefaultPolicyInitPpiGuid ## CONSUMES + +[Depex] + gSiDefaultPolicyInitPpiGuid diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiP= reMemDefaultPolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.c b/Platform/Inte= l/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib/= PeiSiPreMemDefaultPolicyInitLib.c new file mode 100644 index 0000000000..f0eb3f3f14 --- /dev/null +++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiPreMemDe= faultPolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.c @@ -0,0 +1,40 @@ +/** @file + Instance of Fsp Policy Initialization Library. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include +#include +#include + +EFI_STATUS +EFIAPI +PeiSiPreMemDefaultPolicyInitLibConstructor ( + VOID + ) +{ + EFI_STATUS Status; + PEI_PREMEM_SI_DEFAULT_POLICY_INIT_PPI *PeiPreMemSiDefaultPolicyInitPpi; + + // + // Locate Policy init PPI to install default silicon policy + // + Status =3D PeiServicesLocatePpi ( + &gSiPreMemDefaultPolicyInitPpiGuid, + 0, + NULL, + (VOID **) &PeiPreMemSiDefaultPolicyInitPpi + ); + ASSERT_EFI_ERROR (Status); + if (PeiPreMemSiDefaultPolicyInitPpi =3D=3D NULL) { + return Status; + } + DEBUG ((DEBUG_INFO, "PeiPreMemSiDefaultPolicyInitPpi->PeiPreMemPolicyIni= t ()\n", Status)); + Status =3D PeiPreMemSiDefaultPolicyInitPpi->PeiPreMemPolicyInit (); + ASSERT_EFI_ERROR (Status); + + return Status; +} diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiP= reMemDefaultPolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.inf b/Platform/In= tel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLi= b/PeiSiPreMemDefaultPolicyInitLib.inf new file mode 100644 index 0000000000..c118d7fe2c --- /dev/null +++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiPreMemDe= faultPolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.inf @@ -0,0 +1,38 @@ +## @file +# Library functions for Fsp Policy Initialization Library. +# +# Copyright (c) 2021, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +##########################################################################= ###### +# +# Defines Section - statements that will be processed to create a Makefile= . +# +##########################################################################= ###### +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D PeiSiPreMemDefaultPolicyInitLib + FILE_GUID =3D F13311AD-9C5C-4212-AB02-9D0435B3FCF1 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D NULL + CONSTRUCTOR =3D PeiSiPreMemDefaultPolicyInitLibConstr= uctor + +[Packages] + MdePkg/MdePkg.dec + TigerlakeSiliconPkg/SiPkg.dec + +[Sources] + PeiSiPreMemDefaultPolicyInitLib.c + +[LibraryClasses] + PeiServicesLib + DebugLib + +[Ppis] + gSiPreMemDefaultPolicyInitPpiGuid ## CONSUMES + +[Depex] + gSiPreMemDefaultPolicyInitPpiGuid diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookL= ib/BasePlatformHookLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/Library/Bas= ePlatformHookLib/BasePlatformHookLib.c new file mode 100644 index 0000000000..6209e50450 --- /dev/null +++ b/Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/Base= PlatformHookLib.c @@ -0,0 +1,391 @@ +/** @file + Platform Hook Library instances + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define COM1_BASE 0x3f8 +#define COM2_BASE 0x2f8 + +#define SIO_DOCKING_LPC_SWITCH_REGISTER_ADDRESS 0x0690 + +#define LPC_SIO_INDEX_DEFAULT_PORT_2 0x2E +#define LPC_SIO_DATA_DEFAULT_PORT_2 0x2F +#define LPC_SIO_GPIO_REGISTER_ADDRESS_2 0x0A20 + +#define LEGACY_DAUGHTER_CARD_SIO_INDEX_PORT 0x2E +#define LEGACY_DAUGHTER_CARD_SIO_DATA_PORT 0x2F +#define LEGACY_DAUGHTER_CARD_2_SIO_INDEX_PORT 0x4E +#define LEGACY_DAUGHTER_CARD_2_SIO_DATA_PORT 0x4F + +#define IT8628_ENTER_CONFIG_WRITE_SEQ_0 0x87 +#define IT8628_ENTER_CONFIG_WRITE_SEQ_1 0x01 +#define IT8628_ENTER_CONFIG_WRITE_SEQ_2 0x55 +#define IT8628_ENTER_CONFIG_WRITE_SEQ_3 0x55 +#define IT8628_EXIT_CONFIG 0x2 +#define IT8628_CHIPID_BYTE1 0x86 +#define IT8628_CHIPID_BYTE2 0x28 + +typedef struct { + UINT8 Register; + UINT8 Value; +} EFI_SIO_TABLE; + + +GLOBAL_REMOVE_IF_UNREFERENCED EFI_SIO_TABLE mSioTableWpcn381u[] =3D { + {0x29, 0x0A0}, // Enable super I/O clock and set to 48M= Hz + {0x22, 0x003}, // + {0x07, 0x003}, // Select UART0 device + {0x60, (COM1_BASE >> 8)}, // Set Base Address MSB + {0x61, (COM1_BASE & 0x00FF)}, // Set Base Address LSB + {0x70, 0x004}, // Set to IRQ4 + {0x30, 0x001}, // Enable it with Activation bit + {0x07, 0x002}, // Select UART1 device + {0x60, (COM2_BASE >> 8)}, // Set Base Address MSB + {0x61, (COM2_BASE & 0x00FF)}, // Set Base Address LSB + {0x70, 0x003}, // Set to IRQ3 + {0x30, 0x001}, // Enable it with Activation bit + {0x07, 0x007}, // Select GPIO device + {0x60, (LPC_SIO_GPIO_REGISTER_ADDRESS_2 >> 8)}, // Set Base Address= MSB + {0x61, (LPC_SIO_GPIO_REGISTER_ADDRESS_2 & 0x00FF)}, // Set Base Address= LSB + {0x30, 0x001}, // Enable it with Activation bit + {0x21, 0x001}, // Global Device Enable + {0x26, 0x000} // Fast Enable UART 0 & 1 as their enabl= e & activation bit +}; + +// +// IT8628 +// +GLOBAL_REMOVE_IF_UNREFERENCED EFI_SIO_TABLE mSioIt8628TableSerialPort[] = =3D { + {0x023, 0x09}, // Clock Selection register + {0x007, 0x01}, // Com1 Logical Device Number select + {0x061, 0xF8}, // Serial Port 1 Base Address MSB Register + {0x060, 0x03}, // Serial Port 1 Base Address LSB Register + {0x070, 0x04}, // Serial Port 1 Interrupt Level Select + {0x030, 0x01}, // Serial Port 1 Activate + {0x007, 0x02}, // Com1 Logical Device Number select + {0x061, 0xF8}, // Serial Port 2 Base Address MSB Register + {0x060, 0x02}, // Serial Port 2 Base Address MSB Register + {0x070, 0x03}, // Serial Port 2 Interrupt Level Select + {0x030, 0x01} // Serial Port 2 Activate + +}; + +GLOBAL_REMOVE_IF_UNREFERENCED EFI_SIO_TABLE mSioTableWinbond_x374[] =3D { + {0x07, 0x03}, // Select UART0 device + {0x60, (COM1_BASE >> 8)}, // Set Base Address MSB + {0x61, (COM1_BASE & 0x00FF)}, // Set Base Address LSB + {0x70, 0x04}, // Set to IRQ4 + {0x30, 0x01} // Enable it with Activation bit +}; + +/** + Detect if a National 393 SIO is docked. If yes, enable the docked SIO + and its serial port, and disable the onboard serial port. + + @retval EFI_SUCCESS Operations performed successfully. +**/ +STATIC +VOID +CheckNationalSio ( + VOID + ) +{ + UINT8 Data8; + + // + // Pc87393 access is through either (0x2e, 0x2f) or (0x4e, 0x4f). + // We use (0x2e, 0x2f) which is determined by BADD default strapping + // + + // + // Read the Pc87393 signature + // + IoWrite8 (0x2e, 0x20); + Data8 =3D IoRead8 (0x2f); + + if (Data8 =3D=3D 0xea) { + // + // Signature matches - National PC87393 SIO is docked + // + + // + // Enlarge the LPC decode scope to accommodate the Docking LPC Switch + // Register (SIO_DOCKING_LPC_SWITCH_REGISTER_ADDRESS is allocated at + // SIO_BASE_ADDRESS + 0x10) + // + PchLpcGenIoRangeSet ((FixedPcdGet16 (PcdSioBaseAddress) & (UINT16)~0x7= F), 0x20); + + // + // Enable port switch + // + IoWrite8 (SIO_DOCKING_LPC_SWITCH_REGISTER_ADDRESS, 0x06); + + // + // Turn on docking power + // + IoWrite8 (FixedPcdGet16 (PcdSioBaseAddress) + 0x0E, 0x8c); + + IoWrite8 (FixedPcdGet16 (PcdSioBaseAddress) + 0x0E, 0x9c); + + IoWrite8 (FixedPcdGet16 (PcdSioBaseAddress) + 0x0E, 0xBc); + + // + // Enable port switch + // + IoWrite8 (SIO_DOCKING_LPC_SWITCH_REGISTER_ADDRESS, 0x7); + + // + // GPIO setting + // + IoWrite8 (0x2e, 0x24); + IoWrite8 (0x2f, 0x29); + + // + // Enable chip clock + // + IoWrite8 (0x2e, 0x29); + IoWrite8 (0x2f, 0x1e); + + + // + // Enable serial port + // + + // + // Select com1 + // + IoWrite8 (0x2e, 0x7); + IoWrite8 (0x2f, 0x3); + + // + // Base address: 0x3f8 + // + IoWrite8 (0x2e, 0x60); + IoWrite8 (0x2f, 0x03); + IoWrite8 (0x2e, 0x61); + IoWrite8 (0x2f, 0xf8); + + // + // Interrupt: 4 + // + IoWrite8 (0x2e, 0x70); + IoWrite8 (0x2f, 0x04); + + // + // Enable bank selection + // + IoWrite8 (0x2e, 0xf0); + IoWrite8 (0x2f, 0x82); + + // + // Activate + // + IoWrite8 (0x2e, 0x30); + IoWrite8 (0x2f, 0x01); + + // + // Disable onboard serial port + // + IoWrite8 (FixedPcdGet16 (PcdLpcSioConfigDefaultPort), 0x55); + + // + // Power Down UARTs + // + IoWrite8 (PcdGet16 (PcdLpcSioIndexPort), 0x2); + IoWrite8 (PcdGet16 (PcdLpcSioDataPort), 0x00); + + // + // Dissable COM1 decode + // + IoWrite8 (PcdGet16 (PcdLpcSioIndexPort), 0x24); + IoWrite8 (PcdGet16 (PcdLpcSioDataPort), 0); + + // + // Disable COM2 decode + // + IoWrite8 (PcdGet16 (PcdLpcSioIndexPort), 0x25); + IoWrite8 (PcdGet16 (PcdLpcSioDataPort), 0); + + // + // Disable interrupt + // + IoWrite8 (PcdGet16 (PcdLpcSioIndexPort), 0x28); + IoWrite8 (PcdGet16 (PcdLpcSioDataPort), 0x0); + + IoWrite8 (FixedPcdGet16 (PcdLpcSioConfigDefaultPort), 0xAA); + + // + // Enable floppy + // + + // + // Select floppy + // + IoWrite8 (0x2e, 0x7); + IoWrite8 (0x2f, 0x0); + + // + // Base address: 0x3f0 + // + IoWrite8 (0x2e, 0x60); + IoWrite8 (0x2f, 0x03); + IoWrite8 (0x2e, 0x61); + IoWrite8 (0x2f, 0xf0); + + // + // Interrupt: 6 + // + IoWrite8 (0x2e, 0x70); + IoWrite8 (0x2f, 0x06); + + // + // DMA 2 + // + IoWrite8 (0x2e, 0x74); + IoWrite8 (0x2f, 0x02); + + // + // Activate + // + IoWrite8 (0x2e, 0x30); + IoWrite8 (0x2f, 0x01); + + } else { + + // + // No National pc87393 SIO is docked, turn off dock power and + // disable port switch + // + // IoWrite8 (SIO_BASE_ADDRESS + 0x0E, 0xbf); + // IoWrite8 (0x690, 0); + + // + // If no National pc87393, just return + // + return ; + } +} + +/** +Check whether the IT8628 SIO present on LPC. If yes, enable its serial por= ts + +@retval EFI_SUCCESS Operations performed successfully. +**/ +STATIC +VOID +It8628SioSerialPortInit ( + VOID + ) +{ + UINT8 ChipId0 =3D 0; + UINT8 ChipId1 =3D 0; + UINT16 LpcIoDecondeRangeSet =3D 0; + UINT16 LpcIoDecoodeSet =3D 0; + UINT8 Index; + UINTN LpcBaseAddr; + + + + // + // Enable I/O decoding for COM1 (3F8h-3FFh), COM2(2F8h-2FFh), I/O port 2= Eh/2Fh. + // + LpcBaseAddr =3D MmPciBase ( + DEFAULT_PCI_BUS_NUMBER_PCH, + LpcDevNumber (), + LpcFuncNumber () + ); + + LpcIoDecondeRangeSet =3D (UINT16) MmioRead16 (LpcBaseAddr + R_LPC_CFG_IO= D); + LpcIoDecoodeSet =3D (UINT16) MmioRead16 (LpcBaseAddr + R_LPC_CFG_IOE); + MmioWrite16 ((LpcBaseAddr + R_LPC_CFG_IOD), (LpcIoDecondeRangeSet | ((V_= LPC_CFG_IOD_COMB_2F8 << 4) | V_LPC_CFG_IOD_COMA_3F8))); + MmioWrite16 ((LpcBaseAddr + R_LPC_CFG_IOE), (LpcIoDecoodeSet | (B_LPC_CF= G_IOE_SE | B_LPC_CFG_IOE_CBE | B_LPC_CFG_IOE_CAE|B_LPC_CFG_IOE_KE))); + + + // + // Enter MB PnP Mode + // + IoWrite8 (LPC_SIO_INDEX_DEFAULT_PORT_2, IT8628_ENTER_CONFIG_WRITE_SEQ_0)= ; + IoWrite8 (LPC_SIO_INDEX_DEFAULT_PORT_2, IT8628_ENTER_CONFIG_WRITE_SEQ_1)= ; + IoWrite8 (LPC_SIO_INDEX_DEFAULT_PORT_2, IT8628_ENTER_CONFIG_WRITE_SEQ_2)= ; + IoWrite8 (LPC_SIO_INDEX_DEFAULT_PORT_2, IT8628_ENTER_CONFIG_WRITE_SEQ_3)= ; + + // + // Read Chip Id of SIO IT8628 (registers 0x20 and 0x21) + // + IoWrite8 (LPC_SIO_INDEX_DEFAULT_PORT_2, 0x20); + ChipId0 =3D IoRead8 (LPC_SIO_DATA_DEFAULT_PORT_2); + + IoWrite8 (LPC_SIO_INDEX_DEFAULT_PORT_2, 0x21); + ChipId1 =3D IoRead8 (LPC_SIO_DATA_DEFAULT_PORT_2); + + // + // Enable Serial Port 1, Port 2 + // + if ((ChipId0 =3D=3D IT8628_CHIPID_BYTE1) && (ChipId1 =3D=3D IT8628_CHIPI= D_BYTE2)) { + for (Index =3D 0; Index < sizeof (mSioIt8628TableSerialPort) / sizeof = (EFI_SIO_TABLE); Index++) { + IoWrite8 (LPC_SIO_INDEX_DEFAULT_PORT_2, mSioIt8628TableSerialPort[In= dex].Register); + IoWrite8 (LPC_SIO_DATA_DEFAULT_PORT_2, mSioIt8628TableSerialPort[Ind= ex].Value); + } + } + + // + // Exit MB PnP Mode + // + IoWrite8 (LPC_SIO_INDEX_DEFAULT_PORT_2, IT8628_EXIT_CONFIG); + IoWrite8 (LPC_SIO_DATA_DEFAULT_PORT_2, IT8628_EXIT_CONFIG); + + return; +} + +/** + Performs platform specific initialization required for the CPU to access + the hardware associated with a SerialPortLib instance. This function do= es + not initialize the serial port hardware itself. Instead, it initializes + hardware devices that are required for the CPU to access the serial port + hardware. This function may be called more than once. + + @retval RETURN_SUCCESS The platform specific initialization succee= ded. + @retval RETURN_DEVICE_ERROR The platform specific initialization could = not be completed. + +**/ +RETURN_STATUS +EFIAPI +PlatformHookSerialPortInitialize ( + VOID + ) +{ + UINT16 IndexPort; + UINT16 DataPort; + UINT8 Index; + + IndexPort =3D 0; + DataPort =3D 0; + Index =3D 0; + + // + // Enable I/O decoding for COM1(3F8h-3FFh), COM2(2F8h-2FFh), I/O port 2E= h/2Fh, 4Eh/4Fh, 60h/64Fh and 62h/66h. + // + PchLpcIoDecodeRangesSet (PcdGet16 (PcdLpcIoDecodeRange)); + PchLpcIoEnableDecodingSet (PcdGet16 (PchLpcIoEnableDecoding)); + + // Configure Sio IT8628 + It8628SioSerialPortInit (); + + return RETURN_SUCCESS; +} diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookL= ib/BasePlatformHookLib.inf b/Platform/Intel/TigerlakeOpenBoardPkg/Library/B= asePlatformHookLib/BasePlatformHookLib.inf new file mode 100644 index 0000000000..cf01780101 --- /dev/null +++ b/Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/Base= PlatformHookLib.inf @@ -0,0 +1,51 @@ +## @file +# Platform Hook Library instance for Tigerlake Mobile/Desktop CRB. +# +# Copyright (c) 2021, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x00010017 + BASE_NAME =3D BasePlatformHookLib + FILE_GUID =3D E22ADCC6-ED90-4A90-9837-C8E7FF9E963D + VERSION_STRING =3D 1.0 + MODULE_TYPE =3D BASE + LIBRARY_CLASS =3D PlatformHookLib +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D IA32 X64 IPF EBC +# + +[LibraryClasses] + BaseLib + IoLib + PciSegmentLib + MmPciLib + PciLib + PchCycleDecodingLib + SaPlatformLib + PchPciBdfLib + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + MinPlatformPkg/MinPlatformPkg.dec + TigerlakeOpenBoardPkg/OpenBoardPkg.dec + TigerlakeSiliconPkg/SiPkg.dec + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdLpcSioIndexPort ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdLpcSioDataPort ## CONSUMES + +[FixedPcd] + gBoardModuleTokenSpaceGuid.PcdLpcSioConfigDefaultPort ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdSioBaseAddress ## CONSUMES + gBoardModuleTokenSpaceGuid.PcdLpcIoDecodeRange ## CONSUMES + gBoardModuleTokenSpaceGuid.PchLpcIoEnableDecoding ## CONSUMES + +[Sources] + BasePlatformHookLib.c diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommon= Lib/SmmSpiFlashCommonLib.inf b/Platform/Intel/TigerlakeOpenBoardPkg/Library= /SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.inf new file mode 100644 index 0000000000..374f5ea52b --- /dev/null +++ b/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/Smm= SpiFlashCommonLib.inf @@ -0,0 +1,49 @@ +## @file +# SMM Library instance of Spi Flash Common Library Class +# +# Copyright (c) 2021, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x00010017 + BASE_NAME =3D SmmSpiFlashCommonLib + FILE_GUID =3D 9632D96E-E849-4217-9217-DC500B8AAE47 + VERSION_STRING =3D 1.0 + MODULE_TYPE =3D DXE_SMM_DRIVER + LIBRARY_CLASS =3D SpiFlashCommonLib|DXE_SMM_DRIVER + CONSTRUCTOR =3D SmmSpiFlashCommonLibConstructor +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D IA32 X64 +# + +[LibraryClasses] + IoLib + MemoryAllocationLib + BaseLib + UefiLib + SmmServicesTableLib + BaseMemoryLib + DebugLib + +[Packages] + MdePkg/MdePkg.dec + MinPlatformPkg/MinPlatformPkg.dec + TigerlakeSiliconPkg/SiPkg.dec + +[Pcd] + gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress ## CONSUMES + gSiPkgTokenSpaceGuid.PcdBiosSize ## CONSUMES + +[Sources] + SpiFlashCommonSmmLib.c + SpiFlashCommon.c + +[Protocols] + gPchSmmSpiProtocolGuid ## CONSUMES + +[Depex.X64.DXE_SMM_DRIVER] + gPchSmmSpiProtocolGuid diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommon= Lib/SpiFlashCommon.c b/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiF= lashCommonLib/SpiFlashCommon.c new file mode 100644 index 0000000000..f86896dd1f --- /dev/null +++ b/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/Spi= FlashCommon.c @@ -0,0 +1,210 @@ +/** @file + Wrap EFI_SPI_PROTOCOL to provide some library level interfaces + for module use. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include +#include + +PCH_SPI_PROTOCOL *mSpiProtocol; + +// +// Variables for boottime and runtime usage. +// +UINTN mBiosAreaBaseAddress =3D 0; +UINTN mBiosSize =3D 0; +UINTN mBiosOffset =3D 0; + +/** + Enable block protection on the Serial Flash device. + + @retval EFI_SUCCESS Opertion is successful. + @retval EFI_DEVICE_ERROR If there is any device errors. + +**/ +EFI_STATUS +EFIAPI +SpiFlashLock ( + VOID + ) +{ + return EFI_SUCCESS; +} + +/** + Read NumBytes bytes of data from the address specified by + PAddress into Buffer. + + @param[in] Address The starting physical address of the read. + @param[in,out] NumBytes On input, the number of bytes to read. On = output, the number + of bytes actually read. + @param[out] Buffer The destination data buffer for the read. + + @retval EFI_SUCCESS Operation is successful. + @retval EFI_DEVICE_ERROR If there is any device errors. + +**/ +EFI_STATUS +EFIAPI +SpiFlashRead ( + IN UINTN Address, + IN OUT UINT32 *NumBytes, + OUT UINT8 *Buffer + ) +{ + ASSERT ((NumBytes !=3D NULL) && (Buffer !=3D NULL)); + if ((NumBytes =3D=3D NULL) || (Buffer =3D=3D NULL)) { + return EFI_INVALID_PARAMETER; + } + + // + // This function is implemented specifically for those platforms + // at which the SPI device is memory mapped for read. So this + // function just do a memory copy for Spi Flash Read. + // + CopyMem (Buffer, (VOID *) Address, *NumBytes); + + return EFI_SUCCESS; +} + +/** + Write NumBytes bytes of data from Buffer to the address specified by + PAddresss. + + @param[in] Address The starting physical address of the wri= te. + @param[in,out] NumBytes On input, the number of bytes to write. = On output, + the actual number of bytes written. + @param[in] Buffer The source data buffer for the write. + + @retval EFI_SUCCESS Operation is successful. + @retval EFI_DEVICE_ERROR If there is any device errors. + @retval EFI_INVALID_PARAMETER Invalid parameter. + +**/ +EFI_STATUS +EFIAPI +SpiFlashWrite ( + IN UINTN Address, + IN OUT UINT32 *NumBytes, + IN UINT8 *Buffer + ) +{ + EFI_STATUS Status; + UINTN Offset; + UINT32 Length; + UINT32 RemainingBytes; + + ASSERT ((NumBytes !=3D NULL) && (Buffer !=3D NULL)); + if ((NumBytes =3D=3D NULL) || (Buffer =3D=3D NULL)) { + return EFI_INVALID_PARAMETER; + } + + ASSERT (Address >=3D mBiosAreaBaseAddress); + if (Address < mBiosAreaBaseAddress) { + return EFI_INVALID_PARAMETER; + } + + Offset =3D Address - mBiosAreaBaseAddress; + + ASSERT ((*NumBytes + Offset) <=3D mBiosSize); + if ((*NumBytes + Offset) > mBiosSize) { + return EFI_INVALID_PARAMETER; + } + + Status =3D EFI_SUCCESS; + RemainingBytes =3D *NumBytes; + + + while (RemainingBytes > 0) { + if (RemainingBytes > SECTOR_SIZE_4KB) { + Length =3D SECTOR_SIZE_4KB; + } else { + Length =3D RemainingBytes; + } + Status =3D mSpiProtocol->FlashWrite ( + mSpiProtocol, + FlashRegionBios, + (UINT32) Offset, + Length, + Buffer + ); + if (EFI_ERROR (Status)) { + break; + } + RemainingBytes -=3D Length; + Offset +=3D Length; + Buffer +=3D Length; + } + + // + // Actual number of bytes written + // + *NumBytes -=3D RemainingBytes; + + return Status; +} + +/** + Erase the block starting at Address. + + @param[in] Address The starting physical address of the block t= o be erased. + This library assume that caller garantee tha= t the PAddress + is at the starting address of this block. + @param[in] NumBytes On input, the number of bytes of the logical= block to be erased. + On output, the actual number of bytes erased= . + + @retval EFI_SUCCESS. Operation is successful. + @retval EFI_DEVICE_ERROR If there is any device errors. + @retval EFI_INVALID_PARAMETER Invalid parameter. + +**/ +EFI_STATUS +EFIAPI +SpiFlashBlockErase ( + IN UINTN Address, + IN UINTN *NumBytes + ) +{ + EFI_STATUS Status; + UINTN Offset; + UINTN RemainingBytes; + + ASSERT (NumBytes !=3D NULL); + if (NumBytes =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + + ASSERT (Address >=3D mBiosAreaBaseAddress); + if (Address < mBiosAreaBaseAddress) { + return EFI_INVALID_PARAMETER; + } + + Offset =3D Address - mBiosAreaBaseAddress; + + ASSERT ((*NumBytes % SECTOR_SIZE_4KB) =3D=3D 0); + if ((*NumBytes % SECTOR_SIZE_4KB) !=3D 0) { + return EFI_INVALID_PARAMETER; + } + + ASSERT ((*NumBytes + Offset) <=3D mBiosSize); + if ((*NumBytes + Offset) > mBiosSize) { + return EFI_INVALID_PARAMETER; + } + + Status =3D EFI_SUCCESS; + RemainingBytes =3D *NumBytes; + + + Status =3D mSpiProtocol->FlashErase ( + mSpiProtocol, + FlashRegionBios, + (UINT32) Offset, + (UINT32) RemainingBytes + ); + return Status; +} + diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommon= Lib/SpiFlashCommonSmmLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/Library/S= mmSpiFlashCommonLib/SpiFlashCommonSmmLib.c new file mode 100644 index 0000000000..7941b8f872 --- /dev/null +++ b/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/Spi= FlashCommonSmmLib.c @@ -0,0 +1,58 @@ +/** @file + SMM Library instance of SPI Flash Common Library Class + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include +#include + +extern PCH_SPI_PROTOCOL *mSpiProtocol; + +extern UINTN mBiosAreaBaseAddress; +extern UINTN mBiosSize; +extern UINTN mBiosOffset; + +/** + The library constructuor. + + The function does the necessary initialization work for this library + instance. + + @param[in] ImageHandle The firmware allocated handle for the UEFI= image. + @param[in] SystemTable A pointer to the EFI system table. + + @retval EFI_SUCCESS The function always return EFI_SUCCESS for= now. + It will ASSERT on error for debug version. + @retval EFI_ERROR Please reference LocateProtocol for error = code details. +**/ +EFI_STATUS +EFIAPI +SmmSpiFlashCommonLibConstructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + UINT32 BaseAddr; + UINT32 RegionSize; + + mBiosAreaBaseAddress =3D (UINTN)PcdGet32 (PcdBiosAreaBaseAddress); + mBiosSize =3D (UINTN)PcdGet32 (PcdBiosSize); + + // + // Locate the SMM SPI protocol. + // + Status =3D gSmst->SmmLocateProtocol ( + &gPchSmmSpiProtocolGuid, + NULL, + (VOID **) &mSpiProtocol + ); + ASSERT_EFI_ERROR (Status); + + mSpiProtocol->GetRegionAddress (mSpiProtocol, FlashRegionBios, &BaseAddr= , &RegionSize); + mBiosOffset =3D BaseAddr; + return Status; +} diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSilicon= PolicyUpdateLib/DxeGopPolicyInit.c b/Platform/Intel/TigerlakeOpenBoardPkg/P= olicy/Library/DxeSiliconPolicyUpdateLib/DxeGopPolicyInit.c new file mode 100644 index 0000000000..a2367047cd --- /dev/null +++ b/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyU= pdateLib/DxeGopPolicyInit.c @@ -0,0 +1,168 @@ +/** @file + This file initialises and Installs GopPolicy Protocol. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include +#include +#include +#include +#include + +GLOBAL_REMOVE_IF_UNREFERENCED GOP_POLICY_PROTOCOL mGOPPolicy; +GLOBAL_REMOVE_IF_UNREFERENCED UINT32 mVbtSize =3D 0; +GLOBAL_REMOVE_IF_UNREFERENCED EFI_PHYSICAL_ADDRESS mVbtAddress =3D 0= ; + +/** + @param[out] CurrentLidStatus + + @retval EFI_SUCCESS + @retval EFI_UNSUPPORTED +**/ +EFI_STATUS +EFIAPI +GetPlatformLidStatus ( + OUT LID_STATUS *CurrentLidStatus + ) +{ + return EFI_UNSUPPORTED; +} + +/** + @param[out] CurrentDockStatus + + @retval EFI_SUCCESS + @retval EFI_UNSUPPORTED +**/ +EFI_STATUS +EFIAPI +GetPlatformDockStatus ( + OUT DOCK_STATUS CurrentDockStatus + ) +{ + return EFI_UNSUPPORTED; +} + +/** + @param[out] VbtAddress + @param[out] VbtSize + + @retval EFI_SUCCESS + @retval EFI_NOT_FOUND +**/ +EFI_STATUS +EFIAPI +GetVbtData ( + OUT EFI_PHYSICAL_ADDRESS *VbtAddress, + OUT UINT32 *VbtSize + ) +{ + EFI_STATUS Status; + UINTN FvProtocolCount; + EFI_HANDLE *FvHandles; + EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv; + UINTN Index; + UINT32 AuthenticationStatus; + UINT8 *Buffer; + UINTN VbtBufferSize; + + + Status =3D EFI_NOT_FOUND; + if ( mVbtAddress =3D=3D 0) { + Fv =3D NULL; + + Buffer =3D 0; + FvHandles =3D NULL; + Status =3D gBS->LocateHandleBuffer ( + ByProtocol, + &gEfiFirmwareVolume2ProtocolGuid, + NULL, + &FvProtocolCount, + &FvHandles + ); + if (!EFI_ERROR (Status)) { + for (Index =3D 0; Index < FvProtocolCount; Index++) { + Status =3D gBS->HandleProtocol ( + FvHandles[Index], + &gEfiFirmwareVolume2ProtocolGuid, + (VOID **) &Fv + ); + VbtBufferSize =3D 0; + Status =3D Fv->ReadSection ( + Fv, + PcdGetPtr (PcdIntelGraphicsVbtFileGuid), + EFI_SECTION_RAW, + 0, + (VOID **) &Buffer, + &VbtBufferSize, + &AuthenticationStatus + ); + if (!EFI_ERROR (Status)) { + *VbtAddress =3D (EFI_PHYSICAL_ADDRESS)Buffer; + *VbtSize =3D (UINT32)VbtBufferSize; + mVbtAddress =3D *VbtAddress; + mVbtSize =3D *VbtSize; + Status =3D EFI_SUCCESS; + break; + } + } + } else { + Status =3D EFI_NOT_FOUND; + } + + if (FvHandles !=3D NULL) { + FreePool (FvHandles); + FvHandles =3D NULL; + } + } else { + *VbtAddress =3D mVbtAddress; + *VbtSize =3D mVbtSize; + Status =3D EFI_SUCCESS; + } + + return Status; +} + +/** +Initialize GOP DXE Policy + +@param[in] ImageHandle Image handle of this driver. + +@retval EFI_SUCCESS Initialization complete. +@retval EFI_UNSUPPORTED The chipset is unsupported by this driver. +@retval EFI_OUT_OF_RESOURCES Do not have enough resources to initialize= the driver. +@retval EFI_DEVICE_ERROR Device error, driver exits abnormally. +**/ +EFI_STATUS +EFIAPI +GopPolicyInitDxe ( + IN EFI_HANDLE ImageHandle + ) +{ + EFI_STATUS Status; + + // + // Initialize the EFI Driver Library + // + SetMem (&mGOPPolicy, sizeof (GOP_POLICY_PROTOCOL), 0); + + mGOPPolicy.Revision =3D GOP_POLICY_PROTOCOL_REVISION_03; + mGOPPolicy.GetPlatformLidStatus =3D GetPlatformLidStatus; + mGOPPolicy.GetVbtData =3D GetVbtData; + mGOPPolicy.GetPlatformDockStatus =3D GetPlatformDockStatus; + + // + // Install protocol to allow access to this Policy. + // + Status =3D gBS->InstallMultipleProtocolInterfaces ( + &ImageHandle, + &gGopPolicyProtocolGuid, + &mGOPPolicy, + NULL + ); + + return Status; +} diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSilicon= PolicyUpdateLib/DxePchPolicyInit.c b/Platform/Intel/TigerlakeOpenBoardPkg/P= olicy/Library/DxeSiliconPolicyUpdateLib/DxePchPolicyInit.c new file mode 100644 index 0000000000..e75abcb42a --- /dev/null +++ b/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyU= pdateLib/DxePchPolicyInit.c @@ -0,0 +1,61 @@ +/** @file + This file initialises and Installs GopPolicy Protocol. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include + +EFI_STATUS +EFIAPI +CreatePchDxeConfigBlocks ( + IN OUT VOID **SaPolicy + ); + +EFI_STATUS +EFIAPI +PchInstallPolicyProtocol ( + IN EFI_HANDLE ImageHandle, + IN VOID *PchPolicy + ); + +/** + Initialize PCH DXE Policy + + @param[in] ImageHandle Image handle of this driver. + + @retval EFI_SUCCESS Initialization complete. + @retval EFI_UNSUPPORTED The chipset is unsupported by this drive= r. + @retval EFI_OUT_OF_RESOURCES Do not have enough resources to initiali= ze the driver. + @retval EFI_DEVICE_ERROR Device error, driver exits abnormally. +**/ +EFI_STATUS +EFIAPI +PchPolicyInitDxe ( + IN EFI_HANDLE ImageHandle + ) +{ + EFI_STATUS Status; + EFI_HANDLE PchHandle; + VOID *PchPolicy; + + // + // Call CreatePchDxeConfigBlocks to create & initialize platform policy = structure + // and get all Intel default policy settings. + // + Status =3D CreatePchDxeConfigBlocks (&PchPolicy); + ASSERT_EFI_ERROR (Status); + + // + // Install PchInstallPolicyProtocol. + // While installed, RC assumes the Policy is ready and finalized. So ple= ase + // update and override any setting before calling this function. + // + PchHandle =3D NULL; + Status =3D PchInstallPolicyProtocol (PchHandle, PchPolicy); + ASSERT_EFI_ERROR (Status); + + return EFI_SUCCESS; +} diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSilicon= PolicyUpdateLib/DxeSaPolicyInit.c b/Platform/Intel/TigerlakeOpenBoardPkg/Po= licy/Library/DxeSiliconPolicyUpdateLib/DxeSaPolicyInit.c new file mode 100644 index 0000000000..5a9def9d13 --- /dev/null +++ b/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyU= pdateLib/DxeSaPolicyInit.c @@ -0,0 +1,61 @@ +/** @file + This file initialises and Installs GopPolicy Protocol. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include + +EFI_STATUS +EFIAPI +CreateSaDxeConfigBlocks ( + IN OUT VOID **SaPolicy + ); + +EFI_STATUS +EFIAPI +SaInstallPolicyProtocol ( + IN EFI_HANDLE ImageHandle, + IN VOID *SaPolicy + ); + +/** + Initialize SA DXE Policy + + @param[in] ImageHandle Image handle of this driver. + + @retval EFI_SUCCESS Initialization complete. + @retval EFI_UNSUPPORTED The chipset is unsupported by this drive= r. + @retval EFI_OUT_OF_RESOURCES Do not have enough resources to initiali= ze the driver. + @retval EFI_DEVICE_ERROR Device error, driver exits abnormally. +**/ +EFI_STATUS +EFIAPI +SaPolicyInitDxe ( + IN EFI_HANDLE ImageHandle + ) +{ + EFI_STATUS Status; + EFI_HANDLE SaHandle; + VOID *SaPolicy; + + // + // Call CreateSaDxeConfigBlocks to create & initialize platform policy s= tructure + // and get all Intel default policy settings. + // + Status =3D CreateSaDxeConfigBlocks (&SaPolicy); + ASSERT_EFI_ERROR (Status); + + // + // Install SaInstallPolicyProtocol. + // While installed, RC assumes the Policy is ready and finalized. So ple= ase + // update and override any setting before calling this function. + // + SaHandle =3D NULL; + Status =3D SaInstallPolicyProtocol (SaHandle, SaPolicy); + ASSERT_EFI_ERROR (Status); + + return EFI_SUCCESS; +} diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSilicon= PolicyUpdateLib/DxeSiliconPolicyUpdateLate.c b/Platform/Intel/TigerlakeOpen= BoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLat= e.c new file mode 100644 index 0000000000..2eee9958be --- /dev/null +++ b/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyU= pdateLib/DxeSiliconPolicyUpdateLate.c @@ -0,0 +1,97 @@ +/** @file + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include +#include +#include + +/** + Initialize SA DXE Policy + + @param[in] ImageHandle Image handle of this driver. + + @retval EFI_SUCCESS Initialization complete. + @retval EFI_UNSUPPORTED The chipset is unsupported by this drive= r. + @retval EFI_OUT_OF_RESOURCES Do not have enough resources to initiali= ze the driver. + @retval EFI_DEVICE_ERROR Device error, driver exits abnormally. +**/ +EFI_STATUS +EFIAPI +SaPolicyInitDxe ( + IN EFI_HANDLE ImageHandle + ); + +/** + Initialize PCH DXE Policy + + @param[in] ImageHandle Image handle of this driver. + + @retval EFI_SUCCESS Initialization complete. + @retval EFI_UNSUPPORTED The chipset is unsupported by this drive= r. + @retval EFI_OUT_OF_RESOURCES Do not have enough resources to initiali= ze the driver. + @retval EFI_DEVICE_ERROR Device error, driver exits abnormally. +**/ +EFI_STATUS +EFIAPI +PchPolicyInitDxe ( + IN EFI_HANDLE ImageHandle + ); + +/** + Initialize GOP DXE Policy + + @param[in] ImageHandle Image handle of this driver. + + @retval EFI_SUCCESS Initialization complete. + @retval EFI_UNSUPPORTED The chipset is unsupported by this drive= r. + @retval EFI_OUT_OF_RESOURCES Do not have enough resources to initiali= ze the driver. + @retval EFI_DEVICE_ERROR Device error, driver exits abnormally. +**/ +EFI_STATUS +EFIAPI +GopPolicyInitDxe ( + IN EFI_HANDLE ImageHandle + ); + +/** + Performs silicon late policy update. + + The meaning of Policy is defined by silicon code. + It could be the raw data, a handle, a Protocol, etc. + + The input Policy must be returned by SiliconPolicyDoneLate(). + + In FSP or non-FSP path, the board may use additional way to get + the silicon policy data field based upon the input Policy. + + @param[in, out] Policy Pointer to policy. + + @return the updated policy. +**/ +VOID * +EFIAPI +SiliconPolicyUpdateLate ( + IN OUT VOID *Policy + ) +{ + EFI_STATUS Status; + + SaPolicyInitDxe (gImageHandle); + PchPolicyInitDxe (gImageHandle); + + if (PcdGetBool (PcdIntelGopEnable)) { + // + // GOP Dxe Policy Initialization + // + Status =3D GopPolicyInitDxe (gImageHandle); + RETURN_ERROR (Status); + DEBUG ((DEBUG_INFO, "GOP Dxe Policy Initialization done\n")); + } + + return Policy; +} + diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSilicon= PolicyUpdateLib/DxeSiliconPolicyUpdateLib.inf b/Platform/Intel/TigerlakeOpe= nBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLi= b.inf new file mode 100644 index 0000000000..573dbfa04a --- /dev/null +++ b/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyU= pdateLib/DxeSiliconPolicyUpdateLib.inf @@ -0,0 +1,49 @@ +## @file +# Component information file for Silicon Policy Update Library +# +# Copyright (c) 2021, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D DxeSiliconUpdateLib + FILE_GUID =3D C523609D-E354-416B-B24F-33468D4BD21D + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D SiliconPolicyUpdateLib + +[LibraryClasses] + BaseLib + PcdLib + DebugLib + UefiBootServicesTableLib + DxeSaPolicyLib + DxePchPolicyLib + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + TigerlakeSiliconPkg/SiPkg.dec + MinPlatformPkg/MinPlatformPkg.dec + TigerlakeOpenBoardPkg/OpenBoardPkg.dec + IntelSiliconPkg/IntelSiliconPkg.dec + +[Sources] + DxeSiliconPolicyUpdateLate.c + DxeSaPolicyInit.c + DxePchPolicyInit.c + DxeGopPolicyInit.c + +[Pcd] + gBoardModuleTokenSpaceGuid.PcdIntelGopEnable + gBoardModuleTokenSpaceGuid.PcdGraphicsVbtGuid + gIntelSiliconPkgTokenSpaceGuid.PcdIntelGraphicsVbtFileGuid + +[Protocols] + gEfiFirmwareVolume2ProtocolGuid ## CONSUMES + gGopPolicyProtocolGuid ## PRODUCES + +[Depex] + gEfiVariableArchProtocolGuid --=20 2.24.0.windows.2