From patchwork Wed Mar 29 13:48:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 96191 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp2208495qgd; Wed, 29 Mar 2017 06:48:50 -0700 (PDT) X-Received: by 10.99.42.78 with SMTP id q75mr643541pgq.144.1490795330135; Wed, 29 Mar 2017 06:48:50 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id j10si7523651plg.189.2017.03.29.06.48.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Mar 2017 06:48:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 796012041D9EC; Wed, 29 Mar 2017 06:48:48 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wr0-x235.google.com (mail-wr0-x235.google.com [IPv6:2a00:1450:400c:c0c::235]) (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 C26202041D9DF for ; Wed, 29 Mar 2017 06:48:46 -0700 (PDT) Received: by mail-wr0-x235.google.com with SMTP id k6so9917586wre.2 for ; Wed, 29 Mar 2017 06:48:46 -0700 (PDT) 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=4s311jhtym8bb98tuC45BLRAA+m4z4gh2crPlv28eEM=; b=VPnxZVtt/T5s49XZrUKn5bB0x+0FRh7zPxHlvz2/koNXrFCv7qKQnmWt+yl66+zs6n 3rkAdN77j3O5LdJVnEJRZaqKD3KMBgGJjZpFuiHlNX4fDgG0stvbL9zIjPEWlhWL9ax5 fli483Gp6oZDT4ttaHhJa1u2909JCjHU+3ufk= 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=4s311jhtym8bb98tuC45BLRAA+m4z4gh2crPlv28eEM=; b=CWjoqhpRpPX40Qrf+1VIDPMq5aZ7teYwj2LpCUtoVvJFlige9Jxfz26WYRHbMY2zlQ 9PLB0gSTyYFEfNhVzkTYaRZg8Bc064ZI6eTz3UyI7P/Ed4CT2PJ3GbZf//GUk6IUsaXM Nk7KTMKE8x+iHLAZ6ZXvZxJ1ofnl8D6+xA2JIksXhPk6E3AAekXReBIGOhfHr8aPt6Tk QR0jutgomMEI+NmUPBCqwRkRs+wmbxUlGwPXtD5XYXdQXYf+qiJAC6o75M0liZMVnDDp 0qDud06vDB/3IAmHwP3Wxwy2F+2OwOOJXz6JSIJ93dCHxOTmb3FoPLtA1w6v7Zbjmzu5 688g== X-Gm-Message-State: AFeK/H21AktTpUxgZ4v4wjmZV2MBgNotlanQrKA+FLJu6Xumzlh15yOrrQbLJA+tsSivdDm4 X-Received: by 10.223.136.125 with SMTP id e58mr659293wre.14.1490795325380; Wed, 29 Mar 2017 06:48:45 -0700 (PDT) Received: from localhost.localdomain ([196.81.160.3]) by smtp.gmail.com with ESMTPSA id h65sm9479406wrh.32.2017.03.29.06.48.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Mar 2017 06:48:44 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org Date: Wed, 29 Mar 2017 14:48:28 +0100 Message-Id: <20170329134833.12956-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170329134833.12956-1-ard.biesheuvel@linaro.org> References: <20170329134833.12956-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 1/6] EmbeddedPkg/DtPlatformDxe: allow multiple entries in DTB FV file 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: ryan.harkin@linaro.org, lersek@redhat.com, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" To allow some dynamic behavior in selecting the DTB to expose to the OS, allow the DTB FV file to contain multiple sections, and indirect the choice of section via a fixed/dynamic PCD, which defaults to 0. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c | 5 ++++- EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf | 4 ++++ EmbeddedPkg/EmbeddedPkg.dec | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) -- 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c b/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c index 5778633b4985..72f9f5721cda 100644 --- a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c +++ b/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -121,7 +122,9 @@ DtPlatformDxeEntryPoint ( // Dtb = NULL; Status = GetSectionFromAnyFv (&gDtPlatformDefaultDtbFileGuid, - EFI_SECTION_RAW, 0, &Dtb, &DtbSize); + EFI_SECTION_RAW, + PcdGet8 (PcdDtPlatformDefaultDtbSectionIndex), + &Dtb, &DtbSize); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_WARN, "%a: no DTB blob found, defaulting to ACPI\n", __FUNCTION__)); diff --git a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf b/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf index b73877a6086b..c16202790ed9 100644 --- a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf +++ b/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf @@ -43,6 +43,7 @@ [LibraryClasses] DxeServicesLib HiiLib MemoryAllocationLib + PcdLib UefiBootServicesTableLib UefiDriverEntryPoint UefiRuntimeServicesTableLib @@ -56,3 +57,6 @@ [Guids] [Depex] gEfiVariableArchProtocolGuid AND gEfiVariableWriteArchProtocolGuid + +[Pcd] + gEmbeddedTokenSpaceGuid.PcdDtPlatformDefaultDtbSectionIndex diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec index 871fc5ff4016..f1b7af347861 100644 --- a/EmbeddedPkg/EmbeddedPkg.dec +++ b/EmbeddedPkg/EmbeddedPkg.dec @@ -198,3 +198,6 @@ [PcdsFixedAtBuild.X64] [PcdsFixedAtBuild.common, PcdsDynamic.common] gEmbeddedTokenSpaceGuid.PcdFdtDevicePaths|L""|VOID*|0x00000055 + + # the section containing the default DTB for the current platform + gEmbeddedTokenSpaceGuid.PcdDtPlatformDefaultDtbSectionIndex|0|UINT8|0x00000057