From patchwork Wed Nov 15 10:11:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 118928 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4118403qgn; Wed, 15 Nov 2017 02:13:19 -0800 (PST) X-Google-Smtp-Source: AGs4zMZxD52b+LliCC2iWCye8YP1EavFJ/JkPsZVgESYkwCP7Bj9+dD5DQDtUI7/t7WmucMN+/aW X-Received: by 10.80.241.218 with SMTP id y26mr13792676edl.120.1510740799536; Wed, 15 Nov 2017 02:13:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510740799; cv=none; d=google.com; s=arc-20160816; b=zXOYPiFrCBQcLVe4dVvAmyT6FLJTkAhd2yrhcuSW8YRHUds6jMAFEqLQk9AahZZmQJ wkDEKRgqTdpS44Nf1uEBUoXtLFLSeZo5kVEDdzRG2WatT8NhpqvLrVpbpOhmpoL5AeaO sa5lzqXgXUR/cWzYktF9YvoiUszTHNEPCcPXzqqNpgxudYZMh/T2Eu9dxqNJHNvIeh11 1vvUtxyYHWYNFkCsRXTAj/QOr//aBmLfZVnhOdrgqfIpPH6gsMu4u2HlcM8ezXtdVRAW 2KkoOnwEYlhxAMpiD0TNtERN6M6uyO0iHAFXRXXKSEjmm64zchvzGKvTwnowfdBlYYcZ sVAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:arc-authentication-results; bh=3LzM5uEDJqbaMokd5Eqh8XofOkaJKH7bj8951KJHWuI=; b=jZ5VJoleJqlng0s0PplxfrdVIz2d/KKxNgtiPC2AehvduRkinuGHkzDpwfsgUkFlTK vep0kvkOHNDP6Y5bwP2Wg2M9PvV8gvozaNU39r/TIINO8kGSRepxPc6mOKICnelcO4i1 FXVEd9Bo/lBiJqJ+jiZBRfHQ5Ly7CNaX4WEoacffQSJSbo4EG7yD2SA/FfgrFp6Q+DS/ Tda+1ROiGsaQTnJ8RajaY6JBTVdxuRKE/3tIUOzsIzLSX0So91foaiGJWlc6z3yunnuF W25N94GmwGs7z3Yq17xRF+ODTXEap6yjTilWLZi0fOc3H3gFCDNZSV3JynoEZ/zJI9Jk sHHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id g24si15649857edj.173.2017.11.15.02.13.19; Wed, 15 Nov 2017 02:13:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 06D94C21C73; Wed, 15 Nov 2017 10:12:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 8089DC21D90; Wed, 15 Nov 2017 10:12:28 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 42445C21D88; Wed, 15 Nov 2017 10:12:19 +0000 (UTC) Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by lists.denx.de (Postfix) with ESMTP id 0A23FC21DA2 for ; Wed, 15 Nov 2017 10:12:15 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id F0E932037F; Wed, 15 Nov 2017 11:12:13 +0100 (CET) Received: from localhost (unknown [185.94.189.188]) by mail.free-electrons.com (Postfix) with ESMTPSA id 46E9220946; Wed, 15 Nov 2017 11:11:54 +0100 (CET) From: Maxime Ripard To: Tom Rini Date: Wed, 15 Nov 2017 11:11:48 +0100 Message-Id: <20171115101151.11382-2-maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171115101151.11382-1-maxime.ripard@free-electrons.com> References: <20171115101151.11382-1-maxime.ripard@free-electrons.com> Cc: Andre Przywara , agraf@suse.de, u-boot@lists.denx.de, Maxime Ripard , Jagan Teki Subject: [U-Boot] [PATCH 1/4] part: efi: Add a Kconfig option for the number of partition entries X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" On some SoCs, the SPL needs to be located right in the middle of the GPT partition entries. One way to work around that is to create partition entries for a smaller number of partitions to accomodate with where the SPL will be. Create a Kconfig option to allow to do that. Signed-off-by: Maxime Ripard --- disk/Kconfig | 13 +++++++++++++ include/part_efi.h | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/disk/Kconfig b/disk/Kconfig index 939656212065..f82beef6e689 100644 --- a/disk/Kconfig +++ b/disk/Kconfig @@ -78,6 +78,19 @@ config EFI_PARTITION common when EFI is the bootloader. Note 2TB partition limit; see disk/part_efi.c +config EFI_PARTITION_ENTRIES_NUMBERS + int "Number of the EFI partition entries" + depends on EFI_PARTITION + default 128 + help + Specify the number of partition entries in the GPT. This is + meant to allow less than the standard specifies for devices + that might need to place their first-stage bootloader in the + middle of a regular GPT. + + If unsure, leave at 128 entries, which is the standard + number. + config EFI_PARTITION_ENTRIES_OFF int "Offset (in bytes) of the EFI partition entries" depends on EFI_PARTITION diff --git a/include/part_efi.h b/include/part_efi.h index 31e6bc6e140f..4c8f6cc473c8 100644 --- a/include/part_efi.h +++ b/include/part_efi.h @@ -27,7 +27,7 @@ #define GPT_HEADER_SIGNATURE 0x5452415020494645ULL #define GPT_HEADER_REVISION_V1 0x00010000 #define GPT_PRIMARY_PARTITION_TABLE_LBA 1ULL -#define GPT_ENTRY_NUMBERS 128 +#define GPT_ENTRY_NUMBERS CONFIG_EFI_PARTITION_ENTRIES_NUMBERS #define GPT_ENTRY_SIZE 128 #define PARTITION_SYSTEM_GUID \