Re: [edk2-devel] [PATCH] KabylakeOpenBoardPkg: Fixed system hang caused by MemoryTest.

2019-05-21 Thread Kubacki, Michael A
Please promote BaseEcLib to the "GenericBoardPkg" or whatever name is decided 
when created.
We can extend command and vendor support there in the future.

In BaseEcLib.c, remove SLE_FLAG usage and positive logic blocks.

Thanks,
Michael

> -Original Message-
> From: Chiu, Chasel
> Sent: Tuesday, May 21, 2019 8:52 AM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel ; Desimone, Nathaniel L
> ; Kubacki, Michael A
> 
> Subject: [PATCH] KabylakeOpenBoardPkg: Fixed system hang caused by
> MemoryTest.
> 
> From: "Chasel, Chiu" 
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1550
> 
> OS hang due to non-existing memory reported as usable memory.
> There are 2 different RVP3 boards and one with 4GB memory down
> implementation while another one with 8GB. Since rest of the
> configurations are exactly the same, board detection is added
> to the same RVP3 BoardInitLib and only SPD policy assigned
> differently.
> 
> This also fixed below 2 issues:
> 1. Fixed build failuire when PcdMultiBoardSupport == FALSE.
>(Wrong Pcd TokenSpace used in DxeBoardAcpiTableLib.inf)
> 2. Always failed to read SPD from DIMM because SpdAddressTable
>policy was not updated properly. Fixed by a notify callback
>when policy PPI installed.
> 
> Test: Verified both RVP3 boards can boot to Windows.
> 
> Cc: Nate DeSimone 
> Cc: Michael Kubacki 
> Signed-off-by: Chasel Chiu 
> ---
> 
> Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicy
> NotifyLib/PeiPreMemSiliconPolicyNotifyLib.c   | 103
> 
> +++
> 
> Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicy
> UpdateLibFsp/PeiSaPolicyUpdatePreMem.c|  17 ++---
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib/
> DxeMultiBoardAcpiSupportLib.c  |   4 ++--
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib/
> SmmMultiBoardAcpiSupportLib.c  |   6 +++---
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/K
> abylakeRvp3SpdTable.c | 117
> 
> -
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/P
> eiBoardInitPreMemLib.c|   7 +--
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/P
> eiKabylakeRvp3Detect.c|  83
> 
> +++
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/P
> eiKabylakeRvp3InitPreMemLib.c | 127
> 
> ++-
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/P
> eiMultiBoardInitPostMemLib.c  |   4 ++--
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/P
> eiMultiBoardInitPreMemLib.c   |   4 ++--
>  Platform/Intel/KabylakeOpenBoardPkg/Library/BaseEcLib/BaseEcLib.c
> | 339
> 
> 
> 
> 
> 
> +++
> 
> Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicy
> NotifyLib/PeiPreMemSiliconPolicyNotifyLib.inf |  43
> +++
> 
> Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicy
> UpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf |   9 -
>  Platform/Intel/KabylakeOpenBoardPkg/Include/EcCommands.h
> |  44 
>  Platform/Intel/KabylakeOpenBoardPkg/Include/Library/EcLib.h
> | 106
> 
> ++
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib/
> DxeBoardAcpiTableLib.inf   |   8 
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/P
> eiBoardInitPreMemLib.inf  |   3 ++-
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/P
> eiKabylakeRvp3InitLib.h   |   4 +++-
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/P
> eiMultiBoardInitPreMemLib.inf |   3 ++-
>  Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
> |  12 ++--
>  Platform/Intel/KabylakeOpenBoardPkg/Library/BaseEcLib/BaseEcLib.inf
> |  29 +

[edk2-devel] [PATCH] KabylakeOpenBoardPkg: Fixed system hang caused by MemoryTest.

2019-05-21 Thread Chiu, Chasel
From: "Chasel, Chiu" 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1550

OS hang due to non-existing memory reported as usable memory.
There are 2 different RVP3 boards and one with 4GB memory down
implementation while another one with 8GB. Since rest of the
configurations are exactly the same, board detection is added
to the same RVP3 BoardInitLib and only SPD policy assigned
differently.

This also fixed below 2 issues:
1. Fixed build failuire when PcdMultiBoardSupport == FALSE.
   (Wrong Pcd TokenSpace used in DxeBoardAcpiTableLib.inf)
2. Always failed to read SPD from DIMM because SpdAddressTable
   policy was not updated properly. Fixed by a notify callback
   when policy PPI installed.

Test: Verified both RVP3 boards can boot to Windows.

Cc: Nate DeSimone 
Cc: Michael Kubacki 
Signed-off-by: Chasel Chiu 
---
 
Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyNotifyLib/PeiPreMemSiliconPolicyNotifyLib.c
   | 103 
+++
 
Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSaPolicyUpdatePreMem.c
|  17 ++---
 
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib/DxeMultiBoardAcpiSupportLib.c
  |   4 ++--
 
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib/SmmMultiBoardAcpiSupportLib.c
  |   6 +++---
 
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/KabylakeRvp3SpdTable.c
 | 117 
-
 
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiBoardInitPreMemLib.c
|   7 +--
 
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiKabylakeRvp3Detect.c
|  83 
+++
 
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiKabylakeRvp3InitPreMemLib.c
 | 127 
++-
 
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiMultiBoardInitPostMemLib.c
  |   4 ++--
 
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.c
   |   4 ++--
 Platform/Intel/KabylakeOpenBoardPkg/Library/BaseEcLib/BaseEcLib.c  
  | 339 
+++
 
Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyNotifyLib/PeiPreMemSiliconPolicyNotifyLib.inf
 |  43 +++
 
Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
 |   9 -
 Platform/Intel/KabylakeOpenBoardPkg/Include/EcCommands.h   
  |  44 

 Platform/Intel/KabylakeOpenBoardPkg/Include/Library/EcLib.h
  | 106 
++
 
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf
   |   8 
 
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiBoardInitPreMemLib.inf
  |   3 ++-
 
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiKabylakeRvp3InitLib.h
   |   4 +++-
 
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.inf
 |   3 ++-
 Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc  
  |  12 ++--
 Platform/Intel/KabylakeOpenBoardPkg/Library/BaseEcLib/BaseEcLib.inf
  |  29 +
 21 files changed, 1022 insertions(+), 50 deletions(-)

diff --git 
a/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyNotifyLib/PeiPreMemSiliconPolicyNotifyLib.c
 
b/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyNotifyLib/PeiPreMemSiliconPolicyNotifyLib.c
new file mode 100644
index 00..0fedd81cd0
--- /dev/null
+++