public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Tony K Nadackal" <tony.nadackal@arm.com>
To: devel@edk2.groups.io
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Sami Mujawar <sami.mujawar@arm.com>,
	Thomas Abraham <thomas.abraham@arm.com>
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	[thread overview]
Message-ID: <20221208131147.13800-1-tony.nadackal@arm.com> (raw)

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 <tony.nadackal@arm.com>
---
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/Platform/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
 
 [Depex]
   TRUE
diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf b/Platform/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
 
 [Guids]
   gArmSgiPlatformIdDescriptorGuid
diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c b/Platform/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          = SIZE_64KB;
   VirtualMemoryTable[Index].Attributes      = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
 
+  // Expansion AXI - Debug UART
+  VirtualMemoryTable[++Index].PhysicalBase  = FixedPcdGet64 (PcdSerialDbgRegisterBase);
+  VirtualMemoryTable[Index].VirtualBase     = FixedPcdGet64 (PcdSerialDbgRegisterBase);
+  VirtualMemoryTable[Index].Length          = SIZE_64KB;
+  VirtualMemoryTable[Index].Attributes      = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
+
   // DDR - (2GB - 16MB)
   VirtualMemoryTable[++Index].PhysicalBase  = PcdGet64 (PcdSystemMemoryBase);
   VirtualMemoryTable[Index].VirtualBase     = PcdGet64 (PcdSystemMemoryBase);
-- 
2.25.1


                 reply	other threads:[~2022-12-08 13:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221208131147.13800-1-tony.nadackal@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox