0476d89
From 1492c375e52d3cc6d8c39fc4853f10ceeca2948c Mon Sep 17 00:00:00 2001
3485002
From: Laszlo Ersek <lersek@redhat.com>
3485002
Date: Wed, 14 Oct 2015 13:59:20 +0200
ced5d89
Subject: [PATCH 10/21] ArmPlatformPkg: PrePeiCore: write early hello message
ced5d89
 to the serial port (RH)
59c3cdc
59c3cdc
Notes about the RHEL-8.3/20200603-ca407c7246bf [edk2-stable202005] ->
59c3cdc
RHEL-8.5/20210520-e1999b264f1f [edk2-stable202105] rebase:
59c3cdc
59c3cdc
- no change
59c3cdc
59c3cdc
Notes about the RHEL-8.2/20190904-37eef91017ad [edk2-stable201908] ->
59c3cdc
RHEL-8.3/20200603-ca407c7246bf [edk2-stable202005] rebase:
59c3cdc
59c3cdc
- no change
59c3cdc
59c3cdc
Notes about the RHEL-8.1/20190308-89910a39dcfd [edk2-stable201903] ->
59c3cdc
RHEL-8.2/20190904-37eef91017ad [edk2-stable201908] rebase:
59c3cdc
59c3cdc
- no change
59c3cdc
59c3cdc
Notes about the RHEL-8.0/20180508-ee3198e672e2 ->
59c3cdc
RHEL-8.1/20190308-89910a39dcfd rebase:
59c3cdc
59c3cdc
- no change
59c3cdc
59c3cdc
Notes about the RHEL-7.6/ovmf-20180508-2.gitee3198e672e2.el7 ->
59c3cdc
RHEL-8.0/20180508-ee3198e672e2 rebase:
59c3cdc
59c3cdc
- reorder the rebase changelog in the commit message so that it reads like
59c3cdc
  a blog: place more recent entries near the top
