From patchwork Thu Dec 8 08:10:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick DELAUNAY X-Patchwork-Id: 1713599 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=foss.st.com header.i=@foss.st.com header.a=rsa-sha256 header.s=selector1 header.b=ZVeFoIo4; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NSRfr4k7Lz23yq for ; Thu, 8 Dec 2022 19:10:44 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CE7ED80705; Thu, 8 Dec 2022 09:10:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.com 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; unprotected) header.d=foss.st.com header.i=@foss.st.com header.b="ZVeFoIo4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 00F0A82AE2; Thu, 8 Dec 2022 09:10:38 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) (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 95DA7802E6 for ; Thu, 8 Dec 2022 09:10:33 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=834160706f=patrick.delaunay@foss.st.com Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B87GCRg015549; Thu, 8 Dec 2022 09:10:24 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=selector1; bh=xnhesvEBF9rWLHjF8CQCkE/J1MKZS0UXPh3XKktqL7c=; b=ZVeFoIo4FmmdPXt/GAv5G2PSDmHgkg1fIs71K6sM65GTbrcQ0a94lJEsxAJZojqEeczV Cxo7vqHRFWUIdUZstIRuzrWJ7Cp+ET5cTBb3oUn1CC9eBNUskajNXIy0+W3XLQnfbboh gPB8UquHsdKF8HNKvRztIZujV/ixnSNTwy8zBexyK/jTaJ6Px7P43ZmklovPrqfKdBbi KoXsYqn6r+bfLtZlqJjOwlnfLLmb0FY13syw+BbK4X02sPZHbeiYHuWJbdcueZ3A8Y43 ftz0eflCeWfKQq47h7HCVY3735gBLiMehFezIujyOhZHYKE06mbYVmKjBWU0eXQDO4yX Bw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3m7vff5u7x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Dec 2022 09:10:24 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id CE1DB100034; Thu, 8 Dec 2022 09:10:18 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 5E6E3216ECF; Thu, 8 Dec 2022 09:10:18 +0100 (CET) Received: from localhost (10.48.0.157) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.13; Thu, 8 Dec 2022 09:10:15 +0100 From: Patrick Delaunay To: CC: Patrick Delaunay , Ashok Reddy Soma , Heinrich Schuchardt , Ilias Apalodimas , Masahisa Kojima , Ovidiu Panait , =?utf-8?q?Pali_Roh=C3=A1r?= , Simon Glass , U-Boot STM32 Subject: [PATCH] cmd: mtdparts: add SYS_MTDPARTS_RUNTIME dependency on CONFIG_MTDIDS/MTDPARTS_DEFAULT Date: Thu, 8 Dec 2022 09:10:13 +0100 Message-ID: <20221208091010.1.I87acf9c65e708df1d5a45a57ce8508a14dfeb6a6@changeid> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.48.0.157] X-ClientProxiedBy: SHFCAS1NODE2.st.com (10.75.129.73) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-08_04,2022-12-07_01,2022-06-22_01 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.6 at phobos.denx.de X-Virus-Status: Clean The two configuration CONFIG_MTDIDS_DEFAULT and CONFIG_MTDPARTS_DEFAULT are not needed with mtd configuration CONFIG_SYS_MTDPARTS_RUNTIME which allows the MTDIDS and MTDPARTS to be configured at runtime. This patch has no defconfig impacts because CONFIG_SYS_MTDPARTS_RUNTIME is only used by two platforms (stm32mp and igep00x0) which don't define CONFIG_MTDIDS_DEFAULT or CONFIG_MTDPARTS_DEFAULT. This patch solves an UBI environment load issue for NAND boot for stm32mp15 platform. In mtd_uboot.c, when GD_FLG_ENV_READY is not set, env_get_f() return a EMPTY string, define in default_environment[] because CONFIG_MTDIDS_DEFAULT="" and CONFIG_MTDPARTS_DEFAULT="", but a NULL pointer is expected to allow call of board_mtdparts_default. Without mtdparts, the env partition [CONFIG_ENV_UBI_PART="UBI"] is not found in env/ubi.c [CONFIG_ENV_IS_IN_UBI]. It is not a problem when env becomes ready, as these empty variables are removed form U-Boot environment in env_import() / himport_r(). Fixes: a331017c237c ("Complete migration of MTDPARTS_DEFAULT / MTDIDS_DEFAULT, include in environment") Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- cmd/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/Kconfig b/cmd/Kconfig index d93731f2af68..cae6ed22fcd1 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -2535,6 +2535,7 @@ config CMD_MTDPARTS_SHOW_NET_SIZES config MTDIDS_DEFAULT string "Default MTD IDs" depends on MTD || SPI_FLASH + depends on !SYS_MTDPARTS_RUNTIME help Defines a default MTD IDs list for use with MTD partitions in the Linux MTD command line partitions format. @@ -2542,6 +2543,7 @@ config MTDIDS_DEFAULT config MTDPARTS_DEFAULT string "Default MTD partition scheme" depends on MTD || SPI_FLASH + depends on !SYS_MTDPARTS_RUNTIME help Defines a default MTD partitioning scheme in the Linux MTD command line partitions format