[edk2] [PATCH] ShellPkg/acpi: Fix XCODE5 X64 build failure

2018-08-05 Thread Ruiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni 
Cc: Dandan Bi 
---
 ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c | 2 +-
 ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c 
b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c
index cca25fcce9..5b25c66f40 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c
@@ -33,7 +33,7 @@ STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
 /**
   Get the ACPI XSDT header info.
 **/
-CONST ACPI_DESCRIPTION_HEADER_INFO* CONST
+CONST ACPI_DESCRIPTION_HEADER_INFO *
 EFIAPI
 GetAcpiXsdtHeaderInfo (
   VOID
diff --git 
a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c 
b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c
index a5e1412484..5fa28338ef 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c
@@ -32,7 +32,7 @@ STATIC CONST ACPI_PARSER XsdtParser[] = {
 /**
   Get the ACPI XSDT header info.
 **/
-CONST ACPI_DESCRIPTION_HEADER_INFO* CONST
+CONST ACPI_DESCRIPTION_HEADER_INFO *
 EFIAPI
 GetAcpiXsdtHeaderInfo (
   VOID
-- 
2.16.1.windows.1

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


Re: [edk2] [PATCH edk2-platforms v1 03/38] Hisilicon/D06: Add several basal file for D06

2018-08-05 Thread Ming


在 8/5/2018 11:06 PM, Ming 写道:
> 
> 
> 在 8/3/2018 12:14 AM, Leif Lindholm 写道:
>> On Tue, Jul 24, 2018 at 03:08:47PM +0800, Ming Huang wrote:
>>> Add several basal head file and add several build configuration
>>
>> basal -> base
>>
>>> for D06.
>>>
>>> Contributed-under: TianoCore Contribution Agreement 1.1
>>> Signed-off-by: Ming Huang 
>>> Signed-off-by: Heyi Guo 
>>
>> Ah, yes - please drop the multiple Signed-off-bys as well.
>> If Heyi wrote the patch, keep him as Author - but only your
>> Signed-off-by on patches you send out.
>>
>>> ---
>>>  Platform/Hisilicon/D06/D06.dec   |  29 ++
>>>  Platform/Hisilicon/D06/D06.dsc   | 459 
>>> 
>>>  Platform/Hisilicon/D06/D06.fdf   | 351 +++
>>>  Platform/Hisilicon/D06/Include/Library/CpldD06.h |  37 ++
>>>  Silicon/Hisilicon/Hi1620/Include/Library/SerdesLib.h |  85 
>>>  Silicon/Hisilicon/Include/Library/OemAddressMapLib.h |   6 +
>>>  Silicon/Hisilicon/Include/Library/OemNicLib.h|  58 +++
>>>  7 files changed, 1025 insertions(+)
>>>
>>> diff --git a/Platform/Hisilicon/D06/D06.dec b/Platform/Hisilicon/D06/D06.dec
>>> new file mode 100644
>>> index 00..555f816e69
>>> --- /dev/null
>>> +++ b/Platform/Hisilicon/D06/D06.dec
>>> @@ -0,0 +1,29 @@
>>> +#/** @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.
>>> +#
>>> +#**/
>>> +
>>> +#
>>> +# D06 Package
>>> +#
>>> +#
>>> +#
>>> +
>>> +[Defines]
>>> +  DEC_SPECIFICATION  = 0x00010005
>>
>> 0x0001001a
>>
>>> +  PACKAGE_NAME   = D06Pkg
>>> +  PACKAGE_GUID   = B46F75D7-3864-450D-86D9-A0346A882232
>>> +  PACKAGE_VERSION= 0.1
>>> +
>>> +[Includes]
>>> +  Include
>>> diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc
>>> new file mode 100644
>>> index 00..91470118b2
>>> --- /dev/null
>>> +++ b/Platform/Hisilicon/D06/D06.dsc
>>> @@ -0,0 +1,459 @@
>>> +#
>>> +#  Copyright (c) 2011-2012, ARM Limited. All rights reserved.
>>> +#  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 Section - statements that will be processed to create a Makefile.
>>> +#
>>> +
>>> +[Defines]
>>> +  PLATFORM_NAME  = D06
>>> +  PLATFORM_GUID  = D0D445F1-B2CA-4101-9986-1B23525CBEA6
>>> +  PLATFORM_VERSION   = 0.1
>>> +  DSC_SPECIFICATION  = 0x00010005
>>
>> 0x0001001a
>>
>>> +  OUTPUT_DIRECTORY   = Build/$(PLATFORM_NAME)
>>> +  SUPPORTED_ARCHITECTURES= AARCH64
>>> +  BUILD_TARGETS  = DEBUG|RELEASE
>>
>> Can you also add NOOPT please?
>> Between DEBUG and RELEASE.
>>
> 
> Yes, I will add spaces between DEBUG and RELEASE.
> 

I think that I made a mistake in last email. Do you mean add NOOPT targets?
DEBUG|NOOPT|RELEASE ?
What is the NOOPT?

>>> +  SKUID_IDENTIFIER   = DEFAULT
>>> +  FLASH_DEFINITION   = 
>>> Platform/Hisilicon/$(PLATFORM_NAME)/$(PLATFORM_NAME).fdf
>>> +  DEFINE INCLUDE_TFTP_COMMAND=1
>>
>> TFTP needs to be disabled by default.
>> Also, if you set a default value here to edit, the test belows needs to
>> be !if ... == 1 (but preferable to use TRUE/FALSE) rather than !ifdef ...
>> (Currently it would be included regardless of what you set this
>> variable to.)
>>
> 
> I will delete this line and modify the test statement below.
> 
>>> +  DEFINE NETWORK_IP6_ENABLE  = FALSE
>>> +  DEFINE HTTP_BOOT_ENABLE= FALSE
>>> +  DEFINE SECURE_BOOT_ENABLE  = FALSE
>>> +
>>> +!include Silicon/Hisilicon/Hisilicon.dsc.inc
>>> +
>>> +[LibraryClasses.common]
>>> +  ArmLib|ArmPkg/Library/Arm

[edk2] [PATCH] IntelFrameworkModulePkg: Remove redundant definitions and functions

2018-08-05 Thread shenglei
Some dead code functions and redundant definitions
have been removed in inf, .c and .h files.

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

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
---
 .../Bus/Isa/IsaIoDxe/IsaDriver.h  |   1 -
 .../Bus/Isa/IsaIoDxe/IsaIoDxe.inf |   1 -
 .../Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c|  18 --
 .../Bus/Pci/IdeBusDxe/Ata.c   | 105 
 .../Bus/Pci/IdeBusDxe/DriverConfiguration.c   | 156 --
 .../Csm/BiosThunk/Snp16Dxe/PxeUndi.c  |  66 +---
 .../Csm/LegacyBiosDxe/LegacyBiosDxe.inf   |   2 -
 .../Csm/LegacyBiosDxe/LegacyBiosInterface.h   |   2 -
 .../Universal/BdsDxe/BootMaint/BmLib.c|  24 ---
 .../Universal/BdsDxe/BootMaint/BootOption.c   |  52 --
 .../Universal/BdsDxe/BootMaint/Variable.c |  58 ---
 .../Universal/BdsDxe/FrontPage.c  |  18 --
 12 files changed, 1 insertion(+), 502 deletions(-)

diff --git a/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaDriver.h 
b/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaDriver.h
index 9639d18318..6b1aaeda0e 100644
--- a/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaDriver.h
+++ b/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaDriver.h
@@ -24,7 +24,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
diff --git a/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaIoDxe.inf 
b/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaIoDxe.inf
index 6f02aea7af..247c66151b 100644
--- a/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaIoDxe.inf
+++ b/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaIoDxe.inf
@@ -62,7 +62,6 @@
   gEfiSioProtocolGuid   ## TO_START
   gEfiPciIoProtocolGuid ## TO_START
   gEfiDevicePathProtocolGuid## TO_START
-  gEfiGenericMemTestProtocolGuid## TO_START
 
 [Pcd]
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSupportedFeatures  ## 
CONSUMES
diff --git a/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c 
b/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
index 78c4e3b391..404e99241c 100644
--- a/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
+++ b/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
@@ -1856,24 +1856,6 @@ Done:
   @return status of issuing disable command
 
 **/
-EFI_STATUS
-DisableKeyboard (
-  IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn
-  )
-{
-  EFI_STATUS  Status;
-
-  //
-  // Disable keyboard interface
-  //
-  Status = KeyboardCommand (ConsoleIn, 
KEYBOARD_8042_COMMAND_DISABLE_KEYBOARD_INTERFACE);
-  if (EFI_ERROR (Status)) {
-KeyboardError (ConsoleIn, L"\n\r");
-return EFI_DEVICE_ERROR;
-  }
-
-  return Status;
-}
 
 /**
   Check whether there is Ps/2 Keyboard device in system by 0xF4 Keyboard 
Command
diff --git a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ata.c 
b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ata.c
index 7819773f38..6e84800ed6 100644
--- a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ata.c
+++ b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ata.c
@@ -2691,109 +2691,4 @@ AtaNonDataCommandIn (
   @retval  EFI_DEVICE_ERROR Device status error.
 
 **/
-EFI_STATUS
-AtaNonDataCommandInExt (
-  IN  IDE_BLK_IO_DEV  *IdeDev,
-  IN  UINT8   AtaCommand,
-  IN  UINT8   Device,
-  IN  UINT16  Feature,
-  IN  UINT16  SectorCount,
-  IN  EFI_LBA LbaAddress
-  )
-{
-  EFI_STATUS  Status;
-  UINT8   StatusRegister;
-  UINT8   SectorCount8;
-  UINT8   Feature8;
-  UINT8   LbaLow;
-  UINT8   LbaMid;
-  UINT8   LbaHigh;
-
-  Status = WaitForBSYClear (IdeDev, ATATIMEOUT);
-  if (EFI_ERROR (Status)) {
-return EFI_DEVICE_ERROR;
-  }
-
-  //
-  // Select device (bit4), set LBA mode(bit6) (use 0xe0 for compatibility)
-  //
-  IDEWritePortB (
-IdeDev->PciIo,
-IdeDev->IoPort->Head,
-(UINT8) ((IdeDev->Device << 4) | 0xe0)
-);
-
-  //
-  // ATA commands for ATA device must be issued when DRDY is set
-  //
-  Status = DRDYReady (IdeDev, ATATIMEOUT);
-  if (EFI_ERROR (Status)) {
-return EFI_DEVICE_ERROR;
-  }
-
-  //
-  // Pass parameter into device register block
-  //
-  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->Head, Device);
-
-  //
-  // Fill the feature register, which is a two-byte FIFO. Need write twice.
-  //
-  Feature8 = (UINT8) (Feature >> 8);
-  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->Reg1.Feature, Feature8);
-
-  Feature8 = (UINT8) Feature;
-  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->Reg1.Feature, Feature8);
-
-  //
-  // Fill the sector count register, which is a two-byte FIFO. Need write 
twice.
-  //
-  SectorCount8 = (UINT8) (SectorCount >> 8);
-  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->SectorCount, SectorCount8);
-
-  SectorCount8 = (UINT8) SectorCount;
-  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->SectorCount

