From patchwork Tue Jul 24 09:06:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rony Nandy X-Patchwork-Id: 10223 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 8B2CF23E57 for ; Tue, 24 Jul 2012 09:06:09 +0000 (UTC) Received: from mail-gh0-f180.google.com (mail-gh0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id 2047FA185A5 for ; Tue, 24 Jul 2012 09:06:09 +0000 (UTC) Received: by ghbz12 with SMTP id z12so6724146ghb.11 for ; Tue, 24 Jul 2012 02:06:08 -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=AHEh0RhQ0rI+sDWo5ubTwRAJI9DSfYK/D/PP7swq6yY=; b=e/9GrhNF9rPUl6ksiNHjpnEiVKImRsy+GpcmI4hndhGxml1kfTpyWro7aRa0u7Bk/G mxuLfXfdIZqIajWi/OG8Nn1ic7RTlMiRSRKPSmPWEEtMhvp8wKU2rPpSqCsFw204Kf+i IIZNAG5lnTQes0+Jnxv9jVUIzkFSUsdZjVwD4wHUpWp3S7FZdIgTbFJkLm/KRihfHr65 RQOR4E0Zw83M4Ib71XSoUPaEFY8ZS1Hx43Wt/hfnohpW73iGgVMV77R/BFSvV6wSuoTb 60P0BTMJVnft61jrF9vDy4I7C5ZG6vf7u1NG5O5ZJ9G2WlmbRqP/ZU7CGcqLUc2gWFxC myAg== Received: by 10.43.126.1 with SMTP id gu1mr13675402icc.6.1343120768263; Tue, 24 Jul 2012 02:06:08 -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 i7csp68981ibw; Tue, 24 Jul 2012 02:06:07 -0700 (PDT) Received: by 10.52.97.196 with SMTP id ec4mr12984920vdb.96.1343120767408; Tue, 24 Jul 2012 02:06:07 -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 y20si4332556vcw.92.2012.07.24.02.06.06 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Jul 2012 02:06:07 -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 f13so7023898vcb.37 for ; Tue, 24 Jul 2012 02:06:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.149.130 with SMTP id t2mr5790267vcv.8.1343120766665; Tue, 24 Jul 2012 02:06:06 -0700 (PDT) Received: by 10.58.155.8 with HTTP; Tue, 24 Jul 2012 02:06:06 -0700 (PDT) Date: Tue, 24 Jul 2012 14:36:06 +0530 Message-ID: Subject: [RESEND PATCH] SamsungPlatform:Origen: Forward ported to build with the latest edk2 code From: Rony Nandy To: edk2-devel@lists.sourceforge.net Cc: Aditya.ps@samsung.com, Girish Shivananjappa , Patch Tracking X-Gm-Message-State: ALoCoQm0WJLsbAuNxPNhgJXDMbsXFFNBV5ySeklLEf3v8xot7noXuFDowzrJ8mjE3aTIj8T25qk8 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 | 2 +- .../Library/SmdkBoardLib/SmdkBoardSec.c | 15 +++++++++++++++ .../Library/SmdkBoardLib/SmdkBoardSecLib.inf | 2 +- 7 files changed, 39 insertions(+), 6 deletions(-) -- 1.7.5.4 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..0ef5c88 100644 --- a/SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardLib.inf +++ b/SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardLib.inf @@ -30,7 +30,7 @@ [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..93c6645 100644 --- a/SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardSec.c +++ b/SamsungPlatformPkg/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardSec.c @@ -40,3 +40,18 @@ ArmPlatformSecInitialize ( FALSE); } + +/** + 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]