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.8736.1593085335495090400 for ; Thu, 25 Jun 2020 04:42:15 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ard.biesheuvel@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 104BC1FB; Thu, 25 Jun 2020 04:42:15 -0700 (PDT) Received: from [192.168.43.142] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 58A9D3F73C; Thu, 25 Jun 2020 04:42:13 -0700 (PDT) Subject: Re: [PATCH v3 07/15] ArmVirtPkg: Early serial port initialisation To: Sami Mujawar , devel@edk2.groups.io Cc: leif@nuviainc.com, lersek@redhat.com, Alexandru.Elisei@arm.com, Andre.Przywara@arm.com, Matteo.Carlini@arm.com, Laura.Moretta@arm.com, nd@arm.com, Julien Grall References: <20200624133458.61920-1-sami.mujawar@arm.com> <20200624133458.61920-8-sami.mujawar@arm.com> From: "Ard Biesheuvel" Message-ID: <2b729fe3-83f3-52f0-9124-f908cbaf61cd@arm.com> Date: Thu, 25 Jun 2020 13:42:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200624133458.61920-8-sami.mujawar@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit (+ Julien) 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 > --- > 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?