Re: [edk2] [Patch] BaseTools/BinToPcd: Open output file as text file

2018-08-05 Thread Zhu, Yonghong
Reviewed-by: Yonghong Zhu  

Best Regards,
Zhu Yonghong

-Original Message-
From: Sun, Yanyan 
Sent: Monday, August 6, 2018 10:17 AM
To: Kinney, Michael D ; edk2-devel@lists.01.org
Cc: Zhu, Yonghong ; Gao, Liming ; 
Sun, Yanyan 
Subject: RE: [Patch] BaseTools/BinToPcd: Open output file as text file

Mike:

Tried this patch, seems that the issue is fixed.

-Original Message-
From: Kinney, Michael D
Sent: Saturday, August 04, 2018 4:48 AM
To: edk2-devel@lists.01.org
Cc: Sun, Yanyan ; Zhu, Yonghong ; 
Gao, Liming ; Kinney, Michael D 

Subject: [Patch] BaseTools/BinToPcd: Open output file as text file

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

Undo changes from following commit:

https://github.com/tianocore/edk2/commit/83964ebc5e74549d6efc7134af19150a0b2079aa

Change the open mode for the output file from 'wb' to 'w' so the output file is 
written as a text file and not a binary file.

This resolves the issue where the text file was not writable from Python 3.x 
and also removes b'' from output file when the string was encoded as a 
bytearray.

Cc: YanYan Sun 
Cc: Yonghong Zhu 
Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney 
---
 BaseTools/Scripts/BinToPcd.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/BaseTools/Scripts/BinToPcd.py b/BaseTools/Scripts/BinToPcd.py 
index 1495a36933..316cc6117f 100644
--- a/BaseTools/Scripts/BinToPcd.py
+++ b/BaseTools/Scripts/BinToPcd.py
@@ -70,8 +70,7 @@ if __name__ == '__main__':
 #
 # Return a PCD value of the form '{0x01, 0x02, ...}' along with the 
PCD length in bytes
 #
-PcdValue = '{' + ', '.join (['0x{Byte:02X}'.format (Byte = Item) for 
Item in Buffer]) + '}'
-return PcdValue.encode (), len (Buffer)
+return '{' + (', '.join (['0x{Byte:02X}'.format (Byte = Item) 
+ for Item in Buffer])) + '}', len (Buffer)
 
 #
 # Create command line argument parser object @@ -81,7 +80,7 @@ if __name__ 
