public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] IntelFsp2Pkg-Tools: GenCfgOpt.py shouldn't include specific UPD name
@ 2017-09-14  2:43 Chasel, Chiu
  2017-09-14  2:47 ` Yao, Jiewen
  0 siblings, 1 reply; 3+ messages in thread
From: Chasel, Chiu @ 2017-09-14  2:43 UTC (permalink / raw)
  To: edk2-devel; +Cc: Jiewen Yao, Chasel Chiu

PcdSerialIoUartDebugEnable UPD is platform specific and should not
be included in generic GenCfgOpt.py script. Remove this and platform
DSC should control the default value instead.

Cc: Jiewen Yao <Jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
---
 IntelFsp2Pkg/Tools/GenCfgOpt.py | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py b/IntelFsp2Pkg/Tools/GenCfgOpt.py
index 6dc1b10b34..c9b7bc5373 100644
--- a/IntelFsp2Pkg/Tools/GenCfgOpt.py
+++ b/IntelFsp2Pkg/Tools/GenCfgOpt.py
@@ -289,7 +289,6 @@ class CGenCfgOpt:
     def __init__(self):
         self.Debug          = False
         self.Error          = ''
-        self.ReleaseMode    = True
 
         self._GlobalDataDef = """
 GlobalDataDef
@@ -318,13 +317,6 @@ EndList
         self._FvDir       = ''
         self._MapVer      = 0
 
-    def ParseBuildMode (self, OutputStr):
-        if "RELEASE_" in OutputStr:
-            self.ReleaseMode = True
-        if "DEBUG_" in OutputStr:
-            self.ReleaseMode = False
-        return
-
     def ParseMacros (self, MacroDefStr):
         # ['-DABC=1', '-D', 'CFG_DEBUG=1', '-D', 'CFG_OUTDIR=Build']
         self._MacroDict = {}
@@ -815,9 +807,6 @@ EndList
                     TxtFd.write("%s.UnusedUpdSpace%d|%s0x%04X|0x%04X|{0}\n" % (Item['space'], SpaceIdx, Default, NextOffset - StartAddr, Offset - NextOffset))
                     SpaceIdx = SpaceIdx + 1
                 NextOffset = Offset + Item['length']
-                if Item['cname'] == 'PcdSerialIoUartDebugEnable':
-                    if self.ReleaseMode == False:
-                        Item['value'] = 0x01
                 TxtFd.write("%s.%s|%s0x%04X|%s|%s\n" % (Item['space'],Item['cname'],Default,Item['offset'] - StartAddr,Item['length'],Item['value']))
             TxtFd.close()
         return 0
@@ -1437,7 +1426,6 @@ def Main():
                     print "ERROR: Macro parsing failed !"
                     return 3
 
-        GenCfgOpt.ParseBuildMode(sys.argv[3])
         FvDir = sys.argv[3]
         if not os.path.exists(FvDir):
             os.makedirs(FvDir)
-- 
2.13.3.windows.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] IntelFsp2Pkg-Tools: GenCfgOpt.py shouldn't include specific UPD name
  2017-09-14  2:43 [PATCH] IntelFsp2Pkg-Tools: GenCfgOpt.py shouldn't include specific UPD name Chasel, Chiu
@ 2017-09-14  2:47 ` Yao, Jiewen
  2017-09-14  3:56   ` Yao, Jiewen
  0 siblings, 1 reply; 3+ messages in thread
From: Yao, Jiewen @ 2017-09-14  2:47 UTC (permalink / raw)
  To: Chiu, Chasel, edk2-devel@lists.01.org

Thanks to catch this.

Reviewed-by: Jiewen.yao@Intel.com

> -----Original Message-----
> From: Chiu, Chasel
> Sent: Thursday, September 14, 2017 10:44 AM
> To: edk2-devel@lists.01.org
> Cc: Yao, Jiewen <jiewen.yao@intel.com>; Chiu, Chasel <chasel.chiu@intel.com>
> Subject: [PATCH] IntelFsp2Pkg-Tools: GenCfgOpt.py shouldn't include specific
> UPD name
> 
> PcdSerialIoUartDebugEnable UPD is platform specific and should not
> be included in generic GenCfgOpt.py script. Remove this and platform
> DSC should control the default value instead.
> 
> Cc: Jiewen Yao <Jiewen.yao@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
> ---
>  IntelFsp2Pkg/Tools/GenCfgOpt.py | 12 ------------
>  1 file changed, 12 deletions(-)
> 
> diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py
> b/IntelFsp2Pkg/Tools/GenCfgOpt.py
> index 6dc1b10b34..c9b7bc5373 100644
> --- a/IntelFsp2Pkg/Tools/GenCfgOpt.py
> +++ b/IntelFsp2Pkg/Tools/GenCfgOpt.py
> @@ -289,7 +289,6 @@ class CGenCfgOpt:
>      def __init__(self):
>          self.Debug          = False
>          self.Error          = ''
> -        self.ReleaseMode    = True
> 
>          self._GlobalDataDef = """
>  GlobalDataDef
> @@ -318,13 +317,6 @@ EndList
>          self._FvDir       = ''
>          self._MapVer      = 0
> 
> -    def ParseBuildMode (self, OutputStr):
> -        if "RELEASE_" in OutputStr:
> -            self.ReleaseMode = True
> -        if "DEBUG_" in OutputStr:
> -            self.ReleaseMode = False
> -        return
> -
>      def ParseMacros (self, MacroDefStr):
>          # ['-DABC=1', '-D', 'CFG_DEBUG=1', '-D', 'CFG_OUTDIR=Build']
>          self._MacroDict = {}
> @@ -815,9 +807,6 @@ EndList
> 
> TxtFd.write("%s.UnusedUpdSpace%d|%s0x%04X|0x%04X|{0}\n" %
> (Item['space'], SpaceIdx, Default, NextOffset - StartAddr, Offset - NextOffset))
>                      SpaceIdx = SpaceIdx + 1
>                  NextOffset = Offset + Item['length']
> -                if Item['cname'] == 'PcdSerialIoUartDebugEnable':
> -                    if self.ReleaseMode == False:
> -                        Item['value'] = 0x01
>                  TxtFd.write("%s.%s|%s0x%04X|%s|%s\n" %
> (Item['space'],Item['cname'],Default,Item['offset'] -
> StartAddr,Item['length'],Item['value']))
>              TxtFd.close()
>          return 0
> @@ -1437,7 +1426,6 @@ def Main():
>                      print "ERROR: Macro parsing failed !"
>                      return 3
> 
> -        GenCfgOpt.ParseBuildMode(sys.argv[3])
>          FvDir = sys.argv[3]
>          if not os.path.exists(FvDir):
>              os.makedirs(FvDir)
> --
> 2.13.3.windows.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] IntelFsp2Pkg-Tools: GenCfgOpt.py shouldn't include specific UPD name
  2017-09-14  2:47 ` Yao, Jiewen
