[edk2] [RFC 0/2] PCD: Extended SKU support 2 - sub SKU

Star Zeng posted 2 patches 6 years, 12 months ago
Failed in applying to current master (apply log)
Nt32Pkg/Nt32Pkg.dec |  9 +++++++++
Nt32Pkg/Nt32Pkg.dsc | 41 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 50 insertions(+)
[edk2] [RFC 0/2] PCD: Extended SKU support 2 - sub SKU
Posted by Star Zeng 6 years, 12 months ago
- 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.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@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
Re: [edk2] [RFC 0/2] PCD: Extended SKU support 2 - sub SKU
Posted by Zeng, Star 6 years, 11 months ago
Hi,

The development will be done on a staging branch if there is no any comments in the following week.
Anyway, feedback still can be provided during the development on the staging branch and merging to master finally. :)


Thanks,
Star
-----Original Message-----
From: Zeng, Star 
Sent: Tuesday, April 25, 2017 8:48 PM
To: edk2-devel@lists.01.org
Cc: Zeng, Star <star.zeng@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming <liming.gao@intel.com>; Zhu, Yonghong <yonghong.zhu@intel.com>
Subject: [RFC 0/2] PCD: Extended SKU support 2 - sub SKU

- 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.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@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