Blame SOURCES/0014-ArmPlatformPkg-PrePeiCore-write-early-hello-message-.patch

6ef48d
From 638594083b191f84f5d9333eb6147a31570f5a5a Mon Sep 17 00:00:00 2001
eb7fe6
From: Laszlo Ersek <lersek@redhat.com>
eb7fe6
Date: Wed, 14 Oct 2015 13:59:20 +0200
eb7fe6
Subject: ArmPlatformPkg: PrePeiCore: write early hello message to the serial
eb7fe6
 port (RH)
eb7fe6
eb7fe6
The FixedPcdGetSize() macro expands to an integer constant, therefore an
eb7fe6
optimizing compiler can eliminate the new code, if the platform DSC
eb7fe6
doesn't override the empty string (size=1) default of
eb7fe6
PcdEarlyHelloMessage.
eb7fe6
eb7fe6
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1270279
eb7fe6
Downstream only:
eb7fe6
<http://thread.gmane.org/gmane.comp.bios.edk2.devel/2996/focus=3433>.
eb7fe6
eb7fe6
Notes about the 20160608b-988715a -> 20170228-c325e41585e3 rebase:
eb7fe6
eb7fe6
- no changes
eb7fe6
fcf9e8
Notes about the 20170228-c325e41585e3 -> 20171011-92d07e48907f rebase:
fcf9e8
fcf9e8
- no changes
fcf9e8
6ef48d
Notes about the 20171011-92d07e48907f -> 20180508-ee3198e672e2 rebase:
6ef48d
6ef48d
- adapt to upstream commit 7e2a8dfe8a9a ("ArmPlatformPkg/PrePeiCore: seed
6ef48d
  temporary stack before entering PEI core", 2017-11-09) -- conflict
6ef48d
  resolution in "ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf"
6ef48d
eb7fe6
Contributed-under: TianoCore Contribution Agreement 1.0
eb7fe6
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
eb7fe6
(cherry picked from commit b16c4c505ce0e27305235533eac9236aa66f132e)
fcf9e8
(cherry picked from commit 742e5bf6d5ce5a1e73879d6e5c0dd00feda7a9ac)
6ef48d
(cherry picked from commit 93d69eb9393cf05af90676253875c59c1bec67fd)
eb7fe6
---
eb7fe6
 ArmPlatformPkg/PrePeiCore/MainMPCore.c          | 5 +++++
eb7fe6
 ArmPlatformPkg/PrePeiCore/MainUniCore.c         | 5 +++++
eb7fe6
 ArmPlatformPkg/PrePeiCore/PrePeiCore.h          | 1 +
eb7fe6
 ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf  | 2 ++
eb7fe6
 ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf | 2 ++
eb7fe6
 5 files changed, 15 insertions(+)
eb7fe6
eb7fe6
diff --git a/ArmPlatformPkg/PrePeiCore/MainMPCore.c b/ArmPlatformPkg/PrePeiCore/MainMPCore.c
eb7fe6
index dc47adb..cbd7223 100644
eb7fe6
--- a/ArmPlatformPkg/PrePeiCore/MainMPCore.c
eb7fe6
+++ b/ArmPlatformPkg/PrePeiCore/MainMPCore.c
eb7fe6
@@ -117,6 +117,11 @@ PrimaryMain (
eb7fe6
   UINTN                       TemporaryRamBase;
eb7fe6
   UINTN                       TemporaryRamSize;
eb7fe6
 
eb7fe6
+  if (FixedPcdGetSize (PcdEarlyHelloMessage) > 1) {
eb7fe6
+    SerialPortWrite (FixedPcdGetPtr (PcdEarlyHelloMessage),
eb7fe6
+      FixedPcdGetSize (PcdEarlyHelloMessage) - 1);
eb7fe6
+  }
eb7fe6
+
eb7fe6
   CreatePpiList (&PpiListSize, &PpiList);
eb7fe6
 
eb7fe6
   // Enable the GIC Distributor
eb7fe6
diff --git a/ArmPlatformPkg/PrePeiCore/MainUniCore.c b/ArmPlatformPkg/PrePeiCore/MainUniCore.c
eb7fe6
index 134a469..af39fc0 100644
eb7fe6
--- a/ArmPlatformPkg/PrePeiCore/MainUniCore.c
eb7fe6
+++ b/ArmPlatformPkg/PrePeiCore/MainUniCore.c
eb7fe6
@@ -35,6 +35,11 @@ PrimaryMain (
eb7fe6
   UINTN                       TemporaryRamBase;
eb7fe6
   UINTN                       TemporaryRamSize;
eb7fe6
 
eb7fe6
+  if (FixedPcdGetSize (PcdEarlyHelloMessage) > 1) {
eb7fe6
+    SerialPortWrite (FixedPcdGetPtr (PcdEarlyHelloMessage),
eb7fe6
+      FixedPcdGetSize (PcdEarlyHelloMessage) - 1);
eb7fe6
+  }
eb7fe6
+
eb7fe6
   CreatePpiList (&PpiListSize, &PpiList);
eb7fe6
 
eb7fe6
   // Adjust the Temporary Ram as the new Ppi List (Common + Platform Ppi Lists) is created at
eb7fe6
diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCore.h b/ArmPlatformPkg/PrePeiCore/PrePeiCore.h
eb7fe6
index 1608946..bf843d7 100644
eb7fe6
--- a/ArmPlatformPkg/PrePeiCore/PrePeiCore.h
eb7fe6
+++ b/ArmPlatformPkg/PrePeiCore/PrePeiCore.h
eb7fe6
@@ -21,6 +21,7 @@
eb7fe6
 #include <Library/DebugLib.h>
eb7fe6
 #include <Library/IoLib.h>
eb7fe6
 #include <Library/PcdLib.h>
eb7fe6
+#include <Library/SerialPortLib.h>
eb7fe6
 
eb7fe6
 #include <PiPei.h>
eb7fe6
 #include <Ppi/TemporaryRamSupport.h>
eb7fe6
diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf b/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf
6ef48d
index e3a31fa..1bc0c45 100644
eb7fe6
--- a/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf
eb7fe6
+++ b/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf
eb7fe6
@@ -72,6 +72,8 @@
eb7fe6
   gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize
eb7fe6
   gArmPlatformTokenSpaceGuid.PcdCPUCoreSecondaryStackSize
eb7fe6
 
eb7fe6
+  gArmPlatformTokenSpaceGuid.PcdEarlyHelloMessage
eb7fe6
+
eb7fe6
   gArmTokenSpaceGuid.PcdGicDistributorBase
eb7fe6
   gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase
eb7fe6
   gArmTokenSpaceGuid.PcdGicSgiIntId
eb7fe6
diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf b/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf
6ef48d
index ec83cec..b100820 100644
eb7fe6
--- a/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf
eb7fe6
+++ b/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf
6ef48d
@@ -70,4 +70,6 @@
eb7fe6
   gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize
eb7fe6
   gArmPlatformTokenSpaceGuid.PcdCPUCoreSecondaryStackSize
6ef48d
 
eb7fe6
+  gArmPlatformTokenSpaceGuid.PcdEarlyHelloMessage
6ef48d
+
6ef48d
   gEfiMdeModulePkgTokenSpaceGuid.PcdInitValueInTempStack
eb7fe6
-- 
eb7fe6
1.8.3.1
eb7fe6