From patchwork Fri May 10 16:11:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrice CHOTARD X-Patchwork-Id: 1098159 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=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="a0+WZiwh"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 450wGR5mPFz9sB8 for ; Sat, 11 May 2019 02:12:31 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 6C18EC21E13; Fri, 10 May 2019 16:11:57 +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=T_DKIM_INVALID 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 64FD4C21CB6; Fri, 10 May 2019 16:11:40 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id CDBCEC21C27; Fri, 10 May 2019 16:11:37 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) by lists.denx.de (Postfix) with ESMTPS id 69A83C21C27 for ; Fri, 10 May 2019 16:11:37 +0000 (UTC) Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4AG6CiK014689; Fri, 10 May 2019 18:11:35 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=+fCeoJM8YM8xNMTIZXjGsXsuVw3NiDjHY25F1+t5dbo=; b=a0+WZiwhhauIiBa2s74ufmOhZfnOZqaRO79QUxjLLYz+sSZllgL6EnVRI5orPBNxw0Z6 uOtmheQtDZ0QC0amdIFAd6rcn5qe9ipqImug3D69PFYGoX3DeRN/g3XDEdyadgrvGiGO M7K5Xtlj5eCuBXBMrHCgOSKkPHbw6Hxd25heHeAOI4OiJ8b7n2uEunRkBxjXptiHOCXW D928JXc5Bmw2jbDmqpJwy6ngwci5Cra5N3z4dwjWPpdaaIyI7HCOAepFsgsSyyxUMR0+ kmF8AYOweFuAX+kKOO5F8Dra7/Vud2NfU93/DsVTRAry6c6B/L68C+LpMUvh/TX18dch Hg== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2scbkajk2j-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 10 May 2019 18:11:35 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id B6FDA34; Fri, 10 May 2019 16:11:34 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag6node3.st.com [10.75.127.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 9939C2C20; Fri, 10 May 2019 16:11:34 +0000 (GMT) Received: from localhost (10.75.127.48) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 10 May 2019 18:11:34 +0200 From: Patrice Chotard To: Date: Fri, 10 May 2019 18:11:18 +0200 Message-ID: <1557504691-26188-2-git-send-email-patrice.chotard@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> References: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.48] X-ClientProxiedBy: SFHDAG8NODE3.st.com (10.75.127.24) To SFHDAG6NODE3.st.com (10.75.127.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-09_02:, , signatures=0 Cc: Tom Rini , Baruch Siach , U-Boot STM32 , Chris Packham , Marek Vasut Subject: [U-Boot] [PATCH 01/14] Prepare v2019.07-rc1 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Tom Rini Signed-off-by: Tom Rini Signed-off-by: Patrice Chotard --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f2c7bb6..d6a6ef1 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ # SPDX-License-Identifier: GPL-2.0+ VERSION = 2019 -PATCHLEVEL = 04 +PATCHLEVEL = 07 SUBLEVEL = -EXTRAVERSION = +EXTRAVERSION = -rc1 NAME = # *DOCUMENTATION* From patchwork Fri May 10 16:11:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrice CHOTARD X-Patchwork-Id: 1098176 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=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="x/TD+Kd3"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 450wPJ0mrVz9sB8 for ; Sat, 11 May 2019 02:18:28 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id B6B09C21DFA; Fri, 10 May 2019 16:12:54 +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=T_DKIM_INVALID 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 740E3C21E1A; Fri, 10 May 2019 16:11:53 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 69DB0C21C4A; Fri, 10 May 2019 16:11:45 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lists.denx.de (Postfix) with ESMTPS id 9FF2EC21DB5 for ; Fri, 10 May 2019 16:11:41 +0000 (UTC) Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4AG6Tlt025459; Fri, 10 May 2019 18:11:36 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=oH8jFyx+shAdiAns0lrX2Ofn/vByXtuG6ZQzM1GICu8=; b=x/TD+Kd36OYpEdKIJPjYkM9bPhV8pQhX5pBKWabg7mlLr42Wvw4p343iug986uWCumug /ENLFkzPdKaByMqaB+yuz8ZgmhFH/AWEFEFeeNMPbOK4IPAl7fDb+d6UXCtyGY1P2b9a AXEo2AwN5qt0HbnryjntJeXNoDjJEW4rKJcURxoIU5oO1+GYHgfwQg2UCXi5pzgTTPFj Zc0hAhlrjnIxTI37PHpsx10y6rEXTi5et0WVZ47z0gWlJ402Sfq+Og/IN2vkFtzuIhNB wtNUMKEZxe3AC86BdA6Zhvn5Nixwfg/dx7AxtbtKq9tadYt8ecrWtOd9/mHjfeuolNiv hA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2sc9s4kekg-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 10 May 2019 18:11:36 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D626038; Fri, 10 May 2019 16:11:35 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag6node3.st.com [10.75.127.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id B44F02C1E; Fri, 10 May 2019 16:11:35 +0000 (GMT) Received: from localhost (10.75.127.51) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 10 May 2019 18:11:35 +0200 From: Patrice Chotard To: Date: Fri, 10 May 2019 18:11:19 +0200 Message-ID: <1557504691-26188-3-git-send-email-patrice.chotard@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> References: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.51] X-ClientProxiedBy: SFHDAG3NODE2.st.com (10.75.127.8) To SFHDAG6NODE3.st.com (10.75.127.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-09_02:, , signatures=0 Cc: U-Boot STM32 Subject: [U-Boot] [PATCH 02/14] stm32mp1: activate NAND and NOR support on EV1 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Patrick Delaunay Add the necessary configuration to have NAND and NOR support on ev1 board for BASIC boot (with SPL) or for TRUSTED boot (with TF-A). STM32MP> nand info Device 0: nand0, sector size 256 KiB Page size 4096 b OOB size 224 b Erase size 262144 b subpagesize 4096 b options 0x00184200 bbt options 0x00060000 STM32MP> sf probe SF: Detected mx66l51235l with page size 256 Bytes, erase size 64 KiB, total 64 MiB Signed-off-by: Patrick Delaunay Signed-off-by: Patrice Chotard --- arch/arm/dts/stm32mp157-pinctrl.dtsi | 44 ++++++++++++++++++++++++++++++++++++ arch/arm/dts/stm32mp157c-ev1.dts | 16 +++++++++++++ arch/arm/dts/stm32mp157c.dtsi | 15 ++++++++++++ configs/stm32mp15_basic_defconfig | 17 ++++++++++++++ configs/stm32mp15_trusted_defconfig | 17 ++++++++++++++ include/configs/stm32mp1.h | 3 +++ 6 files changed, 112 insertions(+) diff --git a/arch/arm/dts/stm32mp157-pinctrl.dtsi b/arch/arm/dts/stm32mp157-pinctrl.dtsi index 0aae69b..9d1d386 100644 --- a/arch/arm/dts/stm32mp157-pinctrl.dtsi +++ b/arch/arm/dts/stm32mp157-pinctrl.dtsi @@ -210,6 +210,50 @@ }; }; + fmc_pins_a: fmc-0 { + pins1 { + pinmux = , /* FMC_NOE */ + , /* FMC_NWE */ + , /* FMC_A16_FMC_CLE */ + , /* FMC_A17_FMC_ALE */ + , /* FMC_D0 */ + , /* FMC_D1 */ + , /* FMC_D2 */ + , /* FMC_D3 */ + , /* FMC_D4 */ + , /* FMC_D5 */ + , /* FMC_D6 */ + , /* FMC_D7 */ + ; /* FMC_NE2_FMC_NCE */ + bias-disable; + drive-push-pull; + slew-rate = <1>; + }; + pins2 { + pinmux = ; /* FMC_NWAIT */ + bias-pull-up; + }; + }; + + fmc_sleep_pins_a: fmc-sleep-0 { + pins { + pinmux = , /* FMC_NOE */ + , /* FMC_NWE */ + , /* FMC_A16_FMC_CLE */ + , /* FMC_A17_FMC_ALE */ + , /* FMC_D0 */ + , /* FMC_D1 */ + , /* FMC_D2 */ + , /* FMC_D3 */ + , /* FMC_D4 */ + , /* FMC_D5 */ + , /* FMC_D6 */ + , /* FMC_D7 */ + , /* FMC_NWAIT */ + ; /* FMC_NE2_FMC_NCE */ + }; + }; + i2c1_pins_a: i2c1-0 { pins { pinmux = , /* I2C1_SCL */ diff --git a/arch/arm/dts/stm32mp157c-ev1.dts b/arch/arm/dts/stm32mp157c-ev1.dts index a6ee379..69980ca 100644 --- a/arch/arm/dts/stm32mp157c-ev1.dts +++ b/arch/arm/dts/stm32mp157c-ev1.dts @@ -92,6 +92,22 @@ }; }; +&fmc { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&fmc_pins_a>; + pinctrl-1 = <&fmc_sleep_pins_a>; + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + + nand: nand@0 { + reg = <0>; + nand-on-flash-bbt; + #address-cells = <1>; + #size-cells = <1>; + }; +}; + &i2c2 { pinctrl-names = "default"; pinctrl-0 = <&i2c2_pins_a>; diff --git a/arch/arm/dts/stm32mp157c.dtsi b/arch/arm/dts/stm32mp157c.dtsi index 9463433..dd0f4e8 100644 --- a/arch/arm/dts/stm32mp157c.dtsi +++ b/arch/arm/dts/stm32mp157c.dtsi @@ -1033,6 +1033,21 @@ dma-requests = <48>; }; + fmc: nand-controller@58002000 { + compatible = "st,stm32mp15-fmc2"; + reg = <0x58002000 0x1000>, + <0x80000000 0x1000>, + <0x88010000 0x1000>, + <0x88020000 0x1000>, + <0x81000000 0x1000>, + <0x89010000 0x1000>, + <0x89020000 0x1000>; + interrupts = ; + clocks = <&rcc FMC_K>; + resets = <&rcc FMC_R>; + stafmctus = "disabled"; + }; + qspi: spi@58003000 { compatible = "st,stm32f469-qspi"; reg = <0x58003000 0x1000>, <0x70000000 0x10000000>; diff --git a/configs/stm32mp15_basic_defconfig b/configs/stm32mp15_basic_defconfig index bd75df8..f5e13dd 100644 --- a/configs/stm32mp15_basic_defconfig +++ b/configs/stm32mp15_basic_defconfig @@ -29,6 +29,7 @@ CONFIG_CMD_GPIO=y CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y +CONFIG_CMD_SF=y CONFIG_CMD_USB=y CONFIG_CMD_USB_MASS_STORAGE=y CONFIG_CMD_CACHE=y @@ -37,6 +38,7 @@ CONFIG_CMD_TIMER=y CONFIG_CMD_PMIC=y CONFIG_CMD_REGULATOR=y CONFIG_CMD_EXT4_WRITE=y +CONFIG_CMD_MTDPARTS=y # CONFIG_SPL_DOS_PARTITION is not set CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1" CONFIG_STM32_ADC=y @@ -54,6 +56,18 @@ CONFIG_LED=y CONFIG_LED_GPIO=y CONFIG_DM_MMC=y CONFIG_STM32_SDMMC2=y +CONFIG_MTD=y +CONFIG_NAND=y +CONFIG_NAND_STM32_FMC2=y +CONFIG_DM_SPI_FLASH=y +CONFIG_SPI_FLASH=y +CONFIG_SPI_FLASH_BAR=y +CONFIG_SPI_FLASH_MACRONIX=y +CONFIG_SPI_FLASH_SPANSION=y +CONFIG_SPI_FLASH_STMICRO=y +CONFIG_SPI_FLASH_WINBOND=y +# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set +CONFIG_SPI_FLASH_MTD=y CONFIG_PHY=y CONFIG_PHY_STM32_USBPHYC=y CONFIG_PINCONF=y @@ -68,6 +82,9 @@ CONFIG_DM_REGULATOR_STM32_VREFBUF=y CONFIG_DM_REGULATOR_STPMIC1=y CONFIG_SERIAL_RX_BUFFER=y CONFIG_STM32_SERIAL=y +CONFIG_SPI=y +CONFIG_DM_SPI=y +CONFIG_STM32_QSPI=y CONFIG_USB=y CONFIG_DM_USB=y CONFIG_DM_USB_GADGET=y diff --git a/configs/stm32mp15_trusted_defconfig b/configs/stm32mp15_trusted_defconfig index f82b770..cae3324 100644 --- a/configs/stm32mp15_trusted_defconfig +++ b/configs/stm32mp15_trusted_defconfig @@ -22,6 +22,7 @@ CONFIG_CMD_GPIO=y CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y +CONFIG_CMD_SF=y CONFIG_CMD_USB=y CONFIG_CMD_USB_MASS_STORAGE=y CONFIG_CMD_CACHE=y @@ -30,6 +31,7 @@ CONFIG_CMD_TIMER=y CONFIG_CMD_PMIC=y CONFIG_CMD_REGULATOR=y CONFIG_CMD_EXT4_WRITE=y +CONFIG_CMD_MTDPARTS=y CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1" CONFIG_STM32_ADC=y CONFIG_USB_FUNCTION_FASTBOOT=y @@ -46,6 +48,18 @@ CONFIG_LED=y CONFIG_LED_GPIO=y CONFIG_DM_MMC=y CONFIG_STM32_SDMMC2=y +CONFIG_MTD=y +CONFIG_NAND=y +CONFIG_NAND_STM32_FMC2=y +CONFIG_DM_SPI_FLASH=y +CONFIG_SPI_FLASH=y +CONFIG_SPI_FLASH_BAR=y +CONFIG_SPI_FLASH_MACRONIX=y +CONFIG_SPI_FLASH_SPANSION=y +CONFIG_SPI_FLASH_STMICRO=y +CONFIG_SPI_FLASH_WINBOND=y +# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set +CONFIG_SPI_FLASH_MTD=y CONFIG_PHY=y CONFIG_PHY_STM32_USBPHYC=y CONFIG_PINCONF=y @@ -58,6 +72,9 @@ CONFIG_DM_REGULATOR_STM32_VREFBUF=y CONFIG_DM_REGULATOR_STPMIC1=y CONFIG_SERIAL_RX_BUFFER=y CONFIG_STM32_SERIAL=y +CONFIG_SPI=y +CONFIG_DM_SPI=y +CONFIG_STM32_QSPI=y CONFIG_USB=y CONFIG_DM_USB=y CONFIG_DM_USB_GADGET=y diff --git a/include/configs/stm32mp1.h b/include/configs/stm32mp1.h index 3069373..a28b8b3 100644 --- a/include/configs/stm32mp1.h +++ b/include/configs/stm32mp1.h @@ -85,6 +85,9 @@ #if !defined(CONFIG_SPL_BUILD) +/* NAND support */ +#define CONFIG_SYS_NAND_ONFI_DETECTION +#define CONFIG_SYS_MAX_NAND_DEVICE 1 #define BOOT_TARGET_DEVICES(func) \ func(MMC, mmc, 1) \ func(MMC, mmc, 0) \ From patchwork Fri May 10 16:11:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrice CHOTARD X-Patchwork-Id: 1098158 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=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="lvx0JJxi"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 450wFc4rr1z9sB8 for ; Sat, 11 May 2019 02:11:48 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id EF7F4C21C29; Fri, 10 May 2019 16:11:42 +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=T_DKIM_INVALID 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 E738AC21C29; Fri, 10 May 2019 16:11:39 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BE3B4C21C2C; Fri, 10 May 2019 16:11:37 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) by lists.denx.de (Postfix) with ESMTPS id 754E5C21C29 for ; Fri, 10 May 2019 16:11:37 +0000 (UTC) Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4AG6CgX014692; Fri, 10 May 2019 18:11:37 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=AvlDMcc40x8Z7XIxo4OC8Nfz6sJVs5MtX9jX8VEP4Lc=; b=lvx0JJxiDKtQpG7gug4qrbTT3kbvrZfAiw6boWYNc0W33k9I6UbErXOIwC/28bF4Buci x7rNthe10ieOvGa3eEhz6vXw591bfhGSjLLh2MD7W+WsHfJ49jXOpZwYvd6txuD3WZCb kVyugom4LiZDGHZSjmWWL6CvHJ8u8QGCdvEDBBjkAL8/DG5V1zaqO2NeB3fJAu97kSwa 4339L81SGMnk/B/V2I2LofJaV3IH7LhQ5rHIzxk19tMVM3GkZnjrJHuuBTuDNQ8B8Nkc ZeLmjlVcbHGLBmcRQdcxfjplHjq+Iwa4iMcN7rSFlzQcpBWJzdlOjsph+JP4+MvN/vfL +A== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2scbkajk2q-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 10 May 2019 18:11:37 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 701C234; Fri, 10 May 2019 16:11:36 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag6node3.st.com [10.75.127.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 5E6F62C1E; Fri, 10 May 2019 16:11:36 +0000 (GMT) Received: from localhost (10.75.127.51) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 10 May 2019 18:11:35 +0200 From: Patrice Chotard To: Date: Fri, 10 May 2019 18:11:20 +0200 Message-ID: <1557504691-26188-4-git-send-email-patrice.chotard@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> References: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.51] X-ClientProxiedBy: SFHDAG8NODE1.st.com (10.75.127.22) To SFHDAG6NODE3.st.com (10.75.127.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-09_02:, , signatures=0 Cc: U-Boot STM32 Subject: [U-Boot] [PATCH 03/14] stm32mp1: support dynamic MTDPARTS 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This patch configure the default value for mtdids and mtparts dynamically according the presence of nor and nand in the board device tree Signed-off-by: Patrick Delaunay Signed-off-by: Christophe Kerello Signed-off-by: Patrice Chotard --- board/st/stm32mp1/stm32mp1.c | 85 ++++++++++++++++++++++++++++++++++++++++++++ include/configs/stm32mp1.h | 9 +++++ 2 files changed, 94 insertions(+) diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c index 76917b0..360b0df 100644 --- a/board/st/stm32mp1/stm32mp1.c +++ b/board/st/stm32mp1/stm32mp1.c @@ -504,3 +504,88 @@ void board_quiesce_devices(void) { setup_led(LEDST_OFF); } + +#ifdef CONFIG_SYS_MTDPARTS_RUNTIME + +#define MTDPARTS_LEN 256 +#define MTDIDS_LEN 128 + +/** + * The mtdparts_nand0 and mtdparts_nor0 variable tends to be long. + * If we need to access it before the env is relocated, then we need + * to use our own stack buffer. gd->env_buf will be too small. + * + * @param buf temporary buffer pointer MTDPARTS_LEN long + * @return mtdparts variable string, NULL if not found + */ +static const char *env_get_mtdparts(const char *str, char *buf) +{ + if (gd->flags & GD_FLG_ENV_READY) + return env_get(str); + if (env_get_f(str, buf, MTDPARTS_LEN) != -1) + return buf; + + return NULL; +} + +/** + * update the variables "mtdids" and "mtdparts" with content of mtdparts_ + */ +static void board_get_mtdparts(const char *dev, + char *mtdids, + char *mtdparts) +{ + char env_name[32] = "mtdparts_"; + char tmp_mtdparts[MTDPARTS_LEN]; + const char *tmp; + + /* name of env variable to read = mtdparts_ */ + strcat(env_name, dev); + tmp = env_get_mtdparts(env_name, tmp_mtdparts); + if (tmp) { + /* mtdids: "=, ...." */ + if (mtdids[0] != '\0') + strcat(mtdids, ","); + strcat(mtdids, dev); + strcat(mtdids, "="); + strcat(mtdids, dev); + + /* mtdparts: "mtdparts=:>;..." */ + if (mtdparts[0] != '\0') + strncat(mtdparts, ";", MTDPARTS_LEN); + else + strcat(mtdparts, "mtdparts="); + strncat(mtdparts, dev, MTDPARTS_LEN); + strncat(mtdparts, ":", MTDPARTS_LEN); + strncat(mtdparts, tmp, MTDPARTS_LEN); + } +} + +void board_mtdparts_default(const char **mtdids, const char **mtdparts) +{ + struct udevice *dev; + static char parts[2 * MTDPARTS_LEN + 1]; + static char ids[MTDIDS_LEN + 1]; + static bool mtd_initialized; + + if (mtd_initialized) { + *mtdids = ids; + *mtdparts = parts; + return; + } + + memset(parts, 0, sizeof(parts)); + memset(ids, 0, sizeof(ids)); + + if (!uclass_get_device(UCLASS_MTD, 0, &dev)) + board_get_mtdparts("nand0", ids, parts); + + if (!uclass_get_device(UCLASS_SPI_FLASH, 0, &dev)) + board_get_mtdparts("nor0", ids, parts); + + mtd_initialized = true; + *mtdids = ids; + *mtdparts = parts; + debug("%s:mtdids=%s & mtdparts=%s\n", __func__, ids, parts); +} +#endif diff --git a/include/configs/stm32mp1.h b/include/configs/stm32mp1.h index a28b8b3..254aad1 100644 --- a/include/configs/stm32mp1.h +++ b/include/configs/stm32mp1.h @@ -115,6 +115,14 @@ #include +#if defined(CONFIG_STM32_QSPI) || defined(CONFIG_NAND_STM32_FMC) +#define CONFIG_SYS_MTDPARTS_RUNTIME +#endif + +#define STM32MP_MTDPARTS \ + "mtdparts_nor0=256k(fsbl1),256k(fsbl2),2m(ssbl),-(nor_user)\0" \ + "mtdparts_nand0=2m(fsbl),2m(ssbl),-(UBI)\0" + /* * memory layout for 32M uncompressed/compressed kernel, * 1M fdt, 1M script, 1M pxe and 1M for splashimage @@ -130,6 +138,7 @@ "fdt_high=0xffffffff\0" \ "initrd_high=0xffffffff\0" \ STM32MP_BOOTCMD \ + STM32MP_MTDPARTS \ BOOTENV #endif /* ifndef CONFIG_SPL_BUILD */ From patchwork Fri May 10 16:11:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrice CHOTARD X-Patchwork-Id: 1098165 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=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="B3MzyIT9"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 450wLS2pjkz9sB8 for ; Sat, 11 May 2019 02:16:00 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 0451AC21DA2; Fri, 10 May 2019 16:14:27 +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=T_DKIM_INVALID 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 2051DC21E4F; Fri, 10 May 2019 16:12:13 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9E1EFC21E08; Fri, 10 May 2019 16:11:54 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) by lists.denx.de (Postfix) with ESMTPS id 57012C21E18 for ; Fri, 10 May 2019 16:11:50 +0000 (UTC) Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4AFu6Lg032137; Fri, 10 May 2019 18:11:37 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=CTA1DfLAvaRrxl4DLtizcsX/++xc6a+yWkraPSu1AWo=; b=B3MzyIT9jBtfu5Pd5TNcSn15fZ/+muXTlYxKRcWuMNQAWoPPlbkruqKuTxkU6xZ0Wu8Y K4VKnQqRNo4NxARa9EJAtQJfcKCtRcCQYcqUp2mOZtrXg+mndovXc+W2l2YnY9N1LJXT iO69mejE0wtDrbn+qHZCLbxFdvs1zs+qYbiZnAiseXQHoyT7pZsHxl2M/elW109QUyI0 66BAhmOfGjCqY5cPc5g+1TFE3BUlOyCkIT3L5161TmMjgLk4iJzo7A2zzbrYx11zJaWd E/A+fb7LhjdIZKiLar56PVJuGhJy3tcu9pUtD/yIRiISfayQ8xpWDfYsndZxmFE90b/W Mw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2scdjpa2nh-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 10 May 2019 18:11:37 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 35B3731; Fri, 10 May 2019 16:11:37 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag6node3.st.com [10.75.127.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 21FDA2C1E; Fri, 10 May 2019 16:11:37 +0000 (GMT) Received: from localhost (10.75.127.51) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 10 May 2019 18:11:36 +0200 From: Patrice Chotard To: Date: Fri, 10 May 2019 18:11:21 +0200 Message-ID: <1557504691-26188-5-git-send-email-patrice.chotard@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> References: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.51] X-ClientProxiedBy: SFHDAG7NODE2.st.com (10.75.127.20) To SFHDAG6NODE3.st.com (10.75.127.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-09_02:, , signatures=0 Cc: Igor Grinberg , U-Boot STM32 Subject: [U-Boot] [PATCH 04/14] env: ext4: Allow overriding interface, device and partition 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" For platform which can boot on different device, this allows to override interface, device and partition from board code. Signed-off-by: Patrice Chotard --- env/ext4.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/env/ext4.c b/env/ext4.c index 388474a..9947381 100644 --- a/env/ext4.c +++ b/env/ext4.c @@ -30,6 +30,16 @@ #include #include +__weak const char *env_ext4_get_intf(void) +{ + return (const char *)CONFIG_ENV_EXT4_INTERFACE; +} + +__weak const char *env_ext4_get_dev_part(void) +{ + return (const char *)CONFIG_ENV_EXT4_DEVICE_AND_PART; +} + #ifdef CONFIG_CMD_SAVEENV static int env_ext4_save(void) { @@ -38,13 +48,14 @@ static int env_ext4_save(void) disk_partition_t info; int dev, part; int err; + const char *ifname = env_ext4_get_intf(); + const char *dev_and_part = env_ext4_get_dev_part(); err = env_export(&env_new); if (err) return err; - part = blk_get_device_part_str(CONFIG_ENV_EXT4_INTERFACE, - CONFIG_ENV_EXT4_DEVICE_AND_PART, + part = blk_get_device_part_str(ifname, dev_and_part, &dev_desc, &info, 1); if (part < 0) return 1; @@ -54,8 +65,7 @@ static int env_ext4_save(void) if (!ext4fs_mount(info.size)) { printf("\n** Unable to use %s %s for saveenv **\n", - CONFIG_ENV_EXT4_INTERFACE, - CONFIG_ENV_EXT4_DEVICE_AND_PART); + ifname, dev_and_part); return 1; } @@ -65,8 +75,7 @@ static int env_ext4_save(void) if (err == -1) { printf("\n** Unable to write \"%s\" from %s%d:%d **\n", - CONFIG_ENV_EXT4_FILE, CONFIG_ENV_EXT4_INTERFACE, dev, - part); + CONFIG_ENV_EXT4_FILE, ifname, dev, part); return 1; } @@ -83,14 +92,15 @@ static int env_ext4_load(void) int dev, part; int err; loff_t off; + const char *ifname = env_ext4_get_intf(); + const char *dev_and_part = env_ext4_get_dev_part(); #ifdef CONFIG_MMC - if (!strcmp(CONFIG_ENV_EXT4_INTERFACE, "mmc")) + if (!strcmp(ifname, "mmc")) mmc_initialize(NULL); #endif - part = blk_get_device_part_str(CONFIG_ENV_EXT4_INTERFACE, - CONFIG_ENV_EXT4_DEVICE_AND_PART, + part = blk_get_device_part_str(ifname, dev_and_part, &dev_desc, &info, 1); if (part < 0) goto err_env_relocate; @@ -100,8 +110,7 @@ static int env_ext4_load(void) if (!ext4fs_mount(info.size)) { printf("\n** Unable to use %s %s for loading the env **\n", - CONFIG_ENV_EXT4_INTERFACE, - CONFIG_ENV_EXT4_DEVICE_AND_PART); + ifname, dev_and_part); goto err_env_relocate; } @@ -111,8 +120,7 @@ static int env_ext4_load(void) if (err == -1) { printf("\n** Unable to read \"%s\" from %s%d:%d **\n", - CONFIG_ENV_EXT4_FILE, CONFIG_ENV_EXT4_INTERFACE, dev, - part); + CONFIG_ENV_EXT4_FILE, ifname, dev, part); goto err_env_relocate; } From patchwork Fri May 10 16:11:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrice CHOTARD X-Patchwork-Id: 1098160 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=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="FIZCiHOW"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 450wJB4DRpz9sB8 for ; Sat, 11 May 2019 02:14:02 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 39E0BC21DA2; Fri, 10 May 2019 16:12:12 +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=T_DKIM_INVALID 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 14EABC21DA6; Fri, 10 May 2019 16:11:44 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 34395C21C29; Fri, 10 May 2019 16:11:39 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lists.denx.de (Postfix) with ESMTPS id DC19BC21C27 for ; Fri, 10 May 2019 16:11:38 +0000 (UTC) Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4AG6dJU025543; Fri, 10 May 2019 18:11:38 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=aD9IXD2emMRPepXHcZFzEEle8/CxqiP1CgCo/dwyOx0=; b=FIZCiHOWPR41AaiZeo8iwfcj1nxe5++ugj69H1miroXsqOybPclcjcc5a+WP879kOxCF KYi0f8/Zw397u9XjHoI0G3DvrP3eSb2wGKouJhbmzKA2ob/X+/2lzGUsc1dDgqe1SuSB s14sSKtQyYsPsaM7iXfC+1xnMuYH/Odbr0OLWdCU2JFh7Fq2gXlqU6V01+C69tILxiOe fetNOzhCgkzky1bQXiJkc3PEIdBwMHdkzccl4JlZMHUrW1xnes+iXmOT1xZaeyOS2fn8 xv1S797GhVYMVF37LMHUVIqxXspLLhBIflq1/GrwCRm2Xa4Gtsjjjcp/+8inQnhLxzMN lw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2sc9s4kekp-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 10 May 2019 18:11:38 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 074C934; Fri, 10 May 2019 16:11:38 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag6node3.st.com [10.75.127.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id EA3E02C1E; Fri, 10 May 2019 16:11:37 +0000 (GMT) Received: from localhost (10.75.127.49) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 10 May 2019 18:11:37 +0200 From: Patrice Chotard To: Date: Fri, 10 May 2019 18:11:22 +0200 Message-ID: <1557504691-26188-6-git-send-email-patrice.chotard@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> References: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.49] X-ClientProxiedBy: SFHDAG6NODE1.st.com (10.75.127.16) To SFHDAG6NODE3.st.com (10.75.127.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-09_02:, , signatures=0 Cc: U-Boot STM32 Subject: [U-Boot] [PATCH 05/14] board: stm32mp1: Add env_ext4_get_dev_part() and env_ext4_get_intf() 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This allows to : - select the current device to save the environment file - select the correct EXT4 boot device instance and partition to save the environment file. For EXT4, device is mmc, device instance is 0 for sdcard or 1 for eMMC. The partition is set to "auto" to select the first partition with bootable flag. Signed-off-by: Patrice Chotard --- board/st/stm32mp1/stm32mp1.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c index 360b0df..316cd48 100644 --- a/board/st/stm32mp1/stm32mp1.c +++ b/board/st/stm32mp1/stm32mp1.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -505,6 +506,29 @@ void board_quiesce_devices(void) setup_led(LEDST_OFF); } +#if defined(CONFIG_ENV_IS_IN_EXT4) +const char *env_ext4_get_intf(void) +{ + u32 bootmode = get_bootmode(); + + switch (bootmode & TAMP_BOOT_DEVICE_MASK) { + case BOOT_FLASH_SD: + case BOOT_FLASH_EMMC: + return "mmc"; + default: + return ""; + } +} + +const char *env_ext4_get_dev_part(void) +{ + static char *const dev_part[] = {"0:auto", "1:auto", "2:auto"}; + u32 bootmode = get_bootmode(); + + return dev_part[(bootmode & TAMP_BOOT_INSTANCE_MASK) - 1]; +} +#endif + #ifdef CONFIG_SYS_MTDPARTS_RUNTIME #define MTDPARTS_LEN 256 From patchwork Fri May 10 16:11:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrice CHOTARD X-Patchwork-Id: 1098164 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=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="n+b3+6Rg"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 450wJY5cmZz9sBr for ; Sat, 11 May 2019 02:14:21 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 6EBF9C21CB1; Fri, 10 May 2019 16:12:26 +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=T_DKIM_INVALID 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 9A707C21C2C; Fri, 10 May 2019 16:11:49 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 63000C21E18; Fri, 10 May 2019 16:11:45 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lists.denx.de (Postfix) with ESMTPS id E2321C21DB6 for ; Fri, 10 May 2019 16:11:41 +0000 (UTC) Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4AG6dEI020397; Fri, 10 May 2019 18:11:39 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=gCPI9nsZIRdQyxiy/jN5C95zgHZkx3J+49WnZSa1lvE=; b=n+b3+6Rg7vbcQHjHIR0xZrDUXWdsYbT0F9lLD5DAljXzv74fGq2hgCbzblE/2Q5sUEUi +DOZmkof3Y7MXXOZe92tKmI/OS04rbGN3VlbnyQYXsvPBID//Ec77zcMamQ2RKAXj+nC BFSP4bSBpJsmH5CrAV5nZ0t63xk03q5e+wD4fUFPxkxkG1QMy2gV0MbtSKEypBVp889A xatdkZTeLZZ4kNnKJ3Y0mmH1+R2vrAt/h8hRcMHqblHXHUTUODw4pLI8K+6H1a2QpGPA tcgB2PZRya1qBNuGLilvm9AFxHkfOqr/sRne/LcHjQ8c1wz95tTRkVQEYsml4XjULrvz Lg== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2scfv2sptd-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 10 May 2019 18:11:39 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 0043E31; Fri, 10 May 2019 16:11:38 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag6node3.st.com [10.75.127.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D54EC2C1E; Fri, 10 May 2019 16:11:38 +0000 (GMT) Received: from localhost (10.75.127.48) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 10 May 2019 18:11:38 +0200 From: Patrice Chotard To: Date: Fri, 10 May 2019 18:11:23 +0200 Message-ID: <1557504691-26188-7-git-send-email-patrice.chotard@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> References: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.48] X-ClientProxiedBy: SFHDAG7NODE2.st.com (10.75.127.20) To SFHDAG6NODE3.st.com (10.75.127.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-09_02:, , signatures=0 Cc: Heinrich Schuchardt , Alexey Brodkin , Michal Simek , Shyam Saini , U-Boot STM32 , York Sun , Vipul Kumar Subject: [U-Boot] [PATCH 06/14] env: allow ENV_IS_NOWHERE with other storage target 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Allow U-Boot to get default environment for some boot mode (USB for example), and to select storage location when it is booting from flash device; ENVL_NOWHERE is present in env_locations with other one. Signed-off-by: Patrick Delaunay Signed-off-by: Patrice Chotard --- env/Kconfig | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/env/Kconfig b/env/Kconfig index 7830066..ca889cc 100644 --- a/env/Kconfig +++ b/env/Kconfig @@ -2,18 +2,12 @@ menu "Environment" config ENV_IS_NOWHERE bool "Environment is not stored" - depends on !ENV_IS_IN_EEPROM - depends on !ENV_IS_IN_EXT4 - depends on !ENV_IS_IN_FAT - depends on !ENV_IS_IN_FLASH - depends on !ENV_IS_IN_MMC - depends on !ENV_IS_IN_NAND - depends on !ENV_IS_IN_NVRAM - depends on !ENV_IS_IN_ONENAND - depends on !ENV_IS_IN_REMOTE - depends on !ENV_IS_IN_SPI_FLASH - depends on !ENV_IS_IN_UBI - default y + default y if !ENV_IS_IN_EEPROM && !ENV_IS_IN_EXT4 && \ + !ENV_IS_IN_FAT && !ENV_IS_IN_FLASH && \ + !ENV_IS_IN_MMC && !ENV_IS_IN_NAND && \ + !ENV_IS_IN_NVRAM && !ENV_IS_IN_ONENAND && \ + !ENV_IS_IN_REMOTE && !ENV_IS_IN_SPI_FLASH && \ + !ENV_IS_IN_UBI help Define this if you don't want to or can't have an environment stored on a storage medium. In this case the environment will still exist From patchwork Fri May 10 16:11:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrice CHOTARD X-Patchwork-Id: 1098178 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=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="xmY2Vxv6"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 450wQ162jcz9sB8 for ; Sat, 11 May 2019 02:19:05 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 7C088C21C2C; Fri, 10 May 2019 16:14:54 +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=T_DKIM_INVALID 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 413A3C21E12; Fri, 10 May 2019 16:12:24 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A8CEFC21DB3; Fri, 10 May 2019 16:12:00 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) by lists.denx.de (Postfix) with ESMTPS id 8BE02C21DAF for ; Fri, 10 May 2019 16:11:55 +0000 (UTC) Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4AG6CgY014692; Fri, 10 May 2019 18:11:40 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=4xH7Cr02QbWSvh5iR6eXAZUdSs1K+Mx2yLFjz6bk9qc=; b=xmY2Vxv6D+F5JMV0LDXKrke0jvfV1Br45n7DNOPcJFLab0a/T71BpXxpkBWcsllu1XxF A3kPks8gWGkjFn76fB5yIMnbPo2CMTNrfgJl2LuPod8/R9cRWdIn/wopd5rnEL/9ttFp wra3JBEdVtvtmNNsvLm0lsf6uq5OiiSJYPiE3gBiCzyt98zouTlyeVsZA2+RA6Z+eaRe xTq24KU1TnyAc1dw2anlB9yq1+gq7CZoQHY6WUZ1XMbpR62rXCrPsc8Rg98UNOp5SOPf 9t2JL0etayb6zENlZhMA3LUnJirz93BRnIimzhbq14WqRb9Gmyk/i8c6lEMZ4b9veb6o ew== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2scbkajk32-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 10 May 2019 18:11:40 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D9A1B34; Fri, 10 May 2019 16:11:39 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag6node3.st.com [10.75.127.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id BA9182C1E; Fri, 10 May 2019 16:11:39 +0000 (GMT) Received: from localhost (10.75.127.51) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 10 May 2019 18:11:39 +0200 From: Patrice Chotard To: Date: Fri, 10 May 2019 18:11:24 +0200 Message-ID: <1557504691-26188-8-git-send-email-patrice.chotard@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> References: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.51] X-ClientProxiedBy: SFHDAG7NODE2.st.com (10.75.127.20) To SFHDAG6NODE3.st.com (10.75.127.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-09_02:, , signatures=0 Cc: Shyam Saini , Quentin Schulz , Heinrich Schuchardt , Igor Grinberg , U-Boot STM32 , Neil Stainton Subject: [U-Boot] [PATCH 07/14] env: enable saveenv command when one CONFIG_ENV_IS_IN is activated 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Patrick Delaunay Introduce ENV_IS_IN_DEVICE to test if one the CONFIG_ENV_IS_IN_ is defined and support the command saveenv even if CONFIG_ENV_IS_NOWHERE is activated Signed-off-by: Patrick Delaunay Signed-off-by: Patrice Chotard --- cmd/nvedit.c | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/cmd/nvedit.c b/cmd/nvedit.c index 24a6cf7..5d723ac 100644 --- a/cmd/nvedit.c +++ b/cmd/nvedit.c @@ -39,18 +39,24 @@ DECLARE_GLOBAL_DATA_PTR; -#if !defined(CONFIG_ENV_IS_IN_EEPROM) && \ - !defined(CONFIG_ENV_IS_IN_FLASH) && \ - !defined(CONFIG_ENV_IS_IN_MMC) && \ - !defined(CONFIG_ENV_IS_IN_FAT) && \ - !defined(CONFIG_ENV_IS_IN_EXT4) && \ - !defined(CONFIG_ENV_IS_IN_NAND) && \ - !defined(CONFIG_ENV_IS_IN_NVRAM) && \ - !defined(CONFIG_ENV_IS_IN_ONENAND) && \ - !defined(CONFIG_ENV_IS_IN_SATA) && \ - !defined(CONFIG_ENV_IS_IN_SPI_FLASH) && \ - !defined(CONFIG_ENV_IS_IN_REMOTE) && \ - !defined(CONFIG_ENV_IS_IN_UBI) && \ +#if defined(CONFIG_ENV_IS_IN_EEPROM) || \ + defined(CONFIG_ENV_IS_IN_FLASH) || \ + defined(CONFIG_ENV_IS_IN_MMC) || \ + defined(CONFIG_ENV_IS_IN_FAT) || \ + defined(CONFIG_ENV_IS_IN_EXT4) || \ + defined(CONFIG_ENV_IS_IN_NAND) || \ + defined(CONFIG_ENV_IS_IN_NVRAM) || \ + defined(CONFIG_ENV_IS_IN_ONENAND) || \ + defined(CONFIG_ENV_IS_IN_SATA) || \ + defined(CONFIG_ENV_IS_IN_SPI_FLASH) || \ + defined(CONFIG_ENV_IS_IN_REMOTE) || \ + defined(CONFIG_ENV_IS_IN_UBI) + +#define ENV_IS_IN_DEVICE + +#endif + +#if !defined(ENV_IS_IN_DEVICE) && \ !defined(CONFIG_ENV_IS_NOWHERE) # error Define one of CONFIG_ENV_IS_IN_{EEPROM|FLASH|MMC|FAT|EXT4|\ NAND|NVRAM|ONENAND|SATA|SPI_FLASH|REMOTE|UBI} or CONFIG_ENV_IS_NOWHERE @@ -749,7 +755,7 @@ ulong env_get_ulong(const char *name, int base, ulong default_val) } #ifndef CONFIG_SPL_BUILD -#if defined(CONFIG_CMD_SAVEENV) && !defined(CONFIG_ENV_IS_NOWHERE) +#if defined(CONFIG_CMD_SAVEENV) && defined(ENV_IS_IN_DEVICE) static int do_env_save(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { @@ -1205,7 +1211,7 @@ static cmd_tbl_t cmd_env_sub[] = { #if defined(CONFIG_CMD_RUN) U_BOOT_CMD_MKENT(run, CONFIG_SYS_MAXARGS, 1, do_run, "", ""), #endif -#if defined(CONFIG_CMD_SAVEENV) && !defined(CONFIG_ENV_IS_NOWHERE) +#if defined(CONFIG_CMD_SAVEENV) && defined(ENV_IS_IN_DEVICE) U_BOOT_CMD_MKENT(save, 1, 0, do_env_save, "", ""), #endif U_BOOT_CMD_MKENT(set, CONFIG_SYS_MAXARGS, 0, do_env_set, "", ""), @@ -1280,7 +1286,7 @@ static char env_help_text[] = #if defined(CONFIG_CMD_RUN) "env run var [...] - run commands in an environment variable\n" #endif -#if defined(CONFIG_CMD_SAVEENV) && !defined(CONFIG_ENV_IS_NOWHERE) +#if defined(CONFIG_CMD_SAVEENV) && defined(ENV_IS_IN_DEVICE) "env save - save environment\n" #endif #if defined(CONFIG_CMD_NVEDIT_EFI) From patchwork Fri May 10 16:11:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrice CHOTARD X-Patchwork-Id: 1098167 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=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="aXeCldlL"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 450wLl1D8Mz9sB8 for ; Sat, 11 May 2019 02:16:15 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id B9867C21E52; Fri, 10 May 2019 16:13:09 +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=T_DKIM_INVALID 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 DCA6BC21E36; Fri, 10 May 2019 16:11:53 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D6D8CC21E0D; Fri, 10 May 2019 16:11:44 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) by lists.denx.de (Postfix) with ESMTPS id 97172C21DD3 for ; Fri, 10 May 2019 16:11:41 +0000 (UTC) Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4AFuEFf032191; Fri, 10 May 2019 18:11:41 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=gyIC3mMoMDlOjZ4ynddTTL25x6BIRC6NnEbpFLnY0ok=; b=aXeCldlLfYp+Gco00Nx5gXh7CMIRZ/xL3NJLKubUIDqaRTD+Ps+u25pbQAq1t9G5FmFg ULSbljLgbBoq4dxyVqUVWNbMbYBPuN8paoBb5CBBsBuSLIKcaG7UGD4btZLRtW6TkJiH P0F1NU6KMWa4VeVvQ502YEyVRTqXb5UVTgsWMy0MgSUm+mkNr6a5qjxwehL5piBYsiW5 2xu4nuT1RnUJlr/m3LCIJq8hadG/rS8AhnNznO14ff4F8OKqoVlXdpcamJeycWvsy5q1 279toqlI4aE8wLQR9mZYZ4JuvFOFp2g8yHVmnQ5jpKhK4uDp1MrL3hwvngBewhSHMhMR xA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2scdjpa2nv-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 10 May 2019 18:11:41 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id AFD3638; Fri, 10 May 2019 16:11:40 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag6node3.st.com [10.75.127.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 9DF542C1E; Fri, 10 May 2019 16:11:40 +0000 (GMT) Received: from localhost (10.75.127.49) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 10 May 2019 18:11:40 +0200 From: Patrice Chotard To: Date: Fri, 10 May 2019 18:11:25 +0200 Message-ID: <1557504691-26188-9-git-send-email-patrice.chotard@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> References: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.49] X-ClientProxiedBy: SFHDAG1NODE2.st.com (10.75.127.2) To SFHDAG6NODE3.st.com (10.75.127.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-09_02:, , signatures=0 Cc: U-Boot STM32 Subject: [U-Boot] [PATCH 08/14] configs: stm32mp15: Enable ENV_IS_IN_EXT4 and all relative flags 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Patrick Delaunay Enable ENV_IS_IN_EXT4 and all relative flags to be able to load/save environment in EXT4 partition. This will allows to load/save environment on both sdcard and eMMC. As for stm32mp15, bootfs has not the same partition number on sdcard and on eMMC, we use "auto" key which allows to find the first partition in device with bootable flag which is partition 4 on sdcard and partition 2 on eMMC. Signed-off-by: Patrice Chotard --- configs/stm32mp15_basic_defconfig | 5 +++++ configs/stm32mp15_trusted_defconfig | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/configs/stm32mp15_basic_defconfig b/configs/stm32mp15_basic_defconfig index f5e13dd..051c1de 100644 --- a/configs/stm32mp15_basic_defconfig +++ b/configs/stm32mp15_basic_defconfig @@ -41,6 +41,11 @@ CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_MTDPARTS=y # CONFIG_SPL_DOS_PARTITION is not set CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1" +CONFIG_ENV_IS_NOWHERE=y +CONFIG_ENV_IS_IN_EXT4=y +CONFIG_ENV_EXT4_INTERFACE="mmc" +CONFIG_ENV_EXT4_DEVICE_AND_PART="0:auto" +CONFIG_ENV_EXT4_FILE="/uboot.env" CONFIG_STM32_ADC=y CONFIG_USB_FUNCTION_FASTBOOT=y CONFIG_FASTBOOT_BUF_ADDR=0xC0000000 diff --git a/configs/stm32mp15_trusted_defconfig b/configs/stm32mp15_trusted_defconfig index cae3324..f09f0e4 100644 --- a/configs/stm32mp15_trusted_defconfig +++ b/configs/stm32mp15_trusted_defconfig @@ -33,6 +33,11 @@ CONFIG_CMD_REGULATOR=y CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_MTDPARTS=y CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1" +CONFIG_ENV_IS_NOWHERE=y +CONFIG_ENV_IS_IN_EXT4=y +CONFIG_ENV_EXT4_INTERFACE="mmc" +CONFIG_ENV_EXT4_DEVICE_AND_PART="0:auto" +CONFIG_ENV_EXT4_FILE="/uboot.env" CONFIG_STM32_ADC=y CONFIG_USB_FUNCTION_FASTBOOT=y CONFIG_FASTBOOT_BUF_ADDR=0xC0000000 From patchwork Fri May 10 16:11:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrice CHOTARD X-Patchwork-Id: 1098163 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=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="PbQW/i1z"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 450wJX74KNz9sB8 for ; Sat, 11 May 2019 02:14:20 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 9C065C21DD4; Fri, 10 May 2019 16:12:40 +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=T_DKIM_INVALID 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 0B4E0C21E34; Fri, 10 May 2019 16:11:51 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id CEB7CC21DAF; Fri, 10 May 2019 16:11:45 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) by lists.denx.de (Postfix) with ESMTPS id 44D2CC21DDC for ; Fri, 10 May 2019 16:11:42 +0000 (UTC) Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4AG6B1A014681; Fri, 10 May 2019 18:11:41 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=D718zYvyjZHyDjzrdpb2nCU+afqNwPk7+JWsneKxj7Q=; b=PbQW/i1zB2a4WSn6APsrRoJ1aabQr9be895XaWKSpnKokDDDtbaDtnsrL/mdmLpPMA6N GiBDtF924Vi4+xuUCj3ZmDx4jGROPDkL4n/XKGXeD+hmWJMNZUw5pVI8f7krsZYimtfD CU9dehnvW1Qg4w/fq3fWYgcj6Dj/RSaZP4v0k9ciHQ0uyVyJ7nwCZyKYCh5zchBl+EC1 jzbx5udhZTrGYJm0VSEYNlKjDQPPb3H05OBki81ZtRWNzbmBKOQqrris8mvvN84hQerT qg66OIyFbocrlGOiuGoYWI0Kg43vJ2HWwkaahpKGVINZS9AB8BO4I8C/Bx0/ZjSuIFLZ oQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2scbkajk37-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 10 May 2019 18:11:41 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 7E58134; Fri, 10 May 2019 16:11:41 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag6node3.st.com [10.75.127.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 699E02C20; Fri, 10 May 2019 16:11:41 +0000 (GMT) Received: from localhost (10.75.127.49) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 10 May 2019 18:11:41 +0200 From: Patrice Chotard To: Date: Fri, 10 May 2019 18:11:26 +0200 Message-ID: <1557504691-26188-10-git-send-email-patrice.chotard@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> References: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.49] X-ClientProxiedBy: SFHDAG2NODE1.st.com (10.75.127.4) To SFHDAG6NODE3.st.com (10.75.127.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-09_02:, , signatures=0 Cc: U-Boot STM32 Subject: [U-Boot] [PATCH 09/14] stm32mp1: Add env_get_location() 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" In case of several environment location support, env_get_location is needed to select the correct location depending of the boot device . Signed-off-by: Patrice Chotard --- board/st/stm32mp1/stm32mp1.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c index 316cd48..4f7d24a 100644 --- a/board/st/stm32mp1/stm32mp1.c +++ b/board/st/stm32mp1/stm32mp1.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -506,6 +507,28 @@ void board_quiesce_devices(void) setup_led(LEDST_OFF); } +enum env_location env_get_location(enum env_operation op, int prio) +{ + u32 bootmode = get_bootmode(); + + if (prio) + return ENVL_UNKNOWN; + + switch (bootmode & TAMP_BOOT_DEVICE_MASK) { +#ifdef CONFIG_ENV_IS_IN_EXT4 + case BOOT_FLASH_SD: + case BOOT_FLASH_EMMC: + return ENVL_EXT4; +#endif +#ifdef CONFIG_ENV_IS_IN_UBI + case BOOT_FLASH_NAND: + return ENVL_UBI; +#endif + default: + return ENVL_NOWHERE; + } +} + #if defined(CONFIG_ENV_IS_IN_EXT4) const char *env_ext4_get_intf(void) { From patchwork Fri May 10 16:11:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrice CHOTARD X-Patchwork-Id: 1098171 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=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="Z6pRp9Kb"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 450wNZ5jLCz9sBr for ; Sat, 11 May 2019 02:17:50 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 79383C21E38; Fri, 10 May 2019 16:13: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=T_DKIM_INVALID 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 725B6C21E42; Fri, 10 May 2019 16:12:04 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A6A61C21CB6; Fri, 10 May 2019 16:11:49 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) by lists.denx.de (Postfix) with ESMTPS id 60C1AC21DF9 for ; Fri, 10 May 2019 16:11:46 +0000 (UTC) Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4AFu6Lh032137; Fri, 10 May 2019 18:11:43 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=4hFZ5bmECakd1JNX6M63RvaZEjdcpoLvxt8ZJOFyGME=; b=Z6pRp9Kbp+HQoHkjCPTxAkZv4nX1/YYIjS0gBwzW6X88Anaxnu5fXDllQ6yvJjJC91We hEt5bkOKMZ/VFjBuBiF7xQ779snzNWrsrtCCzUBkxYyC4VlWxoQdmRuirLYXcW/7G3ZX ftZ28UPOukxqWYDvIG7TjG2XzAp8WgWMeXj3auwzaohVfa4Tyr0m2cSsZxYZ1zuejgzw RGqfWUVilL2lh7l0Gc04qd3fFKdIPdDFlXRE0sSzsh9m2S7w36H6yW3Lnh4vYfaJcYa0 aNHGCpNaI2I/jRAbhGqJ37dueALT1foPPqL/bbjvU3CptRA/9X4eZVirokZjeOKkAGvj vA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2scdjpa2p2-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 10 May 2019 18:11:43 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 5C7D834; Fri, 10 May 2019 16:11:42 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag6node3.st.com [10.75.127.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 45DF32C20; Fri, 10 May 2019 16:11:42 +0000 (GMT) Received: from localhost (10.75.127.50) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 10 May 2019 18:11:41 +0200 From: Patrice Chotard To: Date: Fri, 10 May 2019 18:11:27 +0200 Message-ID: <1557504691-26188-11-git-send-email-patrice.chotard@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> References: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.50] X-ClientProxiedBy: SFHDAG6NODE3.st.com (10.75.127.18) To SFHDAG6NODE3.st.com (10.75.127.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-09_02:, , signatures=0 Cc: Boris Brezillon , Miquel Raynal , U-Boot STM32 , Stefan Roese , Jagan Teki Subject: [U-Boot] [PATCH 10/14] mtd: Fix get_mtdparts() 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" When ENV_IS_IN_UBI is enable, get_mtdparts is called before relocation. During first get_mtdparts() call, mtdparts is not available in environment, it can be retrieved by calling board_mtdparts_default(), but following env_set() do nothing as we are before relocation. Finally mtdparts is still not available in environment. At second get_mtdparts() call, use_defaults is false, but mtdparts is still not in environment and is NULL. Remove use_defaults bool, only mtdparts criteria is useful. Fixes: commit 5ffcd50612f6 ("mtd: Use default mtdparts/mtids when not defined in the environment") Signed-off-by: Patrice Chotard --- drivers/mtd/mtd_uboot.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/mtd/mtd_uboot.c b/drivers/mtd/mtd_uboot.c index d638f70..0a41ed4 100644 --- a/drivers/mtd/mtd_uboot.c +++ b/drivers/mtd/mtd_uboot.c @@ -122,7 +122,6 @@ static const char *get_mtdparts(void) { __maybe_unused const char *mtdids = NULL; static char tmp_parts[MTDPARTS_MAXLEN]; - static bool use_defaults = true; const char *mtdparts = NULL; if (gd->flags & GD_FLG_ENV_READY) @@ -130,7 +129,7 @@ static const char *get_mtdparts(void) else if (env_get_f("mtdparts", tmp_parts, sizeof(tmp_parts)) != -1) mtdparts = tmp_parts; - if (mtdparts || !use_defaults) + if (mtdparts) return mtdparts; #if defined(CONFIG_SYS_MTDPARTS_RUNTIME) @@ -144,8 +143,6 @@ static const char *get_mtdparts(void) if (mtdparts) env_set("mtdparts", mtdparts); - use_defaults = false; - return mtdparts; } From patchwork Fri May 10 16:11:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrice CHOTARD X-Patchwork-Id: 1098166 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=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="TcR+7o9z"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 450wLW40dXz9sB8 for ; Sat, 11 May 2019 02:16:03 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 3628EC21DD3; Fri, 10 May 2019 16: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=T_DKIM_INVALID 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 6B262C21E45; Fri, 10 May 2019 16:11:57 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9EF0AC21E38; Fri, 10 May 2019 16:11:49 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lists.denx.de (Postfix) with ESMTPS id BEE6BC21DB5 for ; Fri, 10 May 2019 16:11:45 +0000 (UTC) Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4AG6UrU020376; Fri, 10 May 2019 18:11:43 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=F3CR0IpwnpPZcIQ8gckCsBOv9DmEupfDcXLZoOVisis=; b=TcR+7o9zZiWvzLdGHLlnsSuUEBK1/TAgAK5rvnLxIB0lx8HCGivnCkZsgC0ibB8mWZGd 7CuZXoUxcuPuMu7SyaxPb3NY5BImmtpRtAWbX/11nPTXda1/TphpH2p5mglK/fE91zMG k8QPHFrNUegdziOqhkcZ+wUr9W77UoZZoD9HYoBfwxtMnAF7I2H6LD2/apHxfRTtXxcT O8NpSIWebEmJ6itYbuuzVfkg3e5KyRFu4pr2jkHp6QVUalkSxWRwPx+ADvBZh8fQ3BXB VbBnMAwvDz/xcchL0YJMET0ss6tCjneNcRUx2TyRLQgvwpS7XCFpytivQIs0uX6SwBJe 0Q== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2scfv2spty-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 10 May 2019 18:11:43 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 41C9038; Fri, 10 May 2019 16:11:43 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag6node3.st.com [10.75.127.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 2487C2C1E; Fri, 10 May 2019 16:11:43 +0000 (GMT) Received: from localhost (10.75.127.51) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 10 May 2019 18:11:42 +0200 From: Patrice Chotard To: Date: Fri, 10 May 2019 18:11:28 +0200 Message-ID: <1557504691-26188-12-git-send-email-patrice.chotard@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> References: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.51] X-ClientProxiedBy: SFHDAG6NODE3.st.com (10.75.127.18) To SFHDAG6NODE3.st.com (10.75.127.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-09_02:, , signatures=0 Cc: Maxime Ripard , Michal Simek , Shyam Saini , U-Boot STM32 , York Sun , Vipul Kumar Subject: [U-Boot] [PATCH 11/14] stm32mp1: Move ENV_SIZE to Kconfig 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Move ENV_SIZE from include/configs/stm32mp1.h to arch/arm/mach-stm32mp/Kconfig Increase ENV_SIZE from 4 to 8 Ko Signed-off-by: Patrick Delaunay Signed-off-by: Patrice Chotard --- arch/arm/mach-stm32mp/Kconfig | 3 +++ env/Kconfig | 2 +- include/configs/stm32mp1.h | 5 ----- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-stm32mp/Kconfig b/arch/arm/mach-stm32mp/Kconfig index 73aa382..5a7f40d 100644 --- a/arch/arm/mach-stm32mp/Kconfig +++ b/arch/arm/mach-stm32mp/Kconfig @@ -23,6 +23,9 @@ config SPL config SYS_SOC default "stm32mp" +config ENV_SIZE + default 0x2000 + config TARGET_STM32MP1 bool "Support stm32mp1xx" select ARCH_SUPPORT_PSCI if !STM32MP1_TRUSTED diff --git a/env/Kconfig b/env/Kconfig index ca889cc..1091c89 100644 --- a/env/Kconfig +++ b/env/Kconfig @@ -464,7 +464,7 @@ config ENV_EXT4_FILE It's a string of the EXT4 file name. This file use to store the environment (explicit path to the file) -if ARCH_ROCKCHIP || ARCH_SUNXI || ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_VERSAL || ARC +if ARCH_ROCKCHIP || ARCH_SUNXI || ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_VERSAL || ARC || ARCH_STM32MP config ENV_OFFSET hex "Environment Offset" diff --git a/include/configs/stm32mp1.h b/include/configs/stm32mp1.h index 254aad1..51f1736 100644 --- a/include/configs/stm32mp1.h +++ b/include/configs/stm32mp1.h @@ -43,11 +43,6 @@ */ #define CONFIG_SYS_LOAD_ADDR STM32_DDR_BASE -/* - * Env parameters - */ -#define CONFIG_ENV_SIZE SZ_4K - /* ATAGs */ #define CONFIG_CMDLINE_TAG #define CONFIG_SETUP_MEMORY_TAGS From patchwork Fri May 10 16:11:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrice CHOTARD X-Patchwork-Id: 1098168 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=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="m/QijoQo"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 450wMY1m48z9sBr for ; Sat, 11 May 2019 02:16:57 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id E084AC21E08; Fri, 10 May 2019 16:14:13 +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=T_DKIM_INVALID 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 8E8DCC21E62; Fri, 10 May 2019 16:12:10 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 067F4C21C29; Fri, 10 May 2019 16:11:48 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lists.denx.de (Postfix) with ESMTPS id 3966DC21DB3 for ; Fri, 10 May 2019 16:11:45 +0000 (UTC) Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4AG6dJV025543; Fri, 10 May 2019 18:11:45 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=v04/vK3wlxgQzzjc2DMbx3Anz+5JhqURVQd08R5rKeU=; b=m/QijoQo1PJrnAvPsytADV5DePYJwlmHsVE9Z3xJ9sbOpXYw+gXQfC1rFRKwUQ3NVtVp y6W/+180HiS2WVyLCv1jVBi+lBg4XQCFDfI2Tqai1y3hKyjAazlcvAFEZga4dy9LvJlh gJ7kOkxSAyt+zPUFKknpOO56UeHZBlK8oFFZT67dWOHm695UIZVc2NX4HQV66U8Ou7b9 OJlxxCwNJgD4OR/WxP5oklD8BoqZmguMoUDVjXu7jUJYDL0tIE0kgrhpqfeKrLFAhl9Z fgDnmASLoe7COV2qtl3/EuSFte10oZm/LFsrb4eyPg543BoKlBPQQW/yO6wcCE0XVdRv fQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2sc9s4kemf-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 10 May 2019 18:11:44 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 1AE223A; Fri, 10 May 2019 16:11:44 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag6node3.st.com [10.75.127.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 07FB42C1E; Fri, 10 May 2019 16:11:44 +0000 (GMT) Received: from localhost (10.75.127.48) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 10 May 2019 18:11:43 +0200 From: Patrice Chotard To: Date: Fri, 10 May 2019 18:11:29 +0200 Message-ID: <1557504691-26188-13-git-send-email-patrice.chotard@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> References: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.48] X-ClientProxiedBy: SFHDAG1NODE2.st.com (10.75.127.2) To SFHDAG6NODE3.st.com (10.75.127.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-09_02:, , signatures=0 Cc: U-Boot STM32 Subject: [U-Boot] [PATCH 12/14] configs: stm32mp15: Enable ENV_IS_IN_UBI 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add all relative flags needed by ENV_IS_IN_UBI Signed-off-by: Patrice Chotard --- configs/stm32mp15_basic_defconfig | 4 ++++ configs/stm32mp15_trusted_defconfig | 4 ++++ include/configs/stm32mp1.h | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/configs/stm32mp15_basic_defconfig b/configs/stm32mp15_basic_defconfig index 051c1de..e8f170d 100644 --- a/configs/stm32mp15_basic_defconfig +++ b/configs/stm32mp15_basic_defconfig @@ -39,13 +39,17 @@ CONFIG_CMD_PMIC=y CONFIG_CMD_REGULATOR=y CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_MTDPARTS=y +CONFIG_CMD_UBI=y # CONFIG_SPL_DOS_PARTITION is not set CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1" CONFIG_ENV_IS_NOWHERE=y CONFIG_ENV_IS_IN_EXT4=y +CONFIG_ENV_IS_IN_UBI=y CONFIG_ENV_EXT4_INTERFACE="mmc" CONFIG_ENV_EXT4_DEVICE_AND_PART="0:auto" CONFIG_ENV_EXT4_FILE="/uboot.env" +CONFIG_ENV_UBI_PART="UBI" +CONFIG_ENV_UBI_VOLUME="uboot_config" CONFIG_STM32_ADC=y CONFIG_USB_FUNCTION_FASTBOOT=y CONFIG_FASTBOOT_BUF_ADDR=0xC0000000 diff --git a/configs/stm32mp15_trusted_defconfig b/configs/stm32mp15_trusted_defconfig index f09f0e4..61d4467 100644 --- a/configs/stm32mp15_trusted_defconfig +++ b/configs/stm32mp15_trusted_defconfig @@ -32,12 +32,16 @@ CONFIG_CMD_PMIC=y CONFIG_CMD_REGULATOR=y CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_MTDPARTS=y +CONFIG_CMD_UBI=y CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1" CONFIG_ENV_IS_NOWHERE=y CONFIG_ENV_IS_IN_EXT4=y +CONFIG_ENV_IS_IN_UBI=y CONFIG_ENV_EXT4_INTERFACE="mmc" CONFIG_ENV_EXT4_DEVICE_AND_PART="0:auto" CONFIG_ENV_EXT4_FILE="/uboot.env" +CONFIG_ENV_UBI_PART="UBI" +CONFIG_ENV_UBI_VOLUME="uboot_config" CONFIG_STM32_ADC=y CONFIG_USB_FUNCTION_FASTBOOT=y CONFIG_FASTBOOT_BUF_ADDR=0xC0000000 diff --git a/include/configs/stm32mp1.h b/include/configs/stm32mp1.h index 51f1736..e9bd551 100644 --- a/include/configs/stm32mp1.h +++ b/include/configs/stm32mp1.h @@ -43,6 +43,10 @@ */ #define CONFIG_SYS_LOAD_ADDR STM32_DDR_BASE +#if defined(CONFIG_ENV_IS_IN_UBI) +#define CONFIG_ENV_UBI_VOLUME_REDUND "uboot_config_r" +#endif + /* ATAGs */ #define CONFIG_CMDLINE_TAG #define CONFIG_SETUP_MEMORY_TAGS From patchwork Fri May 10 16:11:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrice CHOTARD X-Patchwork-Id: 1098173 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=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="bI+4s8Rp"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 450wNm53KWz9sBr for ; Sat, 11 May 2019 02:18:00 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 71F23C21DC1; Fri, 10 May 2019 16:13:35 +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=T_DKIM_INVALID 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 D7EDAC21C3F; Fri, 10 May 2019 16:12:00 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 5B8C8C21E44; Fri, 10 May 2019 16:11:49 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) by lists.denx.de (Postfix) with ESMTPS id CB2BEC21DDC for ; Fri, 10 May 2019 16:11:45 +0000 (UTC) Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4AG6B1B014681; Fri, 10 May 2019 18:11:45 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=3cC7BlmTEJK0ldNWsplUN7k0RmT4KDvfrmGvV6AZzLQ=; b=bI+4s8Rpur66BdeIKbj04IqMgnoLuBr39jZyagBeLe2CRZcu0s4kSi+C0dn2JBO1RQDT oSCvUVHQwF9Dy4XsdNByVqS8L2LXWdahzzCfUdx3sdBb6K3+mAHUfjall5P2MWRApXFZ 8YmGMsCI6HCDznWV/Gg0bWHQXtHRbYgKTlCGGov8TyWD2rGvK3nauyLkG3CA9oVFTjvV QEj0k5oMXkVj9egUGo0bpgGJCRH70XnCfOn08sz9Khwtupk6K/VpmZXpnTJoW7h/SrGm 9l0dkARImAIJA1KVphbBME6bO8cYYrLJesh4+ej+SVEAZJu9ZcnwFXDJ7kn+gxhdt26K TA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2scbkajk3m-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 10 May 2019 18:11:45 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E8DF838; Fri, 10 May 2019 16:11:44 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag6node3.st.com [10.75.127.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D70C92C1E; Fri, 10 May 2019 16:11:44 +0000 (GMT) Received: from localhost (10.75.127.50) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 10 May 2019 18:11:44 +0200 From: Patrice Chotard To: Date: Fri, 10 May 2019 18:11:30 +0200 Message-ID: <1557504691-26188-14-git-send-email-patrice.chotard@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> References: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.50] X-ClientProxiedBy: SFHDAG8NODE3.st.com (10.75.127.24) To SFHDAG6NODE3.st.com (10.75.127.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-09_02:, , signatures=0 Cc: U-Boot STM32 Subject: [U-Boot] [PATCH 13/14] configs: stm32mp15: Enable ENV_IS_SPI_FLASH 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add all relative flags needed by ENV_IS_IN_SPI_FLASH Reserved a 256KB partition in NOR to save the U-Boot environment. Signed-off-by: Patrice Chotard --- configs/stm32mp15_basic_defconfig | 1 + configs/stm32mp15_trusted_defconfig | 1 + include/configs/stm32mp1.h | 7 ++++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/configs/stm32mp15_basic_defconfig b/configs/stm32mp15_basic_defconfig index e8f170d..93066aa 100644 --- a/configs/stm32mp15_basic_defconfig +++ b/configs/stm32mp15_basic_defconfig @@ -44,6 +44,7 @@ CONFIG_CMD_UBI=y CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1" CONFIG_ENV_IS_NOWHERE=y CONFIG_ENV_IS_IN_EXT4=y +CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_ENV_IS_IN_UBI=y CONFIG_ENV_EXT4_INTERFACE="mmc" CONFIG_ENV_EXT4_DEVICE_AND_PART="0:auto" diff --git a/configs/stm32mp15_trusted_defconfig b/configs/stm32mp15_trusted_defconfig index 61d4467..949b56a 100644 --- a/configs/stm32mp15_trusted_defconfig +++ b/configs/stm32mp15_trusted_defconfig @@ -36,6 +36,7 @@ CONFIG_CMD_UBI=y CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1" CONFIG_ENV_IS_NOWHERE=y CONFIG_ENV_IS_IN_EXT4=y +CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_ENV_IS_IN_UBI=y CONFIG_ENV_EXT4_INTERFACE="mmc" CONFIG_ENV_EXT4_DEVICE_AND_PART="0:auto" diff --git a/include/configs/stm32mp1.h b/include/configs/stm32mp1.h index e9bd551..f541132 100644 --- a/include/configs/stm32mp1.h +++ b/include/configs/stm32mp1.h @@ -47,6 +47,11 @@ #define CONFIG_ENV_UBI_VOLUME_REDUND "uboot_config_r" #endif +#if defined(CONFIG_ENV_IS_IN_SPI_FLASH) +#define CONFIG_ENV_SECT_SIZE SZ_256K +#define CONFIG_ENV_OFFSET 0x00280000 +#endif + /* ATAGs */ #define CONFIG_CMDLINE_TAG #define CONFIG_SETUP_MEMORY_TAGS @@ -119,7 +124,7 @@ #endif #define STM32MP_MTDPARTS \ - "mtdparts_nor0=256k(fsbl1),256k(fsbl2),2m(ssbl),-(nor_user)\0" \ + "mtdparts_nor0=256k(fsbl1),256k(fsbl2),2m(ssbl),256k(u-boot-env),-(nor_user)\0" \ "mtdparts_nand0=2m(fsbl),2m(ssbl),-(UBI)\0" /* From patchwork Fri May 10 16:11:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrice CHOTARD X-Patchwork-Id: 1098177 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=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="eo4RrNpo"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 450wPN0bRVz9sB8 for ; Sat, 11 May 2019 02:18:32 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id C9B9CC21E2F; Fri, 10 May 2019 16:14:01 +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=T_DKIM_INVALID 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 E9EEFC21E56; Fri, 10 May 2019 16:12:08 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id DEC4CC21C4A; Fri, 10 May 2019 16:11:49 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) by lists.denx.de (Postfix) with ESMTPS id 92D3BC21E30 for ; Fri, 10 May 2019 16:11:46 +0000 (UTC) Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4AFu5Ya032134; Fri, 10 May 2019 18:11:46 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=HNuU0wuFZtJD45b4D9yeh6CfzJWOdeABheMGAQjgifc=; b=eo4RrNpogT2o6KSI9psni5wJ8MptzoROUU3FKB7hU1HxMu5WiD8E7oc11z/eBdS6Mxhb HTwMY8k5gb5vFPp2MlNvcvjXc+J8LBtkU0PL4FjYnNgmwCUTkUCMy19ouz7slwDYvNaU FbFnLgNmeXuE7eaC+Iv1akaZuvgN2gbkfbt3dZ/Swmw+0o74hdayeae84mY9d3xH5LQs JkSeDJ1+GptW69JxrcESntu5yJtrtmP4HUjVPHp76vRokh4JXDbAnCv0YPuAf/hiEr20 9FVl/VOrlR0uZDe1XQV/dl1pIP9BDX5Fy+Dt4lnDPMuXZamvSJ5V7g517PTVtdm4vLr1 wQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2scdjpa2pe-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 10 May 2019 18:11:46 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A840C34; Fri, 10 May 2019 16:11:45 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag6node3.st.com [10.75.127.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 996792C20; Fri, 10 May 2019 16:11:45 +0000 (GMT) Received: from localhost (10.75.127.50) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 10 May 2019 18:11:45 +0200 From: Patrice Chotard To: Date: Fri, 10 May 2019 18:11:31 +0200 Message-ID: <1557504691-26188-15-git-send-email-patrice.chotard@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> References: <1557504691-26188-1-git-send-email-patrice.chotard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.50] X-ClientProxiedBy: SFHDAG7NODE2.st.com (10.75.127.20) To SFHDAG6NODE3.st.com (10.75.127.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-09_02:, , signatures=0 Cc: U-Boot STM32 Subject: [U-Boot] [PATCH 14/14] stm32mp1: Update env_get_location for NOR support 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Update env_get_location() to be able to save environment into NOR (SPI_FLASH). Signed-off-by: Patrice Chotard --- board/st/stm32mp1/stm32mp1.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c index 4f7d24a..af607c5 100644 --- a/board/st/stm32mp1/stm32mp1.c +++ b/board/st/stm32mp1/stm32mp1.c @@ -524,6 +524,10 @@ enum env_location env_get_location(enum env_operation op, int prio) case BOOT_FLASH_NAND: return ENVL_UBI; #endif +#ifdef CONFIG_ENV_IS_IN_SPI_FLASH + case BOOT_FLASH_NOR: + return ENVL_SPI_FLASH; +#endif default: return ENVL_NOWHERE; }