IntelFsp2(Wrapper)Pkg: Revert from e8208100 to 737f812b
authorChasel, Chiu <chasel.chiu@intel.com>
Fri, 28 Sep 2018 02:31:37 +0000 (10:31 +0800)
committerChasel, Chiu <chasel.chiu@intel.com>
Fri, 28 Sep 2018 02:50:43 +0000 (10:50 +0800)
Commit formats had issues so reverted 9 commits
from IntelFsp2Pkg and IntelFsp2WrapperPkg.
Will re-submit them with correct formats.

Cc: Jiewen Yao <Jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf
IntelFsp2Pkg/FspSecCore/FspSecCoreS.inf
IntelFsp2Pkg/FspSecCore/FspSecCoreT.inf
IntelFsp2Pkg/Library/BaseFspCommonLib/BaseFspCommonLib.inf
IntelFsp2Pkg/Library/BaseFspPlatformLib/BaseFspPlatformLib.inf
IntelFsp2Pkg/Library/BaseFspSwitchStackLib/BaseFspSwitchStackLib.inf
IntelFsp2Pkg/Tools/GenCfgOpt.py
IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/BaseFspWrapperPlatformLibSample.inf

index c657862..0500a19 100644 (file)
   FspSecPlatformLib\r
 \r
 [Pcd]\r
+  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress           ## UNDEFINED\r
+  gIntelFsp2PkgTokenSpaceGuid.PcdGlobalDataPointerAddress      ## CONSUMES\r
   gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase              ## CONSUMES\r
   gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize              ## CONSUMES\r
   gIntelFsp2PkgTokenSpaceGuid.PcdFspTemporaryRamSize           ## CONSUMES\r
   gIntelFsp2PkgTokenSpaceGuid.PcdFspHeapSizePercentage         ## CONSUMES\r
 \r
+[FixedPcd]\r
+  gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPatchEntry              ## CONSUMES\r
+  gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPerfEntry               ## CONSUMES\r
+\r
 [Ppis]\r
   gEfiTemporaryRamSupportPpiGuid                              ## PRODUCES\r
 \r
index dd3f8e5..a3563dd 100644 (file)
   FspCommonLib\r
   FspSecPlatformLib\r
 \r
+[Pcd]\r
+  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress           ## UNDEFINED\r
+  gIntelFsp2PkgTokenSpaceGuid.PcdGlobalDataPointerAddress      ## CONSUMES\r
+  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase              ## CONSUMES\r
+  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize              ## CONSUMES\r
+  gIntelFsp2PkgTokenSpaceGuid.PcdFspTemporaryRamSize           ## CONSUMES\r
+\r
+[FixedPcd]\r
+  gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPatchEntry              ## CONSUMES\r
+  gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPerfEntry               ## CONSUMES\r
+\r
 [Ppis]\r
   gEfiTemporaryRamSupportPpiGuid                              ## PRODUCES\r
 \r
index aff4b23..cf6a191 100644 (file)
   FspSecPlatformLib\r
 \r
 [Pcd]\r
+  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress           ## UNDEFINED\r
   gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase              ## CONSUMES\r
   gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize              ## CONSUMES\r
   gIntelFsp2PkgTokenSpaceGuid.PcdFspReservedBufferSize         ## CONSUMES\r
 \r
+[FixedPcd]\r
+  gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPatchEntry              ## CONSUMES\r
+  gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPerfEntry               ## CONSUMES\r
+\r
 [Ppis]\r
   gEfiTemporaryRamSupportPpiGuid                              ## PRODUCES\r
index ff82f80..c9d9835 100644 (file)
@@ -33,3 +33,8 @@
 [Pcd]\r
   gIntelFsp2PkgTokenSpaceGuid.PcdGlobalDataPointerAddress      ## CONSUMES\r
 \r
+[FixedPcd]\r
+  gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPatchEntry              ## CONSUMES\r
+  gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPerfEntry               ## CONSUMES\r
+  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase              ## CONSUMES\r
+  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize              ## CONSUMES\r
index b9e8a61..907482d 100644 (file)
   PerformanceLib\r
   ReportStatusCodeLib\r
 \r
+[Pcd]\r
+  gIntelFsp2PkgTokenSpaceGuid.PcdGlobalDataPointerAddress    ## CONSUMES\r
+  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase            ## CONSUMES\r
+  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize            ## CONSUMES\r
+  gIntelFsp2PkgTokenSpaceGuid.PcdFspTemporaryRamSize         ## CONSUMES\r
+\r
 [Guids]\r
   gFspPerformanceDataGuid                                   ## CONSUMES ## GUID\r
   gFspEventEndOfFirmwareGuid                                ## PRODUCES ## GUID\r
@@ -43,3 +49,6 @@
 [Protocols]\r
   gEfiPciEnumerationCompleteProtocolGuid                    ## CONSUMES\r
 \r
+[FixedPcd]\r
+  gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPatchEntry        ## CONSUMES\r
+  gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPerfEntry         ## CONSUMES\r
index 97cf3ca..b3c673a 100644 (file)
@@ -34,5 +34,9 @@
   BaseLib\r
   IoLib\r
 \r
