- 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 <michael.d.kin...@intel.com>
Cc: Liming Gao <liming....@intel.com>
Cc: Yonghong Zhu <yonghong....@intel.com>

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

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to