diff mbox

Forward ported to the latest edk2 code to build with it nd

Message ID CAJ9HRaZfrTZTnhK91JeAPGthtqzGzPBC3-FELE+a-dN2E0jEZg@mail.gmail.com
State Superseded
Headers show

Commit Message

Rony Nandy July 19, 2012, 9:09 a.m. UTC
Forward ported to the latest edk2 code to build with it and
 work on the Origen Board.
 Signed-off-by:rony.nandy@linaro.org
 Signed-off-by:aditya.ps@samsung.com

---
 .../OrigenBoardPkg/OrigenBoardPkg-Exynos.dsc       |    9 ++++++---
 .../OrigenBoardPkg/OrigenBoardPkg-Exynos.fdf       |    2 +-
 .../SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoard.c  |   10 ++++++++++
 .../Library/SmdkBoardLib/SmdkBoardHelper.S         |    5 +++++
 .../Library/SmdkBoardLib/SmdkBoardLib.inf          |    1 -
 .../Library/SmdkBoardLib/SmdkBoardSec.c            |   15 +++++++++++++++
 .../Library/SmdkBoardLib/SmdkBoardSecLib.inf       |    2 +-
 7 files changed, 38 insertions(+), 6 deletions(-)
diff mbox

Patch

diff --git a/SamsungPlatformPkg/OrigenBoardPkg/OrigenBoardPkg-Exynos.dsc
b/SamsungPlatformPkg/OrigenBoardPkg/OrigenBoardPkg-Exynos.dsc
index 1a7be99..bfe690b 100644
--- a/SamsungPlatformPkg/OrigenBoardPkg/OrigenBoardPkg-Exynos.dsc
+++ b/SamsungPlatformPkg/OrigenBoardPkg/OrigenBoardPkg-Exynos.dsc
@@ -37,6 +37,7 @@ 
 !endif
   ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.inf
   ArmPlatformLib|SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardLib.inf
+  ArmPlatformSecLib|SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardSecLib.inf
   ArmCpuLib|ArmPkg/Drivers/ArmCpuLib/ArmCortexA9Lib/ArmCortexA9Lib.inf
   BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
   BaseMemoryLib|ArmPkg/Library/BaseMemoryLibStm/BaseMemoryLibStm.inf
@@ -47,6 +48,7 @@ 
   PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf
   PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
   PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
+  CpuExceptionHandlerLib|MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf

   #
   # Uncomment (and comment out the next line) For RealView Debugger.
The Standard IO window
@@ -98,10 +100,10 @@ 

 [LibraryClasses.common.SEC]
   ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7LibSec.inf
-  ArmGicSecLib|ArmPkg/Drivers/PL390Gic/PL390GicSecLib.inf
-  ArmGicLib|ArmPkg/Drivers/PL390Gic/PL390GicLib.inf
+  ArmTrustedMonitorLib|ArmPlatformPkg/Library/ArmTrustedMonitorLibNull/ArmTrustedMonitorLibNull.inf
+  ArmGicLib|ArmPkg/Drivers/PL390Gic/PL390GicSecLib.inf
   ArmPlatformGlobalVariableLib|ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Sec/SecArmPlatformGlobalVariableLib.inf
-  ArmPlatformLib|SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardSecLib.inf
+  ArmPlatformSecLib|SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardSecLib.inf
   BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
   # L2 Cache Driver
@@ -300,6 +302,7 @@ 
   gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x01000000
   # Stacks for MPCores in Secure World
   gArmPlatformTokenSpaceGuid.PcdCPUCoresSecStackBase|0x4B000000     #
Top of SEC Stack for Secure World
+	gArmPlatformTokenSpaceGuid.PcdSecGlobalVariableSize|0x100

   # Stacks for MPCores in Monitor Mode
   gArmPlatformTokenSpaceGuid.PcdCPUCoresSecMonStackBase|0x4A000000  #
