[edk2] Community Virtual Meetings

2018-10-05 Thread stephano
I've setup 2 virtual meetings and sent out invites to the list. I've 
also posted this information on the wiki:


https://github.com/tianocore/tianocore.github.io/wiki/Community-Virtual-Meetings

I'll send out reminders next week as well.

Please feel free to contact me directly if you have any issues joining 
or any questions.


Cheers,
Stephano

Stephano Cetola
TianoCore Community Manager
stephano.cet...@linux.intel.com
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Event Invitation: TianoCore Community Meeting - NAMO / EMEA

2018-10-05 Thread stephano
Yes, there should be an attachment. Sorry I didn't realize that 
Thunderbird would not put the details of the meeting *in* the email text 
as well. I'll resend with text descriptions shortly.


--Stephano

On 10/5/2018 1:43 PM, Rebecca Cran wrote:
I don't see any information about time/place/etc. - should there be an 
attachment?


On 10/5/18 1:39 PM, stephano wrote:
stephano  has invited you to 
TianoCore Community Meeting - NAMO / EMEA


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

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


Re: [edk2] Openssl submodule

2018-10-05 Thread Laszlo Ersek
On 10/05/18 23:02, Laszlo Ersek wrote:
> On 10/05/18 17:53, Knop, Ryszard wrote:
>> Hi,
>> Git submodules generally point at a specific commit, so if you go to 
>> https://github.com/tianocore/edk2/tree/master/CryptoPkg/Library/OpensslLib 
>> and click on the openssl submodule, you'll go to the exact referenced commit 
>> (currently d4e4bd2, pointing at the 1.1.0h release). It doesn't point at any 
>> specific branch because it's a moving target.
> 
> Right.
> 
> See the "OpenSSL-Version" section in the file
> "CryptoPkg/Library/OpensslLib/OpenSSL-HOWTO.txt". It explains how
> CryptoPkg maintainers advance edk2's reference inside OpenSSL's git history.

Apologies, I forgot to mention:

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

Laszlo

>> -Original Message-
>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of TVKR
>> Sent: Friday, October 5, 2018 16:55
>> To: edk2-devel@lists.01.org
>> Subject: [edk2] Openssl submodule
>>
>> Hi,
>>
>> It is not clear if the recent change to add OpenSSL as a submodule will pull 
>> the code from the master branch of "https://github.com/openssl/openssl;
>> or any other branch like "OpenSSL_1_1_0-stable" or "OpenSSL_1_1_1-stable".
>> Can some one please clarify?
>>
>> Thanks
>> ___
>> edk2-devel mailing list
>> edk2-devel@lists.01.org
>> https://lists.01.org/mailman/listinfo/edk2-devel
>> 
>>
>> Intel Technology Poland sp. z o.o.
>> ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII 
>> Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 
>> 957-07-52-316 | Kapital zakladowy 200.000 PLN.
>>
>> Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata 
>> i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej 
>> wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; 
>> jakiekolwiek
>> przegladanie lub rozpowszechnianie jest zabronione.
>> This e-mail and any attachments may contain confidential material for the 
>> sole use of the intended recipient(s). If you are not the intended 
>> recipient, please contact the sender and delete all copies; any review or 
>> distribution by
>> others is strictly prohibited.
>>
>> ___
>> edk2-devel mailing list
>> edk2-devel@lists.01.org
>> https://lists.01.org/mailman/listinfo/edk2-devel
>>
> 

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


Re: [edk2] Openssl submodule

2018-10-05 Thread Laszlo Ersek
On 10/05/18 17:53, Knop, Ryszard wrote:
> Hi,
> Git submodules generally point at a specific commit, so if you go to 
> https://github.com/tianocore/edk2/tree/master/CryptoPkg/Library/OpensslLib 
> and click on the openssl submodule, you'll go to the exact referenced commit 
> (currently d4e4bd2, pointing at the 1.1.0h release). It doesn't point at any 
> specific branch because it's a moving target.

Right.

See the "OpenSSL-Version" section in the file
"CryptoPkg/Library/OpensslLib/OpenSSL-HOWTO.txt". It explains how
CryptoPkg maintainers advance edk2's reference inside OpenSSL's git history.

Thanks
Laszlo

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of TVKR
> Sent: Friday, October 5, 2018 16:55
> To: edk2-devel@lists.01.org
> Subject: [edk2] Openssl submodule
> 
> Hi,
> 
> It is not clear if the recent change to add OpenSSL as a submodule will pull 
> the code from the master branch of "https://github.com/openssl/openssl;
> or any other branch like "OpenSSL_1_1_0-stable" or "OpenSSL_1_1_1-stable".
> Can some one please clarify?
> 
> Thanks
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
> 
> 
> Intel Technology Poland sp. z o.o.
> ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII 
> Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 
> 957-07-52-316 | Kapital zakladowy 200.000 PLN.
> 
> Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i 
> moze zawierac informacje poufne. W razie przypadkowego otrzymania tej 
> wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; 
> jakiekolwiek
> przegladanie lub rozpowszechnianie jest zabronione.
> This e-mail and any attachments may contain confidential material for the 
> sole use of the intended recipient(s). If you are not the intended recipient, 
> please contact the sender and delete all copies; any review or distribution by
> others is strictly prohibited.
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
> 

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


Re: [edk2] Event Invitation: TianoCore Community Meeting - NAMO / EMEA

2018-10-05 Thread Rebecca Cran
I don't see any information about time/place/etc. - should there be an 
attachment?


On 10/5/18 1:39 PM, stephano wrote:

stephano  has invited you to TianoCore 
Community Meeting - NAMO / EMEA

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

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


Re: [edk2] [PATCH v3 1/1] OvmfPkg/PlatformPei: clear CPU caches

2018-10-05 Thread Laszlo Ersek
On 10/05/18 18:49, Kinney, Michael D wrote:
> Reviewed-by: Michael D Kinney 

Great, thank you :)

Patch pushed as commit d20ae95a13e8.

Thanks!
Laszlo

>> -Original Message-
>> From: edk2-devel [mailto:edk2-devel-
>> boun...@lists.01.org] On Behalf Of
>> marcandre.lur...@redhat.com
>> Sent: Tuesday, October 2, 2018 5:17 AM
>> To: edk2-devel@lists.01.org
>> Cc: Justen, Jordan L ;
>> Anthony Perard ; Laszlo Ersek
>> 
>> Subject: [edk2] [PATCH v3 1/1] OvmfPkg/PlatformPei:
>> clear CPU caches
>>
>> From: Marc-André Lureau 
>>
>> This is for conformance with the TCG "Platform Reset
>> Attack Mitigation
>> Specification". Because clearing the CPU caches at boot
>> doesn't impact
>> performance significantly, do it unconditionally, for
>> simplicity's
>> sake.
>>
>> Flush the cache on all logical processors, thanks to
>> EFI_PEI_MP_SERVICES_PPI and CacheMaintenanceLib.
>>
>> Cc: Jordan Justen 
>> Cc: Laszlo Ersek 
>> Cc: Ard Biesheuvel 
>> Cc: Anthony Perard 
>> Cc: Julien Grall 
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Marc-André Lureau
>> 
>> Message-Id: <20181002120730.13013-1-
>> marcandre.lur...@redhat.com>
>> ---
>>
>> v3:
>>   - update top comment with notes about TCG spec
>>   - sort headers inclusion
>>
>>  OvmfPkg/PlatformPei/PlatformPei.inf |   2 +
>>  OvmfPkg/PlatformPei/Platform.h  |   5 +
>>  OvmfPkg/PlatformPei/ClearCache.c| 117
>> 
>>  OvmfPkg/PlatformPei/Platform.c  |   1 +
>>  4 files changed, 125 insertions(+)
>>
>> diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf
>> b/OvmfPkg/PlatformPei/PlatformPei.inf
>> index 9c5ad9961c4a..5c8dd0fe6d72 100644
>> --- a/OvmfPkg/PlatformPei/PlatformPei.inf
>> +++ b/OvmfPkg/PlatformPei/PlatformPei.inf
>> @@ -30,6 +30,7 @@
>>
>>  [Sources]
>>AmdSev.c
>> +  ClearCache.c
>>Cmos.c
>>Cmos.h
>>FeatureControl.c
>> @@ -54,6 +55,7 @@
>>
>>  [LibraryClasses]
>>BaseLib
>> +  CacheMaintenanceLib
>>DebugLib
>>HobLib
>>IoLib
>> diff --git a/OvmfPkg/PlatformPei/Platform.h
>> b/OvmfPkg/PlatformPei/Platform.h
>> index f942e61bb4f9..b12a5c1f5f78 100644
>> --- a/OvmfPkg/PlatformPei/Platform.h
>> +++ b/OvmfPkg/PlatformPei/Platform.h
>> @@ -83,6 +83,11 @@ InstallFeatureControlCallback (
>>VOID
>>);
>>
>> +VOID
>> +InstallClearCacheCallback (
>> +  VOID
>> +  );
>> +
>>  EFI_STATUS
>>  InitializeXen (
>>VOID
>> diff --git a/OvmfPkg/PlatformPei/ClearCache.c
>> b/OvmfPkg/PlatformPei/ClearCache.c
>> new file mode 100644
>> index ..7d15fd925c3c
>> --- /dev/null
>> +++ b/OvmfPkg/PlatformPei/ClearCache.c
>> @@ -0,0 +1,117 @@
>> +/**@file
>> +  Install a callback to clear cache on all processors.
>> +  This is for conformance with the TCG "Platform Reset
>> Attack Mitigation
>> +  Specification". Because clearing the CPU caches at
>> boot doesn't impact
>> +  performance significantly, do it unconditionally, for
>> simplicity's
>> +  sake.
>> +
>> +  Copyright (C) 2018, Red Hat, Inc.
>> +
>> +  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 be
>> found at
>> +  http://opensource.org/licenses/bsd-license.php
>> +
>> +  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON
>> AN "AS IS" BASIS, WITHOUT
>> +  WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
>> EXPRESS OR IMPLIED.
>> +**/
>> +
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +
>> +#include "Platform.h"
>> +
>> +/**
>> +  Invalidate data & instruction caches.
>> +  All APs execute this function in parallel. The BSP
>> executes the function
>> +  separately.
>> +
>> +  @param[in,out] WorkSpace  Pointer to the input/output
>> argument workspace
>> +shared by all processors.
>> +**/
>> +STATIC
>> +VOID
>> +EFIAPI
>> +ClearCache (
>> +  IN OUT VOID *WorkSpace
>> +  )
>> +{
>> +  WriteBackInvalidateDataCache ();
>> +  InvalidateInstructionCache ();
>> +}
>> +
>> +/**
>> +  Notification function called when
>> EFI_PEI_MP_SERVICES_PPI becomes available.
>> +
>> +  @param[in] PeiServices  Indirect reference to the
>> PEI Services Table.
>> +  @param[in] NotifyDescriptor Address of the
>> notification descriptor data
>> +  structure.
>> +  @param[in] Ppi  Address of the PPI that
>> was installed.
>> +
>> +  @return  Status of the notification. The status code
>> returned from this
>> +   function is ignored.
>> +**/
>> +STATIC
>> +EFI_STATUS
>> +EFIAPI
>> +ClearCacheOnMpServicesAvailable (
>> +  IN EFI_PEI_SERVICES   **PeiServices,
>> +  IN EFI_PEI_NOTIFY_DESCRIPTOR  *NotifyDescriptor,
>> +  IN VOID   *Ppi
>> +  )
>> +{
>> +  EFI_PEI_MP_SERVICES_PPI *MpServices;
>> +  EFI_STATUS  Status;
>> +
>> +  DEBUG ((DEBUG_INFO, "%a: %a\n", gEfiCallerBaseName,
>> __FUNCTION__));
>> +
>> +  //
>> +  // Clear cache on all the 

Re: [edk2] [PATCH] BaseTools: Add support for dots in paths

2018-10-05 Thread Carsey, Jaben
I think that would be better since we are manipulating a path.  I think that 
file needs lots of rework, but I also know that Bob Feng (added to CC) is 
working on that file recently and he might want to think on using os.path to 
replace lots of stuff.

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Yeazel (Prime Air), Matt
> Sent: Friday, October 05, 2018 1:08 PM
> To: Carsey, Jaben ; edk2-devel@lists.01.org
> Subject: Re: [edk2] [PATCH] BaseTools: Add support for dots in paths
> Importance: High
> 
> splitext is probably the exact function we want. I noticed os.path is used
> extensively through this file but not in this case and was concerned there
> was a reason behind using SingleFile.Ext to split so I chose to change it as
> minimally as possible to avoid unintended side effects. I can switch to using
> os.path.splitext as well if that would be more desired.
> 
> Matthew
> 
> From: Carsey, Jaben 
> Sent: Friday, October 5, 2018 11:13 AM
> To: Yeazel (Prime Air), Matt; edk2-devel@lists.01.org
> Subject: RE: [edk2] [PATCH] BaseTools: Add support for dots in paths
> 
> Matthew,
> 
> Would os.path. (maybe splitext) be a better function than using
> the string  rsplit function?  It just seems like we should use the python file
> path manipulation functions instead of trying to trick the string manipulation
> routines into the same behavior...
> 
> -Jaben
> 
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> > Matthew Yeazel
> > Sent: Friday, October 05, 2018 10:13 AM
> > To: edk2-devel@lists.01.org
> > Cc: Matthew Yeazel 
> > Subject: [edk2] [PATCH] BaseTools: Add support for dots in paths
> >
> > The split assumes that there isn't a dot in the path to the file but
> > this isn't always the case. This will support more diverse paths.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Note: Section 3, paragraph 1, is read as an OR.
> > Signed-off-by: Matthew Yeazel 
> > ---
> >  BaseTools/Source/Python/AutoGen/AutoGen.py | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
> > b/BaseTools/Source/Python/AutoGen/AutoGen.py
> > index eb1b283889..54ad4a5247 100644
> > --- a/BaseTools/Source/Python/AutoGen/AutoGen.py
> > +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
> > @@ -3062,7 +3062,7 @@ class ModuleAutoGen(AutoGen):
> >  self.BuildOption
> >  for SingleFile in FileList:
> >  if self.BuildRuleOrder and SingleFile.Ext in 
> > self.BuildRuleOrder and
> > SingleFile.Ext in self.BuildRules:
> > -key = SingleFile.Path.split(SingleFile.Ext)[0]
> > +key = SingleFile.Path.rsplit(SingleFile.Ext, 1)[0]
> >  if key in Order_Dict:
> >  Order_Dict[key].append(SingleFile.Ext)
> >  else:
> > --
> > 2.19.0
> >
> > ___
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] Event Invitation: TianoCore Community Meeting - NAMO / APAC

2018-10-05 Thread stephano
stephano  has invited you to TianoCore 
Community Meeting - NAMO / APAC

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


[edk2] Event Invitation: TianoCore Community Meeting - NAMO / EMEA

2018-10-05 Thread stephano
stephano  has invited you to TianoCore 
Community Meeting - NAMO / EMEA

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


[edk2] [PATCH] MdePkg-BaseLib: Fix PathCleanUpDirectories() issue with "\\..\\.."

2018-10-05 Thread Jim.Dailey
Replace multiple, consecutive "\" characters prior to other processing
involving "\" characters.  This fixes an issue where "\\..\\..",
"//..//..", and similar input paths are not cleaned properly.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jim Dailey 
---
 MdePkg/Library/BaseLib/FilePaths.c | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/MdePkg/Library/BaseLib/FilePaths.c 
b/MdePkg/Library/BaseLib/FilePaths.c
index d6f3758ecb..c5ca0a3b77 100644
--- a/MdePkg/Library/BaseLib/FilePaths.c
+++ b/MdePkg/Library/BaseLib/FilePaths.c
@@ -2,6 +2,7 @@
   Defines file-path manipulation functions.
 
   Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.
+  Copyright (c) 2018, Dell Technologies. 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 be 
found at
@@ -85,6 +86,13 @@ PathCleanUpDirectories(
 }
   }
 
