From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web11.41906.1656700463708601608 for ; Fri, 01 Jul 2022 11:34:23 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=YaOlDvXF; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: isaac.w.oram@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656700463; x=1688236463; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Vq8jr72H7ypD6MbdhXVXOsIBl+c2teyvpgiJrmjYWks=; b=YaOlDvXF7LddAjAqBfToMUluVEbDLCtm9JAOK3/vVZ57+qkIjqZ0XOCt c3AqocxQNlkZKxMrl+oHt7CCHziZhZ5uQe5EqfL/Ou9ML16+z5iBl0Oqg 5x+5m/2wWxmRgqtyKne8Cmy0wN5YcR6hTXJJA/91Gh00KUqZDjYnyoTgm ih1mwLBhhp0Mg90/0e8N4+r9GuJBI0Qu8nIRr17qYr83CTjRPLt2lUqPv J7u8T8QE8BoBimq4BBaciCe6HA982PV12/5caKEX/zCXTMj8EnuoBo3E8 PZDPUL6jEoyeIIxGsSsv8k47rXDDnVLzwnPEV3USYyE8UUfLqV/25zhUs Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10395"; a="280276855" X-IronPort-AV: E=Sophos;i="5.92,237,1650956400"; d="scan'208";a="280276855" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2022 11:34:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,237,1650956400"; d="scan'208";a="718703920" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga004.jf.intel.com with ESMTP; 01 Jul 2022 11:34:23 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 1 Jul 2022 11:34:22 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Fri, 1 Jul 2022 11:34:22 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.170) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Fri, 1 Jul 2022 11:34:22 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nGYTMiD1MlhljqWKoTd8Ah8nneFsk2YE5njDoPRcEBwLMYM/m0rX2UaFFn9EZ3S4egnvCew3cHp/rQ2XHqqLUPWNFkWi/tI2x7Tb5PaWrfPwqiefiu/cy9gdweilBVNoR3XWhpERJ0h10BOCfJDEIjl6pArtJ1zNr9x7bj9X/foOsF4rQ+Mpt58abZ3mC/OikWdf0Q5VWLvLDoH4/0Inv9DmWj5ZmochQCEkOPgzAqrWTT0N0JF+ctWCVyokiT2UE32u9B4PkSMnK/x2xU4h+0cBIWcDQFV53WWwiXOFReGsG1KoVvPpFfqoRuRqlCryfdaNblY1+/7kDCL4RpqsOg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TvyTDcNN45chUMrk+WEBHDKZAtfCyk4YP1bYbzHWOqM=; b=mLuN0hi2rOY7ue2wmqQAFMYNgsv5DJ3OHDxIFrdV31SsyXd6p/ab3zU+UXccPbYQa5G1S1wpm4No9qiwN+qynuxKvEtZlqXu5+2/R2EXKBTxfsTlfE4gT42jG7pg/e4KgYmvF+iUitt3lrTT6rfgt3nYUUvu1bfX56Ijb5w8AjZF6HlRDgfGgyfxelFbgTo0EJCkeYM1WNkH4ohz5SwIwp9usmuDtpPJdKC7JicBhqcwBN9LWNALHJ0bC2BoUIKHpknsqeQNRAIoos8k0QUO2X/j9om43G5hFksXLRomFS8oQ/YEMyA4paL0m5PoqWcE/ewLYEOM/umSR8H/ZUTOgg== 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 Received: from SA1PR11MB5801.namprd11.prod.outlook.com (2603:10b6:806:23d::13) by PH0PR11MB5593.namprd11.prod.outlook.com (2603:10b6:510:e0::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14; Fri, 1 Jul 2022 18:34:19 +0000 Received: from SA1PR11MB5801.namprd11.prod.outlook.com ([fe80::38f6:5a89:7ca7:9b9a]) by SA1PR11MB5801.namprd11.prod.outlook.com ([fe80::38f6:5a89:7ca7:9b9a%4]) with mapi id 15.20.5395.017; Fri, 1 Jul 2022 18:34:19 +0000 From: "Oram, Isaac W" To: "Lin, Jason1" , "devel@edk2.groups.io" CC: "Feng, Bob C" , "Gao, Liming" , "Chen, Christine" , "Chaganty, Rangasai V" , "Chiang, Dakota" Subject: Re: [PATCH v3 3/3] [edk2-platforms] Silicon/Intel/FitGen: Support Startup ACM entries (Type 2) 0x200 Version Thread-Topic: [PATCH v3 3/3] [edk2-platforms] Silicon/Intel/FitGen: Support Startup ACM entries (Type 2) 0x200 Version Thread-Index: AQHYjVyzHqAVVKc8W0eylxkQxHmmq61p15dw Date: Fri, 1 Jul 2022 18:34:19 +0000 Message-ID: References: <20220701151005.189-1-jason1.lin@intel.com> <20220701151005.189-3-jason1.lin@intel.com> In-Reply-To: <20220701151005.189-3-jason1.lin@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 196eea95-9708-4da1-d39a-08da5b904fc7 x-ms-traffictypediagnostic: PH0PR11MB5593:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: pWjIjidbQkS9vxJ3coHNoia7GJr6pJBmfamkrSxsu9eRjo0/dok3BeL5ycZcznB5tjVp3/mhWYwJz+Er8dPNaciUHFW5GsYbEH3CHtWPPvbM8tgjOQmQxnrDy0VbW4skdgnDCDKxPNDeE4WckwSGylDj9s96+Pt5at6x29qeHbmmtoAeGUQpUiwObhhWqums8YiTWgclSWsohvmW3mZee5CavU6kta1N8US6EBouNy3uz14pRuhHPOAtQklEEaHSqXyMuPct6rpNXyoZ27BYlnsMf8zPBwyqPtNyud8kyoe1vnvfYUEbyhW6EQfNF2wvUfsxf+TveWfpp5mcIg3acKK+Jdwjav6YnCbaw8bv6i7aaCcyZ50KzosNJiBJgyRnWR03xlMBS0Tp1QIe1tpi9B1WDa4ER/hAdBeh5oU/dcyUil62s8o3m210AP6ruf9Ise5M/nxBF7ljCt1/V0g4YF5nWm/Yy5MAV6ndlW3KXoKGPSx91pnOe7kVn3hW8Gw2YPHiqxCvNfpOPkmjohPcQMn9075/l7wjr/SnS/Zx3kKGIxocZKxH5J8GTKQkrsVOSG++OpVZrqENKOgcDyiH5YwU6PQJVzc72vYWwxH1ppljwOU7RF47R1pgPWWndbDe1RCjhh5iWPJrPvEwiaLYQSBKWqajMeOPLDYwzPRdvoBccKAt3OtUqBmT76X3oZCuZHBcBaagpa49wnm6RSteVGdEHkQGm/bUVEwruse1ZNzeBfg+cuB1AHKLgOvObOy7ryaFVhfsiIkt5rmBjZGWbca3L3Fy56kZvVt3xB9T7oKDn33t4HRM0Do93vusAN9poipJlT0n2KO2a4IsMmBilXhWRGnrdfyAWN+42nUZQ94= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR11MB5801.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(346002)(136003)(376002)(396003)(366004)(39860400002)(5660300002)(64756008)(66446008)(30864003)(66556008)(66946007)(66476007)(8936002)(52536014)(2906002)(4326008)(8676002)(76116006)(55016003)(38100700002)(86362001)(33656002)(122000001)(38070700005)(82960400001)(478600001)(71200400001)(41300700001)(966005)(316002)(54906003)(110136005)(7696005)(186003)(83380400001)(53546011)(26005)(6506007)(107886003)(9686003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Xu9g/grVwiph8jv7spR0GyHlgl4FKgHRLfd6TNyQQZpYDOW+xtUvTrZxKnCr?= =?us-ascii?Q?imOxHMIGYNh8SlfyeMheLNermczWpn4u39pPK1XK71gcGATvJB8JF5201+iu?= =?us-ascii?Q?RLYMzVYB2n9mNbH3/dutRWCeEU9WD/z1/HmarV88ND5eYvEFVVsfr21rlxME?= =?us-ascii?Q?T/Z4Xk+b5ZExNsvKS4WPoqi8HytkM1vGGADFEk3rZkKgn6+TsUHV9GyrTZqT?= =?us-ascii?Q?i18hk8sF5jn9gFo4QljRqaKcYQeGMZxqqqxSOfNFTB7zgCIGhb5PRo/H91pR?= =?us-ascii?Q?Is0t2R1djONuGEAxzpHRPo2BDAfR7mFhyCsfu8NHgY1Rz83wHeV3WNgtJ/cZ?= =?us-ascii?Q?Vq18ex3uQsbthvVKfBKBmpIvuhOJmnlOCV9nbMAicruVsfvKmpXq2VeYWajK?= =?us-ascii?Q?BSA3fMrBQ+mQhdeeWgvOWV5X0ESngMQDosV+XRb/jLjyro4JhhclQ0QgUn3J?= =?us-ascii?Q?nGFOeJt21wxyLYyg2jePeiCnZs69J91wXeeq4ep8H1GS41o9sLH5Z8WFGl69?= =?us-ascii?Q?yi0uA63OQCXrBEwbwG1Skp6QPXkbRkFROW/KFuTmo0UcEA4jQith3s7DsSgo?= =?us-ascii?Q?sE8S0sUJKNzxVp8PeY1NpO8sl3xXo39x0bHXcmilMeCM924PcujlRSTmULAT?= =?us-ascii?Q?8M4Vsorx9l9Ye9qwf8le+RKaZKPWTCo9rewRCOiy50AXtnuTnoJH0ZHDN5IM?= =?us-ascii?Q?dG3SNCkQ00k7G0mXHwfdlCMjrVnRWnoRBC++IdyA2jIEIKORllV68bN759PY?= =?us-ascii?Q?cDqQy9lbRkNW18NEpRCQRtIybYxsEUF7mxKUzotVU9aAsAVoQ8W1n83O3ymx?= =?us-ascii?Q?up2EI+1pZT5w1XJZDHo7L64rrwR1qOQ3jBl8wKOlXnWvpzkbTogZbqWIunwf?= =?us-ascii?Q?0TTrLKeV1zEJuae2FgdRCOs4pwsX5w+G8kRhjHbjws64bSyKgM9qZDFvvdc5?= =?us-ascii?Q?LfgRTfPzLcid8Q2nQ2x89+3slbVGTid+GB1BKPCJxb5ns+1epP6A/UHkeON4?= =?us-ascii?Q?66krro8GNZJY7uymtBauyhyNzgVefRyGNyczBJoCzYnT0n4ONgMZUObqZHTr?= =?us-ascii?Q?Dlgf2qNSn29SUTfDyGY+/ACpiPCD3EHMJ/eDBFiSRF+N/FB4AgiqSEok+QdD?= =?us-ascii?Q?h2HWgSAbDpA7ZZSHKX1CAtDqC3+mQjEHBEkx8RAfEyD1vLDK3SuYjByWZkeJ?= =?us-ascii?Q?q+jHw7ePrkhB2wTu9qbhOISeEMZEJ7fUiFC2BXZqRTwymtWJ0MCKu24eb+80?= =?us-ascii?Q?oij9ZGqUN7+/kos15+4sxFmsH+JQVGAH7tRXdcw/Owh6kXcMe9fQu3Vas4QH?= =?us-ascii?Q?jRgqiOoZiZyeN4B4BV/4YVDXXWPKFM3fFVcMgHHJ3kuxT8zauZw9Dwjpzon4?= =?us-ascii?Q?W2XcOX4okzssczvaXbpVWs++KhIBuZzPNrmBTegPuULHBbbvJvZLoeaqocQD?= =?us-ascii?Q?5vekaxzZkmb93yTpozDjMGWsfFXBW+bd2Of9vg/aCJaJuEfLiOygiV1A2eeb?= =?us-ascii?Q?Yd/c7BVANr7BGs06RPmwYH97fQLY3hRsabSpYxifqtAlW10+KWUCrfCVYt4c?= =?us-ascii?Q?qvE+8pfVrg2Zc1gFjEKUrGSirBau+8jPoQlH630L?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA1PR11MB5801.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 196eea95-9708-4da1-d39a-08da5b904fc7 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Jul 2022 18:34:19.7635 (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: /8Sjwjjx5JYmBkrwKlz698RS6fFQjJUfM8yWssxMOGMkiS2Qo4wQPsxO0gikil1sninvq0ai4aXaHxLNEiED5g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5593 Return-Path: isaac.w.oram@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Isaac W Oram -----Original Message----- From: Lin, Jason1 =20 Sent: Friday, July 1, 2022 8:10 AM To: devel@edk2.groups.io Cc: Lin, Jason1 ; Feng, Bob C ;= Gao, Liming ; Chen, Christine ; Oram, Isaac W ; Chaganty, Rangasai V ; Chiang, Dakota Subject: [PATCH v3 3/3] [edk2-platforms] Silicon/Intel/FitGen: Support Star= tup ACM entries (Type 2) 0x200 Version From: Jason1 Lin REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3959 As per FIT BIOS Specification 1.2 Rules, the size bytes (3 bytes) / reserve= d byte (1 byte) / CheckSum byte (1 byte) in type 2 are must-be-zero (MBZ). These bytes could be override for the other usages. This change is used to support the Type 02 (ACM) Ver. 0x200. Command: [-S |] [-I ] [-V ] Signed-off-by: Jason1 Lin Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Cc: Isaac W Oram Cc: Rangasai V Chaganty Cc: Dakota Chiang --- Silicon/Intel/Tools/FitGen/FitGen.c | 183 ++++++++++++++++++-- Silicon/Intel/Tools/FitGen/FitGen.h | 2 +- 2 files changed, 165 insertions(+), 20 deletions(-) diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c b/Silicon/Intel/Tools/FitG= en/FitGen.c index 01b4f82518..577ce48b10 100644 --- a/Silicon/Intel/Tools/FitGen/FitGen.c +++ b/Silicon/Intel/Tools/FitGen/FitGen.c @@ -55,6 +55,7 @@ typedef struct { #define ACM_MODULE_FLAG_PREPRODUCTION 0x4000 #define ACM= _MODULE_FLAG_DEBUG_SIGN 0x8000 +#define NIBBLES_TO_BYT= E(A, B) (UINT8)(((A & (0x0F)) << 4) | (B & 0x0F)) typedef struct { UINT= 16 ModuleType;@@ -149,6 +150,20 @@ typedef struct { ACM_PROCESSOR_ID ProcessorID[1]; } PROCESSOR_ID_LIST; +typedef union {+ = struct {+ UINT32 Stepping : 4;+ UINT32 Model : 4;+ = UINT32 Family : 4;+ UINT32 Type : 2;+ UINT32 Rese= rved1 : 2;+ UINT32 ExtendedModel : 4;+ UINT32 ExtendedFamily: 8= ;+ UINT32 Reserved2 : 4;+ } Bits;+ UINT32 Uint32;+} PROCESSOR_ID= ;+ #pragma pack () @@ -210,6 +225,7 @@ typedef struct { #define DEFAULT_FIT_TABLE_POINTER_OFFSET 0x40 #define DEFAULT_FIT_ENTRY_= VERSION 0x0100+#define STARTUP_ACM_FIT_ENTRY_200_VERSION 0x0200 #d= efine TOP_FLASH_ADDRESS (gFitTableContext.TopFlashAddressRemapValue) @@ -2= 47,6 +263,8 @@ typedef struct { UINT8 *Buffer; // Used by OptionalModule only UINT32 Size; UINT32= Version; // Used by OptionalModule and PortModule only+ UINT32 FMS; = // Used by Entry Type 02 (ACM) Ver. 0x200 only+ UINT32 FMSMask; // Used = by Entry Type 02 (ACM) Ver. 0x200 only } FIT_TABLE_CONTEXT_ENTRY; typedef = struct {@@ -262,7 +280,7 @@ typedef struct { UINT32 GlobalVersion; UINT32 F= itHeaderVersion; FIT_TABLE_CONTEXT_ENTRY StartupAcm[MAX_STARTUP_ACM_EN= TRY];- UINT32 StartupAcmVersion;+ UINT32 = StartupAcmVersion[MAX_STARTUP_ACM_ENTRY]; FIT_TABLE_CONTEXT_ENTRY= DiagnstAcm; UINT32 DiagnstAcmVersion; FIT_TABLE= _CONTEXT_ENTRY BiosModule[MAX_BIOS_MODULE_ENTRY];@@ -341,7 +359,7 @@ Ret= urns: "\t[-L ]\n" "\t[= -LF ]\n" "\t[-I ]\n"- "= \t[-S |] [-V ]\n"+ "\t[-S |] [-I ] [-V ]\n" = "\t[-U |]\n" "\t[-B <= BiosModuleAddress BiosModuleSize>] [-B ...] [-V ]\n" = "\t[-M ] [-M ...]|[-U ||] = [-V ]\n"@@ -356,8 +374,11 @@ Returns: printf ("\tFitTablePointerOffset - FIT table pointer offset. 0x%x as de= fault. 0x18 for current soon to be obsoleted CPUs. User can set both.\n", D= EFAULT_FIT_TABLE_POINTER_OFFSET); printf ("\tBiosInfoGuid - Gui= d of BiosInfo Module. If this module exists, StartupAcm/Bios/Microcode can = be optional.\n"); printf ("\tStartupAcmAddress - Address of StartupA= cm.\n");- printf ("\tStartupAcmSize - Size of StartupAcm.\n");+ p= rintf ("\tStartupAcmSize - The maximum size value that could place = the StartupAcm in.\n"); printf ("\tStartupAcmGuid - Guid of Start= upAcm Module, if StartupAcm is in a BiosModule, it will be excluded form th= at.\n");+ printf ("\tStartupAcmFMS - Value of PROCESSOR ID (Famil= y/Model/Stepping value called \"FMS\") - see detail on FIT spec (1.3).\n");= + printf ("\tStartupAcmFMSMask - Value use for uCode (if it recognize= s 0x200 Type2 entry) to do bitmask logic operation with CPU processor ID.\n= ");+ printf ("\t If the result match to StartupAcm= FMS, corresponding ACM will be loaded - see detail on FIT spec (1.3).\n"); = printf ("\tDiagnstAcmAddress - Address of DiagnstAcm.\n"); printf = ("\tDiagnstAcmGuid - Guid of DiagnstAcm Module, if DiagnstAcm is in= a BiosModule, it will be excluded from that.\n"); printf ("\tBiosModuleA= ddress - Address of BiosModule. User should ensure there is no overlap= .\n");@@ -1155,6 +1176,9 @@ Returns: Error (NULL, 0, 0, "-I Parameter incorrect, too many StartupAc= m!", NULL); return 0; }+ //+ // NOT= E: BIOS INFO structure only support the default FIT entry format.+ = // gFitTableContext.StartupAcm[gFitTableContext.StartupAcmNumber= ].Type =3D FIT_TABLE_TYPE_STARTUP_ACM; gFitTableContext.Startu= pAcm[gFitTableContext.StartupAcmNumber].Address =3D (UINT32)BiosInfoStruct[= BiosInfoIndex].Address; gFitTableContext.StartupAcm[gFitTableCont= ext.StartupAcmNumber].Size =3D (UINT32)BiosInfoStruct[BiosInfoIndex].Siz= e;@@ -1392,7 +1416,37 @@ Returns: gFitTableContext.StartupAcm[gFitTableContext.StartupAcmNumber].Size = =3D FileSize; //- // 1.1 StartupAcm version+ // 1.1 Support 0x20= 0 StartupAcm Information+ // With the -I parameter should assign the= type 2 entry with 0x200 version format+ //+ if ((Index + 1 >=3D argc= ) ||+ ((strcmp (argv[Index], "-I") !=3D 0) &&+ (strcmp (argv= [Index], "-i") !=3D 0)) ) {+ //+ // Bypass+ //+ gFitTab= leContext.StartupAcmVersion[gFitTableContext.StartupAcmNumber] =3D gFitTabl= eContext.GlobalVersion;+ } else {+ if (Index + 2 >=3D argc) {+ = //+ // Should get two input value, but not sufficient+ //+= Error (NULL, 0, 0, "-I Parameter incorrect, Require two inputs valu= e!", NULL);+ return 0;+ } else {+ //+ // With the= -I parameter should assign the type 2 entry version as 0x200 format+ = //+ gFitTableContext.StartupAcmVersion[gFitTableContext.StartupAcm= Number] =3D STARTUP_ACM_FIT_ENTRY_200_VERSION;+ gFitTableContext.Sta= rtupAcm[gFitTableContext.StartupAcmNumber].FMS =3D (UINT32)xtoi (argv[Index= + 1]);+ gFitTableContext.StartupAcm[gFitTableContext.StartupAcmNumb= er].FMSMask =3D (UINT32)xtoi (argv[Index + 2]);++ Index +=3D 3;+ = }+ }++ //+ // 1.2 StartupAcm version // if ((Index + 1 >= =3D argc) || ((strcmp (argv[Index], "-V") !=3D 0) &&@@ -1400,18 +14= 54,17 @@ Returns: // // Bypass //- gFitTableContext.StartupAcmVersion= =3D gFitTableContext.GlobalVersion; } else { // // Get off= set from parameter //- gFitTableContext.StartupAcmVersion =3D xt= oi (argv[Index + 1]);+ gFitTableContext.StartupAcmVersion[gFitTableCon= text.StartupAcmNumber] =3D xtoi (argv[Index + 1]); Index +=3D 2; = } gFitTableContext.StartupAcmNumber ++; gFitTableContext.FitEntryN= umber ++;- }+ }; // // 1.5. DiagnosticsAcm@@ -2185,7 +2238,7 @@ Retu= rns: printf ("Total FIT Entry number: 0x%x\n", gFitTableContext.FitEntryNumbe= r); printf ("FitHeader version: 0x%04x\n", gFitTableContext.FitHeaderVers= ion); for (Index =3D 0; Index < gFitTableContext.StartupAcmNumber; Index+= +) {- printf ("StartupAcm[%d] - (0x%08x, 0x%08x, 0x%04x)\n", Index, gFit= TableContext.StartupAcm[Index].Address, gFitTableContext.StartupAcm[Index].= Size, gFitTableContext.StartupAcmVersion);+ printf ("StartupAcm[%d] - (0= x%08x, 0x%08x, 0x%04x)\n", Index, gFitTableContext.StartupAcm[Index].Addres= s, gFitTableContext.StartupAcm[Index].Size, gFitTableContext.StartupAcmVers= ion[Index]); } if (gFitTableContext.DiagnstAcm.Address !=3D 0) { pr= intf ("DiagnosticAcm - (0x%08x, 0x%08x, 0x%04x)\n", gFitTableContext.Diagns= tAcm.Address, gFitTableContext.DiagnstAcm.Size, gFitTableContext.DiagnstAcm= Version);@@ -2774,6 +2827,8 @@ Returns: UINTN SubIndex; FIT_TABLE_CONTEXT_ENTRY = TempContextEntry; FIRMWARE_INTERFACE_TABLE_ENTRY TempTableEntry;+ P= ROCESSOR_ID FMS;+ PROCESSOR_ID FMSMa= sk; // // 1. FitPointer@@ -2825,16 +2880,30 @@ Returns: // 4. StartupAcm // for (Index =3D 0; Index < gFitTableContext.Start= upAcmNumber; Index++) {- FitEntrySizeValue =3D 0; // gFitTable= Context.StartupAcm.Size / 16- FitEntry[FitIndex].Address =3D gFitTableC= ontext.StartupAcm[Index].Address;- FitEntry[FitIndex].Size[0] =3D (UINT= 8)FitEntrySizeValue;- FitEntry[FitIndex].Size[1] =3D (UINT8)(FitEntrySi= zeValue >> 8);- FitEntry[FitIndex].Size[2] =3D (UINT8)(FitEntrySizeValu= e >> 16);- FitEntry[FitIndex].Rsvd =3D 0;- FitEntry[FitIndex].Ver= sion =3D (UINT16)gFitTableContext.StartupAcmVersion;- FitEntry[FitIndex= ].Type =3D FIT_TABLE_TYPE_STARTUP_ACM;- FitEntry[FitIndex].C_V = =3D 0;- FitEntry[FitIndex].Checksum =3D 0;+ if (gFitTableContext.Star= tupAcmVersion[Index] =3D=3D STARTUP_ACM_FIT_ENTRY_200_VERSION) {+ FMS.= Uint32 =3D gFitTableContext.StartupAcm[Index].FMS;+ FMSMask.Uint32 =3D= gFitTableContext.StartupAcm[Index].FMSMask;+ FitEntry[FitIndex].Addre= ss =3D gFitTableContext.StartupAcm[Index].Address;+ FitEntry[FitIndex= ].Size[0] =3D NIBBLES_TO_BYTE (FMS.Bits.Family, FMS.Bits.Model);+ Fit= Entry[FitIndex].Size[1] =3D NIBBLES_TO_BYTE (FMS.Bits.ExtendedModel, FMS.B= its.Type);+ FitEntry[FitIndex].Size[2] =3D NIBBLES_TO_BYTE (FMSMask.B= its.Family, FMSMask.Bits.Model);+ FitEntry[FitIndex].Rsvd =3D NIBB= LES_TO_BYTE (FMSMask.Bits.ExtendedModel, FMSMask.Bits.Type);+ FitEntry= [FitIndex].Version =3D (UINT16)gFitTableContext.StartupAcmVersion[Index];+= FitEntry[FitIndex].Type =3D FIT_TABLE_TYPE_STARTUP_ACM;+ Fit= Entry[FitIndex].C_V =3D 0;+ FitEntry[FitIndex].Checksum =3D NIBBL= ES_TO_BYTE (FMSMask.Bits.ExtendedFamily, FMS.Bits.ExtendedFamily);+ } el= se {+ FitEntrySizeValue =3D 0; // gFitTableContext.StartupAc= m.Size / 16+ FitEntry[FitIndex].Address =3D gFitTableContext.StartupA= cm[Index].Address;+ FitEntry[FitIndex].Size[0] =3D (UINT8)FitEntrySiz= eValue;+ FitEntry[FitIndex].Size[1] =3D (UINT8)(FitEntrySizeValue >> = 8);+ FitEntry[FitIndex].Size[2] =3D (UINT8)(FitEntrySizeValue >> 16);= + FitEntry[FitIndex].Rsvd =3D 0;+ FitEntry[FitIndex].Version = =3D (UINT16)gFitTableContext.StartupAcmVersion[Index];+ FitEntry[FitI= ndex].Type =3D FIT_TABLE_TYPE_STARTUP_ACM;+ FitEntry[FitIndex].C_V= =3D 0;+ FitEntry[FitIndex].Checksum =3D 0;+ } FitIndex++;= } @@ -3135,6 +3204,69 @@ Returns: return FvRecoveryFileSize; } +void+GetFMSFromFitEntry (+ IN FIRMWA= RE_INTERFACE_TABLE_ENTRY FitEntry,+ IN OUT PROCESSOR_ID = *FMS,+ IN OUT PROCESSOR_ID *FMSMask+ )+/*++++Ro= utine Description:++ Get FMS information from FIT Entry.++ Note: Since FI= T entry not record all the processor ID information.+ The value woul= d not the same as the real value.++ +----------+-----------------------+--= ---------------------+-----------------------+-----------------------++ | = Byte | 15 | 14 | 13:12 = | 11 |+ +----------+-----------------------+-----= ------------------+-----------------------+-----------------------++ |Bit = Fields| [7:4] | [3:0] | [7:7] | [6:0] | [7:4] | [3:0]= | [7:4] | [3:0] |+ +----------+-----------------------+--------= ---------------+-----------------------+-----------------------++ | Ver. 1= 00 | Checksum | C_V | Type | Version = | Reserved |+ +----------+-----------------------+-----------= ------------+-----------------------+-----------------------++ | Ver. 200 = | FMSMask | FMS | C_V | Type | Version | = FMSMask | FMSMask |+ | | ExtFamily | ExtFamily | | = | | ExtModel | Type |+ +----------+--= ---------------------+-----------------------+-----------------------+-----= ------------------+++ +----------+-----------------------+----------------= -------+-----------------------+-----------------------++ | Byte | = 10 | 9 | 8 | = 7:0 |+ +----------+-----------------------+-------------------= ----+-----------------------+-----------------------++ |Bit Fields| [7:4= ] | [3:0] | [7:4] | [3:0] | [7:4] | [3:0] | [7:4] = | [3:0] |+ +----------+-----------------------+----------------------= -+-----------------------+-----------------------++ | Ver. 100 | Si= ze[2] | Size[1] | Size[0] | Addre= ss |+ +----------+-----------------------+-----------------------+-= ----------------------+-----------------------++ | Ver. 200 | FMSMask | = FMSMask | FMS | FMS | FMS | FMS | Address = |+ | | Family | Model | ExtModel | Type | F= amily | Model | |+ +----------+----------------= -------+-----------------------+-----------------------+-------------------= ----++++Arguments:++ FitEntry - FIT entry information.+ FMS - Proces= sor ID information.+ FMSMask - Processor ID mask information.++Returns:+ = None++--*/+{++ FMS->Bits.Family =3D (FitEntry.Size[0] & 0xF0) >>= 4;+ FMS->Bits.Model =3D (FitEntry.Size[0] & 0x0F);+ FMS->Bits.= ExtendedModel =3D (FitEntry.Size[1] & 0xF0) >> 4;+ FMS->Bits.Type = =3D (FitEntry.Size[1] & 0x0F);+ FMS->Bits.ExtendedFamily =3D (FitEntr= y.Checksum & 0x0F);++ FMSMask->Bits.Family =3D (FitEntry.Size[2] = & 0xF0) >> 4;+ FMSMask->Bits.Model =3D (FitEntry.Size[2] & 0x0F)= ;+ FMSMask->Bits.ExtendedModel =3D (FitEntry.Rsvd & 0xF0) >> 4;+ FMS= Mask->Bits.Type =3D (FitEntry.Rsvd & 0x0F);+ FMSMask->Bits.E= xtendedFamily =3D (FitEntry.Checksum & 0xF0) >> 4;+}+ UINT32 GetFitEntryInf= o ( IN UINT8 *FvBuffer,@@ -3161,6 +3293,11 @@ Returns: UINT32 FitEntrySizeValue; UINT32 = FitIndex; UINT32 FitTableOffset;+ = PROCESSOR_ID FMS;+ PROCESSOR_ID FMSM= ask;++ FMS.Uint32 =3D 0;+ FMSMask.Uint32 =3D 0; // // 1. FitPoin= ter@@ -3202,7 +3339,15 @@ Returns: break; case FIT_TABLE_TYPE_STARTUP_ACM: gFitTableContext.S= tartupAcm[gFitTableContext.StartupAcmNumber].Address =3D (UINT32)FitEntry[F= itIndex].Address;- gFitTableContext.StartupAcmVersion = =3D FitEntry[FitIndex].Version;+ gFitTableContext.= StartupAcm[gFitTableContext.StartupAcmNumber].Size =3D FitEntrySizeValue= ;+ gFitTableContext.StartupAcm[gFitTableContext.StartupAcmNumber].Type= =3D FitEntry[FitIndex].Type;+ gFitTableContext.StartupAcmVersion[g= FitTableContext.StartupAcmNumber] =3D FitEntry[FitIndex].Version;+ if= (gFitTableContext.StartupAcmVersion[gFitTableContext.StartupAcmNumber] =3D= =3D STARTUP_ACM_FIT_ENTRY_200_VERSION) {+ GetFMSFromFitEntry (FitEnt= ry[FitIndex], &FMS, &FMSMask);+ gFitTableContext.StartupAcm[gFitTabl= eContext.StartupAcmNumber].FMS =3D FMS.Uint32;+ gFitTableContext= .StartupAcm[gFitTableContext.StartupAcmNumber].FMSMask =3D FMSMask.Uint32;+= }+ gFitTableContext.StartupAcmNumber++; break; case FI= T_TABLE_TYPE_BIOS_MODULE: gFitTableContext.BiosModule[gFitTableContex= t.BiosModuleNumber].Address =3D (UINT32)FitEntry[FitIndex].Address;diff --g= it a/Silicon/Intel/Tools/FitGen/FitGen.h b/Silicon/Intel/Tools/FitGen/FitGe= n.h index b7de0a6b2d..80a1423ceb 100644 --- a/Silicon/Intel/Tools/FitGen/FitGen.h +++ b/Silicon/Intel/Tools/FitGen/FitGen.h @@ -31,7 +31,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent // Utility version information // #define UTILITY_MAJOR_VERSION 0-#define = UTILITY_MINOR_VERSION 65+#define UTILITY_MINOR_VERSION 66 #define UTILITY_D= ATE __DATE__ //--=20 2.37.0.windows.1