+[FixedPcd]\r
+  gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPatchEntry      ## CONSUMES\r
+  gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPerfEntry       ## CONSUMES\r
+\r
 \r
 \r
index 059cfcb..c9b7bc5 100644 (file)
@@ -1,6 +1,6 @@
 ## @ GenCfgOpt.py\r
 #\r
-# Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials are licensed and made available under\r
 # the terms and conditions of the BSD License that accompanies this distribution.\r
 # The full text of the license may be found at\r
@@ -418,8 +418,6 @@ EndList
         return ""\r
 \r
     def ParseDscFile (self, DscFile, FvDir):\r
-        Hardcode = False\r
-        AutoAlign = False\r
         self._CfgItemList = []\r
         self._CfgPageDict = {}\r
         self._CfgBlkDict  = {}\r
@@ -440,8 +438,6 @@ EndList
         DscLines     = DscFd.readlines()\r
         DscFd.close()\r
 \r
-        MaxAlign = 32   #Default align to 32, but if there are 64 bit unit, align to 64\r
-        SizeAlign = 0   #record the struct max align\r
         while len(DscLines):\r
             DscLine  = DscLines.pop(0).strip()\r
             Handle   = False\r
@@ -453,7 +449,7 @@ EndList
                 IsUpdSect = False\r
                 if  Match.group(1).lower() == "Defines".lower():\r
                     IsDefSect = True\r
-                if  (Match.group(1).lower() == "PcdsFeatureFlag".lower() or Match.group(1).lower() == "PcdsFixedAtBuild".lower()):\r
+                if  Match.group(1).lower() == "PcdsFeatureFlag".lower():\r
                     IsPcdSect = True\r
                 elif Match.group(1).lower() == "PcdsDynamicVpd.Upd".lower():\r
                     ConfigDict = {}\r
@@ -468,7 +464,6 @@ EndList
                     ConfigDict['comment'] = ''\r
                     ConfigDict['subreg']  = []\r
                     IsUpdSect = True\r
-                    Offset    = 0\r
             else:\r
                 if IsDefSect or IsPcdSect or IsUpdSect or IsVpdSect:\r
                     if re.match("^!else($|\s+#.+)", DscLine):\r
@@ -496,7 +491,7 @@ EndList
                             IfStack.append(Result)\r
                             ElifStack.append(0)\r
                         else:\r
-                            Match  = re.match("!(if|elseif)\s+(.+)", DscLine.split("#")[0])\r
+                            Match  = re.match("!(if|elseif)\s+(.+)", DscLine)\r
                             if Match:\r
                                 Result = self.EvaluateExpress(Match.group(2))\r
                                 if Match.group(1) == "if":\r
@@ -535,7 +530,6 @@ EndList
                                         NewDscLines = IncludeDsc.readlines()\r
                                         IncludeDsc.close()\r
                                         DscLines = NewDscLines + DscLines\r
-                                        Offset = 0\r
                                     else:\r
                                         if DscLine.startswith('!'):\r
                                             print("ERROR: Unrecoginized directive for line '%s'" % DscLine)\r
@@ -626,22 +620,13 @@ EndList
 \r
                 # Check VPD/UPD\r
                 if IsUpdSect:\r
-                    Match = re.match("^([_a-zA-Z0-9]+).([_a-zA-Z0-9]+)\s*\|\s*(0x[0-9A-F]+|\*)\s*\|\s*(\d+|0x[0-9a-fA-F]+)\s*\|\s*(.+)",DscLine)\r
+                    Match = re.match("^([_a-zA-Z0-9]+).([_a-zA-Z0-9]+)\s*\|\s*(0x[0-9A-F]+)\s*\|\s*(\d+|0x[0-9a-fA-F]+)\s*\|\s*(.+)",DscLine)\r
                 else:\r
                     Match = re.match("^([_a-zA-Z0-9]+).([_a-zA-Z0-9]+)\s*\|\s*(0x[0-9A-F]+)(?:\s*\|\s*(.+))?",  DscLine)\r
                 if Match:\r
                     ConfigDict['space']  = Match.group(1)\r
                     ConfigDict['cname']  = Match.group(2)\r
-                    if Match.group(3) != '*':\r
-                        Hardcode = True\r
-                        Offset =  int (Match.group(3), 16)\r
-                    else:\r
-                        AutoAlign = True\r
-\r
-                    if Hardcode and AutoAlign:\r
-                        print("Hardcode and auto-align mixed mode is not supported by GenCfgOpt")\r
-                        raise SystemExit\r
-                    ConfigDict['offset'] = Offset\r
+                    ConfigDict['offset'] = int (Match.group(3), 16)\r
                     if ConfigDict['order'] == -1:\r
                         ConfigDict['order'] = ConfigDict['offset'] << 8\r
                     else:\r
@@ -653,7 +638,6 @@ EndList
                             Length  = int (Match.group(4), 16)\r
                         else :\r
                             Length  = int (Match.group(4))\r
