From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by mx.groups.io with SMTP id smtpd.web12.13990.1590678055891036264 for ; Thu, 28 May 2020 08:00:56 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=jMEB5oc/; spf=pass (domain: nuviainc.com, ip: 209.85.221.66, mailfrom: leif@nuviainc.com) Received: by mail-wr1-f66.google.com with SMTP id x14so22887638wrp.2 for ; Thu, 28 May 2020 08:00:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Wo1hL2Huy03qNQTfpjBBeZ/CuuZXBCtQURXFVwRSJjM=; b=jMEB5oc/hY3GbFp/WkSXqvvwREBZ3WYKeXpzY7HmNTgQEi7+TcFfphkvsMQcywdvqL Of1+O/bXDtAoHjF22eTJZIdF7hVI9aofNvkEvzY2+W2RlBO3xWugr7Yor2TVZtRhygsU w4hjp5K7u0MGhbFQaOknD9iINy0ePfZ6LbuogHuAEzY9Jda8sIf2vbs0JXDYWTTxnKWw 7R49MbrqK3oSVLUf5p9j+337OP4ddqToc6cE40ALKpo14bsR68A+n07s3zCDhgy6PVgX aCb2R+so6OG9PPL4865MZ6ZX5Gff0y6CynoIPlc0dRNftf4ehy8guHr//LgWXyHOvzQM mutw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Wo1hL2Huy03qNQTfpjBBeZ/CuuZXBCtQURXFVwRSJjM=; b=q0yyxK+ebcSNCUbz6hBbss50gWgLjM5dV7brBzV6XtiS+Ruk/4NxIbuqcofcwy1sM4 mIy3fBbIjKuXG0xn25KEtu61+dN7tbUwg3A+Xy1PiFjcLB1dbnA59tdDPBpEGyF1WIHm bhLBPtsZDwfT6Uor2Zwy6V8luV5s6feAh99U7Dt0p2QXNpQy00z2GAY9A8EcFHEQCK/z a2cwil3D1rRunYPwkhCqNfwkqdhO1jjWEB10MypkjwWXKSg9wBLBeDr7PwPh5DBVONTB Zd9+i6qd3w1ays52QH1qoDMyPGVdPCVkVwlKLKDJH17cSEx7COn7pg1it+r3bnl4xRR1 /Kmg== X-Gm-Message-State: AOAM530/4Bt4xGH0hFcDi9a85Jt+4iIAIt+xfqe+cEYzLWjQCIxzrL/O 3JkGXSM9vc5w5mxLoppTr2EdOQ== X-Google-Smtp-Source: ABdhPJycVc2IEQd9wOqsD2r1Vbcf+jq4MsLD4JPaxWVcwgsNcuB1YYTdKgCwnEJjoVR4/RsFYI/yqw== X-Received: by 2002:adf:b348:: with SMTP id k8mr4305018wrd.157.1590678054243; Thu, 28 May 2020 08:00:54 -0700 (PDT) Return-Path: Received: from vanye ([2001:470:1f09:12f0:b26e:bfff:fea9:f1b8]) by smtp.gmail.com with ESMTPSA id t8sm6007324wro.56.2020.05.28.08.00.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2020 08:00:53 -0700 (PDT) Date: Thu, 28 May 2020 16:00:51 +0100 From: "Leif Lindholm" To: Pankaj Bansal Cc: Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton , Ard Biesheuvel Subject: Re: [PATCH edk2-platforms v2 8/9] Platform/NXP: Add LX2160ARDB Platform Message-ID: <20200528150051.GH1923@vanye> References: <20200527085135.16717-1-pankaj.bansal@oss.nxp.com> <20200527085135.16717-9-pankaj.bansal@oss.nxp.com> MIME-Version: 1.0 In-Reply-To: <20200527085135.16717-9-pankaj.bansal@oss.nxp.com> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, May 27, 2020 at 14:21:34 +0530, Pankaj Bansal wrote: > From: Pankaj Bansal > > LX2160A Reference Design Board (RDB) is a high-performance development > platform that supports the QorIQ LX2160A Layerscape Architecture SOCs. > > Signed-off-by: Pankaj Bansal Minor style comment below. > --- > > Notes: > 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.dec b/Platform/NXP/LX2160aRdbPkg/LX2160aRdbPkg.dec > new file mode 100644 > index 000000000000..03996b07fcb9 > --- /dev/null > +++ b/Platform/NXP/LX2160aRdbPkg/LX2160aRdbPkg.dec > @@ -0,0 +1,23 @@ > +# LX2160aRdbPkg.dec > +# LX2160a board package. > +# > +# Copyright 2018, 2020 NXP > +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > + > +[Defines] > + PACKAGE_NAME = LX2160aRdbPkg > + PACKAGE_GUID = 474e0c59-5f77-4060-82dd-9025ee4f4939 > + > +################################################################################ > +# > +# Include Section - list of Include Paths that are provided by this package. > +# Comments are used for Keywords and Module Types. > +# > +# Supported Module Types: > +# BASE SEC PEI_CORE PEIM DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER DXE_SAL_DRIVER UEFI_DRIVER UEFI_APPLICATION > +# > +################################################################################ > +[Includes.common] > + Include # Root include for the package > diff --git a/Platform/NXP/LX2160aRdbPkg/LX2160aRdbPkg.dsc b/Platform/NXP/LX2160aRdbPkg/LX2160aRdbPkg.dsc > new file mode 100644 > index 000000000000..9b3e0386c13e > --- /dev/null > +++ b/Platform/NXP/LX2160aRdbPkg/LX2160aRdbPkg.dsc > @@ -0,0 +1,46 @@ > +# LX2160aRdbPkg.dsc > +# > +# LX2160ARDB Board package. > +# > +# Copyright 2018-2020 NXP > +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > + > +################################################################################ > +# > +# Defines Section - statements that will be processed to create a Makefile. > +# > +################################################################################ > +[Defines] > + # > + # Defines for default states. These can be changed on the command line. > + # -D FLAG=VALUE > + # > + PLATFORM_NAME = LX2160aRdbPkg > + PLATFORM_GUID = be06d8bc-05eb-44d6-b39f-191e93617ebd > + OUTPUT_DIRECTORY = Build/LX2160aRdbPkg > + FLASH_DEFINITION = Platform/NXP/LX2160aRdbPkg/LX2160aRdbPkg.fdf > + > +!include Silicon/NXP/NxpQoriqLs.dsc.inc > +!include Silicon/NXP/LX2160A/LX2160A.dsc.inc > + > +[LibraryClasses.common] > + ArmPlatformLib|Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf > + RealTimeClockLib|EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf > + > +################################################################################ > +# > +# Components Section - list of all EDK II Modules needed by this Platform > +# > +################################################################################ > +[Components.common] > + # > + # Architectural Protocols > + # > + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf { > + > + gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable|TRUE > + } > + > + ## > diff --git a/Platform/NXP/LX2160aRdbPkg/LX2160aRdbPkg.fdf b/Platform/NXP/LX2160aRdbPkg/LX2160aRdbPkg.fdf > new file mode 100644 > index 000000000000..19d2ca9bbe58 > --- /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 = 0x10000 > +NumBlocks = 0x14 > + > +################################################################################ > +# > +# 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 > +# > +################################################################################ > +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 743836e57141..692ba74ec59e 100644 > --- a/Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf > +++ b/Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf > @@ -19,9 +19,12 @@ > ArmPkg/ArmPkg.dec > ArmPlatformPkg/ArmPlatformPkg.dec > Silicon/NXP/NxpQoriqLs.dec > + Silicon/NXP/Chassis3V2/Chassis3V2.dec > + Silicon/NXP/LX2160A/LX2160A.dec Please insert alphabetically sorted. > > [LibraryClasses] > ArmLib > + SocLib > DebugLib Please insert alphabetically sorted. No further comments on this set for v2. For the patches I have not commented on: Reviewed-by: Leif Lindholm / Leif > > [Sources.common] > 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 > #include > +#include > > #include > #include > @@ -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 > +#include > #include > +#include > +#include > + > +#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 >