+  //
+  // Replace the "\\" with "\"
+  //
+  while ((TempString = StrStr (Path, L"")) != NULL) {
+CopyMem (TempString, TempString + 1, StrSize (TempString + 1));
+  }
+
   //
   // Remove all the "\.". E.g.: fs0:\abc\.\def\.
   //
@@ -106,13 +114,6 @@ PathCleanUpDirectories(
 CopyMem (Path + StrLen (Path), TempString + 3, StrSize (TempString + 3));
   }
 
-  //
-  // Replace the "\\" with "\"
-  //
-  while ((TempString = StrStr (Path, L"")) != NULL) {
-CopyMem (TempString, TempString + 1, StrSize (TempString + 1));
-  }
-
   return Path;
 }
 
-- 
2.17.0.windows.1

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


Re: [edk2] [PATCH] BaseTools: Add support for dots in paths

2018-10-05 Thread Carsey, Jaben
Matthew,

Would os.path. (maybe splitext) be a better function than using the 
string  rsplit function?  It just seems like we should use the python file path 
manipulation functions instead of trying to trick the string manipulation 
routines into the same behavior...

-Jaben

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Matthew Yeazel
> Sent: Friday, October 05, 2018 10:13 AM
> To: edk2-devel@lists.01.org
> Cc: Matthew Yeazel 
> Subject: [edk2] [PATCH] BaseTools: Add support for dots in paths
> 
> The split assumes that there isn't a dot in the path to the file but
> this isn't always the case. This will support more diverse paths.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Note: Section 3, paragraph 1, is read as an OR.
> Signed-off-by: Matthew Yeazel 
> ---
>  BaseTools/Source/Python/AutoGen/AutoGen.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
> b/BaseTools/Source/Python/AutoGen/AutoGen.py
> index eb1b283889..54ad4a5247 100644
> --- a/BaseTools/Source/Python/AutoGen/AutoGen.py
> +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
> @@ -3062,7 +3062,7 @@ class ModuleAutoGen(AutoGen):
>  self.BuildOption
>  for SingleFile in FileList:
>  if self.BuildRuleOrder and SingleFile.Ext in self.BuildRuleOrder 
> and
> SingleFile.Ext in self.BuildRules:
> -key = SingleFile.Path.split(SingleFile.Ext)[0]
> +key = SingleFile.Path.rsplit(SingleFile.Ext, 1)[0]
>  if key in Order_Dict:
>  Order_Dict[key].append(SingleFile.Ext)
>  else:
> --
> 2.19.0
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg: Create a homefilesystem environment variable

2018-10-05 Thread Laszlo Ersek
On 10/05/18 17:00, Carsey, Jaben wrote:
> 
> 
>> -Original Message-
>> From: Laszlo Ersek [mailto:ler...@redhat.com]
>> Sent: Friday, October 05, 2018 4:33 AM
>> To: Carsey, Jaben ; Andrew Fish
>> 
>> Cc: edk2-devel@lists.01.org
>> Subject: Re: [edk2] [PATCH] ShellPkg: Create a homefilesystem environment
>> variable
>> Importance: High
>>
>> On 10/04/18 22:54, Carsey, Jaben wrote:
>>> Laszlo,
>>>
>>> The leading "_" was required for out of spec, but built in, commands.  The
>> spec has no restrictions on environment variables except some have special
>> meaning and may be read only.
>>>
>>> I can certainly work on slowing down the process.  I have been complaining
>> about that same thing and should have been more aware.  I would like to
>> have a community minimum amount of time before commits are done that
>> we all agree to.  Something like 1 full day would be nice I think.
>>
>> Good idea! I believe 24 hours should be tolerable on all ends. It also
>> gives a chance to people in other time zones to comment.
> 
> So how do we proceed?  What's the "deciding method" to have a minimum time to 
> allow for reviews?

I think we can handle this as part of the following:

https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html

Thanks
Laszlo

> 
>>
>> I think there should be one exception: grave regressions -- build
>> failures, or total boot failures -- should be possible to revert (or
>> fix) as soon as there's one review.
> 
> Agreed.  We need some way around when an error is made.
> 
>>
>> Thanks!
>> Laszlo

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


[edk2] [PATCH 1/2] MdeModulePkg/SdMmcPciHcDxe: Add controller version defines

2018-10-05 Thread Jeff Brasen
Add SDHCI controller defines, this is useful as the version in the
register does not explictly map to a specification version. For example
vesion 4.10 of the specification is version 0x04.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jeff Brasen 
---
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c|  4 ++--
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c |  2 +-
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h | 10 ++
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c 
b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
index 8c93933..d3f77ed 100644
--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
@@ -978,9 +978,9 @@ SdCardIdentification (
 return Status;
   }
 