@ 2017-09-14  3:56   ` Yao, Jiewen
  0 siblings, 0 replies; 3+ messages in thread
From: Yao, Jiewen @ 2017-09-14  3:56 UTC (permalink / raw)
  To: Yao, Jiewen, Chiu, Chasel, edk2-devel@lists.01.org

I just got an idea on release mode checking.

Because the build.exe will parse target.txt to decide if current build is DEBUG  or RELEASE, I think we can enhance the GenCftOpt.py to get same information from target.txt.

In such way, all tools get same result on debug/release.

Thank you
Yao Jiewen

From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Yao, Jiewen
Sent: Thursday, September 14, 2017 10:47 AM
To: Chiu, Chasel <chasel.chiu@intel.com>; edk2-devel@lists.01.org
Subject: Re: [edk2] [PATCH] IntelFsp2Pkg-Tools: GenCfgOpt.py shouldn't include specific UPD name

Thanks to catch this.

Reviewed-by: Jiewen.yao@Intel.com<mailto:Jiewen.yao@Intel.com>

> -----Original Message-----
> From: Chiu, Chasel
> Sent: Thursday, September 14, 2017 10:44 AM
> To: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> Cc: Yao, Jiewen <jiewen.yao@intel.com<mailto:jiewen.yao@intel.com>>; Chiu, Chasel <chasel.chiu@intel.com<mailto:chasel.chiu@intel.com>>
> Subject: [PATCH] IntelFsp2Pkg-Tools: GenCfgOpt.py shouldn't include specific
> UPD name
>
> PcdSerialIoUartDebugEnable UPD is platform specific and should not
> be included in generic GenCfgOpt.py script. Remove this and platform
> DSC should control the default value instead.
>
> Cc: Jiewen Yao <Jiewen.yao@intel.com<mailto:Jiewen.yao@intel.com>>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Chasel Chiu <chasel.chiu@intel.com<mailto:chasel.chiu@intel.com>>
> ---
>  IntelFsp2Pkg/Tools/GenCfgOpt.py | 12 ------------
>  1 file changed, 12 deletions(-)
>
> diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py
> b/IntelFsp2Pkg/Tools/GenCfgOpt.py
> index 6dc1b10b34..c9b7bc5373 100644
> --- a/IntelFsp2Pkg/Tools/GenCfgOpt.py
> +++ b/IntelFsp2Pkg/Tools/GenCfgOpt.py
> @@ -289,7 +289,6 @@ class CGenCfgOpt:
>      def __init__(self):
>          self.Debug          = False
>          self.Error          = ''
> -        self.ReleaseMode    = True
>
>          self._GlobalDataDef = """
>  GlobalDataDef
> @@ -318,13 +317,6 @@ EndList
>          self._FvDir       = ''
>          self._MapVer      = 0
>
> -    def ParseBuildMode (self, OutputStr):
> -        if "RELEASE_" in OutputStr:
> -            self.ReleaseMode = True
> -        if "DEBUG_" in OutputStr:
> -            self.ReleaseMode = False
> -        return
> -
>      def ParseMacros (self, MacroDefStr):
>          # ['-DABC=1', '-D', 'CFG_DEBUG=1', '-D', 'CFG_OUTDIR=Build']
>          self._MacroDict = {}
> @@ -815,9 +807,6 @@ EndList
>
> TxtFd.write("%s.UnusedUpdSpace%d|%s0x%04X|0x%04X|{0}\n" %
> (Item['space'], SpaceIdx, Default, NextOffset - StartAddr, Offset - NextOffset))
>                      SpaceIdx = SpaceIdx + 1
>                  NextOffset = Offset + Item['length']
> -                if Item['cname'] == 'PcdSerialIoUartDebugEnable':
> -                    if self.ReleaseMode == False:
> -                        Item['value'] = 0x01
>                  TxtFd.write("%s.%s|%s0x%04X|%s|%s\n" %
> (Item['space'],Item['cname'],Default,Item['offset'] -
> StartAddr,Item['length'],Item['value']))
>              TxtFd.close()
>          return 0
> @@ -1437,7 +1426,6 @@ def Main():
>                      print "ERROR: Macro parsing failed !"
>                      return 3
>
> -        GenCfgOpt.ParseBuildMode(sys.argv[3])
>          FvDir = sys.argv[3]
>          if not os.path.exists(FvDir):
>              os.makedirs(FvDir)
> --
> 2.13.3.windows.1

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-14  3:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-14  2:43 [PATCH] IntelFsp2Pkg-Tools: GenCfgOpt.py shouldn't include specific UPD name Chasel, Chiu
2017-09-14  2:47 ` Yao, Jiewen
2017-09-14  3:56   ` Yao, Jiewen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox