From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web09.3877.1658820548398995653 for ; Tue, 26 Jul 2022 00:29:08 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LIi7iZSL; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: osteffen@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658820546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=urndpd0G0NVHGulZmh8vViI+lK5zmdHBWm+xxSOp2Gk=; b=LIi7iZSL3IrDIyJNfAeTjNzV1RScknA02Wzlk7YcHRjL+8ay7l9bZltRcEMH9gENIYsJoC kxMbIzKnoPaubDKsdd54Ypr8/YLUdcmgeL1vWVYIM8CZoAZCWyARsJhJIFX+aS3jTDsrst 4K6A5Ahv4/J2mhCKCJQRAKNqx9yer9M= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-259-KY4Ms0rBNHyIn5leto6Gtw-1; Tue, 26 Jul 2022 03:29:01 -0400 X-MC-Unique: KY4Ms0rBNHyIn5leto6Gtw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2800C101A588; Tue, 26 Jul 2022 07:29:01 +0000 (UTC) Received: from osteffen-laptop.redhat.com (unknown [10.40.194.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5BECE492C3B; Tue, 26 Jul 2022 07:28:59 +0000 (UTC) From: "Oliver Steffen" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Chasel Chiu , Gerd Hoffmann , Leif Lindholm , Nate DeSimone , Sami Mujawar , Star Zeng , Andrew Fish , Laszlo Ersek , Oliver Steffen Subject: [PATCH 2/3] ArmPlatformPkg: PrePeiCore: write early hello message to the serial port Date: Tue, 26 Jul 2022 09:28:47 +0200 Message-Id: <20220726072848.640026-3-osteffen@redhat.com> In-Reply-To: <20220726072848.640026-1-osteffen@redhat.com> References: <20220726072848.640026-1-osteffen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=osteffen@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true From: Laszlo Ersek Print the early hello message to the serial port. The FixedPcdGetSize() macro expands to an integer constant, therefore an optimizing compiler can eliminate the new code, if the platform DSC doesn't override the empty string (size=1) default of PcdEarlyHelloMessage. Signed-off-by: Laszlo Ersek Signed-off-by: Oliver Steffen --- ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf | 2 ++ ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf | 2 ++ ArmPlatformPkg/PrePeiCore/PrePeiCore.h | 1 + ArmPlatformPkg/PrePeiCore/MainMPCore.c | 7 +++++++ ArmPlatformPkg/PrePeiCore/MainUniCore.c | 7 +++++++ 5 files changed, 19 insertions(+) diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf b/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf index a5b4722459d1..ea7b220bc831 100644 --- a/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf @@ -66,6 +66,8 @@ [FixedPcd] gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize gArmPlatformTokenSpaceGuid.PcdCPUCoreSecondaryStackSize + gArmPlatformTokenSpaceGuid.PcdEarlyHelloMessage + gArmTokenSpaceGuid.PcdGicDistributorBase gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase gArmTokenSpaceGuid.PcdGicSgiIntId diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf b/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf index 466a2b01c384..29fb8737cb2f 100644 --- a/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf @@ -64,4 +64,6 @@ [FixedPcd] gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize gArmPlatformTokenSpaceGuid.PcdCPUCoreSecondaryStackSize + gArmPlatformTokenSpaceGuid.PcdEarlyHelloMessage + gEfiMdeModulePkgTokenSpaceGuid.PcdInitValueInTempStack diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCore.h b/ArmPlatformPkg/PrePeiCore/PrePeiCore.h index 0345dd7bdd2a..ae8302becda2 100644 --- a/ArmPlatformPkg/PrePeiCore/PrePeiCore.h +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCore.h @@ -16,6 +16,7 @@ #include #include #include +#include #include #include diff --git a/ArmPlatformPkg/PrePeiCore/MainMPCore.c b/ArmPlatformPkg/PrePeiCore/MainMPCore.c index b5d0d3a6442f..21c9d5f6da8f 100644 --- a/ArmPlatformPkg/PrePeiCore/MainMPCore.c +++ b/ArmPlatformPkg/PrePeiCore/MainMPCore.c @@ -116,6 +116,13 @@ PrimaryMain ( UINTN TemporaryRamBase; UINTN TemporaryRamSize; + if (FixedPcdGetSize (PcdEarlyHelloMessage) > 1) { + SerialPortWrite ( + FixedPcdGetPtr (PcdEarlyHelloMessage), + FixedPcdGetSize (PcdEarlyHelloMessage) - 1 + ); + } + CreatePpiList (&PpiListSize, &PpiList); // Enable the GIC Distributor diff --git a/ArmPlatformPkg/PrePeiCore/MainUniCore.c b/ArmPlatformPkg/PrePeiCore/MainUniCore.c index 1c2580eb923b..37560540e14f 100644 --- a/ArmPlatformPkg/PrePeiCore/MainUniCore.c +++ b/ArmPlatformPkg/PrePeiCore/MainUniCore.c @@ -29,6 +29,13 @@ PrimaryMain ( UINTN TemporaryRamBase; UINTN TemporaryRamSize; + if (FixedPcdGetSize (PcdEarlyHelloMessage) > 1) { + SerialPortWrite ( + FixedPcdGetPtr (PcdEarlyHelloMessage), + FixedPcdGetSize (PcdEarlyHelloMessage) - 1 + ); + } + CreatePpiList (&PpiListSize, &PpiList); // Adjust the Temporary Ram as the new Ppi List (Common + Platform Ppi Lists) is created at -- 2.37.1