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: 5341 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp294348wrs; Wed, 19 Oct 2022 05:23:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5zvldrOwjJ3hYQEFrsGwpygIdWVTX4ezhXjYr0q2KhIy1VoC3rI1tBPZ6pwSd5wSS0M8uP X-Received: by 2002:a17:906:8a79:b0:78d:9c52:2196 with SMTP id hy25-20020a1709068a7900b0078d9c522196mr6633608ejc.328.1666182238207; Wed, 19 Oct 2022 05:23:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666182238; cv=none; d=google.com; s=arc-20160816; b=wK4PjBIwKYpI34svDC+ySE4yipcCtrntnz81tZbxW3KvswIsQIk8igbfR2Y3Yuj7wb Ac7dVkQF10B8Kg5Zz10hrRKDZJOH3d0wF2xxYM32RtKTcaRKvP0OsDu0ohZKXWtz531a 7Qya2n52jC6pm0PYj5U6iFrQybOmjBc8DD5+/BGMq/0WPpCdGMdNUM5Z42+KXaeztUyg MkHbhAC2aYCN26sCgfEMrWiQhC5Rvcnngl1f+L3X7VOVY4TXgki7tKOEbjAHVB0AVUeW q74tX/OZf2ZnIzgzvAs2bbgeaVlc4PQanReMBONz7i3narm3vaBvJKbzOoiuC9NZcpf/ hxBg== 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=/SgthmTOzp3GGabfMw1BGo5g3o2HNTfweNMsL53GOTc=; b=HrNi/1KH1CGAWTmFUuiDIdYNZm51m7VWrZNh693yNtby9ruuTjMyJF6mAEWQKEegwz V8EFSllzushm1ZoBsyHpGLokJfVB+LIKrmeBABwif3EkMxjimt3xr2dMOIiM9JfPAUd6 90L76RYYGeOoS6KQ137PQJtFQzU3Hxe2RsmWW/Lc5LZd6G2xK3XFCwxY/oLcJg5+248y U+/hyCO49FTgdmQZCvfsff5J2YEukiiQWnjLevaupryHKBEdpPHdJ8NQX45KEvC+PNaO v9onH3KgTb5LVmOQYjQCE3m/TzCfaLacoU6HA7L/XTO5S4rmm+HQca9PbexjGbvO8ocS vNZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XznED3sZ; 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 p19-20020a05640210d300b00451d5c11293si11999968edu.496.2022.10.19.05.23.32; Wed, 19 Oct 2022 05:23:58 -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=XznED3sZ; 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 S232764AbiJSMOo (ORCPT + 99 others); Wed, 19 Oct 2022 08:14:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233121AbiJSMOR (ORCPT ); Wed, 19 Oct 2022 08:14:17 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D81B0183D8A; Wed, 19 Oct 2022 04:50:43 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id bp11so28694499wrb.9; Wed, 19 Oct 2022 04:50:43 -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=6SojIR0Txdogg/jNT0iX8FsNtnoWf6Xd6N+u3hiHfPPCjJfEU7oLUHs5QdT4WsS/Xf cVIuNeGAfKtVPKOk9d4zpV2pz62spE8SuCb9JQUGcBBFkhv3N+ylvDcKBO/tgrNuuSHY NdP+RAHWhtBOQTiRkSU8MeiflPjKBwIY97UNkQPXdZz4TAvgVTIc4BjZ9gOn4D9ZFK/J 6tViWhKgz96CPtqHnvkviT6nvVjEsKsQl8hQq5fXeaEpVlKrZ+NuZWo5BONOa+1zRErV L9+gRUZBzxJwMgdHqtMPcGl9b5wcyr4MnfMDNtazP9RFXPQ54A7Xc4Lw48fDG3o6P8FA MxQw== X-Gm-Message-State: ACrzQf1tyQphHATxI1ImyrjZAQa7qSx1NfHkaWqpLhT5z0m5ppNzclBu oAMXEN52HeSzB7OPT+6EJloHqJ/m5Rg= 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-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?1747118706158642707?= X-GMAIL-MSGID: =?utf-8?q?1747118706158642707?= 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 ]