Hi,

On 25/06/2020 12:42, Ard Biesheuvel wrote:
(+ Julien)

Thank you for the CC!

On 6/24/20 3:34 PM, Sami Mujawar wrote:
Initialise serial port early so that the platform
memory map can be logged.

Signed-off-by: Sami Mujawar <sami.muja...@arm.com>
---
  ArmVirtPkg/PrePi/PrePi.c | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/ArmVirtPkg/PrePi/PrePi.c b/ArmVirtPkg/PrePi/PrePi.c
index 4f0c3f98bad63d0682cccd76a0a062d1fd4f46ab..5e144f4bdefb810708238097a3373f11d150bfe5 100755
--- a/ArmVirtPkg/PrePi/PrePi.c
+++ b/ArmVirtPkg/PrePi/PrePi.c
@@ -1,6 +1,6 @@
  /** @file
  *
-*  Copyright (c) 2011-2014, ARM Limited. All rights reserved.
+*  Copyright (c) 2011-2020, ARM Limited. All rights reserved.
  *
  *  SPDX-License-Identifier: BSD-2-Clause-Patent
  *
@@ -60,16 +60,16 @@ PrePiMain (
    //
    InvalidateDataCacheRange((VOID *)(UINTN)PcdGet64 (PcdFdBaseAddress), PcdGet32 (PcdFdSize));
-  // Initialize MMU and Memory HOBs (Resource Descriptor HOBs)
-  Status = MemoryPeim (UefiMemoryBase, FixedPcdGet32 (PcdSystemMemoryUefiRegionSize));
-  ASSERT_EFI_ERROR (Status);
-
    // Initialize the Serial Port
    SerialPortInitialize ();
    CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"UEFI firmware (version %s built at %a on %a)\n\r",
      (CHAR16*)PcdGetPtr(PcdFirmwareVersionString), __TIME__, __DATE__);
    SerialPortWrite ((UINT8 *) Buffer, CharCount);
+  // Initialize MMU and Memory HOBs (Resource Descriptor HOBs)
+  Status = MemoryPeim (UefiMemoryBase, FixedPcdGet32 (PcdSystemMemoryUefiRegionSize));
+  ASSERT_EFI_ERROR (Status);
+
    // Create the Stacks HOB (reserve the memory for all stacks)
    StacksSize = PcdGet32 (PcdCPUCorePrimaryStackSize);
    BuildStackHob (StacksBase, StacksSize);


We need to check whether this works on Xen - I don't remember whether we use some kind of cache coherent shared memory ring there for the serial console that only works if the MMU and caches are enabled. Julien?

Xen Console is using a shared memory ring that requires to be cache coherent. So you wouldn't be able to use the current driver before the MMU and caches are enabled.

It might be possible to make it work by issuing cache maintenance when sending the characters.

Cheers,

--
Julien Grall

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

View/Reply Online (#61755): https://edk2.groups.io/g/devel/message/61755
Mute This Topic: https://groups.io/mt/75081479/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to