Re: [edk2] [Patch V2] BaseTools: Fix a bug that HII type pcd value display extra 0x00

2018-03-04 Thread Feng, Bob C
Reviewed-by: Feng, Bob C  

-Original Message-
From: Zhu, Yonghong 
Sent: Monday, March 05, 2018 2:56 PM
To: edk2-devel@lists.01.org
Cc: Feng, Bob C 
Subject: [Patch V2] BaseTools: Fix a bug that HII type pcd value display extra 
0x00

V2: Add Pcd.DatumType check.

Fix a bug that HII type Pcd value display in the report will have an extra 
0x00, because original code use StringToArray function and it will judge 
whether the value length is a multiplier of 2, if not, it will change the value 
in Pcd Object and add an extra 0x00.

Cc: Bob Feng 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu 
---
 BaseTools/Source/Python/AutoGen/AutoGen.py| 7 ++-
 BaseTools/Source/Python/Workspace/DscBuildData.py | 6 +-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py 
b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 439e360..c8c042b 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -1329,11 +1329,16 @@ class PlatformAutoGen(AutoGen):
 continue
 if len(Sku.VariableName) > 0:
 VariableGuidStructure = Sku.VariableGuidValue
 VariableGuid = 
GuidStructureStringToGuidString(VariableGuidStructure)
 for StorageName in Sku.DefaultStoreDict:
-
VariableInfo.append_variable(var_info(Index,pcdname,StorageName,SkuName, 
StringToArray(Sku.VariableName),VariableGuid, Sku.VariableOffset, 
Sku.VariableAttribute , 
Sku.HiiDefaultValue,Sku.DefaultStoreDict[StorageName],Pcd.DatumType))
+HiiValue = Sku.HiiDefaultValue
+DefaultStoreVal= Sku.DefaultStoreDict[StorageName]
+if Pcd.DatumType not in [TAB_UINT8, TAB_UINT16, 
TAB_UINT32, TAB_UINT64, "BOOLEAN"]:
+HiiValue = StringToArray(Sku.HiiDefaultValue)
+DefaultStoreVal = 
StringToArray(Sku.DefaultStoreDict[StorageName])
+
+ VariableInfo.append_variable(var_info(Index,pcdname,StorageName,SkuNam
+ e, StringToArray(Sku.VariableName),VariableGuid, Sku.VariableOffset, 
+ Sku.VariableAttribute , HiiValue, DefaultStoreVal,Pcd.DatumType))
 Index += 1
 return VariableInfo
 
 def UpdateNVStoreMaxSize(self,OrgVpdFile):
 if self.VariableInfo:
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py 
b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 9d78770..fc7a307 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -2513,17 +2513,13 @@ class DscBuildData(PlatformBuildClassObject):
 else:
 MaxSize = 0
 if pcd.DatumType not in 
['BOOLEAN','UINT8','UINT16','UINT32','UINT64']:
 for (_, skuobj) in pcd.SkuInfoList.items():
 datalen = 0
-skuobj.HiiDefaultValue = 
StringToArray(skuobj.HiiDefaultValue)
-datalen = len(skuobj.HiiDefaultValue.split(","))
+datalen = 
+ len((StringToArray(skuobj.HiiDefaultValue)).split(","))
 if datalen > MaxSize:
 MaxSize = datalen
-for defaultst in skuobj.DefaultStoreDict:
-skuobj.DefaultStoreDict[defaultst] = 
StringToArray(skuobj.DefaultStoreDict[defaultst])
-pcd.DefaultValue = StringToArray(pcd.DefaultValue)
 pcd.MaxDatumSize = str(MaxSize)
 rt, invalidhii = self.CheckVariableNameAssignment(Pcds)
 if not rt:
 invalidpcd = ",".join(invalidhii)
 EdkLogger.error('build', PCD_VARIABLE_INFO_ERROR, Message='The 
same HII PCD must map to the same EFI variable for all SKUs', 
File=self.MetaFile, ExtraData=invalidpcd)
--
2.6.1.windows.1

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


[edk2] [Patch V2] BaseTools: Fix a bug that HII type pcd value display extra 0x00

2018-03-04 Thread Yonghong Zhu
V2: Add Pcd.DatumType check.

Fix a bug that HII type Pcd value display in the report will have an
extra 0x00, because original code use StringToArray function and it will
judge whether the value length is a multiplier of 2, if not, it will
change the value in Pcd Object and add an extra 0x00.

