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

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