On Mon, Jun 01, 2020 at 19:04:38 +0530, Pankaj Bansal wrote:
> From: Pankaj Bansal <[email protected]>
> 
> LX2160A Reference Design Board (RDB) is a high-performance development
> platform that supports the QorIQ LX2160A Layerscape Architecture SOCs.
> 
> Signed-off-by: Pankaj Bansal <[email protected]>
> ---
> 
> Notes:
>     V4:
>     - Alphabetically sorted Packages in
>       Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf

      - Change BlockSize and NumBlocks attributes for FD.LX2160ARDB_EFI.

>     
>     V3:
>     - Alphabetically sorted LibraryClasses in
>       Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf
>     
>     V2:
>     - split Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ in two parts
>       part containing gPlatformGetClockPpi is put before PL011UartClockLib
>       implementation.
> 
>  Platform/NXP/LX2160aRdbPkg/LX2160aRdbPkg.dec                          |  23 
> +++
>  Platform/NXP/LX2160aRdbPkg/LX2160aRdbPkg.dsc                          |  46 
> ++++++
>  Platform/NXP/LX2160aRdbPkg/LX2160aRdbPkg.fdf                          | 168 
> ++++++++++++++++++++
>  Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf  |   3 +
>  Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c    |   4 
> +-
>  Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLibMem.c |  54 
> ++++++-
>  6 files changed, 296 insertions(+), 2 deletions(-)
> 
> diff --git a/Platform/NXP/LX2160aRdbPkg/LX2160aRdbPkg.fdf 
> b/Platform/NXP/LX2160aRdbPkg/LX2160aRdbPkg.fdf
> new file mode 100644
> index 000000000000..13ad6e73cd48
> --- /dev/null
> +++ b/Platform/NXP/LX2160aRdbPkg/LX2160aRdbPkg.fdf
> @@ -0,0 +1,168 @@
> +#  LX2160aRdbPkg.fdf
> +#
> +#  FLASH layout file for LX2160a board.
> +#
> +#  Copyright 2018-2020 NXP
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +
> +################################################################################
> +#
> +# FD Section
> +# The [FD] Section is made up of the definition statements and a
> +# description of what goes into  the Flash Device Image.  Each FD section
> +# defines one flash "device" image.  A flash device image may be one of
> +# the following: Removable media bootable image (like a boot floppy
> +# image,) an Option ROM image (that would be "flashed" into an add-in
> +# card,) a System "Flash"  image (that would be burned into a system's
> +# flash) or an Update ("Capsule") image that will be used to update and
> +# existing system flash.
> +#
> +################################################################################
> +
> +[FD.LX2160ARDB_EFI]
> +BaseAddress   = 0x82000000|gArmTokenSpaceGuid.PcdFdBaseAddress  #The base 
> address of the FLASH Device.
> +Size          = 0x00140000|gArmTokenSpaceGuid.PcdFdSize         #The size in 
> bytes of the FLASH Device
> +ErasePolarity = 1
> +BlockSize     = 0x1000
> +NumBlocks     = 0x140

