From patchwork Wed Oct 19 11:48:54 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: 616431 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp229961pvb; Wed, 19 Oct 2022 04:50:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Vh+oIRAVpdKPv11O/y01C8/tahuZyt2YzsqXJNuCv1PqKnpM88xtEpLxcHfEBxeLuRPWE X-Received: by 2002:a62:5202:0:b0:562:d28e:f715 with SMTP id g2-20020a625202000000b00562d28ef715mr8251696pfb.26.1666180242164; Wed, 19 Oct 2022 04:50:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666180242; cv=none; d=google.com; s=arc-20160816; b=j1Q6QS6VO3x7gBwvQzOMJEkEYqM4oC8QPurXGh/Rg0+62w3VPYS5DLCrWvs9NIY+T+ jqFlTM8GP0qtzMu34zKt5V5q+YJVPtUcUrlqM7Xp/I53qA3Z2aU4S6zbtVm7JV0hwtDr YPYRhb9FqnzWu6nlGYauCSWGfXbR5dSBHRAY4w6HV+V3/bCfh8i4A/kUT4EjzxNFhXbH J5yjdwmcpjBqhO4lHrY31Hn2hxjmWk2D16eW/eB35KsWELn9oUYs/o+y+G1rip8N35rt S22PWA2ZSneQySGp+VGqoMJSU3nJy0+Xg3akPyOAW1F2w74g05dSTXCxj3N8TSV1dB/E 6V5g== 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=26WLv8Q1bZar7IQYdcjhWP5pP2Dv6e2vDA+ztLrwKUA=; b=Um4HSBeSuN1IhjRekfZMkGq6ePTscB8UUQJBtyk+QeMpoeNf3Bs+rjFxJ3Z0deqwmB HT273wUQEyxNgGxcm55N7fSv63P/zHeVnSVwMc2njSbuTuChAYGsA/0z5xvoRzUj2V0L D8p/0R4EWQrv4juVfFWoG+khUlH42o+l2F46bHPzOk5tlQcXR7F1wWrJfKaoUjWovoGI ZvCPuEkM45yxrG6kpHFIu5cwvLrQdcDvuj6B4F84QuyLxwxOpez8+5Mkx6wnOf21Cx44 dqZpYXlmKtrMfhC5oOibFwS2Nv/yNBNMWXrk3HHdpzqX3ucQ1lf0jHEHWWJQ3yOBTXoL AHfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=4uMlQsPW; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=XznED3sZ; 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 d89-20020a17090a6f6200b00200934a5a53si501251pjk.29.2022.10.19.04.50.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 04:50: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=4uMlQsPW; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=XznED3sZ; 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=26WLv8Q1bZar7IQYdcjhWP5pP2Dv6e2vDA+ztLrwKUA=; b=4uMlQsPWSuR9dD /q5GRXlgLuB+X0MiPNKBMl7eg/uf4QRkOvXlel3lsQ5iIK7bsr3FhVqkIpoqSLJuh+Bi+8B7H2ilz S7KGpQh2NnFGWVdXwoVAhbo9qJM3dR/kgPSM2m+T4N2AMZ3tq6nyMKB5NKMvF1RS2wmtJkda/kTxK S/9dVrj9KQsCEd58Ck3mEZSrq2AG9e8aa53JJPlsAEG3K6dlV/rKY+S0BwhdOH84N+HGdsGOlDS3U Ez3rL9tjw5FrhmGB0KyiJrnxgz8HWFqdP4AmwF6f9fnCTAzIhH9fUoFOntEfwg/PEMmV0FlF30MNj U3kyjG38haDGo9G10X5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ol7a5-0011gK-3q; Wed, 19 Oct 2022 11:49:53 +0000 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ol7a0-0011cX-TI for linux-mtd@lists.infradead.org; Wed, 19 Oct 2022 11:49:50 +0000 Received: by mail-lj1-x229.google.com with SMTP id c22so20481725lja.6 for ; Wed, 19 Oct 2022 04:49:45 -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=/SgthmTOzp3GGabfMw1BGo5g3o2HNTfweNMsL53GOTc=; b=XznED3sZp9svoyHkLA1j5DhdbO8l+nPvuyUqWZcMwP52T0KIuuQWMrZIz7p9JrYekv sUzIoYPZXBgeqkGX7wYNW9wgLVaWBTZMMYETm/qxREwkGqRI+pg2cmwkNFAvyPUa4PjM xpX/x3WKxWVoKPUEV1KEJdoOszoC69e8Afbn7Aum9e0FJYhz9MemAWhhWWqOF/VgTZPc qSljtj7HUICXFDKR3YXI7ogC7F3bOK7tCOJ8hq1PgYVSkj/nwVVZAZ4Lja3RcToN9U2I eVk/3TWf1bfoMCH67WoNWUvOUyDNPjg0YWCWBwJtm/jGVl7GVSRdg5qrHZRwLblO+iy8 FeXw== 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=/SgthmTOzp3GGabfMw1BGo5g3o2HNTfweNMsL53GOTc=; b=hqpkw96gqpZwwo/J0fyUqfIm3PTkkNXDP012LZko8MDo3i/RdUIkG1gzNT5UWWBcn8 +ddLAHSo6mspiQHTL8f9cg3TwB60d+t03Pp16BMNYOYHbaIWs388ytCo5eM8b5FQodYK LizQ4nPAmz7L8xr0L8C/EaygcZpd7UCAjBRGG8UiSSiW+StLYQ2JiEAaZcrONWLqwuMd mK8YhHUxvViFApKYEd7ChZPeRM/zGB79t1bORtZgLSohiKuwXbsYJhUpqGBa9t7+LAFV CbCtWMA+JXttf0DJV4WSGz2z/ME4j+9xazoZPVPbavhDRzYDjMBJQLWjLKRTB8BTyhd5 HsFg== X-Gm-Message-State: ACrzQf2DhBtBkmixq3LzL7t2E0fYNNiIPgPyIVes0TgXYWN8mbpYmVQ9 RnMQ4GV56U5hFslBuQXqBSTQe0L8ocI= X-Received: by 2002:a17:906:eec9:b0:73d:c369:690f with SMTP id wu9-20020a170906eec900b0073dc369690fmr6449809ejb.767.1666180173514; Wed, 19 Oct 2022 04:49:33 -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 fg4-20020a056402548400b0045bef7cf489sm10186308edb.89.2022.10.19.04.49.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 04:49:32 -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 1/2] dt-bindings: mtd: partitions: support marking root device partition Date: Wed, 19 Oct 2022 13:48:54 +0200 Message-Id: <20221019114855.31639-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-20221019_044948_986646_B9BFCD2A X-CRM114-Status: GOOD ( 13.91 ) 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?IFsyYTAwOjE0NTA6NDg2NDoyMDowOjA6MDoyMjkgbGlzdGVkIGluXQ==?= =?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,root-device" property to mark correct flash partition. Signed-off-by: Rafał Miłecki --- .../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..e627085df4fc 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,root-device; }; }; diff --git a/Documentation/devicetree/bindings/mtd/partitions/partition.yaml b/Documentation/devicetree/bindings/mtd/partitions/partition.yaml index f1a02d840b12..671906acf1bd 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,root-device: + description: Marks partition that is a root device with filesystem to mount + and boot user space from + if: not: required: [ reg ] From patchwork Wed Oct 19 11:50:41 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: 616432 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp230316pvb; Wed, 19 Oct 2022 04:51:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Ww42ar8G8ANVxLXGiMuhtLxieyBBPDOuKznvT7CGJu8+qNnWjZtsfj6omh5zc5HXU6a9z X-Received: by 2002:a05:6a00:14ca:b0:563:9296:f34d with SMTP id w10-20020a056a0014ca00b005639296f34dmr7899928pfu.64.1666180288574; Wed, 19 Oct 2022 04:51:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666180288; cv=none; d=google.com; s=arc-20160816; b=tbLL4elxM8mcZg+8QQgeYfwNW+JiDQAY8BW6fU4cPOEl2WW+8HTJ3TsFakPJK0fCaR iRYFpdOrtJcMCMmD1tFygT7E7xyaTkt7Ma0YBkQEXOxuTHDX0g5lo8csoagwjZr9bS2Q V7G0zMZieZDFAXiS3CfDYwbUQtqck7ZP9cZlv5H4H7yUCM+gQAqxbmO07Bt76GaWrxhi Clay0IjK5IaWGFsAe7aEpZBykHSic6HpnpMRHjmGx3bRvz0lFf+QIpXZwbFf1IUVkVvv lqZIDuorbnKJoLXSZXLFF+nEn8HoIfrD9UO1VLD0eCZGElJEQDILkHnRpz5MbHLyLURN sA/w== 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=5GofMAh/0/MPviBLYjXQ06sBtoQ+/j0jYrVJnKDv6dE=; b=wsix8m+2k5D2NVIWD/wORG6bvZG3Mqz1u50X6IJI1DThTvoGsUOS4CU+rWBDo6JfyZ PZDLpZJXv9Jk8dNV7hIsyyFy/qo/2rJkcLW65OAUuvY3hP/AqXdzbWkggPyqoCb34ozN 3VbGeVewOq8Fc9SM11fx7up/fFKS//t+sg+QHDYaz7D8T+qsVqbI6hNLYtjTNnfgUS0I msS+DPMY9h8SpDOKAJjz4uVxnz7IcNaQ41LqwufiooQwUz5GgIMOI5f4ccA0HD3bY4HX V868oxlnABhfW05SY99NMrgmUkROQNQgfRICV4UlgI18NHnqeqyZzAdzzieLssxMWnZJ v9gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=CGMdZlaP; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=OtokJ3G5; 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 ne6-20020a17090b374600b0021011c16872si759398pjb.44.2022.10.19.04.51.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 04:51:28 -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=CGMdZlaP; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=OtokJ3G5; 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=5GofMAh/0/MPviBLYjXQ06sBtoQ+/j0jYrVJnKDv6dE=; b=CGMdZlaPPcZgY6 lxYGKekPht41b/gDzfTiECM9iN6e3+Ujs1GAod7vI9Pj3P35X137tVh4RIpUmMzHbiqeQ0DY6PxwW CYdY7Y/YT3d94Bo0ERYSy4FfUDrstyh4nQWyn11oF+J15CLLraV6orxtmzEejOGzVSKBcQJLUI40V 7JW4YddIyBRLSgDSjox6S3hHKtEnD5eOaFVtXiUYbM9eL/fhYAv8PWNEx0Gc9FeOI8QJV8nrnOfbO CiKEYqXifZdxv/c0sZKyXqgjqJgYC0fjx17fFPEDwMp1Bq5oBj/2qWvkYpEO7hkFGD1Ay8SlwSX/S 9QTSIUsh/qcTqk87U6RQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ol7b2-0012D8-Jm; Wed, 19 Oct 2022 11:50:52 +0000 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ol7ay-0012BB-JA for linux-mtd@lists.infradead.org; Wed, 19 Oct 2022 11:50:49 +0000 Received: by mail-ed1-x535.google.com with SMTP id r14so24856649edc.7 for ; Wed, 19 Oct 2022 04:50:48 -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=yTGwtjY7Qx3UHK834yfCMHLL0TaAs+yVt4csz4H7rFw=; b=OtokJ3G5ZiLF/OC4iEJMusA6NeuqVEVdAZ9v0gKZ8M5SVAINXZqwJnLLxNhUZUgn8R Q7gUdiErZk0QhUbU84FHgDdN+NzKzliyYGENPzQm0dU8dRuZrN4SxXvFchaXy4nCYdz+ 9m8rfs2Wr8KKCpoURG3k9LjtOE1djHUFfUWmOGsjHt90WSAMwlXlepZVemcfXbkZV882 j1JEIpQJk7vhe8E/4jkP7JzjmN5G4sHQ+WWbRkhH6rjTLvP+rBW440/lpRqjboaxwzsm 78L82AZScEuO4G8Pu7+oje4nyPKYFi1KhoQQibGXkee3QvlrxpWsuo1+dkPwB0MXStJt 3blA== 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=yTGwtjY7Qx3UHK834yfCMHLL0TaAs+yVt4csz4H7rFw=; b=CLoHERwmHUNnZGGGMiiYsj4SXUyx5mLuisVtCBlgpcI56fzpma3WdsXuc//RFrDO3/ pARcL2sNybPIcnMngpLBVJEhHvPLI1m8zoVCYqp1eeCu9VhXhWUVQO5wAhEJHsdo43m0 AujcdVaCcxYrjxkA1AjCabSjAQ4K2MMCNo+GIR10X1EPnZ8+4ryBIIQoDmJj5KHQ8nGK 5710nB2Ddynu9n8H1/PB2jTM0K+Xwak5zBL/5SP6b1Sbw6rjlo0ypGgn7kyKcieiQ8KC RSxo3JIC0xsA/0WlKshQMIVtIYYmIwMv5ol15Pp7UocGajhfrZx00D/HUTctReibTyym avIQ== X-Gm-Message-State: ACrzQf0fPNuWlQv8FyENG3qlgvh2YDt8/FZMijHoSWUudntZyfJaaZLj K5YB4U77hs/olLpfBVmSrFs= X-Received: by 2002:a05:6402:3709:b0:459:279e:fdc6 with SMTP id ek9-20020a056402370900b00459279efdc6mr7180563edb.338.1666180247042; Wed, 19 Oct 2022 04:50:47 -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 dk24-20020a0564021d9800b0045b910b0542sm10377884edb.15.2022.10.19.04.50.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 04:50:46 -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 2/2] mtd: core: set ROOT_DEV for partitions marked as root devices in DT Date: Wed, 19 Oct 2022 13:50:41 +0200 Message-Id: <20221019115041.31805-1-zajec5@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019114855.31639-1-zajec5@gmail.com> References: <20221019114855.31639-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221019_045048_676112_64E72D21 X-CRM114-Status: GOOD ( 15.01 ) 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=2Croot-device=22?= =?utf-8?q?_binding_that_is_used_to_mark_root_device_MTD_partition=2E_It=27s_?= =?utf-8?q?useful_for_devices?= =?utf-8?q?_using_device_tree_that_don=27t_have_bootloader_passing_root_info_?= =?utf-8?q?in_cmdline=2E?= =?utf-8?q?_?= =?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?IFsyYTAwOjE0NTA6NDg2NDoyMDowOjA6MDo1MzUgbGlzdGVkIGluXQ==?= =?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,root-device" binding that is used to mark root device MTD partition. It's useful for devices using device tree that don't have bootloader passing root info in cmdline. Signed-off-by: Rafał Miłecki --- 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