From patchwork Fri Oct 27 09:46:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Chow X-Patchwork-Id: 1856131 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=openmail.cc header.i=@openmail.cc header.a=rsa-sha256 header.s=2018 header.b=qxscFcUT; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=permerror (SPF Permanent Error: More than 10 MX records returned) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:45e3:2400::1; helo=sv.mirrors.kernel.org; envelope-from=devicetree+bounces-12397-incoming-dt=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [IPv6:2604:1380:45e3:2400::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SGyVb5m6hz23jV for ; Fri, 27 Oct 2023 20:46:47 +1100 (AEDT) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5854328236C for ; Fri, 27 Oct 2023 09:46:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 30F60168CF; Fri, 27 Oct 2023 09:46:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=openmail.cc header.i=@openmail.cc header.b="qxscFcUT" X-Original-To: devicetree@vger.kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E99CEFBE3 for ; Fri, 27 Oct 2023 09:46:42 +0000 (UTC) Received: from smtp161.vfemail.net (smtp161.vfemail.net [146.59.185.161]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70630CE for ; Fri, 27 Oct 2023 02:46:41 -0700 (PDT) Received: (qmail 28644 invoked from network); 27 Oct 2023 09:46:39 +0000 Received: from localhost (HELO nl101-3.vfemail.net) () by smtpout.vfemail.net with ESMTPS (ECDHE-RSA-AES256-GCM-SHA384 encrypted); 27 Oct 2023 09:46:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=openmail.cc; h=from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=2018; bh=Bwdf/hXtE2z1yTkhneNd8f2BY QKrt7drzyCFHrjxjtw=; b=qxscFcUTB5Qwi7tQsy24z5rDPnCWiFulXa165hUpJ HzL+/8ak1Kj4Iuf44tIyV6YXIVQyWh7qO4lDKoicRJKyhxW2XJvU3U2VqrNtEI2G pysRjciBWXEsO7Nhu0C6TyP/onZxlm1ZoH4qqpnU7TP/6wbSvdJfJd4prRI5W20S qQ= Received: (qmail 19359 invoked from network); 27 Oct 2023 09:46:39 -0000 Received: by simscan 1.4.0 ppid: 19049, pid: 19318, t: 0.5371s scanners:none Received: from unknown (HELO bmwxMDEudmZlbWFpbC5uZXQ=) (ZXF1dUBvcGVubWFpbC5jYw==@MTkyLjE2OC4xLjE5Mg==) by nl101.vfemail.net with ESMTPA; 27 Oct 2023 09:46:38 -0000 From: Edward Chow To: Rob Herring , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Krzysztof Kozlowski Cc: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Lech Perczak , Edward Chow Subject: [PATCH v2 1/2] dt-bindings: mtd: partitions: Export special values Date: Fri, 27 Oct 2023 17:46:09 +0800 Message-ID: <20231027094610.1022114-2-equu@openmail.cc> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231027094610.1022114-1-equu@openmail.cc> References: <20231025052937.830813-1-equu@openmail.cc> <20231027094610.1022114-1-equu@openmail.cc> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Export special "offset" and "size" values defined and documented in linux/mtd/partitions.h to dt-bindings/mtd/partitions.h. Signed-off-by: Edward Chow --- MAINTAINERS | 2 ++ include/dt-bindings/mtd/partitions.h | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 include/dt-bindings/mtd/partitions.h diff --git a/MAINTAINERS b/MAINTAINERS index 668d1e24452d..7d6beadc8b36 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13771,9 +13771,11 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/fixes T: git git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next F: Documentation/devicetree/bindings/mtd/ F: drivers/mtd/ +F: include/dt-bindings/mtd/ F: include/linux/mtd/ F: include/uapi/mtd/ + MEMSENSING MICROSYSTEMS MSA311 DRIVER M: Dmitry Rokosov L: linux-iio@vger.kernel.org diff --git a/include/dt-bindings/mtd/partitions.h b/include/dt-bindings/mtd/partitions.h new file mode 100644 index 000000000000..b7f622fe458c --- /dev/null +++ b/include/dt-bindings/mtd/partitions.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */ +/* + * Device Tree constants identical to those in include/linux/mtd/partitions.h + */ + +#ifndef _DT_BINDINGS_MTD_PARTITIONS_H +#define _DT_BINDINGS_MTD_PARTITIONS_H + +#define MTDPART_OFS_SPECIAL (-1) +#define MTDPART_OFS_RETAIN (-3) +#define MTDPART_OFS_NXTBLK (-2) +#define MTDPART_OFS_APPEND (-1) +#define MTDPART_SIZ_FULL (0) + +#endif From patchwork Fri Oct 27 09:46:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Chow X-Patchwork-Id: 1856133 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=openmail.cc header.i=@openmail.cc header.a=rsa-sha256 header.s=2018 header.b=CH+Qd/Qb; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=permerror (SPF Permanent Error: More than 10 MX records returned) smtp.mailfrom=vger.kernel.org (client-ip=147.75.199.223; helo=ny.mirrors.kernel.org; envelope-from=devicetree+bounces-12398-incoming-dt=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SGyVn5kSKz1ypX for ; Fri, 27 Oct 2023 20:46:57 +1100 (AEDT) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 526CE1C2100B for ; Fri, 27 Oct 2023 09:46:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D492B168BC; Fri, 27 Oct 2023 09:46:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=openmail.cc header.i=@openmail.cc header.b="CH+Qd/Qb" X-Original-To: devicetree@vger.kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DD49FBE3 for ; Fri, 27 Oct 2023 09:46:48 +0000 (UTC) Received: from smtp161.vfemail.net (smtp161.vfemail.net [146.59.185.161]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B905E5 for ; Fri, 27 Oct 2023 02:46:45 -0700 (PDT) Received: (qmail 28684 invoked from network); 27 Oct 2023 09:46:43 +0000 Received: from localhost (HELO nl101-3.vfemail.net) () by smtpout.vfemail.net with ESMTPS (ECDHE-RSA-AES256-GCM-SHA384 encrypted); 27 Oct 2023 09:46:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=openmail.cc; h=from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=2018; bh=hle8SC8oQYe3hUk/lyn2FO0kf 0Ff2mlV8GXo803pPyU=; b=CH+Qd/QbAiCVWAvHMIvg/wNRYBwWAp5uusKkg2Eko Qm7GaUKdRAfSsevWXfe75Uh8T9l4tWpSGafnqyRnGwz/07zNhAmWWwo3jI9e87EW TmbArOkT0y6Ws7j890m/aa6cogqoL3ArOzwqBgUXnuF/le8ci795ovexrLMhb6/d Uc= Received: (qmail 19515 invoked from network); 27 Oct 2023 09:46:43 -0000 Received: by simscan 1.4.0 ppid: 19049, pid: 19509, t: 0.3358s scanners:none Received: from unknown (HELO bmwxMDEudmZlbWFpbC5uZXQ=) (ZXF1dUBvcGVubWFpbC5jYw==@MTkyLjE2OC4xLjE5Mg==) by nl101.vfemail.net with ESMTPA; 27 Oct 2023 09:46:42 -0000 From: Edward Chow To: Rob Herring , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Krzysztof Kozlowski Cc: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Lech Perczak , Edward Chow Subject: [PATCH v2 2/2] dt-bindings: mtd: partitions: Document special values Date: Fri, 27 Oct 2023 17:46:10 +0800 Message-ID: <20231027094610.1022114-3-equu@openmail.cc> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231027094610.1022114-1-equu@openmail.cc> References: <20231025052937.830813-1-equu@openmail.cc> <20231027094610.1022114-1-equu@openmail.cc> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add examples for special values in linux/mtd/partitions.h. Signed-off-by: Edward Chow --- .../mtd/partitions/fixed-partitions.yaml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml index 331e564f29dc..e7bf466c395f 100644 --- a/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml +++ b/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml @@ -164,3 +164,33 @@ examples: read-only; }; }; + + - | + #include + partitions { + compatible = "fixed-partitions"; + #address-cells = <2>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0 0x000000 0x020000>; + read-only; + }; + + firmware@1 { + label = "firmware"; + /* From the end of the last partition, occupying as mush + * as possible, retaining 0x010000 after it, + * "MTDPART_OFS_SPECIAL MTDPART_OFS_NXTBLK" similar to + * this, but always beginning at erase block boundary. */ + reg = ; + }; + + calibration@2 { + compatible = "fixed-partitions"; + label = "calibration"; + /* Appending to the last partition, occupying 0x010000 */ + reg = ; + }; + };