From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 63C1D21954092 for ; Tue, 25 Apr 2017 05:48:24 -0700 (PDT) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP; 25 Apr 2017 05:48:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,249,1488873600"; d="scan'208";a="91931474" Received: from shwdeopenpsi068.ccr.corp.intel.com ([10.239.9.20]) by orsmga005.jf.intel.com with ESMTP; 25 Apr 2017 05:48:22 -0700 From: Star Zeng To: edk2-devel@lists.01.org Cc: Star Zeng , Michael Kinney , Liming Gao , Yonghong Zhu Date: Tue, 25 Apr 2017 20:48:18 +0800 Message-Id: <1493124500-19000-1-git-send-email-star.zeng@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 MIME-Version: 1.0 Subject: [RFC 0/2] PCD: Extended SKU support 2 - sub SKU X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Apr 2017 12:48:24 -0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Requirement Simplify the PCDs configuring for multiple SKUs in DSC. - Current limitation There is no sub SKU support for now. The PCD statements for different platform components need to be centralized for different SKUs, and the relationship between different SKUs is hard to build, then it is also hard to maintain the PCD values(configuring new PCD value or updating PCD value) for different SKUs. - Proposal: Support sub SKU set and combinations of them. This proposal depends on the proposal “PCD: Extended SKU support 1 - inheritance” at https://lists.01.org/pipermail/edk2-devel/2017-April/010194.html. This proposal only extends DSC [SkuIds] section syntax. BaseTools update is needed to support the syntax extension, and no any change in PCD database and driver is required. DSC syntax: [SkuIds] SubSkuSetName|SubSkuName[|ParentSubSkuName] SubSkuSetName: string or 0, 0 is reserved for DEFAULT SKU, string means it is sub SKU set name. SubSkuName: string ParentSubSkuName: string, optional, defines which sub SKU the PCD value will derive from for this sub SKU. The PCD value will derive from DEFAULT SKU for this sub SKU if ParentSubSkuName is absent. There could be multiple SubSku entries with different SubSkuSetName. There could be multiple SubSku entries with same SubSkuSetName and different SubSkuName. ComboName | (SubSkuSetName1 or SubSkuName1, SubSkuSetName2 or SubSkuName2, ...) There could be multiple Combo entries for different boards. SKUID_IDENTIFIER in [Defines] section could be DEFAULT, ALL, or combo name if sub SKU and Combo are specified in [Skuids] section. PcdLib.h: // Retrieves sub SKU value based on Combo name and sub SKU name. // This definition is for platform PEIM to easily get the hidden sub SKU values in the Combo. // BaseTools can make sure the unique of platform SKU value that can be calculated by adding up sub SKU values in the Combo. #define PcdSubSkuValueInCombo (ComboName, SubSkuName) _PCD_SUB_SKU_##ComboName_##SubSkuName AutoGen.h: Macros for _PCD_SUB_SKU_##ComboName_##SubSkuName will be generated in AutoGen.h based on the statements in [SkuIds] section of dsc. - Example: Without sub SKU support: Check the example at [RFC 1/2] Example: The PCDs configuring for multiple SKUs with current SKU usage With sub SKU support: Check the example at [RFC 2/2] Example: The PCDs configuring for multiple SKUs with sub SKU support Pseudo-code for platform to set SKU with sub SKU support: Note: The Combo and CPU/CS/FRU identifying should be hardware detection. UINTN CpuSkuV; UINTN CsSkuV; UINTN FruSkuV; UINTN PlatformSku; if (Combo1) { if (CpuA) { CpuSkuV = PcdSubSkuValueInCombo(Combo1, CpuSkuA); } else if (CpuB) { CpuSkuV = PcdSubSkuValueInCombo(Combo1, CpuSkuB); } // Similar logic to get CsSkuV and FruSkuV. // Calculate the platform SKU. PlatformSku = CpuSkuV + CsSkuV + FruSkuV } else … LibPcdSetSku (PlatformSku); Cc: Michael Kinney Cc: Liming Gao Cc: Yonghong Zhu Star Zeng (2): Example: The PCDs configuring for multiple SKUs with current SKU usage Example: The PCDs configuring for multiple SKUs with sub SKU support Nt32Pkg/Nt32Pkg.dec | 9 +++++++++ Nt32Pkg/Nt32Pkg.dsc | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) -- 2.7.0.windows.1