From patchwork Thu Jun 8 15:16:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 1792359 X-Patchwork-Delegate: patrice.chotard@st.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=zZpoA9b9; 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 4QcSVq6BVbz20Wn for ; Fri, 9 Jun 2023 01:17:07 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2C812860F4; Thu, 8 Jun 2023 17:17:01 +0200 (CEST) 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="zZpoA9b9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BB7D9860F2; Thu, 8 Jun 2023 17:16:59 +0200 (CEST) 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) (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 A582C86103 for ; Thu, 8 Jun 2023 17:16:55 +0200 (CEST) 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=45235c3c9f=patrick.delaunay@foss.st.com Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 358Dj5Km007671; Thu, 8 Jun 2023 17:16:54 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=RxwyA9nk2yq3JdBYLWpKZpxRSuZz897/KF25PGY8e6c=; b=zZpoA9b9MAAsZe+Zi3riNrUUlyVoEzdeDyvHpoTUKUEOc8xP0j7neLU4UJUrdnTzOUKv 2/KSRI1c6tNXa1QHKuvq4/puvBigYXSzF/PyGIHs9IiuhprXnV813U+31U7NwP4zHxyU op5Zq1oNmy87zx5/Yk8GEcpV+hlDNiFjwGdsavY2RdFMfW1nUr7ZE0chzY2540mZcEb9 V/MNTqbzzM2BKsO+uN7DJUzKN24fD9Av2KXoGiso9+GUwFWB8iVU5S3ZPAlyIJ32kGtT AZn6HOymM6jqiUxcHtq0mcbOzHyKB8fMG2p4xwf7iQE6xYWZOkYXFYhYflGaVinIav+r uw== 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 3r3cax2aht-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jun 2023 17:16:54 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 5166D10003D; Thu, 8 Jun 2023 17:16:54 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 4BD3621A231; Thu, 8 Jun 2023 17:16:54 +0200 (CEST) Received: from localhost (10.48.1.0) 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.21; Thu, 8 Jun 2023 17:16:53 +0200 From: Patrick Delaunay To: CC: Marek Vasut , Patrick Delaunay , Simon Glass , U-Boot STM32 Subject: [PATCH 01/12] fdt_support: include dm/ofnode.h Date: Thu, 8 Jun 2023 17:16:37 +0200 Message-ID: <20230608171614.1.I21f10cd5db605f5c0fbdfd04328958518fa508aa@changeid> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230608151648.992505-1-patrick.delaunay@foss.st.com> References: <20230608151648.992505-1-patrick.delaunay@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.48.1.0] X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-08_11,2023-06-08_01,2023-05-22_02 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.8 at phobos.denx.de X-Virus-Status: Clean This patch is a preliminary patch to use ofnode function is fdt_support to read the U-Boot device tree with livetree compatible functions. Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard Reviewed-by: Simon Glass --- common/fdt_support.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/fdt_support.c b/common/fdt_support.c index 2053fe3bad83..ffc59fd8b36a 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -1065,7 +1066,6 @@ void fdt_del_node_and_alias(void *blob, const char *alias) /* Max address size we deal with */ #define OF_MAX_ADDR_CELLS 4 -#define OF_BAD_ADDR FDT_ADDR_T_NONE #define OF_CHECK_COUNTS(na, ns) ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS && \ (ns) > 0) From patchwork Thu Jun 8 15:16:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 1792363 X-Patchwork-Delegate: patrice.chotard@st.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=85.214.62.61; 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=TOCBdEKa; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4QcSWK57YFz20Wn for ; Fri, 9 Jun 2023 01:17:33 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EFC6386130; Thu, 8 Jun 2023 17:17:07 +0200 (CEST) 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="TOCBdEKa"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7CD61860F2; Thu, 8 Jun 2023 17:17:01 +0200 (CEST) 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) (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 73A2C86114 for ; Thu, 8 Jun 2023 17:16:56 +0200 (CEST) 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=45235c3c9f=patrick.delaunay@foss.st.com Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 358DknaI007652; Thu, 8 Jun 2023 17:16:55 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=KJ0GX8aAS3OpXqiHs6peGLW7b1JGR0nDkos6ZKtj2Sw=; b=TOCBdEKaoEV0dr1XnKm01gPZCSVvHQZl3kj3cf2FbAhSWGzYZm3aSuUXzhljylFbPa5d KddgZGNIg+EZtKkQQuDfwtu/RwYscA5IjMq0UO16OsjXIaUqKuuE7IrJhXB62+hjU8Z4 ESWTvBkT+nubaxAFnhv7b2czXlDzw9m6SMIO903Reog2B3T1bIgOosliTttWFVNqt03k JVgewEecJln3Kvp3rTbkfXsauE2c1Fpls1vjOQCI2cN257R5NaxC5ErxqQfih6jcAxvj GNrjzjC0vxOEkdejLDWQFXoS/GmhtjYP62AUFmptE6mPXfzNz5HLBmCIIwGsRAGutr32 Eg== 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 3r3cax2ahw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jun 2023 17:16:55 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 16ED710003A; Thu, 8 Jun 2023 17:16:55 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 10F4F21A231; Thu, 8 Jun 2023 17:16:55 +0200 (CEST) Received: from localhost (10.48.1.0) 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.21; Thu, 8 Jun 2023 17:16:54 +0200 From: Patrick Delaunay To: CC: Marek Vasut , Patrick Delaunay , Simon Glass , U-Boot STM32 Subject: [PATCH 02/12] fdt_support: add fdt_copy_fixed_partitions function Date: Thu, 8 Jun 2023 17:16:38 +0200 Message-ID: <20230608171614.2.Idd521a274f1b0524963a501324a1702a5a8b52c1@changeid> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230608151648.992505-1-patrick.delaunay@foss.st.com> References: <20230608151648.992505-1-patrick.delaunay@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.48.1.0] X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-08_11,2023-06-08_01,2023-05-22_02 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.8 at phobos.denx.de X-Virus-Status: Clean Add a new function fdt_copy_fixed_partitions to copy the fixed partition nodes from U-Boot device tree to Linux kernel device tree and to dynamically configure the MTD partitions. This function fdt_copy_fixed_partitions is only based on device tree with livetree compatible function and replace the function fdt_fixup_mtdparts based on mtdparts variable. Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- common/fdt_support.c | 73 +++++++++++++++++++++++++++++++++++++++++++ include/fdt_support.h | 8 +++++ 2 files changed, 81 insertions(+) diff --git a/common/fdt_support.c b/common/fdt_support.c index ffc59fd8b36a..5e49078f8c35 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -1051,6 +1051,79 @@ void fdt_fixup_mtdparts(void *blob, const struct node_info *node_info, } #endif +int fdt_copy_fixed_partitions(void *blob) +{ + ofnode node, subnode; + int off, suboff, res; + char path[256]; + int address_cells, size_cells; + u8 i, j, child_count; + + node = ofnode_by_compatible(ofnode_null(), "fixed-partitions"); + while (ofnode_valid(node)) { + /* copy the U-Boot fixed partition */ + address_cells = ofnode_read_simple_addr_cells(node); + size_cells = ofnode_read_simple_size_cells(node); + + res = ofnode_get_path(ofnode_get_parent(node), path, sizeof(path)); + if (res) + return res; + + off = fdt_path_offset(blob, path); + if (off < 0) + return -ENODEV; + + off = fdt_find_or_add_subnode(blob, off, "partitions"); + res = fdt_setprop_string(blob, off, "compatible", "fixed-partitions"); + if (res) + return res; + + res = fdt_setprop_u32(blob, off, "#address-cells", address_cells); + if (res) + return res; + + res = fdt_setprop_u32(blob, off, "#size-cells", size_cells); + if (res) + return res; + + /* + * parse partition in reverse order as fdt_find_or_add_subnode() only + * insert the new node after the parent's properties + */ + child_count = ofnode_get_child_count(node); + for (i = child_count; i > 0 ; i--) { + subnode = ofnode_first_subnode(node); + if (!ofnode_valid(subnode)) + break; + + for (j = 0; (j < i - 1); j++) + subnode = ofnode_next_subnode(subnode); + + if (!ofnode_valid(subnode)) + break; + + const u32 *reg; + int len; + + suboff = fdt_find_or_add_subnode(blob, off, ofnode_get_name(subnode)); + res = fdt_setprop_string(blob, suboff, "label", + ofnode_read_string(subnode, "label")); + if (res) + return res; + + reg = ofnode_get_property(subnode, "reg", &len); + res = fdt_setprop(blob, suboff, "reg", reg, len); + if (res) + return res; + } + + /* go to next fixed-partitions node */ + node = ofnode_by_compatible(node, "fixed-partitions"); + } + + return 0; +} + void fdt_del_node_and_alias(void *blob, const char *alias) { int off = fdt_path_offset(blob, alias); diff --git a/include/fdt_support.h b/include/fdt_support.h index eeb83e6251d3..2cd836689821 100644 --- a/include/fdt_support.h +++ b/include/fdt_support.h @@ -256,6 +256,14 @@ static inline void fdt_fixup_mtdparts(void *fdt, } #endif +/** + * copy the fixed-partition nodes from U-Boot device tree to external blob + * + * @param blob FDT blob to update + * Return: 0 if ok, or non-zero on error + */ +int fdt_copy_fixed_partitions(void *blob); + void fdt_del_node_and_alias(void *blob, const char *alias); /** From patchwork Thu Jun 8 15:16:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 1792362 X-Patchwork-Delegate: patrice.chotard@st.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=6HkY993C; 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 4QcSW44lF0z20Wn for ; Fri, 9 Jun 2023 01:17:20 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0985C86119; Thu, 8 Jun 2023 17:17:06 +0200 (CEST) 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="6HkY993C"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 71FC1860CF; Thu, 8 Jun 2023 17:17:00 +0200 (CEST) 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,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) (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 39F16860CF for ; Thu, 8 Jun 2023 17:16:57 +0200 (CEST) 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=45235c3c9f=patrick.delaunay@foss.st.com Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 358BIteA013526; Thu, 8 Jun 2023 17:16:56 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=Al7KWB2Ba8wm9Np5nS+4Cxx1tUNrvHcc0/0AE1r8e+E=; b=6HkY993C5+GxvJyWtkivYn3+fviZfJqpwmWnOeMzdTMLRhyntbYwKS8/SDq5LCPqol61 KshEuZy+VAOf1NejKXsomF8mmPi+OGPkIox61zvaCdA9aY4wnG0sDl8DzOLmc1WN/ZCc xjHLyigDuc53opNRI00Oisbzbr2qKn1+4u5Nt2Wiv3ziZMVpUZ64xn5M2zBfD7Ex82lH jx4/iODx6ngSa8RtSQ5Tb+2XqbA++f6qz1LkLS8DWO/2hGzOO6l+qc+Pgg6tcvd1v4yb 2oyd9pfh7y+SX5y5qJqdwdj5j1al8Fj9veQLKGLgKD+Avq+uiLq6SIWlDSRCUkC3QUy5 VQ== 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 3r3atmb3j3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jun 2023 17:16:56 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id C680010003B; Thu, 8 Jun 2023 17:16:55 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id C09F221A231; Thu, 8 Jun 2023 17:16:55 +0200 (CEST) Received: from localhost (10.48.1.0) 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.21; Thu, 8 Jun 2023 17:16:55 +0200 From: Patrick Delaunay To: CC: Marek Vasut , Patrick Delaunay , Lukasz Majewski , U-Boot STM32 Subject: [PATCH 03/12] dfu: mtd: remove direct call of mtdparts_init function Date: Thu, 8 Jun 2023 17:16:39 +0200 Message-ID: <20230608171614.3.I620daeba9c6dbeed0f0164229d65403d36291bb1@changeid> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230608151648.992505-1-patrick.delaunay@foss.st.com> References: <20230608151648.992505-1-patrick.delaunay@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.48.1.0] X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-08_11,2023-06-08_01,2023-05-22_02 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.8 at phobos.denx.de X-Virus-Status: Clean With MTD support in driver model, the direct call of mtdparts_init should be avoided and replaced by mtd_probe_devices. With the modificaton when MTDIDS/MTDPARTS are empty the OF fallback with partition describe in device tree is correctly performed, introduced by commit dc339bf784f0 ("mtd: add support for parsing partitions defined in OF"). With this patch the dependency with CONFIG_CMD_MTDPARTS is removed. Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- drivers/dfu/Kconfig | 1 - drivers/dfu/dfu_mtd.c | 34 +++++++++++++++++++--------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/drivers/dfu/Kconfig b/drivers/dfu/Kconfig index 8d7f13dcb0b5..c3a0b93b25e0 100644 --- a/drivers/dfu/Kconfig +++ b/drivers/dfu/Kconfig @@ -41,7 +41,6 @@ config DFU_MMC config DFU_MTD bool "MTD back end for DFU" depends on DM_MTD - depends on CMD_MTDPARTS help This option enables using DFU to read and write to on any MTD device. diff --git a/drivers/dfu/dfu_mtd.c b/drivers/dfu/dfu_mtd.c index c7075f12eca9..75e2f6a42151 100644 --- a/drivers/dfu/dfu_mtd.c +++ b/drivers/dfu/dfu_mtd.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include @@ -275,7 +274,7 @@ int dfu_fill_entity_mtd(struct dfu_entity *dfu, char *devstr, char **argv, int a { char *s; struct mtd_info *mtd; - int ret, part; + int part; mtd = get_mtd_device_nm(devstr); if (IS_ERR_OR_NULL(mtd)) @@ -299,10 +298,9 @@ int dfu_fill_entity_mtd(struct dfu_entity *dfu, char *devstr, char **argv, int a if (*s) return -EINVAL; } else if ((!strcmp(argv[0], "part")) || (!strcmp(argv[0], "partubi"))) { - char mtd_id[32]; - struct mtd_device *mtd_dev; - u8 part_num; - struct part_info *pi; + struct mtd_info *partition; + int partnum = 0; + bool part_found = false; if (argc != 2) return -EINVAL; @@ -313,19 +311,25 @@ int dfu_fill_entity_mtd(struct dfu_entity *dfu, char *devstr, char **argv, int a if (*s) return -EINVAL; - sprintf(mtd_id, "%s,%d", devstr, part - 1); - printf("using id '%s'\n", mtd_id); + /* register partitions with MTDIDS/MTDPARTS or OF fallback */ + mtd_probe_devices(); - mtdparts_init(); - - ret = find_dev_and_part(mtd_id, &mtd_dev, &part_num, &pi); - if (ret != 0) { - printf("Could not locate '%s'\n", mtd_id); + partnum = 0; + list_for_each_entry(partition, &mtd->partitions, node) { + partnum++; + if (partnum == part) { + part_found = true; + break; + } + } + if (!part_found) { + printf("No partition %d in %s\n", part, mtd->name); return -1; } + log_debug("partition %d:%s in %s\n", partnum, partition->name, mtd->name); - dfu->data.mtd.start = pi->offset; - dfu->data.mtd.size = pi->size; + dfu->data.mtd.start = partition->offset; + dfu->data.mtd.size = partition->size; if (!strcmp(argv[0], "partubi")) dfu->data.mtd.ubi = 1; } else { From patchwork Thu Jun 8 15:16:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 1792366 X-Patchwork-Delegate: patrice.chotard@st.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=dcIKOWJX; 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 4QcSWv1f6fz20Wn for ; Fri, 9 Jun 2023 01:18:03 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6DA158611C; Thu, 8 Jun 2023 17:17:12 +0200 (CEST) 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="dcIKOWJX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 877D88611C; Thu, 8 Jun 2023 17:17:10 +0200 (CEST) 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 8106686122 for ; Thu, 8 Jun 2023 17:17:07 +0200 (CEST) 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=45235c3c9f=patrick.delaunay@foss.st.com Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 358EAHFa029938; Thu, 8 Jun 2023 17:17:04 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=JC81Y2lFLyn8BI+0MMnNj9VGU9TQGH4vnW2OKUK33Z4=; b=dcIKOWJXH8YFHH7Kw3G+5cYoBmPYQ80H97RMbulPzCV0lXpHjoOsFRX5XmbmK5UB5aNV Ph3xPbDkvrKDszPI6fDN6mJnIkAx/i1323BD5bFTXoS7g8RrEs+AAPLERqnqQussxbqE 4p0BBJ6NnenoRypuRUvtouJvejM7/S7YGjqUU8gGgHJfkDzGe/QpAhKqFlwPjsJl54sI 6BU7/r+V+tsEHY7oIpwnGNioe5sSA5y1xCWPGfJvBh0XPTiYkwDMAEreriuV6/FQWaV0 tdB2/REacjDqD/c5leyyhpU/Eu44wOmuwhvUwtJ57B7XVs2StaTvWOOpVlPNrpYwLZQ6 UQ== 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 3r3ggygdw6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jun 2023 17:17:04 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id EB5DB10003A; Thu, 8 Jun 2023 17:16:56 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id E59DB21A231; Thu, 8 Jun 2023 17:16:56 +0200 (CEST) Received: from localhost (10.48.1.0) 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.21; Thu, 8 Jun 2023 17:16:56 +0200 From: Patrick Delaunay To: CC: Marek Vasut , Patrice Chotard , Patrick Delaunay , Simon Glass , U-Boot STM32 Subject: [PATCH 04/12] stm32mp: stm32prog: Remove usage of "mtdparts" function Date: Thu, 8 Jun 2023 17:16:40 +0200 Message-ID: <20230608171614.4.Ib033df552a0517a23e3fa74a4468ec5126775e93@changeid> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230608151648.992505-1-patrick.delaunay@foss.st.com> References: <20230608151648.992505-1-patrick.delaunay@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.48.1.0] X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-08_11,2023-06-08_01,2023-05-22_02 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.8 at phobos.denx.de X-Virus-Status: Clean From: Patrice Chotard Motivation for this patch is to remove usage of function define in cmd/mtdparts.c interface, based on env variables mtdids and mtdparts: mtdparts_init() and find_dev_and_part(). See commit 938db6fe5da3 ("cmd: mtdparts: describe as legacy") Now, all MTD devices are populated with their partition's information found in DT, accessible in MTD devices. Use these information to find the wanted partitions, no more need of find_dev_and_part() usage. Signed-off-by: Patrice Chotard Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- .../mach-stm32mp/cmd_stm32prog/stm32prog.c | 42 +++++++++---------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c index 6f3641ccf57b..241ad40abb7c 100644 --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c @@ -208,11 +208,6 @@ static int optee_ta_invoke(struct stm32prog_data *data, int cmd, int type, return rc; } -/* partition handling routines : CONFIG_CMD_MTDPARTS */ -int mtdparts_init(void); -int find_dev_and_part(const char *id, struct mtd_device **dev, - u8 *part_num, struct part_info **part); - char *stm32prog_get_error(struct stm32prog_data *data) { static const char error_msg[] = "Unspecified"; @@ -741,6 +736,7 @@ static int init_device(struct stm32prog_data *data, struct mmc *mmc = NULL; struct blk_desc *block_dev = NULL; struct mtd_info *mtd = NULL; + struct mtd_info *partition; char mtd_id[16]; int part_id; int ret; @@ -749,6 +745,7 @@ static int init_device(struct stm32prog_data *data, u64 part_addr, part_size; bool part_found; const char *part_name; + u8 i; switch (dev->target) { case STM32PROG_MMC: @@ -793,10 +790,11 @@ static int init_device(struct stm32prog_data *data, stm32prog_err("unknown device type = %d", dev->target); return -ENODEV; } + /* register partitions with MTDIDS/MTDPARTS or OF fallback */ + mtd_probe_devices(); get_mtd_by_target(mtd_id, dev->target, dev->dev_id); log_debug("%s\n", mtd_id); - mtdparts_init(); mtd = get_mtd_device_nm(mtd_id); if (IS_ERR(mtd)) { stm32prog_err("MTD device %s not found", mtd_id); @@ -943,25 +941,23 @@ static int init_device(struct stm32prog_data *data, } if (IS_ENABLED(CONFIG_MTD) && mtd) { - char mtd_part_id[32]; - struct part_info *mtd_part; - struct mtd_device *mtd_dev; - u8 part_num; - - sprintf(mtd_part_id, "%s,%d", mtd_id, - part->part_id - 1); - ret = find_dev_and_part(mtd_part_id, &mtd_dev, - &part_num, &mtd_part); - if (ret != 0) { - stm32prog_err("%s (0x%x): Invalid MTD partition %s", - part->name, part->id, - mtd_part_id); + i = 0; + list_for_each_entry(partition, &mtd->partitions, node) { + if ((part->part_id - 1) == i) { + part_found = true; + break; + } + i++; + } + if (part_found) { + part_addr = partition->offset; + part_size = partition->size; + part_name = partition->name; + } else { + stm32prog_err("%s (0x%x):Couldn't find part %d on device mtd %s", + part->name, part->id, part->part_id, mtd_id); return -ENODEV; } - part_addr = mtd_part->offset; - part_size = mtd_part->size; - part_name = mtd_part->name; - part_found = true; } /* no partition for this device */ From patchwork Thu Jun 8 15:16:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 1792367 X-Patchwork-Delegate: patrice.chotard@st.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=pEjAv/Lb; 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 4QcSXB1402z20Wn for ; Fri, 9 Jun 2023 01:18:18 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 73EBD860F4; Thu, 8 Jun 2023 17:18:05 +0200 (CEST) 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="pEjAv/Lb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9BCF5860F1; Thu, 8 Jun 2023 17:18:02 +0200 (CEST) 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) (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 3729E86149 for ; Thu, 8 Jun 2023 17:17:59 +0200 (CEST) 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=45235c3c9f=patrick.delaunay@foss.st.com Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 358BLsYv013849; Thu, 8 Jun 2023 17:17:58 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=T8nYlJbnOiHzq7+bmRLsh70CbPqn+oVlEXHMsXfXvVI=; b=pEjAv/Lbvaah6OFDL2AXGPACoFqOtATSBnymvmKAs6S0Iw7WRcEcL3DmPQpJdkbLea+Z 991bVoj4uE98GO9SdO1EIpiEaGjNMDpLJimtxUIXZuMbaSJoGAvPERe2rlLTw2s5bdop 2RgJaFzqtnSznHD5xlvaC6VFlX6/IxIxo1xGm/usY/sHpnZrU1j+6tpLPsaArQMvukBN Af1qawd6ANkU2l0EuiwqR7vznxjdTV4Wdiicmqgt126192833kkWV5pzyPPKOWC+ENP3 1yd4Xyqc/ITadj0QYyycPkbLYANrEnRWDxLIfeO04+ebpgY2aZjOXAEOwD+Doa1kQfj9 BQ== 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 3r3atmb3ue-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jun 2023 17:17:58 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id AB8AC10002A; Thu, 8 Jun 2023 17:17:57 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id A4D7821B507; Thu, 8 Jun 2023 17:17:57 +0200 (CEST) Received: from localhost (10.48.1.0) 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.21; Thu, 8 Jun 2023 17:17:57 +0200 From: Patrick Delaunay To: CC: Marek Vasut , Patrick Delaunay , Patrice Chotard , Tom Rini , U-Boot STM32 Subject: [PATCH 05/12] arm: dts: stm32: Align stm32mp15xx-*-scmi-u-boot.dtsi file Date: Thu, 8 Jun 2023 17:16:41 +0200 Message-ID: <20230608171614.5.I06644b2492806114746756df78585e311967e3bc@changeid> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230608151648.992505-1-patrick.delaunay@foss.st.com> References: <20230608151648.992505-1-patrick.delaunay@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.48.1.0] X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-08_11,2023-06-08_01,2023-05-22_02 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.8 at phobos.denx.de X-Virus-Status: Clean Update "secure" version of STM32 boards based on SCMI when RCC_TZCR.TZEN=1 stm32mp15xx-*-scmi-u-boot.dtsi with latest patches on files stm32mp15xx-*-u-boot.dtsi. Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi | 1 + arch/arm/dts/stm32mp157c-dk2-scmi-u-boot.dtsi | 7 ++++ arch/arm/dts/stm32mp157c-ev1-scmi-u-boot.dtsi | 40 +++++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi b/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi index cff3f49948e4..2623cebf21a4 100644 --- a/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi @@ -12,6 +12,7 @@ i2c3 = &i2c4; usb0 = &usbotg_hs; }; + config { u-boot,boot-led = "heartbeat"; u-boot,error-led = "error"; diff --git a/arch/arm/dts/stm32mp157c-dk2-scmi-u-boot.dtsi b/arch/arm/dts/stm32mp157c-dk2-scmi-u-boot.dtsi index 5a8fc15ab2b7..ae93497cd5a8 100644 --- a/arch/arm/dts/stm32mp157c-dk2-scmi-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157c-dk2-scmi-u-boot.dtsi @@ -4,3 +4,10 @@ */ #include "stm32mp157a-dk1-scmi-u-boot.dtsi" + +/ { + fwu-mdata { + compatible = "u-boot,fwu-mdata-gpt"; + fwu-mdata-store = <&sdmmc1>; + }; +}; diff --git a/arch/arm/dts/stm32mp157c-ev1-scmi-u-boot.dtsi b/arch/arm/dts/stm32mp157c-ev1-scmi-u-boot.dtsi index 71a94f9130a6..eef717946b5f 100644 --- a/arch/arm/dts/stm32mp157c-ev1-scmi-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157c-ev1-scmi-u-boot.dtsi @@ -14,4 +14,44 @@ spi0 = &qspi; usb0 = &usbotg_hs; }; + + fwu-mdata { + compatible = "u-boot,fwu-mdata-gpt"; + fwu-mdata-store = <&sdmmc1>; + }; +}; + +&flash0 { + bootph-pre-ram; +}; + +&qspi { + bootph-pre-ram; +}; + +&qspi_clk_pins_a { + bootph-pre-ram; + pins { + bootph-pre-ram; + }; +}; + +&qspi_bk1_pins_a { + bootph-pre-ram; + pins1 { + bootph-pre-ram; + }; + pins2 { + bootph-pre-ram; + }; +}; + +&qspi_bk2_pins_a { + bootph-pre-ram; + pins1 { + bootph-pre-ram; + }; + pins2 { + bootph-pre-ram; + }; }; From patchwork Thu Jun 8 15:16:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 1792368 X-Patchwork-Delegate: patrice.chotard@st.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=A8ICLb6X; 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 4QcSXR5BvGz20Wn for ; Fri, 9 Jun 2023 01:18:31 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 80BF886140; Thu, 8 Jun 2023 17:18:08 +0200 (CEST) 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="A8ICLb6X"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6FDAB860C3; Thu, 8 Jun 2023 17:18:04 +0200 (CEST) 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) (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 C4CEE8471B for ; Thu, 8 Jun 2023 17:17:59 +0200 (CEST) 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=45235c3c9f=patrick.delaunay@foss.st.com Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 358BIteU013526; Thu, 8 Jun 2023 17:17:58 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=J2fRyzU272Zbs81DWeJWF8VLxllod4Ed+epO6GdpQWA=; b=A8ICLb6X5PZAFCpywOgojbdYwlurNG5TnPrQI3pFwgayPE6AbZASFMEubhWe1bJRRDB1 6YoCgb1A10E+IdcflxL8HB5JS3HpyJGH119cnbBWpI9PrFznM/bcZK9FinvR4XORlzYS uEL8ph0cqekZftFQKVhFpbDKOG+qnlAEghfNlfMsqyU6f1m2dhOsYCTE3IWIHtNFzIlZ 3dEJi8zMu3W+GXwmWk0tHO2sQ2QwNIGbJFJBBbVvc5PGD6+498AFP9JK2oH8mAhxg9TL Bo3QP8MBVC54+WloZh1Apj7ZXlgFjWZTqLkcfqnFXGG4274OlOk27bf7UZ1/YnO3abKM Vg== 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 3r3atmb3ug-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jun 2023 17:17:58 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 6471C10003A; Thu, 8 Jun 2023 17:17:58 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 5D4F921B507; Thu, 8 Jun 2023 17:17:58 +0200 (CEST) Received: from localhost (10.48.1.0) 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.21; Thu, 8 Jun 2023 17:17:58 +0200 From: Patrick Delaunay To: CC: Marek Vasut , Patrice Chotard , Patrick Delaunay , Tom Rini , U-Boot STM32 Subject: [PATCH 06/12] arm: dts: stm32: Add partitions in flash0 and nand node for stm32mp15xx-ev1 Date: Thu, 8 Jun 2023 17:16:42 +0200 Message-ID: <20230608171614.6.Ic6e6157ff0175b60d31738882e11485ea60b8b61@changeid> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230608151648.992505-1-patrick.delaunay@foss.st.com> References: <20230608151648.992505-1-patrick.delaunay@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.48.1.0] X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-08_11,2023-06-08_01,2023-05-22_02 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.8 at phobos.denx.de X-Virus-Status: Clean From: Patrice Chotard Add partitions subnode in flash0 and nand nodes for all stm32mp157xx-ev1 boards. Update only the file stm32mp157c-ev1-*u-boot.dtsi, included by other files stm32mp15*-ev1-*-u-boot.dtsi. For SCMI variant of device tree used with stm32mp15_defconfig add partitions needed by TF-A firmware update: - metadata to save the TF-A information: 2 copy - fip-a / fip-b: two FIP slots, used for system A/B (seamless) update - the previous "fsbl" partition with 2 copy of TFA is replaced by 2 partitions (only one copy in each MTD partition) to simplify the update: no need to managed this copy on update, need to update the two partition (skip bad block for NAND) The offset for ENV partition are also updated in stm32mp15_defconfig Signed-off-by: Patrick Delaunay Signed-off-by: Patrice Chotard Reviewed-by: Patrice Chotard --- arch/arm/dts/stm32mp157c-ev1-scmi-u-boot.dtsi | 85 ++++++++++++++++ arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi | 98 ++++++++++++++++++- configs/stm32mp15_defconfig | 4 +- 3 files changed, 184 insertions(+), 3 deletions(-) diff --git a/arch/arm/dts/stm32mp157c-ev1-scmi-u-boot.dtsi b/arch/arm/dts/stm32mp157c-ev1-scmi-u-boot.dtsi index eef717946b5f..9768db8de9c9 100644 --- a/arch/arm/dts/stm32mp157c-ev1-scmi-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157c-ev1-scmi-u-boot.dtsi @@ -23,6 +23,91 @@ &flash0 { bootph-pre-ram; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + partition@0 { + label = "fsbl1"; + reg = <0x00000000 0x00040000>; + }; + partition@40000 { + label = "fsbl2"; + reg = <0x00040000 0x00040000>; + }; + partition@80000 { + label = "metadata1"; + reg = <0x00080000 0x00040000>; + }; + partition@c0000 { + label = "metadata2"; + reg = <0x000c0000 0x00040000>; + }; + partition@100000 { + label = "fip-a"; + reg = <0x00100000 0x00400000>; + }; + partition@500000 { + label = "fip-b"; + reg = <0x00500000 0x00400000>; + }; + partition@900000 { + label = "u-boot-env"; + reg = <0x00900000 0x00080000>; + }; + partition@980000 { + label = "nor-user"; + reg = <0x00980000 0x03680000>; + }; + }; +}; + +&fmc { + nand-controller@4,0 { + nand@0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + partition@0 { + label = "fsbl1"; + reg = <0x00000000 0x00080000>; + }; + partition@80000 { + label = "fsbl2"; + reg = <0x00080000 0x00080000>; + }; + partition@100000 { + label = "metadata1"; + reg = <0x00100000 0x00080000>; + }; + partition@180000 { + label = "metadata2"; + reg = <0x00180000 0x00080000>; + }; + partition@200000 { + label = "fip-a1"; + reg = <0x00200000 0x00400000>; + }; + partition@600000 { + label = "fip-a2"; + reg = <0x00600000 0x00400000>; + }; + partition@a00000 { + label = "fip-b1"; + reg = <0x00a00000 0x00400000>; + }; + partition@e00000 { + label = "fip-b2"; + reg = <0x00e00000 0x00400000>; + }; + partition@1200000 { + label = "UBI"; + reg = <0x01200000 0x3ee00000>; + }; + }; + }; + }; }; &qspi { diff --git a/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi b/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi index cb32c30431c2..1f7fdbce5304 100644 --- a/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi @@ -23,6 +23,103 @@ &flash0 { bootph-pre-ram; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + +#if defined(CONFIG_STM32MP15x_STM32IMAGE) || defined(CONFIG_SPL) + partition@0 { + label = "fsbl1"; + reg = <0x00000000 0x00040000>; + }; + partition@80000 { + label = "fsbl2"; + reg = <0x00040000 0x00040000>; + }; + partition@100000 { + label = "ssbl"; + reg = <0x00080000 0x00200000>; + }; + partition@280000 { + label = "u-boot-env"; + reg = <0x00280000 0x00080000>; + }; + partition@300000 { + label = "nor-user"; + reg = <0x00300000 0x03d00000>; + }; +#else + partition@0 { + label = "fsbl1"; + reg = <0x00000000 0x00040000>; + }; + partition@40000 { + label = "fsbl2"; + reg = <0x00040000 0x00040000>; + }; + partition@100000 { + label = "fip"; + reg = <0x00080000 0x00400000>; + }; + partition@480000 { + label = "u-boot-env"; + reg = <0x00480000 0x00080000>; + }; + partition@500000 { + label = "nor-user"; + reg = <0x00500000 0x03b00000>; + }; +#endif + }; +}; + +&fmc { + nand-controller@4,0 { + nand@0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + +#if defined(CONFIG_STM32MP15x_STM32IMAGE) || defined(CONFIG_SPL) + partition@0 { + label = "fsbl"; + reg = <0x00000000 0x00200000>; + }; + partition@200000 { + label = "ssbl1"; + reg = <0x00200000 0x00200000>; + }; + partition@400000 { + label = "ssbl2"; + reg = <0x00400000 0x00200000>; + }; + partition@600000 { + label = "UBI"; + reg = <0x00600000 0x3fa00000>; + }; +#else + partition@0 { + label = "fsbl"; + reg = <0x00000000 0x00200000>; + }; + partition@200000 { + label = "fip1"; + reg = <0x00200000 0x00400000>; + }; + partition@600000 { + label = "fip2"; + reg = <0x00600000 0x00400000>; + }; + partition@1200000 { + label = "UBI"; + reg = <0x00a00000 0x3f600000>; + }; +#endif + }; + }; + }; }; &qspi { @@ -55,4 +152,3 @@ bootph-pre-ram; }; }; - diff --git a/configs/stm32mp15_defconfig b/configs/stm32mp15_defconfig index 2669aae0f2f4..bad5c32ef808 100644 --- a/configs/stm32mp15_defconfig +++ b/configs/stm32mp15_defconfig @@ -3,7 +3,7 @@ CONFIG_ARCH_STM32MP=y CONFIG_TFABOOT=y CONFIG_SYS_MALLOC_F_LEN=0x80000 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc0100000 -CONFIG_ENV_OFFSET=0x480000 +CONFIG_ENV_OFFSET=0x900000 CONFIG_ENV_SECT_SIZE=0x40000 CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1" CONFIG_SYS_PROMPT="STM32MP> " @@ -11,7 +11,7 @@ CONFIG_DDR_CACHEABLE_SIZE=0x10000000 CONFIG_CMD_STM32KEY=y CONFIG_TYPEC_STUSB160X=y CONFIG_TARGET_ST_STM32MP15x=y -CONFIG_ENV_OFFSET_REDUND=0x4C0000 +CONFIG_ENV_OFFSET_REDUND=0x940000 CONFIG_CMD_STM32PROG=y # CONFIG_ARMV7_NONSEC is not set CONFIG_SYS_LOAD_ADDR=0xc2000000 From patchwork Thu Jun 8 15:16:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 1792369 X-Patchwork-Delegate: patrice.chotard@st.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=Pma9GFiE; 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 4QcSXj1KClz20Wn for ; Fri, 9 Jun 2023 01:18:45 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6D4A686152; Thu, 8 Jun 2023 17:18:10 +0200 (CEST) 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="Pma9GFiE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8026D8471C; Thu, 8 Jun 2023 17:18:05 +0200 (CEST) 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,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) (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 9FE0F860EA for ; Thu, 8 Jun 2023 17:18:00 +0200 (CEST) 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=45235c3c9f=patrick.delaunay@foss.st.com Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 358Dj5L6007671; Thu, 8 Jun 2023 17:18:00 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=olUVwsnPsno49W65CpWTMgTE93iQ31OBghm6c27gucA=; b=Pma9GFiEgDU1hQ3vNHyjlp4vI7khqq/sQ0GBQ8HwTqLvrAaki7NIjDhcjcQWexOL2Dlj n+zK1LF5J6zB81egwwc6vcTmVTKNuskCiM4U5JRqBrUkVHSVQH2lz1g3FVaeHxTYi0Wj voYAZ1LhmicSnWeR+ZWWRnZI+k9mFcTFKwidibSnNC+V5n2yWcm29TZEjp32MbnKdhMp c2jlOuC99CniH2PaeMyFlxqMhCJ0j8UnAwsfe094pWN0+mXHH3q0srl+ElU23Z3EjLrn fdQIzXScq/nc5gdmGNeZnaFjqv9LYSL4kYaTe2P0TDVfv3vP/kxPYIhVXK5Q1VnzuUHT rA== 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 3r3cax2aut-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jun 2023 17:18:00 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 53CCC10002A; Thu, 8 Jun 2023 17:17:59 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 4E13121B507; Thu, 8 Jun 2023 17:17:59 +0200 (CEST) Received: from localhost (10.48.1.0) 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.21; Thu, 8 Jun 2023 17:17:59 +0200 From: Patrick Delaunay To: CC: Marek Vasut , Patrice Chotard , Patrick Delaunay , U-Boot STM32 Subject: [PATCH 07/12] configs: stm32mp: Disable SYS_MTDPARTS_RUNTIME for stm32mp15 and stm32mp13 Date: Thu, 8 Jun 2023 17:16:43 +0200 Message-ID: <20230608171614.7.I26c6ed678ca158380032e3a31fc6b3a77ef6a33f@changeid> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230608151648.992505-1-patrick.delaunay@foss.st.com> References: <20230608151648.992505-1-patrick.delaunay@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.48.1.0] X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-08_11,2023-06-08_01,2023-05-22_02 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.8 at phobos.denx.de X-Virus-Status: Clean From: Patrice Chotard As we don't use anymore MTDPARTS_xx Kconfig variables (MTDPARTS_NAND0_BOOT, MTDPARTS_NOR0_BOOT...), disable SYS_MTDPARTS_RUNTIME. Signed-off-by: Patrice Chotard Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- configs/stm32mp13_defconfig | 1 - configs/stm32mp15_basic_defconfig | 1 - configs/stm32mp15_defconfig | 1 - configs/stm32mp15_trusted_defconfig | 1 - 4 files changed, 4 deletions(-) diff --git a/configs/stm32mp13_defconfig b/configs/stm32mp13_defconfig index b076573c450f..02a29cd9f03a 100644 --- a/configs/stm32mp13_defconfig +++ b/configs/stm32mp13_defconfig @@ -59,7 +59,6 @@ CONFIG_SUPPORT_EMMC_BOOT=y CONFIG_STM32_SDMMC2=y CONFIG_MTD=y CONFIG_DM_MTD=y -CONFIG_SYS_MTDPARTS_RUNTIME=y CONFIG_PINCONF=y CONFIG_DM_REGULATOR=y CONFIG_DM_REGULATOR_FIXED=y diff --git a/configs/stm32mp15_basic_defconfig b/configs/stm32mp15_basic_defconfig index 13355ebb4692..273b72fdaf0a 100644 --- a/configs/stm32mp15_basic_defconfig +++ b/configs/stm32mp15_basic_defconfig @@ -125,7 +125,6 @@ CONFIG_SUPPORT_EMMC_BOOT=y CONFIG_STM32_SDMMC2=y CONFIG_MTD=y CONFIG_DM_MTD=y -CONFIG_SYS_MTDPARTS_RUNTIME=y CONFIG_MTD_RAW_NAND=y CONFIG_NAND_STM32_FMC2=y CONFIG_SYS_NAND_ONFI_DETECTION=y diff --git a/configs/stm32mp15_defconfig b/configs/stm32mp15_defconfig index bad5c32ef808..b1f0f2f7c784 100644 --- a/configs/stm32mp15_defconfig +++ b/configs/stm32mp15_defconfig @@ -98,7 +98,6 @@ CONFIG_SUPPORT_EMMC_BOOT=y CONFIG_STM32_SDMMC2=y CONFIG_MTD=y CONFIG_DM_MTD=y -CONFIG_SYS_MTDPARTS_RUNTIME=y CONFIG_MTD_RAW_NAND=y CONFIG_NAND_STM32_FMC2=y CONFIG_SYS_NAND_ONFI_DETECTION=y diff --git a/configs/stm32mp15_trusted_defconfig b/configs/stm32mp15_trusted_defconfig index 5f0fb4565105..bcfd60e5a85a 100644 --- a/configs/stm32mp15_trusted_defconfig +++ b/configs/stm32mp15_trusted_defconfig @@ -99,7 +99,6 @@ CONFIG_SUPPORT_EMMC_BOOT=y CONFIG_STM32_SDMMC2=y CONFIG_MTD=y CONFIG_DM_MTD=y -CONFIG_SYS_MTDPARTS_RUNTIME=y CONFIG_MTD_RAW_NAND=y CONFIG_NAND_STM32_FMC2=y CONFIG_SYS_NAND_ONFI_DETECTION=y From patchwork Thu Jun 8 15:16:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 1792370 X-Patchwork-Delegate: patrice.chotard@st.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=AkczKge8; 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 4QcSXy11bTz20Wn for ; Fri, 9 Jun 2023 01:18:58 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D3E5886171; Thu, 8 Jun 2023 17:18:11 +0200 (CEST) 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="AkczKge8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1E615860C3; Thu, 8 Jun 2023 17:18:06 +0200 (CEST) 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) (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 2BE4F8610D for ; Thu, 8 Jun 2023 17:18:01 +0200 (CEST) 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=45235c3c9f=patrick.delaunay@foss.st.com Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 358Dknad007652; Thu, 8 Jun 2023 17:18:00 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=3YsGUKooOSIe1Avf5ExqYjd3xL4ugNSIgz9UFFD0ej8=; b=AkczKge8mfyswmlQEPptXo9i/23ybwpTRO9LHsi/I0wic/XApo2chFvwDv1lRA8ImbJt tOMJ0uxWslPaEW/nJ3k+ucxjUjY9dIF1JNhrF/+2nGcmVXixb4I3DYxFlB7EApFWqi3y UBASVB89qR0FKkHcFd2DQdIW43d2gTLD5R5zijk4nItJ7epGcfUCqAnLML4GoE12Em0g vMZaLDkEP9RLuxNgvWj+QO1jJYXWqiTZVJtMdsV7wSWHVT3wHGWNh3oue53DnxGKwl0j XBaI08lKgyrJ/lllRdeDhdLecrVTMHerzou9PaRPeZO4wqXmqIfw5CT3RHi1Lh5eUHY1 2Q== 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 3r3cax2auv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jun 2023 17:18:00 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 1B4D110003A; Thu, 8 Jun 2023 17:18:00 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 11F4C21B507; Thu, 8 Jun 2023 17:18:00 +0200 (CEST) Received: from localhost (10.48.1.0) 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.21; Thu, 8 Jun 2023 17:17:59 +0200 From: Patrick Delaunay To: CC: Marek Vasut , Patrick Delaunay , Patrice Chotard , U-Boot STM32 Subject: [PATCH 08/12] board: stm32mp1: use fdt_copy_fixed_partitions Date: Thu, 8 Jun 2023 17:16:44 +0200 Message-ID: <20230608171614.8.I7bf81c0580c1c801def7453d5d05c323a1b8d620@changeid> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230608151648.992505-1-patrick.delaunay@foss.st.com> References: <20230608151648.992505-1-patrick.delaunay@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.48.1.0] X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-08_11,2023-06-08_01,2023-05-22_02 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.8 at phobos.denx.de X-Virus-Status: Clean Copy the fixed partition nodes from U-Boot device tree to Linux kernel device tree to dynamically configure the MTD partitions. fdt_copy_fixed_partitions is only based on device tree and replace the function fdt_fixup_mtdparts based on mtdparts variable; the variable mtdid and mtdparts are not more required. Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- board/st/stm32mp1/stm32mp1.c | 16 +--------------- configs/stm32mp13_defconfig | 1 - configs/stm32mp15_basic_defconfig | 1 - configs/stm32mp15_defconfig | 1 - configs/stm32mp15_trusted_defconfig | 1 - 5 files changed, 1 insertion(+), 19 deletions(-) diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c index 1a1b1844c8c0..be850151e5fc 100644 --- a/board/st/stm32mp1/stm32mp1.c +++ b/board/st/stm32mp1/stm32mp1.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -915,20 +914,7 @@ int mmc_get_env_dev(void) #if defined(CONFIG_OF_BOARD_SETUP) int ft_board_setup(void *blob, struct bd_info *bd) { - static const struct node_info nodes[] = { - { "jedec,spi-nor", MTD_DEV_TYPE_NOR, }, - { "spi-nand", MTD_DEV_TYPE_SPINAND}, - { "st,stm32mp15-fmc2", MTD_DEV_TYPE_NAND, }, - { "st,stm32mp1-fmc2-nfc", MTD_DEV_TYPE_NAND, }, - }; - char *boot_device; - - /* Check the boot-source and don't update MTD for serial or usb boot */ - boot_device = env_get("boot_device"); - if (!boot_device || - (strcmp(boot_device, "serial") && strcmp(boot_device, "usb"))) - if (IS_ENABLED(CONFIG_FDT_FIXUP_PARTITIONS)) - fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes)); + fdt_copy_fixed_partitions(blob); if (IS_ENABLED(CONFIG_FDT_SIMPLEFB)) fdt_simplefb_enable_and_mem_rsv(blob); diff --git a/configs/stm32mp13_defconfig b/configs/stm32mp13_defconfig index 02a29cd9f03a..a9cc7e4d0353 100644 --- a/configs/stm32mp13_defconfig +++ b/configs/stm32mp13_defconfig @@ -74,7 +74,6 @@ CONFIG_TEE=y CONFIG_OPTEE=y # CONFIG_OPTEE_TA_AVB is not set CONFIG_ERRNO_STR=y -CONFIG_FDT_FIXUP_PARTITIONS=y # CONFIG_LMB_USE_MAX_REGIONS is not set CONFIG_LMB_MEMORY_REGIONS=2 CONFIG_LMB_RESERVED_REGIONS=16 diff --git a/configs/stm32mp15_basic_defconfig b/configs/stm32mp15_basic_defconfig index 273b72fdaf0a..7661159110e5 100644 --- a/configs/stm32mp15_basic_defconfig +++ b/configs/stm32mp15_basic_defconfig @@ -188,7 +188,6 @@ CONFIG_WDT=y CONFIG_WDT_STM32MP=y # CONFIG_BINMAN_FDT is not set CONFIG_ERRNO_STR=y -CONFIG_FDT_FIXUP_PARTITIONS=y # CONFIG_LMB_USE_MAX_REGIONS is not set CONFIG_LMB_MEMORY_REGIONS=2 CONFIG_LMB_RESERVED_REGIONS=16 diff --git a/configs/stm32mp15_defconfig b/configs/stm32mp15_defconfig index b1f0f2f7c784..1ff9f73730d3 100644 --- a/configs/stm32mp15_defconfig +++ b/configs/stm32mp15_defconfig @@ -164,7 +164,6 @@ CONFIG_WDT=y CONFIG_WDT_STM32MP=y # CONFIG_BINMAN_FDT is not set CONFIG_ERRNO_STR=y -CONFIG_FDT_FIXUP_PARTITIONS=y # CONFIG_LMB_USE_MAX_REGIONS is not set CONFIG_LMB_MEMORY_REGIONS=2 CONFIG_LMB_RESERVED_REGIONS=16 diff --git a/configs/stm32mp15_trusted_defconfig b/configs/stm32mp15_trusted_defconfig index bcfd60e5a85a..e7bf2e171ace 100644 --- a/configs/stm32mp15_trusted_defconfig +++ b/configs/stm32mp15_trusted_defconfig @@ -164,7 +164,6 @@ CONFIG_WDT=y CONFIG_WDT_STM32MP=y # CONFIG_BINMAN_FDT is not set CONFIG_ERRNO_STR=y -CONFIG_FDT_FIXUP_PARTITIONS=y # CONFIG_LMB_USE_MAX_REGIONS is not set CONFIG_LMB_MEMORY_REGIONS=2 CONFIG_LMB_RESERVED_REGIONS=16 From patchwork Thu Jun 8 15:16:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 1792371 X-Patchwork-Delegate: patrice.chotard@st.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=85.214.62.61; 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=UbZbxUMU; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4QcSYC4yJkz20Wn for ; Fri, 9 Jun 2023 01:19:11 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 82A1C86177; Thu, 8 Jun 2023 17:18:14 +0200 (CEST) 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="UbZbxUMU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1507E860D4; Thu, 8 Jun 2023 17:18:07 +0200 (CEST) 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) (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 1844D860CB for ; Thu, 8 Jun 2023 17:18:02 +0200 (CEST) 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=45235c3c9f=patrick.delaunay@foss.st.com Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 358Dk9IH007584; Thu, 8 Jun 2023 17:18:01 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=8Y5pEv+MUulVuhF3UudS6c+X8+AVP+9e9W/O5gczkfg=; b=UbZbxUMUvtjDC1G7Ws3Mj/UWuWA2+cveXu6DEAcbXps3eyZy9JfTvYMWq8s3ZvDLD7/N kaISjuhIejYxcloKEjrAihQy/WE9R2QFKzx5t/iTzcWtG/RcoXGphJR2Bb51qlV/pclu nt6/gGxDB2yKBwCrrdxwKmrUoNvHE/z/ER69Cv6RUThMMbTVkjcOlpmOxPTLf7CV9siV iI0pkROv4iTpUPJ/Fs5sYQF2SypAXWGPnWa9xOY/LkBudektObu6jbbI+34o6bA2d0hs sy6x8KZpFtmMiO3JHsjzC+GUxLclJwJHzZc8Z2AECSLVnQXbfal7Uf5t/WQoNKx01wKo Iw== 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 3r3cax2av0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jun 2023 17:18:01 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id C242810003D; Thu, 8 Jun 2023 17:18:00 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id BA5E721B507; Thu, 8 Jun 2023 17:18:00 +0200 (CEST) Received: from localhost (10.48.1.0) 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.21; Thu, 8 Jun 2023 17:18:00 +0200 From: Patrick Delaunay To: CC: Marek Vasut , Patrick Delaunay , Patrice Chotard , Subject: [PATCH 09/12] board: st: remove board_mtdparts_default Date: Thu, 8 Jun 2023 17:16:45 +0200 Message-ID: <20230608171614.9.I762bbd3d98a9b9c886a85a8bedd2666b721f7002@changeid> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230608151648.992505-1-patrick.delaunay@foss.st.com> References: <20230608151648.992505-1-patrick.delaunay@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.48.1.0] X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-08_11,2023-06-08_01,2023-05-22_02 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.8 at phobos.denx.de X-Virus-Status: Clean Remove the function board_mtdparts_default and the associated file or configs, only used by the CONFIG_SYS_MTDPARTS_RUNTIME now removed. Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- board/st/common/Kconfig | 66 ----------- board/st/common/Makefile | 1 - board/st/common/stm32mp_mtdparts.c | 177 ----------------------------- 3 files changed, 244 deletions(-) delete mode 100644 board/st/common/stm32mp_mtdparts.c diff --git a/board/st/common/Kconfig b/board/st/common/Kconfig index aba3590866e0..c1c254d07354 100644 --- a/board/st/common/Kconfig +++ b/board/st/common/Kconfig @@ -6,72 +6,6 @@ config CMD_STBOARD This compile the stboard command to read and write the board in the OTP. -config MTDPARTS_NAND0_BOOT - string "mtd boot partitions for nand0" - default "2m(fsbl),2m(ssbl1),2m(ssbl2)" if STM32MP15x_STM32IMAGE || \ - !TFABOOT - default "2m(fsbl),4m(fip1),4m(fip2)" - depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP - help - This define the partitions of nand0 used to build mtparts dynamically - for boot from nand0. - Each partition need to be aligned with the device erase block size, - 512KB is the max size for the NAND supported by stm32mp1 platform. - The fsbl partition support multiple copy of the same binary, one by - erase block. - -config MTDPARTS_NAND0_TEE - string "mtd tee partitions for nand0" - default "512k(teeh),512k(teed),512k(teex)" - depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP && STM32MP15x_STM32IMAGE - help - This define the tee partitions added in mtparts dynamically - when tee is supported with boot from nand0. - Each partition need to be aligned with the device erase block size, - 512KB is the max size for the NAND supported by stm32mp1 platform. - -config MTDPARTS_NOR0_BOOT - string "mtd boot partitions for nor0" - default "256k(fsbl1),256k(fsbl2),2m(ssbl),512k(u-boot-env)" if STM32MP15x_STM32IMAGE || \ - !TFABOOT - default "256k(fsbl1),256k(fsbl2),4m(fip),512k(u-boot-env)" - depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP - help - This define the partitions of nand0 used to build mtparts dynamically - for boot from nor0. - Each partition need to be aligned with the device erase block size, - with 256KB we support all the NOR. - U-Boot env partition (512kB) use 2 erase block for redundancy. - -config MTDPARTS_NOR0_TEE - string "mtd tee partitions for nor0" - default "256k(teeh),512k(teed),256k(teex)" - depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP && STM32MP15x_STM32IMAGE - help - This define the tee partitions added in mtparts dynamically - when tee is supported with boot from nor0. - -config MTDPARTS_SPINAND0_BOOT - string "mtd boot partitions for spi-nand0" - default "2m(fsbl),2m(ssbl1),2m(ssbl2)" if STM32MP15x_STM32IMAGE || !TFABOOT - default "2m(fsbl),4m(fip1),4m(fip2)" - depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP - help - This define the partitions of nand0 used to build mtparts dynamically - for boot from spi-nand0, - 512KB is the max size for the NAND supported by stm32mp1 platform. - The fsbl partition support multiple copy of the same binary, one by - erase block. - -config MTDPARTS_SPINAND0_TEE - string "mtd tee partitions for spi-nand0" - default "512k(teeh),512k(teed),512k(teex)" - depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP && STM32MP15x_STM32IMAGE - help - This define the tee partitions added in mtparts dynamically - when tee is supported with boot from spi-nand0, - 512KB is the max size for the NAND supported by stm32mp1 platform. - config DFU_ALT_RAM0 string "dfu for ram0" default "uImage ram 0xc2000000 0x2000000;devicetree.dtb ram 0xc4000000 0x100000;uramdisk.image.gz ram 0xc4400000 0x10000000" diff --git a/board/st/common/Makefile b/board/st/common/Makefile index 65bbebd6abc3..c9608297261a 100644 --- a/board/st/common/Makefile +++ b/board/st/common/Makefile @@ -7,7 +7,6 @@ obj-$(CONFIG_CMD_STBOARD) += cmd_stboard.o obj-$(CONFIG_PMIC_STPMIC1) += stpmic1.o ifeq ($(CONFIG_ARCH_STM32MP),y) -obj-$(CONFIG_SYS_MTDPARTS_RUNTIME) += stm32mp_mtdparts.o obj-$(CONFIG_SET_DFU_ALT_INFO) += stm32mp_dfu.o endif diff --git a/board/st/common/stm32mp_mtdparts.c b/board/st/common/stm32mp_mtdparts.c deleted file mode 100644 index 67a56a2623a1..000000000000 --- a/board/st/common/stm32mp_mtdparts.c +++ /dev/null @@ -1,177 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause -/* - * Copyright (C) 2020, STMicroelectronics - All Rights Reserved - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef CONFIG_STM32MP15x_STM32IMAGE -#include -#endif -#include -#include -#include - -#define MTDPARTS_LEN 256 -#define MTDIDS_LEN 128 - -/* - * Get a global data pointer - */ -DECLARE_GLOBAL_DATA_PTR; - -/** - * update the variables "mtdids" and "mtdparts" with boot, tee and user strings - */ -static void board_set_mtdparts(const char *dev, - char *mtdids, - char *mtdparts, - const char *boot, -#ifdef CONFIG_STM32MP15x_STM32IMAGE - const char *tee, -#endif - const char *user) -{ - /* 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); - - if (boot) { - strncat(mtdparts, boot, MTDPARTS_LEN); - strncat(mtdparts, ",", MTDPARTS_LEN); - } - -#ifdef CONFIG_STM32MP15x_STM32IMAGE - if (tee) { - strncat(mtdparts, tee, MTDPARTS_LEN); - strncat(mtdparts, ",", MTDPARTS_LEN); - } -#endif - - strncat(mtdparts, user, MTDPARTS_LEN); -} - -void board_mtdparts_default(const char **mtdids, const char **mtdparts) -{ - struct mtd_info *mtd; - struct udevice *dev; - static char parts[3 * MTDPARTS_LEN + 1]; - static char ids[MTDIDS_LEN + 1]; - static bool mtd_initialized; - bool nor, nand, spinand, serial; -#ifdef CONFIG_STM32MP15x_STM32IMAGE - bool tee = false; -#endif - - if (mtd_initialized) { - *mtdids = ids; - *mtdparts = parts; - return; - } - - nor = false; - nand = false; - spinand = false; - serial = false; - - switch (get_bootmode() & TAMP_BOOT_DEVICE_MASK) { - case BOOT_SERIAL_UART: - case BOOT_SERIAL_USB: - serial = true; - if (IS_ENABLED(CONFIG_CMD_STM32PROG)) { -#ifdef CONFIG_STM32MP15x_STM32IMAGE - tee = stm32prog_get_tee_partitions(); -#endif - nor = stm32prog_get_fsbl_nor(); - } - nand = true; - spinand = true; - break; - case BOOT_FLASH_NAND: - nand = true; - break; - case BOOT_FLASH_SPINAND: - spinand = true; - break; - case BOOT_FLASH_NOR: - nor = true; - break; - default: - break; - } - -#ifdef CONFIG_STM32MP15x_STM32IMAGE - if (!serial && tee_find_device(NULL, NULL, NULL, NULL)) - tee = true; -#endif - - memset(parts, 0, sizeof(parts)); - memset(ids, 0, sizeof(ids)); - - /* probe all MTD devices */ - for (uclass_first_device(UCLASS_MTD, &dev); - dev; - uclass_next_device(&dev)) { - log_debug("mtd device = %s\n", dev->name); - } - - if (nand) { - mtd = get_mtd_device_nm("nand0"); - if (!IS_ERR_OR_NULL(mtd)) { - board_set_mtdparts("nand0", ids, parts, - CONFIG_MTDPARTS_NAND0_BOOT, -#ifdef CONFIG_STM32MP15x_STM32IMAGE - !nor && tee ? CONFIG_MTDPARTS_NAND0_TEE : NULL, -#endif - "-(UBI)"); - put_mtd_device(mtd); - } - } - - if (spinand) { - mtd = get_mtd_device_nm("spi-nand0"); - if (!IS_ERR_OR_NULL(mtd)) { - board_set_mtdparts("spi-nand0", ids, parts, - CONFIG_MTDPARTS_SPINAND0_BOOT, -#ifdef CONFIG_STM32MP15x_STM32IMAGE - !nor && tee ? CONFIG_MTDPARTS_SPINAND0_TEE : NULL, -#endif - "-(UBI)"); - put_mtd_device(mtd); - } - } - - if (nor) { - if (!uclass_get_device(UCLASS_SPI_FLASH, 0, &dev)) { - board_set_mtdparts("nor0", ids, parts, - CONFIG_MTDPARTS_NOR0_BOOT, -#ifdef CONFIG_STM32MP15x_STM32IMAGE - tee ? CONFIG_MTDPARTS_NOR0_TEE : NULL, -#endif - "-(nor_user)"); - } - } - - mtd_initialized = true; - *mtdids = ids; - *mtdparts = parts; - log_debug("mtdids=%s & mtdparts=%s\n", ids, parts); -} From patchwork Thu Jun 8 15:16:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 1792373 X-Patchwork-Delegate: patrice.chotard@st.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=85.214.62.61; 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=ZLe/wQ0z; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4QcSYj5rmrz20Wn for ; Fri, 9 Jun 2023 01:19:37 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0108C860F1; Thu, 8 Jun 2023 17:19:14 +0200 (CEST) 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="ZLe/wQ0z"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5790786139; Thu, 8 Jun 2023 17:19:10 +0200 (CEST) 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 8BEC58615F for ; Thu, 8 Jun 2023 17:19:05 +0200 (CEST) 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=45235c3c9f=patrick.delaunay@foss.st.com Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 358EAB83029869; Thu, 8 Jun 2023 17:19:03 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=GZPZUtY6zuBzktGn0IuP1cyOAH3J6D0NWtBuN/2l5ho=; b=ZLe/wQ0ziH/bXbahoVvKHtKGyFVIKHTCYrNQwhyBRNVnl8FnuGtn6lgRYGb8i9j0f0wP jxAV1UA9AcX3cZjUjTEfs57cDJHV7vGapjIdmVW/QLvc8hEswYQpurHoDfl38p1VxcW0 yduKeP3VzWmL7uC5bt06tS3yLoU2k3LIhJ+lGxHQBPDOIV0qgHq7U/27TGxtRMUwg6kB 3vZt3icj7e9vSonpoKkih4uo+f8WQ523YTSF2D+1TRFmWtUWzFDemL+xk6/AWociveeN c1DrKOSNKVt8V119PKrUfE1xFT7u9H+UfVV/Exqr8hopw90KrQAMnb8mv4w3ArbJok0/ sw== 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 3r3ggygedk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jun 2023 17:19:03 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E4C0C10002A; Thu, 8 Jun 2023 17:19:01 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id DB14F21BF4D; Thu, 8 Jun 2023 17:19:01 +0200 (CEST) Received: from localhost (10.48.1.0) 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.21; Thu, 8 Jun 2023 17:19:01 +0200 From: Patrick Delaunay To: CC: Marek Vasut , Patrice Chotard , Patrick Delaunay , Sean Anderson , Simon Glass , U-Boot STM32 Subject: [PATCH 10/12] stm32mp: stm32prog: Remove tee_detected from stm32prog_data struct Date: Thu, 8 Jun 2023 17:16:46 +0200 Message-ID: <20230608171614.10.I244f84db09e1225f509e2b1072e974810f2024df@changeid> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230608151648.992505-1-patrick.delaunay@foss.st.com> References: <20230608151648.992505-1-patrick.delaunay@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.48.1.0] X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-08_11,2023-06-08_01,2023-05-22_02 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.8 at phobos.denx.de X-Virus-Status: Clean From: Patrice Chotard As stm32prog_get_tee_partitions() is no more used, remove tee_detected boolean from stm32prog_data struct and all code using it. Signed-off-by: Patrice Chotard Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c | 9 --------- arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c | 11 ----------- arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h | 3 --- arch/arm/mach-stm32mp/include/mach/stm32prog.h | 4 ---- 4 files changed, 27 deletions(-) diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c index cfafa539aeb9..c695cc11232b 100644 --- a/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c @@ -180,15 +180,6 @@ U_BOOT_CMD(stm32prog, 5, 0, do_stm32prog, " = size of flashlayout (optional for image with STM32 header)\n" ); -#ifdef CONFIG_STM32MP15x_STM32IMAGE -bool stm32prog_get_tee_partitions(void) -{ - if (stm32prog_data) - return stm32prog_data->tee_detected; - - return false; -} -#endif bool stm32prog_get_fsbl_nor(void) { diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c index 241ad40abb7c..0cdc14dd5bc8 100644 --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c @@ -995,9 +995,6 @@ static int treat_partition_list(struct stm32prog_data *data) INIT_LIST_HEAD(&data->dev[j].part_list); } -#ifdef CONFIG_STM32MP15x_STM32IMAGE - data->tee_detected = false; -#endif data->fsbl_nor_detected = false; for (i = 0; i < data->part_nb; i++) { part = &data->part_array[i]; @@ -1049,14 +1046,6 @@ static int treat_partition_list(struct stm32prog_data *data) !strncmp(part->name, "fsbl", 4)) data->fsbl_nor_detected = true; /* fallthrough */ - case STM32PROG_NAND: - case STM32PROG_SPI_NAND: -#ifdef CONFIG_STM32MP15x_STM32IMAGE - if (!data->tee_detected && - !strncmp(part->name, "tee", 3)) - data->tee_detected = true; - break; -#endif default: break; } diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h index 58f4b96fa752..04a899ee1184 100644 --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h @@ -149,9 +149,6 @@ struct stm32prog_data { struct stm32prog_dev_t dev[STM32PROG_MAX_DEV]; /* array of device */ int part_nb; /* nb of partition */ struct stm32prog_part_t *part_array; /* array of partition */ -#ifdef CONFIG_STM32MP15x_STM32IMAGE - bool tee_detected; -#endif bool fsbl_nor_detected; /* command internal information */ diff --git a/arch/arm/mach-stm32mp/include/mach/stm32prog.h b/arch/arm/mach-stm32mp/include/mach/stm32prog.h index 99be4e1d656b..23d1adfbad92 100644 --- a/arch/arm/mach-stm32mp/include/mach/stm32prog.h +++ b/arch/arm/mach-stm32mp/include/mach/stm32prog.h @@ -11,8 +11,4 @@ int stm32prog_read_medium_virt(struct dfu_entity *dfu, u64 offset, void *buf, long *len); int stm32prog_get_medium_size_virt(struct dfu_entity *dfu, u64 *size); -#ifdef CONFIG_STM32MP15x_STM32IMAGE -bool stm32prog_get_tee_partitions(void); -#endif - bool stm32prog_get_fsbl_nor(void); From patchwork Thu Jun 8 15:16:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 1792372 X-Patchwork-Delegate: patrice.chotard@st.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=85.214.62.61; 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=36SM9uWy; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4QcSYT18yYz20Wn for ; Fri, 9 Jun 2023 01:19:25 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4CB4F860CB; Thu, 8 Jun 2023 17:19:11 +0200 (CEST) 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="36SM9uWy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 976A3860CB; Thu, 8 Jun 2023 17:19:09 +0200 (CEST) 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 4C85E86122 for ; Thu, 8 Jun 2023 17:19:04 +0200 (CEST) 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=45235c3c9f=patrick.delaunay@foss.st.com Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 358EAZhn030123; Thu, 8 Jun 2023 17:19:03 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=+zjFwBApUcDAT5AFDNCFO/pvfnozLbsOHk0NsKJF51Q=; b=36SM9uWyqsKq5a05yOF3Zov8K77OmIuYlF7Slb1s22EcTmrXrkKyiFyeJqPY7RvyU1hP yYzxfGMgvMAO1VTy2xYk0OaPAVngzHDecRqr8cT2X5CaRGrJ+J8uIVpUDN6kgRamIPz9 9BjMeYdsgnkGQlrFVF3SFGBOoz+wp8YE/poLicSVCKf+m5ikkHJqeGZ0WaE0aXeg8nJG 63MI9l1K8khTFSucUwD3CmsNvEWgpq8o9i3Z5f1b0ElKYob+3o8XfI9n7jVfg/DXbIlo I8ExOeNpU0d8KeEvjq8+y+SgnnjCghWmwSC0ayD0wGnrKjOE08M4cO8qMEvSscygz1gn nw== 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 3r3ggygedp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jun 2023 17:19:03 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 160E810003A; Thu, 8 Jun 2023 17:19:03 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 0D5D321BF4D; Thu, 8 Jun 2023 17:19:03 +0200 (CEST) Received: from localhost (10.48.1.0) 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.21; Thu, 8 Jun 2023 17:19:02 +0200 From: Patrick Delaunay To: CC: Marek Vasut , Patrice Chotard , Patrick Delaunay , U-Boot STM32 Subject: [PATCH 11/12] configs: stm32mp1: disable CMD_MTDPARTS Date: Thu, 8 Jun 2023 17:16:47 +0200 Message-ID: <20230608171614.11.I05a3701d3d8a274af29439ce26900177bfbd8767@changeid> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230608151648.992505-1-patrick.delaunay@foss.st.com> References: <20230608151648.992505-1-patrick.delaunay@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.48.1.0] X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-08_11,2023-06-08_01,2023-05-22_02 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.8 at phobos.denx.de X-Virus-Status: Clean From: Patrice Chotard Disable CMD_MTDPARTS as it's no more needed and it is strongly encouraged to avoid using this command anymore. (see comments in ./cmd/Kconfig:2422). Signed-off-by: Patrice Chotard Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- configs/stm32mp13_defconfig | 1 - configs/stm32mp15_basic_defconfig | 1 - configs/stm32mp15_defconfig | 1 - configs/stm32mp15_trusted_defconfig | 1 - 4 files changed, 4 deletions(-) diff --git a/configs/stm32mp13_defconfig b/configs/stm32mp13_defconfig index a9cc7e4d0353..5e9abc5e2625 100644 --- a/configs/stm32mp13_defconfig +++ b/configs/stm32mp13_defconfig @@ -39,7 +39,6 @@ CONFIG_CMD_RNG=y CONFIG_CMD_TIMER=y CONFIG_CMD_REGULATOR=y CONFIG_CMD_EXT4_WRITE=y -CONFIG_CMD_MTDPARTS=y CONFIG_CMD_LOG=y CONFIG_CMD_UBI=y CONFIG_OF_LIVE=y diff --git a/configs/stm32mp15_basic_defconfig b/configs/stm32mp15_basic_defconfig index 7661159110e5..94f4dbd4c32b 100644 --- a/configs/stm32mp15_basic_defconfig +++ b/configs/stm32mp15_basic_defconfig @@ -75,7 +75,6 @@ CONFIG_CMD_TIMER=y CONFIG_CMD_PMIC=y CONFIG_CMD_REGULATOR=y CONFIG_CMD_EXT4_WRITE=y -CONFIG_CMD_MTDPARTS=y CONFIG_CMD_LOG=y CONFIG_CMD_UBI=y # CONFIG_SPL_DOS_PARTITION is not set diff --git a/configs/stm32mp15_defconfig b/configs/stm32mp15_defconfig index 1ff9f73730d3..37b6d4a7b4ac 100644 --- a/configs/stm32mp15_defconfig +++ b/configs/stm32mp15_defconfig @@ -51,7 +51,6 @@ CONFIG_CMD_TIMER=y CONFIG_CMD_PMIC=y CONFIG_CMD_REGULATOR=y CONFIG_CMD_EXT4_WRITE=y -CONFIG_CMD_MTDPARTS=y CONFIG_CMD_LOG=y CONFIG_CMD_UBI=y CONFIG_OF_LIVE=y diff --git a/configs/stm32mp15_trusted_defconfig b/configs/stm32mp15_trusted_defconfig index e7bf2e171ace..9c5446d6d4a2 100644 --- a/configs/stm32mp15_trusted_defconfig +++ b/configs/stm32mp15_trusted_defconfig @@ -52,7 +52,6 @@ CONFIG_CMD_TIMER=y CONFIG_CMD_PMIC=y CONFIG_CMD_REGULATOR=y CONFIG_CMD_EXT4_WRITE=y -CONFIG_CMD_MTDPARTS=y CONFIG_CMD_LOG=y CONFIG_CMD_UBI=y CONFIG_OF_LIVE=y From patchwork Thu Jun 8 15:16:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 1792374 X-Patchwork-Delegate: patrice.chotard@st.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=16DrKdWT; 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 4QcSYy0NQHz20Wn for ; Fri, 9 Jun 2023 01:19:50 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 07FBD8617C; Thu, 8 Jun 2023 17:19:19 +0200 (CEST) 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="16DrKdWT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 66B7086178; Thu, 8 Jun 2023 17:19:18 +0200 (CEST) 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,T_SCC_BODY_TEXT_LINE 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 2B6888471C for ; Thu, 8 Jun 2023 17:19:16 +0200 (CEST) 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=45235c3c9f=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 358DkHZJ001967; Thu, 8 Jun 2023 17:19:05 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=+NqnCdrkQuWs7Xp4E4dwaqNZb/YLnOJ0tiN1OTxWUok=; b=16DrKdWTtjU/+M+jEVR01teuUdGKb2GfeIplIFRJgNckO2IvIxkagjOkymDz0jELAWE8 g9PPx0EV5dkTABSWBEhnW+wf1VV5JJSHHtvOFFbxRGNgOamZ9G6x6hYIDZvC0qX/jZos z2aOTZg0fAAoqcJT8hqOoSngMXwOEaO0zCwj4uQTBfvh4pHyvJRavm9MD96gGQikn/h6 KN07b3o5dZLPyh48QjrQrhlvz+Q0KsB0M941N+EKSw1ey2yA6xsFrfy9Xzu1VW5sF2kO 3SOO/RKLQ4O73YwsaNDgk4VCqVb9l2oU52z5IUbfAehMK7k8v/Kq/0b+1/IsuPLcFRUV Zw== 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 3r3c4ajbvn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jun 2023 17:19:05 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 7EBEB10002A; Thu, 8 Jun 2023 17:19:04 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 7551B21BF4D; Thu, 8 Jun 2023 17:19:04 +0200 (CEST) Received: from localhost (10.48.1.0) 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.21; Thu, 8 Jun 2023 17:19:04 +0200 From: Patrick Delaunay To: CC: Marek Vasut , Patrick Delaunay , Patrice Chotard , Tom Rini , U-Boot STM32 , Subject: [PATCH 12/12] arm: dts: stm32: Add partitions in flash0 and nand node for stm32mp15xx-dhcom/dhcor Date: Thu, 8 Jun 2023 17:16:48 +0200 Message-ID: <20230608171614.12.I7d7a0b6c2347082f9b3c03a5fe72a53cad4c23ef@changeid> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230608151648.992505-1-patrick.delaunay@foss.st.com> References: <20230608151648.992505-1-patrick.delaunay@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.48.1.0] X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-08_11,2023-06-08_01,2023-05-22_02 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.8 at phobos.denx.de X-Virus-Status: Clean Add partitions subnode in flash0 for stm32mp157xx-dhcom/dhcor boards. Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi | 27 ++++++++++++++++++++++ arch/arm/dts/stm32mp15xx-dhcor-u-boot.dtsi | 27 ++++++++++++++++++++++ configs/stm32mp15_dhcom_basic_defconfig | 3 --- configs/stm32mp15_dhcor_basic_defconfig | 3 --- 4 files changed, 54 insertions(+), 6 deletions(-) diff --git a/arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi b/arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi index bc0730cf2bd0..a808620e1219 100644 --- a/arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi +++ b/arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi @@ -92,6 +92,33 @@ &flash0 { bootph-pre-ram; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "fsbl1"; + reg = <0x00000000 0x00040000>; + }; + partition@40000 { + label = "fsbl2"; + reg = <0x00040000 0x00040000>; + }; + partition@500000 { + label = "uboot"; + reg = <0x00080000 0x00160000>; + }; + partition@900000 { + label = "env1"; + reg = <0x001E0000 0x00010000>; + }; + partition@980000 { + label = "env2"; + reg = <0x001F0000 0x00010000>; + }; + }; }; &qspi { diff --git a/arch/arm/dts/stm32mp15xx-dhcor-u-boot.dtsi b/arch/arm/dts/stm32mp15xx-dhcor-u-boot.dtsi index 804c66283e08..eb905ad28201 100644 --- a/arch/arm/dts/stm32mp15xx-dhcor-u-boot.dtsi +++ b/arch/arm/dts/stm32mp15xx-dhcor-u-boot.dtsi @@ -28,6 +28,33 @@ &flash0 { bootph-pre-ram; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "fsbl1"; + reg = <0x00000000 0x00040000>; + }; + partition@40000 { + label = "fsbl2"; + reg = <0x00040000 0x00040000>; + }; + partition@500000 { + label = "uboot"; + reg = <0x00080000 0x00160000>; + }; + partition@900000 { + label = "env1"; + reg = <0x001E0000 0x00010000>; + }; + partition@980000 { + label = "env2"; + reg = <0x001F0000 0x00010000>; + }; + }; }; &i2c4 { diff --git a/configs/stm32mp15_dhcom_basic_defconfig b/configs/stm32mp15_dhcom_basic_defconfig index 430d0bccc9a7..77f0fafc5c71 100644 --- a/configs/stm32mp15_dhcom_basic_defconfig +++ b/configs/stm32mp15_dhcom_basic_defconfig @@ -85,9 +85,6 @@ CONFIG_CMD_PMIC=y CONFIG_CMD_REGULATOR=y CONFIG_CMD_BTRFS=y CONFIG_CMD_EXT4_WRITE=y -CONFIG_CMD_MTDPARTS=y -CONFIG_MTDIDS_DEFAULT="nor0=nor0" -CONFIG_MTDPARTS_DEFAULT="mtdparts=nor0:256k(fsbl1),256k(fsbl2),1408k(uboot),64k(env1),64k(env2)" # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_ISO_PARTITION is not set # CONFIG_SPL_PARTITION_UUIDS is not set diff --git a/configs/stm32mp15_dhcor_basic_defconfig b/configs/stm32mp15_dhcor_basic_defconfig index f23875fb84fe..4151ad64a4be 100644 --- a/configs/stm32mp15_dhcor_basic_defconfig +++ b/configs/stm32mp15_dhcor_basic_defconfig @@ -83,9 +83,6 @@ CONFIG_CMD_PMIC=y CONFIG_CMD_REGULATOR=y CONFIG_CMD_BTRFS=y CONFIG_CMD_EXT4_WRITE=y -CONFIG_CMD_MTDPARTS=y -CONFIG_MTDIDS_DEFAULT="nor0=nor0" -CONFIG_MTDPARTS_DEFAULT="mtdparts=nor0:256k(fsbl1),256k(fsbl2),1408k(uboot),64k(env1),64k(env2)" # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_ISO_PARTITION is not set # CONFIG_SPL_PARTITION_UUIDS is not set