Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1032302rdh; Fri, 27 Oct 2023 02:46:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFldyGhhJmyjvooDPqzSTsSV5wkchrI3GFGEhNDoFBYBPoijd6PoSHYv/EuCqCLTdR1dnS8 X-Received: by 2002:a25:a2c9:0:b0:d9a:fe8c:c298 with SMTP id c9-20020a25a2c9000000b00d9afe8cc298mr1818241ybn.31.1698400016447; Fri, 27 Oct 2023 02:46:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698400016; cv=none; d=google.com; s=arc-20160816; b=iG3y7WSOP61C7pMofSJmJFGzURDKes+gj3vFycncA0M45bhzMMvqMJmoMm4+PDDIjn QHDgGvjqsB4R5OpgHxfIRMFt82/yokWkGIM2VDnOu/H79vtcVz+0BKktqE3qOVyZU0IU sTbCZL3wL/OsdpIsHn5Q2Vu5Agu4Ahuzhi4qbhFlHpFA7XDe1O59TClklZlNAhl1+RgK 6eloDpxCMofQi0QI2k0uPnNxqIHVn8CRPeK/TdrWcnVAgtHLkhSXeBVWx9TDthX11C4X uUZ/rI6SbWqKk9/6bbxziDugQ0Q2OPcDoH8vFIsiZ2xJlAIYOUxLztICEaNPXccVLlJR w6VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TM/H5CIL16uf8z2PQzyNEPI+C/hl4Mk3tbtAvzcu4VM=; fh=Kq9b/J1mwVh6tlELICS5y4CJRfo+SrzMxk7bCnGGdWg=; b=pL3KxSFgzFqrdg9P6kSiCZPDXnqsMaMH8ozrNLgJy2ntZ3EjIai45xTDLBqjnhO1tF SvAMZ9dcXcDaDd9m4E01dYo09QqwrG/xJ9z/XGzaUYgKeI3pr1LK7EHaJeIyQH0s5Tro DAoXcL9ZmeLjZ1aOWtw+xame8fEXAy5XnklM+j5Auf+lKrqvV5USlmcbpVC3IJbwKB2R 1A70H7LnBcywAqh1qglAxPx0LAm40u/EYANEf/4iwyhpTStqm8m25Y+EQ49cbLyLQo1w 0URlrQZlj0wdDkzMUSx3EM1S1/u+P7kXJs8wPrb+a41YivQotuer0ZKl7OyiW7iVwiyW UyvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@openmail.cc header.s=2018 header.b=TNj9Q7hm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id 18-20020a250412000000b00da040cfe08fsi2065712ybe.422.2023.10.27.02.46.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 02:46:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=fail header.i=@openmail.cc header.s=2018 header.b=TNj9Q7hm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 4C8FB833CE37; Fri, 27 Oct 2023 02:46:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345406AbjJ0Jql (ORCPT + 99 others); Fri, 27 Oct 2023 05:46:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230502AbjJ0Jqk (ORCPT ); Fri, 27 Oct 2023 05:46:40 -0400 Received: from smtp161.vfemail.net (smtp161.vfemail.net [146.59.185.161]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8B099D for ; Fri, 27 Oct 2023 02:46:37 -0700 (PDT) Received: (qmail 28603 invoked from network); 27 Oct 2023 09:46:35 +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:35 +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=e/fxR6YN2xfO3OOXNQJoLD0l/ XKbPIRpysCe8SRGnEY=; b=TNj9Q7hmJlSBMUtz2Lpd5RugEr9Y2/WrOsjJ9amWh 9MxWnjBmhjfnVVImCjlh1ftaxMb5m66a/LWrwX1v/DKgVwgcChupRLCEjsMuXuAV ODq+AIpBYc6fQorWonYIq8D7sMJydWwyLgNFfUJAH6ALysK67mf+zBOeE6+TfdLr qU= Received: (qmail 19138 invoked from network); 27 Oct 2023 09:46:35 -0000 Received: by simscan 1.4.0 ppid: 19049, pid: 19125, t: 0.5299s scanners:none Received: from unknown (HELO bmwxMDEudmZlbWFpbC5uZXQ=) (ZXF1dUBvcGVubWFpbC5jYw==@MTkyLjE2OC4xLjE5Mg==) by nl101.vfemail.net with ESMTPA; 27 Oct 2023 09:46:34 -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 0/2] dt-bindings: mtd: partitions: Export special values Date: Fri, 27 Oct 2023 17:46:08 +0800 Message-ID: <20231027094610.1022114-1-equu@openmail.cc> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231025052937.830813-1-equu@openmail.cc> References: <20231025052937.830813-1-equu@openmail.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.3 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 27 Oct 2023 02:46:52 -0700 (PDT) There are special "offset" and "size" values defined and documented in linux/mtd/partitions.h: /* consume as much as possible, leaving size after the end of partition. */ #define MTDPART_OFS_RETAIN (uint64_t)(-3) /* the partition will start at the next erase block. */ #define MTDPART_OFS_NXTBLK (uint64_t)(-2) /* the partition will start where the previous one ended. */ #define MTDPART_OFS_APPEND (uint64_t)(-1) (Though not explicitly, they are compared against variables in uint64_t in drivers/mtd/mtdpart.c, so they had better be considered as such.) /* the partition will extend to the end of the master MTD device. */ #define MTDPART_SIZ_FULL (0) These special values could be used to define partitions automatically fitting to the size of the master MTD device at runtime. However, these values used not to be exported to dt-bindings, thus seldom used before, since they might have been only used in numeric form, such as "(-1) (-3)" for MTDPART_OFS_RETAIN. Now, they are exported in dt-bindings/mtd/partitions.h as 32-bit cell values, so 2-cell addressed should be defined to use special offset values, such as "MTDPART_OFS_SPECIAL MTDPART_OFS_RETAIN" for MTDPART_OFS_RETAIN in linux/mtd/partitions.h. An example is added to fixed-partitions.yaml. Edward Chow (2): dt-bindings: mtd: partitions: Export special values dt-bindings: mtd: partitions: Document special values .../mtd/partitions/fixed-partitions.yaml | 30 +++++++++++++++++++ MAINTAINERS | 2 ++ include/dt-bindings/mtd/partitions.h | 15 ++++++++++ 3 files changed, 47 insertions(+) create mode 100644 include/dt-bindings/mtd/partitions.h -- 2.42.0