== '__main__':
   conflict_handler = 'resolve')
 parser.add_argument ("-i", "--input", dest = 'InputFile', type = 
argparse.FileType ('rb'), action='append', required = True,
  help = "Input binary filename.  Multiple input files 
are combined into a single PCD.")
-parser.add_argument ("-o", "--output", dest = 'OutputFile', type = 
argparse.FileType ('wb'),
+parser.add_argument ("-o", "--output", dest = 'OutputFile', type = 
+ argparse.FileType ('w'),
  help = "Output filename for PCD value or PCD 
statement")
 parser.add_argument ("-p", "--pcd", dest = 'PcdName', type = 
ValidatePcdName,
  help = "Name of the PCD in the form 
.")
--
2.14.2.windows.3

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


Re: [edk2] [PATCH v2 7/7] ShellPkg/UefiShellLib: rebase ShellOpenFileByDevicePath() to UefiLib API

2018-08-05 Thread Ni, Ruiyu

On 8/3/2018 8:15 PM, Laszlo Ersek wrote:

Replace the "old shell method" implementation in
ShellOpenFileByDevicePath() with EfiOpenFileByDevicePath() from UefiLib,
correcting the following issues:

- code duplication between this module and other modules,
- local variable name "EfiSimpleFileSystemProtocol" starting with "Efi"
   prefix,
- bogus "FileHandle = NULL" assignments,
- leaking "Handle1" when the device path type/subtype check or the
   realignment-motivated AllocateCopyPool() fails in the loop.

Cc: Jaben Carsey 
Cc: Ruiyu Ni 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1008
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek 
Reviewed-by: Jaben Carsey 
---

Notes:
 v2:
 - pick up Jaben's R-b

  ShellPkg/Library/UefiShellLib/UefiShellLib.inf |   1 -
  ShellPkg/Library/UefiShellLib/UefiShellLib.c   | 113 +---
  2 files changed, 3 insertions(+), 111 deletions(-)

diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.inf 
b/ShellPkg/Library/UefiShellLib/UefiShellLib.inf
index 38d9a4b81f5f..aacddbbf9765 100644
--- a/ShellPkg/Library/UefiShellLib/UefiShellLib.inf
+++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.inf
@@ -51,7 +51,6 @@ [LibraryClasses]
SortLib
  
  [Protocols]

-  gEfiSimpleFileSystemProtocolGuid  ## SOMETIMES_CONSUMES
gEfiUnicodeCollation2ProtocolGuid ## CONSUMES
  
# shell 2.0

diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c 
b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
index 18c3be4a8bc7..f04adbb63ffe 100644
--- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
+++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
@@ -504,12 +504,7 @@ ShellOpenFileByDevicePath(
  {
CHAR16  *FileName;
EFI_STATUS  Status;
-  EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *EfiSimpleFileSystemProtocol;
-  EFI_FILE_PROTOCOL   *Handle1;
-  EFI_FILE_PROTOCOL   *Handle2;
-  CHAR16  *FnafPathName;
-  UINTN   PathLen;
-  EFI_HANDLE  DeviceHandle;
+  EFI_FILE_PROTOCOL   *File;
  
if (FilePath == NULL || FileHandle == NULL) {

  return (EFI_INVALID_PARAMETER);
@@ -535,117 +530,15 @@ ShellOpenFileByDevicePath(
//
// use old shell method.
//
-  Status = gBS->LocateDevicePath (&gEfiSimpleFileSystemProtocolGuid,
-  FilePath,
-  &DeviceHandle);
+  Status = EfiOpenFileByDevicePath (FilePath, &File, OpenMode, Attributes);
if (EFI_ERROR (Status)) {
  return Status;
}
-  Status = gBS->OpenProtocol(DeviceHandle,
- &gEfiSimpleFileSystemProtocolGuid,
- (VOID**)&EfiSimpleFileSystemProtocol,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL);
-  if (EFI_ERROR (Status)) {
-return Status;
-  }
-  Status = EfiSimpleFileSystemProtocol->OpenVolume(EfiSimpleFileSystemProtocol, 
&Handle1);
-  if (EFI_ERROR (Status)) {
-FileHandle = NULL;
-return Status;
-  }
-
-  //
-  // go down directories one node at a time.
-  //
-  while (!IsDevicePathEnd (*FilePath)) {
-//
-// For file system access each node should be a file path component
-//
-if (DevicePathType(*FilePath) != MEDIA_DEVICE_PATH ||
-DevicePathSubType (*FilePath) != MEDIA_FILEPATH_DP
-   ) {
-  FileHandle = NULL;
-  return (EFI_INVALID_PARAMETER);
-}
-//
-// Open this file path node
-//
-Handle2  = Handle1;
-Handle1 = NULL;
-
-//
-// File Name Alignment Fix (FNAF)
-// Handle2->Open may be incapable of handling a unaligned CHAR16 data.
-// The structure pointed to by FilePath may be not CHAR16 aligned.
-// This code copies the potentially unaligned PathName data from the
-// FilePath structure to the aligned FnafPathName for use in the
-// calls to Handl2->Open.
-//
-
-//
-// Determine length of PathName, in bytes.
-//
-PathLen = DevicePathNodeLength (*FilePath) - SIZE_OF_FILEPATH_DEVICE_PATH;
-
-//
-// Allocate memory for the aligned copy of the string Extra allocation is 
to allow for forced alignment
-// Copy bytes from possibly unaligned location to aligned location
-//
-FnafPathName = AllocateCopyPool(PathLen, (UINT8 
*)((FILEPATH_DEVICE_PATH*)*FilePath)->PathName);
-if (FnafPathName == NULL) {
-  return EFI_OUT_OF_RESOURCES;
-}
-
-//
-// Try to test opening an existing file
-//
-Status = Handle2->Open (
-  Handle2,
-  &Handle1,
-  FnafPathName,
-  OpenMode &~EFI_FILE_MODE_CREATE,
-  0
- );
-
-//
-// see if the error was that it needs to be created
-//
-if ((EFI_ERR

Re: [edk2] [PATCH v2 6/7] ShellPkg/UefiShellLib: drop DeviceHandle param of ShellOpenFileByDevicePath()

2018-08-05 Thread Ni, Ruiyu

On 8/3/2018 8:15 PM, Laszlo Ersek wrote:

The ShellOpenFileByDevicePath() API promises to set the DeviceHandle
output parameter to the handle of the filesystem identified by the
FilePath input parameter. However, this doesn't actually happen when the
UEFI Shell 2.0 method is used (which is basically "always" nowadays).

Accordingly, the only caller of ShellOpenFileByDevicePath(), namely
ShellOpenFileByName(), defines a (dummy) local DeviceHandle variable just
so it can call ShellOpenFileByDevicePath().

Remove the useless output parameter.

Cc: Jaben Carsey 
Cc: Ruiyu Ni 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1008
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek 
Reviewed-by: Jaben Carsey 
---

Notes:
 v2:
 - pick up Jaben's R-b

  ShellPkg/Library/UefiShellLib/UefiShellLib.inf |  2 +-
  ShellPkg/Include/Library/ShellLib.h|  2 --
  ShellPkg/Library/UefiShellLib/UefiShellLib.c   | 11 ---
  3 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.inf 
b/ShellPkg/Library/UefiShellLib/UefiShellLib.inf
index 0df632378fe6..38d9a4b81f5f 100644
--- a/ShellPkg/Library/UefiShellLib/UefiShellLib.inf
+++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.inf
@@ -19,7 +19,7 @@ [Defines]
BASE_NAME  = UefiShellLib
FILE_GUID  = 449D0F00-2148-4a43-9836-F10B3980ECF5
MODULE_TYPE= UEFI_DRIVER
-  VERSION_STRING = 1.1
+  VERSION_STRING = 1.2
LIBRARY_CLASS  = ShellLib|UEFI_APPLICATION UEFI_DRIVER 
DXE_RUNTIME_DRIVER DXE_DRIVER
CONSTRUCTOR= ShellLibConstructor
DESTRUCTOR = ShellLibDestructor
diff --git a/ShellPkg/Include/Library/ShellLib.h 
b/ShellPkg/Include/Library/ShellLib.h
index e360a67ac751..92fddc50f5dd 100644
--- a/ShellPkg/Include/Library/ShellLib.h
+++ b/ShellPkg/Include/Library/ShellLib.h
@@ -89,7 +89,6 @@ ShellSetFileInfo (
  
@param[in, out]  FilePath  On input, the device path to the file.  On output,

   the remaining device path.
-  @param[out]   DeviceHandle Pointer to the system device handle.
@param[out]   FileHandle   Pointer to the file handle.
@param[in]OpenMode The mode to open the file with.
@param[in]Attributes   The file's file attributes.
@@ -115,7 +114,6 @@ EFI_STATUS
  EFIAPI
  ShellOpenFileByDevicePath(
IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath,
-  OUT EFI_HANDLE  *DeviceHandle,
OUT SHELL_FILE_HANDLE   *FileHandle,
IN UINT64   OpenMode,
IN UINT64   Attributes
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c 
b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
index 3c24ba1742bf..18c3be4a8bc7 100644
--- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
+++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
@@ -472,7 +472,6 @@ ShellSetFileInfo (
  
@param  FilePathon input the device path to the file.  On output

the remaining device path.
-  @param  DeviceHandlepointer to the system device handle.
@param  FileHandle  pointer to the file handle.
@param  OpenModethe mode to open the file with.
@param  Attributes  the file's file attributes.
@@ -498,7 +497,6 @@ EFI_STATUS
  EFIAPI
  ShellOpenFileByDevicePath(
IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath,
-  OUT EFI_HANDLE  *DeviceHandle,
OUT SHELL_FILE_HANDLE   *FileHandle,
IN UINT64   OpenMode,
IN UINT64   Attributes
@@ -511,8 +509,9 @@ ShellOpenFileByDevicePath(
EFI_FILE_PROTOCOL   *Handle2;
CHAR16  *FnafPathName;
UINTN   PathLen;
+  EFI_HANDLE  DeviceHandle;
  
-  if (FilePath == NULL || FileHandle == NULL || DeviceHandle == NULL) {

+  if (FilePath == NULL || FileHandle == NULL) {
  return (EFI_INVALID_PARAMETER);
}
  
@@ -538,11 +537,11 @@ ShellOpenFileByDevicePath(

//
Status = gBS->LocateDevicePath (&gEfiSimpleFileSystemProtocolGuid,
FilePath,
-  DeviceHandle);
+  &DeviceHandle);
if (EFI_ERROR (Status)) {
  return Status;
}
-  Status = gBS->OpenProtocol(*DeviceHandle,
+  Status = gBS->OpenProtocol(DeviceHandle,
   &gEfiSimpleFileSystemProtocolGuid,
   (VOID**)&EfiSimpleFileSystemProtocol,
   gImageHandle,
@@ -690,7 +689,6 @@ ShellOpenFileByName(
IN UINT64 Attributes
)
  {
-  EFI_HANDLEDeviceHandle;
EFI_DEVICE_PATH_PROTOCOL  *FilePath;
EFI_STATUS

Re: [edk2] [PATCH v2 1/7] MdePkg/UefiLib: introduce EfiOpenFileByDevicePath()

2018-08-05 Thread Ni, Ruiyu

On 8/3/2018 8:15 PM, Laszlo Ersek wrote:

The EfiOpenFileByDevicePath() function centralizes functionality from

- MdeModulePkg/Universal/Disk/RamDiskDxe
- NetworkPkg/TlsAuthConfigDxe
- SecurityPkg/VariableAuthenticated/SecureBootConfigDxe
- ShellPkg/Library/UefiShellLib

unifying the implementation and fixing various bugs.

(Ray suggested that we eliminate the special handling of
EFI_FILE_MODE_CREATE in the "OpenMode" input parameter as well. We plan to
implement that separately, under
.)

Cc: Chao Zhang 
Cc: Eric Dong 
Cc: Jaben Carsey 
Cc: Jiaxin Wu 
Cc: Jiewen Yao 
Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Roman Bacik 
Cc: Ruiyu Ni 
Cc: Siyuan Fu 
Cc: Star Zeng 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1008
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek 
---

Notes:
 v2:
 
 - add the following sentence to the FilePath parameter's documentation:

   "The caller is responsible for ensuring that the device path
   pointed-to by FilePath is well-formed." [Jiewen]
 
 - lift the definition of the local variables that relate to the current

   device path node from the loop to the top of the function
   ("FilePathNode", "AlignedPathName", "PathName", "NextFile") [Ray]
 
 - report new TianoCore BZ

    -- "don't
   distinguish EFI_FILE_MODE_CREATE in EfiOpenFileByDevicePath() /
   OpenMode" --, and reference it in the commit message, as future work
   [Ray]
 
 - explain ASSERT (EFI_ERROR (Status)) -- as opposed to

   ASSERT_EFI_ERROR (Status) -- with a code comment [Jaben, Ray]
 
 - pick up none of the received Reviewed-by tags (namely from Jaben,

   Liming, and Ray) due to the *sum* of changes above

  MdePkg/Library/UefiLib/UefiLib.inf |   1 +
  MdePkg/Include/Library/UefiLib.h   |  88 
  MdePkg/Library/UefiLib/UefiLib.c   | 227 
  3 files changed, 316 insertions(+)

diff --git a/MdePkg/Library/UefiLib/UefiLib.inf 
b/MdePkg/Library/UefiLib/UefiLib.inf
index f69f0a43b576..a6c739ef3d6d 100644
--- a/MdePkg/Library/UefiLib/UefiLib.inf
+++ b/MdePkg/Library/UefiLib/UefiLib.inf
@@ -68,6 +68,7 @@ [Protocols]
gEfiSimpleTextOutProtocolGuid   ## SOMETIMES_CONSUMES
gEfiGraphicsOutputProtocolGuid  ## SOMETIMES_CONSUMES
gEfiHiiFontProtocolGuid ## SOMETIMES_CONSUMES
+  gEfiSimpleFileSystemProtocolGuid## SOMETIMES_CONSUMES
gEfiUgaDrawProtocolGuid | gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport 
## SOMETIMES_CONSUMES # Consumes if gEfiGraphicsOutputProtocolGuid 
uninstalled
gEfiComponentNameProtocolGuid  | NOT 
gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable   ## SOMETIMES_PRODUCES # User 
chooses to produce it
gEfiComponentName2ProtocolGuid | NOT 
gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable  ## SOMETIMES_PRODUCES # User 
chooses to produce it
diff --git a/MdePkg/Include/Library/UefiLib.h b/MdePkg/Include/Library/UefiLib.h
index 7c6fde620c74..f950f1c9c648 100644
--- a/MdePkg/Include/Library/UefiLib.h
+++ b/MdePkg/Include/Library/UefiLib.h
@@ -33,6 +33,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
  #include 
  #include 
  #include 
+#include 
+#include 
  
  #include 
  
@@ -1520,4 +1522,90 @@ EfiLocateProtocolBuffer (

OUT UINTN *NoProtocols,
OUT VOID  ***Buffer
);
+
+/**
+  Open or create a file or directory, possibly creating the chain of
+  directories leading up to the directory.
+
+  EfiOpenFileByDevicePath() first locates EFI_SIMPLE_FILE_SYSTEM_PROTOCOL on
+  FilePath, and opens the root directory of that filesystem with
+  EFI_SIMPLE_FILE_SYSTEM_PROTOCOL.OpenVolume().
+
+  On the remaining device path, the longest initial sequence of
+  FILEPATH_DEVICE_PATH nodes is node-wise traversed with
+  EFI_FILE_PROTOCOL.Open(). For the pathname fragment specified by each
+  traversed FILEPATH_DEVICE_PATH node, EfiOpenFileByDevicePath() first masks
+  EFI_FILE_MODE_CREATE out of OpenMode, and passes 0 for Attributes. If
+  EFI_FILE_PROTOCOL.Open() fails, and OpenMode includes EFI_FILE_MODE_CREATE,
+  then the operation is retried with the caller's OpenMode and Attributes
+  unmodified.
+
+  (As a consequence, if OpenMode includes EFI_FILE_MODE_CREATE, and Attributes
+  includes EFI_FILE_DIRECTORY, and each FILEPATH_DEVICE_PATH specifies a single
+  pathname component, then EfiOpenFileByDevicePath() ensures that the specified
+  series of subdirectories exist on return.)
+
+  The EFI_FILE_PROTOCOL identified by the last FILEPATH_DEVICE_PATH node is
+  output to the caller; intermediate EFI_FILE_PROTOCOL instances are closed. If
+  there are no FILEPATH_DEVICE_PATH nodes past the node that identifies the
+  filesystem, then the EFI_FILE_PROTOCOL of the root directory of the
+  filesystem is 

[edk2] [PATCH] BaseTools: Optimizing code for function doesn't match

2018-08-05 Thread Feng, YunhuaX
Optimizing code for function doesn't match name and comment

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

Cc: Liming Gao 
Cc: Yonghong Zhu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng 
---
 BaseTools/Source/Python/AutoGen/BuildEngine.py | 30 --
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/BuildEngine.py 
b/BaseTools/Source/Python/AutoGen/BuildEngine.py
index 8a32343846..4291da9001 100644
--- a/BaseTools/Source/Python/AutoGen/BuildEngine.py
+++ b/BaseTools/Source/Python/AutoGen/BuildEngine.py
@@ -528,30 +528,28 @@ class BuildRule:
 ExtraData="Unknown subsection: %s" % 
self.RuleContent[LineIndex])
 ## Parse  sub-section
 #
 #   @param  LineIndex   The line index of build rule text
 #
-def ParseInputFile(self, LineIndex):
+def ParseInputFileSubSection(self, LineIndex):
 FileList = [File.strip() for File in 
self.RuleContent[LineIndex].split(",")]
 for ToolChainFamily in self._FamilyList:
-InputFiles = self._RuleInfo[ToolChainFamily, self._State]
-if InputFiles is None:
-InputFiles = []
-self._RuleInfo[ToolChainFamily, self._State] = InputFiles
-InputFiles.extend(FileList)
+if self._RuleInfo[ToolChainFamily, self._State] is None:
+self._RuleInfo[ToolChainFamily, self._State] = []
+self._RuleInfo[ToolChainFamily, self._State].extend(FileList)
 
 ## Parse  sub-section
+## Parse  sub-section
+## Parse  sub-section
 #
 #   @param  LineIndex   The line index of build rule text
 #
-def ParseCommon(self, LineIndex):
+def ParseCommonSubSection(self, LineIndex):
 for ToolChainFamily in self._FamilyList:
-Items = self._RuleInfo[ToolChainFamily, self._State]
-if Items is None:
-Items = []
-self._RuleInfo[ToolChainFamily, self._State] = Items
-Items.append(self.RuleContent[LineIndex])
+if self._RuleInfo[ToolChainFamily, self._State] is None:
+self._RuleInfo[ToolChainFamily, self._State] = []
+self._RuleInfo[ToolChainFamily, 
self._State].append(self.RuleContent[LineIndex])
 
 ## Get a build rule via [] operator
 #
 #   @param  FileExt The extension of a file
 #   @param  ToolChainFamily The tool chain family name
@@ -582,14 +580,14 @@ class BuildRule:
 _StateHandler = {
 _SectionHeader : ParseSectionHeader,
 _Section   : ParseSection,
 _SubSectionHeader  : ParseSubSectionHeader,
 _SubSection: ParseSubSection,
-_InputFile : ParseInputFile,
-_OutputFile: ParseCommon,
-_ExtraDependency   : ParseCommon,
-_Command   : ParseCommon,
+_InputFile : ParseInputFileSubSection,
+_OutputFile: ParseCommonSubSection,
+_ExtraDependency   : ParseCommonSubSection,
+_Command   : ParseCommonSubSection,
 _UnknownSection: SkipSection,
 }
 
 # This acts like the main() function for the script, unless it is 'import'ed 
into another
 # script.
-- 
2.12.2.windows.2

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


[edk2] [PATCH] BaseTools: Debug message make confused

2018-08-05 Thread Feng, YunhuaX
Debug message make confused

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

Cc: Liming Gao 
Cc: Yonghong Zhu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng 
---
 BaseTools/Source/Python/AutoGen/AutoGen.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py 
b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 06ff84b4cd..033ad644c1 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -3238,11 +3238,11 @@ class ModuleAutoGen(AutoGen):
 ToolChainFamilySet = {"", "*", self.ToolChainFamily, 
self.BuildRuleFamily}
 for F in self.Module.Sources:
 # match tool chain
 if F.TagName not in ToolChainTagSet:
 EdkLogger.debug(EdkLogger.DEBUG_9, "The toolchain [%s] for 
processing file [%s] is found, "
-"but [%s] is needed" % (F.TagName, str(F), 
self.ToolChain))
+"but [%s] is currently used" % (F.TagName, 
str(F), self.ToolChain))
 continue
 # match tool chain family or build rule family
 if F.ToolChainFamily not in ToolChainFamilySet:
 EdkLogger.debug(
 EdkLogger.DEBUG_0,
-- 
2.12.2.windows.2

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


[edk2] [PATCH] BaseTools: Use gGuidPattern for Guid regular expression

2018-08-05 Thread Feng, YunhuaX
Use GlobalData.py gGuidPattern for Guid regular expression

Cc: Liming Gao 
Cc: Yonghong Zhu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng 
---
 BaseTools/Source/Python/GenFds/GenFds.py | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/BaseTools/Source/Python/GenFds/GenFds.py 
b/BaseTools/Source/Python/GenFds/GenFds.py
index 156aae1d0e..2307a19cbe 100644
--- a/BaseTools/Source/Python/GenFds/GenFds.py
+++ b/BaseTools/Source/Python/GenFds/GenFds.py
@@ -42,10 +42,11 @@ from Common.Misc import GuidStructureStringToGuidString
 from Common.BuildVersion import gBUILD_VERSION
 from Common.MultipleWorkspace import MultipleWorkspace as mws
 from . import FfsFileStatement
 import glob
 from struct import unpack
+from Common.GlobalData import gGuidPattern
 
 ## Version and Copyright
 versionNumber = "1.0" + ' ' + gBUILD_VERSION
 __version__ = "%prog Version " + versionNumber
 __copyright__ = "Copyright (c) 2007 - 2018, Intel Corporation  All rights 
reserved."
@@ -603,15 +604,11 @@ class GenFds :
 GuidXRefFileName = os.path.join(GenFdsGlobalVariable.FvDir, 
"Guid.xref")
 GuidXRefFile = BytesIO('')
 GuidDict = {}
 ModuleList = []
 FileGuidList = []
-GuidPattern = re.compile("\s*([0-9a-fA-F]){8}-"
-   "([0-9a-fA-F]){4}-"
-   "([0-9a-fA-F]){4}-"
-   "([0-9a-fA-F]){4}-"
-   "([0-9a-fA-F]){12}\s*")
+GuidPattern = gGuidPattern
 for Arch in ArchList:
 PlatformDataBase = 
BuildDb.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, 
GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
 for ModuleFile in PlatformDataBase.Modules:
 Module = BuildDb.BuildObject[ModuleFile, Arch, 
GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
 if Module in ModuleList:
-- 
2.12.2.windows.2

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


[edk2] [platforms: PATCH 5/9] Marvell/Armada80x0McBin: Enable device tree support

2018-08-05 Thread Marcin Wojtas
This patch enables compilation of the Armada 8040 MacchiatoBin
device tree. Dsable OS acccess to the SPI flash and extend
PCI ranges to use 256MB mmio32 and 4GB mmio64.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas 
---
 Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc   |  3 +++
 Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0McBin.inf   | 28 

 Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc   |  3 +++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-mcbin.dts |  5 +++-
 4 files changed, 38 insertions(+), 1 deletion(-)
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0McBin.inf

diff --git a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc 
b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc
index e1f5827..e6cb0d6 100644
--- a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc
+++ b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc
@@ -49,6 +49,9 @@
 
 !include Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
 
+[Components.common]
+  Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0McBin.inf
+
 

 #
 # Pcd Section - list of all EDK II PCD Entries defined by this Platform
diff --git a/Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0McBin.inf 
b/Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0McBin.inf
new file mode 100644
index 000..810a52b
--- /dev/null
+++ b/Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0McBin.inf
@@ -0,0 +1,28 @@
+## @file
+#
+#  Device tree description of the Marvell Armada 8040 MacchiatoBin platform
+#
+#  Copyright (c) 2018, Marvell International 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  = Armada80x0McBinDeviceTree
+  FILE_GUID  = 25462CDA-221F-47DF-AC1D-259CFAA4E326 # 
gDtPlatformDefaultDtbFileGuid
+  MODULE_TYPE= USER_DEFINED
+  VERSION_STRING = 1.0
+
+[Sources]
+  armada-8040-mcbin.dts
+
+[Packages]
+  MdePkg/MdePkg.dec
diff --git a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc 
b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc
index 984cf7e..4eb1496 100644
--- a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc
+++ b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc
@@ -11,3 +11,6 @@
 #
 
 # Per-board additional content of the DXE phase firmware volume
+
+  # DTB
+  INF RuleOverride = DTB 
Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0McBin.inf
diff --git a/Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-mcbin.dts 
b/Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-mcbin.dts
index 0e20e70..b86e27e 100644
--- a/Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-mcbin.dts
+++ b/Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-mcbin.dts
@@ -185,6 +185,9 @@
 num-lanes = <4>;
 num-viewport = <8>;
 reset-gpio = <&cp0_gpio1 20 GPIO_ACTIVE_LOW>;
+ranges = <0x100 0x0 0x 0x0 0xeff0 0x0 0x0001>,
+ <0x200 0x0 0xc000 0x0 0xc000 0x0 0x2000>,
+ <0x300 0x8 0x 0x8 0x 0x1 0x>;
 status = "okay";
 };
 
@@ -355,7 +358,7 @@
 &cp1_spi1 {
 pinctrl-names = "default";
 pinctrl-0 = <&cp1_spi1_pins>;
-status = "okay";
+status = "disabled";
 
 spi-flash@0 {
 compatible = "st,w25q32";
-- 
2.7.4

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


[edk2] [platforms: PATCH 7/9] Marvell/Armada70x0Db: Enable ACPI support

2018-08-05 Thread Marcin Wojtas
This patch introduces DSDT table and adds necessary
wiring in order to enable ACPI support on Armada 7040 DB.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas 
---
 Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc |  14 ++
 Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc|   3 +
 Silicon/Marvell/Armada7k8k/Armada7k8k.fdf |  12 +
 Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf |  61 ++
 Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc|   5 +
 Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/Dsdt.asl   | 229 

 Silicon/Marvell/Documentation/PortingGuide.txt|  22 ++
 7 files changed, 346 insertions(+)
 create mode 100644 
Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/Dsdt.asl

diff --git a/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc 
b/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
index f1ccda0..d4c67a2 100644
--- a/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
+++ b/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
@@ -593,6 +593,20 @@
   ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
 !endif #$(INCLUDE_TFTP_COMMAND)
 
+[Components.AARCH64]
+  #
+  # Generic ACPI modules
+  #
+  MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
+  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf {
+
+  
PlatformHasAcpiLib|EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf
+
+
+  # support ACPI v5.0 or later
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions|0x20
+  }
+
 
[BuildOptions.common.EDKII.DXE_CORE,BuildOptions.common.EDKII.DXE_DRIVER,BuildOptions.common.EDKII.UEFI_DRIVER,BuildOptions.common.EDKII.UEFI_APPLICATION]
   GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
 
diff --git a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc 
b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
index d3dffb0..f6faff1 100644
--- a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
+++ b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
@@ -51,6 +51,9 @@
 [Components.common]
   Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf
 
+[Components.AARCH64]
+  Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
+
 

 #
 # Pcd Section - list of all EDK II PCD Entries defined by this Platform
diff --git a/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf 
b/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
index 909ad3e..c064a43 100644
--- a/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
+++ b/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
@@ -215,6 +215,12 @@ FvNameGuid = 5eda4200-2c5f-43cb-9da3-0baf74b1b30c
   # DTB
   INF EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf
 
+!if $(ARCH) == AARCH64
+  # ACPI support
+  INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
+  INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
+!endif
+
 !include $(BOARD_DXE_FV_COMPONENTS)
 
 # PEI phase firmware volume
@@ -408,3 +414,9 @@ READ_LOCK_STATUS   = TRUE
   FILE FREEFORM = $(NAMED_GUID) {
 RAW BIN|.dtb
   }
+
+[Rule.Common.USER_DEFINED.ACPITABLE]
+  FILE FREEFORM = $(NAMED_GUID) {
+RAW ASL|.aml
+RAW ACPI   |.acpi
+  }
diff --git a/Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf 
b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
new file mode 100644
index 000..8732e10
--- /dev/null
+++ b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
@@ -0,0 +1,61 @@
+## @file
+#  Component description file for PlatformAcpiTables module.
+#
+#  ACPI table data and ASL sources required to boot the platform.
+#
+#  Copyright (c) 2018, Linaro, Ltd. All rights reserved.
+#  Copyright (C) 2018, Marvell International Ltd. and its affiliates.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution.  The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php
+#
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+##
+
+[Defines]
+  INF_VERSION= 0x0001001A
+  BASE_NAME  = PlatformAcpiTables
+  FILE_GUID  = 7E374E25-8E01-4FEE-87F2-390C23C606CD
+  MODULE_TYPE= USER_DEFINED
+  VERSION_STRING = 1.0
+
+[Sources]
+  Dsdt.asl
+  ../Fadt.aslc
+  ../Gtdt.aslc
+  ../Madt.aslc
+  ../Pptt.aslc
+  ../Spcr.aslc
+
+[Packages]
+  ArmPkg/ArmPkg.dec
+  ArmPlatformPkg/ArmPlatformPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  MdePkg/MdePkg.dec
+  Silic

[edk2] [platforms: PATCH 9/9] Marvell/Armada80x0McBin: Enable ACPI support

2018-08-05 Thread Marcin Wojtas
This patch introduces DSDT table and adds necessary wiring
in order to enable ACPI support on Armada 8040 MacchiatoBin.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas 
---
 Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc|   3 +
 Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/AcpiTables.inf |  61 
 Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc|   4 +
 Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/Dsdt.asl   | 310 

 4 files changed, 378 insertions(+)
 create mode 100644 
Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/AcpiTables.inf
 create mode 100644 
Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/Dsdt.asl

diff --git a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc 
b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc
index e6cb0d6..bb96e4c 100644
--- a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc
+++ b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc
@@ -52,6 +52,9 @@
 [Components.common]
   Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0McBin.inf
 
+[Components.AARCH64]
+  Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/AcpiTables.inf
+
 

 #
 # Pcd Section - list of all EDK II PCD Entries defined by this Platform
diff --git 
a/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/AcpiTables.inf 
b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/AcpiTables.inf
new file mode 100644
index 000..66b1124
--- /dev/null
+++ b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/AcpiTables.inf
@@ -0,0 +1,61 @@
+## @file
+#  Component description file for PlatformAcpiTables module.
+#
+#  ACPI table data and ASL sources required to boot the platform.
+#
+#  Copyright (c) 2018, Linaro, Ltd. All rights reserved.
+#  Copyright (C) 2018, Marvell International Ltd. and its affiliates.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution.  The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php
+#
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+##
+
+[Defines]
+  INF_VERSION= 0x0001001A
+  BASE_NAME  = PlatformAcpiTables
+  FILE_GUID  = 7E374E25-8E01-4FEE-87F2-390C23C606CD
+  MODULE_TYPE= USER_DEFINED
+  VERSION_STRING = 1.0
+
+[Sources]
+  Dsdt.asl
+  ../Fadt.aslc
+  ../Gtdt.aslc
+  ../Madt.aslc
+  ../Pptt.aslc
+  ../Spcr.aslc
+
+[Packages]
+  ArmPkg/ArmPkg.dec
+  ArmPlatformPkg/ArmPlatformPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  MdePkg/MdePkg.dec
+  Silicon/Marvell/Marvell.dec
+
+[FixedPcd]
+  gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase
+  gArmTokenSpaceGuid.PcdGicDistributorBase
+
+  gArmPlatformTokenSpaceGuid.PcdCoreCount
+
+  gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum
+  gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
+  gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum
+  gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum
+
+  gArmTokenSpaceGuid.PcdGenericWatchdogControlBase
+  gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase
+  gArmTokenSpaceGuid.PcdGenericWatchdogEl2IntrNum
+
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate
+
+[BuildOptions]
+  *_*_*_ASLCC_FLAGS = -DARMADA8K
diff --git a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc 
b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc
index 4eb1496..3a6e945 100644
--- a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc
+++ b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc
@@ -14,3 +14,7 @@
 
   # DTB
   INF RuleOverride = DTB 
Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0McBin.inf
+
+!if $(ARCH) == AARCH64
+  INF RuleOverride = ACPITABLE 
Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/AcpiTables.inf
+!endif
diff --git a/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/Dsdt.asl 
b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/Dsdt.asl
new file mode 100644
index 000..87cb93a
--- /dev/null
+++ b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/Dsdt.asl
@@ -0,0 +1,310 @@
+/** @file
+
+  Differentiated System Description Table Fields (DSDT)
+
+  Copyright (c) 2018, Linaro 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 KI

[edk2] [platforms: PATCH 8/9] Marvell/Armada80x0Db: Enable ACPI support

2018-08-05 Thread Marcin Wojtas
This patch introduces DSDT table and adds necessary
wiring in order to enable ACPI support on Armada 8040 DB.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas 
---
 Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc|   3 +
 Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db/AcpiTables.inf |  61 
 Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc|   5 +
 Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db/Dsdt.asl   | 330 

 4 files changed, 399 insertions(+)
 create mode 100644 
Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db/AcpiTables.inf
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db/Dsdt.asl

diff --git a/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc 
b/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc
index 3fc33d4..e2b1156 100644
--- a/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc
+++ b/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc
@@ -51,6 +51,9 @@
 [Components.common]
   Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0Db.inf
 
+[Components.AARCH64]
+  Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db/AcpiTables.inf
+
 

 #
 # Pcd Section - list of all EDK II PCD Entries defined by this Platform
diff --git a/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db/AcpiTables.inf 
b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db/AcpiTables.inf
new file mode 100644
index 000..1e440f7
--- /dev/null
+++ b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db/AcpiTables.inf
@@ -0,0 +1,61 @@
+## @file
+#  Component description file for PlatformAcpiTables module.
+#
+#  ACPI table data and ASL sources required to boot the platform.
+#
+#  Copyright (c) 2018, Linaro, Ltd. All rights reserved.
+#  Copyright (C) 2018, Marvell International Ltd. and its affiliates.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution.  The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php
+#
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010019
+  BASE_NAME  = PlatformAcpiTables
+  FILE_GUID  = 7E374E25-8E01-4FEE-87F2-390C23C606CD
+  MODULE_TYPE= USER_DEFINED
+  VERSION_STRING = 1.0
+
+[Sources]
+  Dsdt.asl
+  ../Fadt.aslc
+  ../Gtdt.aslc
+  ../Madt.aslc
+  ../Pptt.aslc
+  ../Spcr.aslc
+
+[Packages]
+  ArmPkg/ArmPkg.dec
+  ArmPlatformPkg/ArmPlatformPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  MdePkg/MdePkg.dec
+  Silicon/Marvell/Marvell.dec
+
+[FixedPcd]
+  gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase
+  gArmTokenSpaceGuid.PcdGicDistributorBase
+
+  gArmPlatformTokenSpaceGuid.PcdCoreCount
+
+  gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum
+  gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
+  gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum
+  gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum
+
+  gArmTokenSpaceGuid.PcdGenericWatchdogControlBase
+  gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase
+  gArmTokenSpaceGuid.PcdGenericWatchdogEl2IntrNum
+
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate
+
+[BuildOptions]
+  *_*_*_ASLCC_FLAGS = -DARMADA8K
diff --git a/Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc 
b/Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc
index 99e1a11..e902e9f 100644
--- a/Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc
+++ b/Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc
@@ -14,3 +14,8 @@
 
   # DTB
   INF RuleOverride = DTB Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0Db.inf
+
+!if $(ARCH) == AARCH64
+  # ACPI support
+  INF RuleOverride = ACPITABLE 
Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db/AcpiTables.inf
+!endif
diff --git a/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db/Dsdt.asl 
b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db/Dsdt.asl
new file mode 100644
index 000..7c65949
--- /dev/null
+++ b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db/Dsdt.asl
@@ -0,0 +1,330 @@
+/** @file
+
+  Differentiated System Description Table Fields (DSDT)
+
+  Copyright (c) 2018, Linaro Ltd. All rights reserved.
+  Copyright (C) 2018, Marvell International Ltd. and its affiliates.
+
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED

[edk2] [platforms: PATCH 6/9] Marvell/Armada7k8k: Add common ACPI tables

2018-08-05 Thread Marcin Wojtas
This patch adds ACPI tables and necessary headers,
which are common for Armada7k8k SoCs. Per-board
tables and wiring up of support will be done in
the follow-up commits.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas 
---
 Silicon/Marvell/Armada7k8k/AcpiTables/AcpiHeader.h|  45 
 Silicon/Marvell/Armada7k8k/AcpiTables/IcuInterrupts.h |  42 
 Silicon/Marvell/Armada7k8k/AcpiTables/Fadt.aslc   |  86 
 Silicon/Marvell/Armada7k8k/AcpiTables/Gtdt.aslc   |  64 ++
 Silicon/Marvell/Armada7k8k/AcpiTables/Madt.aslc   | 139 +
 Silicon/Marvell/Armada7k8k/AcpiTables/Pptt.aslc   | 216 

 Silicon/Marvell/Armada7k8k/AcpiTables/Spcr.aslc   |  53 +
 7 files changed, 645 insertions(+)
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/AcpiHeader.h
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/IcuInterrupts.h
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Fadt.aslc
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Gtdt.aslc
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Madt.aslc
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Pptt.aslc
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Spcr.aslc

diff --git a/Silicon/Marvell/Armada7k8k/AcpiTables/AcpiHeader.h 
b/Silicon/Marvell/Armada7k8k/AcpiTables/AcpiHeader.h
new file mode 100644
index 000..f5ebd27
--- /dev/null
+++ b/Silicon/Marvell/Armada7k8k/AcpiTables/AcpiHeader.h
@@ -0,0 +1,45 @@
+/** @file
+
+  Multiple APIC Description Table (MADT)
+
+  Copyright (c) 2017, Linaro Ltd. All rights reserved.
+  Copyright (C) 2018, Marvell International Ltd. and its affiliates.
+
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include 
+
+#define ACPI_OEM_ID_ARRAY{'M','V','E','B','U',' '}
+#define ACPI_OEM_REVISION0
+#define ACPI_CREATOR_ID  SIGNATURE_32('L','N','R','O')
+#define ACPI_CREATOR_REVISION0
+
+#if defined(ARMADA7K)
+#define ACPI_OEM_TABLE_IDSIGNATURE_64('A','R','M','A','D','A','7','K')
+#elif defined (ARMADA8K)
+#define ACPI_OEM_TABLE_IDSIGNATURE_64('A','R','M','A','D','A','8','K')
+#endif
+
+/**
+ * A macro to initialize the common header part of EFI ACPI tables
+ * as defined by EFI_ACPI_DESCRIPTION_HEADER structure.
+ **/
+#define __ACPI_HEADER(sign, type, rev) {\
+  sign,   /* UINT32  Signature */   \
+  sizeof (type),  /* UINT32  Length */  \
+  rev,/* UINT8   Revision */\
+  0,  /* UINT8   Checksum */\
+  ACPI_OEM_ID_ARRAY,  /* UINT8   OemId[6] */\
+  ACPI_OEM_TABLE_ID,  /* UINT64  OemTableId */  \
+  ACPI_OEM_REVISION,  /* UINT32  OemRevision */ \
+  ACPI_CREATOR_ID,/* UINT32  CreatorId */   \
+  ACPI_CREATOR_REVISION   /* UINT32  CreatorRevision */ \
+  }
diff --git a/Silicon/Marvell/Armada7k8k/AcpiTables/IcuInterrupts.h 
b/Silicon/Marvell/Armada7k8k/AcpiTables/IcuInterrupts.h
new file mode 100644
index 000..5746ad4
--- /dev/null
+++ b/Silicon/Marvell/Armada7k8k/AcpiTables/IcuInterrupts.h
@@ -0,0 +1,42 @@
+/**
+
+  Copyright (C) 2018, Marvell International Ltd. and its affiliates.
+
+  This program and the accompanying materials are licensed and made available
+  under the terms and conditions of the BSD License which accompanies this
+  distribution. The full text of the license may be found at
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+  Glossary - abbreviations used in Marvell SampleAtReset library 
implementation:
+  ICU - Interrupt Consolidation Unit
+  AP - Application Processor hardware block (Armada 7k8k incorporates AP806)
+  CP - South Bridge hardware blocks (Armada 7k8k incorporates CP110)
+
+**/
+
+#define CP_GIC_SPI_CP0_PCI064
+#define CP_GIC_SPI_CP0_PCI165
+#define CP_GIC_SPI_CP0_PCI266
+#define CP_GIC_SPI_CP0_SDMMC   67
+#define CP_GIC_SPI_PP2_CP0_PORT0   69, 72, 75, 78, 81, 127
+#define CP_GIC_SPI_PP2_CP0_PORT1   70, 73, 76, 79, 82, 126
+#define CP_GIC_SPI_PP2_CP0_PORT2   71, 74, 77, 80, 83, 125
+#define CP_GIC_SPI_CP0_EIP_RNG0105
+#define CP_GIC_SPI_CP0_USB_H1  112
+#define CP_GIC_SPI_CP0_USB_H0  113
+#define CP_GIC_SPI_CP0_SATA_H0 114
+
+#define CP_GIC_SPI_CP1_PCI0288
+#define CP_GIC_SPI_CP1_PCI1289
+#define CP_GIC_SPI

[edk2] [platforms: PATCH 4/9] Marvell/Armada80x0Db: Enable device tree support

2018-08-05 Thread Marcin Wojtas
This patch enables compilation of the Armada 8040 DB
device tree. Also disable OS access to the SPI flash.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas 
---
 Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc   |  3 +++
 Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0Db.inf   | 28 

 Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc   |  3 +++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-db.dts |  2 +-
 4 files changed, 35 insertions(+), 1 deletion(-)
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0Db.inf

diff --git a/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc 
b/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc
index 2d4523f2..3fc33d4 100644
--- a/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc
+++ b/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc
@@ -48,6 +48,9 @@
 
 !include Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
 
+[Components.common]
+  Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0Db.inf
+
 

 #
 # Pcd Section - list of all EDK II PCD Entries defined by this Platform
diff --git a/Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0Db.inf 
b/Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0Db.inf
new file mode 100644
index 000..e4dd41c
--- /dev/null
+++ b/Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0Db.inf
@@ -0,0 +1,28 @@
+## @file
+#
+#  Device tree description of the Marvell Armada 8040 DB platform
+#
+#  Copyright (c) 2018, Marvell International 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  = Armada80x0DbDeviceTree
+  FILE_GUID  = 25462CDA-221F-47DF-AC1D-259CFAA4E326 # 
gDtPlatformDefaultDtbFileGuid
+  MODULE_TYPE= USER_DEFINED
+  VERSION_STRING = 1.0
+
+[Sources]
+  armada-8040-db.dts
+
+[Packages]
+  MdePkg/MdePkg.dec
diff --git a/Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc 
b/Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc
index 984cf7e..99e1a11 100644
--- a/Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc
+++ b/Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc
@@ -11,3 +11,6 @@
 #
 
 # Per-board additional content of the DXE phase firmware volume
+
+  # DTB
+  INF RuleOverride = DTB Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0Db.inf
diff --git a/Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-db.dts 
b/Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-db.dts
index 7518029..e813922 100644
--- a/Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-db.dts
+++ b/Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-db.dts
@@ -213,7 +213,7 @@
 };
 
 &cp1_spi1 {
-status = "okay";
+status = "disabled";
 
 spi-flash@0 {
 #address-cells = <0x1>;
-- 
2.7.4

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


[edk2] [platforms: PATCH 2/9] Marvell/Armada7k8k: Enable including additional DXE FV components

2018-08-05 Thread Marcin Wojtas
Unified .fdf file allows to update all Armada7k8k-based
boards at the same time. However there may be a need
to add unique DXE firmware volume contents like DTB
or ACPI.

For this purpose create empty files for existing boards
that are included as defined in BOARD_DXE_FV_COMPONENTS
macro.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas 
---
 Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc|  1 +
 Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc|  1 +
 Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc |  1 +
 Silicon/Marvell/Armada7k8k/Armada7k8k.fdf |  2 ++
 Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc| 13 +
 Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc| 13 +
 Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc | 13 +
 7 files changed, 44 insertions(+)
 create mode 100644 Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc
 create mode 100644 Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc
 create mode 100644 Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc

diff --git a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc 
b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
index 2240a57..0c08328 100644
--- a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
+++ b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
@@ -44,6 +44,7 @@
   BUILD_TARGETS  = DEBUG|RELEASE|NOOPT
   SKUID_IDENTIFIER   = DEFAULT
   FLASH_DEFINITION   = Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
+  BOARD_DXE_FV_COMPONENTS= 
Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc
 
 !include Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
 
diff --git a/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc 
b/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc
index 2425c45..2d4523f2 100644
--- a/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc
+++ b/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc
@@ -44,6 +44,7 @@
   BUILD_TARGETS  = DEBUG|RELEASE|NOOPT
   SKUID_IDENTIFIER   = DEFAULT
   FLASH_DEFINITION   = Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
+  BOARD_DXE_FV_COMPONENTS= 
Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc
 
 !include Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
 
diff --git a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc 
b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc
index 1baed88..e1f5827 100644
--- a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc
+++ b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc
@@ -44,6 +44,7 @@
   BUILD_TARGETS  = DEBUG|RELEASE|NOOPT
   SKUID_IDENTIFIER   = DEFAULT
   FLASH_DEFINITION   = Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
+  BOARD_DXE_FV_COMPONENTS= 
Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc
   CAPSULE_ENABLE = TRUE
 
 !include Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
diff --git a/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf 
b/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
index 18d5d06..0f38978 100644
--- a/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
+++ b/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
@@ -212,6 +212,8 @@ FvNameGuid = 5eda4200-2c5f-43cb-9da3-0baf74b1b30c
   }
 !endif
 
+!include $(BOARD_DXE_FV_COMPONENTS)
+
 # PEI phase firmware volume
 [FV.FVMAIN_COMPACT]
 FvAlignment= 8
diff --git a/Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc 
b/Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc
new file mode 100644
index 000..984cf7e
--- /dev/null
+++ b/Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc
@@ -0,0 +1,13 @@
+#
+#  Copyright (C) 2018 Marvell International Ltd. and its affiliates
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution.  The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php
+#
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+
+# Per-board additional content of the DXE phase firmware volume
diff --git a/Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc 
b/Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc
new file mode 100644
index 000..984cf7e
--- /dev/null
+++ b/Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc
@@ -0,0 +1,13 @@
+#
+#  Copyright (C) 2018 Marvell International Ltd. and its affiliates
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution.  The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php
+#
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED

[edk2] [platforms: PATCH 1/9] Marvell/Armada7k8k: Import device tree

2018-08-05 Thread Marcin Wojtas
Add a device tree description of the Armada7k8k SoCs,
whose sources are aligned to the Linux v4.18-rc7.
Enablement for each board will be done in the follow-up
commits.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas 
---
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-7020.dtsi   |  16 +
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-7040-db.dts | 267 +++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-7040.dtsi   |  16 +
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-70x0.dtsi   |  64 +++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8020.dtsi   |  26 +
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-db.dts | 336 
+
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-mcbin.dts  | 371 
+++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040.dtsi   |  25 +
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-80x0.dtsi   | 108 +
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-ap806-dual.dtsi |  31 ++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-ap806-quad.dtsi |  43 ++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-ap806.dtsi  | 264 ++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-common.dtsi |  10 +
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-cp110.dtsi  | 503 

 14 files changed, 2080 insertions(+)
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-7020.dtsi
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-7040-db.dts
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-7040.dtsi
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-70x0.dtsi
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8020.dtsi
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-db.dts
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-mcbin.dts
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040.dtsi
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-80x0.dtsi
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-ap806-dual.dtsi
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-ap806-quad.dtsi
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-ap806.dtsi
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-common.dtsi
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-cp110.dtsi

diff --git a/Silicon/Marvell/Armada7k8k/DeviceTree/armada-7020.dtsi 
b/Silicon/Marvell/Armada7k8k/DeviceTree/armada-7020.dtsi
new file mode 100644
index 000..e2edc26
--- /dev/null
+++ b/Silicon/Marvell/Armada7k8k/DeviceTree/armada-7020.dtsi
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2016 Marvell Technology Group Ltd.
+ *
+ * Device Tree file for the Armada 7020 SoC, made of an AP806 Dual and
+ * one CP110.
+ */
+
+#include "armada-ap806-dual.dtsi"
+#include "armada-70x0.dtsi"
+
+/ {
+model = "Marvell Armada 7020";
+compatible = "marvell,armada7020", "marvell,armada-ap806-dual",
+ "marvell,armada-ap806";
+};
diff --git a/Silicon/Marvell/Armada7k8k/DeviceTree/armada-7040-db.dts 
b/Silicon/Marvell/Armada7k8k/DeviceTree/armada-7040-db.dts
new file mode 100644
index 000..6b28bbe
--- /dev/null
+++ b/Silicon/Marvell/Armada7k8k/DeviceTree/armada-7040-db.dts
@@ -0,0 +1,267 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2016 Marvell Technology Group Ltd.
+ *
+ * Device Tree file for Marvell Armada 7040 Development board platform
+ */
+
+#include "armada-7040.dtsi"
+
+#define GPIO_ACTIVE_HIGH 0
+#define GPIO_ACTIVE_LOW  1
+
+/ {
+model = "Marvell Armada 7040 DB board";
+compatible = "marvell,armada7040-db", "marvell,armada7040",
+ "marvell,armada-ap806-quad", "marvell,armada-ap806";
+
+chosen {
+stdout-path = "serial0:115200n8";
+};
+
+memory@0 {
+device_type = "memory";
+reg = <0x0 0x0 0x0 0x8000>;
+};
+
+aliases {
+ethernet0 = &cp0_eth0;
+ethernet1 = &cp0_eth1;
+ethernet2 = &cp0_eth2;
+};
+
+cp0_reg_usb3_0_vbus: cp0-usb3-0-vbus {
+compatible = "regulator-fixed";
+regulator-name = "usb3h0-vbus";
+regulator-min-microvolt = <500>;
+regulator-max-microvolt = <500>;
+enable-active-high;
+gpio = <&expander0 0 GPIO_ACTIVE_HIGH>;
+};
+
+cp0_reg_usb3_1_vbus: cp0-usb3-1-vbus {
+compatible = "regulator-fixed";
+regulator-name = "usb3h1-vbus";
+regulator-min-microvolt = <500>;
+regulator-max-microvolt = <500>;
+enable-active-high;
+gpio = <&expander0 1 GPIO_ACTIVE_HIGH>;
+};
+
+cp0_usb3_0_phy: cp0-usb3-0-phy {
+

[edk2] [platforms: PATCH 0/9] Armada7k8k DT/ACPI support

2018-08-05 Thread Marcin Wojtas
Hi,

This patchset makes enables DT and ACPI support.
For this purpose a way to introduce unique DXE FV
contents is introduced.

The patches are available in the github:
https://github.com/MarvellEmbeddedProcessors/edk2-open-platform/commits/dt-acpi-upstream-r20180806

I'm looking forward to review and any comments/remarks.

Best regards,
Marcin

Marcin Wojtas (9):
  Marvell/Armada7k8k: Import device tree
  Marvell/Armada7k8k: Enable including additional DXE FV components
  Marvell/Armada70x0Db: Enable device tree support
  Marvell/Armada80x0Db: Enable device tree support
  Marvell/Armada80x0McBin: Enable device tree support
  Marvell/Armada7k8k: Add common ACPI tables
  Marvell/Armada70x0Db: Enable ACPI support
  Marvell/Armada80x0Db: Enable ACPI support
  Marvell/Armada80x0McBin: Enable ACPI support

 Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc|  18 +
 Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc   |   7 +
 Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc   |   7 +
 Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc|   7 +
 Silicon/Marvell/Armada7k8k/Armada7k8k.fdf|  22 +
 Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf|  61 +++
 Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db/AcpiTables.inf|  61 +++
 Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/AcpiTables.inf |  61 +++
 Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf   |  28 ++
 Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0Db.inf   |  28 ++
 Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0McBin.inf|  28 ++
 Silicon/Marvell/Armada7k8k/AcpiTables/AcpiHeader.h   |  45 ++
 Silicon/Marvell/Armada7k8k/AcpiTables/IcuInterrupts.h|  42 ++
 Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc   |  21 +
 Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc   |  21 +
 Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc|  20 +
 Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/Dsdt.asl  | 229 
+
 Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db/Dsdt.asl  | 330 
+
 Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/Dsdt.asl   | 310 

 Silicon/Marvell/Armada7k8k/AcpiTables/Fadt.aslc  |  86 
 Silicon/Marvell/Armada7k8k/AcpiTables/Gtdt.aslc  |  64 +++
 Silicon/Marvell/Armada7k8k/AcpiTables/Madt.aslc  | 139 
++
 Silicon/Marvell/Armada7k8k/AcpiTables/Pptt.aslc  | 216 
+
 Silicon/Marvell/Armada7k8k/AcpiTables/Spcr.aslc  |  53 ++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-7020.dtsi   |  16 +
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-7040-db.dts | 267 
+++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-7040.dtsi   |  16 +
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-70x0.dtsi   |  64 +++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8020.dtsi   |  26 +
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-db.dts | 336 
+
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-mcbin.dts  | 374 
+++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040.dtsi   |  25 +
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-80x0.dtsi   | 108 
+
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-ap806-dual.dtsi |  31 ++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-ap806-quad.dtsi |  43 ++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-ap806.dtsi  | 264 
++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-common.dtsi |  10 +
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-cp110.dtsi  | 504 

 Silicon/Marvell/Documentation/PortingGuide.txt   |  22 +
 39 files changed, 4010 insertions(+)
 create mode 100644 
Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
 create mode 100644 
Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db/AcpiTables.inf
 create mode 100644 
Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/AcpiTables.inf
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0Db.inf
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0McBin.inf
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/AcpiHeader.h
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/IcuInterrupts.h
 create mode 100644 Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc
 create mode 100644 Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc
 create mode 100644 Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/Dsdt.asl
 create mode 100644 Sili

[edk2] [platforms: PATCH 3/9] Marvell/Armada70x0Db: Enable device tree support

2018-08-05 Thread Marcin Wojtas
This patch enables compilation of the Armada 7040 DB
device tree. Necessary adjustments are added, so that
the OS can use efi-rtc and has no access to the SPI
flash

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas 
---
 Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc|  4 +++
 Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc   |  3 +++
 Silicon/Marvell/Armada7k8k/Armada7k8k.fdf|  8 ++
 Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf   | 28 

 Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc   |  3 +++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-7040-db.dts |  2 +-
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-cp110.dtsi  |  1 +
 7 files changed, 48 insertions(+), 1 deletion(-)
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf

diff --git a/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc 
b/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
index 2d38ea4..f1ccda0 100644
--- a/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
+++ b/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
@@ -200,6 +200,7 @@
   PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
   
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
   
NonDiscoverableDeviceRegistrationLib|MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.inf
+  
DtPlatformDtbLoaderLib|EmbeddedPkg/Library/DxeDtPlatformDtbLoaderLibDefault/DxeDtPlatformDtbLoaderLibDefault.inf
 
 [LibraryClasses.common.UEFI_APPLICATION]
   
UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf
@@ -585,6 +586,9 @@
   gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000
   }
 
+  # DTB
+  EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf
+
 !ifdef $(INCLUDE_TFTP_COMMAND)
   ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
 !endif #$(INCLUDE_TFTP_COMMAND)
diff --git a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc 
b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
index 0c08328..d3dffb0 100644
--- a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
+++ b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
@@ -48,6 +48,9 @@
 
 !include Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
 
+[Components.common]
+  Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf
+
 

 #
 # Pcd Section - list of all EDK II PCD Entries defined by this Platform
diff --git a/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf 
b/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
index 0f38978..909ad3e 100644
--- a/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
+++ b/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
@@ -212,6 +212,9 @@ FvNameGuid = 5eda4200-2c5f-43cb-9da3-0baf74b1b30c
   }
 !endif
 
+  # DTB
+  INF EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf
+
 !include $(BOARD_DXE_FV_COMPONENTS)
 
 # PEI phase firmware volume
@@ -400,3 +403,8 @@ READ_LOCK_STATUS   = TRUE
  UI   STRING="$(MODULE_NAME)" Optional
  VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
   }
+
+[Rule.Common.USER_DEFINED.DTB]
+  FILE FREEFORM = $(NAMED_GUID) {
+RAW BIN|.dtb
+  }
diff --git a/Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf 
b/Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf
new file mode 100644
index 000..1f2d9ea
--- /dev/null
+++ b/Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf
@@ -0,0 +1,28 @@
+## @file
+#
+#  Device tree description of the Marvell Armada 7040 DB platform
+#
+#  Copyright (c) 2018, Marvell International 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  = Armada70x0DbDeviceTree
+  FILE_GUID  = 25462CDA-221F-47DF-AC1D-259CFAA4E326 # 
gDtPlatformDefaultDtbFileGuid
+  MODULE_TYPE= USER_DEFINED
+  VERSION_STRING = 1.0
+
+[Sources]
+  armada-7040-db.dts
+
+[Packages]
+  MdePkg/MdePkg.dec
diff --git a/Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc 
b/Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc
index 984cf7e..b4c3e20 100644
--- a/Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc
+++ b/Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc
@@ -11,3 +11,6 @@
 #
 
 # Per-board additional content of the DXE phase firmware volume
+
+  # DTB
+  INF RuleOverride = DTB Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf
diff --git a/Silicon/Marvell/Armada7k8k/DeviceTree/armada-7040-db.dts 

Re: [edk2] [PATCH edk2-platforms v1 02/38] Silicon/Hisilicon: Separate PlatformArch.h

2018-08-05 Thread Ming


在 8/2/2018 10:56 PM, Leif Lindholm 写道:
> On Tue, Jul 24, 2018 at 03:08:46PM +0800, Ming Huang wrote:
>> As the mocro of PlatformArch.h is platform special, so Separate
> 
> mocro -> macro (typo)
> special -> specific (subtleties of English language :)
> Separate -> separate (case)
> 
>> PlatformArch.h to Hi1610,Hi1616,Hi1620 for unifying D0x.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Zhou You 
>> Signed-off-by: Ming Huang 
>> ---
>>  Silicon/Hisilicon/{ => Hi1610}/Include/PlatformArch.h |  0
>>  Silicon/Hisilicon/Hi1616/Include/PlatformArch.h   | 35 
>> 
>>  Silicon/Hisilicon/Hi1620/Include/PlatformArch.h   | 34 
>> +++
> 
> Could you move the Hi1620 file to the "add d06 base files" patch?
> There is nothing else for D06 in the tree at this point.
> (Don't forget to update comment to reflect.)
> 

Yes, Hi1620 file will be move to the "add d06 base files" patch.

>>  3 files changed, 69 insertions(+)
>>
>> diff --git a/Silicon/Hisilicon/Include/PlatformArch.h 
>> b/Silicon/Hisilicon/Hi1610/Include/PlatformArch.h
>> similarity index 100%
>> rename from Silicon/Hisilicon/Include/PlatformArch.h
>> rename to Silicon/Hisilicon/Hi1610/Include/PlatformArch.h
>> diff --git a/Silicon/Hisilicon/Hi1616/Include/PlatformArch.h 
>> b/Silicon/Hisilicon/Hi1616/Include/PlatformArch.h
>> new file mode 100644
>> index 00..45995c5893
>> --- /dev/null
>> +++ b/Silicon/Hisilicon/Hi1616/Include/PlatformArch.h
>> @@ -0,0 +1,35 @@
>> +/** @file
>> +*
>> +*  Copyright (c) 2015, Hisilicon Limited. All rights reserved.
>> +*  Copyright (c) 2015, Linaro Limited. All rights reserved.
> 
> Update copyright year?
> 
>> +*
>> +*  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_ARCH_H_
>> +#define _PLATFORM_ARCH_H_
>> +
>> +#define MAX_SOCKET  2
>> +#define MAX_DIE 4
>> +#define MAX_DDRC2
>> +#define MAX_NODE(MAX_SOCKET * MAX_DIE)
>> +#define MAX_CHANNEL 4
>> +#define MAX_DIMM3
>> +#define MAX_RANK_CH 12
>> +#define MAX_RANK_DIMM   4
>> +// Max NUMA node number for each node type
>> +#define MAX_NUM_PER_TYPE 8
>> +
>> +#define S1_BASE   0x400
>> +
>> +#endif
>> +
>> diff --git a/Silicon/Hisilicon/Hi1620/Include/PlatformArch.h 
>> b/Silicon/Hisilicon/Hi1620/Include/PlatformArch.h
>> new file mode 100644
>> index 00..7243a9ec35
>> --- /dev/null
>> +++ b/Silicon/Hisilicon/Hi1620/Include/PlatformArch.h
>> @@ -0,0 +1,34 @@
>> +/** @file
>> +*
>> +*  Copyright (c) 2015, Hisilicon Limited. All rights reserved.
>> +*  Copyright (c) 2015, Linaro Limited. All rights reserved.
> 
> Update copyright year? (in other patch)
> 
> /
> Leif
> 

Ok, I will check all patches.

Ming

>> +*
>> +*  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_ARCH_H_
>> +#define _PLATFORM_ARCH_H_
>> +
>> +#define MAX_SOCKET  2
>> +#define MAX_DIE 4
>> +#define MAX_DDRC4
>> +#define MAX_NODE(MAX_SOCKET * MAX_DIE)
>> +#define MAX_CHANNEL 8
>> +#define MAX_DIMM2
>> +#define MAX_RANK_CH 8
>> +#define MAX_RANK_DIMM   4
>> +// Max NUMA node number for each node type
>> +#define MAX_NUM_PER_TYPE 8
>> +
>> +
>> +#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 v1 03/38] Hisilicon/D06: Add several basal file for D06

2018-08-05 Thread Ming


在 8/3/2018 12:14 AM, Leif Lindholm 写道:
> On Tue, Jul 24, 2018 at 03:08:47PM +0800, Ming Huang wrote:
>> Add several basal head file and add several build configuration
> 
> basal -> base
> 
>> for D06.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Ming Huang 
>> Signed-off-by: Heyi Guo 
> 
> Ah, yes - please drop the multiple Signed-off-bys as well.
> If Heyi wrote the patch, keep him as Author - but only your
> Signed-off-by on patches you send out.
> 
>> ---
>>  Platform/Hisilicon/D06/D06.dec   |  29 ++
>>  Platform/Hisilicon/D06/D06.dsc   | 459 
>> 
>>  Platform/Hisilicon/D06/D06.fdf   | 351 +++
>>  Platform/Hisilicon/D06/Include/Library/CpldD06.h |  37 ++
>>  Silicon/Hisilicon/Hi1620/Include/Library/SerdesLib.h |  85 
>>  Silicon/Hisilicon/Include/Library/OemAddressMapLib.h |   6 +
>>  Silicon/Hisilicon/Include/Library/OemNicLib.h|  58 +++
>>  7 files changed, 1025 insertions(+)
>>
>> diff --git a/Platform/Hisilicon/D06/D06.dec b/Platform/Hisilicon/D06/D06.dec
>> new file mode 100644
>> index 00..555f816e69
>> --- /dev/null
>> +++ b/Platform/Hisilicon/D06/D06.dec
>> @@ -0,0 +1,29 @@
>> +#/** @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.
>> +#
>> +#**/
>> +
>> +#
>> +# D06 Package
>> +#
>> +#
>> +#
>> +
>> +[Defines]
>> +  DEC_SPECIFICATION  = 0x00010005
> 
> 0x0001001a
> 
>> +  PACKAGE_NAME   = D06Pkg
>> +  PACKAGE_GUID   = B46F75D7-3864-450D-86D9-A0346A882232
>> +  PACKAGE_VERSION= 0.1
>> +
>> +[Includes]
>> +  Include
>> diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc
>> new file mode 100644
>> index 00..91470118b2
>> --- /dev/null
>> +++ b/Platform/Hisilicon/D06/D06.dsc
>> @@ -0,0 +1,459 @@
>> +#
>> +#  Copyright (c) 2011-2012, ARM Limited. All rights reserved.
>> +#  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 Section - statements that will be processed to create a Makefile.
>> +#
>> +
>> +[Defines]
>> +  PLATFORM_NAME  = D06
>> +  PLATFORM_GUID  = D0D445F1-B2CA-4101-9986-1B23525CBEA6
>> +  PLATFORM_VERSION   = 0.1
>> +  DSC_SPECIFICATION  = 0x00010005
> 
> 0x0001001a
> 
>> +  OUTPUT_DIRECTORY   = Build/$(PLATFORM_NAME)
>> +  SUPPORTED_ARCHITECTURES= AARCH64
>> +  BUILD_TARGETS  = DEBUG|RELEASE
> 
> Can you also add NOOPT please?
> Between DEBUG and RELEASE.
> 

Yes, I will add spaces between DEBUG and RELEASE.

>> +  SKUID_IDENTIFIER   = DEFAULT
>> +  FLASH_DEFINITION   = 
>> Platform/Hisilicon/$(PLATFORM_NAME)/$(PLATFORM_NAME).fdf
>> +  DEFINE INCLUDE_TFTP_COMMAND=1
> 
> TFTP needs to be disabled by default.
> Also, if you set a default value here to edit, the test belows needs to
> be !if ... == 1 (but preferable to use TRUE/FALSE) rather than !ifdef ...
> (Currently it would be included regardless of what you set this
> variable to.)
> 

I will delete this line and modify the test statement below.

>> +  DEFINE NETWORK_IP6_ENABLE  = FALSE
>> +  DEFINE HTTP_BOOT_ENABLE= FALSE
>> +  DEFINE SECURE_BOOT_ENABLE  = FALSE
>> +
>> +!include Silicon/Hisilicon/Hisilicon.dsc.inc
>> +
>> +[LibraryClasses.common]
>> +  ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
>> +  
>> ArmPlatformLib|Silicon/Hisilicon/Library/ArmPlatformLibHisilicon/ArmPlatformLib.inf
>> +
>> +
>> +  I2CLib|Silicon/Hisilicon/Library/I2CLib/I2CLib.inf
>> +  TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
>> +  NetLib|MdeModulePkg/Library/DxeNetL