Cc: Bob Feng 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu 
---
 BaseTools/Source/Python/AutoGen/AutoGen.py| 7 ++-
 BaseTools/Source/Python/Workspace/DscBuildData.py | 6 +-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py 
b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 439e360..c8c042b 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -1329,11 +1329,16 @@ class PlatformAutoGen(AutoGen):
 continue
 if len(Sku.VariableName) > 0:
 VariableGuidStructure = Sku.VariableGuidValue
 VariableGuid = 
GuidStructureStringToGuidString(VariableGuidStructure)
 for StorageName in Sku.DefaultStoreDict:
-
VariableInfo.append_variable(var_info(Index,pcdname,StorageName,SkuName, 
StringToArray(Sku.VariableName),VariableGuid, Sku.VariableOffset, 
Sku.VariableAttribute , 
Sku.HiiDefaultValue,Sku.DefaultStoreDict[StorageName],Pcd.DatumType))
+HiiValue = Sku.HiiDefaultValue
+DefaultStoreVal= Sku.DefaultStoreDict[StorageName]
+if Pcd.DatumType not in [TAB_UINT8, TAB_UINT16, 
TAB_UINT32, TAB_UINT64, "BOOLEAN"]:
+HiiValue = StringToArray(Sku.HiiDefaultValue)
+DefaultStoreVal = 
StringToArray(Sku.DefaultStoreDict[StorageName])
+
VariableInfo.append_variable(var_info(Index,pcdname,StorageName,SkuName, 
StringToArray(Sku.VariableName),VariableGuid, Sku.VariableOffset, 
Sku.VariableAttribute , HiiValue, DefaultStoreVal,Pcd.DatumType))
 Index += 1
 return VariableInfo
 
 def UpdateNVStoreMaxSize(self,OrgVpdFile):
 if self.VariableInfo:
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py 
b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 9d78770..fc7a307 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -2513,17 +2513,13 @@ class DscBuildData(PlatformBuildClassObject):
 else:
 MaxSize = 0
 if pcd.DatumType not in 
['BOOLEAN','UINT8','UINT16','UINT32','UINT64']:
 for (_, skuobj) in pcd.SkuInfoList.items():
 datalen = 0
-skuobj.HiiDefaultValue = 
StringToArray(skuobj.HiiDefaultValue)
-datalen = len(skuobj.HiiDefaultValue.split(","))
+datalen = 
len((StringToArray(skuobj.HiiDefaultValue)).split(","))
 if datalen > MaxSize:
 MaxSize = datalen
-for defaultst in skuobj.DefaultStoreDict:
-skuobj.DefaultStoreDict[defaultst] = 
StringToArray(skuobj.DefaultStoreDict[defaultst])
-pcd.DefaultValue = StringToArray(pcd.DefaultValue)
 pcd.MaxDatumSize = str(MaxSize)
 rt, invalidhii = self.CheckVariableNameAssignment(Pcds)
 if not rt:
 invalidpcd = ",".join(invalidhii)
 EdkLogger.error('build', PCD_VARIABLE_INFO_ERROR, Message='The 
same HII PCD must map to the same EFI variable for all SKUs', 
File=self.MetaFile, ExtraData=invalidpcd)
-- 
2.6.1.windows.1

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


Re: [edk2] [Patch] BaseTools: Support H"{}" format for Sructure Pcd.