Top of SEC Stack for Monitor World
diff --git a/SamsungPlatformPkg/OrigenBoardPkg/OrigenBoardPkg-Exynos.fdf
b/SamsungPlatformPkg/OrigenBoardPkg/OrigenBoardPkg-Exynos.fdf
index 37d5a48..7b8d05f 100644
--- a/SamsungPlatformPkg/OrigenBoardPkg/OrigenBoardPkg-Exynos.fdf
+++ b/SamsungPlatformPkg/OrigenBoardPkg/OrigenBoardPkg-Exynos.fdf
@@ -50,7 +50,7 @@  NumBlocks     = 0x20
 ################################################################################

 0x0000000|0x00010000
-gArmTokenSpaceGuid.PcdSecureFvBaseAddress|gArmTokenSpaceGuid.PcdSecureFvBaseSize
+gArmTokenSpaceGuid.PcdSecureFvBaseAddress|gArmTokenSpaceGuid.PcdSecureFvSize
 FV = FVMAIN_SEC

 0x00010000|0x00100000
diff --git a/SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoard.c
b/SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoard.c
index e036a6c..2f734f6 100644
--- a/SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoard.c
+++ b/SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoard.c
@@ -149,6 +149,16 @@  ArmPlatformGetBootMode (
 VOID ArmPlatformInitializeSystemMemory(VOID) {
     // We do not need to initialize the System Memory on RTSM
 }
+
+RETURN_STATUS
+ArmPlatformInitialize (
+  IN  UINTN                     MpId
+  )
+{
+return RETURN_SUCCESS;
+}
+
+
 VOID
 ArmPlatformNormalInitialize (
   VOID
diff --git a/SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardHelper.S
b/SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardHelper.S
index b1af424..9dc7abd 100644
--- a/SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardHelper.S
+++ b/SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardHelper.S
@@ -27,6 +27,7 @@  GCC_ASM_EXPORT(ArmPlatformIsClockInitialized)
 GCC_ASM_EXPORT(ArmPlatformIsMemoryInitialized)
 GCC_ASM_EXPORT(ArmPlatformInitializeBootMemory)
 GCC_ASM_EXPORT(ArmPlatformSecBootAction)
+GCC_ASM_EXPORT(ArmPlatformSecBootMemoryInit)

 ASM_PFX(ArmPlatformTZPCInitialized):
         ldr     r0, =Exynos4210_TZPC0_BASE
@@ -343,6 +344,10 @@  cmu_11:
 ASM_PFX(ArmPlatformSecBootAction):
 	 bx    lr

+
+ASM_PFX(ArmPlatformSecBootMemoryInit):
+	 bx    lr
+
 /*
  * Called at the early stage of the Boot phase to know if the memory has
  * already been initialized. Running the code from the reset vector does
diff --git a/SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardLib.inf
b/SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardLib.inf
index 5845fa7..4ae8c5c 100644
--- a/SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardLib.inf
+++ b/SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardLib.inf
@@ -30,7 +30,6 @@ 
 [LibraryClasses]
   IoLib
   ArmLib
-  MemoryAllocationLib

 [Sources.common]
   SmdkBoard.c
diff --git a/SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardSec.c
b/SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardSec.c
index bc29531..a047574 100644
--- a/SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardSec.c
+++ b/SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardSec.c
@@ -40,3 +40,18 @@  ArmPlatformSecInitialize (
       FALSE);

 }
+//Aditya added this to avoid compilation error
+/**
+  Initialize the Secure peripherals and memory regions
+
+  If Trustzone is supported by your platform then this function makes
the required initialization
+  of the secure peripherals and memory regions.
+
+**/
+VOID
+ArmPlatformSecTrustzoneInit (
+  IN  UINTN                     MpId
+  )
+{
+  //ASSERT(FALSE);
+}
diff --git a/SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardSecLib.inf
b/SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardSecLib.inf
index cf77657..f8f7228 100644
--- a/SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardSecLib.inf
+++ b/SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardSecLib.inf
@@ -36,7 +36,7 @@ 
   SmdkBoard.c
   SmdkBoardSec.c
   SmdkBoardHelper.asm   | RVCT
-  SmdkBoardHelper.S     | GCC | ARMGCC
+  SmdkBoardHelper.S     | GCC

 [Protocols]