From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.13104.1670505113852411824 for ; Thu, 08 Dec 2022 05:11:54 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: tony.nadackal@arm.com) 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 12F3623A; Thu, 8 Dec 2022 05:12:00 -0800 (PST) Received: from usa.arm.com (R911G5L7.arm.com [10.1.196.178]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 9F8DC3F73B; Thu, 8 Dec 2022 05:11:52 -0800 (PST) From: "Tony K Nadackal" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Sami Mujawar , Thomas Abraham Subject: [edk2-devel][PATCH V2 1/1] Platform/Sgi: Add memory map entry for debug uart controller Date: Thu, 8 Dec 2022 13:11:47 +0000 Message-Id: <20221208131147.13800-1-tony.nadackal@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable The UART0 controller connected in the AXI expansion space is used as the debug UART controller. Add platform memory map descriptor for this UART controller. Signed-off-by: Tony K Nadackal --- Changes since v1: - Enabled support for this change on RD-N2 platform as well. Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf | 1 + Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf | 1 + Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c | 6 ++++++ 3 files changed, 8 insertions(+) Link to github branch with the patches in this series - https://github.com/tonykn-arm/edk2-platforms/pull/new/fork-dbg_uart_v2 diff --git a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf b/Pl= atform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf index 9d89314a59..e592d1e2f9 100644 --- a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf +++ b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf @@ -41,6 +41,7 @@ gArmSgiTokenSpaceGuid.PcdVirtioBlkSize gArmSgiTokenSpaceGuid.PcdVirtioNetBaseAddress gArmSgiTokenSpaceGuid.PcdVirtioNetSize + gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase =20 [Depex] TRUE diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf b/Pl= atform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf index 1ca7679b41..8efb42fb27 100644 --- a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf +++ b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf @@ -83,6 +83,7 @@ gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase + gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase =20 [Guids] gArmSgiPlatformIdDescriptorGuid diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c b/P= latform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c index 8139b75d8e..096fae000c 100644 --- a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c +++ b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c @@ -171,6 +171,12 @@ ArmPlatformGetVirtualMemoryMap ( VirtualMemoryTable[Index].Length =3D SIZE_64KB; VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIB= UTE_DEVICE; =20 + // Expansion AXI - Debug UART + VirtualMemoryTable[++Index].PhysicalBase =3D FixedPcdGet64 (PcdSerial= DbgRegisterBase); + VirtualMemoryTable[Index].VirtualBase =3D FixedPcdGet64 (PcdSerial= DbgRegisterBase); + VirtualMemoryTable[Index].Length =3D SIZE_64KB; + VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIB= UTE_DEVICE; + // DDR - (2GB - 16MB) VirtualMemoryTable[++Index].PhysicalBase =3D PcdGet64 (PcdSystemMemor= yBase); VirtualMemoryTable[Index].VirtualBase =3D PcdGet64 (PcdSystemMemor= yBase); --=20 2.25.1