2018-03-04 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: Feng, Bob C
>Sent: Monday, March 05, 2018 2:11 PM
>To: edk2-devel@lists.01.org
>Cc: Feng, Bob C ; Gao, Liming 
>Subject: [Patch] BaseTools: Support H"{}" format for Sructure Pcd.
>
>Support H"{}" format for Sructure Pcd from CommandLine
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Bob Feng 
>Cc: Liming Gao 
>---
> BaseTools/Source/Python/Workspace/DscBuildData.py | 1 -
> 1 file changed, 1 deletion(-)
>
>diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py
>b/BaseTools/Source/Python/Workspace/DscBuildData.py
>index 9d787702c2..edf90dbd59 100644
>--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
>+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
>@@ -911,11 +911,10 @@ class DscBuildData(PlatformBuildClassObject):
> if not ValueStr[1]:
> EdkLogger.error("build", FORMAT_INVALID, 'For Void* type PCD,
>when specify the Value in the command line, please use the following format:
>"string", L"string", H"{...}"')
> ValueStr = ValueStr[0] + '"' + ValueStr[1:] + '"'
> PredictedFieldType = "VOID*"
> elif ValueStr.startswith('H') or ValueStr.startswith('{'):
>-EdkLogger.error("build", FORMAT_INVALID, 'Currently we do not
>support assign H"{...}" format for Pcd field.', ExtraData="%s.%s.%s from
>command line" % (TokenSpaceGuidCName, TokenCName, FieldName))
> ValueStr = ValueStr[1:]
> PredictedFieldType = "VOID*"
> elif ValueStr.upper() in ['TRUE', '0X1', '0X01', '1', 'FALSE', '0X0', 
> '0X00', '0']:
> PredictedFieldType = "BOOLEAN"
> elif ValueStr.isdigit() or ValueStr.upper().startswith('0X'):
>--
>2.14.3.windows.1

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


[edk2] [Patch] BaseTools: Support H"{}" format for Sructure Pcd.

2018-03-04 Thread BobCF
Support H"{}" format for Sructure Pcd from CommandLine

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng 
Cc: Liming Gao 
---
 BaseTools/Source/Python/Workspace/DscBuildData.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py 
b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 9d787702c2..edf90dbd59 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -911,11 +911,10 @@ class DscBuildData(PlatformBuildClassObject):
 if not ValueStr[1]:
 EdkLogger.error("build", FORMAT_INVALID, 'For Void* type PCD, 
when specify the Value in the command line, please use the following format: 
"string", L"string", H"{...}"')
 ValueStr = ValueStr[0] + '"' + ValueStr[1:] + '"'
 PredictedFieldType = "VOID*"
 elif ValueStr.startswith('H') or ValueStr.startswith('{'):
-EdkLogger.error("build", FORMAT_INVALID, 'Currently we do not 
support assign H"{...}" format for Pcd field.', ExtraData="%s.%s.%s from 
command line" % (TokenSpaceGuidCName, TokenCName, FieldName))
 ValueStr = ValueStr[1:]
 PredictedFieldType = "VOID*"
 elif ValueStr.upper() in ['TRUE', '0X1', '0X01', '1', 'FALSE', '0X0', 
'0X00', '0']:
 PredictedFieldType = "BOOLEAN"
 elif ValueStr.isdigit() or ValueStr.upper().startswith('0X'):
-- 
2.14.3.windows.1

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


[edk2] [Patch] BaseTools: Fix a bug that HII type pcd value display extra 0x00

2018-03-04 Thread Yonghong Zhu
Fix a bug that HII type Pcd value display in the report will have an
extra 0x00, because original code use StringToArray function and it will
judge whether the value length is a multiplier of 2, if not, it will
change the value in Pcd Object and add an extra 0x00.

Cc: Bob Feng 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu 
---
 BaseTools/Source/Python/AutoGen/AutoGen.py| 2 +-
 BaseTools/Source/Python/Workspace/DscBuildData.py | 6 +-
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py 
b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 439e360..485d932 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -1329,11 +1329,11 @@ class PlatformAutoGen(AutoGen):
 continue
 if len(Sku.VariableName) > 0:
 VariableGuidStructure = Sku.VariableGuidValue
 VariableGuid = 
GuidStructureStringToGuidString(VariableGuidStructure)
 for StorageName in Sku.DefaultStoreDict:
-
VariableInfo.append_variable(var_info(Index,pcdname,StorageName,SkuName, 
StringToArray(Sku.VariableName),VariableGuid, Sku.VariableOffset, 
Sku.VariableAttribute , 
Sku.HiiDefaultValue,Sku.DefaultStoreDict[StorageName],Pcd.DatumType))
+
VariableInfo.append_variable(var_info(Index,pcdname,StorageName,SkuName, 
StringToArray(Sku.VariableName),VariableGuid, Sku.VariableOffset, 
Sku.VariableAttribute , StringToArray(Sku.HiiDefaultValue), 
StringToArray(Sku.DefaultStoreDict[StorageName]),Pcd.DatumType))
 Index += 1
 return VariableInfo
 
 def UpdateNVStoreMaxSize(self,OrgVpdFile):
 if self.VariableInfo:
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py 
b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 9d78770..fc7a307 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -2513,17 +2513,13 @@ class DscBuildData(PlatformBuildClassObject):
 else:
 MaxSize = 0
 if pcd.DatumType not in 
['BOOLEAN','UINT8','UINT16','UINT32','UINT64']:
 for (_, skuobj) in pcd.SkuInfoList.items():
 datalen = 0
-skuobj.HiiDefaultValue = 
StringToArray(skuobj.HiiDefaultValue)
-datalen = len(skuobj.HiiDefaultValue.split(","))
+datalen = 
len((StringToArray(skuobj.HiiDefaultValue)).split(","))
 if datalen > MaxSize:
 MaxSize = datalen
-for defaultst in skuobj.DefaultStoreDict:
-skuobj.DefaultStoreDict[defaultst] = 
StringToArray(skuobj.DefaultStoreDict[defaultst])
-pcd.DefaultValue = StringToArray(pcd.DefaultValue)
 pcd.MaxDatumSize = str(MaxSize)
 rt, invalidhii = self.CheckVariableNameAssignment(Pcds)
 if not rt:
 invalidpcd = ",".join(invalidhii)
 EdkLogger.error('build', PCD_VARIABLE_INFO_ERROR, Message='The 
same HII PCD must map to the same EFI variable for all SKUs', 
File=self.MetaFile, ExtraData=invalidpcd)
-- 
2.6.1.windows.1

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


[edk2] OVMF package : Question about Qemu/Xen support

2018-03-04 Thread Tiger Liu(BJ-RD)
Hi, experts:
I have a question about Ovmf.

Must Ovmf be run with qemu tool?
Or It could be run with Xen without needed qemu software.

It seems Xen began to support uefi boot from 4.4 version.

Thanks


?
?
CONFIDENTIAL NOTE:
This email contains confidential or legally privileged information and is for 
the sole use of its intended recipient. Any unauthorized review, use, copying 
or forwarding of this email or the content of this email is strictly prohibited.
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] UefiCpuPkg/MpInitLib: put mReservedApLoopFunc in executable memory

2018-03-04 Thread Ni, Ruiyu

On 3/3/2018 11:10 PM, Laszlo Ersek wrote:

Hi Ray,

On 03/02/18 12:57, Ni, Ruiyu wrote:

On 3/2/2018 7:45 PM, Laszlo Ersek wrote:

On 03/02/18 06:58, Jian J Wang wrote:

if PcdDxeNxMemoryProtectionPolicy is enabled for EfiReservedMemoryType
of memory, #PF will be triggered for each APs after ExitBootServices
in SCRT test. The root cause is that AP wakeup code executed at that
time is stored in memory of type EfiReservedMemoryType (referenced by
global mReservedApLoopFunc), which is marked as non-executable.

This patch fixes this issue by setting memory of mReservedApLoopFunc to
be executable immediately after allocation.

Cc: Ruiyu Ni 
Cc: Eric Dong 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang 
---
   UefiCpuPkg/Library/MpInitLib/DxeMpLib.c | 15 +++
   1 file changed, 15 insertions(+)

diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
index fd2317924f..5fcb08677c 100644
--- a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
@@ -399,6 +399,21 @@ InitMpGlobalData (
  
  );
     ASSERT_EFI_ERROR (Status);
+
+  //
+  // Make sure that the buffer memory is executable.
+  //
+  Status = gDS->GetMemorySpaceDescriptor (Address, );
+  if (!EFI_ERROR (Status)) {
+    gDS->SetMemorySpaceAttributes (
+   Address,
+   EFI_PAGES_TO_SIZE (EFI_SIZE_TO_PAGES (
+ CpuMpData->AddressMap.RelocateApLoopFuncSize
+ )),
+   MemDesc.Attributes & (~EFI_MEMORY_XP)
+   );
+  }
+
     mReservedApLoopFunc = (VOID *) (UINTN) Address;
     ASSERT (mReservedApLoopFunc != NULL);
     mReservedTopOfApStack = (UINTN) Address + EFI_PAGES_TO_SIZE
(EFI_SIZE_TO_PAGES (ApSafeBufferSize));



Honestly, I see little point in the "Dxe Nx Memory Protection Policy"
when we then override it *every time* it gets in our way.
"RelocateApLoopFuncSize" is likely significantly smaller than a full
page, so we're making a good chunk of the "safe stack(s)" executable too.

Anyway, can you perhaps check BIT0 (standing for EfiReservedMemoryType)
in PcdDxeNxMemoryProtectionPolicy, to see if the above hack is necessary?

Thanks
Laszlo



Checking PCD is not very good I think.


I'll look at v2 next week, just a short comment now: I don't understand
why you are opposed to the PCD check. Reserved memory is generally
expected to be executable, and the issue surfaces *precisely* when
reserved memory is marked as noexec in the PCD in question. That's
exactly the reason why the above logic is needed.


Sorry I didn't see this comments.
Standing from CPU owner's perspective, I don't like to check PCD here.
Or, to be straight, I want to have least knowledge of any extra
non-spec defined interfaces.



Approach it from this side: if I was reading the code (without the PCD
check), I would ask myself, "why are we checking for noexec here? we
just allocated this chunk of reserved memory from normal system memory.
It should be executable already".

So, I think the PCD check is somewhat important functionally, and quite
important for documentation purposes. And it's a lot better than adding
a comment.


If checking is really needed, how about check MemDesc.Attributes
EFI_MEMORY_XP bit?


I think that would check for the symptom, not for the root cause. To a
person reading the code, it doesn't provide any more information than
the current code. "Okay, it's not executable, so we mark it executable
manually. But why isn't it executable in the first place? We just
allocated it from system memory."This code is for AP to sleep, even at runtime, 
before OS takes control

of AP. So making it as BS code may cause issues.



Thanks,
Laszlo




--
Thanks,
Ray
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Update ReadMe.MD

2018-03-04 Thread Guo, Mang
Contributed-under: TianoCore Contribution Agreement 1.1

Signed-off-by: Guo Mang 
---
 ReadMe.MD | 178 --
 1 file changed, 21 insertions(+), 157 deletions(-)

diff --git a/ReadMe.MD b/ReadMe.MD
index a42260e..3c35cbd 100644
--- a/ReadMe.MD
+++ b/ReadMe.MD
@@ -1,172 +1,37 @@
-
-This code base is designed for the MinnowBoard v3 platform using the Intel(R) 
Atom(tm) Processor E3900 Series.
-This code base is based on UDK2017 core packages.
+# MinnowBoard 3 and Leaf Hill CRB Platform
 
-# INDEX
+This codebase is designed for the MinnowBoard 3 platform and Leaf Hill 
Customer Reference Board (CRB), using the [Intel Atom(R) Processor E3900 
Series](https://www.intel.com/content/www/us/en/embedded/products/apollo-lake/overview.html)
 (formerly Apollo Lake).
 
-1.  HOW TO CREATE A FULL SOURCE TREE
-2.  HOW TO BUILD (WINDOWS ENVIRONMENT)
-3.  MAINTAINERS
+## Codebase Overview
 
-## 1. HOW TO CREATE A FULL SOURCE TREE
+This codebase is based on UDK2017 core packages, [Intel(R) Firmware Support 
Package](https://github.com/IntelFsp/FSP.git)
+(Intel(R) FSP), [UEFI UNDI 
driver](https://downloadcenter.intel.com/download/19186/Intel-Ethernet-Connections-Boot-Utility-Preboot-Images-and-EFI-Drivers)
+for Intel Ethernet Controllers, and pre-compiled binary objects required for 
the final Integrated Firmware Image (IFWI).
 
-1. Create a new folder (directory) on the root of your local development 
machine
-   for use as your work space (this example uses "C:\MyWorkspace").
+Additional information on this project is available at 
[firmware.intel.com](https://firmware.intel.com/projects/minnowboard3).
 
-   NOTE: Some code paths are very long, and placing the working directory too
- deep below the ROOT directory may cause the path to be longer than the
- operating system or file system's maximum path length.
+## Build Instructions
 
-2. Get MinnowBoard v3 branch from GitHub with the following command.
-   * `git clone -b devel-MinnowBoard3-UDK2017 
https://github.com/tianocore/edk2-platforms.git`
+Instructions for downloading a source tree and compiling firmware are 
available in the project release notes at 
[firmware.intel.com](https://firmware.intel.com/projects/minnowboard3):
+* 
https://firmware.intel.com/sites/default/files/MinnowBoard3-Rel_0_69-ReleaseNotes.txt
+* 
https://firmware.intel.com/sites/default/files/LeafHill-Rel_0_69-ReleaseNotes.txt
 
-   Once the download completes, all EDK II packages and files will be found
-   under the "C:\MyWorkspace\edk2-platforms" directory.
+*Note that Release 0.69 added a separate [release notes file for the Leaf Hill 
CRB](https://firmware.intel.com/sites/default/files/LeafHill-Rel_0_69-ReleaseNotes.txt).
 Instructions for downloading  the Leaf Hill CRB source tree and compiling an 
IFWI image differ slightly from MinnowBoard 3.*
 
-3. Get the BaseTools binary and copy them to BaseTools binary folder.
-   1. `git clone https://github.com/tianocore/edk2-BaseTools-win32.git Win32`
-   2. Enter folder Win32
-   3. `git checkout 0e088c19ab31fccd1d2f55d9e4fe0314b57c0097`
-   4. Copy Win32 to the BaseTools Binary folder.
-   (C:\MyWorkspace\edk2-platforms\BaseTools\Bin\)
+This project's build instructions have been validated in the following 
environments:
+* Microsoft Windows 7 Ultimate 64-bit & Microsoft Windows 10 Enterprise 64-bit 
with Microsoft Visual Studio 2013/2015
+* Ubuntu Linux 16.04.3.LTS with GCC 5
 
-4. Get the Intel(R) Firmware Support Package(Intel FSP).
-   1. Run `git clone -b ApolloLake https://github.com/IntelFsp/FSP.git` to 
download FSP
-   2. Enter folder FSP
-   3. Run `git checkout de67689ef6261c1a0ecee01b7312bd635e3435e7`
-   4. Copy the ApolloLakeFspBinPkg to the folder
-  "C:\MyWorkspace\edk2-platforms\Silicon\BroxtonSoC\BroxtonFspPkg"
+## Pre-Compiled Firmware Images
 
-5. Install UEFI UNDI driver:
-  Download PREBOOT.EXE Version 21.1 from the "Intel® Ethernet Connections
-  Boot Utility, Preboot Images, and EFI Drivers" page.
-  
https://downloadcenter.intel.com/download/19186/Intel-Ethernet-Connections-Boot-Utility-Preboot-Images-and-EFI-Drivers
+Pre-compiled binary images are available at 
https://firmware.intel.com/projects/minnowboard3
 
-  Windows user:
-  1. Install PREBOOT.EXE into the default folder (C:\Intel21.1).
-  2. Copy the UEFI x64 PCI-E gigabit driver 
(C:\Intel21.1\APPS\EFI\EFIx64\E7320X3.EFI) 
-  to the platform package directory below, create the folder if it does 
not exist:
-* 
"C:\MyWorkspace\edk2-platforms\Platform\BroxtonPlatformPkg\Common\Binaries\UNDI\I210PcieUndiDxe"
+This [project](https://firmware.intel.com/projects/minnowboard3) also includes 
IA32 & x64 'flash update' tools for the UEFI Shell (FirmwareUpdateUtilities).
+These utilities require the 'BIOS Lock' feature to be disabled. Please refer 
to the release notes for programming instructions.
 
-  Linux user:
-  1. 

Re: [edk2] [PATCH 1/5] MdePkg/SPI: Change function definitions to match their descriptions.

2018-03-04 Thread Bi, Dandan
Hi Marvin,

Thank you very much for your contribution. Could you hold this patch series?  
Since current SPI header files follow PI1.6 spec.
For this case, we should submit an ECR to update the PI spec firstly. After the 
ECR has been approved by PIWG, then we can send patch to update them. 
Since you have found a lot of missing/incorrect parts in the SPI part of PI 
Spec. Could you help to submit an ECR to update them?


Thanks,
Dandan

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Marvin 
Häuser
Sent: Wednesday, February 28, 2018 12:49 AM
To: edk2-devel@lists.01.org
Cc: Kinney, Michael D ; Gao, Liming 

Subject: [edk2] [PATCH 1/5] MdePkg/SPI: Change function definitions to match 
their descriptions.

The PI specification is not continuous with function headers and descriptions 
for the SPI protocols. Correct and comment these mistakes.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser 
---
 MdePkg/Include/Protocol/SpiConfiguration.h | 12 
 MdePkg/Include/Protocol/SpiHc.h| 14 +-
 MdePkg/Include/Protocol/SpiIo.h| 15 ++-
 3 files changed, 27 insertions(+), 14 deletions(-)

diff --git a/MdePkg/Include/Protocol/SpiConfiguration.h 
b/MdePkg/Include/Protocol/SpiConfiguration.h
index c0df183ec7f0..c36a809f4232 100644
--- a/MdePkg/Include/Protocol/SpiConfiguration.h
+++ b/MdePkg/Include/Protocol/SpiConfiguration.h
@@ -1,7 +1,7 @@
 /** @file
   This file defines the SPI Configuration Protocol.
 
-  Copyright (c) 2017, Intel Corporation. All rights reserved.
+  Copyright (c) 2017 - 2018, Intel Corporation. All rights 
+ reserved.
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD
   License which accompanies this distribution. The full text of the license 
may @@ -65,6 +65,10 @@ EFI_STATUS
   IN BOOLEAN   PinValue
   );
 
+//
+// Note: In the PI specification, ClockHz is decorated as only 'IN', which is
+//   not conforming to the parameter description.
+//
 /**
   Set up the clock generator to produce the correct clock frequency, phase and
   polarity for a SPI chip.
@@ -78,7 +82,7 @@ EFI_STATUS
 ClockPhase and ClockPolarity fields. The routine
 also has access to the names for the SPI bus and
 chip which can be used during debugging.
-  @param[in] ClockHzPointer to the requested clock frequency. The clock
+  @param[in,out] ClockHzPointer to the requested clock frequency. The clock
 generator will choose a supported clock frequency
 which is less then or equal to this value.
 Specify zero to turn the clock generator off.
@@ -92,8 +96,8 @@ EFI_STATUS
 **/
 typedef EFI_STATUS
 (EFIAPI *EFI_SPI_CLOCK) (
-  IN CONST EFI_SPI_PERIPHERAL  *SpiPeripheral,
-  IN UINT32*ClockHz
+  IN CONST EFI_SPI_PERIPHERAL  *SpiPeripheral,
+  IN OUT UINT32*ClockHz
   );
 
 ///
diff --git a/MdePkg/Include/Protocol/SpiHc.h b/MdePkg/Include/Protocol/SpiHc.h 
index 12fe5d2dce0a..71c75431e4e8 100644
--- a/MdePkg/Include/Protocol/SpiHc.h
+++ b/MdePkg/Include/Protocol/SpiHc.h
@@ -1,7 +1,7 @@
 /** @file
   This file defines the SPI Host Controller Protocol.
 
-  Copyright (c) 2017, Intel Corporation. All rights reserved.
+  Copyright (c) 2017 - 2018, Intel Corporation. All rights 
+ reserved.
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD
   License which accompanies this distribution. The full text of the license 
may @@ -66,6 +66,10 @@ typedef EFI_STATUS
   IN BOOLEANPinValue
   );
 
+//
+// Note: In the PI specification, ClockHz is decorated as only 'IN', which is
+//   not conforming to the parameter description.
+//
 /**
   Set up the clock generator to produce the correct clock frequency, phase and
   polarity for a SPI chip.
@@ -80,7 +84,7 @@ typedef EFI_STATUS
 ClockPhase and ClockPolarity fields. The routine
 also has access to the names for the SPI bus and
 chip which can be used during debugging.
-  @param[in] ClockHzPointer to the requested clock frequency. The SPI
+  @param[in,out] ClockHzPointer to the requested clock frequency. The SPI
 host controller will choose a supported clock
 frequency which is less then or equal to this
 value. Specify zero to turn the clock generator @@ 
-94,9 +98,9 @@ typedef EFI_STATUS  **/  typedef EFI_STATUS  (EFIAPI 
*EFI_SPI_HC_PROTOCOL_CLOCK) (
-  IN CONST EFI_SPI_HC_PROTOCOL  *This,
-  IN 

[edk2] [Patch] BaseTool: Error handling for PCD datumtype.

2018-03-04 Thread BobCF
Report error if the Pcd DatumType is wrong.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng 
Cc: Liming Gao 
---
 BaseTools/Source/Python/Workspace/BuildClassObject.py |  2 ++
 BaseTools/Source/Python/Workspace/DecBuildData.py | 13 +
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/BaseTools/Source/Python/Workspace/BuildClassObject.py 
b/BaseTools/Source/Python/Workspace/BuildClassObject.py
index 711ba492ef..ec7c704fa5 100644
--- a/BaseTools/Source/Python/Workspace/BuildClassObject.py
+++ b/BaseTools/Source/Python/Workspace/BuildClassObject.py
@@ -66,10 +66,11 @@ class PcdClassObject(object):
 self.expressions = expressions
 self.DscDefaultValue = None
 self.DscRawValue = None
 if IsDsc:
 self.DscDefaultValue = Value
+self.DefinitionPosition = ("","")
 
 ## Convert the class to a string
 #
 #  Convert each member of the class to string
 #  Organize to a signle line format string
@@ -175,10 +176,11 @@ class StructurePcd(PcdClassObject):
 self.IsFromDsc = PcdObject.IsFromDsc if PcdObject.IsFromDsc else 
self.IsFromDsc
 self.validateranges = PcdObject.validateranges if 
PcdObject.validateranges else self.validateranges
 self.validlists = PcdObject.validlists if PcdObject.validlists else 
self.validlists
 self.expressions = PcdObject.expressions if PcdObject.expressions else 
self.expressions
 self.DscRawValue = PcdObject.DscRawValue if PcdObject.DscRawValue else 
self.DscRawValue
+self.DefinitionPosition = PcdObject.DefinitionPosition if 
PcdObject.DefinitionPosition else self.DefinitionPosition
 if type(PcdObject) is StructurePcd:
 self.StructuredPcdIncludeFile = PcdObject.StructuredPcdIncludeFile 
if PcdObject.StructuredPcdIncludeFile else self.StructuredPcdIncludeFile
 self.PackageDecs = PcdObject.PackageDecs if PcdObject.PackageDecs 
else self.PackageDecs
 self.DefaultValues = PcdObject.DefaultValues if 
PcdObject.DefaultValues else self.DefaultValues
 self.PcdMode = PcdObject.PcdMode if PcdObject.PcdMode else 
self.PcdMode
diff --git a/BaseTools/Source/Python/Workspace/DecBuildData.py 
b/BaseTools/Source/Python/Workspace/DecBuildData.py
index ee00ec0719..4d6edadc8f 100644
--- a/BaseTools/Source/Python/Workspace/DecBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DecBuildData.py
@@ -392,15 +392,11 @@ class DecBuildData(PackageBuildClassObject):
 struct_pcd.SetDecDefaultValue(item.DefaultValue)
 else:
 struct_pcd.AddDefaultValue(item.TokenCName, 
item.DefaultValue,self.MetaFile.File,LineNo)
 
 struct_pcd.PackageDecs = dep_pkgs
-if not struct_pcd.StructuredPcdIncludeFile:
-EdkLogger.error("build", PCD_STRUCTURE_PCD_ERROR, "The 
structure Pcd %s.%s header file is not found in %s line %s \n" % 
(struct_pcd.TokenSpaceGuidCName, 
struct_pcd.TokenCName,self.MetaFile.File,LineNo ))
-
 str_pcd_set.append(struct_pcd)
-
 return str_pcd_set
 
 ## Retrieve PCD declarations for given type
 def _GetPcd(self, Type):
 Pcds = sdict()
@@ -444,18 +440,27 @@ class DecBuildData(PackageBuildClassObject):
 None,
 list(validateranges),
 list(validlists),
 list(expressions)
 )
+PcdObj.DefinitionPosition = (self.MetaFile.File,LineNo)
 if "." in TokenSpaceGuid:
 StrPcdSet.append((PcdObj,LineNo))
 else:
 Pcds[PcdCName, TokenSpaceGuid, self._PCD_TYPE_STRING_[Type]] = 
PcdObj
 
 StructurePcds = self.ProcessStructurePcd(StrPcdSet)
 for pcd in StructurePcds:
 Pcds[pcd.TokenCName, pcd.TokenSpaceGuidCName, 
self._PCD_TYPE_STRING_[Type]] = pcd
+StructPattern = re.compile(r'[_a-zA-Z][0-9A-Za-z_]*$')
+for pcd in Pcds.values():
+if pcd.DatumType not in [TAB_UINT8, TAB_UINT16, TAB_UINT32, 
TAB_UINT64, TAB_VOID, "BOOLEAN"]:
+if StructPattern.match(pcd.DatumType) == None:
+EdkLogger.error('build', FORMAT_INVALID, "DatumType only 
support BOOLEAN, UINT8, UINT16, UINT32, UINT64, VOID* or a valid struct name.", 
pcd.DefinitionPosition[0],pcd.DefinitionPosition[1])
+for struct_pcd in Pcds.values():
+if isinstance(struct_pcd,StructurePcd) and not 
struct_pcd.StructuredPcdIncludeFile:
+EdkLogger.error("build", PCD_STRUCTURE_PCD_ERROR, "The 
structure Pcd %s.%s header file is not found in %s line %s \n" % 
(struct_pcd.TokenSpaceGuidCName, 
struct_pcd.TokenCName,struct_pcd.DefinitionPosition[0],struct_pcd.DefinitionPosition[1]
 ))
 
 return Pcds