Re: [edk2] [PATCH] uefi-sct/SctPkg:Add conformance test cases for deprecated EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS attribute.

2018-10-26 Thread Leif Lindholm
Laszlo, many thanks for this.

Cc:ing some new(ish) maintainers.

/
Leif

On Wed, Oct 17, 2018 at 02:04:01PM +0200, Laszlo Ersek wrote:
> Hi Leif,
> 
> On 10/16/18 04:28, Leif Lindholm wrote:
> 
> > Laszlo: a few years ago, you also posted a _really_ useful email about
> > the process of being a maintainer, and helpful workflows (like "sort
> > emails to review immediately on reception, even if you don't have time
> > to review now"). I have since failed to find it in my history (or via
> > google). Since you're very organised - do you have it lying around,
> > and if so would you be able to re-post it?
> 
> I'm sure I still have the email, if I sent it; however, I can't find it
> now, because I don't personally remember the *specific* email you refer
> to, and so I can't come up with good search terms, for the program that
> indexes my mailbox ("recoll").
> 
> Anyway, what I generally do is:
> 
> - I maintain a set of tagged emails that present work items. This set
> (of emails) exists in addition to bugzillas that are assigned to me.
> 
> - I process emails in batches. I sync my mailbox, and then turn off
> synching, until I have covered everything possible, at that point, that
> relate to my mailbox.
> 
> - In every new batch in my INBOX, I go over the emails as quickly as
> possible, trying to triage emails as I go. If I can take care of an
> email immediately, I do. If it needs more work (especially focused
> work), then I tag the email, and archive it at once. If the tagged email
> is private (not on any list), then I'll let it sit tagged in my personal
> archive folder. If the email is also on some list, then I might choose
> to tag the email in that folder instead, and archive the personal copy
> without tagging it.
> 
> - I go over all the new emails in my list folders as well (i.e. emails
> that I'm not personally CC'd on). Dependent on list, I dedicate
> different amounts of attention.
> 
> - Once I'm done triaging / tagging the new batch (and therefore I have
> no unread messages in my entire mailbox), I search my mailbox for all
> tagged messages. I usually list those hits in chronological order, but
> not always (e.g., sometimes I group them by containing folder). I work
> my way through these items slowly. Importantly, I shut out interruptions
> while I do this -- no more email synching, no phone, no IRC. And the
> FIFO processing order of the tagged messages mostly ensures good
> responsiveness from my side, despite this process being quite OK at
> throughput as well.
> 
> (Your present email fell in the "take care of it at once" category :) )
> 
> Thanks,
> Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [staging/MicroPythonTestFramework]: MicroPython Test Framework for UEFI

2018-10-20 Thread Leif Lindholm
Thanks Brian,

Long, could you please
1) Send me the commit hashes of micropython and oniguruma that you
   have tested with the overrides?
2) Add a top-level Readme.md to the MicroPythonTestFramework branch,
   mentioning yourself as maintainer and the commit hashes of any
   external projects used?

Best Regards,

Leif

On Fri, Oct 19, 2018 at 06:18:35AM +, Richardson, Brian wrote:
> Leif:
> 
> Thank you for your feedback. Long Qin is a good starting contact for 
> MicroPython issues.
> 
> There are readme files for the sub-components, but I agree that the missing 
> top-level readme file is an issue.
> https://github.com/tianocore/edk2-staging/tree/MicroPythonTestFramework/MpyTestFrameworkPkg
> https://github.com/tianocore/edk2-staging/tree/MicroPythonTestFramework/MicroPythonPkg
> 
> Thanks … br
> ---
> Brian Richardson, Firmware Ecosystem Development, Intel Software
> brian.richard...@intel.com<mailto:brian.richard...@intel.com> -- @intel_brian 
> (Twitter & WeChat)
> https://software.intel.com/en-us/meet-the-developers/evangelists/team/brian-richardson
> 
> From: Leif Lindholm 
> Sent: Friday, October 19, 2018 12:34 AM
> To: Richardson, Brian 
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] [staging/MicroPythonTestFramework]: MicroPython Test 
> Framework for UEFI
> 
> Hi Brian,
> 
> I've started having a look at this, and have a few comments:
> - There is no Readme.md at the top level, as set out in 
> https://github.com/tianocore/edk2-staging/blob/about/README
>   Mainly, this means I don't know who I should cc on any comments I have.
> - There have been substantial changes to oniguruma, and the module no longer 
> builds. Can we have exact commit hashes for the two external projects added 
> to the toplevel Readme.md?
> - At least Uefi/modets.c and Uefi/modos.c contain Ia32/X64-specific bits. 
> Could these bits be put in architecture-specific subdirectories?
> 
> Regards,
> 
> Leif
> 
> On 10 August 2018 at 03:44, Richardson, Brian 
> mailto:brian.richard...@intel.com>> wrote:
> The "MicroPython Test Framework for UEFI" project has been added to 
> edk2-staging for community feedback.
> https://github.com/tianocore/edk2-staging/tree/MicroPythonTestFramework
> 
> This includes a port of MicroPython to UEFI and a test execution environment 
> that can run from the UEFI Shell.
> https://github.com/tianocore/edk2-staging/tree/MicroPythonTestFramework/MicroPythonPkg
> https://github.com/tianocore/edk2-staging/tree/MicroPythonTestFramework/MpyTestFrameworkPkg
> 
> Additional Info:
> https://github.com/tianocore/tianocore.github.io/wiki/MicroPython-Test-Framework-for-UEFI
> 
> Thanks ... br
> ---
> Brian Richardson, Senior Technical Marketing Engineer, Intel Software
> brian.richard...@intel.com<mailto:brian.richard...@intel.com><mailto:brian.richard...@intel.com<mailto:brian.richard...@intel.com>>
>  -- @intel_brian (Twitter & WeChat)
> https://software.intel.com/en-us/meet-the-developers/evangelists/team/brian-richardson
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org<mailto: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 edk2-platforms] Silicon/SynQuacerPciCpuIo2Dxe: fix PCIe I/O translation

2018-10-20 Thread Leif Lindholm
Looks good functionality-wise, but is a bit of a handful to look at (and
not just because I'm code reviewing on a phone).
Could you do it with a couple of temp vars?

/
Leif

On Fri, 19 Oct 2018, 18:48 Ard Biesheuvel, 
wrote:

> Commit 9dd8190e4995 ("Silicon/SynQuacer: tweak PCI I/O windows for
> ACPI/Linux support") updated the min/max/offset definitions for the
> PCIe I/O resource windows on SynQuacer, and updated the read path of
> the platform's EfiCpuIo2 protocol implementation, but failed to update
> the write path as well, resulting in spurious errors if when attempting
> to write to PCIe I/O ports on PCIe RC #1, which uses translation for the
> I/O BAR window.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel 
> ---
>  
> Silicon/Socionext/SynQuacer/Drivers/SynQuacerPciCpuIo2Dxe/SynQuacerPciCpuIo2Dxe.c
> | 18 --
>  1 file changed, 12 insertions(+), 6 deletions(-)
>
> diff --git
> a/Silicon/Socionext/SynQuacer/Drivers/SynQuacerPciCpuIo2Dxe/SynQuacerPciCpuIo2Dxe.c
> b/Silicon/Socionext/SynQuacer/Drivers/SynQuacerPciCpuIo2Dxe/SynQuacerPciCpuIo2Dxe.c
> index 736b20cd5129..e5cc3aef908d 100644
> ---
> a/Silicon/Socionext/SynQuacer/Drivers/SynQuacerPciCpuIo2Dxe/SynQuacerPciCpuIo2Dxe.c
> +++
> b/Silicon/Socionext/SynQuacer/Drivers/SynQuacerPciCpuIo2Dxe/SynQuacerPciCpuIo2Dxe.c
> @@ -518,12 +518,18 @@ CpuIoServiceWrite (
>  return Status;
>}
>
> -  if ((Address >= SYNQUACER_PCI_SEG0_PORTIO_MIN) &&
> -  (Address <= SYNQUACER_PCI_SEG0_PORTIO_MAX)) {
> -Address += SYNQUACER_PCI_SEG0_PORTIO_MEMBASE;
> -  } else if ((Address >= SYNQUACER_PCI_SEG1_PORTIO_MIN) &&
> - (Address <= SYNQUACER_PCI_SEG1_PORTIO_MAX)) {
> -Address += SYNQUACER_PCI_SEG1_PORTIO_MEMBASE;
> +  if ((Address >= (SYNQUACER_PCI_SEG0_PORTIO_MIN +
> +   SYNQUACER_PCI_SEG0_PORTIO_OFFSET)) &&
> +  (Address <= (SYNQUACER_PCI_SEG0_PORTIO_MAX +
> +   SYNQUACER_PCI_SEG0_PORTIO_OFFSET))) {
> +Address += SYNQUACER_PCI_SEG0_PORTIO_MEMBASE -
> +   SYNQUACER_PCI_SEG0_PORTIO_OFFSET;
> +  } else if ((Address >= (SYNQUACER_PCI_SEG1_PORTIO_MIN +
> +  SYNQUACER_PCI_SEG1_PORTIO_OFFSET)) &&
> + (Address <= (SYNQUACER_PCI_SEG1_PORTIO_MAX +
> +  SYNQUACER_PCI_SEG1_PORTIO_OFFSET))) {
> +Address += SYNQUACER_PCI_SEG1_PORTIO_MEMBASE -
> +   SYNQUACER_PCI_SEG1_PORTIO_OFFSET;
>
>} else {
>  ASSERT (FALSE);
> --
> 2.17.1
>
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [staging/MicroPythonTestFramework]: MicroPython Test Framework for UEFI

2018-10-18 Thread Leif Lindholm
Hi Brian,

I've started having a look at this, and have a few comments:
- There is no Readme.md at the top level, as set out in
https://github.com/tianocore/edk2-staging/blob/about/README
  Mainly, this means I don't know who I should cc on any comments I have.
- There have been substantial changes to oniguruma, and the module no
longer builds. Can we have exact commit hashes for the two external
projects added to the toplevel Readme.md?
- At least Uefi/modets.c and Uefi/modos.c contain Ia32/X64-specific bits.
Could these bits be put in architecture-specific subdirectories?

Regards,

Leif

On 10 August 2018 at 03:44, Richardson, Brian 
wrote:

> The "MicroPython Test Framework for UEFI" project has been added to
> edk2-staging for community feedback.
> https://github.com/tianocore/edk2-staging/tree/MicroPythonTestFramework
>
> This includes a port of MicroPython to UEFI and a test execution
> environment that can run from the UEFI Shell.
> https://github.com/tianocore/edk2-staging/tree/MicroPythonTestFramework/
> MicroPythonPkg
> https://github.com/tianocore/edk2-staging/tree/MicroPythonTestFramework/
> MpyTestFrameworkPkg
>
> Additional Info:
> https://github.com/tianocore/tianocore.github.io/wiki/
> MicroPython-Test-Framework-for-UEFI
>
> Thanks ... br
> ---
> Brian Richardson, Senior Technical Marketing Engineer, Intel Software
> brian.richard...@intel.com --
> @intel_brian (Twitter & WeChat)
> https://software.intel.com/en-us/meet-the-developers/
> evangelists/team/brian-richardson
>
> ___
> 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 v4 1/1] ArmPkg/OpteeLib: Add APIs to communicate with OP-TEE

2018-10-18 Thread Leif Lindholm
On Thu, Oct 18, 2018 at 02:43:37PM +0530, Sumit Garg wrote:
> On Thu, 18 Oct 2018 at 14:04, Leif Lindholm  wrote:
> >
> > On Thu, Oct 18, 2018 at 12:59:32PM +0530, Sumit Garg wrote:
> > > > So, looking at the OpTee sources, TEE_UUID is defined as a struct, to
> > > > exactly the same layout as the EFI_GUID type (which is a typedef of
> > > > the GUID struct). Could we add a OPTEE_UUID typedef for the same
> > > > struct in OpteeLib.h?
> > > >
> > > > Since it comes in as an OPTEE_MESSAGE_PARAM_VALUE, alignment is
> > > > already guaranteed to be 64-bit.
> > > >
> > > > (This also deserves a comment explaining how EFI_GUID basically
> > > > follows rfc4122, but uses little-endian for the timestamp fields.)
> > >
> > > Actually, OP-TEE also uses little-endian format for timestamp fields.
> > > You can refer to [1] for conversion from network byte order (octets)
> > > to little-endian and vice-versa.
> > >
> > > So for communications among secure world and non-secure world it uses
> > > network byte order for UUID/GUID to comply with rfc4122.
> > >
> > > [1] https://github.com/OP-TEE/optee_os/blob/master/core/tee/uuid.c
> >
> > Huh, ok. That's good to know.
> > It does however not change my comments. Since we're dealing with data
> > structures of a known layout, I am not a fan of treating them as byte
> > arrays.
> >
> 
> But calling UUID struct with swapped timestamp as OPTEE_UUID would
> also be misnomer. I am not sure regarding appropriate naming for that
> struct.

That's a fair point. We could call it RFC4122_UUID for now.

There could even be a case to add that to BaseLib at some point (but
probably not while there is only one user).

Regards,

Leif

> On the other hand, we have byte array of 16 octets as per network byte
> order complying with rfc4122 which also doesn't imply swapped
> timestamp.
> 
> -Sumit
> 
> > /
> > Leif
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


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

2018-10-18 Thread Leif Lindholm
On Thu, Oct 18, 2018 at 12:59:32PM +0530, Sumit Garg wrote:
> > So, looking at the OpTee sources, TEE_UUID is defined as a struct, to
> > exactly the same layout as the EFI_GUID type (which is a typedef of
> > the GUID struct). Could we add a OPTEE_UUID typedef for the same
> > struct in OpteeLib.h?
> >
> > Since it comes in as an OPTEE_MESSAGE_PARAM_VALUE, alignment is
> > already guaranteed to be 64-bit.
> >
> > (This also deserves a comment explaining how EFI_GUID basically
> > follows rfc4122, but uses little-endian for the timestamp fields.)
> 
> Actually, OP-TEE also uses little-endian format for timestamp fields.
> You can refer to [1] for conversion from network byte order (octets)
> to little-endian and vice-versa.
> 
> So for communications among secure world and non-secure world it uses
> network byte order for UUID/GUID to comply with rfc4122.
> 
> [1] https://github.com/OP-TEE/optee_os/blob/master/core/tee/uuid.c

Huh, ok. That's good to know.
It does however not change my comments. Since we're dealing with data
structures of a known layout, I am not a fan of treating them as byte
arrays.

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


Re: [edk2] [PATCH edk2-platforms] Platform/DeveloperBox: enable HTTPS boot

2018-10-18 Thread Leif Lindholm
On Thu, Oct 18, 2018 at 02:09:33PM +0800, Ard Biesheuvel wrote:
> Enable support for HTTPS boot by incorporating the TLS DXE driver into
> the build, and the driver that permits enrolling the TLS certificates.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel 

Reviewed-by: Leif Lindholm 

> ---
>  Platform/Socionext/DeveloperBox/DeveloperBox.dsc | 5 -
>  Platform/Socionext/DeveloperBox/DeveloperBox.fdf | 2 ++
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc 
> b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc
> index bab72442ec9d..801caf52afcf 100644
> --- a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc
> +++ b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc
> @@ -130,7 +130,8 @@
>NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
>  
>BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
> -  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
> +  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> +  TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
>IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
>  
>NorFlashInfoLib|EmbeddedPkg/Library/NorFlashInfoLib/NorFlashInfoLib.inf
> @@ -657,6 +658,8 @@
>NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
>NetworkPkg/HttpDxe/HttpDxe.inf
>NetworkPkg/HttpBootDxe/HttpBootDxe.inf
> +  NetworkPkg/TlsDxe/TlsDxe.inf
> +  NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf
>  
>#
># Console preference selection
> diff --git a/Platform/Socionext/DeveloperBox/DeveloperBox.fdf 
> b/Platform/Socionext/DeveloperBox/DeveloperBox.fdf
> index 7b009516ae11..8bbad1741de8 100644
> --- a/Platform/Socionext/DeveloperBox/DeveloperBox.fdf
> +++ b/Platform/Socionext/DeveloperBox/DeveloperBox.fdf
> @@ -213,6 +213,8 @@ READ_LOCK_STATUS   = TRUE
>INF NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
>INF NetworkPkg/HttpDxe/HttpDxe.inf
>INF NetworkPkg/HttpBootDxe/HttpBootDxe.inf
> +  INF NetworkPkg/TlsDxe/TlsDxe.inf
> +  INF NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf
>  
>#
># Console preference selection
> -- 
> 2.17.1
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


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

2018-10-18 Thread Leif Lindholm
Hi Sumit,

I have some further comments/suggestions on UUID/GUID handling below.

On Wed, Oct 10, 2018 at 10:48:53AM +0530, 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 
> ---
>  ArmPkg/Library/OpteeLib/OpteeLib.inf |   2 +
>  ArmPkg/Include/Library/OpteeLib.h|  88 +
>  ArmPkg/Library/OpteeLib/OpteeSmc.h   |  43 +++
>  ArmPkg/Library/OpteeLib/Optee.c  | 397 
>  4 files changed, 530 insertions(+)
> 
> diff --git a/ArmPkg/Library/OpteeLib/OpteeLib.inf 
> b/ArmPkg/Library/OpteeLib/OpteeLib.inf
> index 5abd427379cc..e03054a7167d 100644
> --- a/ArmPkg/Library/OpteeLib/OpteeLib.inf
> +++ b/ArmPkg/Library/OpteeLib/OpteeLib.inf
> @@ -23,11 +23,13 @@ [Defines]
>  
>  [Sources]
>Optee.c
> +  OpteeSmc.h
>  
>  [Packages]
>ArmPkg/ArmPkg.dec
>MdePkg/MdePkg.dec
>  
>  [LibraryClasses]
> +  ArmMmuLib
>ArmSmcLib
>BaseLib
> diff --git a/ArmPkg/Include/Library/OpteeLib.h 
> b/ArmPkg/Include/Library/OpteeLib.h
> index f65d8674d9b8..6884d5681831 100644
> --- a/ArmPkg/Include/Library/OpteeLib.h
> +++ b/ArmPkg/Include/Library/OpteeLib.h
> @@ -25,10 +25,98 @@
>  #define OPTEE_OS_UID2  0xaf630002
>  #define OPTEE_OS_UID3  0xa5d5c51b
>  
> +#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_NONE0x0
> +#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_VALUE_INPUT 0x1
> +#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_VALUE_OUTPUT0x2
> +#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_VALUE_INOUT 0x3
> +#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MEMORY_INPUT0x9
> +#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MEMORY_OUTPUT   0xa
> +#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MEMORY_INOUT0xb
> +
> +#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MASK0xff
> +
> +#define OPTEE_ORIGIN_COMMUNICATION  0x0002
> +#define OPTEE_ERROR_COMMUNICATION   0x000E
> +
> +typedef struct {
> +  UINT64BufferAddress;
> +  UINT64Size;
> +  UINT64SharedMemoryReference;
> +} OPTEE_MESSAGE_PARAM_MEMORY;
> +
> +typedef struct {
> +  UINT64A;
> +  UINT64B;
> +  UINT64C;
> +} OPTEE_MESSAGE_PARAM_VALUE;
> +
> +typedef struct {
> +  UINT64 Attribute;
> +  union {
> +OPTEE_MESSAGE_PARAM_MEMORY   Memory;
> +OPTEE_MESSAGE_PARAM_VALUEValue;
> +  } Union;
> +} OPTEE_MESSAGE_PARAM;
> +
> +#define OPTEE_MAX_CALL_PARAMS   4
> +
> +typedef struct {
> +  UINT32Command;
> +  UINT32Function;
> +  UINT32Session;
> +  UINT32CancelId;
> +  UINT32Pad;
> +  UINT32Return;
> +  UINT32ReturnOrigin;
> +  UINT32NumParams;
> +
> +  // NumParams tells the actual number of element in Params
> +  OPTEE_MESSAGE_PARAM  Params[OPTEE_MAX_CALL_PARAMS];
> +} OPTEE_MESSAGE_ARG;
> +
> +typedef struct {
> +  EFI_GUID  Uuid;   // [in] GUID/UUID of the Trusted Application

Forward reference: I have a longer comment on UUID/GUID struct usage
below. I believe this field describes a UUID held in the TEE_UUID
struct format on the OpTee side. If so, can we change this to an
OPTEE_UUID (mentioned below).

> +  UINT32Session;// [out] Session id
> +  UINT32Return; // [out] Return value
> +  UINT32ReturnOrigin;   // [out] Origin of the return value
> +} OPTEE_OPEN_SESSION_ARG;
> +
> +typedef struct {
> +  UINT32Function;   // [in] Trusted Application function, specific 
> to the TA
> +  UINT32Session;// [in] Session id
> +  UINT32Return; // [out] Return value
> +  UINT32ReturnOrigin;   // [out] Origin of the return value
> +  OPTEE_MESSAGE_PARAM  Params[OPTEE_MAX_CALL_PARAMS]; // Params for function 
> to be invoked
> +} OPTEE_INVOKE_FUNCTION_ARG;
> +
>  BOOLEAN
>  EFIAPI
>  IsOpteePresent (
>VOID
>);
>  
> +EFI_STATUS
> +EFIAPI
> +OpteeInit (
> +  VOID
> +  );
> +
> +EFI_STATUS
> +EFIAPI
> +OpteeOpenSession (
> +  IN OUT OPTEE_OPEN_SESSION_ARG  *OpenSessionArg
> +  );
> +
> +EFI_STATUS
> +EFIAPI
> +OpteeCloseSession (
> +  IN UINT32  Session
> +  );
> +
> +EFI_STATUS
> +EFIAPI
> +OpteeInvokeFunction (
> +  IN OUT OPTEE_INVOKE_FUNCTION_ARG   *InvokeFunctionArg
> +  );
> +
>  #endif
> diff --git a/ArmPkg/Library/OpteeLib/OpteeSmc.h 
> b/ArmPkg/Library/OpteeLib/OpteeSmc.h
> new file mode 100644
> index ..21ff4b22ab92
&

Re: [edk2] [PATCH] FatBinPkg: Remove FatBinPkg and modify document

2018-10-17 Thread Leif Lindholm
On Thu, Oct 18, 2018 at 09:08:04AM +0800, Ard Biesheuvel wrote:
> On 17 October 2018 at 19:18, Laszlo Ersek  wrote:
> > On 10/16/18 09:11, shenglei wrote:
> >> Remove FatBinPkg and modify Maintainers.txt.
> >> https://bugzilla.tianocore.org/show_bug.cgi?id=1105
> >>
> >> Cc: Ruiyu Ni 
> >> Contributed-under: TianoCore Contribution Agreement 1.1
> >> Signed-off-by: Shenglei Zhang 
> >> ---
> >>  FatBinPkg/EnhancedFatDxe/AArch64/Fat.efi | Bin 26752 -> 0 bytes
> >>  FatBinPkg/EnhancedFatDxe/Arm/Fat.efi | Bin 17152 -> 0 bytes
> >>  FatBinPkg/EnhancedFatDxe/Ebc/Fat.efi | Bin 79136 -> 0 bytes
> >>  FatBinPkg/EnhancedFatDxe/Fat.inf |  48 ---
> >>  FatBinPkg/EnhancedFatDxe/Ia32/Fat.efi| Bin 21088 -> 0 bytes
> >>  FatBinPkg/EnhancedFatDxe/Ipf/Fat.efi | Bin 154400 -> 0 bytes
> >>  FatBinPkg/EnhancedFatDxe/X64/Fat.efi | Bin 28576 -> 0 bytes
> >>  FatBinPkg/FatBinPkg.dec  |  20 --
> >>  FatBinPkg/ReadMe.txt |   9 -
> >>  Maintainers.txt  |   2 +-
> >>  10 files changed, 1 insertion(+), 78 deletions(-)
> >>  delete mode 100644 FatBinPkg/EnhancedFatDxe/AArch64/Fat.efi
> >>  delete mode 100755 FatBinPkg/EnhancedFatDxe/Arm/Fat.efi
> >>  delete mode 100644 FatBinPkg/EnhancedFatDxe/Ebc/Fat.efi
> >>  delete mode 100644 FatBinPkg/EnhancedFatDxe/Fat.inf
> >>  delete mode 100644 FatBinPkg/EnhancedFatDxe/Ia32/Fat.efi
> >>  delete mode 100644 FatBinPkg/EnhancedFatDxe/Ipf/Fat.efi
> >>  delete mode 100644 FatBinPkg/EnhancedFatDxe/X64/Fat.efi
> >>  delete mode 100644 FatBinPkg/FatBinPkg.dec
> >>  delete mode 100644 FatBinPkg/ReadMe.txt
> >
> > I'm happy about this patch.
> >
> > Reviewed-by: Laszlo Ersek 
> 
> Reviewed-by: Ard Biesheuvel 

Reviewed-by: Leif Lindholm 

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


Re: [edk2] [PATCH v1 6/7] MdeModulePkg/UdfDxe: Remove dead codes in FileName.c

2018-10-16 Thread Leif Lindholm
On Mon, Oct 15, 2018 at 12:55:21PM +0800, Hao Wu wrote:
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1249
> 
> We found potential dead codes within File.c during the code coverage test.
> 
> After manual review, we think the below ones are positive reports:
> 
> A. In function MangleFileName():
> 
>   FileName = TrimString (FileName);
>   // Begin of dead codes
>   if (*FileName == L'\0') {
> goto Exit;
>   }
>   // End of dead codes
> 
> When the code reaches the TrimString() call, the string in 'FileName' is
> guaranteed to have a '\' character due to the call patterns of

What in the call pattern guarantees this? Please be precise.

> MangleFileName(). So after trimming the lead-off/tailing white spaces,
> string in 'FileName' will not be an empty string.
> 
> B. In function MangleFileName():
> 
>   if (FileName[0] == L'.') {
> if (FileName[1] == L'.') {
>   if (FileName[2] == L'\0') {
> goto Exit;
>   } else {
> FileName += 2;
>   }
> } else if (FileName[1] == L'\0') {
>   goto Exit;
> }
>   }
> 
> When the code hits the above checks, string in 'FileName' will always have
> a leading '\' character (denoting an absolute path) due to the call
> patterns of MangleFileName(). So no leading '.' can be there in string
> 'FileName'.

What in the call pattern guarantees this? Please be precise.

Regards,

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


Re: [edk2] [PATCH 0/6] Add kvmtool emulated platform support for ARM

2018-10-15 Thread Leif Lindholm
On Sat, Oct 13, 2018 at 11:42:00PM +0200, Laszlo Ersek wrote:
> On 10/12/18 16:40, Sami Mujawar wrote:
> > Kvmtool is a virtual machine manager that enables hosting KVM
> > guests. ARM is working to enhance kvmtool support to enable 
> > launching of KVM guest with UEFI support.
> 
> Why is QEMU not good enough? (With or without KVM.)
> 
> Another platform I've recently learned about (for QEMU) is the SBSA
> reference machine type. I'm concerned that this kind of divergence will
> be hard to maintain in a common firmware package. Here's my understanding:
> 
> - ArmVirtQemu: supposed to run data center / cloud workloads
> - SBSA reference machine: supposed to emulate physical machines as
>   closely as possible; primarily intended as a development environment
>   for physical machines

If it helps - try to not think of SBSA QEMU as a QEMU target.
It's pretending to be a hardware platform and should be treated as
such. While we may have started the firmware port from ArmVirtPkg (as
the qemu machine was being developed), I don't expect it to ultimately
end up there when it goes upstream.

Regards,

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


Re: [edk2] [PATCH] uefi-sct/SctPkg:Add conformance test cases for deprecated EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS attribute.

2018-10-15 Thread Leif Lindholm
Hi Eric,

1) Really happy to see the first SCT patch out for public review!

2) Could you go through Laszlo's excellent guide for contributions at
   
https://github.com/tianocore/tianocore.github.io/wiki/Laszlo's-unkempt-git-guide-for-edk2-contributors-and-maintainers
   ?

Specifically the bits affecting patch generation and sending helps a
lot with reviewing.

Laszlo: a few years ago, you also posted a _really_ useful email about
the process of being a maintainer, and helpful workflows (like "sort
emails to review immediately on reception, even if you don't have time
to review now"). I have since failed to find it in my history (or via
google). Since you're very organised - do you have it lying around,
and if so would you be able to re-post it?

On Sat, Oct 13, 2018 at 11:19:36PM +0800, Eric Jin wrote:
> Cc: Supreeth Venkatesh 
> Cc: Jiaxin Wu 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Eric Jin 
> ---
>  .../AuthVariableServicesBBTestConformance.c   | 143 ++
>  .../VariableServices/BlackBoxTest/Guid.c  |   6 +-
>  .../VariableServices/BlackBoxTest/Guid.h  |  11 +-

For example, the --stat* options make sure we always see full paths to
affected files, and the orderFile ensures we see more fundamental
changes to structs and APIs before we see them used.

Secondly, I realise it is likely that there are many unrelated minor
fixes queued up from the long time during which the relicensing was
being worked on. Nevertheless, it is useful to bundle them together in
patch sets in order to make it easier to keep track of them.

(This is not something that affects patches already sent out, but it
would be appreciated for future postings.)

I am also attending the plufegest in Taipei this week, seated a couple
of rows behind you to the right, if you would like to meet up and chat
:)

Best Regards,

Leif

>  3 files changed, 132 insertions(+), 28 deletions(-)
> 
> diff --git 
> a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/AuthVariableServicesBBTestConformance.c
>  
> b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/AuthVariableServicesBBTestConformance.c
> index 05281054..a1d1c4c3 100644
> --- 
> a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/AuthVariableServicesBBTestConformance.c
> +++ 
> b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/AuthVariableServicesBBTestConformance.c
> @@ -1,7 +1,7 @@
>  /** @file
>  
>Copyright 2006 - 2012 Unified EFI, Inc.
> -  Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.
> +  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
>  
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the BSD 
> License
> @@ -151,6 +151,44 @@ AuthVariableDERConfTest (
>EFI_TEST_LOGGING_LIBRARY_PROTOCOL   *LoggingLib;
>UINT32  Attr;
>EFI_TEST_ASSERTION  Result;
> +  UINTN   Index;
> +  UINTN   MaximumVariableStorageSize;
> +  UINTN   RemainingVariableStorageSize;
> +  UINTN   MaximumVariableSize;
> +  UINT32  AttrArray[] = {
> +//
> +//  For 1 attribute.
> +//
> +EFI_VARIABLE_NON_VOLATILE,
> +EFI_VARIABLE_RUNTIME_ACCESS,
> +EFI_VARIABLE_BOOTSERVICE_ACCESS,
> +EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
> +
> +//
> +//  For 2 attributes.
> +//
> +EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS,
> +EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
> +EFI_VARIABLE_NON_VOLATILE | 
> EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
> +
> +EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,
> +EFI_VARIABLE_RUNTIME_ACCESS | 
> EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
> +
> +EFI_VARIABLE_BOOTSERVICE_ACCESS | 
> EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
> +
> +//
> +//  For 3 attributes.
> +//
> +EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | 
> EFI_VARIABLE_BOOTSERVICE_ACCESS,
> +EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | 
> EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
> +EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | 
> EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
> +EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS | 
> EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
> +
> +//
> +//  For 4 attributes.
> +//
> +EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | 
> EFI_VARIABLE_BOOTSERVICE_ACCESS | 
> EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
> +  };
>  
>Status = GetTestSupportLibrary (
>   SupportHandle,
> @@ -192,33 +230,86 @@ AuthVariableDERConfTest (

Re: [edk2] Does edk2 still support python 2?

2018-10-15 Thread Leif Lindholm
Hi Fan,

This change has been reverted for now.
Please update to latest version of edk2.

Python3 migration will happen at some point, but not this abrupt.

Best Regards,

Leif

On Sat, Oct 13, 2018 at 01:17:05PM +, Chen, Farrah wrote:
> Hello,
> 
> When we make edk2 "OvmfPkg/build.sh -a X64 -n 16", we met below error:
> 
> [vmm@vmm-build edk2]$ OvmfPkg/build.sh -a X64 -n 16
> Initializing workspace
> /home/fan/edk2/BaseTools
> Loading previous configuration from /home/fan/edk2/Conf/BuildEnv.sh
> WORKSPACE: /home/fan/edk2
> EDK_TOOLS_PATH: /home/fan/edk2/BaseTools
> CONF_PATH: /home/fan/edk2/Conf
> 
> ERROR!!!, python version should greater than or equal to version 3.6.
> 
> Does edk2 still support python 2? How can we make edk2 with python 2? Or we 
> must update the python version to python 3.6?
> 
> 
> Thanks,
> Fan
> 
> ___
> 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] BaseTools/Tests: Update GNUmakefile to use python3 variable

2018-10-14 Thread Leif Lindholm
On Sun, Oct 14, 2018 at 02:51:06PM +, Gao, Liming wrote:
> Leif:
>   OK. I will move this patch set to edk2 staging repo for people
>   verification.

Thats sounds like a good idea.

>   I will use git revert command to revert total 27 patches one by
>   one. Then, there will be 27 commit for the revert patches. Or, one
>   commit to combine all revert patches. One commit is enough. Do you
>   agree it?

On commit is enough.

>   Below is the commit message for the revert patch. Could you help
>   review it?
>   Python3 migration is the fundamental change. It requires every
>   developer to install Python3. Before this migration, the well
>   communication and wide verification must be done. But now, most
>   people is not aware of this change, and not try it. So, Python3
>   migration is reverted and be moved to edk2-staging Python3 branch
>   for the edk2 user evaluation.

This looks good to me, thanks!

Regards,

Leif

> Thanks
> Liming
> > -Original Message-
> > From: Leif Lindholm [mailto:leif.lindh...@linaro.org]
> > Sent: Sunday, October 14, 2018 4:40 AM
> > To: Zhu, Yonghong 
> > Cc: Ard Biesheuvel ; edk2-devel@lists.01.org; 
> > Gao, Liming 
> > Subject: Re: [Patch] BaseTools/Tests: Update GNUmakefile to use python3 
> > variable
> > 
> > Hi Yonghong,
> > 
> > Please revert this patch. The broken state of the master branch must
> > be undone, not hacked on until individual bits seem to work.
> > 
> > Plese do no further work on the master branch until the contents of
> > the tree is identical to what it was at
> > 301402fa4797ac3a141e575329ca2ea91756414c. (I am not talking about a
> > git push -f, I am talking about a git revert.)
> > 
> > Best Regards,
> > 
> > Leif
> > 
> > On Sat, Oct 13, 2018 at 04:53:21PM +, Zhu, Yonghong wrote:
> > > Hi Ard,
> > >
> > > Thanks. I pushed this patch since it is critical block issue.
> > > Version SHA-1: 678f85131238622e576705117e299d81cff755c9
> > >
> > > Best Regards,
> > > Zhu Yonghong
> > >
> > > -Original Message-
> > > From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
> > > Sent: Sunday, October 14, 2018 12:44 AM
> > > To: Zhu, Yonghong 
> > > Cc: edk2-devel@lists.01.org; Leif Lindholm 
> > > Subject: Re: [Patch] BaseTools/Tests: Update GNUmakefile to use python3 
> > > variable
> > >
> > > On 13 October 2018 at 18:40, Yonghong Zhu  wrote:
> > > > Cover the case use do make -C BaseTools before run the .edksetup.sh
> > > > file.
> > > >
> > > > Cc: Ard Biesheuvel 
> > > > Cc: Leif Lindholm 
> > > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > > Signed-off-by: Yonghong Zhu 
> > >
> > > Reviewed-by: Ard Biesheuvel 
> > > Tested-by: Ard Biesheuvel 
> > >
> > > > ---
> > > >  BaseTools/Tests/GNUmakefile | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/BaseTools/Tests/GNUmakefile b/BaseTools/Tests/GNUmakefile
> > > > index af334a8a..536f0b7 100644
> > > > --- a/BaseTools/Tests/GNUmakefile
> > > > +++ b/BaseTools/Tests/GNUmakefile
> > > > @@ -12,10 +12,10 @@
> > > >  #
> > > >
> > > >  all: test
> > > >
> > > >  test:
> > > > -   @if command -v $(PYTHON3) >/dev/null 2>&1; then $(PYTHON3) 
> > > > RunTests.py; else python RunTests.py; fi
> > > > +   @if command -v python3 >/dev/null 2>&1; then python3
> > > > + RunTests.py; else echo "Error: Please install a python 3 tool!"; fi
> > > >
> > > >  clean:
> > > > find . -name '*.pyc' -exec rm '{}' ';'
> > > >
> > > > --
> > > > 2.6.1.windows.1
> > > >
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] BaseTools/Tests: Update GNUmakefile to use python3 variable

2018-10-13 Thread Leif Lindholm
Hi Yonghong,

Please revert this patch. The broken state of the master branch must
be undone, not hacked on until individual bits seem to work.

Plese do no further work on the master branch until the contents of
the tree is identical to what it was at
301402fa4797ac3a141e575329ca2ea91756414c. (I am not talking about a
git push -f, I am talking about a git revert.)

Best Regards,

Leif

On Sat, Oct 13, 2018 at 04:53:21PM +, Zhu, Yonghong wrote:
> Hi Ard,
> 
> Thanks. I pushed this patch since it is critical block issue.
> Version SHA-1: 678f85131238622e576705117e299d81cff755c9
> 
> Best Regards,
> Zhu Yonghong
> 
> -Original Message-
> From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] 
> Sent: Sunday, October 14, 2018 12:44 AM
> To: Zhu, Yonghong 
> Cc: edk2-devel@lists.01.org; Leif Lindholm 
> Subject: Re: [Patch] BaseTools/Tests: Update GNUmakefile to use python3 
> variable
> 
> On 13 October 2018 at 18:40, Yonghong Zhu  wrote:
> > Cover the case use do make -C BaseTools before run the .edksetup.sh 
> > file.
> >
> > Cc: Ard Biesheuvel 
> > Cc: Leif Lindholm 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Yonghong Zhu 
> 
> Reviewed-by: Ard Biesheuvel 
> Tested-by: Ard Biesheuvel 
> 
> > ---
> >  BaseTools/Tests/GNUmakefile | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/BaseTools/Tests/GNUmakefile b/BaseTools/Tests/GNUmakefile 
> > index af334a8a..536f0b7 100644
> > --- a/BaseTools/Tests/GNUmakefile
> > +++ b/BaseTools/Tests/GNUmakefile
> > @@ -12,10 +12,10 @@
> >  #
> >
> >  all: test
> >
> >  test:
> > -   @if command -v $(PYTHON3) >/dev/null 2>&1; then $(PYTHON3) 
> > RunTests.py; else python RunTests.py; fi
> > +   @if command -v python3 >/dev/null 2>&1; then python3 
> > + RunTests.py; else echo "Error: Please install a python 3 tool!"; fi
> >
> >  clean:
> > find . -name '*.pyc' -exec rm '{}' ';'
> >
> > --
> > 2.6.1.windows.1
> >
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v1 2/6] PcAtChipsetPkg: Add MMIO Support to RTC driver

2018-10-13 Thread Leif Lindholm
On Fri, Oct 12, 2018 at 03:40:05PM +0100, Sami Mujawar wrote:
> Some virtual machine managers like kvmtool emulate the MC146818
> RTC controller in the MMIO space so that architectures that do
> not support I/O Mapped I/O can use the RTC. This patch adds MMIO
> support to the RTC controller driver.
> 
> The PCD PcdRtcUseMmio has been added to select I/O or MMIO support.
>   If PcdRtcUseMmio is:
> TRUE  - Indicates the RTC port registers are in MMIO space.
> FALSE - Indicates the RTC port registers are in I/O space.
> Default is I/O space.
> 
> When MMIO support is selected (PcdRtcUseMmio == TRUE) the driver
> maps the MMIO region used by the RTC as runtime memory so that the
> RTC registers are accessible post ExitBootServices.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Sami Mujawar 
> ---
> The changes can be seen at 
> https://github.com/samimujawar/edk2/commit/d9fa7df2204c12883a795c7df429578c310725bf
> 
> Notes:
> v1:
> - Add support to read/write from RTC registers using MMIO access  [SAMI]
> 
>  PcAtChipsetPkg/PcAtChipsetPkg.dec  | 
>   8 ++
>  PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c | 
>  38 ++-
>  PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c| 
> 112 +++-
>  PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.inf | 
>   8 ++
>  4 files changed, 162 insertions(+), 4 deletions(-)
> 
> diff --git a/PcAtChipsetPkg/PcAtChipsetPkg.dec 
> b/PcAtChipsetPkg/PcAtChipsetPkg.dec
> index 
> 0e66ff0ba3770cf765cfe36d592151d72eaa238a..5aaf5e73811c4dba3b83768f1535e028938ead1f
>  100644
> --- a/PcAtChipsetPkg/PcAtChipsetPkg.dec
> +++ b/PcAtChipsetPkg/PcAtChipsetPkg.dec
> @@ -6,6 +6,7 @@
>  #
>  # Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
>  # Copyright (c) 2017, AMD Inc. All rights reserved.
> +# Copyright (c) 2018, ARM Limited. All rights reserved.
>  #
>  # This program and the accompanying materials
>  # are licensed and made available under the terms and conditions of the BSD 
> License
> @@ -202,5 +203,12 @@ [PcdsFixedAtBuild, PcdsPatchableInModule]
># @Prompt RTC Target Register address
>gPcAtChipsetPkgTokenSpaceGuid.PcdRtcTargetRegister|0x71|UINT8|0x001F
>  
> +  ## Indicates the RTC port registers are in MMIO space, or in I/O space.
> +  #  Default is I/O space.
> +  #   TRUE  - RTC port registers are in MMIO space.
> +  #   FALSE - RTC port registers are in I/O space.
> +  # @Prompt RTC port registers use MMIO.
> +  gPcAtChipsetPkgTokenSpaceGuid.PcdRtcUseMmio|FALSE|BOOLEAN|0x0020
> +
>  [UserExtensions.TianoCore."ExtraFiles"]
>PcAtChipsetPkgExtra.uni
> diff --git a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c 
> b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c
> index 
> 7965eb8aa55b92caef7a63834695506123935e2d..ee746add57b9778bf09a4d9eb6881d06caa14aba
>  100644
> --- a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c
> +++ b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c
> @@ -3,6 +3,7 @@
>  
>  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
>  Copyright (c) 2017, AMD Inc. All rights reserved.
> +Copyright (c) 2018, ARM Limited. All rights reserved.
>  
>  This program and the accompanying materials
>  are licensed and made available under the terms and conditions of the BSD 
> License
> @@ -16,6 +17,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
> EXPRESS OR IMPLIED.
>  
>  #include "PcRtc.h"
>  
> +extern EFI_PHYSICAL_ADDRESS   mRtcRegisterBase;
> +
>  //
>  // Days of month.
>  //
> @@ -72,7 +75,21 @@ RtcRead (
>IN  UINT8 Address
>)
>  {
> -  IoWrite8 (PcdGet8 (PcdRtcIndexRegister), (UINT8) (Address | (UINT8) 
> (IoRead8 (PcdGet8 (PcdRtcIndexRegister)) & 0x80)));
> +  if (FixedPcdGetBool (PcdRtcUseMmio)) {
> +MmioWrite8 (
> +  mRtcRegisterBase,
> +  (UINT8)(Address | (UINT8)(MmioRead8 (mRtcRegisterBase) & 0x80))
> +  );
> +return MmioRead8 (
> + mRtcRegisterBase + (PcdGet8 (PcdRtcTargetRegister) -
> +   PcdGet8 (PcdRtcIndexRegister))
> + );
> +  }
> +
> +  IoWrite8 (
> +PcdGet8 (PcdRtcIndexRegister),
> +(UINT8)(Address | (UINT8)(IoRead8 (PcdGet8 (PcdRtcIndexRegister)) & 
> 0x80))
> +);
>return IoRead8 (PcdGet8 (PcdRtcTargetRegister));

So, this isn't my package, but I would much rather see this solved
with local (STATIC) wrapper functions (i.e. RtcRead*/RtcWrite*) for
the accessors instead of conditionalising which one to use at every
call site.

/
Leif

>  }
>  
> @@ -90,8 +107,23 @@ RtcWrite (
>IN  UINT8   Data
>)
>  {
> -  IoWrite8 (PcdGet8 (PcdRtcIndexRegister), (UINT8) (Address | (UINT8) 
> (IoRead8 (PcdGet8 (PcdRtcIndexRegister)) & 0x80)));
> -  IoWrite8 (PcdGet8 (PcdRtcTargetRegister), Data);
> +  if (FixedPcdGetBool (PcdRtcUseMmio)) {
> +MmioWrite8 (
> +  mRtcRegisterBase,
> +  (UINT8)(Address 

Re: [edk2] BaseTools/ build broken due to unreviewed patch - PLEASE FIX

2018-10-13 Thread Leif Lindholm
Liming,

The fact that the set includes unreviewed patches[1] should be
sufficient argument for reverting it immediately.

[1] ea787b6b55499e8f931201f8f49daaaeb2e4409f

But beyond that, a set this invasive should only ever be pushed
in the days after a stable tag has been created - not 2/3 through the
period.

This particular one breaks builds using the instructions from
https://github.com/tianocore/tianocore.github.io/wiki/Common-instructions

With the new set, it is mandatory that edksetup.sh is sourced before
building BaseTools. That was not previously the case, meaning existing
CI jobs following the documentation example now fail.

Please revert this set for now. We can revisit and plan a suitable way
forward after that.

Regards,

Leif

On Sat, Oct 13, 2018 at 08:44:39AM +, Gao, Liming wrote:
> Ard:
>   I pull the latest edk2 code. I can find RunTests.py in
>   BaseTools/Tests. The below error message shows RunTests.py is not
>   found. But, this file is in BaseTools/Tests. I also run Make
>   command in BaseTools directory. It can work in my Ubuntu
>   machine. I install Python37. Do you install Python36 or Python37
>   in your machine?
>   
>   Yonghong has sent the mail to notify BaseTools Python3 migration
>   is done. Python3.6 or the above is required.
>   
> 
> Thanks
> Liming
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ard 
> > Biesheuvel
> > Sent: Saturday, October 13, 2018 4:18 PM
> > To: edk2-devel-01 ; Gao, Liming 
> > ; Laszlo Ersek ; Leif Lindholm
> > ; Kinney, Michael D ; 
> > Zhu, Yonghong ;
> > stephano.cet...@linux.intel.com
> > Subject: [edk2] BaseTools/ build broken due to unreviewed patch - PLEASE FIX
> > 
> > Commit ea787b6b55499e8f931201f8f49daaaeb2e4409f
> > 
> >   "BaseTools: update Test scripts support python3"
> > 
> > [which has never been sent out for review to the mailing list, as far
> > as I can tell] is breaking the BaseTools build
> > 
> > make -C Tests
> > make[1]: Entering directory '/home/ard/build/edk2/BaseTools/Tests'
> > /bin/sh: 1: RunTests.py: not found
> > GNUmakefile:17: recipe for target 'test' failed
> > make[1]: *** [test] Error 127
> > make[1]: Leaving directory '/home/ard/build/edk2/BaseTools/Tests'
> > GNUmakefile:25: recipe for target 'Tests' failed
> > make: *** [Tests] Error 2
> > make: Leaving directory '/home/ard/build/edk2/BaseTools'
> > 
> > I tried reverting that patch alone, but that gives me
> > 
> > make -C Tests
> > make[1]: Entering directory '/home/ard/build/edk2/BaseTools/Tests'
> > Traceback (most recent call last):
> >   File "RunTests.py", line 36, in 
> > allTests = GetAllTestsSuite()
> >   File "RunTests.py", line 33, in GetAllTestsSuite
> > return unittest.TestSuite([GetCTestSuite(), GetPythonTestSuite()])
> >   File "RunTests.py", line 30, in GetPythonTestSuite
> > return PythonToolsTests.TheTestSuite()
> >   File "/home/ard/build/edk2/BaseTools/Tests/PythonToolsTests.py",
> > line 27, in TheTestSuite
> > import CheckUnicodeSourceFiles
> >   File "/home/ard/build/edk2/BaseTools/Tests/CheckUnicodeSourceFiles.py",
> > line 25, in 
> > from Common.Misc import PathClass
> >   File "/home/ard/build/edk2/BaseTools/Source/Python/Common/Misc.py",
> > line 27, in 
> > from collections import UserDict as IterableUserDict
> > ImportError: cannot import name UserDict
> > GNUmakefile:17: recipe for target 'test' failed
> > make[1]: *** [test] Error 1
> > make[1]: Leaving directory '/home/ard/build/edk2/BaseTools/Tests'
> > GNUmakefile:25: recipe for target 'Tests' failed
> > make: *** [Tests] Error 2
> > make: Leaving directory '/home/ard/build/edk2/BaseTools'
> > 
> > Breaking the build for everyone with an unreviewed patch 2 days before
> > the plugfest is NOT OK.
> > 
> > Please fix or revert ASAP
> > 
> > (I suppose that the failing test is a false negative in this case, but
> > that is not really the point - my CI jobs are broken due to this and
> > so are many others, I imagine)
> > ___
> > 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] TianoCore Community Meeting Minutes

2018-10-12 Thread Leif Lindholm
On Fri, Oct 12, 2018 at 06:07:01PM +0200, Laszlo Ersek wrote:
> On 10/12/18 15:27, Leif Lindholm wrote:
> > On Thu, Oct 11, 2018 at 10:43:57AM -0700, stephano wrote:
> 
> >> Switching to Standard C Types
> >> -
> >> Both Shawn and Nate mentioned that the current system has been in place for
> >> a long time and some people prefer the current setup. I can start an email
> >> discussion around this issue specifically if anyone feels strongly that we
> >> should be using standard types.
> > 
> > So, I don't think we made it this far down the agenda on the US-EU
> > call.
> > 
> > One way would be to simply explicitly permit it, possibly with the
> > constraint that every module needs to pick one and stick with it,
> > unless people object.
> > 
> > I think we'll want to discuss this in a US-EU call as well.
> 
> I'm playing devil's advocate here -- because, in general, I'm a fan of
> sticking with standard C as much as possible --, but I see a big
> obstacle in the way.
> 
> That obstacle is "Table 5. Common UEFI Data Types", in the UEFI spec.
> Until a good portion of that table is expressed in terms of standard C
> types as well (expanding upon the current definitions), possibly in an
> edk2-level spec (i.e. not necessarily in the UEFI spec itself), I think
> there's no chance to enable standard C types in edk2 *meaningfully*.
> 
> Because, as soon as you have to call a PI or UEFI interface, you'll have
> to stick with the PI/UEFI spec types anyway.

I don't necessarily see that as an issue. But it is a good point that
it can't just be the codebase changing.

Since we are however extremely specificly not looking to change the
underlying storage types, all it would take would be to make a
2-column table into a 3-column table in both specs. Or just add a
separate table for the mapping. Then edk2 could adopt the "permitted"
rule as soon as the specs were out. Arguably (because we're not
changing underlying types) we could do it before, but we _are_
supposed to be the reference implementation, so it would be poor form.

> >> Using Git Submodules (like we do with OpenSSL)
> >> 
> > 
> > We didn't make it here either. What would we use it _for_?
> > I think the openssl case makes a lot of sense, but what else?
> 
> We embed a bunch of other projects (libraries, mainly):
> - Oniguruma
> - Brotli
> - fdt
> - LZMA SDK
> - ...

Sure. But do we know that is what was meant?

I certainly recall the "each package should be a submodule" idea from
a (much) earlier conversation, and would like to ensure we're not
resurrecting that.

Regards,

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


Re: [edk2] TianoCore Community Meeting Minutes

2018-10-12 Thread Leif Lindholm
Hi Stephano,

Thanks for pulling this together.
Some comments below.

On Thu, Oct 11, 2018 at 10:43:57AM -0700, stephano wrote:
> Thank you all for a great set of meetings!
> 
> This is an overview of the topics discussed and the tasks that were
> assigned. Please feel free to send me any questions or comments.
> 
> Licensing
> -
> Licensing was discussed and no questions or comments came up. Please feel
> free to contact me directly if you would like more info.
> 
> Community Meetings
> --
> Community meetings will be held regularly. We will plan public bug scrubs
> and design meetings. Meeting formats will use zoom and be held 2 times per
> day to accommodate all time zones.

So I didn't comment on the call (which I dialled in to, using a
phone, because that was the only thing that wasn't going to delay me
10 minutes), but I would prefer a conferencing system that does not require
binary downloads to participate in.

I know at least one organisation that would be prevented from using it
until they had explicit approval (which could take a while), and it
puts me in the position of having to keep a spare x86 machine on my
desktop in order to participate.

Solutions I know would work in this scenario (i.e. work without
plugins or downloads in any modern browser) are:
- google hangouts (requires accounts, not ideal for China)
- Skype (not SFB though, only plain old Skype)
- Bluejeans (requires organiser account)

Sure, I could attend via the Android app for zoom, but it would make
it tedious to paste links to/from chat and put me on a tiny screen.

> Invites will be posted to the mailing
> list and the wiki. Since the mailing list does not allow attachments, I will
> work on getting an "add to calendar" link attached to the wiki page.
> 
> I will send out a poll to see if the community would be interested in a
> Slack channel. I'm happy to admin it if there is interest.
> 
> I will also be setting up a specific meeting, probably next month, to
> discuss general code and commit message standards.
> 
> 
> Patch Workflow Improvement
> --
> We would like to find a more modern, user friendly patch workflow that fits
> (as best as it can) most company's workflow.
> It is recommended that the
> community familiarize themselves with some of the options that are out there
> so that we can pose useful questions / comments at the next meeting. Please
> be sure to research up-to-date information and not rely on old info. Options
> and tools discussed included:
> -Github
> -Gitlab
> -Phabricator
> -Gerrit
> 
> The was a concern raised over potential lock-in to Github's, specifically in
> regards to history retention.
> Several Github users brought up that this shouldn't be an issue.

Hopefully they said more than that.
What does "shouldn't be an issue" mean.
Were these users from multiple organisations?

> Shawn mentioned some benefits to stock Github such as
> it is always up to date, it includes APIs to extract data, pull
> requests

Since we are discussing multiple different development systems, can we
try to be a bit more explicit? This is referring to github's web-based
branch-based ticketing system, yes?

I know language drift and all, but
https://www.kernel.org/doc/html/latest/maintainer/pull-requests.html
is what pull request means to at least 3 participants in this conversation.

> lend themselves to simple(r) automation, and it has a much more modern web
> UI than Gerrit.

It seems somewhat less than ideal to me that all of the github
proponents were on the opposite call to me and Laszlo (and Ard). Were
any of them Asia-based or could we try to get them on the call with
Europe next time? I'm sure me and Laszlo could be somewhat more
accommodating than your 7AM, but we're not going to stay up for a 3/4AM
meeting about source control.

> Several community members including Marcin and Rebecca have used Phabricator
> and can recommend it. Intel has used Gerrit internally and can recommend its
> use.

I don't think we had anyone from ARM on either of the calls, but I
know they use gerrit internally.

For those who weren't on the call I was on, I am _not_ a fan of gerrit
- but if the deciding factor (as suggested above) is to best align
with the internal processes of contributing organisations, then
gerrit wins hands down.

> No one voiced any issues with Bugzilla and several from the community
> thought that we should continue to use it.
> 
> Improvements to the Build Process
> 
> We would like to gather a list of concrete specific proposals. Nate
> mentioned that there will always be some specialized tooling because of the
> nature of BIOS. Shawn mentioned that we need to keep in mind that making
> development easier for current developers should be a priority over making
> the processes easier for newcomers. I will send out emails asking for
> specific feedback on some of these topics:
> 
> -Which toolchains are being used, which are 

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

2018-10-08 Thread Leif Lindholm
On Mon, Oct 08, 2018 at 03:20:27PM +0530, Sumit Garg wrote:
> On Fri, 5 Oct 2018 at 20:33, Leif Lindholm  wrote:
> >
> > 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.
> >
> 
> Thanks Leif for this go ahead.
> 
> > 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.
> >
> 
> Sure.
> 
> > > >  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.
> >
> 
> Will rather use BufferAddress.
> 
> > > > +  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.
> >
> 
> Will replace it with SharedMemoryReference.
> 
> > (This comment also applies to a lot of things below, I won't point
> > them all out unless asked to.)
> >
> 
> I will try to replace most of them with full names. But I have
> confusion regarding usage of following not included in [1]:
> 
> 1. MSG/Msg
> 2. MEM/Mem
> 3. INFO/Info
> 4. FUNC/Func
> 5. RET/Ret
> 6. ATTR/Attr
> 7. CMD/Cmd
> 
> But I do see their usage in the codebase. Please help to clarify.

It's a horrible secret, but not a

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"

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 

Re: [edk2] [PATCH edk-platforms v1 1/4] Platform/Hisilicon: add UsbSerialNumberLib

2018-10-04 Thread Leif Lindholm
Ah, here's UsbSerialNumberLib. Got it.
(Please mention dependencies on other patchsets in the cover-letter.)

Please wrap these 3 sets together into a single one, with patches in
dependency order, for v2.

I will comment on this patch aftes I'm done with DwUsb2.

/
Leif

On Mon, Aug 20, 2018 at 06:31:46PM +0800, Haojian Zhuang wrote:
> Add UsbSerialNumberLib. The Library could generate USB Serial Number
> that is used in USB device driver. And it could load/save the USB
> Serial Number into storage device.
> 
> Cc: Leif Lindholm 
> Cc: Ard Biesheuvel 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Haojian Zhuang 
> ---
>  Platform/Hisilicon/Library/UsbSerialNumberLib/UsbSerialNumberLib.dec 
>   |  32 ++
>  Platform/Hisilicon/Library/UsbSerialNumberLib/UsbSerialNumberLib.inf 
>   |  45 +++
>  
> Platform/Hisilicon/Library/UsbSerialNumberLib/Include/Library/UsbSerialNumberLib.h
>  |  59 
>  Platform/Hisilicon/Library/UsbSerialNumberLib/UsbSerialNumberLib.c   
>   | 341 
>  4 files changed, 477 insertions(+)
> 
> diff --git 
> a/Platform/Hisilicon/Library/UsbSerialNumberLib/UsbSerialNumberLib.dec 
> b/Platform/Hisilicon/Library/UsbSerialNumberLib/UsbSerialNumberLib.dec
> new file mode 100644
> index ..4b8b2e047ed9
> --- /dev/null
> +++ b/Platform/Hisilicon/Library/UsbSerialNumberLib/UsbSerialNumberLib.dec
> @@ -0,0 +1,32 @@
> +#
> +#  Copyright (c) 2018, Linaro Limited. 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]
> +  DEC_SPECIFICATION  = 0x00010019
> +  PACKAGE_NAME   = UsbSerialNumberPkg
> +  PACKAGE_GUID   = dcd67420-4220-4b01-a8ba-1fa97fda1678
> +  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
> +#
> +
> +[Includes.common]
> +  Include# Root include for the package
> +
> +[Guids.common]
> +  gUsbSerialNumberTokenSpaceGuid = { 0x0572f26b, 0x1a88, 0x49c2, { 0xb6, 
> 0x98, 0x4d, 0xe0, 0xd0, 0x2a, 0xfe, 0x09 } }
> diff --git 
> a/Platform/Hisilicon/Library/UsbSerialNumberLib/UsbSerialNumberLib.inf 
> b/Platform/Hisilicon/Library/UsbSerialNumberLib/UsbSerialNumberLib.inf
> new file mode 100644
> index ..70ea086d324e
> --- /dev/null
> +++ b/Platform/Hisilicon/Library/UsbSerialNumberLib/UsbSerialNumberLib.inf
> @@ -0,0 +1,45 @@
> +#/** @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  = UsbSerialNumberLib
> +  FILE_GUID  = 88709c56-2a76-4a13-8bcf-427970b7e32a
> +  MODULE_TYPE= BASE
> +  VERSION_STRING = 1.0
> +  LIBRARY_CLASS  = UsbSerialNumberLib
> +
> +#
> +# The following information is for reference only and not required by the 
> build tools.
> +#
> +  VALID_ARCHITECTURES   = ARM AARCH64
> +
> +[Sources]
> +  UsbSerialNumberLib.c
> +
> +[LibraryClasses]
> +  ArmGenericTimerCounterLib
> +  BaseMemoryLib
> +  DebugLib
> +  MemoryAllocationLib
> +  UefiBootServicesTableLib
> +  UefiLib
> +
> +[Protocols]
> +  gEfiBlockIoProtocolGuid
> +
> +[Packages]
> +  ArmPkg/ArmPkg.dec
> +  MdePkg/Mde

Re: [edk2] [PATCH v1 2/2] EmbeddedPkg/Drivers: add DwUsb3Dxe driver

2018-10-04 Thread Leif Lindholm
On Mon, Aug 20, 2018 at 06:31:25PM +0800, Haojian Zhuang wrote:
> Add Designware USB 3.0 device driver. It's focus on USB device
> functionality, not USB Host functionality. The USB driver is
> mainly used for Android Fastboot application.
> 
> Cc: Leif Lindholm 
> Cc: Ard Biesheuvel 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Haojian Zhuang 
> ---
>  EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.dec |   44 +
>  EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.inf |   52 +
>  EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.h   |  632 +
>  EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.c   | 2434 
>  4 files changed, 3162 insertions(+)
> 
> diff --git a/EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.dec 
> b/EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.dec
> new file mode 100644
> index ..038e4881a948
> --- /dev/null
> +++ b/EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.dec
> @@ -0,0 +1,44 @@
> +#/** @file
> +# Framework Module Development Environment Industry Standards

Please change this to reflect this package rather than EmbeddedPkg one
(which appears to have stolen it from an old version of MdePkg.dec :)

> +#
> +# 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.

I see no need to keep these copyright statements.

> +# 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]
> +  DEC_SPECIFICATION  = 0x00010019
> +  PACKAGE_NAME   = DwUsb3DxePkg
> +  PACKAGE_GUID   = 9b7aa6fe-405b-4955-af1f-5faf183aedec
> +  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]
> +  gDwUsb3DxeTokenSpaceGuid  = { 0x098a50d3, 0x92e2, 0x461a, { 0xb6, 
> 0xba, 0xf8, 0x5d, 0x9d, 0x89, 0x49, 0xf5 }}
> +
> +[Protocols.common]
> +  gDwUsbProtocolGuid= { 0x109fa264, 0x7811, 0x4862, { 0xa9, 
> 0x73, 0x4a, 0xb2, 0xef, 0x2e, 0xe2, 0xff }}

Please make this file a common .dec for DwUsb and DwUsb3 instead of
duplicating guid information.
(If we weren't moving it to edk2-platforms, it would still have been
better to add it to EmbeddedPkg.dec.)

> +
> +[PcdsFixedAtBuild.common]
> +  # DwUsb Driver PCDs
> +  gDwUsb3DxeTokenSpaceGuid.PcdDwUsb3DxeBaseAddress|0x0|UINT32|0x0001
> diff --git a/EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.inf 
> b/EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.inf
> new file mode 100644
> index ..510b51a34de7
> --- /dev/null
> +++ b/EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.inf
> @@ -0,0 +1,52 @@
> +#/** @file
> +#
> +#  Copyright (c) 2018, Linaro Limited. 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  = DwUsb3Dxe
> +  FILE_GUID  = 0879cd34-c399-4315-9891-56024072e711
> +  MODULE_TYPE= UEFI_DRIVER
> +  VERSION_STRING = 1.0
> +  ENTRY_POINT= DwUsb3EntryPoint
> +
> +[Sources.common]
> +  DwUsb3Dxe.c
> +
> +[LibraryClasses]
> +  CacheMaintenanceLib
> +  DebugLib
> +  DmaLib
> +  IoLib
> +  MemoryAllocationLib
> +  

Re: [edk2] [PATCH v1 1/2] EmbeddedPkg: add DwUsb protocol

2018-10-04 Thread Leif Lindholm
On Mon, Aug 20, 2018 at 06:31:24PM +0800, Haojian Zhuang wrote:
> The protocol defines the callbacks that could be implemented in
> platform driver. DwUsb device driver needs these callbacks to
> implement USB device functionality.
> 
> Cc: Leif Lindholm 
> Cc: Ard Biesheuvel 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Haojian Zhuang 
> ---
>  EmbeddedPkg/Include/Protocol/DwUsb.h | 81 
>  1 file changed, 81 insertions(+)
> 
> diff --git a/EmbeddedPkg/Include/Protocol/DwUsb.h 
> b/EmbeddedPkg/Include/Protocol/DwUsb.h
> new file mode 100644
> index ..b9fb776f9258
> --- /dev/null
> +++ b/EmbeddedPkg/Include/Protocol/DwUsb.h
> @@ -0,0 +1,81 @@
> +/** @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.
> +
> +**/
> +
> +#ifndef __DW_USB_H__
> +#define __DW_USB_H__

Can you expand all instances of public interfaces to DESIGNWARE?

> +
> +//
> +// Protocol GUID
> +//
> +#define DW_USB_PROTOCOL_GUID { 0x109fa264, 0x7811, 0x4862, { 0xa9, 0x73, 
> 0x4a, 0xb2, 0xef, 0x2e, 0xe2, 0xff }}
> +
> +//
> +// Protocol interface structure
> +//
> +typedef struct _DW_USB_PROTOCOL  DW_USB_PROTOCOL;
> +
> +#define USB_HOST_MODE 0
> +#define USB_DEVICE_MODE   1
> +#define USB_CABLE_NOT_ATTACHED2

And add a DESIGNWARE_ prefix to these?

> +
> +#define LANG_LENGTH   8
> +#define MANU_FACTURER_STRING_LENGTH   32

MANUFACTURER.

Why the hardcoded string lengths?
Are they mandated somewhere?

> +#define PRODUCT_STRING_LENGTH 32
> +#define SERIAL_STRING_LENGTH  17
> +
> +typedef
> +EFI_STATUS
> +(EFIAPI *DW_USB_GET_LANG) (
> +  OUT CHAR16   *Lang,
> +  OUT UINT8*Length
> +  );
> +
> +typedef
> +EFI_STATUS
> +(EFIAPI *DW_USB_GET_MANU_FACTURER) (
> +  OUT CHAR16   *ManuFacturer,

ManuFacturer ->
Manufacturer.

> +  OUT UINT8*Length
> +  );
> +
> +typedef
> +EFI_STATUS
> +(EFIAPI *DW_USB_GET_PRODUCT) (
> +  OUT CHAR16   *Product,
> +  OUT UINT8*Length
> +  );
> +
> +typedef
> +EFI_STATUS
> +(EFIAPI *DW_USB_GET_SERIAL_NO) (

SERIAL_NUMBER

> +  OUT CHAR16   *SerialNo,

SerialNumber.

> +  OUT UINT8*Length
> +  );
> +
> +typedef
> +EFI_STATUS
> +(EFIAPI *DW_USB_PHY_INIT) (
> +  IN UINT8 Mode
> +  );
> +
> +struct _DW_USB_PROTOCOL {
> +  DW_USB_GET_LANG  GetLang;
> +  DW_USB_GET_MANU_FACTURER GetManuFacturer;

GetManuFacturer ->
GetManufacturer.

> +  DW_USB_GET_PRODUCT   GetProduct;
> +  DW_USB_GET_SERIAL_NO GetSerialNo;
> +  DW_USB_PHY_INIT  PhyInit;
> +};
> +
> +extern EFI_GUID gDwUsbProtocolGuid;

gDesignWareUsbProtocolGuid.

/
Leif

> +
> +#endif /* __DW_USB_H__ */
> -- 
> 2.7.4
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v1 0/2] add DwUsb3Dxe driver

2018-10-04 Thread Leif Lindholm
Hi Haojian,

I will start with a few high-level requests:
- Could you rework this for inclusion in edk2-platforms instead?
  Silicon/Synopsys I guess?
- Could you submit Usb2 and Usb3 support in a single set for v2?
- Can you convert these to UEFI driver model with
  NonDiscoverableDeviceRegistrationLib instead of a hard-coded base
  address?

I will provide detailed feedback on the individual patches separately,
so please wait for that before creating a v2.

/
Leif

On Mon, Aug 20, 2018 at 06:31:23PM +0800, Haojian Zhuang wrote:
> Changelog:
>   v1:
> * Add Designware USB 3.0 device driver.
> 
> Haojian Zhuang (2):
>   EmbeddedPkg: add DwUsb protocol
>   EmbeddedPkg/Drivers: add DwUsb3Dxe driver
> 
>  EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.c   | 2434 
> +++
>  EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.dec |   44 +
>  EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.h   |  632 +++
>  EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.inf |   52 +
>  EmbeddedPkg/Include/Protocol/DwUsb.h|   81 +
>  5 files changed, 3243 insertions(+)
>  create mode 100644 EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.c
>  create mode 100644 EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.dec
>  create mode 100644 EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.h
>  create mode 100644 EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.inf
>  create mode 100644 EmbeddedPkg/Include/Protocol/DwUsb.h
> 
> Cc: Leif Lindholm 
> Cc: Ard Biesheuvel 
> -- 
> 2.7.4
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Regression with PXE boot on OvmfPkg/VirtioNetDxe driver on aarch64 system

2018-10-04 Thread Leif Lindholm
+Peter

On Wed, Oct 03, 2018 at 04:59:54PM -0700, aaron.yo...@oracle.com wrote:
>  I am suspecting that this patch to GRUB is the cause of a Buffer being
> re-transmitted before reaping the Buffer via SNP->GetStatus():
> 
> https://git.centos.org/blob/rpms!grub2.git/1065bd29e776aef83f927747882140dcb6fd5cde/SOURCES!0183-efinet-retransmit-if-our-device-is-busy.patch
> 
>  So, to reproduce the issue, the GRUB used via PXE boot needs to include
> this patch.

So the issue cannot be reproduced with upstream GRUB?

Does Fedora/Red Hat include the same patch?

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


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

2018-10-02 Thread Leif Lindholm
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/DuetPkg
 M: Ruiyu Ni 
 M: Hao Wu 
 
+DynamicTablesPkg
+W: https://github.com/tianocore/tianocore.github.io/wiki/DynamicTablesPkg
+M: Evan Lloyd 
+M: Sami Mujawar 
+
 EdkCompatibilityPkg
 W: https://github.com/tianocore/tianocore.github.io/wiki/EdkCompatibilityPkg
 M: Liming Gao 
-- 
2.11.0

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


Re: [edk2] [PATCH v2 1/2] MdePkg/IndustryStandard: Add Global Plaform header file

2018-09-28 Thread Leif Lindholm
Hi Sumit,

On Fri, Sep 28, 2018 at 11:59:33AM +0530, Sumit Garg wrote:
> > > Please help to answer below query from Michael regarding licensing
> > > concerns for using Global Platform specs content in OP-TEE.
> >
> > This dates back to ~2014 before OP-TEE had been pushed as an open source
> > project and indeed the click-through license was one thing that was
> > discussed before we decided to publish this. Having that said, the legal
> > people at ST (back then the project was owned by ST) concluded that we
> > could use the GP click-through license for the APIs, this is a
> > copy/paste from an email discussion with ST (in 2014).
> >
> > "On the legal side, one week ago our legal dedicated to this matter
> > wrote “Progress! Finally, having discussed with colleagues, we have
> > concluded that we can use the GP click-through license for the APIs.
> > Therefore I just need to tidy up the following points and we will be
> > able to provide both the CLA and the license terms for the distribution
> > quite quickly […].”
> >
> > I don't know how the discussion went inside ST nor who the legal person
> > was, but since ST had people on GlobalPlatform boards back then, I
> > suppose that the ST legal people went that way. The only way to find out
> > more about this is to talk directly to ST legal people who were involved
> > in this back in the days.
> 
> Thanks Joakim for this info.
> 
> Mike,
> 
> Please share your views on this and if we could include content from
> Global Platform spec into MdePkg as an industry standard.

Having had a discussion about this, the bit that concerns us the most
is the export restrictions clause of the click-through license which
contains the very unfortunate part "or any product complying with the
Specification.".

Someone must have thought this interface defines cryptography, rather
than an API through which to call cryptography functions.

I don't like it, but without a change in that license I don't see how
we can include this interface in edk2. One workaround would be to
publish this in a separate repository on https://github.com/OP-TEE/
which could be included in builds using PACKAGES_PATH (like we do with
edk2-platforms and edk2-non-osi).

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


Re: [edk2] portability of ShellPkg

2018-09-05 Thread Leif Lindholm
On Wed, Sep 05, 2018 at 05:30:23PM +, Carsey, Jaben wrote:
> How does removing a lib from the components section affect the shell binary 
> output?

Maybe it doesn't and I'm barking up the wrong tree? Unfortunately,
the only thing that means is we don't have a trivial workaround.

/
Leif

> Is the asset at compile time?
> 
> Jaben
> 
> > On Sep 5, 2018, at 10:26 AM, Leif Lindholm  wrote:
> > 
> > Hi all,
> > 
> > (This is partly a summary of discussions that have been held on IRC
> > and offline, with Alex Graf and Mike Kinney.)
> > 
> > The UEFI Shell, as produced by the contents of ShellPkg, is needed for
> > running the UEFI SCT. This has never been problematic before - but now
> > we are starting to run SCT on the U-Boot implementation of the UEFI
> > interfaces, certain implicit assumptions may need to be made explicit,
> > and perhaps reevaluated.
> > 
> > My feeling is the following:
> > - The MinUefiShell variant should be sufficient to run SCT.
> > - The UEFI Shell as provided by ShellPkg (any flavour) should run on
> >  any valid UEFI implementation. Where underlying functionality is
> >  missing for certain commands, those commands should be
> >  degraded/disabled to let remaining commands function.
> > 
> > Ideally, I would like to see a Readme.md in ShellPkg, basically
> > providing a mission statement. I could write one, but I expect the
> > people who actually maintain it would be better suited :)
> > 
> > We currently have an issue with running the shell on U-Boot because
> > even MinUefiShell pulls in UefiShellDebug1CommandsLib.inf. This
> > appears to be inadvertent, since it is also included a few lines
> > further down inside an !ifndef $(NO_SHELL_PROFILES) guard.
> > So I would propose the following patch (and can send it out properly
> > if the maintainers agree):
> > 
> > diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc
> > index 59dd07e0ae..c852abd3f7 100644
> > --- a/ShellPkg/ShellPkg.dsc
> > +++ b/ShellPkg/ShellPkg.dsc
> > @@ -101,7 +101,6 @@ [Components]
> >   ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf
> >   
> > ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf
> >   
> > ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf
> > -  
> > ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
> >   
> > ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf
> >   
> > ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf
> >  
> > The reason this causes a problem is because this module has a
> > dependency on HobLib, which ASSERTS if it does not find any HOBs lying
> > around. Since HOBs are a PI concept rather than a UEFI concept,
> > ideally we would not terminate the shell if they are missing. However,
> > since the HobLib is generic to EDK2, we also shouldn't just go
> > stripping ASSERTs out of it. The above patch gives us a way of
> > unblocking the SCT on U-Boot UEFI while we consider what to do about
> > the bigger question.
> > 
> > Thoughts?
> > 
> > /
> >Leif
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] portability of ShellPkg

2018-09-05 Thread Leif Lindholm
Hi all,

(This is partly a summary of discussions that have been held on IRC
and offline, with Alex Graf and Mike Kinney.)

The UEFI Shell, as produced by the contents of ShellPkg, is needed for
running the UEFI SCT. This has never been problematic before - but now
we are starting to run SCT on the U-Boot implementation of the UEFI
interfaces, certain implicit assumptions may need to be made explicit,
and perhaps reevaluated.

My feeling is the following:
- The MinUefiShell variant should be sufficient to run SCT.
- The UEFI Shell as provided by ShellPkg (any flavour) should run on
  any valid UEFI implementation. Where underlying functionality is
  missing for certain commands, those commands should be
  degraded/disabled to let remaining commands function.

Ideally, I would like to see a Readme.md in ShellPkg, basically
providing a mission statement. I could write one, but I expect the
people who actually maintain it would be better suited :)

We currently have an issue with running the shell on U-Boot because
even MinUefiShell pulls in UefiShellDebug1CommandsLib.inf. This
appears to be inadvertent, since it is also included a few lines
further down inside an !ifndef $(NO_SHELL_PROFILES) guard.
So I would propose the following patch (and can send it out properly
if the maintainers agree):

diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc
index 59dd07e0ae..c852abd3f7 100644
--- a/ShellPkg/ShellPkg.dsc
+++ b/ShellPkg/ShellPkg.dsc
@@ -101,7 +101,6 @@ [Components]
   ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf
   ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf
   
ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf
-  ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
   
ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf
   
ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf
  
The reason this causes a problem is because this module has a
dependency on HobLib, which ASSERTS if it does not find any HOBs lying
around. Since HOBs are a PI concept rather than a UEFI concept,
ideally we would not terminate the shell if they are missing. However,
since the HobLib is generic to EDK2, we also shouldn't just go
stripping ASSERTs out of it. The above patch gives us a way of
unblocking the SCT on U-Boot UEFI while we consider what to do about
the bigger question.

Thoughts?

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


Re: [edk2] [PATCH edk2-platforms v5 00/28] Upload for D06 platform

2018-09-03 Thread Leif Lindholm
On Fri, Aug 31, 2018 at 09:26:42PM +0800, Ming Huang wrote:
> The major features of this patchset include:
> 1 D06 source code;
> 2 Unify some D0x modules;
> 
> Change since v4: 
> 1  build on every commit:
>   Squash "Add PciPlatformLib" to "Add several base file for D06";
>   Reorder OemMiscLibD06 before "Add edk2-non-osi components for D06";
>   Move some mudules after "Add edk2-non-osi components for D06";
>   Move gOemConfigGuid to "Stop watchdog";
> 2 Delete needless SnpDxe;
> 3 Reorder "Unify HisiAcpiPlatformDxe";
> 4 Modify Signed-off-by and add Reviewed-by;
> 5 Modify other comments in v4;
> 
> Code can also be found in github: 
> https://github.com/hisilicon/OpenPlatformPkg.git
> branch: d06-platform-v5

For the series:
Reviewed-by: Leif Lindholm 
Pushed as 1d331a2eaa..8c3914c90e.

> Heyi Guo (3):
>   Hisilicon/D06: Add Debug Serial Port Init Driver
>   Hisilicon/Hi1620: Add ACPI PPTT table
>   Platform/Hisilicon/D06: Enable ACPI PPTT
> 
> Luqi Jiang (1):
>   Hisilicon/D06: add apei driver
> 
> Ming Huang (19):
>   Hisilicon/D0x: Modify PcdBootManagerMenuFile for build
>   Silicon/Hisilicon/Acpi: Unify HisiAcpiPlatformDxe
>   Hisilicon/D06: Add several base file for D06
>   Platform/Hisilicon/D06: Add M41T83RealTimeClockLib
>   Hisilicon/D06: Add OemMiscLibD06
>   Platform/Hisilicon/D06: Add edk2-non-osi components for D06
>   Hisilicon/D06: Add some modules
>   Silicon/Hisilicon/D06: Wait for all disk ready
>   Hisilicon/D06: Add ACPI Tables for D06
>   Silicon/Hisilicon/D06: Stop watchdog
>   Platform/Hisilicon/D06: Add OemNicLib
>   Platform/Hisilicon/D06: Add OemNicConfig2P Driver
>   Platform/Hisilicon/D06: Add EarlyConfigPeim peim
>   Platform/Hisilicon/D06: Add PciHostBridgeLib
>   Platform/Hisilicon/D06: Add capsule upgrade support
>   Silicon/Hisilicon: Add I2C Bus Exception handle function
>   Silicon/Hisilicon/Setup: Support SPCR table switch
>   Silicon/Hisilicon/setup: Enable/disable SMMU
>   Platform/Hisilicon/D0x: Update version string to 18.08
> 
> Sun Yuanchen (2):
>   Silicon/Hisilicon/D0x: Move RAS macro to PlatformArch.h
>   Hisilicon/D0x: Update SMBIOS type9 info
> 
> Yang XinYi (2):
>   Hisilicon/D06: Add Hi1620OemConfigUiLib
>   Silicon/Hisilicon/Hi1620/Setup: Add Setup Item "EnableGOP"
> 
> ZhenYao (1):
>   Silicon/Hisilicon: Modify for disable slave core clock.
> 
>  Platform/Hisilicon/D06/D06.dec|   29 +
>  Silicon/Hisilicon/Hi1620/Hi1620.dec   |   23 +
>  Silicon/Hisilicon/HisiPkg.dec |1 +
>  Platform/Hisilicon/D03/D03.dsc|4 +-
>  Platform/Hisilicon/D05/D05.dsc|4 +-
>  Platform/Hisilicon/D06/D06.dsc|  489 
>  Platform/Hisilicon/D06/D06.fdf|  441 
>  .../OemMiscLib2P/OemMiscLib2PHi1610.inf   |1 +
>  .../Library/OemMiscLibD05/OemMiscLibD05.inf   |1 +
>  .../OemNicConfig2PHi1620/OemNicConfig2P.inf   |   43 +
>  .../SystemFirmwareDescriptor.inf  |   50 +
>  .../EarlyConfigPeim/EarlyConfigPeimD06.inf|   50 +
>  .../Library/OemMiscLibD06/OemMiscLibD06.inf   |   50 +
>  .../D06/Library/OemNicLib/OemNicLib.inf   |   35 +
>  .../PciHostBridgeLib/PciHostBridgeLib.inf |   36 +
>  .../HisiAcpiPlatformDxe/AcpiPlatformDxe.inf   |3 +-
>  .../Hisilicon/Hi1620/Drivers/Apei/Apei.inf|   59 +
>  .../Pl011DebugSerialPortInitDxe.inf   |   48 +
>  .../Hi1620AcpiTables/AcpiTablesHi1620.inf |   60 +
>  .../Hi1620OemConfigUiLib/OemConfigUiLib.inf   |   68 +
>  .../Hi1620PciPlatformLib.inf  |   30 +
>  Silicon/Hisilicon/Hi1620/Pptt/Pptt.inf|   48 +
>  .../M41T83RealTimeClockLib.inf|   46 +
>  .../PlatformBootManagerLib.inf|5 +
>  .../OemNicConfig2PHi1620/OemNicConfig.h   |   25 +
>  .../Hisilicon/D06/Include/Library/CpldD06.h   |   39 +
>  .../Hisilicon/Hi1610/Include/PlatformArch.h   |   15 +-
>  .../Hisilicon/Hi1616/Include/PlatformArch.h   |   12 +
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/Apei.h  |   41 +
>  .../Hisilicon/Hi1620/Drivers/Apei/Bert/Bert.h |   43 +
>  .../Hisilicon/Hi1620/Drivers/Apei/Einj/Einj.h |  146 ++
>  .../Hi1620/Drivers/Apei/ErrorSource/Ghes.h|  110 +
>  .../Hisilicon/Hi1620/Drivers/Apei/Erst/Erst.h |  140 ++
>  .../Hisilicon/Hi1620/Drivers/Apei/Hest/Hest.h |   59 +
>  .../Hi1620/Drivers/Apei/OemApeiHi1620.h   |   43 +
>  .../Hi1620/Hi1620AcpiTables/Hi1620Platform.h  |   27 +
>  .../Hi1620/Hi1620OemConfigUiLib/OemConfig.h   |  142 ++
>  .../Hi1620/Hi1620OemConfigUiLib/OemConfigUi.h |   64 +
>  .../Hi1620/Include/Library/SerdesLib.h|   85 +
>  .../Hisilicon/

Re: [edk2] [PATCH edk2-non-osi v4 0/2] Upload D06 binary modules

2018-09-03 Thread Leif Lindholm
On Thu, Aug 23, 2018 at 11:59:33PM +0800, Ming Huang wrote:
> This patch set include:
> 1 Add D06 binary modules;
> 2 Add PLATFORM_SAS_NOTIFY API.
> 
> Change since v2:
> 1 Add PLATFORM_SAS_NOTIFY API;
> 2 Drop Oem Shell libraries;
> 
> Code can also be found in github: 
> https://github.com/hisilicon/OpenPlatformPkg.git
> branch: d06-non-osi-v4

For the series:
Reviewed-by: Leif Lindholm 
Pushed as 3ce657b0..572f1053.


> Ming Huang (2):
>   Hisilicon: Add dec and header file
>   Hisilicon/D06: Add binary modules
> 
>  Silicon/Hisilicon/HisiliconNonOsi.dec |  26 ++
>  .../Drivers/GetInfoFromBmc/GetInfoFromBmc.inf |  26 ++
>  .../D06/Drivers/IoInitDxe/IoInitDxe.inf   |  27 +++
>  .../IpmiInterfaceDxe/IpmiInterfaceDxe.inf |  28 +++
>  .../IpmiInterfacePei/IpmiInterfacePei.inf |  27 +++
>  .../Drivers/IpmiMiscOpDxe/IpmiMiscOpDxe.inf   |  27 +++
>  .../IpmiWatchdogDxe/IpmiWatchdogDxe.inf   |  27 +++
>  .../Drivers/Net/SnpHi1620NewDxe/SnpDxe.inf|  27 +++
>  .../Drivers/PcieRasInitDxe/PcieRasInitDxe.inf |  26 ++
>  .../D06/Drivers/RasInitDxe/RasInitDxe.inf |  25 ++
>  .../D06/Drivers/SFC/SfcDxeDriver.inf  |  27 +++
>  .../D06/Drivers/Sas/SasDxeDriver.inf  |  27 +++
>  .../D06/Drivers/Sm750Dxe/UefiSmi.inf  |  32 +
>  .../TransferSmbiosInfo/TransSmbiosInfo.inf|  26 ++
>  .../OemAddressMapD06/OemAddressMapD06.inf |  40 
>  .../D06/MemoryInitPei/MemoryInitPeim.inf  |  28 +++
>  .../Library/Hi1620Serdes/Hi1620SerdesLib.inf  |  43 +
>  .../Hi1620/Library/LpcLibHi1620/LpcLib.inf|  39 +++
>  .../PlatformSysCtrlLibHi1620.inf  |  45 ++
>  .../Include/Protocol/PlatformSasNotify.h  |  27 +++
>  .../GetInfoFromBmc/GetInfoFromBmc.depex   | Bin 0 -> 18 bytes
>  .../Drivers/GetInfoFromBmc/GetInfoFromBmc.efi | Bin 0 -> 20480 bytes
>  .../D06/Drivers/IoInitDxe/IoInitDxe.depex | Bin 0 -> 18 bytes
>  .../D06/Drivers/IoInitDxe/IoInitDxe.efi   | Bin 0 -> 229216 bytes
>  .../IpmiInterfaceDxe/IpmiInterfaceDxe.depex   | Bin 0 -> 18 bytes
>  .../IpmiInterfaceDxe/IpmiInterfaceDxe.efi | Bin 0 -> 29440 bytes
>  .../IpmiInterfacePei/IpmiInterfacePei.depex   | Bin 0 -> 18 bytes
>  .../IpmiInterfacePei/IpmiInterfacePei.efi | Bin 0 -> 21664 bytes
>  .../Drivers/IpmiMiscOpDxe/IpmiMiscOp.depex| Bin 0 -> 36 bytes
>  .../D06/Drivers/IpmiMiscOpDxe/IpmiMiscOp.efi  | Bin 0 -> 24736 bytes
>  .../IpmiWatchdogDxe/IpmiWatchdogDxe.depex | Bin 0 -> 36 bytes
>  .../IpmiWatchdogDxe/IpmiWatchdogDxe.efi   | Bin 0 -> 20768 bytes
>  .../Net/SnpHi1620NewDxe/SnpPV600Dxe.efi   | Bin 0 -> 75040 bytes
>  .../PcieRasInitDxe/PcieRasInitDxe.depex   | Bin 0 -> 36 bytes
>  .../Drivers/PcieRasInitDxe/PcieRasInitDxe.efi | Bin 0 -> 21248 bytes
>  .../D06/Drivers/RasInitDxe/RasInitDxe.efi | Bin 0 -> 17984 bytes
>  .../Hisilicon/D06/Drivers/SFC/SFCDriver.depex | Bin 0 -> 36 bytes
>  .../Hisilicon/D06/Drivers/SFC/SFCDriver.efi   | Bin 0 -> 262144 bytes
>  .../D06/Drivers/Sas/SasDriverDxe.depex| Bin 0 -> 216 bytes
>  .../D06/Drivers/Sas/SasDriverDxe.efi  | Bin 0 -> 221312 bytes
>  .../Drivers/Sm750Dxe/SmiGraphicsOutput.efi| Bin 0 -> 38208 bytes
>  .../TransferSmbiosInfo/TransSmbiosInfo.depex  | Bin 0 -> 36 bytes
>  .../TransferSmbiosInfo/TransSmbiosInfo.efi| Bin 0 -> 20288 bytes
>  .../OemAddressMapD06/OemAddressMapD06.lib | Bin 0 -> 61892 bytes
>  .../D06/MemoryInitPei/MemoryInit.depex| Bin 0 -> 18 bytes
>  .../D06/MemoryInitPei/MemoryInit.efi  | Bin 0 -> 297696 bytes
>  Platform/Hisilicon/D06/Sec/FVMAIN_SEC.Fv  | Bin 0 -> 1048576 bytes
>  Platform/Hisilicon/D06/bl1.bin| Bin 0 -> 12432 bytes
>  Platform/Hisilicon/D06/fip.bin| Bin 0 -> 113578 bytes
>  .../Library/Hi1620Serdes/Hi1620SerdesLib.lib  | Bin 0 -> 1319320 bytes
>  .../Hi1620/Library/LpcLibHi1620/LpcLib.lib| Bin 0 -> 15406 bytes
>  .../PlatformSysCtrlLibHi1620.lib  | Bin 0 -> 356032 bytes
>  52 files changed, 600 insertions(+)
>  create mode 100644 Silicon/Hisilicon/HisiliconNonOsi.dec
>  create mode 100644 
> Platform/Hisilicon/D06/Drivers/GetInfoFromBmc/GetInfoFromBmc.inf
>  create mode 100644 Platform/Hisilicon/D06/Drivers/IoInitDxe/IoInitDxe.inf
>  create mode 100644 
> Platform/Hisilicon/D06/Drivers/Ipmi/IpmiInterfaceDxe/IpmiInterfaceDxe.inf
>  create mode 100644 
> Platform/Hisilicon/D06/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.inf
>  create mode 100644 
> Platform/Hi

Re: [edk2] Missing ‘or’ in CLA

2018-09-03 Thread Leif Lindholm
On Fri, Aug 31, 2018 at 09:30:31PM +0200, Laszlo Ersek wrote:
> On 08/31/18 01:58, Henri Yandell wrote:
> > The CLA is missing an ‘or’ in section 3.
> > 
> > See https://github.com/tianocore/edk2/pull/133/files for an example of the
> > specific text.
> 
> could you please turn this report into a real patch (if the suggested
> change is valid)? Technically it's easy enough so I could do it as well,
> just so we have something to review on the list, but:
> - I have no idea if the suggested change is valid,
> - I wasn't around when "Contributions.txt" was originally invented.

Would this require a revision bump to 1.2?

Whether a valid correction or not, it changes the premises under which
certain organisations have confirmed they are happy to contribute.
Moreso in my eyes than the change that lead to the bump to 1.1.

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


Re: [edk2] [PATCH edk2-platforms v5 00/28] Upload for D06 platform

2018-08-31 Thread Leif Lindholm
Hi Ming,

Thanks for the quick turnaround. The difference since v4 is
substantial.

I think this is good to go - I spotted a couple of misplaced spaces
and such, bit I think I'll let them slip.
Will wait with pushing until Monday, when my head is hopefully a bit
clearer.

Have a great weekend,

Leif

On Fri, Aug 31, 2018 at 09:26:42PM +0800, Ming Huang wrote:
> The major features of this patchset include:
> 1 D06 source code;
> 2 Unify some D0x modules;
> 
> Change since v4: 
> 1  build on every commit:
>   Squash "Add PciPlatformLib" to "Add several base file for D06";
>   Reorder OemMiscLibD06 before "Add edk2-non-osi components for D06";
>   Move some mudules after "Add edk2-non-osi components for D06";
>   Move gOemConfigGuid to "Stop watchdog";
> 2 Delete needless SnpDxe;
> 3 Reorder "Unify HisiAcpiPlatformDxe";
> 4 Modify Signed-off-by and add Reviewed-by;
> 5 Modify other comments in v4;
> 
> Code can also be found in github: 
> https://github.com/hisilicon/OpenPlatformPkg.git
> branch: d06-platform-v5
> 
> 
> Heyi Guo (3):
>   Hisilicon/D06: Add Debug Serial Port Init Driver
>   Hisilicon/Hi1620: Add ACPI PPTT table
>   Platform/Hisilicon/D06: Enable ACPI PPTT
> 
> Luqi Jiang (1):
>   Hisilicon/D06: add apei driver
> 
> Ming Huang (19):
>   Hisilicon/D0x: Modify PcdBootManagerMenuFile for build
>   Silicon/Hisilicon/Acpi: Unify HisiAcpiPlatformDxe
>   Hisilicon/D06: Add several base file for D06
>   Platform/Hisilicon/D06: Add M41T83RealTimeClockLib
>   Hisilicon/D06: Add OemMiscLibD06
>   Platform/Hisilicon/D06: Add edk2-non-osi components for D06
>   Hisilicon/D06: Add some modules
>   Silicon/Hisilicon/D06: Wait for all disk ready
>   Hisilicon/D06: Add ACPI Tables for D06
>   Silicon/Hisilicon/D06: Stop watchdog
>   Platform/Hisilicon/D06: Add OemNicLib
>   Platform/Hisilicon/D06: Add OemNicConfig2P Driver
>   Platform/Hisilicon/D06: Add EarlyConfigPeim peim
>   Platform/Hisilicon/D06: Add PciHostBridgeLib
>   Platform/Hisilicon/D06: Add capsule upgrade support
>   Silicon/Hisilicon: Add I2C Bus Exception handle function
>   Silicon/Hisilicon/Setup: Support SPCR table switch
>   Silicon/Hisilicon/setup: Enable/disable SMMU
>   Platform/Hisilicon/D0x: Update version string to 18.08
> 
> Sun Yuanchen (2):
>   Silicon/Hisilicon/D0x: Move RAS macro to PlatformArch.h
>   Hisilicon/D0x: Update SMBIOS type9 info
> 
> Yang XinYi (2):
>   Hisilicon/D06: Add Hi1620OemConfigUiLib
>   Silicon/Hisilicon/Hi1620/Setup: Add Setup Item "EnableGOP"
> 
> ZhenYao (1):
>   Silicon/Hisilicon: Modify for disable slave core clock.
> 
>  Platform/Hisilicon/D06/D06.dec|   29 +
>  Silicon/Hisilicon/Hi1620/Hi1620.dec   |   23 +
>  Silicon/Hisilicon/HisiPkg.dec |1 +
>  Platform/Hisilicon/D03/D03.dsc|4 +-
>  Platform/Hisilicon/D05/D05.dsc|4 +-
>  Platform/Hisilicon/D06/D06.dsc|  489 
>  Platform/Hisilicon/D06/D06.fdf|  441 
>  .../OemMiscLib2P/OemMiscLib2PHi1610.inf   |1 +
>  .../Library/OemMiscLibD05/OemMiscLibD05.inf   |1 +
>  .../OemNicConfig2PHi1620/OemNicConfig2P.inf   |   43 +
>  .../SystemFirmwareDescriptor.inf  |   50 +
>  .../EarlyConfigPeim/EarlyConfigPeimD06.inf|   50 +
>  .../Library/OemMiscLibD06/OemMiscLibD06.inf   |   50 +
>  .../D06/Library/OemNicLib/OemNicLib.inf   |   35 +
>  .../PciHostBridgeLib/PciHostBridgeLib.inf |   36 +
>  .../HisiAcpiPlatformDxe/AcpiPlatformDxe.inf   |3 +-
>  .../Hisilicon/Hi1620/Drivers/Apei/Apei.inf|   59 +
>  .../Pl011DebugSerialPortInitDxe.inf   |   48 +
>  .../Hi1620AcpiTables/AcpiTablesHi1620.inf |   60 +
>  .../Hi1620OemConfigUiLib/OemConfigUiLib.inf   |   68 +
>  .../Hi1620PciPlatformLib.inf  |   30 +
>  Silicon/Hisilicon/Hi1620/Pptt/Pptt.inf|   48 +
>  .../M41T83RealTimeClockLib.inf|   46 +
>  .../PlatformBootManagerLib.inf|5 +
>  .../OemNicConfig2PHi1620/OemNicConfig.h   |   25 +
>  .../Hisilicon/D06/Include/Library/CpldD06.h   |   39 +
>  .../Hisilicon/Hi1610/Include/PlatformArch.h   |   15 +-
>  .../Hisilicon/Hi1616/Include/PlatformArch.h   |   12 +
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/Apei.h  |   41 +
>  .../Hisilicon/Hi1620/Drivers/Apei/Bert/Bert.h |   43 +
>  .../Hisilicon/Hi1620/Drivers/Apei/Einj/Einj.h |  146 ++
>  .../Hi1620/Drivers/Apei/ErrorSource/Ghes.h|  110 +
>  .../Hisilicon/Hi1620/Drivers/Apei/Erst/Erst.h |  140 ++
>  .../Hisilicon/Hi1620/Drivers/Apei/Hest/Hest.h |   59 +
>  .../Hi1620/Drivers/Apei/OemApeiHi1620.h   |   43 +
>  .../Hi1620/Hi1620AcpiTables/Hi1620Platform.h  |   27 +
>  .../Hi1620/Hi1620OemConfigUiLib/OemConfig.h   |  142 ++
>  .../Hi1620/Hi1620OemConfigUiLib/OemConfigUi.h |   64 +
>  .../Hi1620/Include/Library/SerdesLib.h|   85 +
>  .../Hisilicon/Hi1620/Include/PlatformArch.h   |   67 +
>  Silicon/Hisilicon/Hi1620/Pptt/Pptt.h  |   68 +
>  

Re: [edk2] [PATCH edk2-platforms v4 00/31] Upload for D06 platform

2018-08-30 Thread Leif Lindholm
Allright, we're getting close.

Please generate a v5 based on my comments for v4.
If that does not require changes to edk2-non-osi, there is no need to
generate a v5 of that.

_But_, one big overarching issue:
Every commit in the series needs to be buildable. For D03, D05 and D06.
There are many ordering issues in this version. Please ensure

Basically, before you submit v5, I want you to:
1) create a copy of the branch you intend to submit, rebased onto
   origin/master
2) build it for all of those platforms, in DEBUG and RELEASE mode
3) If that causes any build failures, fix those
   3.1) if those changes require any reordering of patches, goto 1
4) git reset --hard HEAD~1
5) if current commit is not origin/master, goto 2

I have a very hackish script called "check-bisect.sh" which I have
just added to uefi-tools. This takes care of steps 2-5 automatically,
stopping and reporting on any build failures. 1 needs to be repeated
manually.

Best Regards,

Leif

On Fri, Aug 24, 2018 at 12:07:12AM +0800, Ming Huang wrote:
> The major features of this patchset include:
> 1 D06 source code;
> 2 Unify some D0x modules;
> 
> Change since v2: (1~3 have reviewed in v3)
> 1 Modify "Wait for all disk ready" patch as communication, update SAS driver 
> binary also;
> 2 Modify OemNicLib, set Mac to 0xFF while eeprom don't contain valid Mac;
> 3 Remove .h file from Apei.inf;
> 4 Replace "Support SPCR table switch" with 
> EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe;
>   And remove EnableSpcr field from patch "Add Hi1620OemConfigUiLib";
>   And move some lines from patch "Support SPCR table switch" to patch 
> "Enable/disable SMMU";
> 5 Move I2CLib set before D06 patch;
> 6 Drop patch "Add some Lpc macro to LpcLib.h";
> 7 Drop Oem Shell commands patch;
> 8 Move PLATFORM_SAS_NOTIFY API to edk2-non-osi;
> 9 Modify Signed-off-by and add Reviewed-by;
> 10 Change include "PlatformArch.h" to ;
> 11 Modify other comments in v2/v3;
> 
> Code can also be found in github: 
> https://github.com/hisilicon/OpenPlatformPkg.git
> branch: d06-platform-v4
> 
> 
> Heyi Guo (3):
>   Hisilicon/D06: Add Debug Serial Port Init Driver
>   Hisilicon/Hi1620: Add ACPI PPTT table
>   Platform/Hisilicon/D06: Enable ACPI PPTT
> 
> Luqi Jiang (1):
>   Hisilicon/D06: add apei driver
> 
> Ming Huang (21):
>   Silicon/Hisilicon/Acpi: Move some macro to PlatformArch.h
>   Silicon/Hisilicon: Fix I2CLib enable fail issue
>   Silicon/Hisilicon: Add I2CLib delay for HNS auto config
>   Hisilicon/D06: Add several base file for D06
>   Platform/Hisilicon/D06: Add M41T83RealTimeClockLib
>   Platform/Hisilicon/D06: Add edk2-non-osi components for D06
>   Hisilicon/D06: Add OemMiscLibD06
>   Silicon/Hisilicon/D06: Wait for all disk ready
>   Silicon/Hisilicon/Acpi: Unify HisiAcpiPlatformDxe
>   Hisilicon/D06: Add ACPI Tables for D06
>   Silicon/Hisilicon/D06: Stop watchdog
>   Platform/Hisilicon/D06: Add OemNicLib
>   Platform/Hisilicon/D06: Add OemNicConfig2P Driver
>   Platform/Hisilicon/D06: Add EarlyConfigPeim peim
>   Platform/Hisilicon/D06: Add PciHostBridgeLib
>   Platform/Hisilicon/D06: Add capsule upgrade support
>   Silicon/Hisilicon: Add I2C Bus Exception handle function
>   Silicon/Hisilicon/Setup: Support SPCR table switch
>   Silicon/Hisilicon/setup: Enable/disable SMMU
>   Hisilicon/D06: Add PciPlatformLib
>   Platform/Hisilicon/D0x: Update version string to 18.08
> 
> Sun Yuanchen (2):
>   Silicon/Hisilicon/D0x: Move RAS macro to PlatformArch.h
>   Hisilicon/D0x: Update SMBIOS type9 info
> 
> Yang XinYi (2):
>   Hisilicon/D06: Add Hi1620OemConfigUiLib
>   Silicon/Hisilicon/Setup: Add Setup Item "EnableGOP"
> 
> ZhenYao (1):
>   Silicon/Hisilicon: Modify for close slave core clock.
> 
> shaochangliang (1):
>   Silicon/Hisilicon: Optimize I2CLib for HNS config CDR time
> 
>  Platform/Hisilicon/D06/D06.dec|   29 +
>  Silicon/Hisilicon/Hi1610/Hi1610.dec   |   23 +
>  Silicon/Hisilicon/Hi1616/Hi1616.dec   |   23 +
>  Silicon/Hisilicon/Hi1620/Hi1620.dec   |   23 +
>  Silicon/Hisilicon/HisiPkg.dec |1 +
>  Platform/Hisilicon/D03/D03.dsc|2 +-
>  Platform/Hisilicon/D05/D05.dsc|2 +-
>  Platform/Hisilicon/D06/D06.dsc|  489 
>  Platform/Hisilicon/D06/D06.fdf|  445 
>  .../OemMiscLib2P/OemMiscLib2PHi1610.inf   |1 +
>  .../Library/OemMiscLibD05/OemMiscLibD05.inf   |1 +
>  .../OemNicConfig2PHi1620/OemNicConfig2P.inf   |   43 +
>  .../SystemFirmwareDescriptor.inf  |   50 +
>  .../EarlyConfigPeim/EarlyConfigPeimD06.inf|   50 +
>  .../Library/OemMiscLibD06/OemMiscLibD06.inf   |   51 +
>  .../D06/Library/OemNicLib/OemNicLib.inf   |   35 +
>  .../PciHostBridgeLib/PciHostBridgeLib.inf |   36 +
>  .../HisiAcpiPlatformDxe/AcpiPlatformDxe.inf   |3 +-
>  .../Hi1610AcpiTables/AcpiTablesHi1610.inf |2 +-
>  .../Hi1616/D05AcpiTables/AcpiTablesHi1616.inf |2 +-
>  

Re: [edk2] [PATCH edk2-platforms v4 07/31] Platform/Hisilicon/D06: Add M41T83RealTimeClockLib

2018-08-30 Thread Leif Lindholm
On Fri, Aug 24, 2018 at 12:07:19AM +0800, Ming Huang wrote:
> Add M41T83RealTimeClockLib for RTC.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 

Reviewed-by: Leif Lindholm 


> ---
>  Platform/Hisilicon/D06/D06.dsc  
> |   1 +
>  Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf 
> |  46 ++
>  Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClock.h  
> | 158 ++
>  Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.c   
> | 559 
>  4 files changed, 764 insertions(+)
> 
> diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc
> index d14fce1159..27358f8c78 100644
> --- a/Platform/Hisilicon/D06/D06.dsc
> +++ b/Platform/Hisilicon/D06/D06.dsc
> @@ -65,6 +65,7 @@
>CpldIoLib|Silicon/Hisilicon/Library/CpldIoLib/CpldIoLib.inf
>  
>TimeBaseLib|EmbeddedPkg/Library/TimeBaseLib/TimeBaseLib.inf
> +  
> RealTimeClockLib|Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf
>  
>CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
>
> GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
> diff --git 
> a/Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf 
> b/Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf
> new file mode 100644
> index 00..e0bf6b3f24
> --- /dev/null
> +++ 
> b/Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf
> @@ -0,0 +1,46 @@
> +#/** @file
> +#
> +#  Copyright (c) 2018, Hisilicon Limited. All rights reserved.
> +#  Copyright (c) 2018, Linaro Limited. 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= 0x0001001A
> +  BASE_NAME  = M41T83RealTimeClockLib
> +  FILE_GUID  = 470DFB96-E205-4515-A75E-2E60F853E79D
> +  MODULE_TYPE= BASE
> +  VERSION_STRING = 1.0
> +  LIBRARY_CLASS  = RealTimeClockLib
> +
> +[Sources.common]
> +  M41T83RealTimeClockLib.c
> +
> +[Packages]
> +  EmbeddedPkg/EmbeddedPkg.dec
> +  MdePkg/MdePkg.dec
> +  Platform/Hisilicon/D06/D06.dec
> +  Silicon/Hisilicon/HisiPkg.dec
> +
> +[LibraryClasses]
> +  BaseMemoryLib
> +  CpldIoLib
> +  DebugLib
> +  I2CLib
> +  IoLib
> +  PcdLib
> +  TimeBaseLib
> +  TimerLib
> +  UefiLib
> +  UefiRuntimeLib# Use EFiAtRuntime to check stage
> +
> +[Depex]
> +  gEfiCpuArchProtocolGuid
> diff --git 
> a/Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClock.h 
> b/Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClock.h
> new file mode 100644
> index 00..d985055d9b
> --- /dev/null
> +++ b/Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClock.h
> @@ -0,0 +1,158 @@
> +/** @file
> +
> +  Copyright (c) 2018, Hisilicon Limited. All rights reserved.
> +  Copyright (c) 2018, Linaro Limited. 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.
> +
> +**/
> +
> +#ifndef __M41T83_REAL_TIME_CLOCK_H__
> +#define __M41T83_REAL_TIME_CLOCK_H__
> +
> +// The delay is need for cpld and I2C. This is a empirical value. 
> MemoryFence is no need.
> +#define RTC_DELAY_30_MS3
> +// The delay is need for cpld and I2C. This is a empirical value. 
> MemoryFence is no need.
> +#define RTC_DELAY_1000_MACROSECOND 1000
> +// The delay is need for cpld and I2C. This is a empirical value. 
> MemoryFence is no need.
> +#define RTC_DELAY_2_MACROSECOND2
> +
> +#define M41T83_REGADDR_DOTSECONDS   0x00
> +#define M41T83_REGADDR_SECONDS 

Re: [edk2] [PATCH edk2-platforms v4 08/31] Platform/Hisilicon/D06: Add edk2-non-osi components for D06

2018-08-30 Thread Leif Lindholm
On Fri, Aug 24, 2018 at 12:07:20AM +0800, Ming Huang wrote:
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 

Reviewed-by: Leif Lindholm 

> ---
>  Platform/Hisilicon/D06/D06.dsc |  7 +++
>  Platform/Hisilicon/D06/D06.fdf | 17 +
>  2 files changed, 24 insertions(+)
> 
> diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc
> index 27358f8c78..94454569f6 100644
> --- a/Platform/Hisilicon/D06/D06.dsc
> +++ b/Platform/Hisilicon/D06/D06.dsc
> @@ -41,6 +41,8 @@
>  
>I2CLib|Silicon/Hisilicon/Library/I2CLib/I2CLib.inf
>TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
> +  IpmiCmdLib|Silicon/Hisilicon/Library/IpmiCmdLib/IpmiCmdLib.inf
> +
>NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
>DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf
>HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
> @@ -64,8 +66,12 @@
>  
>CpldIoLib|Silicon/Hisilicon/Library/CpldIoLib/CpldIoLib.inf
>  
> +  SerdesLib|Silicon/Hisilicon/Hi1620/Library/Hi1620Serdes/Hi1620SerdesLib.inf
> +
>TimeBaseLib|EmbeddedPkg/Library/TimeBaseLib/TimeBaseLib.inf
>
> RealTimeClockLib|Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf
> +  
> OemAddressMapLib|Platform/Hisilicon/D06/Library/OemAddressMapD06/OemAddressMapD06.inf
> +  
> PlatformSysCtrlLib|Silicon/Hisilicon/Hi1620/Library/PlatformSysCtrlLibHi1620/PlatformSysCtrlLibHi1620.inf
>  
>CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
>
> GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
> @@ -81,6 +87,7 @@
># USB Requirements
>UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
>  
> +  LpcLib|Silicon/Hisilicon/Hi1620/Library/LpcLibHi1620/LpcLib.inf
>
> SerialPortLib|ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf
>  !if $(SECURE_BOOT_ENABLE) == TRUE
>FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
> diff --git a/Platform/Hisilicon/D06/D06.fdf b/Platform/Hisilicon/D06/D06.fdf
> index 9567ede0ad..07fe096f61 100644
> --- a/Platform/Hisilicon/D06/D06.fdf
> +++ b/Platform/Hisilicon/D06/D06.fdf
> @@ -56,6 +56,7 @@ NumBlocks = 0x40
>  
>  0x|0x0010
>  gArmTokenSpaceGuid.PcdSecureFvBaseAddress|gArmTokenSpaceGuid.PcdSecureFvSize
> +FILE = Platform/Hisilicon/D06/Sec/FVMAIN_SEC.Fv
>  
>  0x0010|0x0028
>  gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize
> @@ -163,6 +164,7 @@ READ_LOCK_STATUS   = TRUE
>INF MdeModulePkg/Core/Dxe/DxeMain.inf
>INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
>  
> +  INF Platform/Hisilicon/D06/Drivers/IoInitDxe/IoInitDxe.inf
>#
># PI DXE Drivers producing Architectural Protocols (EFI Services)
>#
> @@ -170,6 +172,7 @@ READ_LOCK_STATUS   = TRUE
>INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
>  
>INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
> +  INF Platform/Hisilicon/D06/Drivers/SFC/SfcDxeDriver.inf
>  
>  
>INF Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf
> @@ -225,10 +228,15 @@ READ_LOCK_STATUS   = TRUE
>INF MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf
>INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
>  
> +  INF 
> Platform/Hisilicon/D06/Drivers/Ipmi/IpmiInterfaceDxe/IpmiInterfaceDxe.inf
> +  INF Platform/Hisilicon/D06/Drivers/GetInfoFromBmc/GetInfoFromBmc.inf
>INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
>INF Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/SmbiosMiscDxe.inf
>INF Silicon/Hisilicon/Drivers/Smbios/AddSmbiosType9/AddSmbiosType9.inf
> +  INF Platform/Hisilicon/D06/Drivers/TransferSmbiosInfo/TransSmbiosInfo.inf
> +  INF Platform/Hisilicon/D06/Drivers/IpmiMiscOpDxe/IpmiMiscOpDxe.inf
>  
> +  INF Platform/Hisilicon/D06/Drivers/IpmiWatchdogDxe/IpmiWatchdogDxe.inf
>  
>  
>INF 
> Silicon/Hisilicon/Drivers/Smbios/MemorySubClassDxe/MemorySubClassDxe.inf
> @@ -246,6 +254,7 @@ READ_LOCK_STATUS   = TRUE
>#
>#Network
>#
> +  INF Platform/Hisilicon/D06/Drivers/Net/SnpHi1620NewDxe/SnpDxe.inf
>  
>INF MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf
>INF MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
> @@ -282,8 +291,14 @@ READ_LOCK_STATUS   = TRUE
>INF ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf
>INF MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
>INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
> +  INF Platform/Hisilicon/D06/Drivers/PcieRasInitDxe/PcieRasInitDxe.inf
> +  INF Platform/Hisilicon/D06/Drivers/RasInitDxe/RasInitDxe.inf
>  
> +  # VGA Driver
> +  #
> +  INF Platform/Hisilicon/D06

Re: [edk2] [PATCH edk2-platforms v4 14/31] Hisilicon/D06: Add Hi1620OemConfigUiLib

2018-08-30 Thread Leif Lindholm
On Fri, Aug 24, 2018 at 12:07:26AM +0800, Ming Huang wrote:
> From: Yang XinYi 
> 
> This library is added for oem setup menu item.
> Setup item include:
> 1 DDR option item;
> 2 BMC option item;
> 3 Ras option item;
> 4 Misc option item;
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 

Reviewed-by: Leif Lindholm 

> ---
>  Silicon/Hisilicon/HisiPkg.dec   |   
> 1 +
>  Platform/Hisilicon/D06/D06.dsc  |   
> 5 +-
>  Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf   |   
> 2 +-
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUiLib.inf|  
> 68 
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.h   | 
> 142 
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUi.h |  
> 64 
>  Silicon/Hisilicon/Include/Library/OemConfigData.h   |  
> 83 +
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigVfr.vfr  |  
> 89 +
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.c   | 
> 362 
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MemoryConfig.hfr  | 
> 154 +
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MemoryConfig.uni  | 
> 103 ++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.hfr|  
> 34 ++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.uni|  
> 27 ++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUiLib.uni|  
> 24 ++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUiLibStrings.uni |  
> 42 +++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/PcieConfig.hfr| 
> 219 
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/PcieConfigStrings.uni | 
> 111 ++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/PciePortConfig.hfr| 
> 167 +
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/RasConfig.hfr | 
> 172 ++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/RasConfig.uni |  
> 85 +
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/iBMCConfig.hfr|  
> 81 +
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/iBMCConfig.uni|  
> 34 ++
>  22 files changed, 2067 insertions(+), 2 deletions(-)
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v4 29/31] Silicon/Hisilicon/setup: Enable/disable SMMU

2018-08-30 Thread Leif Lindholm
On Fri, Aug 24, 2018 at 12:07:41AM +0800, Ming Huang wrote:
> Select without SMMU iort while SMMU item is disable,
> Select with SMMU iort while SMMU item is enable.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 

Reviewed-by: Leif Lindholm 

> ---
>  Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf |  1 +
>  Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c   | 89 
> 
>  2 files changed, 90 insertions(+)
> 
> diff --git 
> a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf 
> b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
> index 281a4f2ebd..3d133aff85 100644
> --- a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
> +++ b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
> @@ -51,6 +51,7 @@
>  
>  [Guids]
>gHisiEfiMemoryMapGuid
> +  gOemConfigGuid
>  
>  [Pcd]
>gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiTableStorageFile## CONSUMES
> diff --git a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c 
> b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c
> index 54f49977c3..c2c8f687b0 100644
> --- a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c
> +++ b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c
> @@ -16,12 +16,98 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
> +#include 
>  #include 
>  
>  #define CORECOUNT(X) ((X) * CORE_NUM_PER_SOCKET)
>  
> +#define FIELD_IORT_NODE_OFFSET 40
> +
> +typedef enum {
> +  NodeTypeIts = 0,
> +  NodeTypeNameComponent,
> +  NodeTypePciRC,
> +  NodeTypeSmmuV1,
> +  NodeTypeSmmuV3,
> +  NodeTypePMCG
> +} IORT_NODE_TYPE;
> +
> +#pragma pack(1)
> +typedef struct {
> +  UINT8   Type;
> +  UINT16  Length;
> +  UINT8   Revision;
> +  UINT32  Reserved;
> +  UINT32  IdMapNumber;
> +  UINT32  IdArrayOffset;
> +} IORT_NODE_HEAD;
> +#pragma pack()
> +
> +BOOLEAN
> +IsIortWithSmmu (
> +  IN EFI_ACPI_DESCRIPTION_HEADER  *TableHeader
> +  )
> +{
> +  UINT32   *NodeOffset;
> +  UINT32   NextOffset;
> +  IORT_NODE_HEAD   *Node;
> +
> +  NodeOffset = (UINT32 *)((UINT8 *)TableHeader + FIELD_IORT_NODE_OFFSET);
> +  NextOffset = *NodeOffset;
> +
> +  while (NextOffset < TableHeader->Length) {
> +Node = (IORT_NODE_HEAD *)((UINT8 *)TableHeader + NextOffset);
> +NextOffset += Node->Length;
> +
> +if ((Node->Type == NodeTypeSmmuV1) || (Node->Type == NodeTypeSmmuV3)) {
> +  return TRUE;
> +}
> +  }
> +
> +  return FALSE;
> +}
> +
> +EFI_STATUS
> +SelectIort (
> +  IN EFI_ACPI_DESCRIPTION_HEADER  *TableHeader
> +  )
> +{
> +  EFI_STATUS  Status;
> +  UINTN   Size;
> +  OEM_CONFIG_DATA Configuration;
> +
> +  Configuration.EnableSmmu = 0;
> +  Size = sizeof (OEM_CONFIG_DATA);
> +  Status = gRT->GetVariable (
> +  OEM_CONFIG_NAME,
> +  ,
> +  NULL,
> +  ,
> +  
> +  );
> +  if (EFI_ERROR (Status)) {
> +DEBUG ((DEBUG_ERROR, "Get OemConfig variable (%r).\n", Status));
> +  }
> +
> +  Status =  EFI_SUCCESS;
> +  if (IsIortWithSmmu (TableHeader)) {
> +if (!Configuration.EnableSmmu) {
> +  Status = EFI_ABORTED;
> +}
> +  } else {
> +if (Configuration.EnableSmmu) {
> +  Status = EFI_ABORTED;
> +}
> +  }
> +  DEBUG ((DEBUG_INFO, "SmmuEnable=%x, return %r for Iort table.\n",
> +  Configuration.EnableSmmu, Status));
> +
> +  return Status;
> +}
> +
>  STATIC
>  VOID
>  RemoveUnusedMemoryNode (
> @@ -130,6 +216,9 @@ UpdateAcpiTable (
>case EFI_ACPI_6_0_SYSTEM_LOCALITY_INFORMATION_TABLE_SIGNATURE:
>  Status = UpdateSlit (TableHeader);
>  break;
> +  case EFI_ACPI_6_2_IO_REMAPPING_TABLE_SIGNATURE:
> +Status = SelectIort (TableHeader);
> +break;
>}
>return Status;
>  }
> -- 
> 2.18.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v4 28/31] Silicon/Hisilicon/Setup: Support SPCR table switch

2018-08-30 Thread Leif Lindholm
On Fri, Aug 24, 2018 at 12:07:40AM +0800, Ming Huang wrote:
> If install SPCR table, KVM will not output while install or boot
> some OS, like ubuntu, so add SPCR switch setup item and set it
> disable by default.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 

Reviewed-by: Leif Lindholm 

> ---
>  Platform/Hisilicon/D06/D06.dsc | 1 +
>  Platform/Hisilicon/D06/D06.fdf | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc
> index fad6fcc747..e6bebfb78b 100644
> --- a/Platform/Hisilicon/D06/D06.dsc
> +++ b/Platform/Hisilicon/D06/D06.dsc
> @@ -325,6 +325,7 @@
>MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
>MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
>MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
> +  EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.inf
>  
>MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
>  
> diff --git a/Platform/Hisilicon/D06/D06.fdf b/Platform/Hisilicon/D06/D06.fdf
> index 8c3f4f9932..6580a5971a 100644
> --- a/Platform/Hisilicon/D06/D06.fdf
> +++ b/Platform/Hisilicon/D06/D06.fdf
> @@ -200,6 +200,7 @@ READ_LOCK_STATUS   = TRUE
>INF 
> MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
>INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
>INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
> +  INF EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.inf
>  
>INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
>INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf
> -- 
> 2.18.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v4 27/31] Silicon/Hisilicon: Add I2C Bus Exception handle function

2018-08-30 Thread Leif Lindholm
On Fri, Aug 24, 2018 at 12:07:39AM +0800, Ming Huang wrote:
> During the period of I2c accessing, if the board is reset
> unexpectedly, and because the I2c client can not reset,
> the SDA will be always pull down, then it cause I2C bus
> Exception.
> 
> Follow the Hi1620 I2C FS chapter 1.8.2 design, add I2C
> Bus Exception handle function. It will Config SCL and SDA
> to GPIO, and set the reversal frequency of SCL to 10KHz.
> 
> The implementation of functions is in edk2-non-osi.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 

Reviewed-by: Leif Lindholm 

> ---
>  Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h 
> b/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h
> index 3ccfc6bee3..a232e52ed7 100644
> --- a/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h
> +++ b/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h
> @@ -106,4 +106,7 @@ VOID DisableClusterClock(UINTN CpuClusterBase);
>  VOID EnableClusterClock(UINTN CpuClusterBase);
>  VOID DisableSocketClock (UINT8 Skt);
>  
> +EFI_STATUS EFIAPI HandleI2CException (UINT32 Socket, UINT32 Port);
> +EFI_STATUS EFIAPI HandleI2CExceptionBySocket (UINT32 Socket);
> +
>  #endif
> -- 
> 2.18.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v4 26/31] Silicon/Hisilicon: Modify for close slave core clock.

2018-08-30 Thread Leif Lindholm
Please update also subject and description to use "disable" and
"enable" instead of "close" and "open".

On Fri, Aug 24, 2018 at 12:07:38AM +0800, Ming Huang wrote:
> From: ZhenYao 
> 
> When BIOS booting, the power consumption is too high, so need close
> some clusters clock that don't work to reduce power consumption.
> 
> The implementation of functions is in edk2-non-osi.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> ---
>  Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h 
> b/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h
> index ec2b9a36e7..3ccfc6bee3 100644
> --- a/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h
> +++ b/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h
> @@ -102,5 +102,8 @@ VOID PlatformEventBroadcastConfig(VOID);
>  UINTN GetDjtagRegBase(UINT32 NodeId);
>  VOID LlcCleanInvalidateAsm(VOID);
>  VOID PlatformMdioInit(VOID);
> +VOID DisableClusterClock(UINTN CpuClusterBase);
> +VOID EnableClusterClock(UINTN CpuClusterBase);
> +VOID DisableSocketClock (UINT8 Skt);
>  
>  #endif
> -- 
> 2.18.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v4 25/31] Platform/Hisilicon/D06: Add capsule upgrade support

2018-08-30 Thread Leif Lindholm
On Fri, Aug 24, 2018 at 12:07:37AM +0800, Ming Huang wrote:
> This module support updating the boot CPU firmware only.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> Reviewed-by: Leif Lindholm 

Ard also gave you a Reviewed-by for this patch, please add that in v5.

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


Re: [edk2] [PATCH edk2-platforms v4 24/31] Hisilicon/D06: add apei driver

2018-08-30 Thread Leif Lindholm
On Fri, Aug 24, 2018 at 12:07:36AM +0800, Ming Huang wrote:
> From: Luqi Jiang 
> 
> This driver provide a means for the platform to
> convey error information to OSPM.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 

As far as I can see, this addresses all of my feedback:
Reviewed-by: Leif Lindholm 

> ---
>  Platform/Hisilicon/D06/D06.dsc   |   1 +
>  Platform/Hisilicon/D06/D06.fdf   |   1 +
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/Apei.inf   |  59 +++
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/Apei.h |  41 +++
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/Bert/Bert.h|  43 +++
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/Einj/Einj.h| 146 
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/ErrorSource/Ghes.h | 110 ++
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/Erst/Erst.h| 140 
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/Hest/Hest.h|  59 +++
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/OemApeiHi1620.h|  43 +++
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/Apei.c | 108 ++
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/Bert/Bert.c|  91 +
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/Einj/Einj.c| 349 
> ++
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/ErrorSource/Ghes.c | 330 
> +
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/Erst/Erst.c| 374 
> 
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/Hest/Hest.c| 118 ++
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/OemApeiHi1620.c| 337 
> ++
>  17 files changed, 2350 insertions(+)
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v4 19/31] Platform/Hisilicon/D06: Add OemNicLib

2018-08-30 Thread Leif Lindholm
 0
> +#define SOCKET_1 1
> +#define EEPROM_I2C_PORT  4
> +#define EEPROM_PAGE_SIZE 0x40
> +#define MAC_ADDR_LEN 6
> +#define I2C_OFFSET_EEPROM_ETH0   (0xc00)
> +#define I2C_SLAVEADDR_EEPROM (0x52)
> +
> +#pragma pack(1)
> +typedef struct {
> +  UINT16 Crc16;
> +  UINT16 MacLen;
> +  UINT8  Mac[MAC_ADDR_LEN];
> +} NIC_MAC_ADDRESS;
> +#pragma pack()
> +
> +ETH_PRODUCT_DESC gEthPdtDesc[ETH_MAX_PORT] =
> +{
> +{TRUE,   ETH_SPEED_10KM,  ETH_FULL_DUPLEX, ETH_INVALID, ETH_INVALID},
> +{TRUE,   ETH_SPEED_10KM,  ETH_FULL_DUPLEX, ETH_INVALID, ETH_INVALID},
> +{FALSE,  ETH_INVALID, ETH_INVALID, ETH_INVALID, ETH_INVALID},
> +{FALSE,  ETH_INVALID, ETH_INVALID, ETH_INVALID, ETH_INVALID},
> +{TRUE,   ETH_SPEED_1000M, ETH_FULL_DUPLEX, ETH_PHY_MVL88E1512_ID, 0},
> +{TRUE,   ETH_SPEED_1000M, ETH_FULL_DUPLEX, ETH_PHY_MVL88E1512_ID, 1},
> +{FALSE,  ETH_INVALID, ETH_INVALID, ETH_INVALID, ETH_INVALID},
> +{FALSE,  ETH_INVALID, ETH_INVALID, ETH_INVALID, ETH_INVALID}
> +};
> +
> +UINT16 CrcTable16[256] = {
> +  0x, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
> +  0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
> +  0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,
> +  0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE,
> +  0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485,
> +  0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D,
> +  0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4,
> +  0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC,
> +  0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823,
> +  0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B,
> +  0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12,
> +  0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A,
> +  0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41,
> +  0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49,
> +  0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70,
> +  0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78,
> +  0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F,
> +  0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067,
> +  0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E,
> +  0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256,
> +  0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D,
> +  0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
> +  0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C,
> +  0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634,
> +  0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB,
> +  0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3,
> +  0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A,
> +  0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92,
> +  0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9,
> +  0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1,
> +  0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8,
> +  0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0,
> +};
> +
> +EFI_STATUS
> +GetSfpSpeed (
> +  UINT16 Socket,
> +  UINT16 SfpNum,
> +  UINT8* FiberSpeed
> +  )
> +{
> +  EFI_STATUS  Status;
> +  I2C_DEVICE  SpdDev;
> +  UINT8   SfpSelect;
> +  UINT8   SfpSpeed;
> +  UINT32  RegAddr;
> +  UINT16  I2cAddr;
> +  UINT32  SfpPort;
> +
> +  SfpSpeed = 0x0;
> +  if (Socket == SOCKET_1) {
> +I2cAddr = CPU2_9545_I2C_ADDR;
> +SfpPort = CPU2_I2C_PORT_SFP;
> +  } else {
> +I2cAddr = CPU1_9545_I2C_ADDR;
> +SfpPort = I2C_PORT_SFP;
> +  }
> +
> +  Status = I2CInit (Socket, SfpPort, Normal);
> +  if (EFI_ERROR (Status))
> +  {

That '{' goes on the preceding line.
With that,
Reviewed-by: Leif Lindholm 

/
Leif

> +  DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Socket%d Call I2CInit failed! 
> p1=0x%x.\n",
> + __FUNCTION__, __LINE__, Socket, Status));
> +  return Status;
> +  }
> +
> +  SpdDev.Socket = Socket;
> +  SpdDev.DeviceType = DEVICE_TYPE_SPD;
> +  SpdDev.Port = SfpPort;
> +  SpdDev.SlaveDeviceAddress = I2cAddr;
> +  RegAddr = 0x0;
> +  SfpSelect = SELECT_SFP_BY_INDEX (SfpNum);
> +
> +  Status = I2CWrite (, RegAddr, 1, );
> +  if (EFI_ERROR (Status)) {
> +  DEBUG ((DEBUG_ERROR, "I2CWrite Error =%r.\n", Status));
> +  return Status;
> +  }
> +
> +  SpdDev.Socket = Socket;
> +  SpdDev.DeviceType = DEVICE_TYPE_SPD;
>

Re: [edk2] [PATCH edk2-platforms v4 16/31] Silicon/Hisilicon/Setup: Add Setup Item "EnableGOP"

2018-08-30 Thread Leif Lindholm
Can you add Hi1620 to the subject line, so it's clear that this is a
D06-specific library?

With that
Reviewed-by: Leif Lindholm 

/
Leif

On Fri, Aug 24, 2018 at 12:07:28AM +0800, Ming Huang wrote:
> From: Yang XinYi 
> 
> Add Setup Item "EnableGOP" for D06, This Item only takes
> effect on SM750. The SM750 is a VGA device under BMC and
> the KVM output to SM750.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> ---
>  Silicon/Hisilicon/Include/Library/OemConfigData.h| 1 +
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.c| 1 +
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.hfr | 7 +++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.uni | 4 ++--
>  4 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/Silicon/Hisilicon/Include/Library/OemConfigData.h 
> b/Silicon/Hisilicon/Include/Library/OemConfigData.h
> index 8ab402144c..f120e3123c 100644
> --- a/Silicon/Hisilicon/Include/Library/OemConfigData.h
> +++ b/Silicon/Hisilicon/Include/Library/OemConfigData.h
> @@ -60,6 +60,7 @@ typedef struct {
>/*Misc Config*/
>UINT8 EnableSmmu;
>UINT8 EnableFdtTable;
> +  UINT8 EnableGOP;
>/*RAS Config*/
>UINT8 EnRasSupport;
>UINT8 EnPoison;
> diff --git a/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.c 
> b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.c
> index f49fb3533b..012d45bc02 100644
> --- a/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.c
> +++ b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.c
> @@ -294,6 +294,7 @@ OemConfigUiLibConstructor (
>//
>Configuration.EnableSmmu = 1;
>Configuration.EnableFdtTable = 0;
> +  Configuration.EnableGOP = 0;
>//
>//Set the default value of the Ras option
>//
> diff --git a/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.hfr 
> b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.hfr
> index 819c2b988d..16ce27b95b 100644
> --- a/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.hfr
> +++ b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.hfr
> @@ -31,4 +31,11 @@ form formid = MISC_CONFIG_FORM_ID,
>option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = 0;
>  endoneof;
>  
> +oneof varid   = OEM_CONFIG_DATA.EnableGOP,
> +  prompt  = STRING_TOKEN(STR_ENABLE_GOP_FRAME_BUFFER),
> +  help= STRING_TOKEN(STR_ENABLE_GOP_FRAME_BUFFER_HELP),
> +  option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = DEFAULT;
> +  option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = 0;
> +endoneof;
> +
>  endform;
> diff --git a/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.uni 
> b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.uni
> index 53eb1622c4..2fd92fedff 100644
> --- a/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.uni
> +++ b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.uni
> @@ -23,5 +23,5 @@
>  #string STR_FDT_CONFIG_HELP#language en-US  "Enable or Disable 
> Fdt Table."
>  #string STR_ENABLE_SPCR_TABLE  #language en-US  "Support SPCR"
>  #string STR_ENABLE_SPCR_HELP   #language en-US  "Enable or Disable 
> SPCR Table."
> -#string STR_ENABLE_GOP_FRAME_BUFFER#language en-US  "Support GOP FB"
> -#string STR_ENABLE_GOP_FRAME_BUFFER_HELP #language en-US  "Enable or 
> Disable GOP frame buffer."
> +#string STR_ENABLE_GOP_FRAME_BUFFER#language en-US  "Support GOP FB for 
> SM750"
> +#string STR_ENABLE_GOP_FRAME_BUFFER_HELP #language en-US  "Enable or 
> Disable GOP frame buffer for SM750."
> -- 
> 2.18.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v4 11/31] Silicon/Hisilicon/Acpi: Unify HisiAcpiPlatformDxe

2018-08-30 Thread Leif Lindholm
On Fri, Aug 24, 2018 at 12:07:23AM +0800, Ming Huang wrote:
> The EFI_ACPI_STATIC_RESOURCE_AFFINITY_TABLE struct is used by
> UpdateAcpiTable.c and Srat aslc. The struct may be different
> according to chips, so move some macro to PlatformArch.h.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> Reviewed-by: Leif Lindholm 

Right, so I missed one bit on this last time around.
Could you leave changes to
Silicon/Hisilicon/Hi1620/Include/PlatformArch.h out here and just add
that in the initial d06 patch?

Then, could you move this patch immediately after "Move RAS macro to
PlatformArch"?

/
Leif

> ---
>  Silicon/Hisilicon/Hi1610/Include/PlatformArch.h |  6 
>  Silicon/Hisilicon/Hi1620/Include/PlatformArch.h |  6 
>  Silicon/Hisilicon/Include/Library/AcpiNextLib.h | 31 
> ++--
>  Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c |  2 --
>  4 files changed, 34 insertions(+), 11 deletions(-)
> 
> diff --git a/Silicon/Hisilicon/Hi1610/Include/PlatformArch.h 
> b/Silicon/Hisilicon/Hi1610/Include/PlatformArch.h
> index f39ae0748c..1ebddca4e5 100644
> --- a/Silicon/Hisilicon/Hi1610/Include/PlatformArch.h
> +++ b/Silicon/Hisilicon/Hi1610/Include/PlatformArch.h
> @@ -30,6 +30,12 @@
>  // Max NUMA node number for each node type
>  #define MAX_NUM_PER_TYPE 8
>  
> +// for acpi
> +#define NODE_IN_SOCKET  2
> +#define CORE_NUM_PER_SOCKET 32
> +#define EFI_ACPI_MEMORY_AFFINITY_STRUCTURE_COUNT10
> +#define EFI_ACPI_6_2_ITS_AFFINITY_STRUCTURE_COUNT   8
> +
>  #define S1_BASE   0x400
>  
>  #define RASC_BASE(0x5000)
> diff --git a/Silicon/Hisilicon/Hi1620/Include/PlatformArch.h 
> b/Silicon/Hisilicon/Hi1620/Include/PlatformArch.h
> index 9539cfdada..f3ad45f6c6 100644
> --- a/Silicon/Hisilicon/Hi1620/Include/PlatformArch.h
> +++ b/Silicon/Hisilicon/Hi1620/Include/PlatformArch.h
> @@ -57,5 +57,11 @@
>EFI_ACPI_ARM_CREATOR_REVISION   /* UINT32  CreatorRevision */ \
>}
>  
> +// for acpi
> +#define NODE_IN_SOCKET  2
> +#define CORE_NUM_PER_SOCKET 48
> +#define EFI_ACPI_MEMORY_AFFINITY_STRUCTURE_COUNT16
> +#define EFI_ACPI_6_2_ITS_AFFINITY_STRUCTURE_COUNT   1
> +
>  #endif
>  
> diff --git a/Silicon/Hisilicon/Include/Library/AcpiNextLib.h 
> b/Silicon/Hisilicon/Include/Library/AcpiNextLib.h
> index fd05a3b960..2abffb65fc 100644
> --- a/Silicon/Hisilicon/Include/Library/AcpiNextLib.h
> +++ b/Silicon/Hisilicon/Include/Library/AcpiNextLib.h
> @@ -19,6 +19,21 @@
>  #ifndef __ACPI_NEXT_LIB_H__
>  #define __ACPI_NEXT_LIB_H__
>  
> +#include 
> +
> +///
> +/// ITS Affinity Structure Definition
> +///
> +#pragma pack(1)
> +typedef struct {
> +  UINT8   Type;
> +  UINT8   Length;
> +  UINT32  ProximityDomain;
> +  UINT16  Reserved;
> +  UINT32  ItsHwId;
> +} EFI_ACPI_6_2_ITS_AFFINITY_STRUCTURE;
> +#pragma pack()
> +
>  #define EFI_ACPI_6_1_GIC_ITS_INIT(GicITSHwId, GicITSBase) \
>{ \
>  EFI_ACPI_6_1_GIC_ITS, sizeof (EFI_ACPI_6_1_GIC_ITS_STRUCTURE), 
> EFI_ACPI_RESERVED_WORD, \
> @@ -42,8 +57,8 @@
>  #define EFI_ACPI_6_2_ITS_AFFINITY_STRUCTURE_INIT(
>\
>  ProximityDomain, ItsId)  
>\
>{  
>\
> -4, sizeof (EFI_ACPI_6_2_GIC_ITS_AFFINITY_STRUCTURE), ProximityDomain,
>\
> -{EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE}, ItsId  
>  \
> +4, sizeof (EFI_ACPI_6_2_ITS_AFFINITY_STRUCTURE), ProximityDomain,
>\
> +EFI_ACPI_RESERVED_WORD, ItsId
>\
>}
>  
>  #define EFI_ACPI_6_1_MEMORY_AFFINITY_STRUCTURE_INIT( 
>  \
> @@ -75,15 +90,13 @@
>  // Define the number of each table type.
>  // This is where the table layout is modified.
>  //
> -#define EFI_ACPI_PROCESSOR_LOCAL_GICC_AFFINITY_STRUCTURE_COUNT  64
> -#define EFI_ACPI_MEMORY_AFFINITY_STRUCTURE_COUNT10
> -#define EFI_ACPI_6_2_ITS_AFFINITY_STRUCTURE_COUNT   8
> +#define EFI_ACPI_PROCESSOR_LOCAL_GICC_AFFINITY_STRUCTURE_COUNT  
> (MAX_SOCKET*CORE_NUM_PER_SOCKET)
>  
>  typedef struct {
> -  EFI_ACPI_6_0_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER

Re: [edk2] [PATCH edk2-platforms v4 01/31] Silicon/Hisilicon/Acpi: Move some macro to PlatformArch.h

2018-08-30 Thread Leif Lindholm
On Fri, Aug 24, 2018 at 12:07:13AM +0800, Ming Huang wrote:
> ARM_ACPI_HEADER is used by a unify module in HwPkg,
> so move some macro to PlatformArch.h for unify D0x.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 

Reviewed-by: Leif Lindholm 
1,3-5/31 pushed as:
342330470f..1d331a2eaa

/
Leif

> ---
>  Silicon/Hisilicon/Hi1610/Hi1610.dec| 23 
> +
>  Silicon/Hisilicon/Hi1616/Hi1616.dec| 23 
> +
>  Silicon/Hisilicon/Hi1610/Hi1610AcpiTables/AcpiTablesHi1610.inf |  2 +-
>  Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf|  2 +-
>  Silicon/Hisilicon/Hi1610/Hi1610AcpiTables/Hi1610Platform.h | 27 
> +++-
>  Silicon/Hisilicon/Hi1610/Include/PlatformArch.h| 24 
> +
>  Silicon/Hisilicon/Hi1616/D05AcpiTables/Hi1616Platform.h| 24 
> +
>  Silicon/Hisilicon/Hi1616/Include/PlatformArch.h| 23 
> +
>  8 files changed, 99 insertions(+), 49 deletions(-)
> 
> diff --git a/Silicon/Hisilicon/Hi1610/Hi1610.dec 
> b/Silicon/Hisilicon/Hi1610/Hi1610.dec
> new file mode 100644
> index 00..6ea4867662
> --- /dev/null
> +++ b/Silicon/Hisilicon/Hi1610/Hi1610.dec
> @@ -0,0 +1,23 @@
> +#/** @file
> +#
> +#Copyright (c) 2018, Hisilicon Limited. All rights reserved.
> +#Copyright (c) 2018, Linaro Limited. 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]
> +  DEC_SPECIFICATION  = 0x0001001A
> +  PACKAGE_NAME   = Hi1610Pkg
> +  PACKAGE_GUID   = 0063d37d-adab-47b4-9926-af83539ea167
> +  PACKAGE_VERSION= 0.1
> +
> +[Includes]
> +  Include
> diff --git a/Silicon/Hisilicon/Hi1616/Hi1616.dec 
> b/Silicon/Hisilicon/Hi1616/Hi1616.dec
> new file mode 100644
> index 00..7dad0ab91a
> --- /dev/null
> +++ b/Silicon/Hisilicon/Hi1616/Hi1616.dec
> @@ -0,0 +1,23 @@
> +#/** @file
> +#
> +#Copyright (c) 2018, Hisilicon Limited. All rights reserved.
> +#Copyright (c) 2018, Linaro Limited. 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]
> +  DEC_SPECIFICATION  = 0x0001001A
> +  PACKAGE_NAME   = Hi1616Pkg
> +  PACKAGE_GUID   = 8a64c436-bcd6-4850-9de3-f9c922bb815a
> +  PACKAGE_VERSION= 0.1
> +
> +[Includes]
> +  Include
> diff --git a/Silicon/Hisilicon/Hi1610/Hi1610AcpiTables/AcpiTablesHi1610.inf 
> b/Silicon/Hisilicon/Hi1610/Hi1610AcpiTables/AcpiTablesHi1610.inf
> index 9577d96b23..caef3da460 100644
> --- a/Silicon/Hisilicon/Hi1610/Hi1610AcpiTables/AcpiTablesHi1610.inf
> +++ b/Silicon/Hisilicon/Hi1610/Hi1610AcpiTables/AcpiTablesHi1610.inf
> @@ -40,7 +40,7 @@
>EmbeddedPkg/EmbeddedPkg.dec
>MdePkg/MdePkg.dec
>MdeModulePkg/MdeModulePkg.dec
> -
> +  Silicon/Hisilicon/Hi1610/Hi1610.dec
>Silicon/Hisilicon/HisiPkg.dec
>  
>  [FixedPcd]
> diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf 
> b/Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
> index bb279c8e42..d313936b89 100644
> --- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
> +++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
> @@ -43,7 +43,7 @@
>EmbeddedPkg/EmbeddedPkg.dec
>MdePkg/MdePkg.dec
>MdeModulePkg/MdeModulePkg.dec
> -
> +  Silicon/Hisilicon/Hi1616/Hi1616.dec
>Silicon/Hisilicon/HisiPkg.dec
>  
>  [FixedPcd]
> diff --git a/Silicon/Hisilicon/Hi1610/Hi1610AcpiTables/Hi1610Platform.h 
> b/Silicon/Hisilicon/Hi1610/Hi1610AcpiTables/Hi1610Platform.h
> index 5a95b02055..4b1e4d3aad 100644
> --- a/Silicon/Hisilico

Re: [edk2] [PATCH edk2-platforms v4 02/31] Silicon/Hisilicon/D0x: Move RAS macro to PlatformArch.h

2018-08-30 Thread Leif Lindholm
On Fri, Aug 24, 2018 at 12:07:14AM +0800, Ming Huang wrote:
> From: Sun Yuanchen 
> 
> Move some RAS macros definition to PlatformArch.h for
> unifying D0x
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Sun Yuanchen 

This still has incorrect sign-off in v4. Please address.

/
Leif

> Reviewed-by: Leif Lindholm 
> ---
>  Silicon/Hisilicon/Hi1610/Include/PlatformArch.h |  9 +++--
>  Silicon/Hisilicon/Hi1616/Include/PlatformArch.h | 12 
>  2 files changed, 19 insertions(+), 2 deletions(-)
> 
> diff --git a/Silicon/Hisilicon/Hi1610/Include/PlatformArch.h 
> b/Silicon/Hisilicon/Hi1610/Include/PlatformArch.h
> index 2ff076901e..f39ae0748c 100644
> --- a/Silicon/Hisilicon/Hi1610/Include/PlatformArch.h
> +++ b/Silicon/Hisilicon/Hi1610/Include/PlatformArch.h
> @@ -1,7 +1,7 @@
>  /** @file
>  *
> -*  Copyright (c) 2015, Hisilicon Limited. All rights reserved.
> -*  Copyright (c) 2015, Linaro Limited. All rights reserved.
> +*  Copyright (c) 2015 - 2018, Hisilicon Limited. All rights reserved.
> +*  Copyright (c) 2015 - 2018, Linaro Limited. All rights reserved.
>  *
>  *  This program and the accompanying materials
>  *  are licensed and made available under the terms and conditions of the BSD 
> License
> @@ -32,6 +32,11 @@
>  
>  #define S1_BASE   0x400
>  
> +#define RASC_BASE(0x5000)
> +/* configuration register for Rank statistical information */
> +#define RASC_CFG_INFOIDX_REG (RASC_BASE + 0x5C)
> +/* configuration register for Sparing level */
> +#define RASC_CFG_SPLVL_REG   (RASC_BASE + 0xB8)
>  
>  //
>  // ACPI table information used to initialize tables.
> diff --git a/Silicon/Hisilicon/Hi1616/Include/PlatformArch.h 
> b/Silicon/Hisilicon/Hi1616/Include/PlatformArch.h
> index 60a60593be..e02e4bdabd 100644
> --- a/Silicon/Hisilicon/Hi1616/Include/PlatformArch.h
> +++ b/Silicon/Hisilicon/Hi1616/Include/PlatformArch.h
> @@ -30,6 +30,18 @@
>  // Max NUMA node number for each node type
>  #define MAX_NUM_PER_TYPE 8
>  
> +#define RASC_BASE(0x5000)
> +/* configuration register for Rank statistical information */
> +#define RASC_CFG_INFOIDX_REG (RASC_BASE + 0x5C)
> +/* configuration register for Sparing level */
> +#define RASC_CFG_SPLVL_REG   (RASC_BASE + 0xB8)
> +
> +// for acpi
> +#define NODE_IN_SOCKET  2
> +#define CORE_NUM_PER_SOCKET 32
> +#define EFI_ACPI_MEMORY_AFFINITY_STRUCTURE_COUNT10
> +#define EFI_ACPI_6_2_ITS_AFFINITY_STRUCTURE_COUNT   8
> +
>  #define S1_BASE   0x400
>  
>  //
> -- 
> 2.18.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v4 06/31] Hisilicon/D06: Add several base file for D06

2018-08-30 Thread Leif Lindholm
On Fri, Aug 24, 2018 at 12:07:18AM +0800, Ming Huang wrote:
> Add several base head files and add several build
> files for D06.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> Reviewed-by: Leif Lindholm 
> ---
>  Platform/Hisilicon/D06/D06.dec   |  29 ++
>  Silicon/Hisilicon/Hi1620/Hi1620.dec  |  23 +
>  Platform/Hisilicon/D06/D06.dsc   | 455 
> 
>  Platform/Hisilicon/D06/D06.fdf   | 351 +++
>  Platform/Hisilicon/D06/Include/Library/CpldD06.h |  37 ++
>  Silicon/Hisilicon/Hi1620/Include/Library/SerdesLib.h |  85 
>  Silicon/Hisilicon/Hi1620/Include/PlatformArch.h  |  61 +++
>  Silicon/Hisilicon/Include/Library/OemAddressMapLib.h |   6 +
>  Silicon/Hisilicon/Include/Library/OemNicLib.h|  57 +++
>  9 files changed, 1104 insertions(+)
> 

> diff --git a/Platform/Hisilicon/D06/D06.fdf b/Platform/Hisilicon/D06/D06.fdf
> new file mode 100644
> index 00..9567ede0ad
> --- /dev/null
> +++ b/Platform/Hisilicon/D06/D06.fdf
> @@ -0,0 +1,351 @@

> +
> +#
> +# FV Section
> +#
> +# [FV] section is used to define what components or modules are placed 
> within a flash
> +# device file.  This section also defines order the components and modules 
> are positioned
> +# within the image.  The [FV] section consists of define statements, set 
> statements and
> +# module statements.
> +#
> +
> +
> +[FV.FvMain]
> +BlockSize  = 0x40
> +NumBlocks  = 0 # This FV gets compressed so make it just big 
> enough
> +FvAlignment= 16# FV alignment and FV attributes setting.
> +ERASE_POLARITY = 1
> +MEMORY_MAPPED  = TRUE
> +STICKY_WRITE   = TRUE
> +LOCK_CAP   = TRUE
> +LOCK_STATUS= TRUE
> +WRITE_DISABLED_CAP = TRUE
> +WRITE_ENABLED_CAP  = TRUE
> +WRITE_STATUS   = TRUE
> +WRITE_LOCK_CAP = TRUE
> +WRITE_LOCK_STATUS  = TRUE
> +READ_DISABLED_CAP  = TRUE
> +READ_ENABLED_CAP   = TRUE
> +READ_STATUS= TRUE
> +READ_LOCK_CAP  = TRUE
> +READ_LOCK_STATUS   = TRUE
> +
> +  APRIORI DXE {
> +INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
> +  }
> +
> +  INF MdeModulePkg/Core/Dxe/DxeMain.inf
> +  INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
> +
> +  #
> +  # PI DXE Drivers producing Architectural Protocols (EFI Services)
> +  #
> +  INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf
> +  INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
> +
> +  INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
> +
> +
> +  INF Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf
> +  INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
> +  INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> +
> +  INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> +  INF 
> MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
> +
> +!if $(SECURE_BOOT_ENABLE) == TRUE
> +  INF 
> SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
> +!endif
> +
> +  INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
> +  INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
> +  INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
> +
> +  INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
> +
> +  #
> +  # Multiple Console IO support
> +  #
> +  INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
> +  INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
> +  INF 
> MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
> +  INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> +  INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
> +
> +  INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
> +  INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf
> +
> +  INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
> +
> +  #
> +  # FAT filesystem + GPT/MBR partitioning
> +  #
> +  INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
> +  INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
> +  INF FatPkg/EnhancedFatDxe/Fat.inf
> +  INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
> +  INF 
> IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCodeRuntimeDxe.inf
> +
> +  #
> +  # Usb Support
> +  #
> +
> +
> +  INF MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf
> +
>

Re: [edk2] [PATCH edk2-platforms v4 10/31] Silicon/Hisilicon/D06: Wait for all disk ready

2018-08-30 Thread Leif Lindholm
On 23 August 2018 at 17:07, Ming Huang  wrote:
>
> This patch is relative to D06 SasDxe driver. The SasDxe set a
> variable to notice this libray. Here Wait for all disk ready
> for 15S at most.
>
> D06:
> For using straight-through hard disk backboard, some disk need
> 15 seconds to ready. Actually, wait less 15 seconds here(minus
> the time from end of SAS driver to here).
> For using expander backboard, wait less 6 seconds here(minus
> the time from end of SAS driver to here).
>
> D03/D05:
> As Sas driver don't install PLATFORM_SAS_NOTIFY Protocol, D03/D05
> will skip waiting here.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> ---
>
 Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
|  4 +++
>  Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c
| 37 
>  2 files changed, 41 insertions(+)
>
> diff --git
a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> index 7a53befc44..415f8ee36e 100644
> ---
a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> +++
b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> @@ -36,6 +36,7 @@
>  [Packages]
>MdeModulePkg/MdeModulePkg.dec
>MdePkg/MdePkg.dec
> +  Silicon/Hisilicon/HisiliconNonOsi.dec
>Silicon/Hisilicon/HisiPkg.dec
>
>  [LibraryClasses]
> @@ -49,6 +50,7 @@
>MemoryAllocationLib
>PcdLib
>PrintLib
> +  TimerLib
>UefiBootManagerLib
>UefiBootServicesTableLib
>UefiLib
> @@ -67,8 +69,10 @@
>  [Guids]
>gEfiEndOfDxeEventGroupGuid
>gEfiTtyTermGuid
> +  gOemConfigGuid

This patch still adds a dependency on this guid, but it is not introduced
until 14/31, so it breaks the build at 10,11,12,13/31.
Also, it is not required for this patch. So introduce it only with the code
that first uses it.

/
Leif

>
>  [Protocols]
>gEfiGenericMemTestProtocolGuid
>gEfiLoadedImageProtocolGuid
>gEsrtManagementProtocolGuid
> +  gPlatformSasNotifyProtocolGuid
> diff --git
a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c
b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c
> index aa6db929ca..77295d0111 100644
> --- a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c
> +++ b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c
> @@ -20,6 +20,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -29,6 +30,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>
> @@ -554,6 +556,40 @@ PlatformBootManagerBeforeConsole (
>PlatformRegisterOptionsAndKeys ();
>  }
>
> +STATIC
> +VOID
> +WaitForDiskReady (
> +  VOID
> +  )
> +{
> +  EFI_STATUSStatus;
> +  UINT32Index;
> +  PLATFORM_SAS_NOTIFY   *SasNotify;
> +
> +  Status = gBS->LocateProtocol (
> +  ,
> +  NULL,
> +  (VOID **));
> +  if (EFI_ERROR (Status)) {
> +DEBUG ((DEBUG_INFO, "Locate SasPlatformNotify:%r\n", Status));
> +return;
> +  }
> +
> +  // Wait for 30 seconds at most.
> +  for (Index = 0; Index < 30; Index++) {
> +Status = gBS->CheckEvent (SasNotify->WaitDiskEvent);
> +if (!EFI_ERROR (Status)) {
> +  DEBUG ((DEBUG_INFO, "WaitDiskEvent is signaled.\n"));
> +  EfiBootManagerConnectAll ();
> +  break;
> +}
> +DEBUG ((DEBUG_ERROR, "%a", Index == 0 ? "Wait for disk." : "."));
> +MicroSecondDelay (1000 * 1000);
> +  }
> +
> +  return;
> +}
> +
>  /**
>Do the platform specific action after the console is ready
>Possible things that can be done in PlatformBootManagerAfterConsole:
> @@ -583,6 +619,7 @@ PlatformBootManagerAfterConsole (
>// Connect the rest of the devices.
>//
>EfiBootManagerConnectAll ();
> +  WaitForDiskReady ();
>
>//
>// Enumerate all possible boot options.
> --
> 2.18.0
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v4 30/31] Hisilicon/D06: Add PciPlatformLib

2018-08-30 Thread Leif Lindholm
On Fri, Aug 24, 2018 at 12:07:42AM +0800, Ming Huang wrote:
> Add a Null PciPlatformLib for build D06. The switch generic
> PciHostBridge patch set add two api for PciPlatform driver,
> so need to implement the two api for D06.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> Reviewed-by: Leif Lindholm 

This library is required to build
Silicon/Hisilicon/Drivers/PciPlatform/PciPlatform.inf, which exists in
D06.dsc from the original revision in:
Hisilicon/D06: Add several base file for D06

This breaks the build on every commit between these two points.
If you are OK with the idea, I can just squash them together.

There is nothing interesting done in this code anyway - it's just glue.

Regards,

Leif

> ---
>  Platform/Hisilicon/D06/D06.dsc   
>   |  1 +
>  
> Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.inf
>  | 30 +
>  Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.c 
>   | 67 
>  3 files changed, 98 insertions(+)
> 
> diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc
> index e6bebfb78b..e828010abf 100644
> --- a/Platform/Hisilicon/D06/D06.dsc
> +++ b/Platform/Hisilicon/D06/D06.dsc
> @@ -95,6 +95,7 @@
>FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
>  !endif
>PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf
> +  
> PciPlatformLib|Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.inf
>  
>  [LibraryClasses.common.SEC]
>
> ArmPlatformLib|Silicon/Hisilicon/Library/ArmPlatformLibHisilicon/ArmPlatformLibSec.inf
> diff --git 
> a/Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.inf
>  
> b/Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.inf
> new file mode 100644
> index 00..7648322522
> --- /dev/null
> +++ 
> b/Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.inf
> @@ -0,0 +1,30 @@
> +## @file
> +# PCI Segment Library for Hisilicon Hi1610/Hi1616 SoC with multiple RCs
> +#
> +# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
> +# Copyright (c) 2017 - 2018, Linaro Ltd. All rights reserved.
> +# Copyright (c) 2018, Hisilicon Ltd. 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= 0x0001001A
> +  BASE_NAME  = Hi1620PciPlatformLib
> +  FILE_GUID  = 29ba30da-68bc-46a5-888f-c65dabb67fd8
> +  MODULE_TYPE= BASE
> +  VERSION_STRING = 1.0
> +  LIBRARY_CLASS  = PciPlatformLib
> +
> +[Sources]
> +  Hi1620PciPlatformLib.c
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> diff --git 
> a/Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.c
>  
> b/Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.c
> new file mode 100644
> index 00..ff77974c0f
> --- /dev/null
> +++ 
> b/Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.c
> @@ -0,0 +1,67 @@
> +/** @file
> +*
> +*  Copyright (c) 2018, Hisilicon Limited. All rights reserved.
> +*  Copyright (c) 2018, Linaro Limited. 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.
> +*
> +**/
> +
> +#include 
> +#include 
> +
> +
> +/*++
> +
> +Routine Description:
> +
> +  Perform Platform initialization first in PciPlatform.
> +
> +Arguments:
> +
> +Returns:
> +
> + VOID.
> +
> +--*/
> +VOID
> +EFIAPI
> +PciInitPlatform (
> +  VOID
> +  )
> +{
> +  return;
> +}
> +
> +/*++
> +
> +Routine Description:
> +
> +  P

Re: [edk2] [PATCH edk2-platforms] sgi575/acpi: Use ACPI 6.2 specification

2018-08-30 Thread Leif Lindholm
On Wed, Aug 29, 2018 at 04:14:16PM +0530, Chandni Cherukuri wrote:
> Switched from using ACPI 6.1 to 6.2 specification for
> SGI575 since SBBR 1.1 requires ACPI 6.2 tables or later.

Just to clarify - this has no impact at all on the actual generated
tables, right?

We really should have a better way of dealing with this.
(But we don't, at the moment.)

/
Leif

> Contributed-under: TianoCore Contribution Agreement 1.1
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Signed-off-by: Chandni Cherukuri 
> ---
>  Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dbg2.aslc |  8 ++--
>  Platform/ARM/SgiPkg/AcpiTables/Sgi575/Gtdt.aslc | 48 ++--
>  Platform/ARM/SgiPkg/AcpiTables/Sgi575/Mcfg.aslc |  4 +-
>  Platform/ARM/SgiPkg/AcpiTables/Sgi575/Spcr.aslc |  6 +--
>  4 files changed, 33 insertions(+), 33 deletions(-)
> 
> diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dbg2.aslc 
> b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dbg2.aslc
> index ed671f3..0183685 100644
> --- a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dbg2.aslc
> +++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dbg2.aslc
> @@ -15,7 +15,7 @@
>  
>  #include "SgiAcpiHeader.h"
>  #include 
> -#include 
> +#include 
>  #include 
>  
>  #define SGI_DBG2_NUM_DEBUG_PORTS   1
> @@ -29,7 +29,7 @@
>  
>  typedef struct {
>EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT Dbg2Device;
> -  EFI_ACPI_6_1_GENERIC_ADDRESS_STRUCTUREBaseAddressRegister;
> +  EFI_ACPI_6_2_GENERIC_ADDRESS_STRUCTUREBaseAddressRegister;
>UINT32AddressSize;
>UINT8 
> NameSpaceString[SGI_DBG2_NS_STR_LENGTH];
>  } DBG2_DEBUG_DEVICE_INFORMATION;
> @@ -56,7 +56,7 @@ typedef struct {
>  OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, BaseAddressRegister), /* 
> UINT16BaseAddressRegister Offset */  \
>  OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, AddressSize)  /* 
> UINT16AddressSize Offset */  \
>}, 
>\
> -  ARM_GAS32 (UartBase),/* 
> EFI_ACPI_6_1_GENERIC_ADDRESS_STRUCTURE BaseAddressRegister */ \
> +  ARM_GAS32 (UartBase),/* 
> EFI_ACPI_6_2_GENERIC_ADDRESS_STRUCTURE BaseAddressRegister */ \
>UartAddrLen, /* UINT32  AddressSize */ 
>\
>UartNameStr  /* UINT8   
> NameSpaceString[MAX_DBG2_NAME_LEN] */ \
>  }
> @@ -64,7 +64,7 @@ typedef struct {
>  STATIC DBG2_TABLE Dbg2 = {
>{
>  ARM_ACPI_HEADER (
> -  EFI_ACPI_6_1_DEBUG_PORT_2_TABLE_SIGNATURE,
> +  EFI_ACPI_6_2_DEBUG_PORT_2_TABLE_SIGNATURE,
>DBG2_TABLE,
>EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT_REVISION
>  ),
> diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Gtdt.aslc 
> b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Gtdt.aslc
> index 46d811e..39e3f02 100644
> --- a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Gtdt.aslc
> +++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Gtdt.aslc
> @@ -16,7 +16,7 @@
>  #include "SgiAcpiHeader.h"
>  #include 
>  #include 
> -#include 
> +#include 
>  
>  #define SGI_PLATFORM_WATCHDOG_COUNT   2
>  #define SGI_PLATFORM_TIMER_COUNT  (SGI_PLATFORM_WATCHDOG_COUNT + 1)
> @@ -24,7 +24,7 @@
>  
>  #define SYSTEM_TIMER_BASE_ADDRESS 0x
>  #define GTDT_GLOBAL_FLAGS 0
> -#define GTDT_GTIMER_FLAGS 
> EFI_ACPI_6_1_GTDT_TIMER_FLAG_TIMER_INTERRUPT_POLARITY
> +#define GTDT_GTIMER_FLAGS 
> EFI_ACPI_6_2_GTDT_TIMER_FLAG_TIMER_INTERRUPT_POLARITY
>  
>  #define SGI_GT_BLOCK_CTL_BASE 0x2A81
>  #define SGI_GT_BLOCK_FRAME1_CTL_BASE  0x2A82
> @@ -36,18 +36,18 @@
>  #define SGI_GT_BLOCK_FRAME0_GSIV  0x5C
>  
>  #define SGI_GTX_TIMER_FLAGS   0
> -#define GTX_TIMER_SECURE  
> EFI_ACPI_6_1_GTDT_GT_BLOCK_COMMON_FLAG_SECURE_TIMER
> +#define GTX_TIMER_SECURE  
> EFI_ACPI_6_2_GTDT_GT_BLOCK_COMMON_FLAG_SECURE_TIMER
>  #define GTX_TIMER_NON_SECURE  0
> -#define GTX_TIMER_SAVE_CONTEXT
> EFI_ACPI_6_1_GTDT_GT_BLOCK_COMMON_FLAG_ALWAYS_ON_CAPABILITY
> +#define GTX_TIMER_SAVE_CONTEXT
> EFI_ACPI_6_2_GTDT_GT_BLOCK_COMMON_FLAG_ALWAYS_ON_CAPABILITY
>  #define SGI_GTX_COMMON_FLAGS_S(GTX_TIMER_SAVE_CONTEXT | 
> GTX_TIMER_SECURE)
>  #define SGI_GTX_COMMON_

Re: [edk2] [PATCH edk2-platforms v3 32/36] Silicon/Hisilicon/Setup: Support SPCR table switch

2018-08-23 Thread Leif Lindholm
I don't see how it would be less risky to include new code rather than
using the existing and well-tested solution for the same problem.

On Thu, 23 Aug 2018, 11:51 Ming,  wrote:

> Hi Leif,
>
> Is it ok replace with ConsolePrefDxe after ERP 18.08?
>
>
> On 8/22/2018 10:49 AM, Ming wrote:
> >
> >
> > On 8/22/2018 5:11 AM, Leif Lindholm wrote:
> >> On Thu, Aug 16, 2018 at 08:12:35PM +0800, Ming Huang wrote:
> >>> If install SPCR table, KVM will not output while install or boot
> >>> some OS, like ubuntu, so add SPCR switch setup item and set it
> >>> disable by default.
> >>
> >> This one was supposed to be replaced with
> >> EmbeddedPkg/Drivers/ConsolePrefDxe, right?
> >
> > Yes, I will take a look ConsolePrefDxe and replace with it after ERP
> 18.08.
> >
> >>
> >> /
> >> Leif
> >>
> >>> Contributed-under: TianoCore Contribution Agreement 1.1
> >>> Signed-off-by: Ming Huang 
> >>> Signed-off-by: Heyi Guo 
> >>> ---
> >>>  Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf |
> 1 +
> >>>  Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c   |
> 24 
> >>>  2 files changed, 25 insertions(+)
> >>>
> >>> diff --git
> a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
> b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
> >>> index 281a4f2ebd..3d133aff85 100644
> >>> --- a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
> >>> +++ b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
> >>> @@ -51,6 +51,7 @@
> >>>
> >>>  [Guids]
> >>>gHisiEfiMemoryMapGuid
> >>> +  gOemConfigGuid
> >>>
> >>>  [Pcd]
> >>>gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiTableStorageFile##
> CONSUMES
> >>> diff --git
> a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c
> b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c
> >>> index 54f49977c3..32878ca4f9 100644
> >>> --- a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c
> >>> +++ b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c
> >>> @@ -16,8 +16,10 @@
> >>>  #include 
> >>>  #include 
> >>>  #include 
> >>> +#include 
> >>>  #include 
> >>>  #include 
> >>> +#include 
> >>>  #include 
> >>>
> >>>  #define CORECOUNT(X) ((X) * CORE_NUM_PER_SOCKET)
> >>> @@ -114,6 +116,25 @@ UpdateSlit (
> >>>return  EFI_SUCCESS;
> >>>  }
> >>>
> >>> +STATIC
> >>> +EFI_STATUS
> >>> +IsNeedSpcr (
> >>> +  IN OUT EFI_ACPI_DESCRIPTION_HEADER  *Table
> >>> +  )
> >>> +{
> >>> +  EFI_STATUS Status;
> >>> +  OEM_CONFIG_DATASetupData;
> >>> +  UINTN  DataSize = sizeof (OEM_CONFIG_DATA);
> >>> +
> >>> +  Status = gRT->GetVariable (OEM_CONFIG_NAME, , NULL,
> , );
> >>> +  if (!EFI_ERROR (Status) && (SetupData.EnableSpcr == FALSE)) {
> >>> +return EFI_ABORTED;
> >>> +  }
> >>> +
> >>> +  return EFI_SUCCESS;
> >>> +}
> >>> +
> >>> +
> >>>  EFI_STATUS
> >>>  UpdateAcpiTable (
> >>>IN OUT EFI_ACPI_DESCRIPTION_HEADER  *TableHeader
> >>> @@ -130,6 +151,9 @@ UpdateAcpiTable (
> >>>case EFI_ACPI_6_0_SYSTEM_LOCALITY_INFORMATION_TABLE_SIGNATURE:
> >>>  Status = UpdateSlit (TableHeader);
> >>>  break;
> >>> +  case EFI_ACPI_6_2_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE:
> >>> +Status = IsNeedSpcr (TableHeader);
> >>> +break;
> >>>}
> >>>return Status;
> >>>  }
> >>> --
> >>> 2.17.0
> >>>
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v2 39/43] Silicon/Hisilicon/Setup: Support SPCR table switch

2018-08-23 Thread Leif Lindholm
On Thu, Aug 23, 2018 at 05:54:48PM +0800, Ming wrote:
> Hi Leif,
> 
> How about this patch?

https://lists.01.org/pipermail/edk2-devel/2018-August/028823.html

/
Leif

> On 8/14/2018 4:08 PM, Ming Huang wrote:
> > If install SPCR table, KVM will not output while install or boot
> > some OS, like ubuntu, so add SPCR switch setup item and set it
> > disable by default.
> > 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Ming Huang 
> > Signed-off-by: Heyi Guo 
> > ---
> >  Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf |  1 +
> >  Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c   | 24 
> > 
> >  2 files changed, 25 insertions(+)
> > 
> > diff --git 
> > a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf 
> > b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
> > index 281a4f2ebd..3d133aff85 100644
> > --- a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
> > +++ b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
> > @@ -51,6 +51,7 @@
> >  
> >  [Guids]
> >gHisiEfiMemoryMapGuid
> > +  gOemConfigGuid
> >  
> >  [Pcd]
> >gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiTableStorageFile## CONSUMES
> > diff --git 
> > a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c 
> > b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c
> > index 54f49977c3..32878ca4f9 100644
> > --- a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c
> > +++ b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c
> > @@ -16,8 +16,10 @@
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> >  #include 
> >  #include 
> > +#include 
> >  #include 
> >  
> >  #define CORECOUNT(X) ((X) * CORE_NUM_PER_SOCKET)
> > @@ -114,6 +116,25 @@ UpdateSlit (
> >return  EFI_SUCCESS;
> >  }
> >  
> > +STATIC
> > +EFI_STATUS
> > +IsNeedSpcr (
> > +  IN OUT EFI_ACPI_DESCRIPTION_HEADER  *Table
> > +  )
> > +{
> > +  EFI_STATUS Status;
> > +  OEM_CONFIG_DATASetupData;
> > +  UINTN  DataSize = sizeof (OEM_CONFIG_DATA);
> > +
> > +  Status = gRT->GetVariable (OEM_CONFIG_NAME, , NULL, 
> > , );
> > +  if (!EFI_ERROR (Status) && (SetupData.EnableSpcr == FALSE)) {
> > +return EFI_ABORTED;
> > +  }
> > +
> > +  return EFI_SUCCESS;
> > +}
> > +
> > +
> >  EFI_STATUS
> >  UpdateAcpiTable (
> >IN OUT EFI_ACPI_DESCRIPTION_HEADER  *TableHeader
> > @@ -130,6 +151,9 @@ UpdateAcpiTable (
> >case EFI_ACPI_6_0_SYSTEM_LOCALITY_INFORMATION_TABLE_SIGNATURE:
> >  Status = UpdateSlit (TableHeader);
> >  break;
> > +  case EFI_ACPI_6_2_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE:
> > +Status = IsNeedSpcr (TableHeader);
> > +break;
> >}
> >return Status;
> >  }
> > 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v2 35/43] Silicon/Hisilicon/D06: Add some Lpc macro to LpcLib.h

2018-08-23 Thread Leif Lindholm
On Thu, Aug 23, 2018 at 03:39:57PM +0800, Ming wrote:
> 
> 
> On 8/22/2018 11:33 PM, Leif Lindholm wrote:
> > On Tue, Aug 14, 2018 at 04:08:55PM +0800, Ming Huang wrote:
> >> Add some Lpc macro to LpcLib.h for D06.
> >>
> > 
> > Unaddressed feedback from v1:
> > 
> > I have no issue with this patch, but can you explain when these macros
> > are intended to be used? And if in this set, move this patch
> > immediately before the patch than needs it?
> 
> These macros are not used in edk2-platforms, used in HwPkg/LpcLib.

Then why are they not in HwPkg?

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


Re: [edk2] [PATCH edk2-platforms v2 34/43] Hisilicon/D06: add apei driver

2018-08-23 Thread Leif Lindholm
On Thu, Aug 23, 2018 at 03:35:04PM +0800, Ming wrote:
> >> +BOOLEAN
> >> +BertAddGenericErrorData (
> >> +  IN EFI_ACPI_6_0_BOOT_ERROR_RECORD_TABLE_HEADER *Bert,
> >> +  IN EFI_CPER_SECTION_TYPE   TypeOfErrorData,
> >> +  IN VOID*GenericErrorData,
> >> +  IN UINT32  SizeOfGenericErrorData,
> >> +  IN ERROR_SEVERITY  ErrorSeverity,
> >> +  IN BOOLEAN Correctable
> >> +)
> >> +{
> >> +  DEBUG ((DEBUG_ERROR, "[%a]:[%dL]: \n", __FUNCTION__, __LINE__));
> > 
> > Isn't this adding error data for somewhere else?
> > If so, shouldn't that be giving an error message?
> > This one amounts to "I'm logging that there was an error somewhere".
> 
> I want to drop this DEBUG line. Is that ok?

Yes please.

> > This does not look like an error - should it really be of the ERROR
> > debug level? Better to move it to INFO.
> > The same applies to similar functions for the other tables.
> 
> Yes, it should be INFO and I will modify similar issues in this patch.

Thanks.

> >> +  DEBUG ((DEBUG_ERROR, "[%a]:[%dL]: \n", __FUNCTION__, __LINE__));
> > 
> > Why this message?
> 
> I think this DEBUG is useless.
> I will drop it in v4.

Yes please.

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


Re: [edk2] [PATCH v1 1/1] ArmPkg: Add support for GICv4

2018-08-22 Thread Leif Lindholm
Hi Sami,

On Tue, Aug 21, 2018 at 11:14:43AM +0100, Sami Mujawar wrote:
> Updated Redistributor base calculation to allow for the fact that
> GICv4 has 2 additional 64KB frames (for VLPI and a reserved frame).
> The code now tests the VLPIS bit in the GICR_TYPER register

Can you expand the name for this register (GIC Redistributor Type
Register)?

> and calculates the Redistributor granularity accordingly.
> 
> The code changes are:
>   GICR_TYPER register fields, etc, added to the header.
>   Loop updated to pay attention to GICR_TYPER.Last.
>   Derive frame "stride" size from GICR_TYPER.VLPIS.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Sami Mujawar 
> ---
> The changes can be seen at:
> https://github.com/samimujawar/edk2/tree/329_gicv4_granularity_v1
> 
> Notes:
> v1:
>  - Added support for initializing GICv4 [SAMI]
> 
>  ArmPkg/Drivers/ArmGic/ArmGicLib.c  | 37 
>  ArmPkg/Include/Library/ArmGicLib.h | 19 --

Can you add a sort order file in your working tree (git config
diff.orderFile) with the contents in Laszlo's unkempt guide?

>  2 files changed, 39 insertions(+), 17 deletions(-)
> 
> diff --git a/ArmPkg/Drivers/ArmGic/ArmGicLib.c 
> b/ArmPkg/Drivers/ArmGic/ArmGicLib.c
> index 
> 0087399fb1dba0e697f7a6ccd6f7432a59311ac6..033d98b75c1fc0414e7b70be1ca53d5c91cb6f3c
>  100644
> --- a/ArmPkg/Drivers/ArmGic/ArmGicLib.c
> +++ b/ArmPkg/Drivers/ArmGic/ArmGicLib.c
> @@ -1,6 +1,6 @@
>  /** @file
>  *
> -*  Copyright (c) 2011-2017, ARM Limited. All rights reserved.
> +*  Copyright (c) 2011-2018, ARM Limited. All rights reserved.
>  *
>  *  This program and the accompanying materials
>  *  are licensed and made available under the terms and conditions of the BSD 
> License
> @@ -19,6 +19,16 @@
>  #include 
>  #include 
>  
> +// In GICv3, there are 2 x 64KB frames:
> +// Redistributor control frame + SGI Control & Generation frame
> +#define GIC_V3_REDISTRIBUTOR_GRANULARITY  (ARM_GICR_CTLR_FRAME_SIZE  
>  \
> +   + ARM_GICR_SGI_PPI_FRAME_SIZE)
> +
> +// In GICv4, there are 2 additional 64KB frames:
> +// VLPI frame + Reserved page frame
> +#define GIC_V4_REDISTRIBUTOR_GRANULARITY  (GIC_V3_REDISTRIBUTOR_GRANULARITY  
>  \
> +   + ARM_GICR_SGI_VLPI_FRAME_SIZE
>  \
> +   + 
> ARM_GICR_SGI_RESERVED_FRAME_SIZE)
>  
>  #define ISENABLER_ADDRESS(base,offset) ((base) + \
>ARM_GICR_CTLR_FRAME_SIZE +  ARM_GICR_ISENABLER + (4 * offset))
> @@ -54,12 +64,11 @@ GicGetCpuRedistributorBase (
>IN ARM_GIC_ARCH_REVISION Revision
>)
>  {
> -  UINTN Index;
>UINTN MpId;
>UINTN CpuAffinity;
>UINTN Affinity;
> -  UINTN GicRedistributorGranularity;
>UINTN GicCpuRedistributorBase;
> +  UINT64 GicRTyper;

I know this is the official name of the register, but this is a local
variable in a function specific to the redistributor, so could you
change it to be just TypeRegister?

>  
>MpId = ArmReadMpidr ();
>// Define CPU affinity as:
> @@ -68,27 +77,27 @@ GicGetCpuRedistributorBase (
>CpuAffinity = (MpId & (ARM_CORE_AFF0 | ARM_CORE_AFF1 | ARM_CORE_AFF2)) |
>  ((MpId & ARM_CORE_AFF3) >> 8);
>  
> -  if (Revision == ARM_GIC_ARCH_REVISION_3) {
> -// 2 x 64KB frame:
> -//   Redistributor control frame + SGI Control & Generation frame
> -GicRedistributorGranularity = ARM_GICR_CTLR_FRAME_SIZE
> -  + ARM_GICR_SGI_PPI_FRAME_SIZE;
> -  } else {
> +  if (Revision < ARM_GIC_ARCH_REVISION_3) {
>  ASSERT_EFI_ERROR (EFI_UNSUPPORTED);
>  return 0;
>}
>  
>GicCpuRedistributorBase = GicRedistributorBase;
>  
> -  for (Index = 0; Index < PcdGet32 (PcdCoreCount); Index++) {
> -Affinity = MmioRead64 (GicCpuRedistributorBase + ARM_GICR_TYPER) >> 32;
> +  do {
> +GicRTyper = MmioRead64 (GicCpuRedistributorBase + ARM_GICR_TYPER);
> +Affinity = GicRTyper >> 32;

Could you add a macro for that >> 32? ARM_GICR_TYPER_AFFINITY(...) ?
Hah, no, that's already used for the other way :)
_GET_AFFINITY?

>  if (Affinity == CpuAffinity) {
>return GicCpuRedistributorBase;
>  }
>  
> -// Move to the next GIC Redistributor frame
> -GicCpuRedistributorBase += GicRedistributorGranularity;
> -  }
> +// Move to the next GIC Redistributor frame.
> +// The GIC specification does not forbid a mixture of v3 and v4 frames,
> +// so we test VLPIS for each frame.

Could you expand VLPIS (Virtual LPIs Supported or somesuch)?
"v3 and v4" frames ... is that a correct architectural description?

/
Leif

> +GicCpuRedistributorBase += (((ARM_GICR_TYPER_VLPIS & GicRTyper) != 0)
> +? GIC_V4_REDISTRIBUTOR_GRANULARITY
> +: GIC_V3_REDISTRIBUTOR_GRANULARITY);
> +  } while ((GicRTyper & ARM_GICR_TYPER_LAST) == 0);
>  
>// The Redistributor has 

Re: [edk2] [PATCH edk2-platforms v2 00/43] Upload for D06 platform

2018-08-22 Thread Leif Lindholm
Hi Ming,

I have finished reviewing v2/v3.
Please go ahead and start putting together and sending out a v4 of
both the edk2-platforms part and the edk2-non-osi part.

Regards,

Leif

On Tue, Aug 14, 2018 at 04:08:20PM +0800, Ming Huang wrote:
> The major features of this patchset include:
> 1 D06 source code;
> 2 Unify some D0x modules;
> 
> This patch set is base on pcihostbridage-v2.
> For compiling D06, add below hunk to edk2-platforms.config
> [d06]
> LONGNAME=HiSilicon D06
> DSC=Platform/Hisilicon/D06/D06.dsc
> ARCH=AARCH64
> 
> Code can also be found in github: 
> https://github.com/hisilicon/OpenPlatformPkg.git
> branch: d06-platform-v2
> 
> 
> Heyi Guo (3):
>   Hisilicon/D06: Add Debug Serial Port Init Driver
>   Hisilicon/Hi1620: Add ACPI PPTT table
>   Platform/Hisilicon/D06: Enable ACPI PPTT
> 
> Luqi Jiang (1):
>   Hisilicon/D06: add apei driver
> 
> Ming Huang (32):
>   Silicon/Hisilicon: Modify the MRC interface for other module
>   Silicon/Hisilicon: Separate PlatformArch.h
>   Silicon/Hisilicon/Acpi: Move some macro to PlatformArch.h
>   Hisilicon/D0x: Move CustomData.Fv to common path of Hisilicon
>   Hisilicon/D0x: Move IpmiCmdLib to common path of Hisilicon
>   Hisilicon/D0x: Unify FlashFvbDxe driver
>   Hisilicon/D0X: Rename the global variable gDS3231RtcDevice
>   Hisilicon/D06: Add several base file for D06
>   Platform/Hisilicon/D06: Add M41T83RealTimeClockLib
>   Platform/Hisilicon/D06: Add edk2-non-osi components for D06
>   Hisilicon/D06: Add OemMiscLibD06
>   Silicon/Hisilicon/D06: Wait for all disk ready
>   Silicon/Hisilicon/Acpi: Unify HisiAcipPlatformDxe
>   Hisilicon/D06: Add ACPI Tables for D06
>   Silicon/Hisilicon/D06: Stop watchdog
>   Hisilicon/I2C: Modify I2CLib.c for coding style
>   Silicon/Hisilicon/I2C: Refactor I2C library
>   Silicon/Hisilicon/D06: Fix I2C enable fail issue for D06
>   Silicon/Hisilicon/D06: Add I2C delay for HNS auto config
>   Hisilicon/I2C: Fix a typo issue
>   Platform/Hisilicon/D06: Add OemNicLib
>   Platform/Hisilicon/D06: Add OemNicConfig2P Driver
>   Platform/Hisilicon/D06: Add EarlyConfigPeim peim
>   Platform/Hisilicon/D06: Add PciHostBridgeLib
>   Silicon/Hisilicon/D06: Add some Lpc macro to LpcLib.h
>   Platform/Hisilicon/D06: Add capsule upgrade support
>   Silicon/Hisilicon/D06: Add I2C Bus Exception handle function
>   Silicon/Hisilicon/Setup: Support SPCR table switch
>   Silicon/Hisilicon/setup: Support SMMU switch
>   Hisilicon/D06: Add PciPlatformLib
>   Hisilicon/D06: Add edk2-non-osi Shell components
>   Platform/Hisilicon/D0x: Update version string to 18.08
> 
> Sun Yuanchen (3):
>   Silicon/Hisilicon/D0x: Move dimm size definition to PlatformArch.h
>   Silicon/Hisilicon/D0x: Move RAS macro to PlatformArch.h
>   Hisilicon/D0x: Update SMBIOS type9 info
> 
> Yang XinYi (2):
>   Hisilicon/D06: Add Hi1620OemConfigUiLib
>   Silicon/Hisilicon/Setup: Add Setup Item "EnableGOP"
> 
> ZhenYao (1):
>   Silicon/Hisilicon/D06: Modify for close slave core clock.
> 
> shaochangliang (1):
>   Silicon/Hisilicon/D06: Optimize HNS config CDR post time
> 
>  Platform/Hisilicon/D06/D06.dec|   29 +
>  Silicon/Hisilicon/HisiPkg.dec |6 +
>  Platform/Hisilicon/D03/D03.dsc|4 +-
>  Platform/Hisilicon/D05/D05.dsc|4 +-
>  Platform/Hisilicon/D06/D06.dsc|  490 
>  Platform/Hisilicon/D03/D03.fdf|8 +-
>  Platform/Hisilicon/D05/D05.fdf|8 +-
>  Platform/Hisilicon/D06/D06.fdf|  444 
>  .../OemMiscLib2P/OemMiscLib2PHi1610.inf   |1 +
>  .../Library/OemMiscLibD05/OemMiscLibD05.inf   |1 +
>  .../OemNicConfig2PHi1620/OemNicConfig2P.inf   |   43 +
>  .../SystemFirmwareDescriptor.inf  |   50 +
>  .../EarlyConfigPeim/EarlyConfigPeimD06.inf|   50 +
>  .../Library/OemMiscLibD06/OemMiscLibD06.inf   |   51 +
>  .../D06/Library/OemNicLib/OemNicLib.inf   |   35 +
>  .../PciHostBridgeLib/PciHostBridgeLib.inf |   36 +
>  .../Drivers/FlashFvbDxe/FlashFvbDxe.inf   |7 +-
>  .../HisiAcpiPlatformDxe/AcpiPlatformDxe.inf   |3 +-
>  .../ProcessorSubClassDxe.inf  |2 +
>  .../Hisilicon/Hi1620/Drivers/Apei/Apei.inf|   64 +
>  .../Pl011DebugSerialPortInitDxe.inf   |   48 +
>  .../Hi1620AcpiTables/AcpiTablesHi1620.inf |   59 +
>  .../Hi1620OemConfigUiLib/OemConfigUiLib.inf   |   68 +
>  .../Hi1620PciPlatformLib.inf  |   30 +
>  Silicon/Hisilicon/Hi1620/Pptt/Pptt.inf|   48 +
>  .../M41T83RealTimeClockLib.inf|   46 +
>  .../PlatformBootManagerLib.inf|4 +
>  .../OemNicConfig2PHi1620/OemNicConfig.h   |   25 +
>  .../Hisilicon/D06/Include/Library/CpldD06.h   |   39 +
>  .../Smbios/MemorySubClassDxe/MemorySubClass.h |2 -
>  .../Hi1610/Hi1610AcpiTables/Hi1610Platform.h  |   27 +-
>  .../Hisilicon/Hi1610/Include/PlatformArch.h   |   71 +
>  .../Hi1616/D05AcpiTables/Hi1616Platform.h |   24 

Re: [edk2] [PATCH edk2-platforms v2 42/43] Hisilicon/D06: Add edk2-non-osi Shell components

2018-08-22 Thread Leif Lindholm
So, on the whole, I am really not happy for any of these commands to
go into 18.08. I understand they may be handy for development, but I
do not understand why they make sense to upstream.

On Tue, Aug 14, 2018 at 04:09:02PM +0800, Ming Huang wrote:
> Add Hisilicon Oem Shell libraries for some commands,such as
> biosupdate, getmac, setmac, provision, acpistartos, brdinfo,
> sfpinfo.
> 
> biosupdate example:
> ifconfig -s eth2 static 192.168.2.68 255.255.255.0 192.168.2.1
> biosupdate serverIp -u user -p password -f D06.fd -m master
> 
> acpistartos example:
> ifconfig -s eth2 static 192.168.2.69 255.255.255.0 192.168.2.1
> provision serverIp -u user -p password -f os\Image -a 0x8
> 2
> provision serverIp -u user -p password -f os\minifs.cpio.gz -a 0x0700
> 2
> acpistartos
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> ---
>  Silicon/Hisilicon/HisiPkg.dec  | 4 
>  Platform/Hisilicon/D06/D06.dsc | 2 ++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/Silicon/Hisilicon/HisiPkg.dec b/Silicon/Hisilicon/HisiPkg.dec
> index 858b840a57..010d501914 100644
> --- a/Silicon/Hisilicon/HisiPkg.dec
> +++ b/Silicon/Hisilicon/HisiPkg.dec
> @@ -39,6 +39,7 @@
>gPlatformSasProtocolGuid = {0x40e9829f, 0x3a2c, 0x479a, {0x9a, 0x93, 0x45, 
> 0x7d, 0x13, 0x50, 0x96, 0x5d}}
>gHisiPlatformSasProtocolGuid = {0x20e9829f, 0x3a2c, 0x479a, {0x9a, 0x93, 
> 0x45, 0x7d, 0x13, 0x50, 0x96, 0x6d}}
>gHisiSnpPlatformProtocolGuid = {0x81321f27, 0xff58, 0x4a1d, {0x99, 0x97, 
> 0xd, 0xcc, 0xfa, 0x82, 0xf4, 0x6f}}
> +  gOemNicProtocolGuid = {0xb5903955, 0x31e9, 0x4aaf, {0xb2, 0x83, 0x7, 0x9f, 
> 0x3c, 0xc4, 0x71, 0x66}}
>  
>  [Guids]
>gHisiTokenSpaceGuid = {0xc8bc553e, 0x12bf, 0x11e6, {0x97, 0x4f, 0x87, 
> 0xf7, 0x7c, 0xfd, 0x52, 0x1d}}
> @@ -49,6 +50,8 @@
>gHisiOemVariableGuid = {0xac62b9a5, 0x9939, 0x41d3, {0xff, 0x5c, 0xc5, 
> 0x80, 0x32, 0x7d, 0x9b, 0x29}}
>gOemBootVariableGuid = {0xb7784577, 0x5aaf, 0x4557, {0xa1, 0x99, 0xd4, 
> 0xa4, 0x2f, 0x45, 0x06, 0xf8}}
>gEfiHisiSocControllerGuid = {0xee369cc3, 0xa743, 0x5382, {0x75, 0x64, 
> 0x53, 0xe4, 0x31, 0x19, 0x38, 0x35}}
> +  HisiShellSampleHiiGuid  = { 0x43859314, 0x82c1, 0x4592, { 0x8f, 0xf7, 
> 0xc1, 0xbd, 0xf3, 0xb2, 0x0e, 0xd5 }}
> +  HisiPlatformShellSampleHiiGuid = { 0x7924a5de, 0xc600, 0x40d5, { 0x91, 
> 0x10, 0xf9, 0xc3, 0xe7, 0x25, 0x4d, 0x33 }}

Why do we need all these different GUIDs?

Also, why "Sample"?

/
Leif

>  
>  [LibraryClasses]
>PlatformSysCtrlLib|Include/Library/PlatformSysCtrlLib.h
> @@ -101,6 +104,7 @@
>gHisiTokenSpaceGuid.PcdSlotPerChannelNum|0x0|UINT32|0x4004
>  
>gHisiTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5, 0x04, 0x7C, 0x3E, 0x9E, 
> 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1 }|VOID*|0x30006554
> +  gHisiTokenSpaceGuid.PcdStartOsParameter|L""|VOID*|0x500
>  
>#FDT File Address
>gHisiTokenSpaceGuid.FdtFileAddress|0x0|UINT64|0x4005
> diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc
> index 053ea894d5..544039e450 100644
> --- a/Platform/Hisilicon/D06/D06.dsc
> +++ b/Platform/Hisilicon/D06/D06.dsc
> @@ -473,6 +473,8 @@
>  !if $(INCLUDE_DP) == TRUE
>NULL|ShellPkg/Library/UefiDpLib/UefiDpLib.inf
>  !endif #$(INCLUDE_DP)
> +  NULL|Silicon/Hisilicon/Library/HisiShellCmdLib/HisiShellCmdLib.inf
> +  
> NULL|Silicon/Hisilicon/Hi1620/Library/HisiD06ShellCmdLib/HisiD06ShellCmdLib.inf
>  
>  
>gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0xFF
> -- 
> 2.17.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v2 36/43] Platform/Hisilicon/D06: Add capsule upgrade support

2018-08-22 Thread Leif Lindholm
On Tue, Aug 14, 2018 at 04:08:56PM +0800, Ming Huang wrote:
> This module support updating the boot CPU firmware only.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 

As I said on v1, I have no further comments on this.
Reviewed-by: Leif Lindholm 

Ard may have something to add.

/
Leif

> ---
>  Platform/Hisilicon/D06/D06.dsc   
> | 14 
>  Platform/Hisilicon/D06/D06.fdf   
> | 72 -
>  
> Platform/Hisilicon/D06/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf
>  | 50 
>  
> Platform/Hisilicon/D06/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptorPei.c
> | 70 +
>  
> Platform/Hisilicon/D06/Capsule/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini
>  | 46 +++
>  
> Platform/Hisilicon/D06/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc
> | 81 
>  6 files changed, 332 insertions(+), 1 deletion(-)
> 
> diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc
> index 9550e0d497..fad6fcc747 100644
> --- a/Platform/Hisilicon/D06/D06.dsc
> +++ b/Platform/Hisilicon/D06/D06.dsc
> @@ -121,6 +121,11 @@
>gHisiTokenSpaceGuid.PcdIsItsSupported|TRUE
>gArmTokenSpaceGuid.PcdArmGicV3WithV2Legacy|FALSE
>gEfiMdeModulePkgTokenSpaceGuid.PcdHiiOsRuntimeSupport|FALSE
> +[PcdsDynamicExDefault.common.DEFAULT]
> +  
> gEfiSignedCapsulePkgTokenSpaceGuid.PcdEdkiiSystemFirmwareImageDescriptor|{0x0}|VOID*|0x100
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdSystemFmpCapsuleImageTypeIdGuid|{0x29, 
> 0x3d, 0x4b, 0xd3, 0x85, 0x00, 0xb3, 0x4a, 0x8b, 0xe8, 0x84, 0x18, 0x8c, 0xc5, 
> 0x04, 0x89}
> +  gEfiSignedCapsulePkgTokenSpaceGuid.PcdEdkiiSystemFirmwareFileGuid|{0xcf, 
> 0x4f, 0x2e, 0x64, 0xf7, 0x2d, 0x15, 0x44, 0x8b, 0x70, 0xa0, 0x39, 0x09, 0xc5, 
> 0x7b, 0x55}
> +
>  
>  [PcdsFixedAtBuild.common]
>gArmPlatformTokenSpaceGuid.PcdCoreCount|48
> @@ -266,6 +271,7 @@
>Platform/Hisilicon/D06/EarlyConfigPeim/EarlyConfigPeimD06.inf
>Silicon/Hisilicon/Drivers/VersionInfoPeim/VersionInfoPeim.inf
>  
> +  
> Platform/Hisilicon/D06/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf
>MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf {
>  
>
> NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
> @@ -386,6 +392,8 @@
>MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
>MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
>MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
> +  SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareReportDxe.inf
> +  MdeModulePkg/Universal/EsrtDxe/EsrtDxe.inf
>#
># FAT filesystem + GPT/MBR partitioning
>#
> @@ -434,6 +442,12 @@
>MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
>MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
>MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> +  
> SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareUpdateDxe.inf {
> +
> +  
> FmpAuthenticationLib|SecurityPkg/Library/FmpAuthenticationLibPkcs7/FmpAuthenticationLibPkcs7.inf
> +  }
> +
> +  MdeModulePkg/Application/CapsuleApp/CapsuleApp.inf
>  
>#
># UEFI application (Shell Embedded Boot Loader)
> diff --git a/Platform/Hisilicon/D06/D06.fdf b/Platform/Hisilicon/D06/D06.fdf
> index 90379b8558..8c3f4f9932 100644
> --- a/Platform/Hisilicon/D06/D06.fdf
> +++ b/Platform/Hisilicon/D06/D06.fdf
> @@ -308,7 +308,9 @@ READ_LOCK_STATUS   = TRUE
>INF MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
>  
>INF 
> Silicon/Hisilicon/Hi1620/Drivers/Pl011DebugSerialPortInitDxe/Pl011DebugSerialPortInitDxe.inf
> -  INF MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf
> +  INF 
> SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareReportDxe.inf
> +  INF MdeModulePkg/Universal/EsrtDxe/EsrtDxe.inf
> +
>#
># Build Shell from latest source code instead of prebuilt binary
>#
> @@ -364,11 +366,79 @@ READ_LOCK_STATUS   = TRUE
>  
>INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
>  
> +  INF RuleOverride = FMP_IMAGE_DESC 
> Platform/Hisilicon/D06/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf
>FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {
>  SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED 
> = TRUE {
>SECTION FV_IMAGE = FVMAIN
>  }
>}
> +[FV.CapsuleDispatchFv]
> +FvAlignment= 16
> +ERASE_POLARITY = 1
> +MEMORY_MAPPED  = TRUE
> +STICKY_WRITE   = TRUE
> +LOCK_

Re: [edk2] [PATCH edk2-platforms v2 40/43] Silicon/Hisilicon/setup: Support SMMU switch

2018-08-22 Thread Leif Lindholm
Please correct the subject as per my prevoious comments on this.

On the whole, I think the enable/disable SMMU is a likely enough
scenario that we should probably have some core functionality for it
like for SPCR. For now I'm OK with this.

On Tue, Aug 14, 2018 at 04:09:00PM +0800, Ming Huang wrote:
> Select without SMMU iort while SMMU item is disable,
> Select with SMMU iort while SMMU item is enable.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> ---
>  Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c | 88 
> 
>  1 file changed, 88 insertions(+)
> 
> diff --git a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c 
> b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c
> index 32878ca4f9..e0c29e0f57 100644
> --- a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c
> +++ b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c
> @@ -24,6 +24,90 @@
>  
>  #define CORECOUNT(X) ((X) * CORE_NUM_PER_SOCKET)
>  
> +#define FIELD_IORT_NODE_OFFSET 40
> +
> +typedef enum {
> +  NodeTypeIts = 0,
> +  NodeTypeNameComponent,
> +  NodeTypePciRC,
> +  NodeTypeSmmuV1,
> +  NodeTypeSmmuV3,
> +  NodeTypePMCG
> +} IORT_NODE_TYPE;
> +
> +#pragma pack(1)
> +typedef struct {
> +  UINT8   Type;
> +  UINT16  Length;
> +  UINT8   Revision;
> +  UINT32  Reserved;
> +  UINT32  IdMapNumber;
> +  UINT32  IdArrayOffset;
> +} IORT_NODE_HEAD;
> +#pragma pack()
> +
> +BOOLEAN
> +IsIortWithSmmu (
> +  IN EFI_ACPI_DESCRIPTION_HEADER  *TableHeader
> +  )
> +{
> +  UINT32   *NodeOffset;
> +  UINT32   NextOffset;
> +  IORT_NODE_HEAD   *Node;
> +
> +  NodeOffset = (UINT32 *)((UINT8 *)TableHeader + FIELD_IORT_NODE_OFFSET);
> +  NextOffset = *NodeOffset;
> +
> +  while (NextOffset < TableHeader->Length) {
> +Node = (IORT_NODE_HEAD *)((UINT8 *)TableHeader + NextOffset);
> +NextOffset += Node->Length;
> +
> +if ((Node->Type == NodeTypeSmmuV1) || (Node->Type == NodeTypeSmmuV3)) {
> +  return TRUE;
> +}
> +  }
> +
> +  return FALSE;
> +}
> +
> +EFI_STATUS
> +SelectIort (
> +  IN EFI_ACPI_DESCRIPTION_HEADER  *TableHeader
> +  )
> +{
> +  EFI_STATUS  Status;
> +  UINTN   Size;
> +  OEM_CONFIG_DATA Configuration;
> +
> +  Configuration.EnableSmmu = 0;
> +  Size = sizeof (OEM_CONFIG_DATA);
> +  Status = gRT->GetVariable (
> +  OEM_CONFIG_NAME,
> +  ,
> +  NULL,
> +  ,
> +  
> +  );
> +  if (EFI_ERROR (Status)) {
> +DEBUG ((DEBUG_ERROR, "Get OemConfig variable (%r).\n", Status));
> +  }
> +
> +  Status =  EFI_SUCCESS;
> +  if (IsIortWithSmmu (TableHeader)) {
> +if (!Configuration.EnableSmmu) {
> +  Status = EFI_ABORTED;
> +}
> +  } else {
> +if (Configuration.EnableSmmu) {
> +  Status = EFI_ABORTED;
> +}
> +  }
> +  DEBUG ((DEBUG_INFO, "SmmuEnable=%x, return %r for Iort table.\n",
> +  Configuration.EnableSmmu, Status));
> +
> +  return Status;
> +}
> +
>  STATIC
>  VOID
>  RemoveUnusedMemoryNode (
> @@ -151,6 +235,10 @@ UpdateAcpiTable (
>case EFI_ACPI_6_0_SYSTEM_LOCALITY_INFORMATION_TABLE_SIGNATURE:
>  Status = UpdateSlit (TableHeader);
>  break;
> +

Drop this blank line.

/
Leif

> +  case EFI_ACPI_6_2_IO_REMAPPING_TABLE_SIGNATURE:
> +Status = SelectIort (TableHeader);
> +break;
>case EFI_ACPI_6_2_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE:
>  Status = IsNeedSpcr (TableHeader);
>  break;
> -- 
> 2.17.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v2 23/43] Silicon/Hisilicon/D06: Add I2C delay for HNS auto config

2018-08-22 Thread Leif Lindholm
On Wed, Aug 22, 2018 at 11:16:26PM +0800, Ming wrote:
> 
> 
> On 8/22/2018 10:27 PM, Leif Lindholm wrote:
> > On Tue, Aug 14, 2018 at 04:08:43PM +0800, Ming Huang wrote:
> >> Because I2C Port5 salve device connect under I2C extender
> >> (9545 device), it will cost more time to access I2C slave
> >> device, so add delay time for HNS auto config.
> >>
> >> Contributed-under: TianoCore Contribution Agreement 1.1
> >> Signed-off-by: Ming Huang 
> >> ---
> >>  Silicon/Hisilicon/Library/I2CLib/I2CHw.h  |  3 +++
> >>  Silicon/Hisilicon/Library/I2CLib/I2CLib.c | 21 +++-
> >>  2 files changed, 19 insertions(+), 5 deletions(-)
> > 
> > Like previous patch, please change subject line - this affects d03,
> > d05, d06.
> > 
> > Silicon/Hisilicon: Add I2CLib delay for HNS auto config
> 
> Should this patch reorder before the first D06 patch ?

Yes please.

/
Leif

> > 
> >> diff --git a/Silicon/Hisilicon/Library/I2CLib/I2CHw.h 
> >> b/Silicon/Hisilicon/Library/I2CLib/I2CHw.h
> >> index fa954c7937..d77aea509e 100644
> >> --- a/Silicon/Hisilicon/Library/I2CLib/I2CHw.h
> >> +++ b/Silicon/Hisilicon/Library/I2CLib/I2CHw.h
> >> @@ -19,6 +19,9 @@
> >>  #include 
> >>  #include 
> >>  
> >> +// The HNS I2C port 5 is under I2C extender
> >> +#define I2C_EXTENDER_PORT_HNS5
> >> +
> >>  #define I2C_READ_TIMEOUT 500
> >>  #define I2C_DRV_ONCE_WRITE_BYTES_NUM 8
> >>  #define I2C_DRV_ONCE_READ_BYTES_NUM  8
> >> diff --git a/Silicon/Hisilicon/Library/I2CLib/I2CLib.c 
> >> b/Silicon/Hisilicon/Library/I2CLib/I2CLib.c
> >> index d67ddc7f9b..59633106ce 100644
> >> --- a/Silicon/Hisilicon/Library/I2CLib/I2CLib.c
> >> +++ b/Silicon/Hisilicon/Library/I2CLib/I2CLib.c
> >> @@ -258,8 +258,13 @@ CheckI2CTimeOut (
> >>if (Transfer == I2CTx) {
> >>  Fifo = I2C_GetTxStatus (Socket, Port);
> >>  while (Fifo != 0) {
> >> -  // This is a empirical value for I2C delay. MemoryFance is no need 
> >> here.
> >> -  I2C_Delay (2);
> >> +  if (Port == I2C_EXTENDER_PORT_HNS) {
> >> +// This is a empirical value for I2C delay. MemoryFance is no 
> >> need here.
> > 
> > MemoryFance ->
> > MemoryFence
> > 
> > (You may want to search and replace that on the whole set.)
> > 
> > With that:
> > Reviewed-by: Leif Lindholm 
> 
> Replace they in v4.
> Thanks.
> 
> > 
> > /
> > Leif
> > 
> >> +I2C_Delay (1000);
> >> +  } else {
> >> +// This is a empirical value for I2C delay. MemoryFance is no 
> >> need here.
> >> +I2C_Delay (2);
> >> +  }
> >>if (++Times > I2C_READ_TIMEOUT) {
> >>  (VOID)I2C_Disable (Socket, Port);
> >>  return EFI_TIMEOUT;
> >> @@ -269,8 +274,13 @@ CheckI2CTimeOut (
> >>} else {
> >>  Fifo = I2C_GetRxStatus (Socket, Port);
> >>  while (Fifo == 0) {
> >> -  // This is a empirical value for I2C delay. MemoryFance is no need 
> >> here.
> >> -  I2C_Delay (2);
> >> +  if (Port == I2C_EXTENDER_PORT_HNS) {
> >> +// This is a empirical value for I2C delay. MemoryFance is no 
> >> need here.
> >> +I2C_Delay (1000);
> >> +  } else {
> >> +// This is a empirical value for I2C delay. MemoryFance is no 
> >> need here.
> >> +I2C_Delay (2);
> >> +  }
> >>if (++Times > I2C_READ_TIMEOUT) {
> >>  (VOID)I2C_Disable (Socket, Port);
> >>  return EFI_TIMEOUT;
> >> @@ -369,7 +379,8 @@ I2CWrite(
> >>  Times = 0;
> >>  Fifo = I2C_GetTxStatus (I2cInfo->Socket, I2cInfo->Port);
> >>  while (Fifo > I2C_TXRX_THRESHOLD) {
> >> -  I2C_Delay (2);
> >> +  // This is a empirical value for I2C delay. MemoryFance is no need 
> >> here.
> >> +  I2C_Delay (1000);
> >>if (++Times > I2C_READ_TIMEOUT) {
> >>  (VOID)I2C_Disable (I2cInfo->Socket, I2cInfo->Port);
> >>  return EFI_TIMEOUT;
> >> -- 
> >> 2.17.0
> >>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v2 12/43] Platform/Hisilicon/D06: Add edk2-non-osi components for D06

2018-08-22 Thread Leif Lindholm
On Wed, Aug 22, 2018 at 10:54:54PM +0800, Ming wrote:
> 
> 
> On 8/22/2018 5:49 PM, Leif Lindholm wrote:
> > On Tue, Aug 14, 2018 at 04:08:32PM +0800, Ming Huang wrote:
> >> Add PcdCoreCount to fix build issue while add binary components.
> > 
> > This commit message fails to describe what is being done, apart from a
> > single thing that should be a separate patch.
> > 
> > Pleas add a proper commit message describing which components are
> > being imported.
> > 
> >> Contributed-under: TianoCore Contribution Agreement 1.1
> >> Signed-off-by: Ming Huang 
> >> ---
> >>  Platform/Hisilicon/D06/D06.dsc
> >>  |  7 +++
> >>  Platform/Hisilicon/D06/D06.fdf
> >>  | 17 +
> >>  
> >> Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClassDxe.inf
> >>  |  2 ++
> >>  3 files changed, 26 insertions(+)
> >>
> > 
> >> diff --git 
> >> a/Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClassDxe.inf
> >>  
> >> b/Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClassDxe.inf
> >> index 2275586ff3..a47806f391 100644
> >> --- 
> >> a/Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClassDxe.inf
> >> +++ 
> >> b/Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClassDxe.inf
> >> @@ -28,6 +28,7 @@
> >>  
> >>  [Packages]
> >>ArmPkg/ArmPkg.dec
> >> +  ArmPlatformPkg/ArmPlatformPkg.dec
> >>MdePkg/MdePkg.dec
> >>MdeModulePkg/MdeModulePkg.dec
> >>IntelFrameworkPkg/IntelFrameworkPkg.dec
> >> @@ -52,6 +53,7 @@
> >>gEfiSmbiosProtocolGuid   # PROTOCOL ALWAYS_CONSUMED
> >>  
> >>  [Pcd]
> >> +  gArmPlatformTokenSpaceGuid.PcdCoreCount
> >>gHisiTokenSpaceGuid.PcdCPUInfo
> >>gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz
> > 
> > And please submit this as a separate patch, explaining why the change
> > is needed. If it is only needed by one of the binary modules imported
> > as part of the current patch, place it immediately preceding this.
> > 
> > If it resolves some other issue, please insert it as early in the set
> > as possible.
> 
> Silicon/Hisilicon/Hi1620/Library/PlatformSysCtrlLibHi1620 add a function
> which use the PcdCoreCount and the function is used by ProcessorSubClassDxe.
> Should I add gArmPlatformTokenSpaceGuid.PcdCoreCount to
> Silicon/Hisilicon/Hi1620/Library/PlatformSysCtrlLibHi1620/PlatformSysCtrlLibHi1620.inf
>  ?
> And delete the commit message in this patch ?

Yes please - that sounds like the correct solution.

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


Re: [edk2] [PATCH edk2-platforms v3 00/36] Upload for D06 platform

2018-08-22 Thread Leif Lindholm
On Sat, Aug 18, 2018 at 02:20:49PM +0800, Ming wrote:
> 
> 
> 在 8/17/2018 8:23 PM, Leif Lindholm 写道:
> > Hi Ming,
> > 
> > Please do not send new revisions while I'm still reviewing the
> > previous one. It is possible you inferred that I wanted this from some
> > comment I made about changes I wanted to see _when_ the next revision
> > was sent out, but this was not my meaning.
> > If I want a new revision sent out before I have finished reviewing the
> > current one, I will ask for it explicitly.
> > 
> > Do however please include a summary of what has changed since the
> > previous revision. And keep this summary when you send a subsequent
> > patch, so you end up with:
> > 
> > Changes since v3:
> > - ...
> > - ...
> > 
> > Changes since v2:
> > - ...
> > - ...
> > - ...
> > 
> > Changes since v1:
> > - ...
> > 
> > In this instance, it seems like patches 1-7 went missing.
> > I pushed 6-7, but 1-5 were still under review.
> 
> Apology for v3.

No need to apologise.
But now you know how I prefer to handle sets.

> I will Add 1-5 back in v4 when you ask for it.

Any minute now :)

> > And please remember the --stat and --stat-graph-width from
> > https://github.com/tianocore/tianocore.github.io/wiki/Laszlo's-unkempt-git-guide-for-edk2-contributors-and-maintainers#contrib-23
> 
> I format patches using below commands. The diff.order file have configured.
> Is it enouth?
> git format-patch --stat=1000 --stat-graph-width=20 --cover-letter --no-binary 
> --subject-prefix="PATCH edk2-platforms" -36 -v 3 -o v3
> git format-patch --stat=1000 --stat-graph-width=20 --cover-letter --no-binary 
> --subject-prefix="PATCH edk2-non-osi" -2 -v 3 -o v3

Yes, that should be fine.

> Changes since v2:
> 1 Modify "Wait for all disk ready" patch as communication, update SAS driver 
> binary also;
> 2 Modify OemNicLib, set Mac to 0xFF while eeprom don't contain valid Mac;
> 3 Remove .h file from Apei.inf;

Yes, I think I addressed all of those in my review.

Please include that changeset in the v4 cover letter.

Regards,

Leif

> Thanks.
> 
> > 
> > I will continue reviewing v2.
> > Please do not send a v4 until I ask for it.
> > 
> > Regards,
> > 
> > Leif
> > 
> > On Thu, Aug 16, 2018 at 08:12:03PM +0800, Ming Huang wrote:
> >> The major features of this patchset include:
> >> 1 D06 source code;
> >> 2 Unify some D0x modules;
> >>
> >> This patch set is base on pcihostbridage-v2.
> >> For compiling D06, add below hunk to edk2-platforms.config
> >> [d06]
> >> LONGNAME=HiSilicon D06
> >> DSC=Platform/Hisilicon/D06/D06.dsc
> >> ARCH=AARCH64
> >>
> >> Code can also be found in github: 
> >> https://github.com/hisilicon/OpenPlatformPkg.git
> >> branch: d06-platform-v3
> >>
> >>
> >> Heyi Guo (3):
> >>   Hisilicon/D06: Add Debug Serial Port Init Driver
> >>   Hisilicon/Hi1620: Add ACPI PPTT table
> >>   Platform/Hisilicon/D06: Enable ACPI PPTT
> >>
> >> Luqi Jiang (1):
> >>   Hisilicon/D06: add apei driver
> >>
> >> Ming Huang (27):
> >>   Hisilicon/D0x: Unify FlashFvbDxe driver
> >>   Hisilicon/D0X: Rename the global variable gDS3231RtcDevice
> >>   Hisilicon/D06: Add several base file for D06
> >>   Platform/Hisilicon/D06: Add M41T83RealTimeClockLib
> >>   Platform/Hisilicon/D06: Add edk2-non-osi components for D06
> >>   Hisilicon/D06: Add OemMiscLibD06
> >>   Silicon/Hisilicon/D06: Wait for all disk ready
> >>   Silicon/Hisilicon/Acpi: Unify HisiAcipPlatformDxe
> >>   Hisilicon/D06: Add ACPI Tables for D06
> >>   Silicon/Hisilicon/D06: Stop watchdog
> >>   Hisilicon/I2C: Modify I2CLib.c for coding style
> >>   Silicon/Hisilicon/I2C: Refactor I2C library
> >>   Silicon/Hisilicon/D06: Fix I2C enable fail issue for D06
> >>   Silicon/Hisilicon/D06: Add I2C delay for HNS auto config
> >>   Hisilicon/I2C: Fix a typo issue
> >>   Platform/Hisilicon/D06: Add OemNicLib
> >>   Platform/Hisilicon/D06: Add OemNicConfig2P Driver
> >>   Platform/Hisilicon/D06: Add EarlyConfigPeim peim
> >>   Platform/Hisilicon/D06: Add PciHostBridgeLib
> >>   Silicon/Hisilicon/D06: Add some Lpc macro to LpcLib.h
> >>   Platform/Hisilicon/D06: Add capsule upgrade support
> >>   Silicon/Hisilicon/D06: Add I2C Bus Exception handle function
> >>   Silicon/Hisilicon/Setup: Support SPCR table switch
> >>  

Re: [edk2] [PATCH edk2-platforms v2 41/43] Hisilicon/D06: Add PciPlatformLib

2018-08-22 Thread Leif Lindholm
On Tue, Aug 14, 2018 at 04:09:01PM +0800, Ming Huang wrote:
> Add a Null PciPlatformLib for build D06. The switch generic
> PciHostBridge patch set add two api for PciPlatform driver,
> so need to implement the two api for D06.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 

Reviewed-by: Leif Lindholm 

> ---
>  Platform/Hisilicon/D06/D06.dsc   
>   |  1 +
>  
> Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.inf
>  | 30 +
>  Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.c 
>   | 67 
>  3 files changed, 98 insertions(+)
> 
> diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc
> index fad6fcc747..053ea894d5 100644
> --- a/Platform/Hisilicon/D06/D06.dsc
> +++ b/Platform/Hisilicon/D06/D06.dsc
> @@ -95,6 +95,7 @@
>FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
>  !endif
>PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf
> +  
> PciPlatformLib|Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.inf
>  
>  [LibraryClasses.common.SEC]
>
> ArmPlatformLib|Silicon/Hisilicon/Library/ArmPlatformLibHisilicon/ArmPlatformLibSec.inf
> diff --git 
> a/Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.inf
>  
> b/Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.inf
> new file mode 100644
> index 00..7648322522
> --- /dev/null
> +++ 
> b/Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.inf
> @@ -0,0 +1,30 @@
> +## @file
> +# PCI Segment Library for Hisilicon Hi1610/Hi1616 SoC with multiple RCs
> +#
> +# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
> +# Copyright (c) 2017 - 2018, Linaro Ltd. All rights reserved.
> +# Copyright (c) 2018, Hisilicon Ltd. 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= 0x0001001A
> +  BASE_NAME  = Hi1620PciPlatformLib
> +  FILE_GUID  = 29ba30da-68bc-46a5-888f-c65dabb67fd8
> +  MODULE_TYPE= BASE
> +  VERSION_STRING = 1.0
> +  LIBRARY_CLASS  = PciPlatformLib
> +
> +[Sources]
> +  Hi1620PciPlatformLib.c
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> diff --git 
> a/Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.c
>  
> b/Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.c
> new file mode 100644
> index 00..ff77974c0f
> --- /dev/null
> +++ 
> b/Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.c
> @@ -0,0 +1,67 @@
> +/** @file
> +*
> +*  Copyright (c) 2018, Hisilicon Limited. All rights reserved.
> +*  Copyright (c) 2018, Linaro Limited. 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.
> +*
> +**/
> +
> +#include 
> +#include 
> +
> +
> +/*++
> +
> +Routine Description:
> +
> +  Perform Platform initialization first in PciPlatform.
> +
> +Arguments:
> +
> +Returns:
> +
> + VOID.
> +
> +--*/
> +VOID
> +EFIAPI
> +PciInitPlatform (
> +  VOID
> +  )
> +{
> +  return;
> +}
> +
> +/*++
> +
> +Routine Description:
> +
> +  Perform Platform initialization by the phase indicated.
> +
> +Arguments:
> +
> +  HostBridge-  The associated PCI host bridge handle.
> +  Phase -  The phase of the PCI controller enumeration.
> +  ChipsetPhase  -  Defines the execution phase of the PCI chipset driver.
> +
> +Returns:
> +
> +--*/
> +VOID
> +EFIAPI
> +PhaseNotifyPlatform (
> +  IN  EFI_HANDLE HostBridge,
> +  IN  EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE  Phase,
> +  IN  EFI_PCI_CHIPSET_EXECUTION_PHASEChipsetPhase
> +  )
> +{
> +  return;
> +}
> +
> -- 
> 2.17.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v2 43/43] Platform/Hisilicon/D0x: Update version string to 18.08

2018-08-22 Thread Leif Lindholm
On Tue, Aug 14, 2018 at 04:09:03PM +0800, Ming Huang wrote:
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 

Reviewed-by: Leif Lindholm 

> ---
>  Platform/Hisilicon/D03/D03.dsc | 2 +-
>  Platform/Hisilicon/D05/D05.dsc | 2 +-
>  Platform/Hisilicon/D06/D06.dsc | 4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/Platform/Hisilicon/D03/D03.dsc b/Platform/Hisilicon/D03/D03.dsc
> index c12790ba59..add15b7f93 100644
> --- a/Platform/Hisilicon/D03/D03.dsc
> +++ b/Platform/Hisilicon/D03/D03.dsc
> @@ -174,7 +174,7 @@
>!ifdef $(FIRMWARE_VER)
>  
> gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"$(FIRMWARE_VER)"
>!else
> -gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"Development 
> build 18.02 for Hisilicon D03"
> +gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"Development 
> build 18.08 for Hisilicon D03"
>!endif
>  
>gHisiTokenSpaceGuid.PcdBiosVersionString|L"10.01.01T18"
> diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc
> index 94d386582e..76c0bd421e 100644
> --- a/Platform/Hisilicon/D05/D05.dsc
> +++ b/Platform/Hisilicon/D05/D05.dsc
> @@ -192,7 +192,7 @@
>!ifdef $(FIRMWARE_VER)
>  
> gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"$(FIRMWARE_VER)"
>!else
> -gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"Development 
> build 18.02 for Hisilicon D05"
> +gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"Development 
> build 18.08 for Hisilicon D05"
>!endif
>  
>gHisiTokenSpaceGuid.PcdBiosVersionString|L"10.01.01T18"
> diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc
> index 544039e450..09197922ad 100644
> --- a/Platform/Hisilicon/D06/D06.dsc
> +++ b/Platform/Hisilicon/D06/D06.dsc
> @@ -165,12 +165,12 @@
>!ifdef $(FIRMWARE_VER)
>  
> gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"$(FIRMWARE_VER)"
>!else
> -gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"Hisilicon D06 
> UEFI RC0 - B308 (V0.38)"
> +gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"Development 
> build 18.08 for Hisilicon D06"
>!endif
>  
>gHisiTokenSpaceGuid.PcdBiosVersionString|L"10.01.01T18"
>  
> -  gHisiTokenSpaceGuid.PcdBiosVersionForBmc|L"0.38"
> +  gHisiTokenSpaceGuid.PcdBiosVersionForBmc|L"0.42"
>  
>gHisiTokenSpaceGuid.PcdSystemProductName|L"D06"
>gHisiTokenSpaceGuid.PcdSystemVersion|L"VER.A"
> -- 
> 2.17.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v2 38/43] Silicon/Hisilicon/D06: Add I2C Bus Exception handle function

2018-08-22 Thread Leif Lindholm
On Tue, Aug 14, 2018 at 04:08:58PM +0800, Ming Huang wrote:
> During the period of I2c accessing, if the board is reset
> unexpectedly, and because the I2c client can not reset,
> the SDA will be always pull down, then it cause I2C bus
> Exception.
> 
> Follow the Hi1620 I2C FS chapter 1.8.2 design, add I2C
> Bus Exception handle function. It will Config SCL and SDA
> to GPIO, and set the reversal frequency of SCL to 10KHz.
> 
> The implementation of functions is in edk2-non-osi.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 

This change is not in Silicon/Hisilicon/D06, please fix the subject
line.

/
Leif

> ---
>  Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h 
> b/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h
> index 3ccfc6bee3..a232e52ed7 100644
> --- a/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h
> +++ b/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h
> @@ -106,4 +106,7 @@ VOID DisableClusterClock(UINTN CpuClusterBase);
>  VOID EnableClusterClock(UINTN CpuClusterBase);
>  VOID DisableSocketClock (UINT8 Skt);
>  
> +EFI_STATUS EFIAPI HandleI2CException (UINT32 Socket, UINT32 Port);
> +EFI_STATUS EFIAPI HandleI2CExceptionBySocket (UINT32 Socket);
> +
>  #endif
> -- 
> 2.17.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v2 37/43] Silicon/Hisilicon/D06: Modify for close slave core clock.

2018-08-22 Thread Leif Lindholm
On Tue, Aug 14, 2018 at 04:08:57PM +0800, Ming Huang wrote:
> From: ZhenYao 
> 
> When BIOS booting, the power consumption is too high, so need close
> some clusters clock that don't work to reduce power consumption.
> 
> The implementation of functions is in edk2-non-osi.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: ZhenYao 

This patch is not in Silicon/Hisilicon/D06. Fix the subject please.

> ---
>  Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h 
> b/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h
> index ec2b9a36e7..3ccfc6bee3 100644
> --- a/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h
> +++ b/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h
> @@ -102,5 +102,8 @@ VOID PlatformEventBroadcastConfig(VOID);
>  UINTN GetDjtagRegBase(UINT32 NodeId);
>  VOID LlcCleanInvalidateAsm(VOID);
>  VOID PlatformMdioInit(VOID);
> +VOID DisableClusterClock(UINTN CpuClusterBase);
> +VOID EnableClusterClock(UINTN CpuClusterBase);
> +VOID DisableSocketClock (UINT8 Skt);
>  
>  #endif
> -- 
> 2.17.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v2 34/43] Hisilicon/D06: add apei driver

2018-08-22 Thread Leif Lindholm
On Tue, Aug 14, 2018 at 04:08:54PM +0800, Ming Huang wrote:
> From: Luqi Jiang 
> 
> This driver provide a means for the platform to
> convey error information to OSPM.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Luqi Jiang 
> ---
>  Platform/Hisilicon/D06/D06.dsc   |   1 +
>  Platform/Hisilicon/D06/D06.fdf   |   1 +
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/Apei.inf   |  64 
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/Apei.h |  41 +++
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/Bert/bert.h|  43 +++
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/Einj/einj.h| 146 
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/ErrorSource/Ghes.h | 110 ++
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/Erst/erst.h| 146 
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/Hest/hest.h|  59 +++
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/OemApeiHi1620.h|  43 +++
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/Apei.c | 108 ++
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/Bert/bert.c|  92 +
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/Einj/einj.c| 349 
> ++
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/ErrorSource/Ghes.c | 330 
> +
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/Erst/erst.c| 374 
> 
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/Hest/hest.c| 119 +++
>  Silicon/Hisilicon/Hi1620/Drivers/Apei/OemApeiHi1620.c| 337 
> ++
>  17 files changed, 2363 insertions(+)

OK, so I was a bit terse in my original comment.
But all of these files need to be named approprietly - with an
upper-case first letter.

bert.h ->
Bert.h
einj.h ->
Einj.h

and so on.

More comments inline.

> 
> diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc
> index c6de9f04ad..9550e0d497 100644
> --- a/Platform/Hisilicon/D06/D06.dsc
> +++ b/Platform/Hisilicon/D06/D06.dsc
> @@ -340,6 +340,7 @@
>Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/AcpiTablesHi1620.inf
>Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
>  
> +  Silicon/Hisilicon/Hi1620/Drivers/Apei/Apei.inf
>Silicon/Hisilicon/Hi1620/Pptt/Pptt.inf
>#
># Usb Support
> diff --git a/Platform/Hisilicon/D06/D06.fdf b/Platform/Hisilicon/D06/D06.fdf
> index bd3ea47226..90379b8558 100644
> --- a/Platform/Hisilicon/D06/D06.fdf
> +++ b/Platform/Hisilicon/D06/D06.fdf
> @@ -251,6 +251,7 @@ READ_LOCK_STATUS   = TRUE
>  
>INF RuleOverride=ACPITABLE 
> Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/AcpiTablesHi1620.inf
>INF Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
> +  INF Silicon/Hisilicon/Hi1620/Drivers/Apei/Apei.inf
>  
>INF Silicon/Hisilicon/Hi1620/Pptt/Pptt.inf
>  
> diff --git a/Silicon/Hisilicon/Hi1620/Drivers/Apei/Apei.inf 
> b/Silicon/Hisilicon/Hi1620/Drivers/Apei/Apei.inf
> new file mode 100644
> index 00..7a75968da1
> --- /dev/null
> +++ b/Silicon/Hisilicon/Hi1620/Drivers/Apei/Apei.inf
> @@ -0,0 +1,64 @@
> +/** @file
> +*
> +*  Copyright (c) 2018, Hisilicon Limited. All rights reserved.
> +*  Copyright (c) 2018, Linaro Limited. 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= 0x0001001A
> +  BASE_NAME  = AcpiApei
> +  FILE_GUID  = E9570C39-EF68-4fc6-B921-C1954A87CCD2
> +  MODULE_TYPE= DXE_DRIVER
> +  VERSION_STRING = 1.0
> +  ENTRY_POINT= ApeiEntryPoint
> +
> +[sources.common]
> +  Apei.c
> +  Bert/bert.c
> +  Bert/bert.h
> +  Einj/einj.c
> +  Einj/einj.h
> +  Erst/erst.c
> +  Erst/erst.h
> +  Hest/hest.c
> +  Hest/hest.h
> +  ErrorSource/Ghes.c
> +  ErrorSource/Ghes.h
> +  OemApeiHi1620.c
> +
> +[Packages]
> +  ArmPkg/ArmPkg.dec
> +  MdePkg/MdePkg.dec
> +  Silicon/Hisilicon/HisiPkg.dec
> +
> +[LibraryClasses]
> +  ArmSmcLib
> +  BaseMemoryLib
> +  DebugLib
> +  HobLib
> +  TimerLib
> +  UefiDriverEntryPoint
> +  UefiRuntimeServicesTableLib
> +
> +[Guids]
> +  gOemConfigGuid
> +
> +[Protocols]
> +  gEfiAcpiSdtProtocolGuid
> +  gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED
> +
> +[Pcd]
> +  gHisiTokenSpaceGuid.PcdCpldBaseAddress
> +  gHisiTokenSpaceGuid.PcdTrustedFirmwareEnable
> +
> +[Depex]
> +  gEfiAcpiTableProtocolGuid AND gEfiAcpiSdtProtocolGuid
> diff --git a/Silicon/Hisilicon/Hi1620/Drivers/Apei/Apei.h 
> b/Silicon/Hisilicon/Hi1620/Drivers/Apei/Apei.h
> new file mode 100644
> index 

Re: [edk2] [PATCH edk2-platforms v2 33/43] Platform/Hisilicon/D06: Add PciHostBridgeLib

2018-08-22 Thread Leif Lindholm
On Tue, Aug 14, 2018 at 04:08:53PM +0800, Ming Huang wrote:
> PciHostBridgeLib which is need by PciHostBridgeDxe, provide
> root bridges and deal with resource conflict.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 

All of my comments from v1 have been addressed.
Reviewed-by: Leif Lindholm 

/
Leif

> ---
>  Platform/Hisilicon/D06/D06.dsc   |   2 +-
>  Platform/Hisilicon/D06/Library/PciHostBridgeLib/PciHostBridgeLib.inf |  36 ++
>  Platform/Hisilicon/D06/Library/PciHostBridgeLib/PciHostBridgeLib.c   | 635 
> 
>  3 files changed, 672 insertions(+), 1 deletion(-)
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v2 32/43] Platform/Hisilicon/D06: Add EarlyConfigPeim peim

2018-08-22 Thread Leif Lindholm
On Tue, Aug 14, 2018 at 04:08:52PM +0800, Ming Huang wrote:
> This peim configuare SMMU,BSP,MN(Miscellaneous Node).

configuare still needs to change to
configures

With that change:
Reviewed-by: Leif Lindholm 


> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> ---
>  Platform/Hisilicon/D06/D06.dsc|   1 +
>  Platform/Hisilicon/D06/D06.fdf|   1 +
>  Platform/Hisilicon/D06/EarlyConfigPeim/EarlyConfigPeimD06.inf |  50 +
>  Silicon/Hisilicon/Include/Library/OemAddressMapLib.h  |   2 +
>  Platform/Hisilicon/D06/EarlyConfigPeim/EarlyConfigPeimD06.c   | 107 
> 
>  5 files changed, 161 insertions(+)
> 
> diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc
> index 5571028f42..3de09ea870 100644
> --- a/Platform/Hisilicon/D06/D06.dsc
> +++ b/Platform/Hisilicon/D06/D06.dsc
> @@ -263,6 +263,7 @@
>MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf
>MdeModulePkg/Universal/Variable/Pei/VariablePei.inf
>  
> +  Platform/Hisilicon/D06/EarlyConfigPeim/EarlyConfigPeimD06.inf
>Silicon/Hisilicon/Drivers/VersionInfoPeim/VersionInfoPeim.inf
>  
>MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf {
> diff --git a/Platform/Hisilicon/D06/D06.fdf b/Platform/Hisilicon/D06/D06.fdf
> index 184d5d4dcf..bd3ea47226 100644
> --- a/Platform/Hisilicon/D06/D06.fdf
> +++ b/Platform/Hisilicon/D06/D06.fdf
> @@ -359,6 +359,7 @@ READ_LOCK_STATUS   = TRUE
>INF ArmPkg/Drivers/CpuPei/CpuPei.inf
>INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf
>INF IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf
> +  INF Platform/Hisilicon/D06/EarlyConfigPeim/EarlyConfigPeimD06.inf
>  
>INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
>  
> diff --git a/Platform/Hisilicon/D06/EarlyConfigPeim/EarlyConfigPeimD06.inf 
> b/Platform/Hisilicon/D06/EarlyConfigPeim/EarlyConfigPeimD06.inf
> new file mode 100644
> index 00..8296ee02de
> --- /dev/null
> +++ b/Platform/Hisilicon/D06/EarlyConfigPeim/EarlyConfigPeimD06.inf
> @@ -0,0 +1,50 @@
> +#/** @file
> +#
> +#Copyright (c) 2018, Hisilicon Limited. All rights reserved.
> +#Copyright (c) 2017, Linaro Limited. 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= 0x0001001A
> +  BASE_NAME  = EarlyConfigPeimD06
> +  FILE_GUID  = FB8C65EB-0199-40C3-A82B-029921A9E9B3
> +  MODULE_TYPE= PEIM
> +  VERSION_STRING = 1.0
> +  ENTRY_POINT= EarlyConfigEntry
> +
> +[Sources.common]
> +  EarlyConfigPeimD06.c
> +
> +[Packages]
> +  ArmPkg/ArmPkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +  MdePkg/MdePkg.dec
> +  Silicon/Hisilicon/HisiPkg.dec
> +
> +[LibraryClasses]
> +  ArmLib
> +  CacheMaintenanceLib
> +  DebugLib
> +  IoLib
> +  PcdLib
> +  PeimEntryPoint
> +  PlatformSysCtrlLib
> +
> +[Pcd]
> +  gHisiTokenSpaceGuid.PcdMailBoxAddress
> +  gHisiTokenSpaceGuid.PcdPeriSubctrlAddress
> +  gHisiTokenSpaceGuid.PcdTrustedFirmwareEnable
> +
> +[Depex]
> +## As we will clean mailbox in this module, need to wait memory init complete
> +  gEfiPeiMemoryDiscoveredPpiGuid
> diff --git a/Silicon/Hisilicon/Include/Library/OemAddressMapLib.h 
> b/Silicon/Hisilicon/Include/Library/OemAddressMapLib.h
> index 332a79343f..b330be09ba 100644
> --- a/Silicon/Hisilicon/Include/Library/OemAddressMapLib.h
> +++ b/Silicon/Hisilicon/Include/Library/OemAddressMapLib.h
> @@ -16,6 +16,8 @@
>  #ifndef _OEM_ADDRESS_MAP_LIB_H_
>  #define _OEM_ADDRESS_MAP_LIB_H_
>  
> +#include "PlatformArch.h"
> +
>  typedef struct _DDRC_BASE_ID{
>  UINTN  Base;
>  UINTN  Id;
> diff --git a/Platform/Hisilicon/D06/EarlyConfigPeim/EarlyConfigPeimD06.c 
> b/Platform/Hisilicon/D06/EarlyConfigPeim/EarlyConfigPeimD06.c
> new file mode 100644
> index 00..0790f7941a
> --- /dev/null
> +++ b/Platform/Hisilicon/D06/EarlyConfigPeim/EarlyConfigPeimD06.c
> @@ -0,0 +1,107 @@
> +/** @file
> +*
> +*  Copyright (c) 2018, Hisilicon Limited. All rights reserved.
> +*  Copyright (c) 2018, Lina

Re: [edk2] [PATCH edk2-platforms v2 31/43] Hisilicon/D0x: Update SMBIOS type9 info

2018-08-22 Thread Leif Lindholm
gt; +VOID
> +GetPciDidVid (
> +  REPORT_PCIEDIDVID2BMC *Report
> +  )
> +{
> +  if (OemIsMpBoot ()) {
> +(VOID)CopyMem ((VOID *)Report, (VOID *)PcieDeviceToReport_2P, sizeof 
> (PcieDeviceToReport_2P));
> +  } else {
> +(VOID)CopyMem ((VOID *)Report, (VOID *)PcieDeviceToReport, sizeof 
> (PcieDeviceToReport));

I think these lines got longer from v1?
Please wrap.

With these changes:
Reviewed-by: Leif Lindholm 

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


Re: [edk2] [PATCH edk2-platforms v2 30/43] Platform/Hisilicon/D06: Add OemNicConfig2P Driver

2018-08-22 Thread Leif Lindholm
On Tue, Aug 14, 2018 at 04:08:50PM +0800, Ming Huang wrote:
> This Driver provide Get/Set Mac function.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 

Reviewed-by: Leif Lindholm 

> ---
>  Platform/Hisilicon/D06/D06.dsc |  2 
> +-
>  Platform/Hisilicon/D06/D06.fdf |  2 
> +-
>  Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.inf | 43 
> 
>  Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig.h | 25 
> +++
>  Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.c   | 71 
> 
>  5 files changed, 141 insertions(+), 2 deletions(-)
> 
> diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc
> index e18badf3b3..5571028f42 100644
> --- a/Platform/Hisilicon/D06/D06.dsc
> +++ b/Platform/Hisilicon/D06/D06.dsc
> @@ -285,7 +285,7 @@
>#
>ArmPkg/Drivers/CpuDxe/CpuDxe.inf
>MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
> -
> +  Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.inf
>  
>  !if $(SECURE_BOOT_ENABLE) == TRUE
>MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf {
> diff --git a/Platform/Hisilicon/D06/D06.fdf b/Platform/Hisilicon/D06/D06.fdf
> index 5bb779d2e4..184d5d4dcf 100644
> --- a/Platform/Hisilicon/D06/D06.fdf
> +++ b/Platform/Hisilicon/D06/D06.fdf
> @@ -174,7 +174,7 @@ READ_LOCK_STATUS   = TRUE
>INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
>INF Platform/Hisilicon/D06/Drivers/SFC/SfcDxeDriver.inf
>  
> -
> +  INF Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.inf
>INF Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf
>INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
>INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> diff --git 
> a/Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.inf 
> b/Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.inf
> new file mode 100644
> index 00..a91f2b6005
> --- /dev/null
> +++ b/Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.inf
> @@ -0,0 +1,43 @@
> +#/** @file
> +#
> +#Copyright (c) 2016-2018, Hisilicon Limited. All rights reserved.
> +#Copyright (c) 2016-2018, Linaro Limited. 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= 0x0001001A
> +  BASE_NAME  = OemNicConfigPangea
> +  FILE_GUID  = edc95319-ebe9-4c38-96af-1d203fb85231
> +  MODULE_TYPE= DXE_DRIVER
> +  VERSION_STRING = 1.0
> +  ENTRY_POINT= OemNicConfigEntry
> +
> +[Sources.common]
> +  OemNicConfig2P.c
> +
> +[Packages]
> +  MdeModulePkg/MdeModulePkg.dec
> +  MdePkg/MdePkg.dec
> +  Silicon/Hisilicon/HisiPkg.dec
> +
> +[Protocols]
> +  gHisiBoardNicProtocolGuid   ##Produce
> +
> +[LibraryClasses]
> +  DebugLib
> +  IoLib
> +  OemNicLib
> +  UefiBootServicesTableLib
> +  UefiDriverEntryPoint
> +
> +[Depex]
> +  TRUE
> diff --git 
> a/Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig.h 
> b/Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig.h
> new file mode 100644
> index 00..35228fdf1d
> --- /dev/null
> +++ b/Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig.h
> @@ -0,0 +1,25 @@
> +/** @file
> +*
> +*  Copyright (c) 2016-2018, Hisilicon Limited. All rights reserved.
> +*  Copyright (c) 2016-2018, Linaro Limited. 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.
> +*
> +**/
> +
> +#ifndef __OEM_NIC_CONFIG_H__
&

Re: [edk2] [PATCH edk2-platforms v3 22/36] Platform/Hisilicon/D06: Add OemNicLib

2018-08-22 Thread Leif Lindholm
Responding to v3 since that contains some of the things still problematic
in v2.

On 16 August 2018 at 13:12, Ming Huang  wrote:
>
> OemNicLib provide nic related api like GetMac,SetMac.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> ---
>  Platform/Hisilicon/D06/D06.dsc |   1 +
>  Platform/Hisilicon/D06/Library/OemNicLib/OemNicLib.inf |  35 ++
>  Platform/Hisilicon/D06/Library/OemNicLib/OemNicLib.c   | 570

>  3 files changed, 606 insertions(+)
>
> diff --git a/Platform/Hisilicon/D06/D06.dsc
b/Platform/Hisilicon/D06/D06.dsc
> index 06249d8a5b..e18badf3b3 100644
> --- a/Platform/Hisilicon/D06/D06.dsc
> +++ b/Platform/Hisilicon/D06/D06.dsc
> @@ -90,6 +90,7 @@
>
>LpcLib|Silicon/Hisilicon/Hi1620/Library/LpcLibHi1620/LpcLib.inf
>
 SerialPortLib|ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf
> +  OemNicLib|Platform/Hisilicon/D06/Library/OemNicLib/OemNicLib.inf
>  !if $(SECURE_BOOT_ENABLE) == TRUE
>
 FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
>  !endif
> diff --git a/Platform/Hisilicon/D06/Library/OemNicLib/OemNicLib.inf
b/Platform/Hisilicon/D06/Library/OemNicLib/OemNicLib.inf
> new file mode 100644
> index 00..3b0bd2d60c
> --- /dev/null
> +++ b/Platform/Hisilicon/D06/Library/OemNicLib/OemNicLib.inf
> @@ -0,0 +1,35 @@
> +#/** @file
> +#
> +#Copyright (c) 2018, Hisilicon Limited. All rights reserved.
> +#Copyright (c) 2017, Linaro Limited. 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= 0x0001001A
> +  BASE_NAME  = OemNicLib
> +  FILE_GUID  = 520F872C-FFCF-4EF3-AC01-85BDB0816DCE
> +  MODULE_TYPE= BASE
> +  VERSION_STRING = 1.0
> +  LIBRARY_CLASS  = OemNicLib
> +
> +[Sources.common]
> +  OemNicLib.c
> +
> +[Packages]
> +  ArmPkg/ArmPkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +  MdePkg/MdePkg.dec
> +  Silicon/Hisilicon/HisiPkg.dec
> +
> +[LibraryClasses]
> +  CpldIoLib
> +  I2CLib
> diff --git a/Platform/Hisilicon/D06/Library/OemNicLib/OemNicLib.c
b/Platform/Hisilicon/D06/Library/OemNicLib/OemNicLib.c
> new file mode 100644
> index 00..aa75617092
> --- /dev/null
> +++ b/Platform/Hisilicon/D06/Library/OemNicLib/OemNicLib.c
> @@ -0,0 +1,570 @@
> +/** @file
> +*
> +*  Copyright (c) 2018, Hisilicon Limited. All rights reserved.
> +*  Copyright (c) 2017, Linaro Limited. 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.
> +*
> +**/
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#define CPU2_SFP2_100G_CARD_OFFSET   0x25
> +#define CPU1_SFP1_LOCATE_OFFSET  0x16
> +#define CPU1_SFP0_LOCATE_OFFSET  0x12
> +#define CPU2_SFP1_LOCATE_OFFSET  0x21
> +#define CPU2_SFP0_LOCATE_OFFSET  0x19
> +#define CPU2_SFP2_10G_GE_CARD_OFFSET 0x25
> +
> +#define SFP_10G_SPEED   10
> +#define SFP_25G_SPEED   25
> +#define SFP_100G_SPEED  100
> +#define SFP_GE_SPEED1
> +
> +#define SFP_GE_SPEED_VAL_VENDOR_FINISAR 0x0C
> +#define SFP_GE_SPEED_VAL0x0D
> +#define SFP_10G_SPEED_VAL   0x67
> +#define SFP_25G_SPEED_VAL   0xFF
> +
> +#define CARD_PRESENT_100G   (BIT7)
> +#define CARD_PRESENT_10G(BIT0)
> +#define SELECT_SFP_BY_INDEX(index)  (1 << (index - 1))
> +#define SPF_SPEED_OFFSET12
> +
> +#define SFP_DEVICE_ADDRESS 0x50
> +#define CPU1_9545_I2C_ADDR 0x70
> +#define CPU2_9545_I2C_ADDR 0x71
> +
> +#define FIBER_PRESENT 0
> +#define CARD_PRESENT  1
> +#define I2C_PORT_SFP  4
> +#define CPU2_I2C_PORT_SFP 5
> +
> +#define SOCKET_0 0
> +#define SOCKET_1 1
> +#define EEPROM_I2C_PORT  4
> +#define EEPROM_PAGE_SIZE 0x40
> +#define MAC_ADDR_LEN 6
> +#define I2C_OFFSET_EEPROM_ETH0   (0xc00)
> +#define I2C_SLAVEADDR_EEPROM (0x52)
> +
> +#pragma pack(1)
> +typedef struct {
> +  UINT16 Crc16;
> +  UINT16 MacLen;
> +  UINT8  Mac[MAC_ADDR_LEN];
> +} NIC_MAC_ADDRESS;
> +#pragma pack()

Re: [edk2] [PATCH edk2-platforms v2 28/43] Platform/Hisilicon/D06: Enable ACPI PPTT

2018-08-22 Thread Leif Lindholm
On Tue, Aug 14, 2018 at 04:08:48PM +0800, Ming Huang wrote:
> From: Heyi Guo 
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Heyi Guo 

Replace Heyi's Signed-off-by with your own.
Then
Reviewed-by: Leif Lindholm 


> ---
>  Platform/Hisilicon/D06/D06.dsc | 1 +
>  Platform/Hisilicon/D06/D06.fdf | 2 ++
>  2 files changed, 3 insertions(+)
> 
> diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc
> index bec422670d..06249d8a5b 100644
> --- a/Platform/Hisilicon/D06/D06.dsc
> +++ b/Platform/Hisilicon/D06/D06.dsc
> @@ -338,6 +338,7 @@
>Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/AcpiTablesHi1620.inf
>Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
>  
> +  Silicon/Hisilicon/Hi1620/Pptt/Pptt.inf
>#
># Usb Support
>#
> diff --git a/Platform/Hisilicon/D06/D06.fdf b/Platform/Hisilicon/D06/D06.fdf
> index 06203dc079..5bb779d2e4 100644
> --- a/Platform/Hisilicon/D06/D06.fdf
> +++ b/Platform/Hisilicon/D06/D06.fdf
> @@ -252,6 +252,8 @@ READ_LOCK_STATUS   = TRUE
>INF RuleOverride=ACPITABLE 
> Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/AcpiTablesHi1620.inf
>INF Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
>  
> +  INF Silicon/Hisilicon/Hi1620/Pptt/Pptt.inf
> +
>#
>#Network
>#
> -- 
> 2.17.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v2 27/43] Hisilicon/Hi1620: Add ACPI PPTT table

2018-08-22 Thread Leif Lindholm
On Tue, Aug 14, 2018 at 04:08:47PM +0800, Ming Huang wrote:
> From: Heyi Guo 
> 
> This driver fetches information from MADT,  so it is adaptable for
> partial good and 1P/2P, since MADT is updated for different
> configurations by certain mechanism.
> 
> Since L2 cache is also private resource of core, so we need to set the
> next level of cache for L1I and L1D, which is important for OS to
> parse cache hierarchy.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Heyi Guo 

No, Signed-off-by: Ming Huang 
You are signing off on these patches being correclty licensed and
permitted to contribute under the Contribution agreement.
The above is equivalent to "Heyi says it's fine".

"Heyi wrote this code" is reflected through the From: tag above.

Looking back, I notice this is true for many patches in the set.
Please address throughout v4.

I have no further comment on this patch, so with that change:
Reviewed-by: Leif Lindholm 

> ---
>  Silicon/Hisilicon/Hi1620/Pptt/Pptt.inf |  48 ++
>  Silicon/Hisilicon/Hi1620/Pptt/Pptt.h   |  68 +++
>  Silicon/Hisilicon/Hi1620/Pptt/Pptt.c   | 543 
>  3 files changed, 659 insertions(+)
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v2 26/43] Silicon/Hisilicon/Setup: Add Setup Item "EnableGOP"

2018-08-22 Thread Leif Lindholm
On Tue, Aug 14, 2018 at 04:08:46PM +0800, Ming Huang wrote:
> From: Yang XinYi 
> 
> Add Setup Item "EnableGOP" for D06, This Item only takes
> effect on VGA device SM750.

Feedback on v1 was:
What is SM750? Please add more detail to commit message.

Please address.

Rest of patch is fine.

/
Leif

> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Yang XinYi 
> ---
>  Silicon/Hisilicon/Include/Library/OemConfigData.h| 1 +
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.c| 1 +
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.hfr | 7 +++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.uni | 4 ++--
>  4 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/Silicon/Hisilicon/Include/Library/OemConfigData.h 
> b/Silicon/Hisilicon/Include/Library/OemConfigData.h
> index 478821ae2c..e4d5917046 100644
> --- a/Silicon/Hisilicon/Include/Library/OemConfigData.h
> +++ b/Silicon/Hisilicon/Include/Library/OemConfigData.h
> @@ -61,6 +61,7 @@ typedef struct {
>UINT8 EnableSmmu;
>UINT8 EnableFdtTable;
>UINT8 EnableSpcr;
> +  UINT8 EnableGOP;
>/*RAS Config*/
>UINT8 EnRasSupport;
>UINT8 EnPoison;
> diff --git a/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.c 
> b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.c
> index 1e3635307c..3ecae3759a 100644
> --- a/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.c
> +++ b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.c
> @@ -295,6 +295,7 @@ OemConfigUiLibConstructor (
>Configuration.EnableSmmu = 1;
>Configuration.EnableFdtTable = 0;
>Configuration.EnableSpcr = 0;
> +  Configuration.EnableGOP = 0;
>//
>//Set the default value of the Ras option
>//
> diff --git a/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.hfr 
> b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.hfr
> index 9e3ac73116..c0b6e294a6 100644
> --- a/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.hfr
> +++ b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.hfr
> @@ -38,4 +38,11 @@ form formid = MISC_CONFIG_FORM_ID,
>option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = 0;
>  endoneof;
>  
> +oneof varid   = OEM_CONFIG_DATA.EnableGOP,
> +  prompt  = STRING_TOKEN(STR_ENABLE_GOP_FRAME_BUFFER),
> +  help= STRING_TOKEN(STR_ENABLE_GOP_FRAME_BUFFER_HELP),
> +  option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = DEFAULT;
> +  option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = 0;
> +endoneof;
> +
>  endform;
> diff --git a/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.uni 
> b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.uni
> index 53eb1622c4..2fd92fedff 100644
> --- a/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.uni
> +++ b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.uni
> @@ -23,5 +23,5 @@
>  #string STR_FDT_CONFIG_HELP#language en-US  "Enable or Disable 
> Fdt Table."
>  #string STR_ENABLE_SPCR_TABLE  #language en-US  "Support SPCR"
>  #string STR_ENABLE_SPCR_HELP   #language en-US  "Enable or Disable 
> SPCR Table."
> -#string STR_ENABLE_GOP_FRAME_BUFFER#language en-US  "Support GOP FB"
> -#string STR_ENABLE_GOP_FRAME_BUFFER_HELP #language en-US  "Enable or 
> Disable GOP frame buffer."
> +#string STR_ENABLE_GOP_FRAME_BUFFER#language en-US  "Support GOP FB for 
> SM750"
> +#string STR_ENABLE_GOP_FRAME_BUFFER_HELP #language en-US  "Enable or 
> Disable GOP frame buffer for SM750."
> -- 
> 2.17.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v2 25/43] Silicon/Hisilicon/D06: Optimize HNS config CDR post time

2018-08-22 Thread Leif Lindholm
On Tue, Aug 14, 2018 at 04:08:45PM +0800, Ming Huang wrote:
> From: shaochangliang 
> 
> Use I2C 400KB speed for config CDR.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 

The start of the subject line is supposed to reflect the code that is
being modified - not the platform you are doing it for. Drop D06,
mention I2CLib.

All of these patches should go in before the first D06 one.

With those changes:
Reviewed-by: Leif Lindholm 

> ---
>  Silicon/Hisilicon/Library/I2CLib/I2CLib.c | 9 -
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/Silicon/Hisilicon/Library/I2CLib/I2CLib.c 
> b/Silicon/Hisilicon/Library/I2CLib/I2CLib.c
> index ed44ac204f..55c030a3af 100644
> --- a/Silicon/Hisilicon/Library/I2CLib/I2CLib.c
> +++ b/Silicon/Hisilicon/Library/I2CLib/I2CLib.c
> @@ -28,6 +28,9 @@
>  #include "I2CLibInternal.h"
>  #include "I2CHw.h"
>  
> +#define I2C_100KB_SPEED 0x1
> +#define I2C_400KB_SPEED 0x2
> +
>  VOID
>  I2C_Delay (
>UINT32 Count
> @@ -158,7 +161,11 @@ I2CInit (
>  
>I2C_REG_READ (Base + I2C_CON_OFFSET, I2cControlReg.Val32);
>I2cControlReg.bits.master = 1;
> -  I2cControlReg.bits.Speed = 0x1;
> +  if(SpeedMode == Normal) {
> +I2cControlReg.bits.Speed = I2C_100KB_SPEED;
> +  } else {
> +I2cControlReg.bits.Speed = I2C_400KB_SPEED;
> +  }
>I2cControlReg.bits.restart_en = 1;
>I2cControlReg.bits.slave_disable = 1;
>I2C_REG_WRITE (Base + I2C_CON_OFFSET, I2cControlReg.Val32);
> -- 
> 2.17.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v2 23/43] Silicon/Hisilicon/D06: Add I2C delay for HNS auto config

2018-08-22 Thread Leif Lindholm
On Tue, Aug 14, 2018 at 04:08:43PM +0800, Ming Huang wrote:
> Because I2C Port5 salve device connect under I2C extender
> (9545 device), it will cost more time to access I2C slave
> device, so add delay time for HNS auto config.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> ---
>  Silicon/Hisilicon/Library/I2CLib/I2CHw.h  |  3 +++
>  Silicon/Hisilicon/Library/I2CLib/I2CLib.c | 21 +++-
>  2 files changed, 19 insertions(+), 5 deletions(-)

Like previous patch, please change subject line - this affects d03,
d05, d06.

Silicon/Hisilicon: Add I2CLib delay for HNS auto config

> diff --git a/Silicon/Hisilicon/Library/I2CLib/I2CHw.h 
> b/Silicon/Hisilicon/Library/I2CLib/I2CHw.h
> index fa954c7937..d77aea509e 100644
> --- a/Silicon/Hisilicon/Library/I2CLib/I2CHw.h
> +++ b/Silicon/Hisilicon/Library/I2CLib/I2CHw.h
> @@ -19,6 +19,9 @@
>  #include 
>  #include 
>  
> +// The HNS I2C port 5 is under I2C extender
> +#define I2C_EXTENDER_PORT_HNS5
> +
>  #define I2C_READ_TIMEOUT 500
>  #define I2C_DRV_ONCE_WRITE_BYTES_NUM 8
>  #define I2C_DRV_ONCE_READ_BYTES_NUM  8
> diff --git a/Silicon/Hisilicon/Library/I2CLib/I2CLib.c 
> b/Silicon/Hisilicon/Library/I2CLib/I2CLib.c
> index d67ddc7f9b..59633106ce 100644
> --- a/Silicon/Hisilicon/Library/I2CLib/I2CLib.c
> +++ b/Silicon/Hisilicon/Library/I2CLib/I2CLib.c
> @@ -258,8 +258,13 @@ CheckI2CTimeOut (
>if (Transfer == I2CTx) {
>  Fifo = I2C_GetTxStatus (Socket, Port);
>  while (Fifo != 0) {
> -  // This is a empirical value for I2C delay. MemoryFance is no need 
> here.
> -  I2C_Delay (2);
> +  if (Port == I2C_EXTENDER_PORT_HNS) {
> +// This is a empirical value for I2C delay. MemoryFance is no need 
> here.

MemoryFance ->
MemoryFence

(You may want to search and replace that on the whole set.)

With that:
Reviewed-by: Leif Lindholm 

/
Leif

> +I2C_Delay (1000);
> +  } else {
> +// This is a empirical value for I2C delay. MemoryFance is no need 
> here.
> +I2C_Delay (2);
> +  }
>if (++Times > I2C_READ_TIMEOUT) {
>  (VOID)I2C_Disable (Socket, Port);
>  return EFI_TIMEOUT;
> @@ -269,8 +274,13 @@ CheckI2CTimeOut (
>} else {
>  Fifo = I2C_GetRxStatus (Socket, Port);
>  while (Fifo == 0) {
> -  // This is a empirical value for I2C delay. MemoryFance is no need 
> here.
> -  I2C_Delay (2);
> +  if (Port == I2C_EXTENDER_PORT_HNS) {
> +// This is a empirical value for I2C delay. MemoryFance is no need 
> here.
> +I2C_Delay (1000);
> +  } else {
> +// This is a empirical value for I2C delay. MemoryFance is no need 
> here.
> +I2C_Delay (2);
> +  }
>if (++Times > I2C_READ_TIMEOUT) {
>  (VOID)I2C_Disable (Socket, Port);
>  return EFI_TIMEOUT;
> @@ -369,7 +379,8 @@ I2CWrite(
>  Times = 0;
>  Fifo = I2C_GetTxStatus (I2cInfo->Socket, I2cInfo->Port);
>  while (Fifo > I2C_TXRX_THRESHOLD) {
> -  I2C_Delay (2);
> +  // This is a empirical value for I2C delay. MemoryFance is no need 
> here.
> +  I2C_Delay (1000);
>if (++Times > I2C_READ_TIMEOUT) {
>  (VOID)I2C_Disable (I2cInfo->Socket, I2cInfo->Port);
>  return EFI_TIMEOUT;
> -- 
> 2.17.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v2 22/43] Silicon/Hisilicon/D06: Fix I2C enable fail issue for D06

2018-08-22 Thread Leif Lindholm
On Tue, Aug 14, 2018 at 04:08:42PM +0800, Ming Huang wrote:
> I2C may enable failed in D06, so retry I2C enable while
> enable failed.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> ---
>  Silicon/Hisilicon/Library/I2CLib/I2CLib.c | 18 --
>  1 file changed, 12 insertions(+), 6 deletions(-)

Please change subject line to:
Silicon/Hisilicon: Fix I2CLib enable fail issue
and reorder it before the first D06 patch.

With that:
Reviewed-by: Leif Lindholm 

> diff --git a/Silicon/Hisilicon/Library/I2CLib/I2CLib.c 
> b/Silicon/Hisilicon/Library/I2CLib/I2CLib.c
> index 9174e50dd4..d67ddc7f9b 100644
> --- a/Silicon/Hisilicon/Library/I2CLib/I2CLib.c
> +++ b/Silicon/Hisilicon/Library/I2CLib/I2CLib.c
> @@ -86,6 +86,7 @@ I2C_Enable (
>  {
>I2C0_ENABLE_U   I2cEnableReg;
>I2C0_ENABLE_STATUS_UI2cEnableStatusReg;
> +  UINT32  TimeCnt = I2C_READ_TIMEOUT;
>  
>UINTN Base = GetI2cBase (Socket, Port);
>  
> @@ -93,13 +94,18 @@ I2C_Enable (
>I2cEnableReg.bits.enable = 1;
>I2C_REG_WRITE (Base + I2C_ENABLE_OFFSET, I2cEnableReg.Val32);
>  
> +  do {
> +// This is a empirical value for I2C delay. MemoryFance is no need here.
> +I2C_Delay (1);
>  
> -  I2C_REG_READ (Base + I2C_ENABLE_STATUS_OFFSET, I2cEnableStatusReg.Val32);
> -  if (I2cEnableStatusReg.bits.ic_en == 1) {
> -return EFI_SUCCESS;
> -  } else {
> -return EFI_DEVICE_ERROR;
> -  }
> +TimeCnt--;
> +I2C_REG_READ (Base + I2C_ENABLE_STATUS_OFFSET, I2cEnableStatusReg.Val32);
> +if (TimeCnt == 0) {
> +  return EFI_DEVICE_ERROR;
> +}
> +  } while (I2cEnableStatusReg.bits.ic_en == 0);
> +
> +  return EFI_SUCCESS;
>  }
>  
>  VOID
> -- 
> 2.17.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v2 19/43] Silicon/Hisilicon/D06: Stop watchdog

2018-08-22 Thread Leif Lindholm
On Tue, Aug 14, 2018 at 04:08:39PM +0800, Ming Huang wrote:
> according as watchdog design on D06, watchdog should be
> stopped before boot a option.
> 
> This is an out of band watchdog timer in BMC; it is used
> to monitor the whole BIOS boot process and reset the system
> in case BIOS hangs somewhere, i.e. it is armed when system
> is power on, and disabled before handling system control to
> OS, while UEFI boot services watchdog is only armed before
> invoking a boot option. So they are two different watchdogs.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 

Reviewed-by: Leif Lindholm 

> ---
>  Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf 
> |  2 ++
>  Silicon/Hisilicon/Include/Library/IpmiCmdLib.h  
> | 16 ++
>  Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c   
> | 22 
>  3 files changed, 40 insertions(+)
> 
> diff --git 
> a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf 
> b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> index a093f13fb0..b9458b0ade 100644
> --- 
> a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> +++ 
> b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> @@ -46,6 +46,7 @@
>DebugLib
>DevicePathLib
>DxeServicesLib
> +  IpmiCmdLib
>MemoryAllocationLib
>PcdLib
>PrintLib
> @@ -69,6 +70,7 @@
>gEfiEndOfDxeEventGroupGuid
>gEfiTtyTermGuid
>gHisiOemVariableGuid
> +  gOemConfigGuid
>  
>  [Protocols]
>gEfiGenericMemTestProtocolGuid
> diff --git a/Silicon/Hisilicon/Include/Library/IpmiCmdLib.h 
> b/Silicon/Hisilicon/Include/Library/IpmiCmdLib.h
> index 8868b76135..b956ee6d07 100644
> --- a/Silicon/Hisilicon/Include/Library/IpmiCmdLib.h
> +++ b/Silicon/Hisilicon/Include/Library/IpmiCmdLib.h
> @@ -19,6 +19,17 @@
>  #define BOOT_OPTION_BOOT_FLAG_VALID 1
>  #define BOOT_OPTION_BOOT_FLAG_INVALID   0
>  
> +typedef enum {
> +  EfiReserved,
> +  EfiBiosFrb2,
> +  EfiBiosPost,
> +  EfiOsLoad,
> +  EfiSmsOs,
> +  EfiOem,
> +  EfiFrbReserved1,
> +  EfiFrbReserved2
> +} EFI_WDT_USER_TYPE;
> +
>  typedef enum {
>NoOverride = 0x0,
>ForcePxe,
> @@ -91,4 +102,9 @@ IpmiCmdGetSysBootOptions (
>IN IPMI_GET_BOOT_OPTION   *BootOption
>);
>  
> +EFI_STATUS
> +IpmiCmdStopWatchdogTimer (
> +  IN EFI_WDT_USER_TYPE  UserType
> +  );
> +
>  #endif
> diff --git a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c 
> b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c
> index d5f6d78fa4..b63818cbe4 100644
> --- a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c
> +++ b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c
> @@ -19,6 +19,8 @@
>  #include 
>  #include 
>  #include 
> +#include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -615,6 +617,8 @@ PlatformBootManagerAfterConsole (
>  {
>EFI_STATUS Status;
>ESRT_MANAGEMENT_PROTOCOL   *EsrtManagement = NULL;
> +  OEM_CONFIG_DATASetupData;
> +  UINTN  DataSize = sizeof (OEM_CONFIG_DATA);
>  
>//
>// Show the splash screen.
> @@ -651,6 +655,24 @@ PlatformBootManagerAfterConsole (
>  );
>  
>HandleBmcBootType ();
> +
> +  //Disable POST Watch Dog before attempting boot
> +  Status = gRT->GetVariable (
> +  OEM_CONFIG_NAME,
> +  ,
> +  NULL,
> +  ,
> +  
> +  );
> +
> +  if (!EFI_ERROR (Status)) {
> +if (SetupData.BmcWdtEnable) {
> +  Status = IpmiCmdStopWatchdogTimer (EfiBiosPost);
> +  if (EFI_ERROR (Status)) {
> +DEBUG ((DEBUG_ERROR, "%a:%r\n", __FUNCTION__, Status));
> +  }
> +}
> +  }
>  }
>  
>  /**
> -- 
> 2.17.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v2 18/43] Hisilicon/D06: Add Hi1620OemConfigUiLib

2018-08-22 Thread Leif Lindholm
On Tue, Aug 14, 2018 at 04:08:38PM +0800, Ming Huang wrote:
> From: Yang XinYi 
> 
> This library is added for oem setup menu item.
> Setup item include:
> 1 DDR option item;
> 2 BMC option item;
> 3 Ras option item;
> 4 Misc option item;
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Yang XinYi 
> ---
>  Silicon/Hisilicon/HisiPkg.dec   |   
> 1 +
>  Platform/Hisilicon/D06/D06.dsc  |   
> 5 +-
>  Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf   |   
> 2 +-
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUiLib.inf|  
> 68 
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.h   | 
> 142 
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUi.h |  
> 64 
>  Silicon/Hisilicon/Include/Library/OemConfigData.h   |  
> 84 +
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.c   | 
> 363 
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MemoryConfig.hfr  | 
> 154 +
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MemoryConfig.uni  | 
> 103 ++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.hfr|  
> 41 +++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.uni|  
> 27 ++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUiLib.uni|  
> 24 ++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUiLibStrings.uni |  
> 42 +++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigVfr.Vfr  |  
> 89 +

Ah, I didn't spot thie before - but can you please rename this one
from
.Vfr to
.vfr

to align with the others?

>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/PcieConfig.hfr| 
> 219 
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/PcieConfigStrings.uni | 
> 111 ++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/PciePortConfig.hfr| 
> 167 +
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/RasConfig.hfr | 
> 172 ++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/RasConfig.uni |  
> 85 +
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/iBMCConfig.hfr|  
> 81 +
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/iBMCConfig.uni|  
> 34 ++
>  22 files changed, 2076 insertions(+), 2 deletions(-)
> 
> diff --git a/Silicon/Hisilicon/HisiPkg.dec b/Silicon/Hisilicon/HisiPkg.dec
> index b56a6a6af7..858b840a57 100644
> --- a/Silicon/Hisilicon/HisiPkg.dec
> +++ b/Silicon/Hisilicon/HisiPkg.dec
> @@ -44,6 +44,7 @@
>gHisiTokenSpaceGuid = {0xc8bc553e, 0x12bf, 0x11e6, {0x97, 0x4f, 0x87, 
> 0xf7, 0x7c, 0xfd, 0x52, 0x1d}}
>  
>gHisiEfiMemoryMapGuid  = {0xf8870015, 0x6994, 0x4b98, {0x95, 0xa2, 0xbd, 
> 0x56, 0xda, 0x91, 0xc0, 0x7f}}
> +  gOemConfigGuid = {0x42927b59, 0x58fc, 0x41be, {0x8f, 0x59, 0xd1, 0x7c, 
> 0x02, 0x1a, 0x70, 0x13}}
>gVersionInfoHobGuid = {0xe13a14c, 0x859c, 0x4f22, {0x82, 0xbd, 0x18, 0xe, 
> 0xe1, 0x42, 0x12, 0xbf}}
>gHisiOemVariableGuid = {0xac62b9a5, 0x9939, 0x41d3, {0xff, 0x5c, 0xc5, 
> 0x80, 0x32, 0x7d, 0x9b, 0x29}}
>gOemBootVariableGuid = {0xb7784577, 0x5aaf, 0x4557, {0xa1, 0x99, 0xd4, 
> 0xa4, 0x2f, 0x45, 0x06, 0xf8}}
> diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc
> index 9d4a86a4f4..bec422670d 100644
> --- a/Platform/Hisilicon/D06/D06.dsc
> +++ b/Platform/Hisilicon/D06/D06.dsc
> @@ -330,7 +330,10 @@
>#ACPI
>#
>MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
> -  Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
> +  Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf {
> +
> +NULL|Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUiLib.inf
> +  }
>  
>Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/AcpiTablesHi1620.inf
>Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
> diff --git 
> a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf 
> b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
> index e268a56bbd..281a4f2ebd 100644
> --- a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
> +++ b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
> @@ -56,7 +56,7 @@
>gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiTableStorageFile## CONSUMES
>  
>  [Depex]
> -  gEfiAcpiTableProtocolGuid
> +  gEfiAcpiTableProtocolGuid AND gEfiVariableWriteArchProtocolGuid
>  
>  [UserExtensions.TianoCore."ExtraFiles"]
>AcpiPlatformExtra.uni
> diff --git a/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUiLib.inf 
> b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUiLib.inf
> new file mode 100644
> index 00..fba619e9ba
> --- /dev/null
> +++ b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUiLib.inf
> @@ -0,0 +1,68 @@
> +## @file
> +#  

Re: [edk2] [PATCH edk2-platforms v2 17/43] Hisilicon/D06: Add ACPI Tables for D06

2018-08-22 Thread Leif Lindholm
On Tue, Aug 14, 2018 at 04:08:37PM +0800, Ming Huang wrote:
> ACPI tables for D06 2P, especially,Hi1620Iort.asl is include smmu
> and Hi1620IortNoSmmu.asl is without smmu.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 

As per last feedback:
Reviewed-by: Leif Lindholm 

(The only modification I asked for has been done.)

> ---
>  Platform/Hisilicon/D06/D06.dsc  |
> 1 +
>  Platform/Hisilicon/D06/D06.fdf  |
> 1 +
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/AcpiTablesHi1620.inf  |   
> 59 +
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Hi1620Platform.h  |   
> 27 +
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Dsdt/CPU.asl  |  
> 409 
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Dsdt/Com.asl  |   
> 30 +
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Dsdt/DsdtHi1620.asl   |   
> 35 +
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Dsdt/Hi1620Apei.asl   |   
> 93 +
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Dsdt/Hi1620Ged.asl|   
> 58 +
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Dsdt/Hi1620Mbig.asl   | 
> 1459 ++
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Dsdt/Hi1620Mctp.asl   |   
> 41 +
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Dsdt/Hi1620Pci.asl| 
> 1216 
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Dsdt/Hi1620Power.asl  |   
> 28 +
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Dsdt/Hi1620Rde.asl|   
> 47 +
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Dsdt/Hi1620Sec.asl|   
> 57 +
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Dsdt/Hi1620Socip4_i2c100k.asl |  
> 249 +++
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Dsdt/Hi1620Socip4_i2c400k.asl |  
> 249 +++
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Dsdt/LpcUart_clk.asl  |   
> 49 +
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Dsdt/Pv680UncorePmu.asl   | 
> 1658 
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Dsdt/ipmi.asl |   
> 49 +
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Facs.aslc |   
> 67 +
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Fadt.aslc |   
> 91 +
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Gtdt.aslc |   
> 86 +
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Hi1620Dbg2.aslc   |   
> 86 +
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Hi1620Iort.asl| 
> 1989 
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Hi1620IortNoSmmu.asl  | 
> 1736 +
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Hi1620Mcfg.aslc   |   
> 64 +
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Hi1620Slit.aslc   |   
> 64 +
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Hi1620Spcr.aslc   |   
> 81 +
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Hi1620Srat.aslc   |  
> 166 ++
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/MadtHi1620.aslc   |  
> 375 
>  31 files changed, 10620 insertions(+)
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v2 16/43] Hisilicon/D06: Add Debug Serial Port Init Driver

2018-08-22 Thread Leif Lindholm
On Tue, Aug 14, 2018 at 04:08:36PM +0800, Ming Huang wrote:
> From: Heyi Guo 
> 
> Hi1620 have two physical PL011 serial ports on the board,
> one for serial port console (described by ACPI SPCR) and
> the other for standard debug port (described by ACPI DBG2).
> This driver is to initialize the debug UART, not the serial
> console.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Heyi Guo 

Reviewed-by: Leif Lindholm 

> ---
>  Platform/Hisilicon/D06/D06.dsc   
> |  1 +
>  Platform/Hisilicon/D06/D06.fdf   
> |  1 +
>  
> Silicon/Hisilicon/Hi1620/Drivers/Pl011DebugSerialPortInitDxe/Pl011DebugSerialPortInitDxe.inf
>  | 48 +++
>  
> Silicon/Hisilicon/Hi1620/Drivers/Pl011DebugSerialPortInitDxe/Pl011DebugSerialPortInitDxe.c
>| 64 
>  4 files changed, 114 insertions(+)
> 
> diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc
> index 9ca7160dad..20d2d2a1b4 100644
> --- a/Platform/Hisilicon/D06/D06.dsc
> +++ b/Platform/Hisilicon/D06/D06.dsc
> @@ -422,6 +422,7 @@
># Memory test
>#
>MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf
> +  
> Silicon/Hisilicon/Hi1620/Drivers/Pl011DebugSerialPortInitDxe/Pl011DebugSerialPortInitDxe.inf
>MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
>MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
>MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> diff --git a/Platform/Hisilicon/D06/D06.fdf b/Platform/Hisilicon/D06/D06.fdf
> index 07fe096f61..8cac126ccf 100644
> --- a/Platform/Hisilicon/D06/D06.fdf
> +++ b/Platform/Hisilicon/D06/D06.fdf
> @@ -303,6 +303,7 @@ READ_LOCK_STATUS   = TRUE
>INF MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
>INF MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
>  
> +  INF 
> Silicon/Hisilicon/Hi1620/Drivers/Pl011DebugSerialPortInitDxe/Pl011DebugSerialPortInitDxe.inf
>INF MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf
>#
># Build Shell from latest source code instead of prebuilt binary
> diff --git 
> a/Silicon/Hisilicon/Hi1620/Drivers/Pl011DebugSerialPortInitDxe/Pl011DebugSerialPortInitDxe.inf
>  
> b/Silicon/Hisilicon/Hi1620/Drivers/Pl011DebugSerialPortInitDxe/Pl011DebugSerialPortInitDxe.inf
> new file mode 100644
> index 00..8c91bdf0f4
> --- /dev/null
> +++ 
> b/Silicon/Hisilicon/Hi1620/Drivers/Pl011DebugSerialPortInitDxe/Pl011DebugSerialPortInitDxe.inf
> @@ -0,0 +1,48 @@
> +#/** @file
> +#
> +#Copyright (c) 2016 - 2018, Hisilicon Limited. All rights reserved.
> +#Copyright (c) 2016 - 2018, Linaro Limited. 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= 0x0001001A
> +  BASE_NAME  = Pl011DebugSerialPortInitDxe
> +  FILE_GUID  = 16D53E86-7EA4-47bd-861F-511EA9B8ABE0
> +  MODULE_TYPE= DXE_DRIVER
> +  VERSION_STRING = 1.0
> +  ENTRY_POINT= SerialPortEntry
> +
> +[Sources.common]
> +  Pl011DebugSerialPortInitDxe.c
> +
> +
> +[Packages]
> +  ArmPlatformPkg/ArmPlatformPkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +  MdePkg/MdePkg.dec
> +  Silicon/Hisilicon/HisiPkg.dec
> +
> +[LibraryClasses]
> +  BaseLib
> +  UefiDriverEntryPoint
> +
> +[Pcd]
> +  gArmPlatformTokenSpaceGuid.PL011UartClkInHz
> +  gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
> +  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate
> +  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits
> +  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity
> +  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits
> +
> +[Depex]
> +  TRUE
> +
> diff --git 
> a/Silicon/Hisilicon/Hi1620/Drivers/Pl011DebugSerialPortInitDxe/Pl011DebugSerialPortInitDxe.c
>  
> b/Silicon/Hisilicon/Hi1620/Drivers/Pl011DebugSerialPortInitDxe/Pl011DebugSerialPortInitDxe.c
> new file mode 100644
> index 00..8f83737327
> --- /dev/null
> +++ 
> b/Silicon/Hisilicon/Hi1620/Drivers/Pl011DebugSerialPortInitDxe/Pl011DebugSerialPortInitDxe.c
> @@ -0,0 +1,64 @@
> +/** @file

Re: [edk2] [PATCH edk2-platforms v2 15/43] Silicon/Hisilicon/Acpi: Unify HisiAcipPlatformDxe

2018-08-22 Thread Leif Lindholm
On Tue, Aug 14, 2018 at 04:08:35PM +0800, Ming Huang wrote:
> The EFI_ACPI_STATIC_RESOURCE_AFFINITY_TABLE struct is used by
> UpdateAcpiTable.c and Srat aslc. The struct may be different
> according to chips, so move some macro to PlatformArch.h.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 

I told you you could have
Reviewed-by: Leif Lindholm 
on this one.

Please add that to all patches where I say that on next submission.

(But also fix the spelling of Acpi in the subject please, I missed
that :)

/
Leif

> ---
>  Silicon/Hisilicon/Hi1610/Include/PlatformArch.h |  6 
>  Silicon/Hisilicon/Hi1620/Include/PlatformArch.h |  6 
>  Silicon/Hisilicon/Include/Library/AcpiNextLib.h | 31 
> ++--
>  Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c |  2 --
>  4 files changed, 34 insertions(+), 11 deletions(-)
> 
> diff --git a/Silicon/Hisilicon/Hi1610/Include/PlatformArch.h 
> b/Silicon/Hisilicon/Hi1610/Include/PlatformArch.h
> index f39ae0748c..1ebddca4e5 100644
> --- a/Silicon/Hisilicon/Hi1610/Include/PlatformArch.h
> +++ b/Silicon/Hisilicon/Hi1610/Include/PlatformArch.h
> @@ -30,6 +30,12 @@
>  // Max NUMA node number for each node type
>  #define MAX_NUM_PER_TYPE 8
>  
> +// for acpi
> +#define NODE_IN_SOCKET  2
> +#define CORE_NUM_PER_SOCKET 32
> +#define EFI_ACPI_MEMORY_AFFINITY_STRUCTURE_COUNT10
> +#define EFI_ACPI_6_2_ITS_AFFINITY_STRUCTURE_COUNT   8
> +
>  #define S1_BASE   0x400
>  
>  #define RASC_BASE(0x5000)
> diff --git a/Silicon/Hisilicon/Hi1620/Include/PlatformArch.h 
> b/Silicon/Hisilicon/Hi1620/Include/PlatformArch.h
> index 9539cfdada..f3ad45f6c6 100644
> --- a/Silicon/Hisilicon/Hi1620/Include/PlatformArch.h
> +++ b/Silicon/Hisilicon/Hi1620/Include/PlatformArch.h
> @@ -57,5 +57,11 @@
>EFI_ACPI_ARM_CREATOR_REVISION   /* UINT32  CreatorRevision */ \
>}
>  
> +// for acpi
> +#define NODE_IN_SOCKET  2
> +#define CORE_NUM_PER_SOCKET 48
> +#define EFI_ACPI_MEMORY_AFFINITY_STRUCTURE_COUNT16
> +#define EFI_ACPI_6_2_ITS_AFFINITY_STRUCTURE_COUNT   1
> +
>  #endif
>  
> diff --git a/Silicon/Hisilicon/Include/Library/AcpiNextLib.h 
> b/Silicon/Hisilicon/Include/Library/AcpiNextLib.h
> index fd05a3b960..2abffb65fc 100644
> --- a/Silicon/Hisilicon/Include/Library/AcpiNextLib.h
> +++ b/Silicon/Hisilicon/Include/Library/AcpiNextLib.h
> @@ -19,6 +19,21 @@
>  #ifndef __ACPI_NEXT_LIB_H__
>  #define __ACPI_NEXT_LIB_H__
>  
> +#include 
> +
> +///
> +/// ITS Affinity Structure Definition
> +///
> +#pragma pack(1)
> +typedef struct {
> +  UINT8   Type;
> +  UINT8   Length;
> +  UINT32  ProximityDomain;
> +  UINT16  Reserved;
> +  UINT32  ItsHwId;
> +} EFI_ACPI_6_2_ITS_AFFINITY_STRUCTURE;
> +#pragma pack()
> +
>  #define EFI_ACPI_6_1_GIC_ITS_INIT(GicITSHwId, GicITSBase) \
>{ \
>  EFI_ACPI_6_1_GIC_ITS, sizeof (EFI_ACPI_6_1_GIC_ITS_STRUCTURE), 
> EFI_ACPI_RESERVED_WORD, \
> @@ -42,8 +57,8 @@
>  #define EFI_ACPI_6_2_ITS_AFFINITY_STRUCTURE_INIT(
>\
>  ProximityDomain, ItsId)  
>\
>{  
>\
> -4, sizeof (EFI_ACPI_6_2_GIC_ITS_AFFINITY_STRUCTURE), ProximityDomain,
>\
> -{EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE}, ItsId  
>  \
> +4, sizeof (EFI_ACPI_6_2_ITS_AFFINITY_STRUCTURE), ProximityDomain,
>\
> +EFI_ACPI_RESERVED_WORD, ItsId
>\
>}
>  
>  #define EFI_ACPI_6_1_MEMORY_AFFINITY_STRUCTURE_INIT( 
>  \
> @@ -75,15 +90,13 @@
>  // Define the number of each table type.
>  // This is where the table layout is modified.
>  //
> -#define EFI_ACPI_PROCESSOR_LOCAL_GICC_AFFINITY_STRUCTURE_COUNT  64
> -#define EFI_ACPI_MEMORY_AFFINITY_STRUCTURE_COUNT10
> -#define EFI_ACPI_6_2_ITS_AFFINITY_STRUCTURE_COUNT   8
> +#define EFI_ACPI_PROCESSOR_LOCAL_GICC_AFFINITY_STRUCTURE_COUNT  
> (MAX_SOCKET*CORE_NUM_PER_SOCKET)
>  
>  typedef struct {
> -  EFI_ACPI_6_0_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER  Header;
> -  EFI_ACPI_6_0_MEMORY_AFFINITY_STRUCTURE  
> Memory[EFI_ACPI_MEMOR

Re: [edk2] [PATCH edk2-platforms v3 07/36] Silicon/Hisilicon/D06: Wait for all disk ready

2018-08-22 Thread Leif Lindholm
(Commenting on the v3 patch since I know it supersedes the v2 patch.)

On Thu, Aug 16, 2018 at 08:12:10PM +0800, Ming Huang wrote:
> This patch is relative to D06 SasDxe driver. The SasDxe set a
> variable to notice this libray. Here Wait for all disk ready
> for 15S at most.
> 
> D06:
> For using straight-through hard disk backboard, some disk need
> 15 seconds to ready. Actually, wait less 15 seconds here(minus
> the time from end of SAS driver to here).
> For using expander backboard, wait less 6 seconds here(minus
> the time from end of SAS driver to here).
> 
> D03/D05:
> As Sas driver don't install PLATFORM_SAS_NOTIFY Protocol, D03/D05
> will skip waiting here.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> ---
>  Silicon/Hisilicon/HisiPkg.dec   
> |  1 +
>  Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf 
> |  3 ++
>  Silicon/Hisilicon/Include/Protocol/PlatformSasNotify.h  
> | 27 ++
>  Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c   
> | 37 
>  4 files changed, 68 insertions(+)
> 
> diff --git a/Silicon/Hisilicon/HisiPkg.dec b/Silicon/Hisilicon/HisiPkg.dec
> index 35bea970ec..0595790df8 100644
> --- a/Silicon/Hisilicon/HisiPkg.dec
> +++ b/Silicon/Hisilicon/HisiPkg.dec
> @@ -39,6 +39,7 @@
>gPlatformSasProtocolGuid = {0x40e9829f, 0x3a2c, 0x479a, {0x9a, 0x93, 0x45, 
> 0x7d, 0x13, 0x50, 0x96, 0x5d}}
>gHisiPlatformSasProtocolGuid = {0x20e9829f, 0x3a2c, 0x479a, {0x9a, 0x93, 
> 0x45, 0x7d, 0x13, 0x50, 0x96, 0x6d}}
>gHisiSnpPlatformProtocolGuid = {0x81321f27, 0xff58, 0x4a1d, {0x99, 0x97, 
> 0xd, 0xcc, 0xfa, 0x82, 0xf4, 0x6f}}
> +  gPlatformSasNotifyProtocolGuid = {0xac62b9a5, 0x9939, 0x41d3, {0xff, 0x5c, 
> 0xc5, 0x80, 0x32, 0x7d, 0x9b, 0x29}}

Ideally, I would like to see a new package declaration file added in
edk2-non-osi/Silicon/Hisilicon. Maybe HisiliconNonOsi.dec. And this
guid added there.

>  
>  [Guids]
>gHisiTokenSpaceGuid = {0xc8bc553e, 0x12bf, 0x11e6, {0x97, 0x4f, 0x87, 
> 0xf7, 0x7c, 0xfd, 0x52, 0x1d}}
> diff --git 
> a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf 
> b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> index 7a53befc44..96a46da8c5 100644
> --- 
> a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> +++ 
> b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> @@ -49,6 +49,7 @@
>MemoryAllocationLib
>PcdLib
>PrintLib
> +  TimerLib
>UefiBootManagerLib
>UefiBootServicesTableLib
>UefiLib
> @@ -67,8 +68,10 @@
>  [Guids]
>gEfiEndOfDxeEventGroupGuid
>gEfiTtyTermGuid
> +  gOemConfigGuid
>  
>  [Protocols]
>gEfiGenericMemTestProtocolGuid
>gEfiLoadedImageProtocolGuid
>gEsrtManagementProtocolGuid
> +  gPlatformSasNotifyProtocolGuid
> diff --git a/Silicon/Hisilicon/Include/Protocol/PlatformSasNotify.h 
> b/Silicon/Hisilicon/Include/Protocol/PlatformSasNotify.h
> new file mode 100644
> index 00..54fd30fc68
> --- /dev/null
> +++ b/Silicon/Hisilicon/Include/Protocol/PlatformSasNotify.h

And similarly, this file added under 
edk2-non-osi/Silicon/Hisilicon/Include/Protocol.

Other than that, I am happy with this patch.

(Yes, I know we have not enforced this in the past, but it is way
cleaner and makes API-updates a single patch in a single repository.)

/
Leif

> @@ -0,0 +1,27 @@
> +/** @file
> +*
> +*  Copyright (c) 2018, Hisilicon Limited. All rights reserved.
> +*  Copyright (c) 2018, Linaro Limited. 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.
> +*
> +**/
> +
> +#ifndef _PLATFORM_SAS_NOTIFY_H_
> +#define _PLATFORM_SAS_NOTIFY_H_
> +
> +typedef struct _PLATFORM_SAS_NOTIFY PLATFORM_SAS_NOTIFY;
> +
> +struct _PLATFORM_SAS_NOTIFY {
> +  EFI_EVENT   WaitDiskEvent;
> +};
> +
> +extern EFI_GUID gPlatformSasNotifyProtocolGuid;
> +
> +#endif
> diff --git a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c 
> b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c
> index 7dd5ba615c..eaa6ce78d0 100644
> --- a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c
> +++ b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c
> @@ -20,6 +20,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -29,6 +30,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  
> @@ -554,6 +556,40 @@ 

Re: [edk2] [PATCH edk2-platforms v2 12/43] Platform/Hisilicon/D06: Add edk2-non-osi components for D06

2018-08-22 Thread Leif Lindholm
On Tue, Aug 14, 2018 at 04:08:32PM +0800, Ming Huang wrote:
> Add PcdCoreCount to fix build issue while add binary components.

This commit message fails to describe what is being done, apart from a
single thing that should be a separate patch.

Pleas add a proper commit message describing which components are
being imported.

> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> ---
>  Platform/Hisilicon/D06/D06.dsc   
>   |  7 +++
>  Platform/Hisilicon/D06/D06.fdf   
>   | 17 +
>  
> Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClassDxe.inf
>  |  2 ++
>  3 files changed, 26 insertions(+)
> 

> diff --git 
> a/Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClassDxe.inf
>  
> b/Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClassDxe.inf
> index 2275586ff3..a47806f391 100644
> --- 
> a/Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClassDxe.inf
> +++ 
> b/Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClassDxe.inf
> @@ -28,6 +28,7 @@
>  
>  [Packages]
>ArmPkg/ArmPkg.dec
> +  ArmPlatformPkg/ArmPlatformPkg.dec
>MdePkg/MdePkg.dec
>MdeModulePkg/MdeModulePkg.dec
>IntelFrameworkPkg/IntelFrameworkPkg.dec
> @@ -52,6 +53,7 @@
>gEfiSmbiosProtocolGuid   # PROTOCOL ALWAYS_CONSUMED
>  
>  [Pcd]
> +  gArmPlatformTokenSpaceGuid.PcdCoreCount
>gHisiTokenSpaceGuid.PcdCPUInfo
>gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz

And please submit this as a separate patch, explaining why the change
is needed. If it is only needed by one of the binary modules imported
as part of the current patch, place it immediately preceding this.

If it resolves some other issue, please insert it as early in the set
as possible.

/
Leif

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


Re: [edk2] [PATCH edk2-platforms v2 11/43] Platform/Hisilicon/D06: Add M41T83RealTimeClockLib

2018-08-21 Thread Leif Lindholm



On Tue, Aug 14, 2018 at 04:08:31PM +0800, Ming Huang wrote:
> Add M41T83RealTimeClockLib for RTC.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> ---
>  Platform/Hisilicon/D06/D06.dsc  
> |   1 +
>  Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf 
> |  46 ++
>  Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClock.h  
> | 158 ++
>  Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.c   
> | 564 
>  4 files changed, 769 insertions(+)
> 
> diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc
> index d14fce1159..27358f8c78 100644
> --- a/Platform/Hisilicon/D06/D06.dsc
> +++ b/Platform/Hisilicon/D06/D06.dsc
> @@ -65,6 +65,7 @@
>CpldIoLib|Silicon/Hisilicon/Library/CpldIoLib/CpldIoLib.inf
>  
>TimeBaseLib|EmbeddedPkg/Library/TimeBaseLib/TimeBaseLib.inf
> +  
> RealTimeClockLib|Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf
>  
>CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
>
> GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
> diff --git 
> a/Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf 
> b/Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf
> new file mode 100644
> index 00..e0bf6b3f24
> --- /dev/null
> +++ 
> b/Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf
> @@ -0,0 +1,46 @@
> +#/** @file
> +#
> +#  Copyright (c) 2018, Hisilicon Limited. All rights reserved.
> +#  Copyright (c) 2018, Linaro Limited. 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= 0x0001001A
> +  BASE_NAME  = M41T83RealTimeClockLib
> +  FILE_GUID  = 470DFB96-E205-4515-A75E-2E60F853E79D
> +  MODULE_TYPE= BASE
> +  VERSION_STRING = 1.0
> +  LIBRARY_CLASS  = RealTimeClockLib
> +
> +[Sources.common]
> +  M41T83RealTimeClockLib.c
> +
> +[Packages]
> +  EmbeddedPkg/EmbeddedPkg.dec
> +  MdePkg/MdePkg.dec
> +  Platform/Hisilicon/D06/D06.dec
> +  Silicon/Hisilicon/HisiPkg.dec
> +
> +[LibraryClasses]
> +  BaseMemoryLib
> +  CpldIoLib
> +  DebugLib
> +  I2CLib
> +  IoLib
> +  PcdLib
> +  TimeBaseLib
> +  TimerLib
> +  UefiLib
> +  UefiRuntimeLib# Use EFiAtRuntime to check stage
> +
> +[Depex]
> +  gEfiCpuArchProtocolGuid
> diff --git 
> a/Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClock.h 
> b/Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClock.h
> new file mode 100644
> index 00..ed10099bf3
> --- /dev/null
> +++ b/Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClock.h
> @@ -0,0 +1,158 @@
> +/** @file
> +
> +  Copyright (c) 2018, Hisilicon Limited. All rights reserved.
> +  Copyright (c) 2018, Linaro Limited. 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.
> +
> +**/
> +
> +#ifndef __M41T83_REAL_TIME_CLOCK_H__
> +#define __M41T83_REAL_TIME_CLOCK_H__
> +
> +// The delay is need for cpld and I2C. This is a empirical value. 
> MemoryFance is no need.
> +#define RTC_DELAY_30_MS3
> +// The delay is need for cpld and I2C. This is a empirical value. 
> MemoryFance is no need.
> +#define RTC_DELAY_1000_MACROSECOND 1000
> +// The delay is need for cpld and I2C. This is a empirical value. 
> MemoryFance is no need.
> +#define RTC_DELAY_2_MACROSECOND2
> +
> +#define M41T83_REGADDR_DOTSECONDS   0x00
> +#define M41T83_REGADDR_SECONDS  0x01
> +#define M41T83_REGADDR_MINUTES  0x02
> +#define M41T83_REGADDR_HOURS0x03
> +#define M41T83_REGADDR_WEEK_DAY 0x04
> +#define M41T83_REGADDR_DAY  0x05
> +#define M41T83_REGADDR_MONTH0x06
> +#define M41T83_REGADDR_YEAR 0x07
> +#define M41T83_REGADDR_ALARM1SEC0x0E
> +#define M41T83_REGADDR_ALARM1MIN0x0D
> +#define M41T83_REGADDR_ALARM1HOUR   0x0C
> +#define 

Re: [edk2] [PATCH edk2-platforms v2 10/43] Hisilicon/D06: Add several base file for D06

2018-08-21 Thread Leif Lindholm
On Tue, Aug 14, 2018 at 04:08:30PM +0800, Ming Huang wrote:
> Add several base head files and add several build
> files for D06.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 

All my comments have been addressed, so:
Reviewed-by: Leif Lindholm 

> ---
>  Platform/Hisilicon/D06/D06.dec   |  29 ++
>  Platform/Hisilicon/D06/D06.dsc   | 455 
> 
>  Platform/Hisilicon/D06/D06.fdf   | 351 +++
>  Platform/Hisilicon/D06/Include/Library/CpldD06.h |  37 ++
>  Silicon/Hisilicon/Hi1620/Include/Library/SerdesLib.h |  85 
>  Silicon/Hisilicon/Hi1620/Include/PlatformArch.h  |  61 +++
>  Silicon/Hisilicon/Include/Library/OemAddressMapLib.h |   6 +
>  Silicon/Hisilicon/Include/Library/OemNicLib.h|  57 +++
>  8 files changed, 1081 insertions(+)
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v3 17/36] Hisilicon/I2C: Fix a typo issue

2018-08-21 Thread Leif Lindholm
Err, that was 13, 14 and 17 in v3.

In v2, it's 20, 21, 24.

(I pushed the right patches, I just replied to the wrong email.)

On Tue, Aug 21, 2018 at 10:45:44PM +0100, Leif Lindholm wrote:
> Patches 13, 14 and 17/43 are just cleanup and refactoring of I2C
> library. It can (and should) go in before D06 support.
> 
> For the three patches:
> Reviewed-by: Leif Lindholm 
> 
> Pushed as 4e6af5fa1b..342330470f.
> 
> On Thu, Aug 16, 2018 at 08:12:20PM +0800, Ming Huang wrote:
> > Modify spedd to Speed.
> > 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Ming Huang 
> > ---
> >  Silicon/Hisilicon/Library/I2CLib/I2CHw.h  | 2 +-
> >  Silicon/Hisilicon/Library/I2CLib/I2CLib.c | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/Silicon/Hisilicon/Library/I2CLib/I2CHw.h 
> > b/Silicon/Hisilicon/Library/I2CLib/I2CHw.h
> > index d77aea509e..6fd7b8183e 100644
> > --- a/Silicon/Hisilicon/Library/I2CLib/I2CHw.h
> > +++ b/Silicon/Hisilicon/Library/I2CLib/I2CHw.h
> > @@ -81,7 +81,7 @@
> >   struct
> >   {
> >  UINT32  master: 1   ;
> > -UINT32  spedd : 2   ;
> > +UINT32  Speed : 2   ;
> >  UINT32  slave_10bit   : 1   ;
> >  UINT32  master_10bit  : 1   ;
> >  UINT32  restart_en: 1   ;
> > diff --git a/Silicon/Hisilicon/Library/I2CLib/I2CLib.c 
> > b/Silicon/Hisilicon/Library/I2CLib/I2CLib.c
> > index 59633106ce..ed44ac204f 100644
> > --- a/Silicon/Hisilicon/Library/I2CLib/I2CLib.c
> > +++ b/Silicon/Hisilicon/Library/I2CLib/I2CLib.c
> > @@ -158,7 +158,7 @@ I2CInit (
> >  
> >I2C_REG_READ (Base + I2C_CON_OFFSET, I2cControlReg.Val32);
> >I2cControlReg.bits.master = 1;
> > -  I2cControlReg.bits.spedd = 0x1;
> > +  I2cControlReg.bits.Speed = 0x1;
> >I2cControlReg.bits.restart_en = 1;
> >I2cControlReg.bits.slave_disable = 1;
> >I2C_REG_WRITE (Base + I2C_CON_OFFSET, I2cControlReg.Val32);
> > -- 
> > 2.17.0
> > 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v3 17/36] Hisilicon/I2C: Fix a typo issue

2018-08-21 Thread Leif Lindholm
Patches 13, 14 and 17/43 are just cleanup and refactoring of I2C
library. It can (and should) go in before D06 support.

For the three patches:
Reviewed-by: Leif Lindholm 

Pushed as 4e6af5fa1b..342330470f.

On Thu, Aug 16, 2018 at 08:12:20PM +0800, Ming Huang wrote:
> Modify spedd to Speed.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> ---
>  Silicon/Hisilicon/Library/I2CLib/I2CHw.h  | 2 +-
>  Silicon/Hisilicon/Library/I2CLib/I2CLib.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Silicon/Hisilicon/Library/I2CLib/I2CHw.h 
> b/Silicon/Hisilicon/Library/I2CLib/I2CHw.h
> index d77aea509e..6fd7b8183e 100644
> --- a/Silicon/Hisilicon/Library/I2CLib/I2CHw.h
> +++ b/Silicon/Hisilicon/Library/I2CLib/I2CHw.h
> @@ -81,7 +81,7 @@
>   struct
>   {
>  UINT32  master: 1   ;
> -UINT32  spedd : 2   ;
> +UINT32  Speed : 2   ;
>  UINT32  slave_10bit   : 1   ;
>  UINT32  master_10bit  : 1   ;
>  UINT32  restart_en: 1   ;
> diff --git a/Silicon/Hisilicon/Library/I2CLib/I2CLib.c 
> b/Silicon/Hisilicon/Library/I2CLib/I2CLib.c
> index 59633106ce..ed44ac204f 100644
> --- a/Silicon/Hisilicon/Library/I2CLib/I2CLib.c
> +++ b/Silicon/Hisilicon/Library/I2CLib/I2CLib.c
> @@ -158,7 +158,7 @@ I2CInit (
>  
>I2C_REG_READ (Base + I2C_CON_OFFSET, I2cControlReg.Val32);
>I2cControlReg.bits.master = 1;
> -  I2cControlReg.bits.spedd = 0x1;
> +  I2cControlReg.bits.Speed = 0x1;
>I2cControlReg.bits.restart_en = 1;
>I2cControlReg.bits.slave_disable = 1;
>I2C_REG_WRITE (Base + I2C_CON_OFFSET, I2cControlReg.Val32);
> -- 
> 2.17.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v3 32/36] Silicon/Hisilicon/Setup: Support SPCR table switch

2018-08-21 Thread Leif Lindholm
On Thu, Aug 16, 2018 at 08:12:35PM +0800, Ming Huang wrote:
> If install SPCR table, KVM will not output while install or boot
> some OS, like ubuntu, so add SPCR switch setup item and set it
> disable by default.

This one was supposed to be replaced with
EmbeddedPkg/Drivers/ConsolePrefDxe, right?

/
Leif

> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> Signed-off-by: Heyi Guo 
> ---
>  Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf |  1 +
>  Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c   | 24 
> 
>  2 files changed, 25 insertions(+)
> 
> diff --git 
> a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf 
> b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
> index 281a4f2ebd..3d133aff85 100644
> --- a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
> +++ b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
> @@ -51,6 +51,7 @@
>  
>  [Guids]
>gHisiEfiMemoryMapGuid
> +  gOemConfigGuid
>  
>  [Pcd]
>gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiTableStorageFile## CONSUMES
> diff --git a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c 
> b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c
> index 54f49977c3..32878ca4f9 100644
> --- a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c
> +++ b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c
> @@ -16,8 +16,10 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
> +#include 
>  #include 
>  
>  #define CORECOUNT(X) ((X) * CORE_NUM_PER_SOCKET)
> @@ -114,6 +116,25 @@ UpdateSlit (
>return  EFI_SUCCESS;
>  }
>  
> +STATIC
> +EFI_STATUS
> +IsNeedSpcr (
> +  IN OUT EFI_ACPI_DESCRIPTION_HEADER  *Table
> +  )
> +{
> +  EFI_STATUS Status;
> +  OEM_CONFIG_DATASetupData;
> +  UINTN  DataSize = sizeof (OEM_CONFIG_DATA);
> +
> +  Status = gRT->GetVariable (OEM_CONFIG_NAME, , NULL, 
> , );
> +  if (!EFI_ERROR (Status) && (SetupData.EnableSpcr == FALSE)) {
> +return EFI_ABORTED;
> +  }
> +
> +  return EFI_SUCCESS;
> +}
> +
> +
>  EFI_STATUS
>  UpdateAcpiTable (
>IN OUT EFI_ACPI_DESCRIPTION_HEADER  *TableHeader
> @@ -130,6 +151,9 @@ UpdateAcpiTable (
>case EFI_ACPI_6_0_SYSTEM_LOCALITY_INFORMATION_TABLE_SIGNATURE:
>  Status = UpdateSlit (TableHeader);
>  break;
> +  case EFI_ACPI_6_2_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE:
> +Status = IsNeedSpcr (TableHeader);
> +break;
>}
>return Status;
>  }
> -- 
> 2.17.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v2 01/43] Silicon/Hisilicon: Modify the MRC interface for other module

2018-08-21 Thread Leif Lindholm
On Tue, Aug 14, 2018 at 04:08:21PM +0800, Ming Huang wrote:
> This patch is to unify D0x. Add pGBL_INTERFACE struct define
> and remove useless interfece. Replace DMRC pGblData with pGblInterface;

interfece ->
interface

I will fix that up on commit.
Reviewed-by: Leif Lindholm 


> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> ---
>  Silicon/Hisilicon/Include/Library/HwMemInitLib.h| 356 
> 
>  Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c |   4 +-
>  Silicon/Hisilicon/Drivers/Smbios/MemorySubClassDxe/MemorySubClass.c |  26 +-
>  3 files changed, 78 insertions(+), 308 deletions(-)
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v2 05/43] Silicon/Hisilicon/D0x: Move RAS macro to PlatformArch.h

2018-08-21 Thread Leif Lindholm
This one needs to be rebased onto the modified 3/43.
I have no other issues with it, so when you resubmit:
Reviewed-by: Leif Lindholm 

On Tue, Aug 14, 2018 at 04:08:25PM +0800, Ming Huang wrote:
> From: Sun Yuanchen 
> 
> Move some RAS macros definition to PlatformArch.h for
> unifying D0x
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Sun Yuanchen 
> ---
>  Silicon/Hisilicon/Hi1610/Include/PlatformArch.h |  9 +++--
>  Silicon/Hisilicon/Hi1616/Include/PlatformArch.h | 12 
>  2 files changed, 19 insertions(+), 2 deletions(-)
> 
> diff --git a/Silicon/Hisilicon/Hi1610/Include/PlatformArch.h 
> b/Silicon/Hisilicon/Hi1610/Include/PlatformArch.h
> index 2ff076901e..f39ae0748c 100644
> --- a/Silicon/Hisilicon/Hi1610/Include/PlatformArch.h
> +++ b/Silicon/Hisilicon/Hi1610/Include/PlatformArch.h
> @@ -1,7 +1,7 @@
>  /** @file
>  *
> -*  Copyright (c) 2015, Hisilicon Limited. All rights reserved.
> -*  Copyright (c) 2015, Linaro Limited. All rights reserved.
> +*  Copyright (c) 2015 - 2018, Hisilicon Limited. All rights reserved.
> +*  Copyright (c) 2015 - 2018, Linaro Limited. All rights reserved.
>  *
>  *  This program and the accompanying materials
>  *  are licensed and made available under the terms and conditions of the BSD 
> License
> @@ -32,6 +32,11 @@
>  
>  #define S1_BASE   0x400
>  
> +#define RASC_BASE(0x5000)
> +/* configuration register for Rank statistical information */
> +#define RASC_CFG_INFOIDX_REG (RASC_BASE + 0x5C)
> +/* configuration register for Sparing level */
> +#define RASC_CFG_SPLVL_REG   (RASC_BASE + 0xB8)
>  
>  //
>  // ACPI table information used to initialize tables.
> diff --git a/Silicon/Hisilicon/Hi1616/Include/PlatformArch.h 
> b/Silicon/Hisilicon/Hi1616/Include/PlatformArch.h
> index 60a60593be..e02e4bdabd 100644
> --- a/Silicon/Hisilicon/Hi1616/Include/PlatformArch.h
> +++ b/Silicon/Hisilicon/Hi1616/Include/PlatformArch.h
> @@ -30,6 +30,18 @@
>  // Max NUMA node number for each node type
>  #define MAX_NUM_PER_TYPE 8
>  
> +#define RASC_BASE(0x5000)
> +/* configuration register for Rank statistical information */
> +#define RASC_CFG_INFOIDX_REG (RASC_BASE + 0x5C)
> +/* configuration register for Sparing level */
> +#define RASC_CFG_SPLVL_REG   (RASC_BASE + 0xB8)
> +
> +// for acpi
> +#define NODE_IN_SOCKET  2
> +#define CORE_NUM_PER_SOCKET 32
> +#define EFI_ACPI_MEMORY_AFFINITY_STRUCTURE_COUNT10
> +#define EFI_ACPI_6_2_ITS_AFFINITY_STRUCTURE_COUNT   8
> +
>  #define S1_BASE   0x400
>  
>  //
> -- 
> 2.17.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2 edk-platforms 1/3] Silicon/Hi3660: fix LDO9_VSET register definition

2018-08-16 Thread Leif Lindholm
On Thu, Aug 16, 2018 at 09:49:24AM +0800, Haojian Zhuang wrote:
> Fix the LDO9_VSET register definition in PMIC. LDO9 is used
> by Designware SD controller. Without this fix, SD controller
> fails to operate SD card since lack of right voltage setting.
> 
> Cc: Leif Lindholm 
> Cc: Ard Biesheuvel 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Haojian Zhuang 

Reviewed-by: Leif Lindholm 
Pushed as d11581e5fd.

> ---
>  Silicon/Hisilicon/Hi3660/Include/Hi3660.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Silicon/Hisilicon/Hi3660/Include/Hi3660.h 
> b/Silicon/Hisilicon/Hi3660/Include/Hi3660.h
> index 5fbf32267657..6e0587f7783a 100644
> --- a/Silicon/Hisilicon/Hi3660/Include/Hi3660.h
> +++ b/Silicon/Hisilicon/Hi3660/Include/Hi3660.h
> @@ -58,7 +58,7 @@
>  #define USB3OTG_PHY_CR_CAP_ADDR (1 << 0)
>  
>  #define PMU_REG_BASE0xFFF34000
> -#define PMIC_LDO9_VSET_REG  (PMU_REG_BASE + (0x068 << 2))
> +#define PMIC_LDO9_VSET_REG  (PMU_REG_BASE + (0x06b << 2))
>  #define LDO9_VSET_MASK  (7 << 0)
>  
>  #define PMIC_LDO16_ONOFF_ECO_REG(PMU_REG_BASE + (0x078 << 2))
> -- 
> 2.7.4
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-non-osi v2 3/4] Hisilicon/D06: Add binary modules

2018-08-16 Thread Leif Lindholm
On Thu, Aug 16, 2018 at 10:14:14AM +0800, Ming wrote:
> 在 8/15/2018 11:27 PM, Leif Lindholm 写道:
> > Thanks, this commit message is a lot better.
> > 
> > My only concern with this patch is that the binaries are built with a
> > truly ancient toolchain. Is there some particular reason for this?
> 
> In internally, we share build server with product project, so we follow
> product project rhythm for upgrade toolchain.

Fully understandable.

However, I would strongly recommend upgrading _that_ toolchain.
4.8 was the first version of GCC that supported AArch64 upstream.
There have been very many improvements made, both in performance and
code correctness, since then.

Also, anything < GCC5 will miss out on link-time optimisation.
But this is a conversation we can have off-line Linaro<->Hisilicon.

Anyway, for this patch:
Reviewed-by: Leif Lindholm 
(I will push it with the corresponding edk2-platforms patch when
ready.)

/
Leif

> > 
> > /
> > Leif
> > 
> > On Tue, Aug 14, 2018 at 04:04:50PM +0800, Ming Huang wrote:
> >> Description per Module:
> >> GetInfoFromBmc:
> >>   Get board infomation from BMC and install a protocal.
> >> IoInitDxe:
> >>   Serdes initialization and PCIe port initialization and SMMU workaround.
> >> IpmiInterfacePei:
> >>   Install PEI ipmi interface PPI.
> >> IpmiInterfaceDxe:
> >>   Install DXE ipmi interface protocal.
> >> IpmiMiscOpDxe:
> >>   Send some OEM info to BMC via ipmi protocal.
> >> IpmiWatchdogDxe:
> >>   Manage the out of band watchdog timer in BMC.
> >> SnpDxe:
> >>   Snp driver for D06 debug on board net card.
> >> PcieRasInitDxe:
> >>   Initialize PCIe RAS function for all PCIe root port and end point.
> >> RasInitDxe:
> >>   Configure and enable RAS.
> >> SfcDxeDriver:
> >>   SPI flash driver.
> >> SasDxeDriver:
> >>   SAS driver for on board SAS controller.
> >> UefiSmi:
> >>   VGA driver for on board VGA device(SM750).
> >> TransSmbiosInfo:
> >>   Send SMBIOS infomation to BMC via ipmi.
> >> OemAddressMapD06:
> >>   Provide function for configuration components of chips.
> >> MemoryInitPeim:
> >>   Peim for memory initialization.
> >> Hi1620SerdesLib:
> >>   Library for initialization Hi1620 serdes.
> >> LpcLib:
> >>   Include LpcInit, LpcByteWrite and LpcByteRead functions.
> >> PlatformSysCtrlLibHi1620:
> >>   Provide Misc function needed by other modules.
> >> FVMAIN_SEC.Fv:
> >>   A Fv for SEC binary.
> >> bl1.bin/fip.bin:
> >>   Trusted Firmware module.
> >>
> >> Build commit infomation:
> >> edk2:   871c57754c1d
> >> edk2-platforms: 820af7623c42
> >> HwPkg:  a7947372749e
> >> TrustedFirmware: cccdae6ff768
> >> Tools:  6b286b119422
> >>
> >> Contributed-under: TianoCore Contribution Agreement 1.1
> >> Signed-off-by: Ming Huang 
> >> ---
> >>  Platform/Hisilicon/D06/Drivers/GetInfoFromBmc/GetInfoFromBmc.inf  
> >>  |  26 
> >>  Platform/Hisilicon/D06/Drivers/IoInitDxe/IoInitDxe.inf
> >>  |  27 
> >>  Platform/Hisilicon/D06/Drivers/Ipmi/IpmiInterfaceDxe/IpmiInterfaceDxe.inf 
> >>  |  28 +
> >>  Platform/Hisilicon/D06/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.inf 
> >>  |  27 
> >>  Platform/Hisilicon/D06/Drivers/IpmiMiscOpDxe/IpmiMiscOpDxe.inf
> >>  |  27 
> >>  Platform/Hisilicon/D06/Drivers/IpmiWatchdogDxe/IpmiWatchdogDxe.inf
> >>  |  27 
> >>  Platform/Hisilicon/D06/Drivers/Net/SnpHi1620NewDxe/SnpDxe.inf 
> >>  |  27 
> >>  Platform/Hisilicon/D06/Drivers/PcieRasInitDxe/PcieRasInitDxe.inf  
> >>  |  26 
> >>  Platform/Hisilicon/D06/Drivers/RasInitDxe/RasInitDxe.inf  
> >>  |  25 
> >>  Platform/Hisilicon/D06/Drivers/SFC/SfcDxeDriver.inf   
> >>  |  27 
> >>  Platform/Hisilicon/D06/Drivers/Sas/SasDxeDriver.inf   
> >>  |  27 
> >>  Platform/Hisilicon/D06/Drivers/Sm750Dxe/UefiSmi.inf   
> >>  |  32 +++
> >>  Platform/Hisilicon/D

Re: [edk2] [PATCH edk2-non-osi v2 3/4] Hisilicon/D06: Add binary modules

2018-08-15 Thread Leif Lindholm
Thanks, this commit message is a lot better.

My only concern with this patch is that the binaries are built with a
truly ancient toolchain. Is there some particular reason for this?

/
Leif

On Tue, Aug 14, 2018 at 04:04:50PM +0800, Ming Huang wrote:
> Description per Module:
> GetInfoFromBmc:
>   Get board infomation from BMC and install a protocal.
> IoInitDxe:
>   Serdes initialization and PCIe port initialization and SMMU workaround.
> IpmiInterfacePei:
>   Install PEI ipmi interface PPI.
> IpmiInterfaceDxe:
>   Install DXE ipmi interface protocal.
> IpmiMiscOpDxe:
>   Send some OEM info to BMC via ipmi protocal.
> IpmiWatchdogDxe:
>   Manage the out of band watchdog timer in BMC.
> SnpDxe:
>   Snp driver for D06 debug on board net card.
> PcieRasInitDxe:
>   Initialize PCIe RAS function for all PCIe root port and end point.
> RasInitDxe:
>   Configure and enable RAS.
> SfcDxeDriver:
>   SPI flash driver.
> SasDxeDriver:
>   SAS driver for on board SAS controller.
> UefiSmi:
>   VGA driver for on board VGA device(SM750).
> TransSmbiosInfo:
>   Send SMBIOS infomation to BMC via ipmi.
> OemAddressMapD06:
>   Provide function for configuration components of chips.
> MemoryInitPeim:
>   Peim for memory initialization.
> Hi1620SerdesLib:
>   Library for initialization Hi1620 serdes.
> LpcLib:
>   Include LpcInit, LpcByteWrite and LpcByteRead functions.
> PlatformSysCtrlLibHi1620:
>   Provide Misc function needed by other modules.
> FVMAIN_SEC.Fv:
>   A Fv for SEC binary.
> bl1.bin/fip.bin:
>   Trusted Firmware module.
> 
> Build commit infomation:
> edk2:   871c57754c1d
> edk2-platforms: 820af7623c42
> HwPkg:  a7947372749e
> TrustedFirmware: cccdae6ff768
> Tools:  6b286b119422
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> ---
>  Platform/Hisilicon/D06/Drivers/GetInfoFromBmc/GetInfoFromBmc.inf 
>   |  26 
>  Platform/Hisilicon/D06/Drivers/IoInitDxe/IoInitDxe.inf   
>   |  27 
>  Platform/Hisilicon/D06/Drivers/Ipmi/IpmiInterfaceDxe/IpmiInterfaceDxe.inf
>   |  28 +
>  Platform/Hisilicon/D06/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.inf
>   |  27 
>  Platform/Hisilicon/D06/Drivers/IpmiMiscOpDxe/IpmiMiscOpDxe.inf   
>   |  27 
>  Platform/Hisilicon/D06/Drivers/IpmiWatchdogDxe/IpmiWatchdogDxe.inf   
>   |  27 
>  Platform/Hisilicon/D06/Drivers/Net/SnpHi1620NewDxe/SnpDxe.inf
>   |  27 
>  Platform/Hisilicon/D06/Drivers/PcieRasInitDxe/PcieRasInitDxe.inf 
>   |  26 
>  Platform/Hisilicon/D06/Drivers/RasInitDxe/RasInitDxe.inf 
>   |  25 
>  Platform/Hisilicon/D06/Drivers/SFC/SfcDxeDriver.inf  
>   |  27 
>  Platform/Hisilicon/D06/Drivers/Sas/SasDxeDriver.inf  
>   |  27 
>  Platform/Hisilicon/D06/Drivers/Sm750Dxe/UefiSmi.inf  
>   |  32 +++
>  Platform/Hisilicon/D06/Drivers/TransferSmbiosInfo/TransSmbiosInfo.inf
>   |  26 
>  Platform/Hisilicon/D06/Library/OemAddressMapD06/OemAddressMapD06.inf 
>   |  40 ++
>  Platform/Hisilicon/D06/MemoryInitPei/MemoryInitPeim.inf  
>   |  28 +
>  Silicon/Hisilicon/Hi1620/Library/Hi1620Serdes/Hi1620SerdesLib.inf
>   |  43 
>  Silicon/Hisilicon/Hi1620/Library/LpcLibHi1620/LpcLib.inf 
>   |  39 ++
>  
> Silicon/Hisilicon/Hi1620/Library/PlatformSysCtrlLibHi1620/PlatformSysCtrlLibHi1620.inf
>  |  43 
>  Platform/Hisilicon/D06/Drivers/GetInfoFromBmc/GetInfoFromBmc.depex   
>   | Bin 0 -> 18 bytes
>  Platform/Hisilicon/D06/Drivers/GetInfoFromBmc/GetInfoFromBmc.efi 
>   | Bin 0 -> 20480 bytes
>  Platform/Hisilicon/D06/Drivers/IoInitDxe/IoInitDxe.depex 
>   | Bin 0 -> 18 bytes
>  Platform/Hisilicon/D06/Drivers/IoInitDxe/IoInitDxe.efi   
>   | Bin 0 -> 229216 bytes
>  Platform/Hisilicon/D06/Drivers/Ipmi/IpmiInterfaceDxe/IpmiInterfaceDxe.depex  
>   | Bin 0 -> 18 bytes
>  Platform/Hisilicon/D06/Drivers/Ipmi/IpmiInterfaceDxe/IpmiInterfaceDxe.efi
>   | Bin 0 -> 29440 bytes
>  Platform/Hisilicon/D06/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.depex  
>   | Bin 0 -> 18 bytes
>  Platform/Hisilicon/D06/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.efi
>   | Bin 0 -> 21664 bytes
>  Platform/Hisilicon/D06/Drivers/IpmiMiscOpDxe/IpmiMiscOp.depex
>   | Bin 0 -> 36 bytes
>  Platform/Hisilicon/D06/Drivers/IpmiMiscOpDxe/IpmiMiscOp.efi  
> 

Re: [edk2] [PATCH edk2-non-osi v2 4/4] Silicon/Hisilicon/D06: Add Oem Shell libraries

2018-08-15 Thread Leif Lindholm
On Tue, Aug 14, 2018 at 04:04:51PM +0800, Ming Huang wrote:
> Add Hisilicon Oem Shell libraries for some commands,such as
> biosupdate, getmac, setmac, provision, acpistartos, brdinfo,
> sfpinfo.
> 
> biosupdate example:
> ifconfig -s eth2 static 192.168.2.68 255.255.255.0 192.168.2.1
> biosupdate serverIp -u user -p password -f D06.fd -m master

Is this expected to be used in reality?
There is capsule update and there is a BMC - why do you need a magic
platform-specific command in the Shell?
Is it a debug feature?

> acpistartos example:
> ifconfig -s eth2 static 192.168.2.69 255.255.255.0 192.168.2.1
> provision serverIp -u user -p password -f os\Image -a 0x8
> 2
> provision serverIp -u user -p password -f os\minifs.cpio.gz -a
> 0x0700
> 2
> acpistartos

Why is there a magic Shell comand to load a Linux kernel and
initramfs? This is the opposite of what UEFI is for.

/
Leif

> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> ---
>  Silicon/Hisilicon/Hi1620/Library/HisiD06ShellCmdLib/HisiD06ShellCmdLib.inf | 
>  41 ++
>  Silicon/Hisilicon/Library/HisiShellCmdLib/HisiShellCmdLib.inf  | 
>  59 
>  Silicon/Hisilicon/Hi1620/Library/HisiD06ShellCmdLib/HisiD06ShellCmdLib.lib | 
> Bin 0 -> 144880 bytes
>  Silicon/Hisilicon/Library/HisiShellCmdLib/HisiShellCmdLib.lib  | 
> Bin 0 -> 1109382 bytes
>  4 files changed, 100 insertions(+)
> 
> diff --git 
> a/Silicon/Hisilicon/Hi1620/Library/HisiD06ShellCmdLib/HisiD06ShellCmdLib.inf 
> b/Silicon/Hisilicon/Hi1620/Library/HisiD06ShellCmdLib/HisiD06ShellCmdLib.inf
> new file mode 100644
> index 000..3dea3fb
> --- /dev/null
> +++ 
> b/Silicon/Hisilicon/Hi1620/Library/HisiD06ShellCmdLib/HisiD06ShellCmdLib.inf
> @@ -0,0 +1,41 @@
> +/** @file
> +*
> +*  Copyright (c) 2018, Hisilicon Limited. All rights reserved.
> +*  Copyright (c) 2018, Linaro Limited. 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= 0x0001001A
> +  BASE_NAME  = HisiD06ShellCmdLib
> +  FILE_GUID  = 41878264-1668-460f-b0bf-26bdc89d464c
> +  MODULE_TYPE= UEFI_APPLICATION
> +  VERSION_STRING = 1.0
> +  LIBRARY_CLASS  = NULL|UEFI_APPLICATION UEFI_DRIVER
> +  CONSTRUCTOR= HisiD06ShellCmdLibConstructor
> +  DESTRUCTOR = HisiD06ShellCmdLibDestructor
> +
> +
> +[Binaries.AARCH64]
> +  LIB|HisiD06ShellCmdLib.lib|*
> +
> +[Packages]
> +  ShellPkg/ShellPkg.dec
> +  Silicon/Hisilicon/HisiPkg.dec
> +
> +[LibraryClasses]
> +  I2CLib
> +  ShellLib
> +
> +[Guids]
> +  HisiPlatformShellSampleHiiGuid ## CONSUMES ## HII
> diff --git a/Silicon/Hisilicon/Library/HisiShellCmdLib/HisiShellCmdLib.inf 
> b/Silicon/Hisilicon/Library/HisiShellCmdLib/HisiShellCmdLib.inf
> new file mode 100644
> index 000..a81af92
> --- /dev/null
> +++ b/Silicon/Hisilicon/Library/HisiShellCmdLib/HisiShellCmdLib.inf
> @@ -0,0 +1,59 @@
> +/** @file
> +*
> +*  Copyright (c) 2018, Hisilicon Limited. All rights reserved.
> +*  Copyright (c) 2018, Linaro Limited. 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= 0x0001001A
> +  BASE_NAME  = HisiShellCmdLib
> +  FILE_GUID  = 88324505-C49D-4eac-8253-75D324457B88
> +  MODULE_TYPE= UEFI_APPLICATION
> +  VERSION_STRING = 1.0
> +  LIBRARY_CLASS  = NULL|UEFI_APPLICATION UEFI_DRIVER
> +  CONSTRUCTOR= HisiShellCmdLibConstructor
> +  DESTRUCTOR = HisiShellCmdLibDestructor
> +
> +[Binaries.AARCH64]
> +  LIB|HisiShellCmdLib.lib|*
> +
> +[Packages]
> +  ArmPkg/ArmPkg.dec
> +  ShellPkg/ShellPkg.dec
> +  Silicon/Hisilicon/HisiPkg.dec
> +
> +[LibraryClasses]
> +  ArmSmcLib
> +  IpmiCmdLib
> +  PcdLib
> +  ShellCommandLib
> +  ShellLib
> +
> +[Pcd]
> +  gEfiShellPkgTokenSpaceGuid.PcdShellProfileMask ## CONSUMES
> +  

<    1   2   3   4   5   6   7   8   9   10   >