From patchwork Fri Oct 21 06:00:50 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: 617112 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp754963pvb; Thu, 20 Oct 2022 23:01:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6eq+v7By46QMWOWc+vNsilhbnKvBpRuWcPJ9dQml0wDzlm4KACidjaR6zmGeIx+XnbSmoM X-Received: by 2002:a05:6a00:1389:b0:566:1549:c5bc with SMTP id t9-20020a056a00138900b005661549c5bcmr17871695pfg.8.1666332102805; Thu, 20 Oct 2022 23:01:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666332102; cv=none; d=google.com; s=arc-20160816; b=Z6x1+FUB8gJTdPPykYvvKkMwAjJX/XxgLVHkvsGccbnOii6TkboBMhbuiNylWlqwxV V+iIiLTQEazPcTo7MC2bIwsmcaCGHuc0bBP5Yw/0p33l0w9q5uzZPmIRasPPdgqNALp4 ZPAxTUb1oYv9SmHkkBhMJ8zqmV3MMG6itvaiV3Wr9fsGcBqrD6QdFFJM2xJpUP4u20SE MHN0dQesNhbDeDAqD04vxSMkL/tx52gIIdYAl4f+aJWHNmj5qR9CVHEv+4CjYcPKBFkN qDlR1i3t4kj+gAl8r0oxFbNuQFk0defIV3Hz+bp7LJqdS47TZmW9LEosw41GVp01MkCX kSOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:message-id:date:subject:cc:to:from:dkim-signature :dkim-signature; bh=374hRwSmZkevQ4AI0K6sO5+2PGRce7OZqN6zJqlIYPU=; b=e7Brvpau4I9zapl9Ej2jeo830mSxceA58B4EAyl3q/sD2P0mtPAt9ZqbY1Z3/VOwzS LH7Jijx0no4tpfN53/dz6SeVFCx20yzkhB+MU3B9n+cTD/DsRTALHzosiOlfo/AwOQj6 B+pSfQeKB1m4xLe3bRpmT2PJBoc5f1moTIolTsX6bXrf+ZNCe4G1fvVqG6tASEzAZiV9 ZLTaAauwyduh1ZBgPPC92k0UJbEFUTK/DYLznED5AY8NnuvtDrble6lo5JqII/Psqkfs Sc2+nLUfdeqQt/lgszWd8TFNs1vMjckWd7DdfSmTHgBRkB1VRmcUT+4hKUdMyyLcYz7F IgXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b="0/o9FzIa"; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=OYP1l1n6; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:3::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:3::133]) by mx.google.com with ESMTPS id h7-20020a170902f70700b00172f32450b7si23462955plo.197.2022.10.20.23.01.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 23:01:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:3::133 as permitted sender) client-ip=2607:7c80:54:3::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b="0/o9FzIa"; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=OYP1l1n6; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:3::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=374hRwSmZkevQ4AI0K6sO5+2PGRce7OZqN6zJqlIYPU=; b=0/o9FzIaCKzahV nr7s+3IFA2mBHG0m3Kiw9LQ5FDM7x82emgOG3sIpyp2Ze4jILaJybmzIbYU8+UO2R0szwloujCzQu nzrNl4CuXocIpI2LkiBNQhD02924jyZG3qyy2cJtMYt59oZDKYDoJbLi9H9SsVzM+Di9ghYGTSpKC OuamH5sElcIg7LbjMnN3vMYeB7rTDmmTnSYNhRh+kqCheSLsVVBT5T8DrCLnJTIY+Cb+ZtJBgTZ6z sIEWf/MrW90lRtfKDgIrrQJVt5ETuUNsJtMUXGBLr76jwwRl+7LarJ+SqGLsEbSb24bZF4s/up07K qIMux9mFNdvKe6SSRcZg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oll5d-005YdL-Nd; Fri, 21 Oct 2022 06:01:05 +0000 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oll5Y-005YaZ-Ro for linux-mtd@lists.infradead.org; Fri, 21 Oct 2022 06:01:02 +0000 Received: by mail-lf1-x130.google.com with SMTP id a29so3386534lfo.1 for ; Thu, 20 Oct 2022 23:00:57 -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=OYP1l1n6nvRFKN66YMNkW/ZD0biklmoqW7/GKmlBQ/5ENQhPpcHwgnW/rNIUjRoyeq mUi4KXWRSDufdZ1cvTW+/XnGUEaYLFilpxFrjNlzxEDxCFeoa4hoLVhGgnokrL4GUPet uKYNILHU9QWMrCKkaYtUezb0B7qpROKi1T0G3/hNigGE37igbdbYuW2uvo4prBisHInc RUEzuiYlVyFbUVo4KlAGbb6R/AWWoEOYu7HdZU0ekJPUOU2oH4HXT/NQl7KkNx7KZB/t L3IccSVZ1ulaB+TjsnFK+9dkyAMqV/YBwlFRErIyCwwNXGnUijQlIUCwJg60u7yjz9E8 xS7Q== 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=JS8XY8EzCxTZTKZcZQyiGzFf5LZ25Bl4ZarcoXIjvKcGeY6XIWtUB6VUj8wnox6ivo vTVyxPMjtYrPLteEiwpxSrK+jPNjsvmdI/JgzBpNqxiWcHV/od1EMicd6B8q1iq7HyHW MnDs6lVTuLwqs+C7FlNJ9akbR+VCphv+il5yYA2y01buWrQX5iOCUl/o7JMWEjnDbCqq mI5I4uuC5Ry97hz/JZCrmiKNdF5HOmfmPcbKziByF9cvOC02MKW03GW17ZOTLlJGCvyP eOMz/Jxe943DYRx43ASi0KQtATOSz/BaAF4vve4YBKvCoy6oQdC5/evXF2oMenMlqi5M nxMA== X-Gm-Message-State: ACrzQf23ZLzMu5T5R/qzm2lXLCIVohqbyEN19RWqph0EX1Up1BdD8s3w DPt8KY1SNeBViRr4nldmU/c= X-Received: by 2002:ac2:5321:0:b0:4a4:3c25:dbd with SMTP id f1-20020ac25321000000b004a43c250dbdmr5837748lfh.406.1666332056154; Thu, 20 Oct 2022 23:00:56 -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 p6-20020ac246c6000000b0049e9122bd0esm3021950lfo.114.2022.10.20.23.00.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 23:00:55 -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 V2 1/2] dt-bindings: mtd: partitions: support marking rootfs partition Date: Fri, 21 Oct 2022 08:00:50 +0200 Message-Id: <20221021060051.2508-1-zajec5@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221020_230100_922957_E1B9B1E6 X-CRM114-Status: GOOD ( 13.46 ) X-Spam-Score: 0.1 (/) X-Spam-Report: =?utf-8?q?Spam_detection_software=2C_running_on_the_system_?= =?utf-8?q?=22bombadil=2Einfradead=2Eorg=22=2C?= =?utf-8?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_original?= =?utf-8?q?_message_has_been_attached_to_this_so_you_can_view_it_or_label?= =?utf-8?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?utf-8?q?_the_administrator_of_that_system_for_details=2E?= =?utf-8?q?_?= =?utf-8?q?_Content_preview=3A__From=3A_Rafa=C3=85=C2=82_Mi=C3=85=C2=82ecki_L?= =?utf-8?q?inux_needs_to_know_what_to_use_as_root?= =?utf-8?q?_device=2E_On_embedded_devices_with_flash_the_only_common_way_to_s?= =?utf-8?q?pecify_that?= =?utf-8?q?_is_cmdline_=26_root=3D_parameter=2E_That_solution_works_with_U-Bo?= =?utf-8?q?ot_which_is_Linux?= =?utf-8?q?_=26_cmdline_aware_but_isn=27t_available_with_all_market_bootloade?= =?utf-8?q?rs=2E_Also_that?= =?utf-8?q?_method_is_fragile=3A_1=2E_Requires_specific_probing_order_on_mult?= =?utf-8?q?i-flash_devices?= =?utf-8?b?IDIgWy4uLl0g?= =?utf-8?q?_?= =?utf-8?q?_Content_analysis_details=3A___=280=2E1_points=2C_5=2E0_required?= =?utf-8?q?=29?= =?utf-8?q?_?= =?utf-8?q?_pts_rule_name______________description?= =?utf-8?q?_----_----------------------_-------------------------------------?= =?utf-8?q?-------------?= =?utf-8?q?_-0=2E0_RCVD=5FIN=5FDNSWL=5FNONE_____RBL=3A_Sender_listed_at_https?= =?utf-8?q?=3A//www=2Ednswl=2Eorg/=2C?= =?utf-8?q?_no_trust?= =?utf-8?b?IFsyYTAwOjE0NTA6NDg2NDoyMDowOjA6MDoxMzAgbGlzdGVkIGluXQ==?= =?utf-8?b?IFtsaXN0LmRuc3dsLm9yZ10=?= =?utf-8?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_record?= =?utf-8?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publish_an_?= =?utf-8?q?SPF_Record?= =?utf-8?q?_0=2E0_FREEMAIL=5FFROM__________Sender_email_is_commonly_abused_en?= =?utf-8?q?duser_mail?= =?utf-8?q?_provider?= =?utf-8?q?_=5Bzajec5=5Bat=5Dgmail=2Ecom=5D?= =?utf-8?q?_0=2E2_FREEMAIL=5FENVFROM=5FEND=5FDIGIT_Envelope-from_freemail_use?= =?utf-8?q?rname_ends?= =?utf-8?q?_in_digit?= =?utf-8?q?_=5Bzajec5=5Bat=5Dgmail=2Ecom=5D?= =?utf-8?q?_-0=2E1_DKIM=5FVALID=5FAU__________Message_has_a_valid_DKIM_or_DK_?= =?utf-8?q?signature_from?= =?utf-8?q?_author=27s_domain?= =?utf-8?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_valid_DK?= =?utf-8?q?IM_or_DK_signature?= =?utf-8?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_signature?= =?utf-8?q?=2C_not_necessarily?= =?utf-8?q?_valid?= =?utf-8?q?_-0=2E1_DKIM=5FVALID=5FEF__________Message_has_a_valid_DKIM_or_DK_?= =?utf-8?q?signature_from?= =?utf-8?q?_envelope-from_domain?= X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org 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 --- 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 ] From patchwork Fri Oct 21 06:00:51 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: 617111 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp754946pvb; Thu, 20 Oct 2022 23:01:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Tb9CJ0LZm2nJtqLGbGW40OZEXmnONBxJjZGdTRh10XeCIzB21Tpi0j6JNm0x7EAisV94m X-Received: by 2002:a17:902:e804:b0:185:5276:7063 with SMTP id u4-20020a170902e80400b0018552767063mr18225114plg.171.1666332101539; Thu, 20 Oct 2022 23:01:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666332101; cv=none; d=google.com; s=arc-20160816; b=h+IFifDozV9Y8t3OIvYrIMpw7ICVXz80XcpxQRGo8Kp8EUbNzN/JmqUFj9vj3GIk1e 8WrsxqQkGnGj1NdtAOzibTpgBXCvaAseCJn7civOuR8zIpgxDuVbIpU6nA0VPPrZiGSU 5AyUD2pmawv6XJE1x30JgRJ87fHu7VluZIm/nW7Jdl+uuLFvePMMpKQIsrYCy9Koxag2 aigc/mBozHI4uva3oKbWpj3g3rnZCVjXkNnGZ7XEi3ZaeXSaSG0/czSMilTZUO6isvUp edSd2Ee5skEEPVtC4X5j4SKkGUQLif3cjEp/i9wrI7ObCQoRn7SW2Fwqhd6bONEoSbGK 3/uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature; bh=1DY8wdPiOLj5svuuObWvfFB2GG1JDiK4afz50q5xMIo=; b=bX+3H3e+dUUjxICjoeRtyQh2G375ZmuWw9y5LEDIpcY49VVU4TwfOM5VQCA8ZzslpU W5DGb9KW55JTIRZWfYI9rzm5vjeEgAd8ZBDcXFyEGcJ44Z1Vsk/toEQ8X4VyE9ur/YUK 5+kHK8z00rc6YxMEFj1BqgOlTUdrFON3Gbe/dCNLQLuFWwmAy1RDlURDOobsJjD5iT0t Yt44GlqxVgF1zr3VBKvpP4j3+DmwFdSEVy+jbRnKhqYnKdPWnSa3TePz0WD52bwIOJyS 87WA8QyyZmoGpD/LAVW4vsAX5UNxIZOmeOZJjNbZ48QxX3MuLWk2cwctfw00NwBJrVFH BkTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=11uRKmqy; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=d1Ic9JTy; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:3::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:3::133]) by mx.google.com with ESMTPS id n2-20020a170902e54200b00176e592a0d4si29556506plf.276.2022.10.20.23.01.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 23:01:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:3::133 as permitted sender) client-ip=2607:7c80:54:3::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=11uRKmqy; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=d1Ic9JTy; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:3::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1DY8wdPiOLj5svuuObWvfFB2GG1JDiK4afz50q5xMIo=; b=11uRKmqyJqi3x0 nckPD2KCD1ZvTotyB4V2RoJIVy0jvEDyn+G9rNf4hBxzomu3qyIBISOKMi/VkLpDUaPVigtblM8cY EyWP0nOG+UVUF/kPOgxQ39xbgmblDa9vKiVW+sBDcl05ZbkMh0Gkwhwi3vT5D2KRdxRaImispHieE pHZSDGk0Txi5j3dsg7YJdv7T9YRxmopc5FiSSmOn7ShFOX1CmDmA4Sa/iatW8YdqrUPXtQBowY2vb rEYEXCgNV1jmarlrwF1kDSZEVyNemVEcVwFcbTzW219tkP8cP2GhuFpTokffZASXFVWnCf4vwm//L 1M2hDU7lhHuluFNs4yQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oll5f-005YeF-L7; Fri, 21 Oct 2022 06:01:07 +0000 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oll5Z-005Yap-MT for linux-mtd@lists.infradead.org; Fri, 21 Oct 2022 06:01:05 +0000 Received: by mail-lf1-x133.google.com with SMTP id d6so3287031lfs.10 for ; Thu, 20 Oct 2022 23:01:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RJ9xIMP9KJSnyP3kmEcAZFEOTKsj48z0+6bhrdbyYmQ=; b=d1Ic9JTyYswqZsEL5SydOKhL435NQPu3xf45ckQx+lh0zbljdQXq32zSHLZSdZhfGK 0NTAOfVvX/A9wGkQREP8rf4nIZ2eIZ5dknqfY6MXMR5wSF0tSbL4i443zXJDCpCu3dM9 LLnBbM0HkC7bE2lEC8Iy4RpSsR3VM4UbZ+Zpsx8RVHF/cPNO94o8MVbVdBkF3vhnNQwW mlkB2aOzr2RpA5I+GZX0sodWgJkknZuegcQYzVXIU+R998qS1zhMaoGJPt1ym+bJXFnj Rx7DyriZhROpSd0A7uzEvPKl8bRHVk8I3Jy7cM6KPFBLtnciJLQ99aHoQQTYutgufa8r Qpzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RJ9xIMP9KJSnyP3kmEcAZFEOTKsj48z0+6bhrdbyYmQ=; b=vh4Mw10jRVLnA5CSWMO3th/RMczPwbZljBL9sV8xJAaYKEjtoIG3YS8j+Saeo24BT1 dKREOeEl/pZoZgXH8+lFUBPQ1mfMEtNNVK8EXVbxTWvzGfoXCcR053FRHQ28d6Tj/oWN f9AAZnVGreId0n6HK7g74HnuK9ASRjoodLm9xM8y/o0QbgtYaGfSQn15OekwN/cp3P/3 kbC2Vz225q6oT+OmC5gW7GHgXKOtHHZP+apRdnb9JKf2YGbXBS0q9A7hRo1RFqD5ItBk kFo2iHcwZ6FxzY6ANnEpJjHum+2ikV21P1KUCLDiPfvRAxms5QiM4i/cnD3k3VauIuE5 pozw== X-Gm-Message-State: ACrzQf0jbTXKd3V4gB+FdlrJ2XDM/x8brazHkjmF4u0FrcHkzPN5bKsw o+rTM/Q985eHbjkTNIjob9k= X-Received: by 2002:a05:6512:11e9:b0:49f:d530:9f25 with SMTP id p9-20020a05651211e900b0049fd5309f25mr6513590lfs.533.1666332058608; Thu, 20 Oct 2022 23:00:58 -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 p6-20020ac246c6000000b0049e9122bd0esm3021950lfo.114.2022.10.20.23.00.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 23:00:58 -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 V2 2/2] mtd: core: set ROOT_DEV for partitions marked as rootfs in DT Date: Fri, 21 Oct 2022 08:00:51 +0200 Message-Id: <20221021060051.2508-2-zajec5@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221021060051.2508-1-zajec5@gmail.com> References: <20221021060051.2508-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221020_230104_125325_E39846E3 X-CRM114-Status: GOOD ( 14.30 ) X-Spam-Score: 0.1 (/) X-Spam-Report: =?utf-8?q?Spam_detection_software=2C_running_on_the_system_?= =?utf-8?q?=22bombadil=2Einfradead=2Eorg=22=2C?= =?utf-8?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_original?= =?utf-8?q?_message_has_been_attached_to_this_so_you_can_view_it_or_label?= =?utf-8?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?utf-8?q?_the_administrator_of_that_system_for_details=2E?= =?utf-8?q?_?= =?utf-8?q?_Content_preview=3A__From=3A_Rafa=C3=85=C2=82_Mi=C3=85=C2=82ecki_T?= =?utf-8?q?his_adds_support_for_=22linux=2Crootfs=22?= =?utf-8?q?_binding_that_is_used_to_mark_flash_partition_containing_rootfs=2E?= =?utf-8?q?_It=27s_useful?= =?utf-8?q?_for_devices_using_device_tree_that_don=27t_have_bootloader_passin?= =?utf-8?q?g_root_info?= =?utf-8?q?_in_cmdline=2E_?= =?utf-8?q?_?= =?utf-8?q?_Content_analysis_details=3A___=280=2E1_points=2C_5=2E0_required?= =?utf-8?q?=29?= =?utf-8?q?_?= =?utf-8?q?_pts_rule_name______________description?= =?utf-8?q?_----_----------------------_-------------------------------------?= =?utf-8?q?-------------?= =?utf-8?q?_-0=2E0_RCVD=5FIN=5FDNSWL=5FNONE_____RBL=3A_Sender_listed_at_https?= =?utf-8?q?=3A//www=2Ednswl=2Eorg/=2C?= =?utf-8?q?_no_trust?= =?utf-8?b?IFsyYTAwOjE0NTA6NDg2NDoyMDowOjA6MDoxMzMgbGlzdGVkIGluXQ==?= =?utf-8?b?IFtsaXN0LmRuc3dsLm9yZ10=?= =?utf-8?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_record?= =?utf-8?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publish_an_?= =?utf-8?q?SPF_Record?= =?utf-8?q?_0=2E0_FREEMAIL=5FFROM__________Sender_email_is_commonly_abused_en?= =?utf-8?q?duser_mail?= =?utf-8?q?_provider?= =?utf-8?q?_=5Bzajec5=5Bat=5Dgmail=2Ecom=5D?= =?utf-8?q?_0=2E2_FREEMAIL=5FENVFROM=5FEND=5FDIGIT_Envelope-from_freemail_use?= =?utf-8?q?rname_ends?= =?utf-8?q?_in_digit?= =?utf-8?q?_=5Bzajec5=5Bat=5Dgmail=2Ecom=5D?= =?utf-8?q?_-0=2E1_DKIM=5FVALID=5FAU__________Message_has_a_valid_DKIM_or_DK_?= =?utf-8?q?signature_from?= =?utf-8?q?_author=27s_domain?= =?utf-8?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_valid_DK?= =?utf-8?q?IM_or_DK_signature?= =?utf-8?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_signature?= =?utf-8?q?=2C_not_necessarily?= =?utf-8?q?_valid?= =?utf-8?q?_-0=2E1_DKIM=5FVALID=5FEF__________Message_has_a_valid_DKIM_or_DK_?= =?utf-8?q?signature_from?= =?utf-8?q?_envelope-from_domain?= X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org From: Rafał Miłecki This adds support for "linux,rootfs" binding that is used to mark flash partition containing rootfs. It's useful for devices using device tree that don't have bootloader passing root info in cmdline. Signed-off-by: Rafał Miłecki --- V2: Use "linux,rootfs" as more accurate. Thanks Rob. --- drivers/mtd/mtdcore.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 07249af4f890..034b06aff660 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -735,6 +736,12 @@ int add_mtd_device(struct mtd_info *mtd) not->add(mtd); mutex_unlock(&mtd_table_mutex); + + if (of_find_property(mtd_get_of_node(mtd), "linux,rootfs", NULL)) { + pr_info("mtd: setting mtd%d (%s) as root device\n", mtd->index, mtd->name); + ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, mtd->index); + } + /* We _know_ we aren't being removed, because our caller is still holding us here. So none of this try_ nonsense, and no bitching about it