-  if ((ControllerVer & 0xFF) == 2) {
+  if ((ControllerVer & 0xFF) == SD_MMC_HC_CTRL_VER_300) {
 S18r = TRUE;
-  } else if (((ControllerVer & 0xFF) == 0) || ((ControllerVer & 0xFF) == 1)) {
+  } else if (((ControllerVer & 0xFF) == SD_MMC_HC_CTRL_VER_100) || 
((ControllerVer & 0xFF) == SD_MMC_HC_CTRL_VER_200)) {
 S18r = FALSE;
   } else {
 ASSERT (FALSE);
diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c 
b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
index 25771dc..3b9a184 100644
--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
@@ -782,7 +782,7 @@ SdMmcHcClockSupply (
   //
   // Set SDCLK Frequency Select and Internal Clock Enable fields in Clock 
Control register.
   //
-  if ((ControllerVer & 0xFF) == 2) {
+  if ((ControllerVer & 0xFF) == SD_MMC_HC_CTRL_VER_300) {
 ASSERT (Divisor <= 0x3FF);
 ClockCtrl = ((Divisor & 0xFF) << 8) | ((Divisor & 0x300) >> 2);
   } else if (((ControllerVer & 0xFF) == 0) || ((ControllerVer & 0xFF) == 1)) {
diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h 
b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
index e389d52..7e3f588 100644
--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
@@ -135,6 +135,16 @@ typedef struct {
   UINT32   Hs400:1;   // bit 63
 } SD_MMC_HC_SLOT_CAP;
 
+//
+// SD Host controller version
+//
+#define SD_MMC_HC_CTRL_VER_100  0x00
+#define SD_MMC_HC_CTRL_VER_200  0x01
+#define SD_MMC_HC_CTRL_VER_300  0x02
+#define SD_MMC_HC_CTRL_VER_400  0x03
+#define SD_MMC_HC_CTRL_VER_410  0x04
+#define SD_MMC_HC_CTRL_VER_420  0x05
+
 /**
   Dump the content of SD/MMC host controller's Capability Register.
 
-- 
2.7.4


---
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
---
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH 2/2] MdeModulePkg/SdMmcPciHcDxe: Allow additional SDHCI versions

2018-10-05 Thread Jeff Brasen
Clock control is similar in SDHCI versions greater then version 3. Add
support for more recent versions of the controller specification.

SD card support for 1.8V is also present in controller versions 3 and
greater.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jeff Brasen 
---
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c| 2 +-
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c 
b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
index d3f77ed..12b4659 100644
--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
@@ -978,7 +978,7 @@ SdCardIdentification (
 return Status;
   }
 
-  if ((ControllerVer & 0xFF) == SD_MMC_HC_CTRL_VER_300) {
+  if ((ControllerVer & 0xFF) >= SD_MMC_HC_CTRL_VER_300) {
 S18r = TRUE;
   } else if (((ControllerVer & 0xFF) == SD_MMC_HC_CTRL_VER_100) || 
((ControllerVer & 0xFF) == SD_MMC_HC_CTRL_VER_200)) {
 S18r = FALSE;
diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c 
b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
index 3b9a184..de282bf 100644
--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
@@ -782,7 +782,7 @@ SdMmcHcClockSupply (
   //
   // Set SDCLK Frequency Select and Internal Clock Enable fields in Clock 
Control register.
   //
-  if ((ControllerVer & 0xFF) == SD_MMC_HC_CTRL_VER_300) {
+  if ((ControllerVer & 0xFF) >= SD_MMC_HC_CTRL_VER_300) {
 ASSERT (Divisor <= 0x3FF);
 ClockCtrl = ((Divisor & 0xFF) << 8) | ((Divisor & 0x300) >> 2);
   } else if (((ControllerVer & 0xFF) == 0) || ((ControllerVer & 0xFF) == 1)) {
-- 
2.7.4


---
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
---
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [RFC] Create new edk2-test repo

2018-10-05 Thread Supreeth Venkatesh
Thanks Mike. I second that.
Also, UEFI-SCT needs to find a place within edk2-test.
Hope we can get this created before UEFI Taipei PlugFest (Oct 16) and after 
everyone's comments/review and approval.

Thanks,
Supreeth

-Original Message-
From: edk2-devel  On Behalf Of Kinney, Michael 
D
Sent: Tuesday, September 25, 2018 6:34 PM
To: edk2-devel@lists.01.org; Kinney, Michael D 
Subject: [edk2] [RFC] Create new edk2-test repo

This is a proposal to create a new repository for tests called edk2-test.

The purpose of this repository is to provide test harnesses and test cases to 
test EDK II based firmware.

There is test related content in edk2-staging branches and as that content is 
completed, a location for tests is required.  This will provide core and 
platform developers the ability to test changes before commits are made and 
also provide a place to add new test cases for new features and functionality.

Thanks,

Mike
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v3 1/1] OvmfPkg/PlatformPei: clear CPU caches

2018-10-05 Thread Kinney, Michael D
Reviewed-by: Michael D Kinney 

Mike

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-
> boun...@lists.01.org] On Behalf Of
> marcandre.lur...@redhat.com
> Sent: Tuesday, October 2, 2018 5:17 AM
> To: edk2-devel@lists.01.org
> Cc: Justen, Jordan L ;
> Anthony Perard ; Laszlo Ersek
> 
> Subject: [edk2] [PATCH v3 1/1] OvmfPkg/PlatformPei:
> clear CPU caches
> 
> From: Marc-André Lureau 
> 
> This is for conformance with the TCG "Platform Reset
> Attack Mitigation
> Specification". Because clearing the CPU caches at boot
> doesn't impact
> performance significantly, do it unconditionally, for
> simplicity's
> sake.
> 
> Flush the cache on all logical processors, thanks to
> EFI_PEI_MP_SERVICES_PPI and CacheMaintenanceLib.
> 
> Cc: Jordan Justen 
> Cc: Laszlo Ersek 
> Cc: Ard Biesheuvel 
> Cc: Anthony Perard 
> Cc: Julien Grall 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Marc-André Lureau
> 
> Message-Id: <20181002120730.13013-1-
> marcandre.lur...@redhat.com>
> ---
> 
> v3:
>   - update top comment with notes about TCG spec
>   - sort headers inclusion
> 
>  OvmfPkg/PlatformPei/PlatformPei.inf |   2 +
>  OvmfPkg/PlatformPei/Platform.h  |   5 +
>  OvmfPkg/PlatformPei/ClearCache.c| 117
> 
>  OvmfPkg/PlatformPei/Platform.c  |   1 +
>  4 files changed, 125 insertions(+)
> 
> diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf
> b/OvmfPkg/PlatformPei/PlatformPei.inf
> index 9c5ad9961c4a..5c8dd0fe6d72 100644
> --- a/OvmfPkg/PlatformPei/PlatformPei.inf
> +++ b/OvmfPkg/PlatformPei/PlatformPei.inf
> @@ -30,6 +30,7 @@
> 
>  [Sources]
>AmdSev.c
> +  ClearCache.c
>Cmos.c
>Cmos.h
>FeatureControl.c
> @@ -54,6 +55,7 @@
> 
>  [LibraryClasses]
>BaseLib
> +  CacheMaintenanceLib
>DebugLib
>HobLib
>IoLib
> diff --git a/OvmfPkg/PlatformPei/Platform.h
> b/OvmfPkg/PlatformPei/Platform.h
> index f942e61bb4f9..b12a5c1f5f78 100644
> --- a/OvmfPkg/PlatformPei/Platform.h
> +++ b/OvmfPkg/PlatformPei/Platform.h
> @@ -83,6 +83,11 @@ InstallFeatureControlCallback (
>VOID
>);
> 
> +VOID
> +InstallClearCacheCallback (
> +  VOID
> +  );
> +
>  EFI_STATUS
>  InitializeXen (
>VOID
> diff --git a/OvmfPkg/PlatformPei/ClearCache.c
> b/OvmfPkg/PlatformPei/ClearCache.c
> new file mode 100644
> index ..7d15fd925c3c
> --- /dev/null
> +++ b/OvmfPkg/PlatformPei/ClearCache.c
> @@ -0,0 +1,117 @@
> +/**@file
> +  Install a callback to clear cache on all processors.
> +  This is for conformance with the TCG "Platform Reset
> Attack Mitigation
> +  Specification". Because clearing the CPU caches at
> boot doesn't impact
> +  performance significantly, do it unconditionally, for
> simplicity's
> +  sake.
> +
> +  Copyright (C) 2018, Red Hat, Inc.
> +
> +  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 be
> found at
> +  http://opensource.org/licenses/bsd-license.php
> +
> +  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON
> AN "AS IS" BASIS, WITHOUT
> +  WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> EXPRESS OR IMPLIED.
> +**/
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include "Platform.h"
> +
> +/**
> +  Invalidate data & instruction caches.
> +  All APs execute this function in parallel. The BSP
> executes the function
> +  separately.
> +
> +  @param[in,out] WorkSpace  Pointer to the input/output
> argument workspace
> +shared by all processors.
> +**/
> +STATIC
> +VOID
> +EFIAPI
> +ClearCache (
> +  IN OUT VOID *WorkSpace
> +  )
> +{
> +  WriteBackInvalidateDataCache ();
> +  InvalidateInstructionCache ();
> +}
> +
> +/**
> +  Notification function called when
> EFI_PEI_MP_SERVICES_PPI becomes available.
> +
> +  @param[in] PeiServices  Indirect reference to the
> PEI Services Table.
> +  @param[in] NotifyDescriptor Address of the
> notification descriptor data
> +  structure.
> +  @param[in] Ppi  Address of the PPI that
> was installed.
> +
> +  @return  Status of the notification. The status code
> returned from this
> +   function is ignored.
> +**/
> +STATIC
> +EFI_STATUS
> +EFIAPI
> +ClearCacheOnMpServicesAvailable (
> +  IN EFI_PEI_SERVICES   **PeiServices,
> +  IN EFI_PEI_NOTIFY_DESCRIPTOR  *NotifyDescriptor,
> +  IN VOID   *Ppi
> +  )
> +{
> +  EFI_PEI_MP_SERVICES_PPI *MpServices;
> +  EFI_STATUS  Status;
> +
> +  DEBUG ((DEBUG_INFO, "%a: %a\n", gEfiCallerBaseName,
> __FUNCTION__));
> +
> +  //
> +  // Clear cache on all the APs in parallel.
> +  //
> +  MpServices = Ppi;
> +  Status = MpServices->StartupAllAPs (
> + (CONST EFI_PEI_SERVICES
> **)PeiServices,
> + MpServices,
> + ClearCache,  //
> Procedure
> +

Re: [edk2] [PATCH] Maintainers.txt: add DynamicTablesPkg

2018-10-05 Thread Kinney, Michael D
Reviewed-by: Michael D Kinney 

Mike

> -Original Message-
> From: Leif Lindholm [mailto:leif.lindh...@linaro.org]
> Sent: Tuesday, October 2, 2018 9:04 AM
> To: edk2-devel@lists.01.org
> Cc: Andrew Fish ; Laszlo Ersek
> ; Kinney, Michael D
> ; Evan Lloyd
> ; Sami Mujawar
> 
> Subject: [PATCH] Maintainers.txt: add DynamicTablesPkg
> 
> DynamicTablesPkg has been in edk2-staging[1] for some
> time now, and it is
> time for it to move into the main tree.
> [1] https://github.com/tianocore/edk2-
> staging/tree/dynamictables
> 
> Add Evan and Sami as maintainers of the new package, and
> let them bring
> it in themselves.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Leif Lindholm 
> ---
> 
> We'll need Reviewed-by: from both new maintainers.
> Github write permissions need to be added separately.
> 
> Please add some documentation at the specified URL
> before
> you import any code :)
> 
>  Maintainers.txt | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt
> index 7ebd53f662..072cf3ce8f 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -105,6 +105,11 @@ W:
> https://github.com/tianocore/tianocore.github.io/wiki/Du
> etPkg
>  M: Ruiyu Ni 
>  M: Hao Wu 
> 
> +DynamicTablesPkg
> +W:
> https://github.com/tianocore/tianocore.github.io/wiki/Dy
> namicTablesPkg
> +M: Evan Lloyd 
> +M: Sami Mujawar 
> +
>  EdkCompatibilityPkg
>  W:
> https://github.com/tianocore/tianocore.github.io/wiki/Ed
> kCompatibilityPkg
>  M: Liming Gao 
> --
> 2.11.0
D 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Openssl submodule

2018-10-05 Thread Knop, Ryszard
Hi,
Git submodules generally point at a specific commit, so if you go to 
https://github.com/tianocore/edk2/tree/master/CryptoPkg/Library/OpensslLib and 
click on the openssl submodule, you'll go to the exact referenced commit 
(currently d4e4bd2, pointing at the 1.1.0h release). It doesn't point at any 
specific branch because it's a moving target.
Richard

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of TVKR
Sent: Friday, October 5, 2018 16:55
To: edk2-devel@lists.01.org
Subject: [edk2] Openssl submodule

Hi,

It is not clear if the recent change to add OpenSSL as a submodule will pull 
the code from the master branch of "https://github.com/openssl/openssl;
or any other branch like "OpenSSL_1_1_0-stable" or "OpenSSL_1_1_1-stable".
Can some one please clarify?

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


Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial 
Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | 
Kapital zakladowy 200.000 PLN.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i 
moze zawierac informacje poufne. W razie przypadkowego otrzymania tej 
wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; 
jakiekolwiek
przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole 
use of the intended recipient(s). If you are not the intended recipient, please 
contact the sender and delete all copies; any review or distribution by
others is strictly prohibited.

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


Re: [edk2] [PATCH v1 1/1] EmbeddedPkg/Drivers: add DwUsbDxe

2018-10-05 Thread Leif Lindholm
On Tue, Aug 21, 2018 at 07:35:13PM +0800, Haojian Zhuang wrote:
> Add Designware USB 2.0 device driver that is used on HiKey platform.
> 
> Cc: Leif Lindholm 
> Cc: Ard Biesheuvel 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Haojian Zhuang 
> ---
>  EmbeddedPkg/Drivers/DwUsbDxe/DwUsbDxe.dec |  45 +
>  EmbeddedPkg/Drivers/DwUsbDxe/DwUsbDxe.inf |  52 ++
>  EmbeddedPkg/Drivers/DwUsbDxe/DwUsbDxe.h   | 655 ++
>  EmbeddedPkg/Drivers/DwUsbDxe/DwUsbDxe.c   | 912 
>  4 files changed, 1664 insertions(+)

Could it be renamed DwUsb2? This seems to match how Synopsys
themselves refer to it, and what the Linux driver is called.

Other than that, same comments as for DwUsb3Dxe - please move it to
edk2-platforms and convert it to UEFI driver model with
NonDiscoverableDeviceRegistrationLib.

Hmm, it also looks to me like there are plenty of things here
hardcoded for the use as a device for fastboot. I don't object to
that being the only support submitted, you made it clear when you
posted it. But the code is completely geared towards this, and I feel
if someone comes along and want to add the functionality to run it in
host mode.

I expect I will find the same when I look at the reworked version of DwUsb3Dxe.

Is there anything you can do to break out the generic device
configuration bits from the bits that assume there are two endpoints
and they are being used for fastboot?

> 
> diff --git a/EmbeddedPkg/Drivers/DwUsbDxe/DwUsbDxe.dec 
> b/EmbeddedPkg/Drivers/DwUsbDxe/DwUsbDxe.dec
> new file mode 100644
> index ..7eb65e498c04
> --- /dev/null
> +++ b/EmbeddedPkg/Drivers/DwUsbDxe/DwUsbDxe.dec
> @@ -0,0 +1,45 @@
> +#/** @file
> +# Framework Module Development Environment Industry Standards
> +#
> +# This Package provides headers and libraries that conform to EFI/PI 
> Industry standards.
> +# Copyright (c) 2007, Intel Corporation. All rights reserved.
> +# Copyright (c) 2012-2014, ARM Ltd. All rights reserved.
> +# Copyright (c) 2018, Linaro. All rights reserved.

Same comments as for DwUsb3 - please merge these two into a common one
for both drivers (if still needed).

> +#
> +#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 be found at
> +#http://opensource.org/licenses/bsd-license.php
> +#
> +#THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +#WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> +#
> +#**/
> +
> +[Defines]
> +  DEC_SPECIFICATION  = 0x00010019
> +  PACKAGE_NAME   = DwUsbDxePkg
> +  PACKAGE_GUID   = 114a3be9-10f7-4bf1-81ca-09ac52d4c3d5
> +  PACKAGE_VERSION= 0.1
> +
> +
> +
> +#
> +# Include Section - list of Include Paths that are provided by this package.
> +#   Comments are used for Keywords and Module Types.
> +#
> +# Supported Module Types:
> +#  BASE SEC PEI_CORE PEIM DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER 
> DXE_SMM_DRIVER DXE_SAL_DRIVER UEFI_DRIVER UEFI_APPLICATION
> +#
> +
> +
> +[Guids.common]
> +  gDwUsbDxeTokenSpaceGuid   = { 0x131c4d02, 0x9449, 0x4ee9, { 0xba, 
> 0x3d, 0x69, 0x50, 0x21, 0x89, 0x26, 0x0b }}
> +
> +[Protocols.common]
> +  gDwUsbProtocolGuid= { 0x109fa264, 0x7811, 0x4862, { 0xa9, 
> 0x73, 0x4a, 0xb2, 0xef, 0x2e, 0xe2, 0xff }}
> +
> +[PcdsFixedAtBuild.common]
> +  # DwUsb Driver PCDs
> +  gDwUsbDxeTokenSpaceGuid.PcdDwUsbDxeBaseAddress|0x0|UINT32|0x0001
> +  gDwUsbDxeTokenSpaceGuid.PcdSysCtrlBaseAddress|0x0|UINT32|0x0002

I don't see PcdSysCtrlBaseAddress used anywhere in this patch? It also
doesn't sound like something that should be an aspect of the USB
controller driver.

> diff --git a/EmbeddedPkg/Drivers/DwUsbDxe/DwUsbDxe.inf 
> b/EmbeddedPkg/Drivers/DwUsbDxe/DwUsbDxe.inf
> new file mode 100644
> index ..56d518c27c32
> --- /dev/null
> +++ b/EmbeddedPkg/Drivers/DwUsbDxe/DwUsbDxe.inf
> @@ -0,0 +1,52 @@
> +#/** @file
> +#
> +#  Copyright (c) 2018, Linaro. 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 be found at
> +#  http://opensource.org/licenses/bsd-license.php
> +#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> +#
> +#
> +#**/
> +
> +[Defines]
> +  INF_VERSION= 0x00010019
> +  BASE_NAME  = DwUsbDxe
> +  FILE_GUID  = 

Re: [edk2] [PATCH v2 2/4] MdeModulePkg/SdMmcPciHcDxe: Add UhsSignaling to SdMmcOverride protocol

2018-10-05 Thread Marcin Wojtas
pt., 5 paź 2018 o 17:12 Philippe Mathieu-Daudé  napisał(a):
>
> Hi Marcin, Tomasz.
>
> On 05/10/2018 15:25, Marcin Wojtas wrote:
> > From: Tomasz Michalec 
> >
> > Some SD Host Controlers use different values in Host Control 2 Register
>
> My two cents, in various places "Controler" is miswritten, this should
> be "Controller".

Thanks, missed that. It will be corrected in the next revision.

Best regards,
Marcin

>
> > to select UHS Mode. This patch adds a new UhsSignaling type routine to
> > the NotifyPhase of the SdMmcOverride protocol.
> >
> > UHS signaling configuration is moved to a common, default routine
> > (SdMmcHcUhsSignaling), which is called when SdMmcOverride does not
> > cover this functionality.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Marcin Wojtas 
> > ---
> >  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h |  50 +++
> >  MdeModulePkg/Include/Protocol/SdMmcOverride.h|   2 +
> >  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c  | 153 
> >  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c|  37 +++--
> >  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c |  69 +
> >  5 files changed, 243 insertions(+), 68 deletions(-)
> >
> > diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h 
> > b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
> > index e389d52..a03160d 100644
> > --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
> > +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
> > @@ -63,6 +63,39 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, 
> > EITHER EXPRESS OR IMPLIED.
> >  #define SD_MMC_HC_CTRL_VER0xFE
> >
> >  //
> > +// SD Host Controler bits to HOST_CTRL2 register
> > +//
> > +#define SD_MMC_HC_CTRL_UHS_MASK   0x0007
> > +#define SD_MMC_HC_CTRL_UHS_SDR12  0x
> > +#define SD_MMC_HC_CTRL_UHS_SDR25  0x0001
> > +#define SD_MMC_HC_CTRL_UHS_SDR50  0x0002
> > +#define SD_MMC_HC_CTRL_UHS_SDR104 0x0003
> > +#define SD_MMC_HC_CTRL_UHS_DDR50  0x0004
> > +#define SD_MMC_HC_CTRL_MMC_DDR52  0x0004
> > +#define SD_MMC_HC_CTRL_MMC_SDR50  0x0002
> > +#define SD_MMC_HC_CTRL_MMC_SDR25  0x0001
> > +#define SD_MMC_HC_CTRL_MMC_SDR12  0x
> > +#define SD_MMC_HC_CTRL_HS200  0x0003
> > +#define SD_MMC_HC_CTRL_HS400  0x0005
> > +
> > +//
> > +// Timing modes for uhs
> > +//
> > +typedef enum {
> > +  SdMmcUhsSdr12,
> > +  SdMmcUhsSdr25,
> > +  SdMmcUhsSdr50,
> > +  SdMmcUhsSdr104,
> > +  SdMmcUhsDdr50,
> > +  SdMmcMmcDdr52,
> > +  SdMmcMmcSdr50,
> > +  SdMmcMmcSdr25,
> > +  SdMmcMmcSdr12,
> > +  SdMmcMmcHs200,
> > +  SdMmcMmcHs400,
> > +} SD_MMC_UHS_TIMING;
> > +
> > +//
> >  // The transfer modes supported by SD Host Controller
> >  // Simplified Spec 3.0 Table 1-2
> >  //
> > @@ -508,4 +541,21 @@ SdMmcHcInitTimeoutCtrl (
> >IN UINT8  Slot
> >);
> >
> > +/**
> > +  Set SD Host Controler control 2 registry according to selected speed.
> > +
> > +  @param[in] PciIo  The PCI IO protocol instance.
> > +  @param[in] Slot   The slot number of the SD card to send the 
> > command to.
> > +  @param[in] Timing The timing to select.
> > +
> > +  @retval EFI_SUCCESS   The timing is set successfully.
> > +  @retval OthersThe timing isn't set successfully.
> > +**/
> > +EFI_STATUS
> > +SdMmcHcUhsSignaling (
> > +  IN EFI_PCI_IO_PROTOCOL*PciIo,
> > +  IN UINT8  Slot,
> > +  IN SD_MMC_UHS_TIMING  Timing
> > +  );
> > +
> >  #endif
> > diff --git a/MdeModulePkg/Include/Protocol/SdMmcOverride.h 
> > b/MdeModulePkg/Include/Protocol/SdMmcOverride.h
> > index 178945f..25db98a 100644
> > --- a/MdeModulePkg/Include/Protocol/SdMmcOverride.h
> > +++ b/MdeModulePkg/Include/Protocol/SdMmcOverride.h
> > @@ -17,6 +17,7 @@
> >  #ifndef __SD_MMC_OVERRIDE_H__
> >  #define __SD_MMC_OVERRIDE_H__
> >
> > +#include 
> >  #include 
> >
> >  #define EDKII_SD_MMC_OVERRIDE_PROTOCOL_GUID \
> > @@ -31,6 +32,7 @@ typedef enum {
> >EdkiiSdMmcResetPost,
> >EdkiiSdMmcInitHostPre,
> >EdkiiSdMmcInitHostPost,
> > +  EdkiiSdMmcUhsSignaling,
> >  } EDKII_SD_MMC_PHASE_TYPE;
> >
> >  /**
> > diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c 
> > b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c
> > index c5fd214..05bd4a0 100755
> > --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c
> > +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c
> > @@ -740,10 +740,13 @@ EmmcSwitchToHighSpeed (
> >IN UINT8  BusWidth
> >)
> >  {
> > -  EFI_STATUS  Status;
> > -  UINT8   HsTiming;
> > -  UINT8   HostCtrl1;
> > -  UINT8   HostCtrl2;
> > +  EFI_STATUS  Status;
> > +  UINT8   HsTiming;
> > +  UINT8   HostCtrl1;
> > +  SD_MMC_UHS_TIMING   Timing;
> > +  SD_MMC_HC_PRIVATE_DATA  *Private;
> > +
> > +  Private = SD_MMC_HC_PRIVATE_FROM_THIS (PassThru);
> >
> >

Re: [edk2] [PATCH v2 2/4] MdeModulePkg/SdMmcPciHcDxe: Add UhsSignaling to SdMmcOverride protocol

2018-10-05 Thread Philippe Mathieu-Daudé
Hi Marcin, Tomasz.

On 05/10/2018 15:25, Marcin Wojtas wrote:
> From: Tomasz Michalec 
> 
> Some SD Host Controlers use different values in Host Control 2 Register

My two cents, in various places "Controler" is miswritten, this should
be "Controller".

> to select UHS Mode. This patch adds a new UhsSignaling type routine to
> the NotifyPhase of the SdMmcOverride protocol.
> 
> UHS signaling configuration is moved to a common, default routine
> (SdMmcHcUhsSignaling), which is called when SdMmcOverride does not
> cover this functionality.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Marcin Wojtas 
> ---
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h |  50 +++
>  MdeModulePkg/Include/Protocol/SdMmcOverride.h|   2 +
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c  | 153 
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c|  37 +++--
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c |  69 +
>  5 files changed, 243 insertions(+), 68 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h 
> b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
> index e389d52..a03160d 100644
> --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
> +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
> @@ -63,6 +63,39 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
> EXPRESS OR IMPLIED.
>  #define SD_MMC_HC_CTRL_VER0xFE
>  
>  //
> +// SD Host Controler bits to HOST_CTRL2 register
> +//
> +#define SD_MMC_HC_CTRL_UHS_MASK   0x0007
> +#define SD_MMC_HC_CTRL_UHS_SDR12  0x
> +#define SD_MMC_HC_CTRL_UHS_SDR25  0x0001
> +#define SD_MMC_HC_CTRL_UHS_SDR50  0x0002
> +#define SD_MMC_HC_CTRL_UHS_SDR104 0x0003
> +#define SD_MMC_HC_CTRL_UHS_DDR50  0x0004
> +#define SD_MMC_HC_CTRL_MMC_DDR52  0x0004
> +#define SD_MMC_HC_CTRL_MMC_SDR50  0x0002
> +#define SD_MMC_HC_CTRL_MMC_SDR25  0x0001
> +#define SD_MMC_HC_CTRL_MMC_SDR12  0x
> +#define SD_MMC_HC_CTRL_HS200  0x0003
> +#define SD_MMC_HC_CTRL_HS400  0x0005
> +
> +//
> +// Timing modes for uhs
> +//
> +typedef enum {
> +  SdMmcUhsSdr12,
> +  SdMmcUhsSdr25,
> +  SdMmcUhsSdr50,
> +  SdMmcUhsSdr104,
> +  SdMmcUhsDdr50,
> +  SdMmcMmcDdr52,
> +  SdMmcMmcSdr50,
> +  SdMmcMmcSdr25,
> +  SdMmcMmcSdr12,
> +  SdMmcMmcHs200,
> +  SdMmcMmcHs400,
> +} SD_MMC_UHS_TIMING;
> +
> +//
>  // The transfer modes supported by SD Host Controller
>  // Simplified Spec 3.0 Table 1-2
>  //
> @@ -508,4 +541,21 @@ SdMmcHcInitTimeoutCtrl (
>IN UINT8  Slot
>);
>  
> +/**
> +  Set SD Host Controler control 2 registry according to selected speed.
> +
> +  @param[in] PciIo  The PCI IO protocol instance.
> +  @param[in] Slot   The slot number of the SD card to send the 
> command to.
> +  @param[in] Timing The timing to select.
> +
> +  @retval EFI_SUCCESS   The timing is set successfully.
> +  @retval OthersThe timing isn't set successfully.
> +**/
> +EFI_STATUS
> +SdMmcHcUhsSignaling (
> +  IN EFI_PCI_IO_PROTOCOL*PciIo,
> +  IN UINT8  Slot,
> +  IN SD_MMC_UHS_TIMING  Timing
> +  );
> +
>  #endif
> diff --git a/MdeModulePkg/Include/Protocol/SdMmcOverride.h 
> b/MdeModulePkg/Include/Protocol/SdMmcOverride.h
> index 178945f..25db98a 100644
> --- a/MdeModulePkg/Include/Protocol/SdMmcOverride.h
> +++ b/MdeModulePkg/Include/Protocol/SdMmcOverride.h
> @@ -17,6 +17,7 @@
>  #ifndef __SD_MMC_OVERRIDE_H__
>  #define __SD_MMC_OVERRIDE_H__
>  
> +#include 
>  #include 
>  
>  #define EDKII_SD_MMC_OVERRIDE_PROTOCOL_GUID \
> @@ -31,6 +32,7 @@ typedef enum {
>EdkiiSdMmcResetPost,
>EdkiiSdMmcInitHostPre,
>EdkiiSdMmcInitHostPost,
> +  EdkiiSdMmcUhsSignaling,
>  } EDKII_SD_MMC_PHASE_TYPE;
>  
>  /**
> diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c 
> b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c
> index c5fd214..05bd4a0 100755
> --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c
> +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c
> @@ -740,10 +740,13 @@ EmmcSwitchToHighSpeed (
>IN UINT8  BusWidth
>)
>  {
> -  EFI_STATUS  Status;
> -  UINT8   HsTiming;
> -  UINT8   HostCtrl1;
> -  UINT8   HostCtrl2;
> +  EFI_STATUS  Status;
> +  UINT8   HsTiming;
> +  UINT8   HostCtrl1;
> +  SD_MMC_UHS_TIMING   Timing;
> +  SD_MMC_HC_PRIVATE_DATA  *Private;
> +
> +  Private = SD_MMC_HC_PRIVATE_FROM_THIS (PassThru);
>  
>Status = EmmcSwitchBusWidth (PciIo, PassThru, Slot, Rca, IsDdr, BusWidth);
>if (EFI_ERROR (Status)) {
> @@ -758,27 +761,37 @@ EmmcSwitchToHighSpeed (
>  return Status;
>}
>  
> -  //
> -  // Clean UHS Mode Select field of Host Control 2 reigster before update
> -  //
> -  HostCtrl2 = (UINT8)~0x7;
> -  Status = SdMmcHcAndMmio (PciIo, Slot, SD_MMC_HC_HOST_CTRL2, sizeof 
> (HostCtrl2), );
> -  if 

Re: [edk2] [PATCH v3 1/1] ArmPkg/OpteeLib: Add APIs to communicate with OP-TEE

2018-10-05 Thread Leif Lindholm
On Wed, Oct 03, 2018 at 11:33:01AM +0200, Ard Biesheuvel wrote:
> On 3 October 2018 at 09:43, Sumit Garg  wrote:
> > Add following APIs to communicate with OP-TEE pseudo/early TAs:
> > 1. OpteeInit
> > 2. OpteeOpenSession
> > 3. OpteeCloseSession
> > 4. OpteeInvokeFunc
> >
> > Cc: Ard Biesheuvel 
> > Cc: Leif Lindholm 
> > Cc: Michael D Kinney 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Sumit Garg 
> 
> Given the outcome of the GP discussion, I'm fine with this approach. Leif?

Apologies for the delay, I needed some time to think it over.

I'm not super happy about this approach, but I'm happier with this
than I would be with leaving the functionality out of the upstream
tree. I really hope we can get that license either changed or dropped
completely.

I do have a few comments below.

> > ---
> >  ArmPkg/Include/Library/OpteeLib.h|  90 +
> >  ArmPkg/Library/OpteeLib/Optee.c  | 357 
> > +++
> >  ArmPkg/Library/OpteeLib/OpteeLib.inf |   2 +
> >  ArmPkg/Library/OpteeLib/OpteeSmc.h   |  43 +

Could you follow the instructions in
https://github.com/tianocore/tianocore.github.io/wiki/Laszlo's-unkempt-git-guide-for-edk2-contributors-and-maintainers#contrib-23
when generating future patches?
The --stat* effects aren't apparent here, but the -O ones are.

> >  4 files changed, 492 insertions(+)
> >  create mode 100644 ArmPkg/Library/OpteeLib/OpteeSmc.h
> >
> > diff --git a/ArmPkg/Include/Library/OpteeLib.h 
> > b/ArmPkg/Include/Library/OpteeLib.h
> > index f65d8674d9b8..2d1c60632dfe 100644
> > --- a/ArmPkg/Include/Library/OpteeLib.h
> > +++ b/ArmPkg/Include/Library/OpteeLib.h
> > @@ -25,10 +25,100 @@
> >  #define OPTEE_OS_UID2  0xaf630002
> >  #define OPTEE_OS_UID3  0xa5d5c51b
> >
> > +#define OPTEE_MSG_ATTR_TYPE_NONE0x0
> > +#define OPTEE_MSG_ATTR_TYPE_VALUE_INPUT 0x1
> > +#define OPTEE_MSG_ATTR_TYPE_VALUE_OUTPUT0x2
> > +#define OPTEE_MSG_ATTR_TYPE_VALUE_INOUT 0x3
> > +#define OPTEE_MSG_ATTR_TYPE_MEM_INPUT   0x9
> > +#define OPTEE_MSG_ATTR_TYPE_MEM_OUTPUT  0xa
> > +#define OPTEE_MSG_ATTR_TYPE_MEM_INOUT   0xb
> > +
> > +#define OPTEE_MSG_ATTR_TYPE_MASK0xff
> > +
> > +#define OPTEE_ORIGIN_COMMS  0x0002
> > +#define OPTEE_ERROR_COMMS   0x000E
> > +
> > +typedef struct {
> > +  UINT64BufPtr;

If it's a pointer, it has a *.
Otherwise it's an address.

> > +  UINT64Size;
> > +  UINT64ShmRef;

Abbreviations in function, variable or type names (other than the ones
defined in [1] are not permitted unless they are explicitly added to a
glossary section of the source file header. Where possible, just write
out the name in full.

[1] 
https://edk2-docs.gitbooks.io/edk-ii-c-coding-standards-specification/content/v/release/2.20/4_naming_conventions/#table-2-efi-supported-abbreviations

BufPtr (as a name) gets a pass since it's unambiguous and we already
have a bunch of those in the codebase. ShmRef needs to be clear.

(This comment also applies to a lot of things below, I won't point
them all out unless asked to.)

> > +} OPTEE_MSG_PARAM_MEM;
> > +
> > +typedef struct {
> > +  UINT64A;
> > +  UINT64B;
> > +  UINT64C;
> > +} OPTEE_MSG_PARAM_VALUE;
> > +
> > +typedef struct {
> > +  UINT64 Attr;
> > +  union {
> > +OPTEE_MSG_PARAM_MEM  Mem;
> > +OPTEE_MSG_PARAM_VALUEValue;
> > +  } U;
> > +} OPTEE_MSG_PARAM;
> > +
> > +#define MAX_PARAMS   4

This is a very localised macro with a very globalised name.
Suggest adding an OPTEE_ prefix, but also something describing what it
is the maximum parameters for. CALL_?

> > +
> > +typedef struct {
> > +UINT32 Cmd;
> > +UINT32 Func;
> > +UINT32 Session;
> > +UINT32 CancelId;
> > +UINT32 Pad;
> > +UINT32 Ret;
> > +UINT32 RetOrigin;
> > +UINT32 NumParams;
> > +
> > +// NumParams tells the actual number of element in Params
> > +OPTEE_MSG_PARAMParams[MAX_PARAMS];
> > +} OPTEE_MSG_ARG;
> > +
> > +#define OPTEE_UUID_LEN   16

UUIDs are UUIDs. If optee decides on an incompatible format, we may
have an interoperability issue. I assume this is not the case, so
perhaps replace with sizeof (EFI_GUID) at each point of use?

> > +
> > +typedef struct {
> > +UINT8 Uuid[OPTEE_UUID_LEN]; // [in] UUID of the Trusted 
> > Application

Is there a strong reason for not using EFI_GUID here?

> > +UINT32Session;  // [out] Session id
> > +UINT32Ret;  // [out] Return value
> > +UINT32RetOrigin;// [out] Origin of the return value
> > +} OPTEE_OPEN_SESSION_ARG;
> > +
> > +typedef struct {
> > +UINT32 Func;// [in] Trusted App func, specific to 
> > 

Re: [edk2] [PATCH] ShellPkg: Create a homefilesystem environment variable

2018-10-05 Thread Carsey, Jaben



> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Friday, October 05, 2018 4:33 AM
> To: Carsey, Jaben ; Andrew Fish
> 
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] [PATCH] ShellPkg: Create a homefilesystem environment
> variable
> Importance: High
> 
> On 10/04/18 22:54, Carsey, Jaben wrote:
> > Laszlo,
> >
> > The leading "_" was required for out of spec, but built in, commands.  The
> spec has no restrictions on environment variables except some have special
> meaning and may be read only.
> >
> > I can certainly work on slowing down the process.  I have been complaining
> about that same thing and should have been more aware.  I would like to
> have a community minimum amount of time before commits are done that
> we all agree to.  Something like 1 full day would be nice I think.
> 
> Good idea! I believe 24 hours should be tolerable on all ends. It also
> gives a chance to people in other time zones to comment.

So how do we proceed?  What's the "deciding method" to have a minimum time to 
allow for reviews?

> 
> I think there should be one exception: grave regressions -- build
> failures, or total boot failures -- should be possible to revert (or
> fix) as soon as there's one review.

Agreed.  We need some way around when an error is made.

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


[edk2] Openssl submodule

2018-10-05 Thread TVKR
Hi,

It is not clear if the recent change to add OpenSSL as a submodule will
pull the code from the master branch of "https://github.com/openssl/openssl;
or any other branch like "OpenSSL_1_1_0-stable" or "OpenSSL_1_1_1-stable".
Can some one please clarify?

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


[edk2] [platforms: PATCH v2 2/7] Marvell/Library: ArmadaBoardDescLib: Extend SDMMC information

2018-10-05 Thread Marcin Wojtas
From: Tomasz Michalec 

Added fields specific for Xenon host controller and declaration
of ArmadaBoardDescSdMmcGet function.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas 
---
 Silicon/Marvell/Include/Library/ArmadaBoardDescLib.h | 17 -
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/Silicon/Marvell/Include/Library/ArmadaBoardDescLib.h 
b/Silicon/Marvell/Include/Library/ArmadaBoardDescLib.h
index ee8e06e..4bb7a43 100644
--- a/Silicon/Marvell/Include/Library/ArmadaBoardDescLib.h
+++ b/Silicon/Marvell/Include/Library/ArmadaBoardDescLib.h
@@ -14,6 +14,8 @@
 #ifndef __ARMADA_BOARD_DESC_LIB_H__
 #define __ARMADA_BOARD_DESC_LIB_H__
 
+#include 
+
 #include 
 
 //
@@ -57,7 +59,12 @@ typedef struct {
 //
 typedef struct {
   MV_SOC_SDMMC_DESC *SoC;
-  UINTN  SdMmcDevCount;
+  UINTNSdMmcDevCount;
+  BOOLEAN  Xenon1v8Enabled;
+  BOOLEAN  Xenon8BitBusEnabled;
+  BOOLEAN  XenonSlowModeEnabled;
+  UINT8XenonTuningStepDivisor;
+  EFI_SD_MMC_SLOT_TYPE SlotType;
 } MV_BOARD_SDMMC_DESC;
 
 //
@@ -84,4 +91,12 @@ typedef struct {
   UINTN UtmiDevCount;
   UINTN UtmiPortType;
 } MV_BOARD_UTMI_DESC;
+
+EFI_STATUS
+EFIAPI
+ArmadaBoardDescSdMmcGet (
+  IN OUT UINTN   *SdMmcDevCount,
+  IN OUT MV_BOARD_SDMMC_DESC **SdMmcDesc
+  );
+
 #endif /* __ARMADA_SOC_DESC_LIB_H__ */
-- 
2.7.4

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


[edk2] [platforms: PATCH v2 3/7] SolidRun/Armada80x0McBin: Introduce board description library

2018-10-05 Thread Marcin Wojtas
From: Tomasz Michalec 

This patch implements ArmadaBoarDescLib library for
Armada80x0McBin comunity board and add to it ArmadaBoardDescSdMmcGet
function with description of connected Xenon host controllers.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas 
---
 Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc  
   |  3 +
 
Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.inf
 | 34 ++
 
Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.c
   | 66 
 3 files changed, 103 insertions(+)
 create mode 100644 
Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.inf
 create mode 100644 
Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.c

diff --git a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc 
b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc
index 52e2b9b..077224d 100644
--- a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc
+++ b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc
@@ -55,6 +55,9 @@
 [Components.AARCH64]
   Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin.inf
 
+[LibraryClasses.common]
+  
ArmadaBoardDescLib|Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.inf
+
 

 #
 # Pcd Section - list of all EDK II PCD Entries defined by this Platform
diff --git 
a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.inf
 
b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.inf
new file mode 100644
index 000..63a4f66
--- /dev/null
+++ 
b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.inf
@@ -0,0 +1,34 @@
+## @file
+#
+#  Copyright (C) 2018, Marvell International Ltd. and its affiliates
+#
+#  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 be found at
+#  http://opensource.org/licenses/bsd-license.php
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
+#  IMPLIED.
+#
+#
+##
+
+[Defines]
+  INF_VERSION= 0x0001001A
+  BASE_NAME  = ArmadaMcBinBoardDescLib
+  FILE_GUID  = 8208558f-5f33-46e2-b5c5-43354384389e
+  MODULE_TYPE= BASE
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = ArmadaBoardDescLib
+
+[Sources]
+  Armada80x0McBinBoardDescLib.c
+
+[Packages]
+  MdeModulePkg/MdeModulePkg.dec
+  MdePkg/MdePkg.dec
+  Silicon/Marvell/Marvell.dec
+
+[LibraryClasses]
+  DebugLib
+  IoLib
diff --git 
a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.c
 
b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.c
new file mode 100644
index 000..9e38ce0
--- /dev/null
+++ 
b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.c
@@ -0,0 +1,66 @@
+/**
+*
+*  Copyright (C) 2018, Marvell International Ltd. and its affiliates.
+*
+*  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 be found at
+*  http://opensource.org/licenses/bsd-license.php
+*
+*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+*
+**/
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+//
+// Order of devices in SdMmcDescTemplate has to be in par with ArmadaSoCDescLib
+//
+STATIC
+MV_BOARD_SDMMC_DESC mMcBinSdMmcDescTemplate[] = {
+  { /* eMMC 0xF06E */
+0, /* SOC will be filled by MvBoardDescDxe */
+0, /* SdMmcDevCount will be filled by MvBoardDescDxe */
+FALSE, /* Xenon1v8Enabled */
+TRUE,  /* Xenon8BitBusEnabled */
+TRUE,  /* XenonSlowModeEnabled */
+0x40,  /* XenonTuningStepDivisor */
+EmbeddedSlot /* SlotType */
+  },
+  { /* SD/MMC 0xF278 */
+0, /* SOC will be filled by MvBoardDescDxe */
+0, /* SdMmcDevCount will be filled by MvBoardDescDxe */
+FALSE, /* Xenon1v8Enabled */
+FALSE, /* Xenon8BitBusEnabled */
+FALSE, /* XenonSlowModeEnabled */
+0x19,  /* XenonTuningStepDivisor */
+EmbeddedSlot /* SlotType */
+  }
+};
+
+EFI_STATUS
+EFIAPI
+ArmadaBoardDescSdMmcGet (
+  IN OUT UINTN   *SdMmcDevCount,
+  IN OUT MV_BOARD_SDMMC_DESC **SdMmcDesc
+  )
+{
+  *SdMmcDevCount = ARRAY_SIZE 

[edk2] [platforms: PATCH v2 4/7] Marvell/Armada70x0Db: Introduce board description library

2018-10-05 Thread Marcin Wojtas
From: Tomasz Michalec 

This patch implements ArmadaBoarDescLib library for
Armada7040 Development Board and add to it ArmadaBoardDescSdMmcGet
function with description of connected Xenon host controllers.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas 
---
 Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc 
 |  3 +
 
Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.inf
 | 34 ++
 
Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.c
   | 66 
 3 files changed, 103 insertions(+)
 create mode 100644 
Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.inf
 create mode 100644 
Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.c

diff --git a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc 
b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
index e0bf447..a935f36 100644
--- a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
+++ b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
@@ -54,6 +54,9 @@
 [Components.AARCH64]
   Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db.inf
 
+[LibraryClasses.common]
+  
ArmadaBoardDescLib|Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.inf
+
 

 #
 # Pcd Section - list of all EDK II PCD Entries defined by this Platform
diff --git 
a/Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.inf
 
b/Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.inf
new file mode 100644
index 000..b26f55b
--- /dev/null
+++ 
b/Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.inf
@@ -0,0 +1,34 @@
+## @file
+#
+#  Copyright (C) 2018, Marvell International Ltd. and its affiliates
+#
+#  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 be found at
+#  http://opensource.org/licenses/bsd-license.php
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
+#  IMPLIED.
+#
+#
+##
+
+[Defines]
+  INF_VERSION= 0x0001001A
+  BASE_NAME  = Armada70x0DbBoardDescLib
+  FILE_GUID  = 3164c8d9-19d4-4ad6-8196-cea094b1ddf1
+  MODULE_TYPE= BASE
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = ArmadaBoardDescLib
+
+[Sources]
+  Armada70x0DbBoardDescLib.c
+
+[Packages]
+  MdeModulePkg/MdeModulePkg.dec
+  MdePkg/MdePkg.dec
+  Silicon/Marvell/Marvell.dec
+
+[LibraryClasses]
+  DebugLib
+  IoLib
diff --git 
a/Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.c
 
b/Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.c
new file mode 100644
index 000..dd5e3a0
--- /dev/null
+++ 
b/Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.c
@@ -0,0 +1,66 @@
+/**
+*
+*  Copyright (C) 2018, Marvell International Ltd. and its affiliates.
+*
+*  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 be found at
+*  http://opensource.org/licenses/bsd-license.php
+*
+*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+*
+**/
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+//
+// Order of devices in SdMmcDescTemplate has to be in par with ArmadaSoCDescLib
+//
+STATIC
+MV_BOARD_SDMMC_DESC mSdMmcDescTemplate[] = {
+  { /* eMMC 0xF06E */
+0, /* SOC will be filled by MvBoardDescDxe */
+0, /* SdMmcDevCount will be filled by MvBoardDescDxe */
+FALSE, /* Xenon1v8Enabled */
+FALSE, /* Xenon8BitBusEnabled */
+TRUE,  /* XenonSlowModeEnabled */
+0x40,  /* XenonTuningStepDivisor */
+EmbeddedSlot /* SlotType */
+  },
+  { /* SD/MMC 0xF278 */
+0, /* SOC will be filled by MvBoardDescDxe */
+0, /* SdMmcDevCount will be filled by MvBoardDescDxe */
+FALSE, /* Xenon1v8Enabled */
+FALSE, /* Xenon8BitBusEnabled */
+FALSE, /* XenonSlowModeEnabled */
+0x19,  /* XenonTuningStepDivisor */
+EmbeddedSlot /* SlotType */
+  }
+};
+
+EFI_STATUS
+EFIAPI
+ArmadaBoardDescSdMmcGet (
+  IN OUT UINTN   *SdMmcDevCount,
+  IN OUT MV_BOARD_SDMMC_DESC **SdMmcDesc
+  )
+{
+  *SdMmcDevCount = ARRAY_SIZE (mSdMmcDescTemplate);
+
+  *SdMmcDesc = AllocateCopyPool (sizeof (mSdMmcDescTemplate),
+ );
+  if (*SdMmcDesc == NULL) {
+DEBUG ((DEBUG_ERROR, 

[edk2] [platforms: PATCH v2 1/7] Silicon/SynQuacer/PlatformDxe: adjust to updated SdMmcOverride

2018-10-05 Thread Marcin Wojtas
The newest changes in the SdMmcOverride protocol added additional
arguments to the NotifyPhase and Capability routines. Update
according places in the Synquacer Emmc driver.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas 
---
 Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/Emmc.c | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/Emmc.c 
b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/Emmc.c
index e0987c9..0a917a5 100644
--- a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/Emmc.c
+++ b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/Emmc.c
@@ -72,6 +72,8 @@ STATIC VOID *mEventRegistration;
   @param[in]  ControllerHandle  The EFI_HANDLE of the controller.
   @param[in]  Slot  The 0 based slot index.
   @param[in,out]  SdMmcHcSlotCapability The SDHCI capability structure.
+  @param[in,out]  BaseClkFreq   The base clock frequency value that
+optionally can be updated.
 
   @retval EFI_SUCCESS   The override function completed successfully.
   @retval EFI_NOT_FOUND The specified controller or slot does not 
exist.
@@ -84,7 +86,8 @@ EFIAPI
 SynQuacerSdMmcCapability (
   IN  EFI_HANDLE  ControllerHandle,
   IN  UINT8   Slot,
-  IN  OUT VOID*SdMmcHcSlotCapability
+  IN OUT  VOID*SdMmcHcSlotCapability,
+  IN OUT  UINT32  *BaseClkFreq
   )
 {
   UINT64 Capability;
@@ -117,6 +120,7 @@ SynQuacerSdMmcCapability (
   @param[in]  PhaseType The type of operation and whether the
 hook is invoked right before (pre) or
 right after (post)
+  @param[in,out]  Data  The pointer to a phase-specific data.
 
   @retval EFI_SUCCESS   The override function completed successfully.
   @retval EFI_NOT_FOUND The specified controller or slot does not 
exist.
@@ -129,7 +133,8 @@ EFIAPI
 SynQuacerSdMmcNotifyPhase (
   IN  EFI_HANDLE  ControllerHandle,
   IN  UINT8   Slot,
-  IN  EDKII_SD_MMC_PHASE_TYPE PhaseType
+  IN  EDKII_SD_MMC_PHASE_TYPE PhaseType,
+  IN OUT  VOID*Data
   )
 {
   if (ControllerHandle != mSdMmcControllerHandle) {
-- 
2.7.4

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


[edk2] [platforms: PATCH v2 6/7] Marvell/Drivers: MvBoardDesc: Extend information for SdMmc

2018-10-05 Thread Marcin Wojtas
From: Tomasz Michalec 

Extend MvBoardDescSdMmcGet function to fill MV_BOARD_SDMMC_DESC
with Xenon specific info obtained from ArmadaBoardDescLib.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas 
---
 Silicon/Marvell/Drivers/BoardDesc/MvBoardDescDxe.inf |  1 +
 Silicon/Marvell/Drivers/BoardDesc/MvBoardDescDxe.c   | 24 +---
 2 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/Silicon/Marvell/Drivers/BoardDesc/MvBoardDescDxe.inf 
b/Silicon/Marvell/Drivers/BoardDesc/MvBoardDescDxe.inf
index 41f72d6..0b93948 100644
--- a/Silicon/Marvell/Drivers/BoardDesc/MvBoardDescDxe.inf
+++ b/Silicon/Marvell/Drivers/BoardDesc/MvBoardDescDxe.inf
@@ -47,6 +47,7 @@
   Silicon/Marvell/Marvell.dec
 
 [LibraryClasses]
+  ArmadaBoardDescLib
   ArmadaSoCDescLib
   DebugLib
   MemoryAllocationLib
diff --git a/Silicon/Marvell/Drivers/BoardDesc/MvBoardDescDxe.c 
b/Silicon/Marvell/Drivers/BoardDesc/MvBoardDescDxe.c
index 39dc06c..f71bfc4 100644
--- a/Silicon/Marvell/Drivers/BoardDesc/MvBoardDescDxe.c
+++ b/Silicon/Marvell/Drivers/BoardDesc/MvBoardDescDxe.c
@@ -270,6 +270,7 @@ MvBoardDescSdMmcGet (
 {
   UINT8 *SdMmcDeviceEnabled;
   UINTN SdMmcCount, SdMmcDeviceTableSize, SdMmcIndex, Index;
+  UINTN SdMmcDevCount;
   MV_BOARD_SDMMC_DESC *BoardDesc;
   MV_SOC_SDMMC_DESC *SoCDesc;
   EFI_STATUS Status;
@@ -280,6 +281,13 @@ MvBoardDescSdMmcGet (
 return Status;
   }
 
+  /* Get per-board configuration of the controllers */
+  Status = ArmadaBoardDescSdMmcGet (, );
+  if (EFI_ERROR (Status)) {
+DEBUG ((DEBUG_ERROR, "%a: ArmadaBoardDescSdMmcGet filed\n", __FUNCTION__));
+return Status;
+  }
+
   /*
* Obtain table with enabled SDMMC controllers
* which is represented as an array of UINT8 values
@@ -294,18 +302,12 @@ MvBoardDescSdMmcGet (
   SdMmcDeviceTableSize = PcdGetSize (PcdPciESdhci);
 
   /* Check if PCD with SDMMC controllers is correctly defined */
-  if (SdMmcDeviceTableSize > SdMmcCount) {
+  if ((SdMmcDeviceTableSize > SdMmcCount) ||
+  (SdMmcDeviceTableSize < SdMmcDevCount)) {
 DEBUG ((DEBUG_ERROR, "%a: Wrong PcdPciESdhci format\n", __FUNCTION__));
 return EFI_INVALID_PARAMETER;
   }
 
-  /* Allocate and fill board description */
-  BoardDesc = AllocateZeroPool (SdMmcDeviceTableSize * sizeof 
(MV_BOARD_SDMMC_DESC));
-  if (BoardDesc == NULL) {
-DEBUG ((DEBUG_ERROR, "%a: Cannot allocate memory\n", __FUNCTION__));
-return EFI_OUT_OF_RESOURCES;
-  }
-
   SdMmcIndex = 0;
   for (Index = 0; Index < SdMmcDeviceTableSize; Index++) {
 if (!SdMmcDeviceEnabled[Index]) {
@@ -313,6 +315,12 @@ MvBoardDescSdMmcGet (
   continue;
 }
 
+if (SdMmcIndex >= SdMmcDevCount) {
+  DEBUG ((DEBUG_ERROR,
+"%a: More enabled devices than returned by ArmadaBoardDescSdMmcGet\n",
+__FUNCTION__));
+  return EFI_INVALID_PARAMETER;
+}
 BoardDesc[SdMmcIndex].SoC = [Index];
 SdMmcIndex++;
   }
-- 
2.7.4

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


[edk2] [PATCH v2 0/4] SdMmcOverride extension

2018-10-05 Thread Marcin Wojtas
Hi,

This is the second version of the patchset. Initial one was
interleaved with the fixes, which after split got already merged.
The biggest change is - resigning from the new callbacks
and extending parameter lists of both NotifyPhase and Capability
routines.

Patches are available in the github:
https://github.com/MarvellEmbeddedProcessors/edk2-open-platform/commits/sdmmc-override-upstream-r20181005

Please note that extending SdMmcOverride protocol was impacting
so far the only user of it (Synquacer controller). In paralel
edk2-platforms patchset, a patch can be found:
("Silicon/SynQuacer/PlatformDxe: adjust to updated SdMmcOverride")
which immunizes for above and future extensions of the protocol:
https://github.com/MarvellEmbeddedProcessors/edk2-open-platform/commits/xenon-upstream-r20181005

I'm looking forward to the comments and remarks.

Best regards,
Marcin

Changelog:
v1 -> v2
* Rebase onto newest master
* 1/4 [new patch] - preparation for extending NotifyPhase
* 2/4 - UhsSignaling as a part of NotifyPhase
* 3/4 - SwitchClockFreqPost as a part of NotifyPhase
* 4/4 - Allow updating BaseClkFreq via Capability instead of the
independent callback.

Marcin Wojtas (2):
  MdeModulePkg/SdMmcPciHcDxe: Add an optional parameter in NotifyPhase
  MdeModulePkg/SdMmcPciHcDxe: Allow overriding base clock frequency

Tomasz Michalec (2):
  MdeModulePkg/SdMmcPciHcDxe: Add UhsSignaling to SdMmcOverride protocol
  MdeModulePkg/SdMmcPciHcDxe: Add SwitchClockFreqPost to SdMmcOverride

 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h |   6 +
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h   |  62 +-
 MdeModulePkg/Include/Protocol/SdMmcOverride.h  |  12 +-
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c| 215 ++--
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c  |  57 +-
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c |  18 +-
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c   | 108 --
 7 files changed, 383 insertions(+), 95 deletions(-)

-- 
2.7.4

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


[edk2] [PATCH v2 2/4] MdeModulePkg/SdMmcPciHcDxe: Add UhsSignaling to SdMmcOverride protocol

2018-10-05 Thread Marcin Wojtas
From: Tomasz Michalec 

Some SD Host Controlers use different values in Host Control 2 Register
to select UHS Mode. This patch adds a new UhsSignaling type routine to
the NotifyPhase of the SdMmcOverride protocol.

UHS signaling configuration is moved to a common, default routine
(SdMmcHcUhsSignaling), which is called when SdMmcOverride does not
cover this functionality.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas 
---
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h |  50 +++
 MdeModulePkg/Include/Protocol/SdMmcOverride.h|   2 +
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c  | 153 
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c|  37 +++--
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c |  69 +
 5 files changed, 243 insertions(+), 68 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h 
b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
index e389d52..a03160d 100644
--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
@@ -63,6 +63,39 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
 #define SD_MMC_HC_CTRL_VER0xFE
 
 //
+// SD Host Controler bits to HOST_CTRL2 register
+//
+#define SD_MMC_HC_CTRL_UHS_MASK   0x0007
+#define SD_MMC_HC_CTRL_UHS_SDR12  0x
+#define SD_MMC_HC_CTRL_UHS_SDR25  0x0001
+#define SD_MMC_HC_CTRL_UHS_SDR50  0x0002
+#define SD_MMC_HC_CTRL_UHS_SDR104 0x0003
+#define SD_MMC_HC_CTRL_UHS_DDR50  0x0004
+#define SD_MMC_HC_CTRL_MMC_DDR52  0x0004
+#define SD_MMC_HC_CTRL_MMC_SDR50  0x0002
+#define SD_MMC_HC_CTRL_MMC_SDR25  0x0001
+#define SD_MMC_HC_CTRL_MMC_SDR12  0x
+#define SD_MMC_HC_CTRL_HS200  0x0003
+#define SD_MMC_HC_CTRL_HS400  0x0005
+
+//
+// Timing modes for uhs
+//
+typedef enum {
+  SdMmcUhsSdr12,
+  SdMmcUhsSdr25,
+  SdMmcUhsSdr50,
+  SdMmcUhsSdr104,
+  SdMmcUhsDdr50,
+  SdMmcMmcDdr52,
+  SdMmcMmcSdr50,
+  SdMmcMmcSdr25,
+  SdMmcMmcSdr12,
+  SdMmcMmcHs200,
+  SdMmcMmcHs400,
+} SD_MMC_UHS_TIMING;
+
+//
 // The transfer modes supported by SD Host Controller
 // Simplified Spec 3.0 Table 1-2
 //
@@ -508,4 +541,21 @@ SdMmcHcInitTimeoutCtrl (
   IN UINT8  Slot
   );
 
+/**
+  Set SD Host Controler control 2 registry according to selected speed.
+
+  @param[in] PciIo  The PCI IO protocol instance.
+  @param[in] Slot   The slot number of the SD card to send the command 
to.
+  @param[in] Timing The timing to select.
+
+  @retval EFI_SUCCESS   The timing is set successfully.
+  @retval OthersThe timing isn't set successfully.
+**/
+EFI_STATUS
+SdMmcHcUhsSignaling (
+  IN EFI_PCI_IO_PROTOCOL*PciIo,
+  IN UINT8  Slot,
+  IN SD_MMC_UHS_TIMING  Timing
+  );
+
 #endif
diff --git a/MdeModulePkg/Include/Protocol/SdMmcOverride.h 
b/MdeModulePkg/Include/Protocol/SdMmcOverride.h
index 178945f..25db98a 100644
--- a/MdeModulePkg/Include/Protocol/SdMmcOverride.h
+++ b/MdeModulePkg/Include/Protocol/SdMmcOverride.h
@@ -17,6 +17,7 @@
 #ifndef __SD_MMC_OVERRIDE_H__
 #define __SD_MMC_OVERRIDE_H__
 
+#include 
 #include 
 
 #define EDKII_SD_MMC_OVERRIDE_PROTOCOL_GUID \
@@ -31,6 +32,7 @@ typedef enum {
   EdkiiSdMmcResetPost,
   EdkiiSdMmcInitHostPre,
   EdkiiSdMmcInitHostPost,
+  EdkiiSdMmcUhsSignaling,
 } EDKII_SD_MMC_PHASE_TYPE;
 
 /**
diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c 
b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c
index c5fd214..05bd4a0 100755
--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c
+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c
@@ -740,10 +740,13 @@ EmmcSwitchToHighSpeed (
   IN UINT8  BusWidth
   )
 {
-  EFI_STATUS  Status;
-  UINT8   HsTiming;
-  UINT8   HostCtrl1;
-  UINT8   HostCtrl2;
+  EFI_STATUS  Status;
+  UINT8   HsTiming;
+  UINT8   HostCtrl1;
+  SD_MMC_UHS_TIMING   Timing;
+  SD_MMC_HC_PRIVATE_DATA  *Private;
+
+  Private = SD_MMC_HC_PRIVATE_FROM_THIS (PassThru);
 
   Status = EmmcSwitchBusWidth (PciIo, PassThru, Slot, Rca, IsDdr, BusWidth);
   if (EFI_ERROR (Status)) {
@@ -758,27 +761,37 @@ EmmcSwitchToHighSpeed (
 return Status;
   }
 
-  //
-  // Clean UHS Mode Select field of Host Control 2 reigster before update
-  //
-  HostCtrl2 = (UINT8)~0x7;
-  Status = SdMmcHcAndMmio (PciIo, Slot, SD_MMC_HC_HOST_CTRL2, sizeof 
(HostCtrl2), );
-  if (EFI_ERROR (Status)) {
-return Status;
-  }
-  //
-  // Set UHS Mode Select field of Host Control 2 reigster to SDR12/25/50
-  //
   if (IsDdr) {
-HostCtrl2 = BIT2;
+Timing = SdMmcMmcDdr52;
   } else if (ClockFreq == 52) {
-HostCtrl2 = BIT0;
+Timing = SdMmcMmcSdr50;
+  } else if (ClockFreq == 26) {
+Timing = SdMmcMmcSdr25;
   } else {
-HostCtrl2 = 0;
+Timing = SdMmcMmcSdr12;
   }
-  Status = 

[edk2] [PATCH v2 3/4] MdeModulePkg/SdMmcPciHcDxe: Add SwitchClockFreqPost to SdMmcOverride

2018-10-05 Thread Marcin Wojtas
From: Tomasz Michalec 

Some SD Host Controlers need to do additional opperations after clock
frequency switch.

This patch add new callback type to NotifyPhase of the SdMmcOverride
protocol. It is called after EmmcSwitchClockFreq and SdMmcHcClockSupply.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas 
---
 MdeModulePkg/Include/Protocol/SdMmcOverride.h   |  1 +
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c | 60 
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c   | 18 ++
 3 files changed, 79 insertions(+)

diff --git a/MdeModulePkg/Include/Protocol/SdMmcOverride.h 
b/MdeModulePkg/Include/Protocol/SdMmcOverride.h
index 25db98a..d9daada 100644
--- a/MdeModulePkg/Include/Protocol/SdMmcOverride.h
+++ b/MdeModulePkg/Include/Protocol/SdMmcOverride.h
@@ -33,6 +33,7 @@ typedef enum {
   EdkiiSdMmcInitHostPre,
   EdkiiSdMmcInitHostPost,
   EdkiiSdMmcUhsSignaling,
+  EdkiiSdMmcSwitchClockFreqPost,
 } EDKII_SD_MMC_PHASE_TYPE;
 
 /**
diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c 
b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c
index 05bd4a0..7e75283 100755
--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c
+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c
@@ -796,6 +796,27 @@ EmmcSwitchToHighSpeed (
 
   HsTiming = 1;
   Status = EmmcSwitchClockFreq (PciIo, PassThru, Slot, Rca, HsTiming, 
ClockFreq);
+  if (EFI_ERROR (Status)) {
+return Status;
+  }
+
+  if (mOverride != NULL && mOverride->NotifyPhase != NULL) {
+Status = mOverride->NotifyPhase (
+  Private->ControllerHandle,
+  Slot,
+  EdkiiSdMmcSwitchClockFreqPost,
+  
+  );
+if (EFI_ERROR (Status)) {
+  DEBUG ((
+DEBUG_ERROR,
+"%a: SD/MMC switch clock freq post notifier callback failed - %r\n",
+__FUNCTION__,
+Status
+));
+  return Status;
+}
+  }
 
   return Status;
 }
@@ -905,6 +926,24 @@ EmmcSwitchToHS200 (
 return Status;
   }
 
+  if (mOverride != NULL && mOverride->NotifyPhase != NULL) {
+Status = mOverride->NotifyPhase (
+  Private->ControllerHandle,
+  Slot,
+  EdkiiSdMmcSwitchClockFreqPost,
+  
+  );
+if (EFI_ERROR (Status)) {
+  DEBUG ((
+DEBUG_ERROR,
+"%a: SD/MMC switch clock freq post notifier callback failed - %r\n",
+__FUNCTION__,
+Status
+));
+  return Status;
+}
+  }
+
   Status = EmmcTuningClkForHs200 (PciIo, PassThru, Slot, BusWidth);
 
   return Status;
@@ -989,6 +1028,27 @@ EmmcSwitchToHS400 (
 
   HsTiming = 3;
   Status = EmmcSwitchClockFreq (PciIo, PassThru, Slot, Rca, HsTiming, 
ClockFreq);
+  if (EFI_ERROR (Status)) {
+return Status;
+  }
+
+  if (mOverride != NULL && mOverride->NotifyPhase != NULL) {
+Status = mOverride->NotifyPhase (
+  Private->ControllerHandle,
+  Slot,
+  EdkiiSdMmcSwitchClockFreqPost,
+  
+  );
+if (EFI_ERROR (Status)) {
+  DEBUG ((
+DEBUG_ERROR,
+"%a: SD/MMC switch clock freq post notifier callback failed - %r\n",
+__FUNCTION__,
+Status
+));
+  return Status;
+}
+  }
 
   return Status;
 }
diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c 
b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
index 5645a71..057a4e2 100644
--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
@@ -887,6 +887,24 @@ SdCardSetBusMode (
 return Status;
   }
 
+  if (mOverride != NULL && mOverride->NotifyPhase != NULL) {
+Status = mOverride->NotifyPhase (
+  Private->ControllerHandle,
+  Slot,
+  EdkiiSdMmcSwitchClockFreqPost,
+  
+  );
+if (EFI_ERROR (Status)) {
+  DEBUG ((
+DEBUG_ERROR,
+"%a: SD/MMC switch clock freq post notifier callback failed - %r\n",
+__FUNCTION__,
+Status
+));
+  return Status;
+}
+  }
+
   if ((AccessMode == 3) || ((AccessMode == 2) && (Capability->TuningSDR50 != 
0))) {
 Status = SdCardTuningClock (PciIo, PassThru, Slot);
 if (EFI_ERROR (Status)) {
-- 
2.7.4

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


Re: [edk2] [PATCH] ShellPkg: Create a homefilesystem environment variable

2018-10-05 Thread Tim Lewis
Jaben --

Following on this: shouldn't this be a spec issue? If you are asking people
to depend on the behavior.

Thanks,
Tim

-Original Message-
From: edk2-devel  On Behalf Of Laszlo Ersek
Sent: Friday, October 5, 2018 4:33 AM
To: Carsey, Jaben ; Andrew Fish 
Cc: edk2-devel@lists.01.org
Subject: Re: [edk2] [PATCH] ShellPkg: Create a homefilesystem environment
variable

On 10/04/18 22:54, Carsey, Jaben wrote:
> Laszlo,
> 
> The leading "_" was required for out of spec, but built in, commands.  The
spec has no restrictions on environment variables except some have special
meaning and may be read only.
> 
> I can certainly work on slowing down the process.  I have been complaining
about that same thing and should have been more aware.  I would like to have
a community minimum amount of time before commits are done that we all agree
to.  Something like 1 full day would be nice I think.

Good idea! I believe 24 hours should be tolerable on all ends. It also gives
a chance to people in other time zones to comment.

I think there should be one exception: grave regressions -- build failures,
or total boot failures -- should be possible to revert (or
fix) as soon as there's one review.

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

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


Re: [edk2] [PATCH] ShellPkg: Create a homefilesystem environment variable

2018-10-05 Thread Laszlo Ersek
On 10/04/18 22:54, Carsey, Jaben wrote:
> Laszlo,
> 
> The leading "_" was required for out of spec, but built in, commands.  The 
> spec has no restrictions on environment variables except some have special 
> meaning and may be read only.
> 
> I can certainly work on slowing down the process.  I have been complaining 
> about that same thing and should have been more aware.  I would like to have 
> a community minimum amount of time before commits are done that we all agree 
> to.  Something like 1 full day would be nice I think.

Good idea! I believe 24 hours should be tolerable on all ends. It also
gives a chance to people in other time zones to comment.

I think there should be one exception: grave regressions -- build
failures, or total boot failures -- should be possible to revert (or
fix) as soon as there's one review.

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