From patchwork Sat Oct 22 21:13:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 7940 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1357015wrr; Sat, 22 Oct 2022 14:17:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4SU30Qxnng8YLgn9vLDFV9qFWqusiO5Q5TU1eDIxRjCkLoLknWutp/COT3tcVLRrGyEmjL X-Received: by 2002:a17:906:5daa:b0:78e:2bc7:f1a3 with SMTP id n10-20020a1709065daa00b0078e2bc7f1a3mr20594758ejv.256.1666473457475; Sat, 22 Oct 2022 14:17:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666473457; cv=none; d=google.com; s=arc-20160816; b=sFojaBPLyf3PkTstILUYy6+6a94UpFz/U2suJOkkiSPB1/envHtzuwOY+cRL13UoDF BH9ntgwggvYcdaTjQgwj+pvD9dVYYlTD2ednIRYoik3/JanNDSxQ+kbCDId9bhfnPoe8 wN3DS+xUU7WSnVfKAJA4QDsdz6Iwy236p8Fkalt1w76fZts/rSFct9xv3yZ6Uor9MWTU zIhZsbhmCUr46uqCk2Jw8bKewkHb/DNw44XSM860WlJ6eANR83J1w64SfdSD6LMMgA8F c/0ZGCJsvgtdmJBuw4ydeEZQSvg2TCfweR/zwzhYgw/2joyj5Kpi3Q5UbpuJEn6ol6ct Xcqg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=C5hHs2S/RQl/JXIwHudGm/5mav5RsuOJ5skKbHJaT7M=; b=X/8g36iMRvp/QtLY6RRkX2Gfg+Qt7qivTwylrGtdC+crvKNVp8n4bm6P2tP7J7CTpZ HLk3vDsGculUB3v1H/zn9GEWj1xWazjIYC1GMzWJpKBJsfC6M8coOBhb+elvBHkpqHsn tWA3iSLA5BwK2MqFV2YrED2Iubb5u1nLQo8grkhljU1fBcfXMzxkZh6gRpqPohqi/x8P y3E3WNiAYfsd4wTM7uzBThNmygE4omW9K8nP+3aOfocsbyxZZjMnGebf7jmv2mRSqO3a ONYf/BUBfbDKsCjip1aJKuq2uyuNHfvz/eyS+UOYMHHGSvXVoMT8SuEJi9lt6QBBOHYZ qzJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NmBEE6eF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gb22-20020a170907961600b0072fc714c92fsi25181783ejc.902.2022.10.22.14.17.13; Sat, 22 Oct 2022 14:17:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NmBEE6eF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229817AbiJVVNa (ORCPT + 99 others); Sat, 22 Oct 2022 17:13:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229610AbiJVVN2 (ORCPT ); Sat, 22 Oct 2022 17:13:28 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57FBC7FF9A; Sat, 22 Oct 2022 14:13:25 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id u21so18125343edi.9; Sat, 22 Oct 2022 14:13:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=C5hHs2S/RQl/JXIwHudGm/5mav5RsuOJ5skKbHJaT7M=; b=NmBEE6eFFqAk065UYolm1o7PT0D3spxPjIpTB1GN4doSOzS/VyF0MqEGtviFaTzcZc kkyskhusTgRHUEXA+SUJWNZZZMtBpySOqUoLqvRB5ZBLRjhEc9KjhLe9c5jK8ry4uTV2 Nk789OK4t4+qNfxNc4QY99Syb9ofJ5Ow89nccso5G+zA4tp0VGicKZTAp9x+JY0nIJAz F+e7O3kIGx94sm6tXjxLuCdaD+lqhx63E8T/5sM8hYbr3w3szKdM8Thn11CAbYOPpln1 t8lbqWF+RU+6NYlfHw/1fmuOYBoXOLkZUGM3TezeU14AoBjoAJHSGDkc9AdSC9EA9b48 y46Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=C5hHs2S/RQl/JXIwHudGm/5mav5RsuOJ5skKbHJaT7M=; b=mCVrS0wvWRyrbI4uwJMat0y8A+hV0Qo4FncYjVra9n6IZRI08gR2dhjsgPeD4mW0RN IGu9putT6zFaJGgkWwM72sBxrWh1k5tyQOe/1vwXjqtZlfPzR1StnC3W96pMWKx8ueMZ AtUZii6TxNR7Yerg1Ec/zXwrOsH5Ns7/isTLvnRmULg6cVx7r+1rOlmJr3p0s9bFeE65 cI0pbGBl3N4o2QxKtvo8l++XRd9A8aBqWpwSJjvULDZhOhauc+XLmv1AGdDtfSPnACxJ EzNL1h4UHF74/v0Pb0CxusB0ReJ8r4+5wE5+Uu549mKJAb8Plfn+QOmUn5qDWQubY3tQ XPag== X-Gm-Message-State: ACrzQf2u5hf2EAQYk02M//TkbooW2wThRO+dsYGUP5o4JYi9WdOTQ+rN IYIyBSEYhAVsnkIzrHEzKVc= X-Received: by 2002:a17:907:3f23:b0:78e:260a:fc33 with SMTP id hq35-20020a1709073f2300b0078e260afc33mr21579377ejc.152.1666473203739; Sat, 22 Oct 2022 14:13:23 -0700 (PDT) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id la5-20020a170907780500b0077f20a722dfsm13382584ejc.165.2022.10.22.14.13.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Oct 2022 14:13:23 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski Cc: Mikhail Zhilkin , Christian Marangi , Wolfram Sang , Chaitanya Kulkarni , "Martin K . Petersen" , Jens Axboe , Andrew Morton , linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH V3 1/2] dt-bindings: mtd: partitions: support marking rootfs partition Date: Sat, 22 Oct 2022 23:13:17 +0200 Message-Id: <20221022211318.32009-1-zajec5@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747424071807013035?= X-GMAIL-MSGID: =?utf-8?q?1747424071807013035?= From: Rafał Miłecki Linux needs to know what to use as root device. On embedded devices with flash the only common way to specify that is cmdline & root= parameter. That solution works with U-Boot which is Linux & cmdline aware but isn't available with all market bootloaders. Also that method is fragile: 1. Requires specific probing order on multi-flash devices 2. Uses hardcoded partitions indexes A lot of devices use different partitioning methods. It may be "fixed-partitions" or some dynamic partitioning (e.g. based on parts table). For such cases allow "linux,rootfs" property to mark correct flash partition. Signed-off-by: Rafał Miłecki Reviewed-by: Rob Herring --- V2: Use "linux,rootfs" as more accurate. Thanks Rob. --- .../devicetree/bindings/mtd/partitions/fixed-partitions.yaml | 1 + .../devicetree/bindings/mtd/partitions/partition.yaml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml index ad3ccd250802..d66a6e3bcb56 100644 --- a/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml +++ b/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml @@ -84,6 +84,7 @@ examples: partition@0 { label = "filesystem"; reg = <0x00000000 0x1 0x00000000>; + linux,rootfs; }; }; diff --git a/Documentation/devicetree/bindings/mtd/partitions/partition.yaml b/Documentation/devicetree/bindings/mtd/partitions/partition.yaml index f1a02d840b12..a25cd23a34c0 100644 --- a/Documentation/devicetree/bindings/mtd/partitions/partition.yaml +++ b/Documentation/devicetree/bindings/mtd/partitions/partition.yaml @@ -52,6 +52,10 @@ properties: immune to paired-pages corruptions type: boolean + linux,rootfs: + description: Marks partition that contains root filesystem to mount and boot + user space from + if: not: required: [ reg ]