From patchwork Tue May 10 12:11:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 67448 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp2092912qge; Tue, 10 May 2016 05:16:39 -0700 (PDT) X-Received: by 10.140.102.178 with SMTP id w47mr37591175qge.21.1462882599203; Tue, 10 May 2016 05:16:39 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id h65si1207413qgf.52.2016.05.10.05.16.38; Tue, 10 May 2016 05:16:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linaro-uefi-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linaro-uefi-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=linaro-uefi-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id D3A2E6163F; Tue, 10 May 2016 12:16:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 472C56165E; Tue, 10 May 2016 12:13:54 +0000 (UTC) X-Original-To: linaro-uefi@lists.linaro.org Delivered-To: linaro-uefi@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 77E436165F; Tue, 10 May 2016 12:13:38 +0000 (UTC) Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by lists.linaro.org (Postfix) with ESMTPS id 16CF261662 for ; Tue, 10 May 2016 12:12:22 +0000 (UTC) Received: by mail-wm0-f41.google.com with SMTP id e201so175183939wme.0 for ; Tue, 10 May 2016 05:12:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+OX/vdAKfYoufYvL94cELZurwjQ/jFxim9Qj2X1PqDA=; b=OC7YGsswjHYvm9HfBObhvUJVmeAV0k5uuz1A/JMor0UvJ0qbL0MJO+Yt2UKw7Z4/0Q V5WkN7GNxWRLHzLsqBx3bToCcR6nTzYi9JXC0wvqHMpn6xhQU9UvBzmslbHNVLDuNK+a gS8SQDSl2HUyPMiQPR0awwgriMZ990X3JHmWT9ZdrxMwROCpUWSzWDtfRy06rSf04iza 6ClLE8iLDSZ+0UFUoZXTsbQbkaNRzIVQsNX5QjS6OV4Rq6yVI6ikNpgRgnZh25r/CbyA SHcOXXwav0XCRfE+3j5i2uJnG97Va23A00Lx7/F5WcyQoGoKlJqGMoDV3LTNlP+K1OO2 tg3A== X-Gm-Message-State: AOPr4FU7IGHixRnhKqDpFx2KctTawFCmIIHHqt3ZKeFcD7SDWjHAxhUT9IjT7Ero/Oly8Uq42NQ= X-Received: by 10.194.23.162 with SMTP id n2mr17186845wjf.108.1462882341209; Tue, 10 May 2016 05:12:21 -0700 (PDT) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id m20sm2623084wma.23.2016.05.10.05.12.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 May 2016 05:12:20 -0700 (PDT) From: Ard Biesheuvel To: linaro-uefi@lists.linaro.org Date: Tue, 10 May 2016 14:11:51 +0200 Message-Id: <1462882313-7637-13-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1462882313-7637-1-git-send-email-ard.biesheuvel@linaro.org> References: <1462882313-7637-1-git-send-email-ard.biesheuvel@linaro.org> Cc: leo.duran@amd.com Subject: [Linaro-uefi] [PATCH 12/14] Platforms/AMD/Styx: reshuffle flash layout and add variable store region X-BeenThere: linaro-uefi@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linaro-uefi-bounces@lists.linaro.org Sender: "Linaro-uefi" This reduces the size of the overall image to 2 MB, and reserves the top 128 KB for the variable store and the fault tolerant write working and spare areas. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- Platforms/AMD/Styx/CelloBoard/CelloBoard.fdf | 3 +- Platforms/AMD/Styx/Common/Varstore.fdf.inc | 70 ++++++++++++++++++++ Platforms/AMD/Styx/OverdriveBoard/OverdriveBoard.fdf | 3 +- 3 files changed, 74 insertions(+), 2 deletions(-) diff --git a/Platforms/AMD/Styx/CelloBoard/CelloBoard.fdf b/Platforms/AMD/Styx/CelloBoard/CelloBoard.fdf index 333a6e4c619d..04711bd58a5a 100644 --- a/Platforms/AMD/Styx/CelloBoard/CelloBoard.fdf +++ b/Platforms/AMD/Styx/CelloBoard/CelloBoard.fdf @@ -49,10 +49,11 @@ NumBlocks = 0x300 # ################################################################################ -0x00000000|0x00280000 +0x00000000|0x00260000 gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize FV = FVMAIN_COMPACT +!include OpenPlatformPkg/Platforms/AMD/Styx/Common/Varstore.fdf.inc ################################################################################ # diff --git a/Platforms/AMD/Styx/Common/Varstore.fdf.inc b/Platforms/AMD/Styx/Common/Varstore.fdf.inc new file mode 100644 index 000000000000..2456bb3eacba --- /dev/null +++ b/Platforms/AMD/Styx/Common/Varstore.fdf.inc @@ -0,0 +1,70 @@ +## @file +# FDF include file with Layout Regions that define an empty variable store. +# +# Copyright (C) 2016, Linaro, Ltd. +# Copyright (C) 2014, Red Hat, Inc. +# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
+# +# This program and the accompanying materials are licensed and made available +# under the terms and conditions of the BSD License which accompanies this +# distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR +# IMPLIED. +# +## + +0x00260000|0x0000F000 +gAmdStyxTokenSpaceGuid.PcdFlashNvStorageOriginalBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize +DATA = { + ## This is the EFI_FIRMWARE_VOLUME_HEADER + # ZeroVector [] + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + # FileSystemGuid: gEfiSystemNvDataFvGuid = + # { 0xFFF12B8D, 0x7696, 0x4C8B, + # { 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50 }} + 0x8D, 0x2B, 0xF1, 0xFF, 0x96, 0x76, 0x8B, 0x4C, + 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50, + # FvLength: 0x30000 + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, + # Signature "_FVH" # Attributes + 0x5f, 0x46, 0x56, 0x48, 0xff, 0xfe, 0x04, 0x00, + # HeaderLength # CheckSum # ExtHeaderOffset #Reserved #Revision + 0x48, 0x00, 0x19, 0xF9, 0x00, 0x00, 0x00, 0x02, + # Blockmap[0]: 0xF Blocks * 0x1000 Bytes / Block + 0x0F, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, + # Blockmap[1]: End + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + ## This is the VARIABLE_STORE_HEADER + # It is compatible with SECURE_BOOT_ENABLE == FALSE as well. + # Signature: gEfiAuthenticatedVariableGuid = + # { 0xaaf32c78, 0x947b, 0x439a, + # { 0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92 }} + 0x78, 0x2c, 0xf3, 0xaa, 0x7b, 0x94, 0x9a, 0x43, + 0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92, + # Size: 0xF000 (gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize) - + # 0x48 (size of EFI_FIRMWARE_VOLUME_HEADER) = 0xefb8 + # This can speed up the Variable Dispatch a bit. + 0xB8, 0xEF, 0x00, 0x00, + # FORMATTED: 0x5A #HEALTHY: 0xFE #Reserved: UINT16 #Reserved1: UINT32 + 0x5A, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +} + +0x0026F000|0x00001000 +gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize +DATA = { + # EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER->Signature = gEdkiiWorkingBlockSignatureGuid = + # { 0x9e58292b, 0x7c68, 0x497d, { 0xa0, 0xce, 0x65, 0x0, 0xfd, 0x9f, 0x1b, 0x95 }} + 0x2b, 0x29, 0x58, 0x9e, 0x68, 0x7c, 0x7d, 0x49, + 0xa0, 0xce, 0x65, 0x0, 0xfd, 0x9f, 0x1b, 0x95, + # Crc:UINT32 #WorkingBlockValid:1, WorkingBlockInvalid:1, Reserved + 0x2c, 0xaf, 0x2c, 0x64, 0xFE, 0xFF, 0xFF, 0xFF, + # WriteQueueSize: UINT64 + 0xE0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +} + +0x00270000|0x00010000 +gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize diff --git a/Platforms/AMD/Styx/OverdriveBoard/OverdriveBoard.fdf b/Platforms/AMD/Styx/OverdriveBoard/OverdriveBoard.fdf index 679e71a10fae..4e9443642bd2 100644 --- a/Platforms/AMD/Styx/OverdriveBoard/OverdriveBoard.fdf +++ b/Platforms/AMD/Styx/OverdriveBoard/OverdriveBoard.fdf @@ -49,10 +49,11 @@ NumBlocks = 0x300 # ################################################################################ -0x00000000|0x00280000 +0x00000000|0x00260000 gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize FV = FVMAIN_COMPACT +!include OpenPlatformPkg/Platforms/AMD/Styx/Common/Varstore.fdf.inc ################################################################################ #