In v3 (and v1, so I'll assume also in v2), this was 0x10000 and 0x14.

This change may or may not be an improvement, but it is not something
that should change as part of a version step describing only a sort
order change in a .inf.

I have reverted these values back to their v1-v3 original. If you want
to change them, please submit that as a separate patch.

With that - for remaining patches:
Reviewed-by: Leif Lindholm <[email protected]>
Series pushed as dae68d51c5df..c5b2d12eb826.

/
    Leif

> +
> +################################################################################
> +#
> +# Following are lists of FD Region layout which correspond to the locations 
> of different
> +# images within the flash device.
> +#
> +# Regions must be defined in ascending order and may not overlap.
> +#
> +# A Layout Region start with a eight digit hex offset (leading "0x" 
> required) followed by
> +# the pipe "|" character, followed by the size of the region, also in hex 
> with the leading
> +# "0x" characters. Like:
> +# Offset|Size
> +# PcdOffsetCName|PcdSizeCName
> +# RegionType <FV, DATA, or FILE>
> +#
> +################################################################################
> +0x00000000|0x00140000
> +gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize
> +FV = FVMAIN_COMPACT
> +
> +!include Platform/NXP/FVRules.fdf.inc
> +################################################################################
> +#
> +# 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]
> +FvNameGuid         = 1037c42b-8452-4c41-aac7-41e6c31468da
> +BlockSize          = 0x1
> +NumBlocks          = 0         # This FV gets compressed so make it just big 
> enough
> +FvAlignment        = 8         # 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
> +
> +  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 MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> +  INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> +  INF 
> MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
> +  INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
> +  INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
> +  INF MdeModulePkg/Universal/Metronome/Metronome.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 ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.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
> +
> +  #
> +  # UEFI application (Shell Embedded Boot Loader)
> +  #
> +  INF ShellPkg/Application/Shell/Shell.inf
> +
> +  #
> +  # Bds
> +  #
> +  INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
> +  INF MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
> +  INF MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
> +  INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> +  INF MdeModulePkg/Application/UiApp/UiApp.inf
> +
> +[FV.FVMAIN_COMPACT]
> +FvAlignment        = 8
> +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
> +
> +  INF ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf
> +  INF MdeModulePkg/Core/Pei/PeiMain.inf
> +  INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf
> +  INF MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf
> +  INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf
> +  INF ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.inf
> +  INF ArmPkg/Drivers/CpuPei/CpuPei.inf
> +  INF ArmPlatformPkg/PlatformPei/PlatformPeim.inf
> +  INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
> +
> +  FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {
> +    SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED 
> = TRUE {
> +      SECTION FV_IMAGE = FVMAIN
> +    }
> +  }
> diff --git 
> a/Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf 
> b/Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf
> index 53d8af58925a..e1ab682c1976 100644
> --- a/Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf
> +++ b/Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf
> @@ -18,11 +18,14 @@
>    ArmPlatformPkg/ArmPlatformPkg.dec
>    MdeModulePkg/MdeModulePkg.dec
>    MdePkg/MdePkg.dec
> +  Silicon/NXP/Chassis3V2/Chassis3V2.dec
> +  Silicon/NXP/LX2160A/LX2160A.dec
>    Silicon/NXP/NxpQoriqLs.dec
>  
>  [LibraryClasses]
>    ArmLib
>    DebugLib
> +  SocLib
>  
>  [Sources.common]
>    ArmPlatformLib.c
> diff --git 
> a/Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c 
> b/Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c
> index 806cfd180bee..f3f1e5b3f220 100644
> --- a/Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c
> +++ b/Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c
> @@ -8,6 +8,7 @@
>  
>  #include <Library/ArmLib.h>
>  #include <Library/ArmPlatformLib.h>
> +#include <Library/SocLib.h>
>  
>  #include <Ppi/ArmMpCoreInfo.h>
>  #include <Ppi/NxpPlatformGetClock.h>
> @@ -76,6 +77,7 @@ NxpPlatformGetClock(
>    case NXP_I2C_CLOCK:
>    case NXP_UART_CLOCK:
>      Clock = NxpPlatformGetClock (NXP_SYSTEM_CLOCK);
> +    Clock = SocGetClock (Clock, ClockType, Args);
>      break;
>    default:
>      break;
> @@ -98,7 +100,7 @@ ArmPlatformInitialize (
>    IN  UINTN                     MpId
>    )
>  {
> -  //TODO: Implement me
> +  SocInit ();
>  
>    return EFI_SUCCESS;
>  }
> diff --git 
> a/Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLibMem.c 
> b/Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLibMem.c
> index ad6862dd81eb..391dab265ad7 100644
> --- a/Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLibMem.c
> +++ b/Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLibMem.c
> @@ -7,7 +7,12 @@
>  **/
>  
>  #include <Library/ArmPlatformLib.h>
> +#include <Library/BaseMemoryLib.h>
>  #include <Library/DebugLib.h>
> +#include <Library/MemoryAllocationLib.h>
> +#include <Soc.h>
> +
> +#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS          6
>  
>  /**
>    Return the Virtual Memory Map of your platform
> @@ -24,5 +29,52 @@ ArmPlatformGetVirtualMemoryMap (
>    IN ARM_MEMORY_REGION_DESCRIPTOR** VirtualMemoryMap
>    )
>  {
> -  ASSERT(0);
> +  UINTN                            Index;
> +  ARM_MEMORY_REGION_DESCRIPTOR     *VirtualMemoryTable;
> +
> +  Index = 0;
> +
> +  ASSERT (VirtualMemoryMap != NULL);
> +
> +  VirtualMemoryTable = AllocatePool (sizeof (ARM_MEMORY_REGION_DESCRIPTOR) *
> +                                     MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS);
> +
> +  if (VirtualMemoryTable == NULL) {
> +    DEBUG ((DEBUG_ERROR, "%a: Error: Failed AllocatePool()\n", 
> __FUNCTION__));
> +    return;
> +  }
> +
> +  VirtualMemoryTable[Index].PhysicalBase = LX2160A_DRAM0_PHYS_ADDRESS;
> +  VirtualMemoryTable[Index].VirtualBase  = LX2160A_DRAM0_PHYS_ADDRESS;
> +  VirtualMemoryTable[Index].Length       = LX2160A_DRAM0_SIZE;
> +  VirtualMemoryTable[Index++].Attributes = 
> ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK;
> +
> +  VirtualMemoryTable[Index].PhysicalBase = LX2160A_DRAM1_PHYS_ADDRESS;
> +  VirtualMemoryTable[Index].VirtualBase  = LX2160A_DRAM1_PHYS_ADDRESS;
> +  VirtualMemoryTable[Index].Length       = LX2160A_DRAM1_SIZE;
> +  VirtualMemoryTable[Index++].Attributes = 
> ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK;
> +
> +  VirtualMemoryTable[Index].PhysicalBase = LX2160A_DRAM2_PHYS_ADDRESS;
> +  VirtualMemoryTable[Index].VirtualBase  = LX2160A_DRAM2_PHYS_ADDRESS;
> +  VirtualMemoryTable[Index].Length       = LX2160A_DRAM2_SIZE;
> +  VirtualMemoryTable[Index++].Attributes = 
> ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK;
> +
> +  // CCSR Space
> +  VirtualMemoryTable[Index].PhysicalBase = LX2160A_CCSR_PHYS_ADDRESS;
> +  VirtualMemoryTable[Index].VirtualBase  = LX2160A_CCSR_PHYS_ADDRESS;
> +  VirtualMemoryTable[Index].Length       = LX2160A_CCSR_SIZE;
> +  VirtualMemoryTable[Index++].Attributes = 
> ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
> +
> +  // FlexSPI
> +  VirtualMemoryTable[Index].PhysicalBase = LX2160A_FSPI0_PHYS_ADDRESS;
> +  VirtualMemoryTable[Index].VirtualBase  = LX2160A_FSPI0_PHYS_ADDRESS;
> +  VirtualMemoryTable[Index].Length       = LX2160A_FSPI0_SIZE;
> +  VirtualMemoryTable[Index++].Attributes = 
> ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
> +
> +  // End of Table
> +  ZeroMem (&VirtualMemoryTable[Index], sizeof 
> (ARM_MEMORY_REGION_DESCRIPTOR));
> +
> +  ASSERT (Index < MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS);
> +
> +  *VirtualMemoryMap = VirtualMemoryTable;
>  }
> -- 
> 2.17.1
> 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#60541): https://edk2.groups.io/g/devel/message/60541
Mute This Topic: https://groups.io/mt/74604250/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to