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: 838132 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3ycKwh5cLVz9s74 for ; Wed, 15 Nov 2017 21:14:12 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 78444C21DA0; Wed, 15 Nov 2017 10:12:30 +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 \ From patchwork Wed Nov 15 10:11:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 838131 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3ycKwM5tdpz9s74 for ; Wed, 15 Nov 2017 21:13:55 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 5347EC21D80; Wed, 15 Nov 2017 10:12:48 +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 7795CC21D88; Wed, 15 Nov 2017 10:12:37 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BCFD2C21D80; Wed, 15 Nov 2017 10:12:20 +0000 (UTC) Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by lists.denx.de (Postfix) with ESMTP id 45262C21D93 for ; Wed, 15 Nov 2017 10:12:16 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 376BC20810; Wed, 15 Nov 2017 11:12:15 +0100 (CET) Received: from localhost (unknown [185.94.189.188]) by mail.free-electrons.com (Postfix) with ESMTPSA id A789A212A2; Wed, 15 Nov 2017 11:11:55 +0100 (CET) From: Maxime Ripard To: Tom Rini Date: Wed, 15 Nov 2017 11:11:49 +0100 Message-Id: <20171115101151.11382-3-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 2/4] part: efi: Add default number of partition entries for sunxi 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" The SPL must be located at 8kB (16 sectors) offset. That's right in the middle of the GPT, so we need to define a smaller amount of partitions to accomodate for that location. Signed-off-by: Maxime Ripard --- disk/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/disk/Kconfig b/disk/Kconfig index f82beef6e689..0446bb63ca7e 100644 --- a/disk/Kconfig +++ b/disk/Kconfig @@ -81,6 +81,7 @@ config EFI_PARTITION config EFI_PARTITION_ENTRIES_NUMBERS int "Number of the EFI partition entries" depends on EFI_PARTITION + default 56 if ARCH_SUNXI default 128 help Specify the number of partition entries in the GPT. This is From patchwork Wed Nov 15 10:11:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 838133 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3ycKxH2dcHz9s0g for ; Wed, 15 Nov 2017 21:14:43 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 0796CC21C29; Wed, 15 Nov 2017 10:13:22 +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 5B3F2C21DA5; Wed, 15 Nov 2017 10:12:47 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 64297C21DB9; Wed, 15 Nov 2017 10:12:20 +0000 (UTC) Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by lists.denx.de (Postfix) with ESMTP id 3F80FC21D80 for ; Wed, 15 Nov 2017 10:12:16 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 3347B2037B; Wed, 15 Nov 2017 11:12:15 +0100 (CET) Received: from localhost (unknown [185.94.189.188]) by mail.free-electrons.com (Postfix) with ESMTPSA id 16C7D20DD4; Wed, 15 Nov 2017 11:11:55 +0100 (CET) From: Maxime Ripard To: Tom Rini Date: Wed, 15 Nov 2017 11:11:50 +0100 Message-Id: <20171115101151.11382-4-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 3/4] sunxi: Add default partition scheme 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" The partitions variable is especially useful to create a partition table from U-Boot, either directly from the U-Boot shell, or through flashing tools like fastboot and its oem format command. This is especially useful on devices with an eMMC you can't take out to flash from another system, and booting a Linux system first to flash our system then is not really practical. Signed-off-by: Maxime Ripard --- include/configs/sunxi-common.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h index 4391a8cbc824..11da6ccfbf54 100644 --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h @@ -493,6 +493,12 @@ extern int soft_i2c_gpio_scl; #define SUNXI_MTDPARTS_DEFAULT #endif +#define PARTS_DEFAULT \ + "name=loader1,start=8k,size=32k;" \ + "name=loader2,size=984k;" \ + "name=boot,size=128M,bootable;" \ + "name=system,size=-;" + #define CONSOLE_ENV_SETTINGS \ CONSOLE_STDIN_SETTINGS \ CONSOLE_STDOUT_SETTINGS @@ -511,6 +517,7 @@ extern int soft_i2c_gpio_scl; "console=ttyS0,115200\0" \ SUNXI_MTDIDS_DEFAULT \ SUNXI_MTDPARTS_DEFAULT \ + "partitions=" PARTS_DEFAULT "\0" \ BOOTCMD_SUNXI_COMPAT \ BOOTENV From patchwork Wed Nov 15 10:11:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 838134 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3ycKxt3R3Pz9s0g for ; Wed, 15 Nov 2017 21:15:14 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 2EC86C21DB1; Wed, 15 Nov 2017 10:13:04 +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 21CC0C21DC5; Wed, 15 Nov 2017 10:12:42 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B24E7C21DA6; Wed, 15 Nov 2017 10:12:21 +0000 (UTC) Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by lists.denx.de (Postfix) with ESMTP id 21DB0C21DA5 for ; Wed, 15 Nov 2017 10:12:17 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 0DAB72083D; Wed, 15 Nov 2017 11:12:16 +0100 (CET) Received: from localhost (unknown [185.94.189.188]) by mail.free-electrons.com (Postfix) with ESMTPSA id 6FE1D213DA; Wed, 15 Nov 2017 11:11:56 +0100 (CET) From: Maxime Ripard To: Tom Rini Date: Wed, 15 Nov 2017 11:11:51 +0100 Message-Id: <20171115101151.11382-5-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 4/4] fastboot: Enable flashing by default on sunxi 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" Now that more and more devices are built using eMMC, providing a way to easily flash the system without too much hassle seems like a right thing to do. Since fastboot is the most deployed tool to do that these days, we can just rely on it to provide a way to flash the various components in the system (SPL, U-Boot and the system itself) easily, especially since you can upload the U-Boot hosting the fastboot "server" through FEL. Signed-off-by: Maxime Ripard --- cmd/fastboot/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/fastboot/Kconfig b/cmd/fastboot/Kconfig index 4ce7a775e28e..cbb9183ea266 100644 --- a/cmd/fastboot/Kconfig +++ b/cmd/fastboot/Kconfig @@ -66,6 +66,7 @@ config FASTBOOT_USB_DEV config FASTBOOT_FLASH bool "Enable FASTBOOT FLASH command" + default y if ARCH_SUNXI help The fastboot protocol includes a "flash" command for writing the downloaded image to a non-volatile storage device. Define