59c3cdc
- no changes to the patch body
59c3cdc
59c3cdc
Notes about the 20171011-92d07e48907f -> 20180508-ee3198e672e2 rebase:
59c3cdc
59c3cdc
- adapt to upstream commit 7e2a8dfe8a9a ("ArmPlatformPkg/PrePeiCore: seed
59c3cdc
  temporary stack before entering PEI core", 2017-11-09) -- conflict
59c3cdc
  resolution in "ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf"
59c3cdc
59c3cdc
Notes about the 20170228-c325e41585e3 -> 20171011-92d07e48907f rebase:
59c3cdc
59c3cdc
- no changes
59c3cdc
59c3cdc
Notes about the 20160608b-988715a -> 20170228-c325e41585e3 rebase:
59c3cdc
59c3cdc
- no changes
3485002
3485002
The FixedPcdGetSize() macro expands to an integer constant, therefore an
3485002
optimizing compiler can eliminate the new code, if the platform DSC
3485002
doesn't override the empty string (size=1) default of
3485002
PcdEarlyHelloMessage.
3485002
3485002
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1270279
3485002
Downstream only:
3485002
<http://thread.gmane.org/gmane.comp.bios.edk2.devel/2996/focus=3433>.
3485002
3485002
Contributed-under: TianoCore Contribution Agreement 1.0
3485002
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
3485002
(cherry picked from commit b16c4c505ce0e27305235533eac9236aa66f132e)
3485002
(cherry picked from commit 742e5bf6d5ce5a1e73879d6e5c0dd00feda7a9ac)
59c3cdc
(cherry picked from commit 93d69eb9393cf05af90676253875c59c1bec67fd)
59c3cdc
(cherry picked from commit 638594083b191f84f5d9333eb6147a31570f5a5a)
59c3cdc
(cherry picked from commit f4b7aae411d88b2b83f85d20ef06a4032a57e7de)
59c3cdc
(cherry picked from commit bb71490fdda3b38fa9f071d281b863f9b64363bf)
59c3cdc
(cherry picked from commit 8d5a8827aabc67cb2a046697e1a750ca8d9cc453)
59c3cdc
(cherry picked from commit 49fe5596cd79c94d903c4d506c563d642ccd69aa)
3485002
---
3485002
 ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf  | 2 ++
3485002
 ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf | 2 ++
ced5d89
 ArmPlatformPkg/PrePeiCore/PrePeiCore.h          | 1 +
ced5d89
 ArmPlatformPkg/PrePeiCore/MainMPCore.c          | 5 +++++
ced5d89
 ArmPlatformPkg/PrePeiCore/MainUniCore.c         | 5 +++++
3485002
 5 files changed, 15 insertions(+)
3485002
ced5d89
diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf b/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf
0476d89
index a5b4722459d1..ea7b220bc831 100644
ced5d89
--- a/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf
ced5d89
+++ b/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf
0476d89
@@ -66,6 +66,8 @@ [FixedPcd]
ced5d89
   gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize
ced5d89
   gArmPlatformTokenSpaceGuid.PcdCPUCoreSecondaryStackSize
ced5d89
 
ced5d89
+  gArmPlatformTokenSpaceGuid.PcdEarlyHelloMessage
ced5d89
+
ced5d89
   gArmTokenSpaceGuid.PcdGicDistributorBase
ced5d89
   gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase
ced5d89
   gArmTokenSpaceGuid.PcdGicSgiIntId
ced5d89
diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf b/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf
0476d89
index 466a2b01c384..29fb8737cb2f 100644
ced5d89
--- a/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf
ced5d89
+++ b/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf
0476d89
@@ -64,4 +64,6 @@ [FixedPcd]
ced5d89
   gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize
ced5d89
   gArmPlatformTokenSpaceGuid.PcdCPUCoreSecondaryStackSize
ced5d89
 
ced5d89
+  gArmPlatformTokenSpaceGuid.PcdEarlyHelloMessage
ced5d89
+
ced5d89
   gEfiMdeModulePkgTokenSpaceGuid.PcdInitValueInTempStack
ced5d89
diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCore.h b/ArmPlatformPkg/PrePeiCore/PrePeiCore.h
ced5d89
index 0345dd7bdd2a..ae8302becda2 100644
ced5d89
--- a/ArmPlatformPkg/PrePeiCore/PrePeiCore.h
ced5d89
+++ b/ArmPlatformPkg/PrePeiCore/PrePeiCore.h
ced5d89
@@ -16,6 +16,7 @@
ced5d89
 #include <Library/DebugLib.h>
ced5d89
 #include <Library/IoLib.h>
ced5d89
 #include <Library/PcdLib.h>
ced5d89
+#include <Library/SerialPortLib.h>
ced5d89
 
ced5d89
 #include <PiPei.h>
ced5d89
 #include <Ppi/TemporaryRamSupport.h>
3485002
diff --git a/ArmPlatformPkg/PrePeiCore/MainMPCore.c b/ArmPlatformPkg/PrePeiCore/MainMPCore.c
ced5d89
index b5d0d3a6442f..5126a6dfb0b1 100644
3485002
--- a/ArmPlatformPkg/PrePeiCore/MainMPCore.c
3485002
+++ b/ArmPlatformPkg/PrePeiCore/MainMPCore.c
ced5d89
@@ -116,6 +116,11 @@ PrimaryMain (
ced5d89
   UINTN                   TemporaryRamBase;
ced5d89
   UINTN                   TemporaryRamSize;
3485002
 
3485002
+  if (FixedPcdGetSize (PcdEarlyHelloMessage) > 1) {
3485002
+    SerialPortWrite (FixedPcdGetPtr (PcdEarlyHelloMessage),
3485002
+      FixedPcdGetSize (PcdEarlyHelloMessage) - 1);
3485002
+  }
3485002
+
3485002
   CreatePpiList (&PpiListSize, &PpiList);
3485002
 
3485002
   // Enable the GIC Distributor
3485002
diff --git a/ArmPlatformPkg/PrePeiCore/MainUniCore.c b/ArmPlatformPkg/PrePeiCore/MainUniCore.c
ced5d89
index 1c2580eb923b..2a7580dbb405 100644
3485002
--- a/ArmPlatformPkg/PrePeiCore/MainUniCore.c
3485002
+++ b/ArmPlatformPkg/PrePeiCore/MainUniCore.c
7407978
@@ -29,6 +29,11 @@ PrimaryMain (
ced5d89
   UINTN                   TemporaryRamBase;
ced5d89
   UINTN                   TemporaryRamSize;
3485002
 
3485002
+  if (FixedPcdGetSize (PcdEarlyHelloMessage) > 1) {
3485002
+    SerialPortWrite (FixedPcdGetPtr (PcdEarlyHelloMessage),
3485002
+      FixedPcdGetSize (PcdEarlyHelloMessage) - 1);
3485002
+  }
3485002
+
3485002
   CreatePpiList (&PpiListSize, &PpiList);
3485002
 
3485002
   // Adjust the Temporary Ram as the new Ppi List (Common + Platform Ppi Lists) is created at
59c3cdc
-- 
0476d89
2.35.3
59c3cdc