public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Sami Mujawar" <sami.mujawar@arm.com>
To: devel@edk2.groups.io, Ard Biesheuvel <ardb@kernel.org>, nd@arm.com
Subject: Re: [edk2-devel] [PATCH 1/1] ArmPlatformPkg/PrePeiCore: Print the firmware version early in boot
Date: Mon, 25 Jul 2022 12:19:58 +0100	[thread overview]
Message-ID: <5c02b879-24a3-0af7-5f82-f1b1408ac3f2@arm.com> (raw)
In-Reply-To: <15026.1658420593869880980@groups.io>

[-- Attachment #1: Type: text/plain, Size: 1965 bytes --]

Hi Rebecca,

Please find my response inline marked [SAMI].

Regards,

Sami Mujawar

On 21/07/2022 05:23 pm, Sami Mujawar via groups.io wrote:
Hi Rebecca, Ard,

On Tue, May 3, 2022 at 12:43 AM, Ard Biesheuvel wrote:
// Data Cache enabled on Primary core when MMU is enabled.
ArmDisableDataCache ();
// Invalidate instruction cache
@@ -90,6 +95,18 @@ CEntryPoint (

// If not primary Jump to Secondary Main
if (ArmPlatformIsPrimaryCore (MpId)) {
+ // Initialize the Serial Port
+ SerialPortInitialize ();
+ CharCount = AsciiSPrint (
+ Buffer,
+ sizeof (Buffer),
+ "UEFI firmware (version %s built at %a on %a)\n\r",
+ (CHAR16 *)PcdGetPtr (PcdFirmwareVersionString),
Given that this runs before any library constructors are called, I'd
be inclined to use FixedPcdGetPtr() here (and [FixedPcd] in the .INFs
below), to ensure that we don't dereference garbage.

I also wonder whether we need a call to
ProcessLibraryConstructorList() somewhere.
[SAMI] There is a patch at https://edk2.groups.io/g/devel/message/91113 which aims to call ProcessLibraryConstructorList(). The idea being that the DebugLib constructor would be called which initializes the serial port.
So, maybe these patches need adjustment so that we avoid calling SerialPortInitialize () twice.
[/SAMI]

[/SAMI] I had a look at the SerialPortInitialize() implementation for PL011 and 16550 UARTs and it appears that both check the current settings before programming the UART. Therefore, please ignore my comment above.

[/SAMI]

regards,

Sami Mujawar

+ __TIME__,
+ __DATE__
+ );
+ SerialPortWrite ((UINT8 *)Buffer, CharCount);

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

[-- Attachment #2: Type: text/html, Size: 2726 bytes --]

  reply	other threads:[~2022-07-25 11:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-13 22:45 [PATCH 1/1] ArmPlatformPkg/PrePeiCore: Print the firmware version early in boot Rebecca Cran
2022-05-03  7:43 ` [edk2-devel] " Ard Biesheuvel
2022-07-21 16:23   ` Sami Mujawar
2022-07-25 11:19     ` Sami Mujawar [this message]
2022-09-21  7:03     ` Oliver Steffen
2022-09-21 13:04       ` Rebecca Cran
     [not found] <16E5962F445589B7.27930@groups.io>
2022-04-20  0:41 ` Rebecca Cran

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=5c02b879-24a3-0af7-5f82-f1b1408ac3f2@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