From patchwork Thu Jul 19 09:09:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rony Nandy X-Patchwork-Id: 10135 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 8BCD423F4C for ; Thu, 19 Jul 2012 09:09:08 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id 3D02CA181EE for ; Thu, 19 Jul 2012 09:09:08 +0000 (UTC) Received: by yenq6 with SMTP id q6so2716760yen.11 for ; Thu, 19 Jul 2012 02:09:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :mime-version:date:message-id:subject:from:to:cc:content-type :x-gm-message-state; bh=aHFZ/GlyO58vJvjSj1lLeP7mIhDab6WDkm9bRwGpxVs=; b=TT3Fwc+7DUuEYv7XLA6vzsvlj2mRfOaLojhWsIdGnXDB3lxwYNoqRtUAvGlXWCUHXD g0BP7JSWZEBsy5anAQDUbOk6mEakw+pirKJy+VsocwadQi8QuV7NpE8gKZr8ErGeDEkE b3Pic9pZzfjXQ39XkJTeE6SBWqLSO4wCKUs3hGgrvpwDr5q4jMyDVgdbZQ1HmF19vN6A onGxHO+9stSx9W0QY5aKHb7HIQKt/Q66AJmRyHN0bj8P4/k2KjO0vBvWiMdU6p7fapuh GewKagSLYxn3CGkQ+ODxP3ROqkqR5tFJl835TiVcQJLYIZWYeCXcvNavifrUaRUGVPlW WjIw== Received: by 10.50.57.167 with SMTP id j7mr4481281igq.53.1342688947465; Thu, 19 Jul 2012 02:09:07 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.153.7 with SMTP id i7csp8311ibw; Thu, 19 Jul 2012 02:09:06 -0700 (PDT) Received: by 10.52.21.174 with SMTP id w14mr481956vde.24.1342688946531; Thu, 19 Jul 2012 02:09:06 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id a8si329931vcr.179.2012.07.19.02.09.06 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 Jul 2012 02:09:06 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of rony.nandy@linaro.org) client-ip=209.85.220.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of rony.nandy@linaro.org) smtp.mail=rony.nandy@linaro.org Received: by vcbf13 with SMTP id f13so2312132vcb.37 for ; Thu, 19 Jul 2012 02:09:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.148.210 with SMTP id q18mr569164vcv.6.1342688946007; Thu, 19 Jul 2012 02:09:06 -0700 (PDT) Received: by 10.58.216.101 with HTTP; Thu, 19 Jul 2012 02:09:05 -0700 (PDT) Date: Thu, 19 Jul 2012 14:39:05 +0530 Message-ID: Subject: [PATCH] Forward ported to the latest edk2 code to build with it nd From: Rony Nandy To: edk2-devel@lists.sourceforge.net Cc: Aditya.ps@samsung.com, Girish Shivananjappa , Patch Tracking X-Gm-Message-State: ALoCoQmCU/MOq8yAoV2BDp4TOiGw5tmBhCESNQx7h/72Q8KSlzQYcMi3XePT0IbCk8az4ewH2ZZw 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 --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]