From nobody Wed Dec 25 13:21:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1508061317060807.1635333026579; Sun, 15 Oct 2017 02:55:17 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 38E4C202E6112; Sun, 15 Oct 2017 02:51:42 -0700 (PDT) Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9680E202E6108 for ; Sun, 15 Oct 2017 02:51:39 -0700 (PDT) Received: by mail-wm0-x232.google.com with SMTP id i124so28045778wmf.3 for ; Sun, 15 Oct 2017 02:55:13 -0700 (PDT) Received: from localhost.localdomain ([154.146.29.151]) by smtp.gmail.com with ESMTPSA id 25sm3938943wrv.8.2017.10.15.02.55.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Oct 2017 02:55:10 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::232; helo=mail-wm0-x232.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=u8pCIfGMNk1kkFNjwZ5gDPD03jm+MSJDgUkzqvswdBI=; b=ZFfQqgb1BHh7iwVpevZoAqrRqk3QdtqfF4fynh67iVagaur0xF0nVc0uK5piV+8pzl KUQUObxQ9XUf/T7aFKMFlZGZorAS06vhafVes7ZVJKzEC4OVpcuzHdTgBGNqmNEG25gT yQAjUADmMxaCHRngp3dEU+dMNkAbrFZDQH8m4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=u8pCIfGMNk1kkFNjwZ5gDPD03jm+MSJDgUkzqvswdBI=; b=MGU3PfLRf6XR3csP/xMru6AB6GPP4a7GS0n6nFl4cKbcHPkUQZySPlzqlcKNIPTg/i ro4PfusxyqOYlM2q/BdqZVVATIlXPkBhTei7ZLt8hZYy6YFc7OUdoaKnoDTbwLEkz5AD 9N5+9fThqdOms5eWc4+ioHlDjPAuIeu0tfOBsarTODxqviZQQxBmOvJwHSwZv2xTUqfk Isgp4C+wJpYMWovO4j6ydTSFtBje+T+2fE+g8ymnuOmu2LlNXhirLZfQkaxzc3No+fSG 9dfZfTSieDF31W7zaxokgqY9dcxsbbcvCw1XAeQv26qlSeA3P756pVci7ebz3wbT1Iru Tk5Q== X-Gm-Message-State: AMCzsaU5YQ4oVlKjMY0UQhZuZTiH8IXWY7cxzdAFKX2/uy/Y9o5VcnNn 4Uvt7n9P6C5dXvSWLPQ7ZKb2Ry8Xrp0= X-Google-Smtp-Source: ABhQp+R0zgHZpLF8aA+N4oXn1U9cJ4BR9m2OeaujnhvSSnc4hQU+evBh82sYHWjT+YMsrZE0W9AszQ== X-Received: by 10.28.69.8 with SMTP id s8mr4414125wma.65.1508061311627; Sun, 15 Oct 2017 02:55:11 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Sun, 15 Oct 2017 10:54:49 +0100 Message-Id: <20171015095453.4420-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171015095453.4420-1-ard.biesheuvel@linaro.org> References: <20171015095453.4420-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 1/5] Platform/AMD/Overdrive: remove StatusCodeLib references X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alan@softiron.co.uk, Ard Biesheuvel , leif.lindholm@linaro.org, naresh.bhat@linaro.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This fixes a reboot issue, which is caused by the inclusion of the wrong flavor of StatusCodeLib into ResetSystemRuntimeDxe. However, we don't use status codes in the first place, so let's replace all occurrences with the NULL resolution. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- Platform/AMD/OverdriveBoard/OverdriveBoard.dsc | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc b/Platform/AMD/= OverdriveBoard/OverdriveBoard.dsc index bc69c586e929..c99c12a2230e 100644 --- a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc +++ b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc @@ -150,6 +150,9 @@ DEFINE DO_FLASHER =3D FALSE SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf =20 + ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseRepor= tStatusCodeLibNull.inf + OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHo= okStatusCodeLibNull.inf + [LibraryClasses.common.SEC] HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf PeiServicesTablePointerLib|ArmPkg/Library/PeiServicesTablePointerLib/Pei= ServicesTablePointerLib.inf @@ -178,8 +181,6 @@ DEFINE DO_FLASHER =3D FALSE MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAlloc= ationLib.inf PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.= inf - ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiRepor= tStatusCodeLib.inf - OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHo= okStatusCodeLibNull.inf PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeC= offGetEntryPointLib.inf UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompres= sLib.inf ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExt= ractGuidedSectionLib.inf @@ -192,8 +193,6 @@ DEFINE DO_FLASHER =3D FALSE MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAlloc= ationLib.inf PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.= inf - ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiRepor= tStatusCodeLib.inf - OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHo= okStatusCodeLibNull.inf PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeC= offGetEntryPointLib.inf PeiResourcePublicationLib|MdePkg/Library/PeiResourcePublicationLib/PeiRe= sourcePublicationLib.inf UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompres= sLib.inf @@ -205,13 +204,11 @@ DEFINE DO_FLASHER =3D FALSE HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeC= oreMemoryAllocationLib.inf DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf - ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeL= ibFramework/DxeReportStatusCodeLib.inf ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExt= ractGuidedSectionLib.inf UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompres= sLib.inf PerformanceLib|MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerform= anceLib.inf =20 [LibraryClasses.common.DXE_DRIVER] - ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeL= ibFramework/DxeReportStatusCodeLib.inf SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeS= ecurityManagementLib.inf PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.= inf MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf @@ -220,18 +217,15 @@ DEFINE DO_FLASHER =3D FALSE [LibraryClasses.common.DXE_RUNTIME_DRIVER] HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf - ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeL= ibFramework/DxeReportStatusCodeLib.inf - CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf + CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf =20 [LibraryClasses.common.UEFI_APPLICATION] UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDec= ompressLib/BaseUefiTianoCustomDecompressLib.inf PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.= inf MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf - ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor= tStatusCodeLib.inf =20 [LibraryClasses.common.UEFI_DRIVER] - ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeL= ibFramework/DxeReportStatusCodeLib.inf UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDec= ompressLib/BaseUefiTianoCustomDecompressLib.inf ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExt= ractGuidedSectionLib.inf PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.= inf @@ -339,8 +333,6 @@ DEFINE DO_FLASHER =3D FALSE # DEBUG_ERROR 0x80000000 // Error gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000000F =20 - gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07 - # # Optional feature to help prevent EFI memory map fragments # Turned on and off via: PcdPrePiProduceMemoryTypeInformationHob --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed Dec 25 13:21:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1508061320342210.03521534132938; Sun, 15 Oct 2017 02:55:20 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 72C05202E6117; Sun, 15 Oct 2017 02:51:43 -0700 (PDT) Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5DAEB202E60F0 for ; Sun, 15 Oct 2017 02:51:41 -0700 (PDT) Received: by mail-wm0-x232.google.com with SMTP id u138so28792003wmu.4 for ; Sun, 15 Oct 2017 02:55:15 -0700 (PDT) Received: from localhost.localdomain ([154.146.29.151]) by smtp.gmail.com with ESMTPSA id 25sm3938943wrv.8.2017.10.15.02.55.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Oct 2017 02:55:12 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::232; helo=mail-wm0-x232.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zLG+h+ypgsFGtG3/j1YuiXtrIGgpBaTN/BWY3qBgiBE=; b=cDEKBF6hSWT98aHOyraSaG5IcrykdpD6g9Uy9xtCCx0ZCPRsE8hB7oRlESMMWKxETH UKKhI2fVBYHYzQ+6uNRH+SAZJbicQbR+exoPk4U0c7VaBxxSKZCs3ihjBc3Dawv+vwBL Vmz0TF2sroGk+gy8SvMVgnfAGcR5F2ajMTZ7g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zLG+h+ypgsFGtG3/j1YuiXtrIGgpBaTN/BWY3qBgiBE=; b=h9ssoRh+qPOJJqEqt1VN4TWkImZqIUH0Wh2nz33e27L5MIKRvmqiFlQMrnoNjqVhEd r7tZ9eqgg52ty3lGrzBf7Ywn1wYb1DpOpYlGuwfY+NTlBZ4LFfhsytI1sVofGqzwHOVU 06HCUGtdQ9+Wft4Zb6oVMFBV3u7ziznDwjWUSV7xjUoLdAKvE2IS28yY2nPchhTu4P97 xwFYgt/vdbodQj47gyhKkWAoUpS2+W3Efa2wO7b5iwFX/ryTro2SDm58wriUdakLf24Y 51gSYpJ1iDsy/oM1Lk46ZX35y+rlwp0s3TRv7c3cex8Zb48fJfWQEbMjVS+K9Z9ZDL/g 1XuQ== X-Gm-Message-State: AMCzsaWOQwl4EniCfGr+DJeAbPUjAhb81+7QfnjXFBe6bkOhNFEf4e0T q/MQuI7zFBfePw9jTomy/rlo+4zTBUQ= X-Google-Smtp-Source: ABhQp+Rpr59PeWB9ZfljrBnlC/43r4+fFgB3TqerpiAtMNo+ae0mWgKt80mOf1/3Q1+eW2ROZzcGag== X-Received: by 10.28.153.85 with SMTP id b82mr4483942wme.121.1508061313592; Sun, 15 Oct 2017 02:55:13 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Sun, 15 Oct 2017 10:54:50 +0100 Message-Id: <20171015095453.4420-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171015095453.4420-1-ard.biesheuvel@linaro.org> References: <20171015095453.4420-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 2/5] Silicon/AMD/Styx: update SMMU id to MMU-401 X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alan@softiron.co.uk, Ard Biesheuvel , leif.lindholm@linaro.org, naresh.bhat@linaro.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The IORT spec has been updated to include more specific defines for the MMU-401, which supports more page sizes than the generic SMMU v1. Note that this requires an OS that understands these new definitions. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- Silicon/AMD/Styx/AcpiTables/Iort.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/AMD/Styx/AcpiTables/Iort.c b/Silicon/AMD/Styx/AcpiTabl= es/Iort.c index 80872773ba7d..370e71e13610 100644 --- a/Silicon/AMD/Styx/AcpiTables/Iort.c +++ b/Silicon/AMD/Styx/AcpiTables/Iort.c @@ -84,7 +84,7 @@ typedef struct { }, \ Base, \ Size, \ - EFI_ACPI_IORT_SMMUv1v2_MODEL_v1, \ + EFI_ACPI_IORT_SMMUv1v2_MODEL_MMU401, \ EFI_ACPI_IORT_SMMUv1v2_FLAG_COH_WALK, \ FIELD_OFFSET(EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE, \ SMMU_NSgIrpt), \ --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed Dec 25 13:21:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1508061323242796.6015245744842; Sun, 15 Oct 2017 02:55:23 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id B0353202E6119; Sun, 15 Oct 2017 02:51:44 -0700 (PDT) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 92D32202E6119 for ; Sun, 15 Oct 2017 02:51:43 -0700 (PDT) Received: by mail-wm0-x233.google.com with SMTP id 196so909884wma.1 for ; Sun, 15 Oct 2017 02:55:17 -0700 (PDT) Received: from localhost.localdomain ([154.146.29.151]) by smtp.gmail.com with ESMTPSA id 25sm3938943wrv.8.2017.10.15.02.55.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Oct 2017 02:55:15 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::233; helo=mail-wm0-x233.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WhxOGCN638hmnM3vmwuITainV+PNidNqztOhJukIgvs=; b=Ynf0dEWQ0biXVA3k2E+I8EWfo9o4/8qlV6WEORI0k9JFAV4NyD6QfLTD1tlO2YCh65 1r1XaxnM4jCptk/GS54GdO2YP7fS25JtQ9y7xcjCilwEBpujTEa+JKaDl+Kyph5tJ2Hd Q0PmRd9Hou9AiuQtatat2CAK0P6Z7gDWBKUCQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WhxOGCN638hmnM3vmwuITainV+PNidNqztOhJukIgvs=; b=HgHI0LurZMQvEv744oJixgAGt+wNXLkhdi7N4qq1GA9SDYJeYC4ILwpS1gLcwslWrn Ahu+K4VWKkSew+kl6ExYTWPcFZBY6bDhWwyJVRAel3Z+J5Zen6dtAGfI6PnOEYsvHp4d 3RxToeAj3Dx8nteuTF3BHjepvgAHICykl0vdZCudCWYJSCkaFcNmKLe6maIGyP6Tz9ob IsyYdJus9PoprmJFBTxCnILA/W/cWBZvKUS/tIFVHSkGoDgy+2i5RuEUC1t5qo9OZVgK C7u/6+DVoWS9Gp29Jz72FIhOBxOAJs04/UXO7INxXwWJFZJNSQ5KQFKBa1GfAbceGuU6 kErA== X-Gm-Message-State: AMCzsaWdXEDlzwhMwBe+h3gCbVfIRbERZ8y8uqZVPoyWffBd1HJZo3mc zlKAVynhFFYTnbxeXTmDXILNue+fOOE= X-Google-Smtp-Source: ABhQp+TMt2DpMkhe0Bp6KG5XWCuzJBJ4gT5ZsNGG7qqm2GOELkN3GGv20MnHE6NsjXj+ydI2HlOQvg== X-Received: by 10.28.214.212 with SMTP id n203mr4468321wmg.10.1508061315692; Sun, 15 Oct 2017 02:55:15 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Sun, 15 Oct 2017 10:54:51 +0100 Message-Id: <20171015095453.4420-4-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171015095453.4420-1-ard.biesheuvel@linaro.org> References: <20171015095453.4420-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 3/5] Silicon/Amd/Styx: fix flasher support X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alan@softiron.co.uk, Ard Biesheuvel , leif.lindholm@linaro.org, naresh.bhat@linaro.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The StyxFlashUefi application was not migrated correctly from OpenPlatformPkg to edk2-platforms. It will be superseded shortly by capsule update support, but let's put it back into a working state before we remove it. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- Platform/AMD/OverdriveBoard/OverdriveBoard.dsc | 2 +- Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc | 2 +- Silicon/AMD/Styx/Applications/StyxFlashUefi/StyxFlashUefi.inf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc b/Platform/AMD/= OverdriveBoard/OverdriveBoard.dsc index c99c12a2230e..daa773172029 100644 --- a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc +++ b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc @@ -740,7 +740,7 @@ DEFINE DO_FLASHER =3D FALSE } =20 !if $(DO_FLASHER) =3D=3D TRUE - OpenPlatformPkg/Silicon/AMD/Styx/Applications/StyxFlashUefi/StyxFlashUef= i.inf { + Silicon/AMD/Styx/Applications/StyxFlashUefi/StyxFlashUefi.inf { ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLi= b.inf } diff --git a/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc b/= Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc index d4fc159bcf8d..29ce8b3bd18e 100644 --- a/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc +++ b/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc @@ -703,7 +703,7 @@ DEFINE DO_FLASHER =3D FALSE } =20 !if $(DO_FLASHER) =3D=3D TRUE - OpenPlatformPkg/Silicon/AMD/Styx/Applications/StyxFlashUefi/StyxFlashUef= i.inf { + Silicon/AMD/Styx/Applications/StyxFlashUefi/StyxFlashUefi.inf { ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLi= b.inf } diff --git a/Silicon/AMD/Styx/Applications/StyxFlashUefi/StyxFlashUefi.inf = b/Silicon/AMD/Styx/Applications/StyxFlashUefi/StyxFlashUefi.inf index 582b57b2c80d..0c289dcf95f4 100644 --- a/Silicon/AMD/Styx/Applications/StyxFlashUefi/StyxFlashUefi.inf +++ b/Silicon/AMD/Styx/Applications/StyxFlashUefi/StyxFlashUefi.inf @@ -29,10 +29,10 @@ StyxFlashUefi.c =20 [Packages] - AmdModulePkg/AmdModulePkg.dec ArmPkg/ArmPkg.dec MdePkg/MdePkg.dec ShellPkg/ShellPkg.dec + Silicon/AMD/Styx/AmdModulePkg/AmdModulePkg.dec =20 [LibraryClasses] BaseMemoryLib --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed Dec 25 13:21:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1508061325914837.539508924849; Sun, 15 Oct 2017 02:55:25 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E6726202E6111; Sun, 15 Oct 2017 02:51:46 -0700 (PDT) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7E8F9202E60F0 for ; Sun, 15 Oct 2017 02:51:45 -0700 (PDT) Received: by mail-wm0-x22e.google.com with SMTP id k4so28662947wmc.1 for ; Sun, 15 Oct 2017 02:55:19 -0700 (PDT) Received: from localhost.localdomain ([154.146.29.151]) by smtp.gmail.com with ESMTPSA id 25sm3938943wrv.8.2017.10.15.02.55.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Oct 2017 02:55:16 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::22e; helo=mail-wm0-x22e.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PWiQHDdb1fyEcpVsgW/zInEkrf4sVkKCJCGWJTufbQ8=; b=bc30rfph6GaB9DKmPOMy06jR91maf/XDXu37rmIujecTQW67n7BuqrOIXf+iolXZv/ mDxPt0WFJk23OMMUv93Ac5CFIpmnv7BunAE3q9EedrdmeGgCIAvMiPAeBWgrL17pv8Du 5F6SsMm7cB6K3njd61eZvl5gtYI1aqGpdrYD8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PWiQHDdb1fyEcpVsgW/zInEkrf4sVkKCJCGWJTufbQ8=; b=W8OdpcaDCbVNSknaE9h89wlX7tQSWF9TPQaLK7EBHB7Ku9kZ6NSgA49FBhSrWrFtW2 U/dpf7FUbwIsatx6Mb89jpkzGNhHnZ1a+ItuN8H7X6tdsZaYlxvfMfPcJW0gAMCZulwZ 5D5hwnz5zBvuCpHZJfTj1J/glXF3OMbenCYbEMyV/Mp4hfkN+/oCyczmJiuQJMi6+W5/ D3TnfMfgJFvuLKg8O9+MpZ6l2uaHFdl54WzdiqSX9KFNyJ8h8gXzhN2+xoq4GIHApG+O ccRenndnveXkj50Jl06K59h9EllxXy8nNKxXbXFH+iyANZFtEMrB+UOiBrA2COgz1m1l OeFw== X-Gm-Message-State: AMCzsaWmfgK1Yc7tKUCqHlq6mHgrR9usvO8BH0nGDx6PcmgRdM+EvaxR HU7rVsvsObqiPybyR8gLKJZwr+D3AWA= X-Google-Smtp-Source: ABhQp+Tj0A5d2CEfGG2bc/MS502h2rTIbdD7IjVPZ7LAd8zANtZyrysaGP9WdAm842jkpVvV5yL5xg== X-Received: by 10.28.181.2 with SMTP id e2mr4482330wmf.81.1508061317463; Sun, 15 Oct 2017 02:55:17 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Sun, 15 Oct 2017 10:54:52 +0100 Message-Id: <20171015095453.4420-5-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171015095453.4420-1-ard.biesheuvel@linaro.org> References: <20171015095453.4420-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 4/5] Silicon/AMD/Styx: add PlatformFlashAccessLib implementation X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alan@softiron.co.uk, Ard Biesheuvel , leif.lindholm@linaro.org, naresh.bhat@linaro.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" In preparation of adding capsule support to the AMD Styx aka Seattle based platforms, implement a PlatformFlashAccessLib instance that invokes the ISCP to update the FV containing our UEFI image. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAcces= sLib.c | 128 ++++++++++++++++++++ Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAcces= sLib.inf | 47 +++++++ 2 files changed, 175 insertions(+) diff --git a/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatfo= rmFlashAccessLib.c b/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/St= yxPlatformFlashAccessLib.c new file mode 100644 index 000000000000..a23500dd35dc --- /dev/null +++ b/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlash= AccessLib.c @@ -0,0 +1,128 @@ +/** @file + Platform flash device access library for AMD Styx + + Copyright (c) 2017, Linaro, Ltd. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BS= D License + which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. + +**/ + +#include + +#include +#include +#include +#include + +#include + +STATIC CONST UINT64 mFlashOffset =3D FixedPcdGet64 (PcdFvBaseAddress) - + FixedPcdGet64 (PcdFdBaseAddress); +STATIC CONST UINT64 mFlashMaxSize =3D FixedPcdGet64 (PcdFvSize); + +STATIC CONST UINTN mBlockSize =3D SIZE_64KB; + +/** + Perform flash write operation. + + @param[in] FirmwareType The type of firmware. + @param[in] FlashAddress The address of flash device to be accessed. + @param[in] FlashAddressType The type of flash device address. + @param[in] Buffer The pointer to the data buffer. + @param[in] Length The length of data buffer in bytes. + + @retval EFI_SUCCESS The operation returns successfully. + @retval EFI_WRITE_PROTECTED The flash device is read only. + @retval EFI_UNSUPPORTED The flash device access is unsupported. + @retval EFI_INVALID_PARAMETER The input parameter is not valid. +**/ +EFI_STATUS +EFIAPI +PerformFlashWrite ( + IN PLATFORM_FIRMWARE_TYPE FirmwareType, + IN EFI_PHYSICAL_ADDRESS FlashAddress, + IN FLASH_ADDRESS_TYPE FlashAddressType, + IN VOID *Buffer, + IN UINTN Length + ) +{ + EFI_STATUS Status; + AMD_ISCP_DXE_PROTOCOL *IscpDxeProtocol; + + if (FlashAddressType !=3D FlashAddressTypeRelativeAddress) { + DEBUG ((DEBUG_ERROR, "%a: only FlashAddressTypeRelativeAddress support= ed\n", + __FUNCTION__)); + + return EFI_INVALID_PARAMETER; + } + + if (FirmwareType !=3D PlatformFirmwareTypeSystemFirmware) { + DEBUG ((DEBUG_ERROR, + "%a: only PlatformFirmwareTypeSystemFirmware supported\n", + __FUNCTION__)); + + return EFI_INVALID_PARAMETER; + } + + if ((FlashAddress % mBlockSize) !=3D 0 || (Length % mBlockSize) !=3D 0) { + DEBUG ((DEBUG_ERROR, + "%a:region [0x%lx, 0x%lx) is not a multiple of the blocksize 0x%lx\n= ", + __FUNCTION__, FlashAddress, Length, mBlockSize)); + return EFI_INVALID_PARAMETER; + } + + if (FlashAddress < mFlashOffset || + (FlashAddress + Length) > (mFlashOffset + mFlashMaxSize)) { + DEBUG ((DEBUG_ERROR, + "%a: updated region [0x%lx, 0x%lx) outside of FV region [0x%lx, 0x%l= x)\n", + __FUNCTION__, FlashAddress, FlashAddress + Length, mFlashOffset, + mFlashOffset + mFlashMaxSize)); + return EFI_INVALID_PARAMETER; + } + + Status =3D gBS->LocateProtocol (&gAmdIscpDxeProtocolGuid, NULL, + (VOID **)&IscpDxeProtocol); + ASSERT_EFI_ERROR (Status); + + while (Length > 0) { + // + // Erase the block + // + DEBUG ((DEBUG_INFO, "%a: erasing 0x%llx bytes at address 0x%llx\n", + __FUNCTION__, mBlockSize, FlashAddress)); + + Status =3D IscpDxeProtocol->AmdExecuteEraseFvBlockDxe (IscpDxeProtocol, + FlashAddress, mBlockSize); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: AmdExecuteEraseFvBlockDxe () failed - %r\n= ", + __FUNCTION__, Status)); + } + + // + // Write the new data + // + DEBUG ((DEBUG_INFO, "%a: writing 0x%llx bytes at at address 0x%llx\\n", + __FUNCTION__, mBlockSize, FlashAddress)); + + Status =3D IscpDxeProtocol->AmdExecuteUpdateFvBlockDxe (IscpDxeProtoco= l, + FlashAddress, Buffer, mBlockSize); + + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, + "%a: write of block address 0x%lx failed - %r\n", + __FUNCTION__, FlashAddress, Status)); + } + + FlashAddress +=3D mBlockSize; + Buffer +=3D mBlockSize; + Length -=3D mBlockSize; + } + + return EFI_SUCCESS; +} diff --git a/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatfo= rmFlashAccessLib.inf b/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/= StyxPlatformFlashAccessLib.inf new file mode 100644 index 000000000000..411173f1f3c5 --- /dev/null +++ b/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlash= AccessLib.inf @@ -0,0 +1,47 @@ +## @file +# Platform flash device access library. +# +# Copyright (c) 2017, Linaro, Ltd. All rights reserved.
+# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the B= SD 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 IM= PLIED. +# +## + +[Defines] + INF_VERSION =3D 0x00010019 + BASE_NAME =3D StyxPlatformFlashAccessLib + FILE_GUID =3D 3fd08c10-07de-4851-a891-acaeea5055f8 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D PlatformFlashAccessLib|DXE_DRIVER + +[Sources] + StyxPlatformFlashAccessLib.c + +[Packages] + ArmPkg/ArmPkg.dec + MdePkg/MdePkg.dec + SignedCapsulePkg/SignedCapsulePkg.dec + Silicon/AMD/Styx/AmdModulePkg/AmdModulePkg.dec + +[LibraryClasses] + BaseMemoryLib + DebugLib + UefiBootServicesTableLib + +[Protocols] + gAmdIscpDxeProtocolGuid ## CONSUMES + +[FixedPcd] + gArmTokenSpaceGuid.PcdFdBaseAddress + gArmTokenSpaceGuid.PcdFvBaseAddress + gArmTokenSpaceGuid.PcdFvSize + +[Depex] + gAmdIscpDxeProtocolGuid --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed Dec 25 13:21:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1508061328875149.9418071984503; Sun, 15 Oct 2017 02:55:28 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3056E202E611E; Sun, 15 Oct 2017 02:51:49 -0700 (PDT) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C5EE6202E60F0 for ; Sun, 15 Oct 2017 02:51:47 -0700 (PDT) Received: by mail-wm0-x22b.google.com with SMTP id l68so28617764wmd.5 for ; Sun, 15 Oct 2017 02:55:21 -0700 (PDT) Received: from localhost.localdomain ([154.146.29.151]) by smtp.gmail.com with ESMTPSA id 25sm3938943wrv.8.2017.10.15.02.55.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Oct 2017 02:55:19 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::22b; helo=mail-wm0-x22b.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=f+HPp8MM9ZZAD3C3E9JDTFhRRI4IXG2ka6GKRBQwoJY=; b=V9VDtw1VjbuwL6Y14/FdCn0UqzS1nJbMthuSiPCLxYW1e/wT9nDJVveGaVgp4zHrmB ceEoD78Ee0NcpRuqv9Io0EK1VY+fw7fbGBr2TxrNEuXQ7ScWNuJasaDhWI5Zbrnpl7Mw m12XnN6bAzvkgZ/bQEbCmrtrYG//p4kR7AG5Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=f+HPp8MM9ZZAD3C3E9JDTFhRRI4IXG2ka6GKRBQwoJY=; b=kV06JUh+rC/JINGatuYwrgUZ3LlbmOJ1zrVJxioxo6n4qL0NYNeKLpJohshMxxCSAw bXgRKxbOyXc8wWEHHu3o9cda+jCQW7q3NtUZaeU2GRSFX9jaoLyR00iIqL0rEqdlDBqG VJBM4L62+lVZe9MMFGqznSnCMkm70oFMoQ/N1cCWuQ6drcMgV6g1SUiDwkovNTTsctkD ADImGyhdO+5cR+cfLmvjGIasS9y9TRRgM7wnN8dHTAzjqIaglVVyaHZ4147AqVhRyZtd wVQWmFHNbi9Ckic3KfgSrj1spuk953WRQ3f5ntENFaezVUZNfi/uusf76mpTX3IfeHTW 3ysQ== X-Gm-Message-State: AMCzsaVQXJOHICzE6ubgMvyqj/UJhT3S1aoYqrbPzvpXlSfxNflFORzm KcwgWyOye0RoYYETeNRGJccPsSV3hbE= X-Google-Smtp-Source: ABhQp+QbklVh38xX2mu5tLR5d8p9qOnZkuW+FaYABSTmALpFKQDj3+2Z3jwwYJE0iR2gfXfVHUWQ4Q== X-Received: by 10.28.232.75 with SMTP id f72mr4705622wmh.90.1508061319741; Sun, 15 Oct 2017 02:55:19 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Sun, 15 Oct 2017 10:54:53 +0100 Message-Id: <20171015095453.4420-6-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171015095453.4420-1-ard.biesheuvel@linaro.org> References: <20171015095453.4420-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 5/5] Platforms/AMD/Overdrive: add signed capsule update support X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alan@softiron.co.uk, Ard Biesheuvel , leif.lindholm@linaro.org, naresh.bhat@linaro.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Wire up the various modules and boilerplate configuration snippets to implement signed capsule update for AMD Overdrive. Note that this uses the insecure default key. The secure firmware on this SoC does not implement warm reboot, so we cannot support capsules that persist across reset. Instead, the capsule may be installed using CapsuleApp (from MdeModulePkg), from the UEFI Shell prompt. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm --- Platform/AMD/OverdriveBoard/OverdriveBoard.dsc = | 27 ++++++- Platform/AMD/OverdriveBoard/OverdriveBoard.fdf = | 83 ++++++++++++++++++++ Platform/AMD/OverdriveBoard/SystemFirmwareDescriptor/SystemFirmwareDescrip= tor.aslc | 80 +++++++++++++++++++ Platform/AMD/OverdriveBoard/SystemFirmwareDescriptor/SystemFirmwareDescrip= tor.inf | 46 +++++++++++ Platform/AMD/OverdriveBoard/SystemFirmwareDescriptor/SystemFirmwareDescrip= torPei.c | 68 ++++++++++++++++ Platform/AMD/OverdriveBoard/SystemFirmwareUpdateConfig/SystemFirmwareUpdat= eConfig.ini | 25 ++++++ 6 files changed, 328 insertions(+), 1 deletion(-) diff --git a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc b/Platform/AMD/= OverdriveBoard/OverdriveBoard.dsc index daa773172029..a15f96d2fba9 100644 --- a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc +++ b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc @@ -123,7 +123,15 @@ DEFINE DO_FLASHER =3D FALSE ResetSystemLib|ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSy= stemLib.inf RealTimeClockLib|Silicon/AMD/Styx/Library/RealTimeClockLib/RealTimeClock= Lib.inf =20 - CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf + CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.inf + BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf + OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf + IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + EdkiiSystemCapsuleLib|SignedCapsulePkg/Library/EdkiiSystemCapsuleLib/Edk= iiSystemCapsuleLib.inf + FmpAuthenticationLib|SecurityPkg/Library/FmpAuthenticationLibPkcs7/FmpAu= thenticationLibPkcs7.inf + IniParsingLib|SignedCapsulePkg/Library/IniParsingLib/IniParsingLib.inf + PlatformFlashAccessLib|Silicon/AMD/Styx/Library/StyxPlatformFlashAccessL= ib/StyxPlatformFlashAccessLib.inf + UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManag= erLib.inf PlatformBootManagerLib|ArmPkg/Library/PlatformBootManagerLib/PlatformBoo= tManagerLib.inf BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf @@ -499,6 +507,15 @@ DEFINE DO_FLASHER =3D FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|0x0 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64|0x0 =20 +[PcdsDynamicExDefault.common.DEFAULT] + gEfiSignedCapsulePkgTokenSpaceGuid.PcdEdkiiSystemFirmwareImageDescriptor= |{0x0}|VOID*|0x100 + + # 642e4fcf-2df7-4415-8b70-a03909c57b55 + gEfiSignedCapsulePkgTokenSpaceGuid.PcdEdkiiSystemFirmwareFileGuid|{0xcf,= 0x4f, 0x2e, 0x64, 0xf7, 0x2d, 0x15, 0x44, 0x8b, 0x70, 0xa0, 0x39, 0x09, 0x= c5, 0x7b, 0x55} + + # d34b3d29-0085-4ab3-8be8-84188cc50489 + gEfiMdeModulePkgTokenSpaceGuid.PcdSystemFmpCapsuleImageTypeIdGuid|{0x29,= 0x3d, 0x4b, 0xd3, 0x85, 0x0, 0xb3, 0x4a, 0x8b, 0xe8, 0x84, 0x18, 0x8c, 0xc= 5, 0x04, 0x89} + [PcdsDynamicHii] gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVar= iableGuid|0x0|5 =20 @@ -745,3 +762,11 @@ DEFINE DO_FLASHER =3D FALSE ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLi= b.inf } !endif + + # + # Firmware update + # + MdeModulePkg/Universal/EsrtDxe/EsrtDxe.inf + SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareReportDxe.= inf + SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareUpdateDxe.= inf + Platform/AMD/OverdriveBoard/SystemFirmwareDescriptor/SystemFirmwareDescr= iptor.inf diff --git a/Platform/AMD/OverdriveBoard/OverdriveBoard.fdf b/Platform/AMD/= OverdriveBoard/OverdriveBoard.fdf index 23e57befcdd9..18f74b3c46fe 100644 --- a/Platform/AMD/OverdriveBoard/OverdriveBoard.fdf +++ b/Platform/AMD/OverdriveBoard/OverdriveBoard.fdf @@ -249,6 +249,12 @@ READ_LOCK_STATUS =3D TRUE # INF Silicon/AMD/Styx/Drivers/StyxRngDxe/StyxRngDxe.inf =20 + # + # Firmware update + # + INF MdeModulePkg/Universal/EsrtDxe/EsrtDxe.inf + INF SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareReport= Dxe.inf + [FV.STYX_EFI] FvAlignment =3D 16 ERASE_POLARITY =3D 1 @@ -277,6 +283,8 @@ READ_LOCK_STATUS =3D TRUE INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf + INF RuleOverride =3D FMP_IMAGE_DESC Platform/AMD/OverdriveBoard/SystemFi= rmwareDescriptor/SystemFirmwareDescriptor.inf + =20 FILE FV_IMAGE =3D 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 { SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRE= D =3D TRUE { @@ -284,6 +292,73 @@ READ_LOCK_STATUS =3D TRUE } } =20 +[FV.CapsuleDispatchFv] +FvAlignment =3D 16 +ERASE_POLARITY =3D 1 +MEMORY_MAPPED =3D TRUE +STICKY_WRITE =3D TRUE +LOCK_CAP =3D TRUE +LOCK_STATUS =3D TRUE +WRITE_DISABLED_CAP =3D TRUE +WRITE_ENABLED_CAP =3D TRUE +WRITE_STATUS =3D TRUE +WRITE_LOCK_CAP =3D TRUE +WRITE_LOCK_STATUS =3D TRUE +READ_DISABLED_CAP =3D TRUE +READ_ENABLED_CAP =3D TRUE +READ_STATUS =3D TRUE +READ_LOCK_CAP =3D TRUE +READ_LOCK_STATUS =3D TRUE + + INF SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareUpdat= eDxe.inf + +[FV.SystemFirmwareUpdateCargo] +FvAlignment =3D 16 +ERASE_POLARITY =3D 1 +MEMORY_MAPPED =3D TRUE +STICKY_WRITE =3D TRUE +LOCK_CAP =3D TRUE +LOCK_STATUS =3D TRUE +WRITE_DISABLED_CAP =3D TRUE +WRITE_ENABLED_CAP =3D TRUE +WRITE_STATUS =3D TRUE +WRITE_LOCK_CAP =3D TRUE +WRITE_LOCK_STATUS =3D TRUE +READ_DISABLED_CAP =3D TRUE +READ_ENABLED_CAP =3D TRUE +READ_STATUS =3D TRUE +READ_LOCK_CAP =3D TRUE +READ_LOCK_STATUS =3D TRUE + + FILE RAW =3D 642e4fcf-2df7-4415-8b70-a03909c57b55 { # PcdEdkiiSystemFirm= wareFileGuid + FV =3D STYX_EFI + } + + FILE RAW =3D ce57b167-b0e4-41e8-a897-5f4feb781d40 { # gEdkiiSystemFmpCap= suleDriverFvFileGuid + FV =3D CapsuleDispatchFv + } + + FILE RAW =3D 812136D3-4D3A-433A-9418-29BB9BF78F6E { # gEdkiiSystemFmpCap= suleConfigFileGuid + Platform/AMD/OverdriveBoard/SystemFirmwareUpdateConfig/SystemFirmwareU= pdateConfig.ini + } + +[FmpPayload.FmpPayloadSystemFirmwarePkcs7] +IMAGE_HEADER_INIT_VERSION =3D 0x02 +IMAGE_TYPE_ID =3D d34b3d29-0085-4ab3-8be8-84188cc50489 # PcdSy= stemFmpCapsuleImageTypeIdGuid +IMAGE_INDEX =3D 0x1 +HARDWARE_INSTANCE =3D 0x0 +MONOTONIC_COUNT =3D 0x1 +CERTIFICATE_GUID =3D 4AAFD29D-68DF-49EE-8AA9-347D375665A7 # PKCS7 + + FV =3D SystemFirmwareUpdateCargo + +[Capsule.StyxFirmwareUpdateCapsuleFmpPkcs7] +CAPSULE_GUID =3D 6dcbd5ed-e82d-4c44-bda1-7194199ad92a # gEf= iFmpCapsuleGuid +CAPSULE_HEADER_SIZE =3D 0x20 +CAPSULE_HEADER_INIT_VERSION =3D 0x1 + + FMP_PAYLOAD =3D FmpPayloadSystemFirmwarePkcs7 + =20 ##########################################################################= ###### # @@ -413,3 +488,11 @@ READ_LOCK_STATUS =3D TRUE RAW ASL |.aml } =20 +[Rule.Common.PEIM.FMP_IMAGE_DESC] + FILE PEIM =3D $(NAMED_GUID) { + RAW BIN |.acpi + PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex + PE32 PE32 Align=3D4K $(INF_OUTPUT)/$(MODULE_NAME).efi + UI STRING=3D"$(MODULE_NAME)" Optional + VERSION STRING=3D"$(INF_VERSION)" Optional BUILD_NUM=3D$(BUILD_NUMBE= R) + } diff --git a/Platform/AMD/OverdriveBoard/SystemFirmwareDescriptor/SystemFir= mwareDescriptor.aslc b/Platform/AMD/OverdriveBoard/SystemFirmwareDescriptor= /SystemFirmwareDescriptor.aslc new file mode 100644 index 000000000000..8737c02fa006 --- /dev/null +++ b/Platform/AMD/OverdriveBoard/SystemFirmwareDescriptor/SystemFirmwareDe= scriptor.aslc @@ -0,0 +1,80 @@ +/** @file + System Firmware descriptor. + + Copyright (c) 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2017, Linaro, Ltd. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BS= D License + which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. + +**/ + +#include +#include +#include + +#define PACKAGE_VERSION 0xFFFFFFFF +#define PACKAGE_VERSION_STRING L"Unknown" + +#define CURRENT_FIRMWARE_VERSION 0x00000001 +#define CURRENT_FIRMWARE_VERSION_STRING L"0x00000001" +#define LOWEST_SUPPORTED_FIRMWARE_VERSION 0x00000001 + +#define IMAGE_ID SIGNATURE_64('O', 'V', 'R', 'D= ', 'R', 'I', 'V', 'E') +#define IMAGE_ID_STRING L"AMD Seattle Overdrive UEFI" + +// PcdSystemFmpCapsuleImageTypeIdGuid +#define IMAGE_TYPE_ID_GUID { 0xd34b3d29, 0x0085, 0x4ab3, = { 0x8b, 0xe8, 0x84, 0x18, 0x8c, 0xc5, 0x04, 0x89 } } + +typedef struct { + EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTOR Descriptor; + // real string data + CHAR16 ImageIdNameStr[sizeof(IMAGE_ID_S= TRING)/sizeof(CHAR16)]; + CHAR16 VersionNameStr[sizeof(CURRENT_FI= RMWARE_VERSION_STRING)/sizeof(CHAR16)]; + CHAR16 PackageVersionNameStr[sizeof(PAC= KAGE_VERSION_STRING)/sizeof(CHAR16)]; +} IMAGE_DESCRIPTOR; + +STATIC IMAGE_DESCRIPTOR mImageDescriptor =3D +{ + { + EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTOR_SIGNATURE, + sizeof(EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTOR), + sizeof(IMAGE_DESCRIPTOR), + PACKAGE_VERSION, // PackageVersi= on + OFFSET_OF (IMAGE_DESCRIPTOR, PackageVersionNameStr), // PackageVersi= onName + 1, // ImageIndex; + {0x0}, // Reserved + IMAGE_TYPE_ID_GUID, // ImageTypeId; + IMAGE_ID, // ImageId; + OFFSET_OF (IMAGE_DESCRIPTOR, ImageIdNameStr), // ImageIdName; + CURRENT_FIRMWARE_VERSION, // Version; + OFFSET_OF (IMAGE_DESCRIPTOR, VersionNameStr), // VersionName; + {0x0}, // Reserved2 + FixedPcdGet32(PcdFdSize), // Size; + IMAGE_ATTRIBUTE_IMAGE_UPDATABLE | + IMAGE_ATTRIBUTE_RESET_REQUIRED | + IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED | + IMAGE_ATTRIBUTE_IN_USE, // AttributesSu= pported; + IMAGE_ATTRIBUTE_IMAGE_UPDATABLE | + IMAGE_ATTRIBUTE_RESET_REQUIRED | + IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED | + IMAGE_ATTRIBUTE_IN_USE, // AttributesSe= tting; + 0x0, // Compatibilit= ies; + LOWEST_SUPPORTED_FIRMWARE_VERSION, // LowestSuppor= tedImageVersion; + 0x00000000, // LastAttemptV= ersion; + 0, // LastAttemptS= tatus; + {0x0}, // Reserved3 + 0, // HardwareInst= ance; + }, + // real string data + IMAGE_ID_STRING, + CURRENT_FIRMWARE_VERSION_STRING, + PACKAGE_VERSION_STRING, +}; + +VOID* CONST ReferenceAcpiTable =3D &mImageDescriptor; diff --git a/Platform/AMD/OverdriveBoard/SystemFirmwareDescriptor/SystemFir= mwareDescriptor.inf b/Platform/AMD/OverdriveBoard/SystemFirmwareDescriptor/= SystemFirmwareDescriptor.inf new file mode 100644 index 000000000000..9d47d3b2923a --- /dev/null +++ b/Platform/AMD/OverdriveBoard/SystemFirmwareDescriptor/SystemFirmwareDe= scriptor.inf @@ -0,0 +1,46 @@ +## @file +# System Firmware descriptor. +# +# Copyright (c) 2016, Intel Corporation. All rights reserved.
+# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the B= SD 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 IM= PLIED. +# +## + +[Defines] + INF_VERSION =3D 0x0001001A + BASE_NAME =3D SystemFirmwareDescriptor + FILE_GUID =3D 90B2B846-CA6D-4D6E-A8D3-C140A8E110AC + MODULE_TYPE =3D PEIM + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D SystemFirmwareDescriptorPeimEntry + +[Sources] + SystemFirmwareDescriptorPei.c + SystemFirmwareDescriptor.aslc + +[Packages] + ArmPkg/ArmPkg.dec + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + SignedCapsulePkg/SignedCapsulePkg.dec + +[LibraryClasses] + PcdLib + PeiServicesLib + DebugLib + PeimEntryPoint + +[FixedPcd] + gArmTokenSpaceGuid.PcdFdSize + +[Pcd] + gEfiSignedCapsulePkgTokenSpaceGuid.PcdEdkiiSystemFirmwareImageDescriptor + +[Depex] + TRUE diff --git a/Platform/AMD/OverdriveBoard/SystemFirmwareDescriptor/SystemFir= mwareDescriptorPei.c b/Platform/AMD/OverdriveBoard/SystemFirmwareDescriptor= /SystemFirmwareDescriptorPei.c new file mode 100644 index 000000000000..8d40956726ab --- /dev/null +++ b/Platform/AMD/OverdriveBoard/SystemFirmwareDescriptor/SystemFirmwareDe= scriptorPei.c @@ -0,0 +1,68 @@ +/** @file + System Firmware descriptor producer. + + Copyright (c) 2016, Intel Corporation. All rights reserved.
+ This program and the accompanying materials + are licensed and made available under the terms and conditions of the BS= D License + which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. + +**/ + +#include +#include +#include +#include +#include +#include + +/** + Entrypoint for SystemFirmwareDescriptor PEIM. + + @param[in] FileHandle Handle of the file being invoked. + @param[in] PeiServices Describes the list of possible PEI Services. + + @retval EFI_SUCCESS PPI successfully installed. +**/ +EFI_STATUS +EFIAPI +SystemFirmwareDescriptorPeimEntry ( + IN EFI_PEI_FILE_HANDLE FileHandle, + IN CONST EFI_PEI_SERVICES **PeiServices + ) +{ + EFI_STATUS Status; + EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTOR *Descriptor; + UINTN Size; + UINTN Index; + UINT32 AuthenticationStatus; + + // + // Search RAW section. + // + Index =3D 0; + while (TRUE) { + Status =3D PeiServicesFfsFindSectionData3(EFI_SECTION_RAW, Index, File= Handle, + (VOID **)&Descriptor, &AuthenticationStatus); + if (EFI_ERROR(Status)) { + // Should not happen, must something wrong in FDF. + ASSERT(FALSE); + return EFI_NOT_FOUND; + } + if (Descriptor->Signature =3D=3D EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTO= R_SIGNATURE) { + break; + } + Index++; + } + + DEBUG((DEBUG_INFO, "EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTOR size - 0x%x\n= ", + Descriptor->Length)); + + Size =3D Descriptor->Length; + PcdSetPtrS (PcdEdkiiSystemFirmwareImageDescriptor, &Size, Descriptor); + + return EFI_SUCCESS; +} diff --git a/Platform/AMD/OverdriveBoard/SystemFirmwareUpdateConfig/SystemF= irmwareUpdateConfig.ini b/Platform/AMD/OverdriveBoard/SystemFirmwareUpdateC= onfig/SystemFirmwareUpdateConfig.ini new file mode 100644 index 000000000000..c89e95f60fba --- /dev/null +++ b/Platform/AMD/OverdriveBoard/SystemFirmwareUpdateConfig/SystemFirmware= UpdateConfig.ini @@ -0,0 +1,25 @@ +## @file +# +# Copyright (c) 2016, Intel Corporation. All rights reserved.
+# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the B= SD 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 IM= PLIED. +# +## + +[Head] +NumOfUpdate =3D 1 +NumOfRecovery =3D 0 +Update0 =3D StyxFvMain + +[StyxFvMain] +FirmwareType =3D 0 # SystemFirmware +AddressType =3D 0 # 0 - relative address, 1 - absolute addre= ss. +BaseAddress =3D 0x00200000 # Base address offset on flash +Length =3D 0x00260000 # Length +ImageOffset =3D 0x00000000 # Image offset of this SystemFirmware image +FileGuid =3D 642e4fcf-2df7-4415-8b70-a03909c57b55 # PcdEdkiiSystemFi= rmwareFileGuid --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel