Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AA810C433EF for ; Mon, 7 Feb 2022 13:07:47 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D600881112; Mon, 7 Feb 2022 14:07:44 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=unrailed.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; secure) header.d=unrailed.org header.i=@unrailed.org header.b="AgXgisbP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 014C883C6F; Mon, 7 Feb 2022 09:11:19 +0100 (CET) Received: from outbound2.mail.transip.nl (outbound2.mail.transip.nl [IPv6:2a01:7c8:7c8::73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0B31383C69 for ; Mon, 7 Feb 2022 09:11:15 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=unrailed.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rogier@unrailed.org Received: from submission10.mail.transip.nl (unknown [10.103.8.161]) by outbound2.mail.transip.nl (Postfix) with ESMTP id 4Jsf3k3vqgzYdWn; Mon, 7 Feb 2022 09:11:14 +0100 (CET) Received: from [192.168.3.10] (ftth-213-233-205-025.solcon.nl [213.233.205.25]) by submission10.mail.transip.nl (Postfix) with ESMTPA id 4Jsf3Z2f3Lz1gwrp; Mon, 7 Feb 2022 09:11:06 +0100 (CET) To: u-boot@lists.denx.de Cc: =?UTF-8?Q?Pali_Roh=c3=a1r?= , sr@denx.de From: Rogier Stam Subject: [PATCH] U-Boot ENV in EXT4 support for Espressobin Message-ID: <7dc41f20-1058-3c30-cd22-334b05733a7f@unrailed.org> Date: Mon, 7 Feb 2022 09:11:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2B5231803DEC48E28F5B0137" Content-Language: en-US X-Scanned-By: ClueGetter at submission10.mail.transip.nl DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=transip-a; d=unrailed.org; t=1644221466; h=from:subject:to:cc:date: mime-version:content-type; bh=nEFehUmZl3sGt3D5muoJW4hnyXct/EbaGtzZHACgcS4=; b=AgXgisbPtP++iU/77UTp9DFopuDfB+0T7BhjXSRsIalefeqxfZQELyqo4hyukJRoHcSkya tA69ff7O6gnszh/sRB9wO4xDYejrX30OURHRpopgwWlezFidJZ5o590eR4XWW6cx8HgY/+ C3RDLbxsS9K0oL8zlt+twN0Pd6f4iuaX7IDENLnXco+tMfd3zUyXCkdHy7YUM9GGzKkwq2 ZcCrMjxHzB1hRmVo2C3ciO7/x4SdtTFm9pgLgt/ZBqXATuOuXbjabNCwVOPGVDPkzYN/kX 71qJk/ibIz/mKRVb6EqhgtApg4QC0yGAMqhs+H2Xe/Lgzb4VfRBLv1A4nttD+Q== X-Report-Abuse-To: abuse@transip.nl X-Mailman-Approved-At: Mon, 07 Feb 2022 14:07:43 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean This is a multi-part message in MIME format. --------------2B5231803DEC48E28F5B0137 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi I was attemting to boot from SATA on an Espressobin. As such I wanted to store the Environment in a SATA partition and not in the SPI flash. In order to get this running I had to make a few changes, as the original code assumes the Environment is always in SPI flash. Additionally I also had to force scsci_scan to ensure the AHCI disk / partitions could be found. Hope it will be considered to merge Regards Rogier Stam --------------2B5231803DEC48E28F5B0137 Content-Type: text/x-patch; charset=UTF-8; name="0001-Fix-Espressobin-build-for-configs-where-ENV-is-not-i.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-Fix-Espressobin-build-for-configs-where-ENV-is-not-i.pa"; filename*1="tch" From 460eb1fc6d5189750d2ce791e45c89792c476167 Mon Sep 17 00:00:00 2001 From: Rogier Stam Date: Mon, 31 Jan 2022 23:06:19 +0100 Subject: [PATCH] Fix Espressobin build for configs where ENV is not in SPI When storing the UBoot Environment in for example EXT4, the U-Boot build is broken for several reasons: 1. armada-385-turris-omnia-u-boot.dtsi will not allow CONFIG_ENV_OFFSET and CONFIG_ENV_SIZE to be undefined 2. armada-37xx/board.c ft_board_setup function does not exist if CONFIG_ENV_IS_IN_SPI_FLASH is not defined 3. When defining CONFIG_ENV_IS_IN_EXT4 and using AHCI SCSI scan is not performed and hence the partition on AHCI is not available when the environment is loaded. This change fixes these 3 points so that the UBoot config can be on a AHCI (SATA) drive partition instead of enforced in SPI flash. Signed-off-by: Rogier Stam --- arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi | 2 ++ board/Marvell/mvebu_armada-37xx/board.c | 4 ++-- env/ext4.c | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi b/arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi index 3ff76c9..7921298 100644 --- a/arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi +++ b/arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi @@ -41,6 +41,7 @@ &spi0 { u-boot,dm-pre-reloc; +#ifdef CONFIG_ENV_IS_IN_SPI_FLASH spi-nor@0 { u-boot,dm-pre-reloc; @@ -55,6 +56,7 @@ }; }; }; +#endif }; &uart0 { diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c index d7b6eca..33b772a 100644 --- a/board/Marvell/mvebu_armada-37xx/board.c +++ b/board/Marvell/mvebu_armada-37xx/board.c @@ -328,7 +328,6 @@ int board_network_enable(struct mii_dev *bus) return 0; } -#if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_ENV_IS_IN_SPI_FLASH) int ft_board_setup(void *blob, struct bd_info *bd) { int ret; @@ -340,6 +339,7 @@ int ft_board_setup(void *blob, struct bd_info *bd) if (!of_machine_is_compatible("globalscale,espressobin")) return 0; +#if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_ENV_IS_IN_SPI_FLASH) spi_off = fdt_node_offset_by_compatible(blob, -1, "jedec,spi-nor"); if (spi_off < 0) return 0; @@ -424,6 +424,6 @@ int ft_board_setup(void *blob, struct bd_info *bd) return 0; } +#endif return 0; } -#endif diff --git a/env/ext4.c b/env/ext4.c index 9f65afb..88214b9 100644 --- a/env/ext4.c +++ b/env/ext4.c @@ -146,6 +146,10 @@ static int env_ext4_load(void) if (!strcmp(ifname, "mmc")) mmc_initialize(NULL); #endif +#ifdef CONFIG_AHCI + if (!strcmp(ifname, "scsi")) + scsi_scan(true); +#endif part = blk_get_device_part_str(ifname, dev_and_part, &dev_desc, &info, 1); -- 2.7.4 --------------2B5231803DEC48E28F5B0137--