-                        Offset += Length\r
                     else:\r
                         Value = Match.group(4)\r
                         if Value is None:\r
@@ -681,52 +665,6 @@ EndList
                         ConfigDict['help']   = ''\r
                         ConfigDict['type']   = ''\r
                         ConfigDict['option'] = ''\r
-                    if IsUpdSect and AutoAlign:\r
-                        ItemLength = int(ConfigDict['length'])\r
-                        ItemOffset = int(ConfigDict['offset'])\r
-                        ItemStruct = ConfigDict['struct']\r
-                        Unit = 1\r
-                        if ItemLength in [1, 2, 4, 8] and not ConfigDict['value'].startswith('{'):\r
-                            Unit = ItemLength\r
-                            # If there are 64 bit unit, align to 64\r
-                            if Unit == 8:\r
-                                MaxAlign = 64\r
-                                SizeAlign = 8\r
-                        if ItemStruct != '':\r
-                            UnitDict = {'UINT8':1, 'UINT16':2, 'UINT32':4, 'UINT64':8}\r
-                            if ItemStruct in ['UINT8', 'UINT16', 'UINT32', 'UINT64']:\r
-                                Unit = UnitDict[ItemStruct]\r
-                                # If there are 64 bit unit, align to 64\r
-                                if Unit == 8:\r
-                                    MaxAlign = 64\r
-                                SizeAlign = max(SizeAlign, Unit)\r
-                        if (ConfigDict['embed'].find(':START') != -1):\r
-                            Base = ItemOffset\r
-                        SubOffset = ItemOffset - Base\r
-                        SubRemainder = SubOffset % Unit\r
-                        if SubRemainder:\r
-                            Diff = Unit - SubRemainder\r
-                            Offset = Offset + Diff\r
-                            ItemOffset = ItemOffset + Diff\r
-\r
-                        if (ConfigDict['embed'].find(':END') != -1):\r
-                            Remainder = Offset % (MaxAlign/8)   # MaxAlign is either 32 or 64\r
-                            if Remainder:\r
-                                Diff = (MaxAlign/8) - Remainder\r
-                                Offset = Offset + Diff\r
-                                ItemOffset = ItemOffset + Diff\r
-                            MaxAlign = 32                       # Reset to default 32 align when struct end\r
-                        if (ConfigDict['cname'] == 'UpdTerminator'):\r
-                            # ItemLength is the size of UpdTerminator\r
-                            # Itemlength might be 16, 32, or 64\r
-                            # Struct align to 64 if UpdTerminator\r
-                            # or struct size is 64 bit, else align to 32\r
-                            Remainder = Offset % max(ItemLength/8, 4, SizeAlign)\r
-                            Offset = Offset + ItemLength\r
-                            if Remainder:\r
-                                Diff = max(ItemLength/8, 4, SizeAlign) - Remainder\r
-                                ItemOffset = ItemOffset + Diff\r
-                        ConfigDict['offset'] = ItemOffset\r
 \r
                     self._CfgItemList.append(ConfigDict.copy())\r
                     ConfigDict['name']   = ''\r
@@ -1038,13 +976,6 @@ EndList
         NewTextBody.extend(OldTextBody)\r
         return NewTextBody\r
 \r
-    def WriteLinesWithoutTailingSpace (self, HeaderFd, Line):\r
-        TxtBody2 = Line.splitlines(True)\r
-        for Line2 in TxtBody2:\r
-            Line2 = Line2.rstrip()\r
-            Line2 += '\n'\r
-            HeaderFd.write (Line2)\r
-        return 0\r
     def CreateHeaderFile (self, InputHeaderFile):\r
         FvDir = self._FvDir\r
 \r
@@ -1244,7 +1175,7 @@ EndList
                 Index += 1\r
                 for Item in range(len(StructStart)):\r
                     if Index >= StructStartWithComment[Item] and Index <= StructEnd[Item]:\r
-                        self.WriteLinesWithoutTailingSpace(HeaderFd, Line)\r
+                        HeaderFd.write (Line)\r
             HeaderFd.write("#pragma pack()\n\n")\r
             HeaderFd.write("#endif\n")\r
             HeaderFd.close()\r
@@ -1289,7 +1220,7 @@ EndList
                 Index += 1\r
                 for Item in range(len(StructStart)):\r
                     if Index >= StructStartWithComment[Item] and Index <= StructEnd[Item]:\r
-                        self.WriteLinesWithoutTailingSpace(HeaderFd, Line)\r
+                        HeaderFd.write (Line)\r
         HeaderFd.write("#pragma pack()\n\n")\r
         HeaderFd.write("#endif\n")\r
         HeaderFd.close()\r
index 011cf89..ce3bfa0 100644 (file)
@@ -61,6 +61,7 @@
   gFspHobGuid                                       ## CONSUMES ## HOB\r
 \r
 [Pcd]\r
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress  ## CONSUMES\r
   gIntelFsp2WrapperTokenSpaceGuid.PcdSkipFspApi       ## CONSUMES\r
 \r
 [Depex]\r