From nobody Mon Feb 9 15:10:17 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+57338+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+57338+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1586868776; cv=none; d=zohomail.com; s=zohoarc; b=XrtXc5t5sGXg49Ir6DPZtDUsxAvqJ8ET5BXHnK+pqkB2fF4o+8cwM0orrM76E5sZV8TzpMCI/wbS77WxdvWhG4P0vCnJvgV3a24FByIZgPCaoewjQSIYh15293Ncu9Zr73NbgsC+9f4I5DerSsEb56Es/7Ccmj0RpM+F62h7+00= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586868776; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=aEnUyKUrs/d6HpsRep5RZVqgk81mwGtFm3JKMmE0DOk=; b=FKws9yjDWmT2Edc36r9uAnzN2foAi6WASvCAjORNHgfvxiEpNhGQbphUSzibBt/sAl+3QC9g/b4uMmD9sUngdhfZGQceLQX38GT4TepLY0UpgjbjbZ8z2420e+MBRzOIiMuM9Lf/Zv7/Q/PjuK49vdo4A7VKMTNncH06PQ2kZOE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+57338+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1586868776649688.2730977120552; Tue, 14 Apr 2020 05:52:56 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id ityTYY1788612xXCEOgjTDI4; Tue, 14 Apr 2020 05:52:56 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.10413.1586868775535786494 for ; Tue, 14 Apr 2020 05:52:55 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 650BC30E; Tue, 14 Apr 2020 05:52:54 -0700 (PDT) X-Received: from usa.arm.com (a073440-lin.blr.arm.com [10.162.16.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 75BB33F73D; Tue, 14 Apr 2020 05:52:52 -0700 (PDT) From: "Aditya Angadi" To: devel@edk2.groups.io Cc: thomas.abraham@arm.com, ard.biesheuvel@arm.com, leif@nuviainc.com, Vijayenthiran Subramaniam , Aditya Angadi Subject: [edk2-devel] [edk2-platforms][PATCH v4 4/9] Platform/ARM/Sgi: Add support for remote numa memory nodes Date: Tue, 14 Apr 2020 18:22:03 +0530 Message-Id: <20200414125208.2878-5-aditya.angadi@arm.com> In-Reply-To: <20200414125208.2878-1-aditya.angadi@arm.com> References: <20200414125208.2878-1-aditya.angadi@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,aditya.angadi@arm.com X-Gm-Message-State: B1CSIBxhYB6qwLY7PeNcqARfx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1586868776; bh=W5A5VhqC+JDGoRwCegWvqApWF+oMk0x5GLSkwOIk5TI=; h=Cc:Date:From:Reply-To:Subject:To; b=wAF0MxZBGWhr28Jp+A58wkL8szdcrMeLwUrY7mkVtb/tGwHB1geEHWOsLNfBY8P5VkP H1tXCtcckSl2yPyzpGcvC50GYL32wwO1S1f2MfHRUkuWIyhw0ZTceKHYCXmn0vALCSRrF IuqPlVLJzCDtgc1NcpC4v9AbKdiZuQjQkTQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Vijayenthiran Subramaniam Add new PCDs that define the base address and size of remote NUMA memory nodes on multi-chip platforms. Use these PCDs to setup system memory resource descriptor HOBs. Signed-off-by: Aditya Angadi --- Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf | 18 ++++ Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c | 87 ++++++++++++= +++++++- Platform/ARM/SgiPkg/SgiPlatform.dec | 19 +++++ 3 files changed, 123 insertions(+), 1 deletion(-) diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf b/Plat= form/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf index a918afef5fba..c3125d7e4e0f 100644 --- a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf +++ b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf @@ -46,6 +46,24 @@ [FixedPcd] =20 gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemorySize + + gArmSgiTokenSpaceGuid.PcdChipCount + + gArmSgiTokenSpaceGuid.PcdDramBlock1BaseRemote1 + gArmSgiTokenSpaceGuid.PcdDramBlock1SizeRemote1 + gArmSgiTokenSpaceGuid.PcdDramBlock2BaseRemote1 + gArmSgiTokenSpaceGuid.PcdDramBlock2SizeRemote1 + + gArmSgiTokenSpaceGuid.PcdDramBlock1BaseRemote2 + gArmSgiTokenSpaceGuid.PcdDramBlock1SizeRemote2 + gArmSgiTokenSpaceGuid.PcdDramBlock2BaseRemote2 + gArmSgiTokenSpaceGuid.PcdDramBlock2SizeRemote2 + + gArmSgiTokenSpaceGuid.PcdDramBlock1BaseRemote3 + gArmSgiTokenSpaceGuid.PcdDramBlock1SizeRemote3 + gArmSgiTokenSpaceGuid.PcdDramBlock2BaseRemote3 + gArmSgiTokenSpaceGuid.PcdDramBlock2SizeRemote3 + gArmTokenSpaceGuid.PcdGicDistributorBase gArmTokenSpaceGuid.PcdGicRedistributorsBase gArmTokenSpaceGuid.PcdFvBaseAddress diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c b/Pla= tform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c index 8d0ad4ec9c84..d8d9a406cf91 100644 --- a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c +++ b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c @@ -16,7 +16,8 @@ #include =20 // Total number of descriptors, including the final "end-of-table" descrip= tor. -#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 13 +#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS \ + (11 + (FixedPcdGet32 (PcdChipCount) * 2)) =20 /** Returns the Virtual Memory Map of the platform. @@ -52,6 +53,48 @@ ArmPlatformGetVirtualMemoryMap ( FixedPcdGet64 (PcdDramBlock2Base), FixedPcdGet64 (PcdDramBlock2Size)); =20 +#if (FixedPcdGet32 (PcdChipCount) > 1) + BuildResourceDescriptorHob ( + EFI_RESOURCE_SYSTEM_MEMORY, + ResourceAttributes, + FixedPcdGet64 (PcdDramBlock1BaseRemote1), + FixedPcdGet64 (PcdDramBlock1SizeRemote1)); + + BuildResourceDescriptorHob ( + EFI_RESOURCE_SYSTEM_MEMORY, + ResourceAttributes, + FixedPcdGet64 (PcdDramBlock2BaseRemote1), + FixedPcdGet64 (PcdDramBlock2SizeRemote1)); + +#if (FixedPcdGet32 (PcdChipCount) > 2) + BuildResourceDescriptorHob ( + EFI_RESOURCE_SYSTEM_MEMORY, + ResourceAttributes, + FixedPcdGet64 (PcdDramBlock1BaseRemote2), + FixedPcdGet64 (PcdDramBlock1SizeRemote2)); + + BuildResourceDescriptorHob ( + EFI_RESOURCE_SYSTEM_MEMORY, + ResourceAttributes, + FixedPcdGet64 (PcdDramBlock2BaseRemote2), + FixedPcdGet64 (PcdDramBlock2SizeRemote2)); + +#if (FixedPcdGet32 (PcdChipCount) > 3) + BuildResourceDescriptorHob ( + EFI_RESOURCE_SYSTEM_MEMORY, + ResourceAttributes, + FixedPcdGet64 (PcdDramBlock1BaseRemote3), + FixedPcdGet64 (PcdDramBlock1SizeRemote3)); + + BuildResourceDescriptorHob ( + EFI_RESOURCE_SYSTEM_MEMORY, + ResourceAttributes, + FixedPcdGet64 (PcdDramBlock2BaseRemote3), + FixedPcdGet64 (PcdDramBlock2SizeRemote3)); +#endif +#endif +#endif + ASSERT (VirtualMemoryMap !=3D NULL); Index =3D 0; =20 @@ -122,6 +165,48 @@ ArmPlatformGetVirtualMemoryMap ( VirtualMemoryTable[Index].Length =3D PcdGet64 (PcdDramBlock2Siz= e); VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUT= E_WRITE_BACK; =20 +#if (FixedPcdGet32 (PcdChipCount) > 1) + // Chip 1 DDR Block 1 - (2GB) + VirtualMemoryTable[++Index].PhysicalBase =3D PcdGet64 (PcdDramBlock1Bas= eRemote1); + VirtualMemoryTable[Index].VirtualBase =3D PcdGet64 (PcdDramBlock1Bas= eRemote1); + VirtualMemoryTable[Index].Length =3D PcdGet64 (PcdDramBlock1Bas= eRemote1); + VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUT= E_WRITE_BACK; + + // Chip 1 DDR Block 2 - (6GB) + VirtualMemoryTable[++Index].PhysicalBase =3D PcdGet64 (PcdDramBlock2Bas= eRemote1); + VirtualMemoryTable[Index].VirtualBase =3D PcdGet64 (PcdDramBlock2Bas= eRemote1); + VirtualMemoryTable[Index].Length =3D PcdGet64 (PcdDramBlock2Bas= eRemote1); + VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUT= E_WRITE_BACK; + +#if (FixedPcdGet32 (PcdChipCount) > 2) + // Chip 2 DDR Block 1 - (2GB) + VirtualMemoryTable[++Index].PhysicalBase =3D PcdGet64 (PcdDramBlock1Bas= eRemote2); + VirtualMemoryTable[Index].VirtualBase =3D PcdGet64 (PcdDramBlock1Bas= eRemote2); + VirtualMemoryTable[Index].Length =3D PcdGet64 (PcdDramBlock1Bas= eRemote2); + VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUT= E_WRITE_BACK; + + // Chip 2 DDR Block 2 - (6GB) + VirtualMemoryTable[++Index].PhysicalBase =3D PcdGet64 (PcdDramBlock2Bas= eRemote2); + VirtualMemoryTable[Index].VirtualBase =3D PcdGet64 (PcdDramBlock2Bas= eRemote2); + VirtualMemoryTable[Index].Length =3D PcdGet64 (PcdDramBlock2Bas= eRemote2); + VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUT= E_WRITE_BACK; + +#if (FixedPcdGet32 (PcdChipCount) > 3) + // Chip 3 DDR Block 1 - (2GB) + VirtualMemoryTable[++Index].PhysicalBase =3D PcdGet64 (PcdDramBlock1Bas= eRemote3); + VirtualMemoryTable[Index].VirtualBase =3D PcdGet64 (PcdDramBlock1Bas= eRemote3); + VirtualMemoryTable[Index].Length =3D PcdGet64 (PcdDramBlock1Bas= eRemote3); + VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUT= E_WRITE_BACK; + + // Chip 3 DDR Block 2 - (6GB) + VirtualMemoryTable[++Index].PhysicalBase =3D PcdGet64 (PcdDramBlock2Bas= eRemote3); + VirtualMemoryTable[Index].VirtualBase =3D PcdGet64 (PcdDramBlock2Bas= eRemote3); + VirtualMemoryTable[Index].Length =3D PcdGet64 (PcdDramBlock2Bas= eRemote3); + VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUT= E_WRITE_BACK; +#endif +#endif +#endif + // PCI Configuration Space VirtualMemoryTable[++Index].PhysicalBase =3D PcdGet64 (PcdPciExpressBas= eAddress); VirtualMemoryTable[Index].VirtualBase =3D PcdGet64 (PcdPciExpressBas= eAddress); diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dec b/Platform/ARM/SgiPkg/SgiP= latform.dec index 97c1e40349ea..28d738f982dd 100644 --- a/Platform/ARM/SgiPkg/SgiPlatform.dec +++ b/Platform/ARM/SgiPkg/SgiPlatform.dec @@ -46,6 +46,25 @@ [PcdsFixedAtBuild] gArmSgiTokenSpaceGuid.PcdVirtioNetSize|0x00000000|UINT32|0x00000008 gArmSgiTokenSpaceGuid.PcdVirtioNetInterrupt|0x00000000|UINT32|0x00000009 =20 + # Chip count on the platform + gArmSgiTokenSpaceGuid.PcdChipCount|1|UINT32|0x0000000C + + # Remote NUMA memory node base and size + gArmSgiTokenSpaceGuid.PcdDramBlock1BaseRemote1|0|UINT64|0x00000011 + gArmSgiTokenSpaceGuid.PcdDramBlock1SizeRemote1|0|UINT64|0x00000012 + gArmSgiTokenSpaceGuid.PcdDramBlock2BaseRemote1|0|UINT64|0x00000013 + gArmSgiTokenSpaceGuid.PcdDramBlock2SizeRemote1|0|UINT64|0x00000014 + + gArmSgiTokenSpaceGuid.PcdDramBlock1BaseRemote2|0|UINT64|0x00000015 + gArmSgiTokenSpaceGuid.PcdDramBlock1SizeRemote2|0|UINT64|0x00000016 + gArmSgiTokenSpaceGuid.PcdDramBlock2BaseRemote2|0|UINT64|0x00000017 + gArmSgiTokenSpaceGuid.PcdDramBlock2SizeRemote2|0|UINT64|0x00000018 + + gArmSgiTokenSpaceGuid.PcdDramBlock1BaseRemote3|0|UINT64|0x00000019 + gArmSgiTokenSpaceGuid.PcdDramBlock1SizeRemote3|0|UINT64|0x0000001A + gArmSgiTokenSpaceGuid.PcdDramBlock2BaseRemote3|0|UINT64|0x0000001B + gArmSgiTokenSpaceGuid.PcdDramBlock2SizeRemote3|0|UINT64|0x0000001C + # GIC gArmSgiTokenSpaceGuid.PcdGicSize|0|UINT64|0x0000000A =20 --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#57338): https://edk2.groups.io/g/devel/message/57338 Mute This Topic: https://groups.io/mt/73009396/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-