From patchwork Tue Aug 6 11:41:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1969438 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=DCRZJGwP; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=T9X9Hq9c; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WdWcB1cf7z1yf3 for ; Tue, 6 Aug 2024 21:41:46 +1000 (AEST) 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:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lSDJnBo3zSf3PD2Zc1A+jNvuPIyojVTeBnT2/54gbo8=; b=DCRZJGwPMRB09y x7vosyNY6a2F2xBdx0ekwoa0irAa+43KPutHWC8S+gQdpO+8oFWH5/RhvDSIUUoaJjiAnszqH4I06 kwGRJuNd83/yqUCqo9sqkXMBksBoK5m5wfRuFTe0H2gQM17n+xEHfLqkVAW2/2Y/MXbx2EoiSD1dE /58qH3lkFmCsMiV4vnAU/PxaERnlQPZTF9CbcEWexsglEo+Qzi+Sh4XyAaHsTDLOtvDhKbtTM5N/s TLKxKOJdVjfoyHhaSrCwuYeU/cknwpn1KKKDNu/gKRz+hMvIhw0eWjFZpK3dtAMuArFWX6NTnz8cZ ZF22PDjf8JClnOr0QEUQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbIZK-00000001N7w-0rcq; Tue, 06 Aug 2024 11:41:34 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbIZG-00000001N5Z-0u4D; Tue, 06 Aug 2024 11:41:31 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-42809d6e719so4110815e9.3; Tue, 06 Aug 2024 04:41:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722944488; x=1723549288; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=N4Tqx/xl+do4nmfv0ZFIXdX55krJHtI/dy8e3uyNR1Y=; b=T9X9Hq9cYSUIQl96He+wls/WTMNw9OGH1tdQU8QfT5sn9bY8ODfQvCuP0fwusNqwSj ng37RWj6IIkaxUNWANmhPbN5XR8y9WxMCCBfGzc9kF5lbrugRmjusvF1q2waUGG03Zkm wkPal94Hj++/YE4IgnJPHeYudP2DFc5cl8nLJkGIf016xv8qvNkeVoe7W3HGiwwupcct 2ZL7m9ziPIQvDgD4qAoLpK0nfuP+UJoG5932HlipWPB73Vxvfhs1nsNUDNaxJeMTfgJi AN99wWqGNEllDFjal4L/xEeHhGnzEbHVxLaPPkcqGxFRM97RQHnK/2wMNT4Mp6AIH7qE As9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722944488; x=1723549288; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N4Tqx/xl+do4nmfv0ZFIXdX55krJHtI/dy8e3uyNR1Y=; b=D0Pwcav0TX+YDeY1uEmbd5Jhu3UNXW44GyWIRVuWyA3NvkJDIm8YaqkNAWuQoA8Dxk 92oeDkkqSOdlodRj2Uso0Cqcl55/wMiL5SuAh6KJVhT31kmJ+PRhGKw5E7cItBFtisi1 NkeTIoNxKfFCZRNgF91KaG2Wo97xau2NcoX+jwDvHSs4YTKOPUXV/r5kwG5Q52aKfsmT L0m1G3FA074Lq13kOycJO8oELYpSQt55qmw1ATzqPclldd7aJrPZUFtkPcJYRc4eENXE u5u4p8DUozUK9KF07jaTVyU3zevBSq3K9D4sTr8XqLY5dfDlRYrWbRKVHt1yqAB72lih LCIg== X-Forwarded-Encrypted: i=1; AJvYcCWeggxIgUc52Yr6jSNAtWByGb1slDpk1kTy9VSSvsWgGflr2FNxRwMdkWQUAW2ep0kyeFF6lsPj5EcLwVmU9QSkwAtAmvQTxezrsC/hfKrRffyfAQn6k4tS8Y3tyX7tqEDkx4maaSR2EsZ820nJ X-Gm-Message-State: AOJu0YwNylpTW3HS8zpTCgBZ7UrRSn9HcTz2ih5VE5VfIwmsmHkLxlRV 3+ERtuPM0GHNbeiKgKhvJrj+464k05LHBp25WoSsGdS2l1MitOp6 X-Google-Smtp-Source: AGHT+IG9k8L6rRkA1Va2sD8UO032mLhZSWZwsxwXlldLySXDGaw0sRlChwet0LU+bpg2jQOFstrw/Q== X-Received: by 2002:a05:600c:4f0c:b0:426:6099:6eaa with SMTP id 5b1f17b1804b1-428e6b7c61emr101771725e9.26.1722944488151; Tue, 06 Aug 2024 04:41:28 -0700 (PDT) Received: from localhost.localdomain (host-87-6-196-30.retail.telecomitalia.it. [87.6.196.30]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-428e6e7cce6sm176105845e9.31.2024.08.06.04.41.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Aug 2024 04:41:27 -0700 (PDT) From: Christian Marangi To: Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Joern Engel , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Christian Marangi , Wolfram Sang , Florian Fainelli , Thomas Bogendoerfer , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-nvme@lists.infradead.org Subject: [PATCH v3 1/6] dt-bindings: nvme: Document nvme-card compatible Date: Tue, 6 Aug 2024 13:41:11 +0200 Message-ID: <20240806114118.17198-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806114118.17198-1-ansuelsmth@gmail.com> References: <20240806114118.17198-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240806_044130_270287_750642DC X-CRM114-Status: GOOD ( 14.85 ) X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Document new nvme-card compatible to permit defining fixed-partition in DT by the use of the block2mtd module to use block devices as MTD. Signed-off-by: Christian Marangi --- .../devicetree/bindings/nvme/nvme-card.yaml | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 Documentation/devicetree/bindings/nvme/n [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:335 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [ansuelsmth(at)gmail.com] 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+incoming=patchwork.ozlabs.org@lists.infradead.org Document new nvme-card compatible to permit defining fixed-partition in DT by the use of the block2mtd module to use block devices as MTD. Signed-off-by: Christian Marangi --- .../devicetree/bindings/nvme/nvme-card.yaml | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 Documentation/devicetree/bindings/nvme/nvme-card.yaml diff --git a/Documentation/devicetree/bindings/nvme/nvme-card.yaml b/Documentation/devicetree/bindings/nvme/nvme-card.yaml new file mode 100644 index 000000000000..20e9a877fac4 --- /dev/null +++ b/Documentation/devicetree/bindings/nvme/nvme-card.yaml @@ -0,0 +1,78 @@ +# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/nvme/nvme-card.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NVME Card + +maintainers: + - Christian Marangi + +description: | + This documents describes the devicetree bindings for a NVME controller + child node describing a nvme-card. + +properties: + compatible: + const: nvme-card + + partitions: + $ref: /schemas/mtd/partitions/partitions.yaml + +required: + - compatible + +additionalProperties: false + +examples: + - | + pcie { + #address-cells = <3>; + #size-cells = <2>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + nvme@1,0 { + compatible = "pci144d,a809"; + + reg = <0x00010000 0 0 0 0>; + #address-cells = <1>; + #size-cells = <1>; + + card { + compatible = "nvme-card"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + bootloader@0 { + label = "bootloader"; + reg = <0x00000000 0x00080000>; + }; + + tclinux@80000 { + label = "tclinux"; + reg = <0x00080000 0x02800000>; + }; + + tclinux_slave@2880000 { + label = "tclinux_slave"; + reg = <0x02880000 0x02800000>; + }; + + rootfs_data@5080000 { + label = "rootfs_data"; + reg = <0x5080000 0x00800000>; + }; + }; + }; + }; + }; + }; From patchwork Tue Aug 6 11:41:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1969440 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=dFaQS6+2; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=J8en9XFr; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WdWcG2ZBjz1yf3 for ; Tue, 6 Aug 2024 21:41:50 +1000 (AEST) 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:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pQNjTwW+MOpp9C5Q/MHr5cvRe4inORamchhN1WnnaDA=; b=dFaQS6+2O7S5Fl ZLBWjDfp4rR2p82YvOKmpDskjGubRJOKV4Q5oFWVudAQT5kOz4SWtvgEp7si20NDTAYdAMe3YFWBx FS4wBLCBhmdqBi8141UYmtHONpZK+zTdDXsvO7l8CTpF0xOlKZjQFB6cdQNxXsJHJTOjUi339RueM l5F9gyyc55pq8L7SJuDtGmRY/EjNv0z9VNowR9BIS52sJ8JtlBBrSCOfR+5nbh4w9JduySO5R1qMD XJmna9qZEp3C+4sCl84fx1P1uURTUsTciC752B79vWEnkgoaU78ppiQK45mOei8MxzwiuTttwVESg SykMoYZ1BEMPQTqenFzw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbIZO-00000001NBK-0ybO; Tue, 06 Aug 2024 11:41:38 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbIZI-00000001N6G-0NrU; Tue, 06 Aug 2024 11:41:33 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4280ee5f1e3so3231425e9.0; Tue, 06 Aug 2024 04:41:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722944490; x=1723549290; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=NJElgdSeo7tFBhUWI5Y2VGkmcaarTUGB2bJhxj7nOts=; b=J8en9XFrmTlOEDb59OGPUWxGALmDK4VdFS/AmOO97xdELTkDTkArk+0W+3pPGNAzW+ vZ68aDnLgaQ7ol5mh8dulSTRLnylsopakjafWACJSNjmZvet40ci8WeD/Wf/FktPeslo NAn05nC3KeoTS9Q3g2ypiHhcY7ee9vYZ9/2pa7rUUVDlmDF3SilINHGc5QAIsCET/byA iQc9IbRAefYANv92ALF3/dvvoTR3HNSBF11uKXh/QCw++Kgt1HWN/TuXe735oNr5sgax Tn7bHen0U2ZZFeZEBcIAf8Y8jJl7u8X+iQ4xfEL4wgyLNPR7XO7xdbDHlulT3duzdTng JqtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722944490; x=1723549290; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NJElgdSeo7tFBhUWI5Y2VGkmcaarTUGB2bJhxj7nOts=; b=Azky0UwU/ay7gfUXJ1R8zj4N4VUIeE/DbLvh+EzKJ16ZdfE7aDgMxdeBvzZ/FeOT9k JZij9OCkY6d+/diEIvzl0SBuSYSkWpO0qpRY3EjfPqvkOD7Q1NbxDCZC1TJxzIzFAWR9 2AOcZVqKb+BxqsHFrEdSUJO3+wzJHIQQPOWYcXr+0ln4NmyozzIQDUJB7zqNe8rnWxyQ iU1udor4oq+nBaorPuPepwa/MHY8fgzR3S5TSHp+fKggekQnKJs2i1dSPfJO8CtcO4k6 GaEXxUkmbkrw1Tb2o+R45ddE5nKyLyVIhyu7NOZGayLsUHW7d3AyNiUpY9OdK9OM1kGP 9KmA== X-Forwarded-Encrypted: i=1; AJvYcCU60UzX66S6QBUH7kzL0qg0Rz2rD6sk6TLNhysvS+Yd/el8CX5k9Cd3bV2uAbATU+39bAtKSJ3yhxSKH68BBvTsTu2CHeMpW59YY2pJLUczyI6vkOWV6+dRsPAIdlRPjhDGdmIKNkqYjIVE2c7k X-Gm-Message-State: AOJu0YxK8enW5cZjcD0wfC1CwfCCRUk4j+NIlgUQy6WJ0epaAbpTezkA DR64xwrOAn1sNCBC6ylO7lyBLhFGlAZFjoDWUSUdWPDPHd+BO+Me X-Google-Smtp-Source: AGHT+IHsLBFQO+J/lS62zM2qc6hKgOhyDSFxfwIUq3wJKk0pA9FyD5Jiwj6/3xBLV/JtPtreeeXWCw== X-Received: by 2002:a05:600c:4e87:b0:426:60b8:d8ba with SMTP id 5b1f17b1804b1-428e6b7cab3mr105454325e9.28.1722944490056; Tue, 06 Aug 2024 04:41:30 -0700 (PDT) Received: from localhost.localdomain (host-87-6-196-30.retail.telecomitalia.it. [87.6.196.30]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-428e6e7cce6sm176105845e9.31.2024.08.06.04.41.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Aug 2024 04:41:29 -0700 (PDT) From: Christian Marangi To: Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Joern Engel , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Christian Marangi , Wolfram Sang , Florian Fainelli , Thomas Bogendoerfer , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-nvme@lists.infradead.org Subject: [PATCH v3 2/6] nvme: assign of_node to nvme device Date: Tue, 6 Aug 2024 13:41:12 +0200 Message-ID: <20240806114118.17198-3-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806114118.17198-1-ansuelsmth@gmail.com> References: <20240806114118.17198-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240806_044132_206150_6DB67FAE X-CRM114-Status: GOOD ( 15.08 ) X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Introduce support for a dedicated node for a nvme card. This will be a subnode of the nvme controller node that will have the "nvme-card" compatible. This follow a similar implementation done for mmc where the specific mmc card have a dedicated of_node. Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:32f listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [ansuelsmth(at)gmail.com] 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+incoming=patchwork.ozlabs.org@lists.infradead.org Introduce support for a dedicated node for a nvme card. This will be a subnode of the nvme controller node that will have the "nvme-card" compatible. This follow a similar implementation done for mmc where the specific mmc card have a dedicated of_node. This can be used for scenario where block2mtd module is used to declare partition in DT and block2mtd is called on the root block of the nvme card, permitting the usage of fixed-partition parser or alternative ones. Signed-off-by: Christian Marangi --- drivers/nvme/host/core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 053d5b4909cd..344523274d1b 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -4651,6 +4652,7 @@ void nvme_uninit_ctrl(struct nvme_ctrl *ctrl) nvme_hwmon_exit(ctrl); nvme_fault_inject_fini(&ctrl->fault_inject); dev_pm_qos_hide_latency_tolerance(ctrl->device); + of_node_put(ctrl->device->of_node); cdev_device_del(&ctrl->cdev, ctrl->device); nvme_put_ctrl(ctrl); } @@ -4771,6 +4773,8 @@ int nvme_init_ctrl(struct nvme_ctrl *ctrl, struct device *dev, else ctrl->device->groups = nvme_dev_attr_groups; ctrl->device->release = nvme_free_ctrl; + ctrl->device->of_node = of_get_compatible_child(ctrl->dev->of_node, + "nvme-card"); dev_set_drvdata(ctrl->device, ctrl); return ret; From patchwork Tue Aug 6 11:41:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1969441 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=26L3oJpt; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=A94PNFhg; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WdWcR2KYsz1yYD for ; Tue, 6 Aug 2024 21:41:59 +1000 (AEST) 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:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oa6DcZChtVfsdSlC1EcT5LNZkRFInVx71Gajvm0THCA=; b=26L3oJpt28R/TX UcU4t5quOxTNieKyE666DelpKIQXJ+eS5FqO6y5piAyLLlo2h/Zm1ffqVvh6MbzlmtM2IRUA46gCW EB50diJYwRrACBeLxu9lY8ItCCC6Wa1MEPk8kpmieSXDlDRwmu4Eq0XlG/udxavJKmgvFi0ninTGr cdqiTatVtQY+rlzlnwcNweaw3WC/5h9ct5kmg2FGUSzxDUAnt/YNldQ1ea29EpkNSUy6z48iaWGIk wQiRgzF9tKl5R1CMO5jk+qoqK2dUf6PpctJhFc0XgEQKVdDGZeeoZ2+X2mH4kjwqYPPUXznhApML9 n38hHIhWoDq5GUQPm5Lw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbIZY-00000001NJs-3Vle; Tue, 06 Aug 2024 11:41:48 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbIZK-00000001N7a-1uAP; Tue, 06 Aug 2024 11:41:46 +0000 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4266dc7591fso3384585e9.0; Tue, 06 Aug 2024 04:41:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722944492; x=1723549292; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=zJtL0MfF3HGZoWE7QS0/OcrDoRKxdV59VhkJ0rmXwsw=; b=A94PNFhgxfu/rHv3OEq2RS9Nlsmhu2iv30n7oTiy2yavsHLf7esv924cq1c9zrJ9/d +EPZiFzqkUYP52xqbpubQ+bP/jz1nPJYLoEHHblVFxcoWI8fS7CMhk8qB+2xrzHkCzLZ uoclFOdR4cac9R9DfZ1J2P4K94jLIC6SB8lUSlFpRzTc6JeYSWNrzgO2eXDEg3i/HtS9 SgRgSmnwFsoxgG15pWpJD7ufkfgRvWTWHLwEeS9sSg79w8tlkVrct+E5ZqXr1BwI7lct Yxfmr972Helj+rMcIfIDCjnxxzCU/1duRJg86EDh3ynqAHXPxNSmAPfXVrmO98AVJU4/ FBAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722944492; x=1723549292; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zJtL0MfF3HGZoWE7QS0/OcrDoRKxdV59VhkJ0rmXwsw=; b=JCOLMKph+I9+G4bhMKhbRY5cxoXxuUWWwcYsc61ixzWB9oeH1GgdLquU0B6WjJg21P Dd0Fku3wCVMVqpekcsOuNw/1m4oUsv99FP2uVfbEo+dR4819Quhtb/7GSVTBzFT4+FJ1 XV6gvllfqNaxNHlhRiGVHpmR+efc9Fo8k9wTydK//6c6y/phQReFBPqBC7/EL8FEY0OL HHOGDKHDQMxUrcQRUG54M2N037opbXPKCXQH0tj163dRNDhns0Q431dk1DcOFApDtZQ5 lNYjKKeRDZzxV7SY6c1svXhIH2h4pykIW9FROy4XnYuT//WFgR1TnLmxHrLerF5iKU80 ojow== X-Forwarded-Encrypted: i=1; AJvYcCUItVY1x1eagrAWALxACZtkBv2TCXaiRan39rAY8ETFG/cZrN6GRRciuSkQIVumlfd6aDt4MEBy4B/h5rl61qA3Oe/iqNEILcgpT4IesIPARMtc2n1WQjG0il5I9PG4ct1tOGOMDdB2InNKsOCf X-Gm-Message-State: AOJu0YzlBaOh181LqFF8Q2ICGeWIPNsHStGE6ko2HUCktRghvS9Ni75I pSMgPfloh2Q2R1edwxEZfYiMUpK9v4tLVz0b8M7vJ7L33oYud1Wa X-Google-Smtp-Source: AGHT+IEtsLb9ubCDZAG9HKspu+Ejg5Bny2dpdCF+3riHPRWpHuMWqRmG9LivPX6D4Zet1J/ot/MWyg== X-Received: by 2002:a05:600c:1d89:b0:426:6a5e:73c5 with SMTP id 5b1f17b1804b1-428e6b92d50mr97449265e9.37.1722944492093; Tue, 06 Aug 2024 04:41:32 -0700 (PDT) Received: from localhost.localdomain (host-87-6-196-30.retail.telecomitalia.it. [87.6.196.30]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-428e6e7cce6sm176105845e9.31.2024.08.06.04.41.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Aug 2024 04:41:31 -0700 (PDT) From: Christian Marangi To: Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Joern Engel , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Christian Marangi , Wolfram Sang , Florian Fainelli , Thomas Bogendoerfer , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-nvme@lists.infradead.org Subject: [PATCH v3 3/6] dt-bindings: mmc: add property for partitions node in mmc-card node Date: Tue, 6 Aug 2024 13:41:13 +0200 Message-ID: <20240806114118.17198-4-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806114118.17198-1-ansuelsmth@gmail.com> References: <20240806114118.17198-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240806_044134_532828_115E83B0 X-CRM114-Status: GOOD ( 12.75 ) X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Add property for defining partitions node in mmc-card node to define partitions in DT by the use of the block2mtd module to use block devices as MTD. Signed-off-by: Christian Marangi --- .../devicetree/bindings/mmc/mmc-card.yaml | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:32e listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [ansuelsmth(at)gmail.com] 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+incoming=patchwork.ozlabs.org@lists.infradead.org Add property for defining partitions node in mmc-card node to define partitions in DT by the use of the block2mtd module to use block devices as MTD. Signed-off-by: Christian Marangi --- .../devicetree/bindings/mmc/mmc-card.yaml | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/Documentation/devicetree/bindings/mmc/mmc-card.yaml b/Documentation/devicetree/bindings/mmc/mmc-card.yaml index fd347126449a..0f32d24417bc 100644 --- a/Documentation/devicetree/bindings/mmc/mmc-card.yaml +++ b/Documentation/devicetree/bindings/mmc/mmc-card.yaml @@ -26,6 +26,9 @@ properties: Use this to indicate that the mmc-card has a broken hpi implementation, and that hpi should not be used. + partitions: + $ref: /schemas/mtd/partitions/partitions.yaml + required: - compatible - reg @@ -45,4 +48,41 @@ examples: }; }; + mmc1 { + #address-cells = <1>; + #size-cells = <0>; + + card@0 { + compatible = "mmc-card"; + reg = <0>; + broken-hpi; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + bootloader@0 { + label = "bootloader"; + reg = <0x00000000 0x00080000>; + }; + + tclinux@80000 { + label = "tclinux"; + reg = <0x00080000 0x02800000>; + }; + + tclinux_slave@2880000 { + label = "tclinux_slave"; + reg = <0x02880000 0x02800000>; + }; + + rootfs_data@5080000 { + label = "rootfs_data"; + reg = <0x5080000 0x00800000>; + }; + }; + }; + }; + ... From patchwork Tue Aug 6 11:41:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1969477 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=24j+U4h5; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=SZxGN3wg; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WdY1x2X6gz1yXs for ; Tue, 6 Aug 2024 22:45:41 +1000 (AEST) 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:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QFNH6rLZcRbqSC/M7jX6e7cne+Ib0SWNir99onyphDU=; b=24j+U4h5KgHK1t FDXNuaug9hTgDFIUFEK88yxy24OH5mASt2nz74Nx+pkYfvEdRWgLkVYoKPm09tId3N7DwG/4cLi6N mYHDjO+w45YSBWrJCbiXaZJL4S0sp6gpR57WpA3Sp+mL/JhoyWrS7MtSaqgwnnBS6Rm3LDhcbs2Xb ymrrtl+pchGwloQzexL3RDeC7z3ZNZsU0AhwB3vp1Tz6vw6oHNvnwqbfY8rChrc9UUC5NuDRVsdKj Todf7YXoL6Rs8YDFHM8JY2JkgpTiwJtBgWu5c6xpw+55OvHVMrqE1ecsJQ2C27l80xVWq5iyfO5Cf Eysu8o1+YIE3xEO7VZRw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbJZH-00000001XrZ-0GPT; Tue, 06 Aug 2024 12:45:35 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbIZM-00000001N8f-0fC5; Tue, 06 Aug 2024 11:41:55 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-428243f928fso5057405e9.0; Tue, 06 Aug 2024 04:41:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722944494; x=1723549294; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=1AwITVf2WPGSBxmw93SjsOJVEu1oqZyIKeUGfTrfzs4=; b=SZxGN3wgJT2WbE3uRNfYMVT8qXmaf2QmXNq8P/bAM+gW5+JxzSe8qLSGX8csc88Z8H tc7baN0NC02+kbZrIfIBg01sWVVznI7t3GaychKKuoOAVKyIbKByGts3UVP/wPk8d8S/ 9l+8D0w8PIVuVXZyGyCP3PDtPko9y3vqI6rrtYiMQpnbELpiq6aP2/MjTw2NucmmjzRS 5Y1g52Uf+/GIUEHfielzRLeTJ1esRL+/Prf1C0lCQEmghUBQF+Rp8bKSrFZXByQjLJp7 OsKMg8iMV04aUFrmpHBiZHBPdwzlo3xIg5dNrtaIGobeEGqrfSZfpZt6FYuoIxOCgOxf lmbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722944494; x=1723549294; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1AwITVf2WPGSBxmw93SjsOJVEu1oqZyIKeUGfTrfzs4=; b=TgsQpWbD+exffrWr8PQibcJw6EQrU/P2zIPk5OUJN5fZEPHEm3MxBL1qOk2Vgf+38x l4f4AX0bGgV4iIjZsI9uz9csEkS36UH/d9xUG7aIrTirlCtDxJwImwAvbjpfWlw79SEV aIS0EDr5g565YcuRB7SwVABeHwT0t1lO547Y1k1RdIUjZ6HDne6HplQrM4mS5dTGXZhz mOfGDvMR5FU9VLNPX8i6qfOgbwuMXjkcKsuIYxPkMhNnQTNMotKYmzWa40e/V+CbzvuF W14DjRMYGrD8UAqTxG9qbEQoe4hRAPcF/HrME7qVNPfBfT4eUqL3EY03dKSAtaGODBm7 J6IQ== X-Forwarded-Encrypted: i=1; AJvYcCU/unMB+Wmrx4qH6UKtsif3FK+zcyaXXRes19swzxS/FwrvSQDnmHp7B0qORnt82YdrUVEf0I60ghrPgLx5Im0SV61B2kHgeR5qNhzlSeGntakzsQhG3/2jRz55gwLpUc7BRxsHLN/kmdZ8XY1w X-Gm-Message-State: AOJu0YwSymbUVw7bzLwruk+Q6QV5tugiTKHZEzf5tki4iE2tq9oErTDi E0+V7Lkqg3H8LtjBVlMSDSYEhREoJ7XgZbwnFnUV/U7VHRu+EbpD X-Google-Smtp-Source: AGHT+IFGVYMjIkc1rf+t9JbyTCPhrBWsc7Ju4jzCOzjNnzD1sS+oEYPY0w7XNI1EwLNMTIC2ME3gng== X-Received: by 2002:a05:600c:4752:b0:426:6fd2:e14b with SMTP id 5b1f17b1804b1-428e6b0274emr117918275e9.11.1722944493977; Tue, 06 Aug 2024 04:41:33 -0700 (PDT) Received: from localhost.localdomain (host-87-6-196-30.retail.telecomitalia.it. [87.6.196.30]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-428e6e7cce6sm176105845e9.31.2024.08.06.04.41.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Aug 2024 04:41:33 -0700 (PDT) From: Christian Marangi To: Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Joern Engel , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Christian Marangi , Wolfram Sang , Florian Fainelli , Thomas Bogendoerfer , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-nvme@lists.infradead.org Subject: [PATCH v3 4/6] block2mtd: attach device OF node to MTD device Date: Tue, 6 Aug 2024 13:41:14 +0200 Message-ID: <20240806114118.17198-5-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806114118.17198-1-ansuelsmth@gmail.com> References: <20240806114118.17198-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240806_044136_267782_3861FAE1 X-CRM114-Status: GOOD ( 16.61 ) X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Attach device OF node to MTD device if defined and the root blockdev is being used to add support for partitions defined in DT node. This permits the usage of fixed-partition or alternative parser with the use of block2mtd module. Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:334 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [ansuelsmth(at)gmail.com] 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+incoming=patchwork.ozlabs.org@lists.infradead.org Attach device OF node to MTD device if defined and the root blockdev is being used to add support for partitions defined in DT node. This permits the usage of fixed-partition or alternative parser with the use of block2mtd module. Signed-off-by: Christian Marangi --- drivers/mtd/devices/block2mtd.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c index b06c8dd51562..8ff9787edc24 100644 --- a/drivers/mtd/devices/block2mtd.c +++ b/drivers/mtd/devices/block2mtd.c @@ -265,6 +265,7 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size, struct file *bdev_file; struct block_device *bdev; struct block2mtd_dev *dev; + struct device *ddev; loff_t size; char *name; @@ -324,6 +325,15 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size, dev->mtd.priv = dev; dev->mtd.owner = THIS_MODULE; + /* + * Check if we are using root blockdev. + * If it's the case, connect the MTD of_node to the ddev parent + * to support providing partition in DT node. + */ + ddev = disk_to_dev(bdev->bd_disk); + if (ddev == &bdev->bd_device) + dev->mtd.dev.of_node = of_node_get(ddev->parent->of_node); + if (mtd_device_register(&dev->mtd, NULL, 0)) { /* Device didn't get added, so free the entry */ goto err_destroy_mutex; @@ -337,6 +347,7 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size, return dev; err_destroy_mutex: + of_node_put(dev->mtd.dev.of_node); mutex_destroy(&dev->write_mutex); err_free_block2mtd: block2mtd_free_device(dev); @@ -515,6 +526,7 @@ static void block2mtd_exit(void) struct block2mtd_dev *dev = list_entry(pos, typeof(*dev), list); block2mtd_sync(&dev->mtd); mtd_device_unregister(&dev->mtd); + of_node_put(dev->mtd.dev.of_node); mutex_destroy(&dev->write_mutex); pr_info("mtd%d: [%s] removed\n", dev->mtd.index, From patchwork Tue Aug 6 11:41:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1969478 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=1lg6ctAV; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=OPIQVOzJ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WdY1x66hKz1yf3 for ; Tue, 6 Aug 2024 22:45:41 +1000 (AEST) 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:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pje1o8SVWSAocOcfsLuB8z5g+4e5HkTlhsZWwINnJQI=; b=1lg6ctAVGztq4e crNevUomLDUp98MsFFrcehhHd1EmVlmUI3brJ+nnVvNQfc2Bq6ihnBk5NBRWV8SaGbYWRWD3vIWr3 UUKYUaFMRUtE7hv/2udy76N86MUybfLbdRv2Sz8ocgZC0guXAeysy8jNqeu4FdsUr6xpvE9dK5qYT NiUTjUYutXFQGxFSAlj8c8Eu1xgOiD+Jh2CDaT/1XMeGJDDwERHW+gxaVPwD1lp6QURJ7JS4Lh6bO iaSUE+NtP2sctXPRYLB6sCClDkPLsjIFzh6ggXFlTEMKFJoUOi7uNdPlrzSDN7Xt5xMzDsaLY7JHm n5DJMtQ55lHQJXU47iyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbJZH-00000001Xrm-2TW3; Tue, 06 Aug 2024 12:45:35 +0000 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbIZO-00000001NB2-151z; Tue, 06 Aug 2024 11:41:56 +0000 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2f149845fbaso6046081fa.3; Tue, 06 Aug 2024 04:41:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722944496; x=1723549296; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=5xBEuESArl0fBfjXYsEhDBEbTfGt9gI5ouD6sU73/GU=; b=OPIQVOzJ9UONSa+/XS5n8+vTVYgqIkr24xXgrZ6aVhu3PjeP0xWikzY+Ym87kt+KEq y4G0es/dVIrwX07OmPVoK+dtnvgzhF4I4Z47WLVCyAbepz2zq2brafKiPhV1CLhMiawI +xF5xCNMBH3Usm/49CgVnCtnlEgIc0Zn9TKb+d+uxqKhuzNkmVzOSOYVS9J9ZiQS8k3c D0H4QejQ6Lrkzy7UAA5YFl/A++8/qoBWXxI/PYwGn2spjuRZ+dmBR+IQFGLrKKoi+7kT faNsH/poozO0jfjK/Y7Akp9x0ZlBLy05JSSzzwDpY/Vb15t2JR2CJXr19jnPRuJaYyQY DOGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722944496; x=1723549296; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5xBEuESArl0fBfjXYsEhDBEbTfGt9gI5ouD6sU73/GU=; b=dnPnf1qq8d2jjFx1E5YQ+3G3FI+Z9+Ij0R3CUlQAQ9lCAvSPizGLJJRmKUeM05ng68 O3TH5IlG0MMtD363UvQ/t0hz0N7BJpr4lovORe1dgl20N0XDYhwmh6DuD5cPrYV+An3i i5akqMUEZ/y5x2J6nfAcMCSETxy/rAnPR4+sU9kAj0NQJvqojgNkLUXLZh55xlp+fL/u 6Pu0KdVHRW8AWvAen9DchubHYJsZp30gNMoZZ4zNw9MWE8D00hfwTlxrFcCtfv35UDUt xWQoWHSr6HukKK9Y30CxPiGpm2BvxOeANziJigpmqDoJWwcfOfaotFMF0gbPNLHZCf+K E7xA== X-Forwarded-Encrypted: i=1; AJvYcCV4yB59DGynJnz1c6g/ebO3XwjXbo4nj4OInDOl0+0yv8pAmZhv0wtTE+dx74szg+0WWDOR5C7lVdwOqtxckCuK98sN8MNfiT7t3S3Zm4sTTZoPzMa6p9DYHkUCUIQCPAdrfK5XzKWLW/9PA+nu X-Gm-Message-State: AOJu0YzeUaeOivbqWJT3Gc0xNaVJdYPKfjM91Fg6lwZvcOCGstlZZozm lu11gRatJVZpn0FtijpvOmGy6Bii35TUGgh38npFOAtJj1hiiQN+ X-Google-Smtp-Source: AGHT+IGEw7FbfFGV4bGUwud7W+/31hW0KginGDZdKiOUFG09QuHWu6Nsg6YcjdixER72oYD5wUIGqQ== X-Received: by 2002:a2e:999a:0:b0:2ef:2f19:a8b3 with SMTP id 38308e7fff4ca-2f15ab049f2mr102072831fa.41.1722944495774; Tue, 06 Aug 2024 04:41:35 -0700 (PDT) Received: from localhost.localdomain (host-87-6-196-30.retail.telecomitalia.it. [87.6.196.30]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-428e6e7cce6sm176105845e9.31.2024.08.06.04.41.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Aug 2024 04:41:35 -0700 (PDT) From: Christian Marangi To: Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Joern Engel , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Christian Marangi , Wolfram Sang , Florian Fainelli , Thomas Bogendoerfer , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-nvme@lists.infradead.org Subject: [PATCH v3 5/6] dt-bindings: mtd: Add Documentation for Airoha fixed-partitions Date: Tue, 6 Aug 2024 13:41:15 +0200 Message-ID: <20240806114118.17198-6-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806114118.17198-1-ansuelsmth@gmail.com> References: <20240806114118.17198-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240806_044138_395429_C79219E0 X-CRM114-Status: GOOD ( 18.50 ) X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Add Documentation for Airoha fixed-partitions compatibles. Airoha based SoC declare a dedicated partition at the end of the flash to store calibration and device specific data, in addition to fixed partitions. The offset of this special partition is not well [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:22c listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [ansuelsmth(at)gmail.com] 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+incoming=patchwork.ozlabs.org@lists.infradead.org Add Documentation for Airoha fixed-partitions compatibles. Airoha based SoC declare a dedicated partition at the end of the flash to store calibration and device specific data, in addition to fixed partitions. The offset of this special partition is not well defined as it depends on flash bad block management that might require reserving additional space at the end of the flash. This binding allows defining all fixed partitions and marking the last one to detect the correct offset. Signed-off-by: Christian Marangi --- .../partitions/airoha,fixed-partitions.yaml | 80 +++++++++++++++++++ .../bindings/mtd/partitions/partitions.yaml | 1 + 2 files changed, 81 insertions(+) create mode 100644 Documentation/devicetree/bindings/mtd/partitions/airoha,fixed-partitions.yaml diff --git a/Documentation/devicetree/bindings/mtd/partitions/airoha,fixed-partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/airoha,fixed-partitions.yaml new file mode 100644 index 000000000000..8d7221561f51 --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/partitions/airoha,fixed-partitions.yaml @@ -0,0 +1,80 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mtd/partitions/airoha,fixed-partitions.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Airoha SoC partitioning + +description: | + Airoha based SoC declare a dedicated partition at the end of the flash to + store calibration and device specific data, in addition to fixed partitions. + The offset of this special partition is not well defined as it depends on + flash bad block management that might require reserving additional space at the + end of the flash. + + This binding allows defining all fixed partitions and marking the last one to + detect the correct offset. + +maintainers: + - Christian Marangi + +select: false + +properties: + compatible: + const: airoha,fixed-partitions + + "#address-cells": + enum: [ 1, 2 ] + + "#size-cells": + enum: [ 1, 2 ] + +patternProperties: + "^partition@[0-9a-f]+$": + $ref: partition.yaml# + properties: + compatible: + const: airoha,dynamic-art + unevaluatedProperties: false + +required: + - "#address-cells" + - "#size-cells" + +additionalProperties: false + +examples: + - | + partitions { + compatible = "airoha,fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00080000>; + }; + + partition@80000 { + label = "tclinux"; + reg = <0x00080000 0x02800000>; + }; + + partition@2880000 { + label = "tclinux_slave"; + reg = <0x02880000 0x02800000>; + }; + + partition@5080000 { + label = "rootfs_data"; + reg = <0x5080000 0x00800000>; + }; + + partition@ffffffff { + compatible = "airoha,dynamic-art"; + label = "art"; + reg = <0xffffffff 0x00300000>; + }; + }; diff --git a/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml index 1dda2c80747b..ec254e03adf0 100644 --- a/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml +++ b/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml @@ -14,6 +14,7 @@ maintainers: - Miquel Raynal oneOf: + - $ref: airoha,fixed-partitions.yaml - $ref: arm,arm-firmware-suite.yaml - $ref: brcm,bcm4908-partitions.yaml - $ref: brcm,bcm947xx-cfe-partitions.yaml From patchwork Tue Aug 6 11:41:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1969442 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=t2helV+h; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=eT9Sx+vP; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WdWck3M6dz1yYD for ; Tue, 6 Aug 2024 21:42:14 +1000 (AEST) 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:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PC/VrMBLdYYmp9pBNWj0pY+PbNYKthXSA6vGgNqA7c4=; b=t2helV+h+2OUcB REf7CYcrRBi0F21SLX2JUC2eybJiyR9t/3yTWDMBRRHlJMOusRo7F7n1xumRsH1VpKuW2NaLEsj86 ntHxIW4GTuBiXOfP1SfyC+PUGYRFZjhiIGshUhiV64/h3/gq8ovsPvJl+0+59DPADPo6ssiSFR9q0 OCByaBYblDAYjPa8Grs9etT960iUL864S3WBcMAETkNx5MWfe0MWsSP/vukOJM8egTmxd2njzYDQj FUExjppnR5INgOyoZWnvuSuSv2oqlcak6BXtZ/9meQy8jyGlVIdItvfiJttrpjtZQUBDJZDS40ueK b4lNTup6WQFjat41oDYg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbIZl-00000001NUj-1UBa; Tue, 06 Aug 2024 11:42:01 +0000 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbIZQ-00000001NC8-0rPg; Tue, 06 Aug 2024 11:41:57 +0000 Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2f15dd0b489so7931801fa.3; Tue, 06 Aug 2024 04:41:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722944498; x=1723549298; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=W8UY9azmTjhPunDkBNM5W4aID9KMi7XRKzM/JmHz9bA=; b=eT9Sx+vPxcQ/ClCkX2MA8DN0HjdoLbW824bnSjeb1XglYBQe6fpyL7R+C/V5Dv18+2 UHoE5pSp2ZRsau4L5TU46w7oN3gMiY8pXWJARVtdqdDF7XrjXFSJLUdT+CC+PiEb1cW9 /1PjrxD2b5RYH7dTUGtuhrG2aWIKlDcgT49oI194rp8YLfkOgvaDXnnGV1O8VMcICYwS Wzzx6XsNeSihzRj3+g9+r4aZOVs4M4hWgKnyv1G+CVjEvfiwz1gTCwTaGZXxJOFRwSNX dyzdWdf7yiN1tLG+ufTHP384iQ/QgwEQE95GB7sTQyJSVvMKZz/+Mnyl77Jh87TjhNzh Q5rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722944498; x=1723549298; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W8UY9azmTjhPunDkBNM5W4aID9KMi7XRKzM/JmHz9bA=; b=NWUVjrxcLRE7enYa0hc4vOcAUrhN73zQKLNsjVlJw1gMazOu7ovZ0Kzz3HewOzg69h Ez16y16FsH7AdJhY/6YQdGb9g9aEbJxNX/AAgUuU6oVUP/R9/J33G0QohBBXGAGEd7Ox MwzHHnyzbjpI/0BnshzRUcd6Y0XRKH4iWTyinqd/Mo50aUZFtUDej7pc8qcyVp18wLky CBXrNvHd5DEXGJB9agKA2psyzHzXLxM3ZskqpVGYnFYPvP0PFrBxpuCDQcvJkfYVyqtr onKQbl5D1FPLbDE62N1bL/yvi4Op95M4wawfh8QAH6+zrNunNnaZpQmkdLjKHrQqTxh2 sChQ== X-Forwarded-Encrypted: i=1; AJvYcCUjN8gSoutxPlkB7KE0PWhXUHD9G+Au3WU3BwyqPMd+wGMBHX3zVuX8MMnJkNw89EP+9SsVZKjV7xibcl9KXAlHaDoqV8fstnAWRoEqohlNEYD4mkazVKdWabeFK0f7bEsrcNTApY1/NLh8NY/p X-Gm-Message-State: AOJu0YyiQZ5FBUosqWQzO35+KGKKivufaKga/xhLvYFm5V4eOEHciUm7 jUXtwo+cTsDyu7AiqCRAkk7Tdk+bXGz7dLIIYHSG5jsjXQRhzj4F X-Google-Smtp-Source: AGHT+IGx9JpvtWSSJNncxBn64nyf6VX1HlPIDvZrqJFY+6GFP8Hs6JdctNgOCKrCUWNgRJKHapbLMA== X-Received: by 2002:a2e:8747:0:b0:2ef:2061:8bf5 with SMTP id 38308e7fff4ca-2f15ab27c85mr88378811fa.40.1722944497625; Tue, 06 Aug 2024 04:41:37 -0700 (PDT) Received: from localhost.localdomain (host-87-6-196-30.retail.telecomitalia.it. [87.6.196.30]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-428e6e7cce6sm176105845e9.31.2024.08.06.04.41.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Aug 2024 04:41:37 -0700 (PDT) From: Christian Marangi To: Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Joern Engel , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Christian Marangi , Wolfram Sang , Florian Fainelli , Thomas Bogendoerfer , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-nvme@lists.infradead.org Subject: [PATCH v3 6/6] mtd: parser: add support for Airoha parser Date: Tue, 6 Aug 2024 13:41:16 +0200 Message-ID: <20240806114118.17198-7-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806114118.17198-1-ansuelsmth@gmail.com> References: <20240806114118.17198-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240806_044140_465524_A31AD28E X-CRM114-Status: GOOD ( 31.26 ) X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Add support for Airoha parser based on a post parse ofpart function. Airoha partition table follow normal fixed-partition implementation with a special implementation for the ART partition. This is always the last partition and is placed from the end of the flash - the [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:233 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [ansuelsmth(at)gmail.com] 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+incoming=patchwork.ozlabs.org@lists.infradead.org Add support for Airoha parser based on a post parse ofpart function. Airoha partition table follow normal fixed-partition implementation with a special implementation for the ART partition. This is always the last partition and is placed from the end of the flash - the partition size. To enable this special implementation for ART partition, the relevant node require the "airoha,dynamic-art" compatible. With that declared, offset value is ignored and real offset is updated with the calculated value. Due to usage of specific bad block management driver, the MTD size might vary hence the ART partition offset needs to be dynamically parsed and can't be declared statically. Signed-off-by: Christian Marangi --- drivers/mtd/parsers/Kconfig | 10 +++++ drivers/mtd/parsers/Makefile | 1 + drivers/mtd/parsers/ofpart_airoha.c | 57 +++++++++++++++++++++++++++++ drivers/mtd/parsers/ofpart_airoha.h | 18 +++++++++ drivers/mtd/parsers/ofpart_core.c | 6 +++ 5 files changed, 92 insertions(+) create mode 100644 drivers/mtd/parsers/ofpart_airoha.c create mode 100644 drivers/mtd/parsers/ofpart_airoha.h diff --git a/drivers/mtd/parsers/Kconfig b/drivers/mtd/parsers/Kconfig index da03ab6efe04..d6c53aa16ea6 100644 --- a/drivers/mtd/parsers/Kconfig +++ b/drivers/mtd/parsers/Kconfig @@ -72,6 +72,16 @@ config MTD_OF_PARTS flash memory node, as described in Documentation/devicetree/bindings/mtd/mtd.yaml. +config MTD_OF_PARTS_AIROHA + bool "Airoha EN7815 partitioning support" + depends on MTD_OF_PARTS && (ARCH_AIROHA || COMPILE_TEST) + default ARCH_AIROHA + help + This provides partitions parser for Airoha EN7815 family devices + that can have dynamic "ART" partition at the end of the flash. + It takes care of finding the correct offset and update property + with it. + config MTD_OF_PARTS_BCM4908 bool "BCM4908 partitioning support" depends on MTD_OF_PARTS && (ARCH_BCMBCA || COMPILE_TEST) diff --git a/drivers/mtd/parsers/Makefile b/drivers/mtd/parsers/Makefile index 9b00c62b837a..d67f9b4d39ac 100644 --- a/drivers/mtd/parsers/Makefile +++ b/drivers/mtd/parsers/Makefile @@ -5,6 +5,7 @@ obj-$(CONFIG_MTD_BRCM_U_BOOT) += brcm_u-boot.o obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o obj-$(CONFIG_MTD_OF_PARTS) += ofpart.o ofpart-y += ofpart_core.o +ofpart-$(CONFIG_MTD_OF_PARTS_AIROHA) += ofpart_airoha.o ofpart-$(CONFIG_MTD_OF_PARTS_BCM4908) += ofpart_bcm4908.o ofpart-$(CONFIG_MTD_OF_PARTS_LINKSYS_NS)+= ofpart_linksys_ns.o obj-$(CONFIG_MTD_PARSER_IMAGETAG) += parser_imagetag.o diff --git a/drivers/mtd/parsers/ofpart_airoha.c b/drivers/mtd/parsers/ofpart_airoha.c new file mode 100644 index 000000000000..5e2cc7b6376b --- /dev/null +++ b/drivers/mtd/parsers/ofpart_airoha.c @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2024 Christian Marangi + */ + +#include +#include +#include + +#include "ofpart_airoha.h" + +int airoha_partitions_post_parse(struct mtd_info *mtd, + struct mtd_partition *parts, + int nr_parts) +{ + struct mtd_partition *part; + int len, a_cells, s_cells; + struct device_node *pp; + struct property *prop; + const __be32 *reg; + __be32 *new_reg; + + part = &parts[nr_parts - 1]; + pp = part->of_node; + + /* Skip if ART partition have a valid offset instead of a dynamic one */ + if (!of_device_is_compatible(pp, "airoha,dynamic-art")) + return 0; + + /* ART partition is set at the end of flash - size */ + part->offset = mtd->size - part->size; + + /* Update the offset with the new calculate value in DT */ + prop = kzalloc(sizeof(*prop), GFP_KERNEL); + if (!prop) + return -ENOMEM; + + /* Reg already validated by fixed-partition parser */ + reg = of_get_property(pp, "reg", &len); + + /* Fixed partition */ + a_cells = of_n_addr_cells(pp); + s_cells = of_n_size_cells(pp); + + prop->name = "reg"; + prop->length = (a_cells + s_cells) * sizeof(__be32); + prop->value = kmemdup(reg, (a_cells + s_cells) * sizeof(__be32), + GFP_KERNEL); + new_reg = prop->value; + memset(new_reg, 0, a_cells * sizeof(__be32)); + new_reg[a_cells - 1] = cpu_to_be32(part->offset); + if (a_cells > 1) + new_reg[0] = cpu_to_be32(part->offset >> 32); + of_update_property(pp, prop); + + return 0; +} diff --git a/drivers/mtd/parsers/ofpart_airoha.h b/drivers/mtd/parsers/ofpart_airoha.h new file mode 100644 index 000000000000..3e8a8456c13a --- /dev/null +++ b/drivers/mtd/parsers/ofpart_airoha.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __OFPART_AIROHA_H +#define __OFPART_AIROHA_H + +#ifdef CONFIG_MTD_OF_PARTS_AIROHA +int airoha_partitions_post_parse(struct mtd_info *mtd, + struct mtd_partition *parts, + int nr_parts); +#else +static inline int airoha_partitions_post_parse(struct mtd_info *mtd, + struct mtd_partition *parts, + int nr_parts) +{ + return -EOPNOTSUPP; +} +#endif + +#endif diff --git a/drivers/mtd/parsers/ofpart_core.c b/drivers/mtd/parsers/ofpart_core.c index e7b8e9d0a910..9e078636d158 100644 --- a/drivers/mtd/parsers/ofpart_core.c +++ b/drivers/mtd/parsers/ofpart_core.c @@ -16,6 +16,7 @@ #include #include +#include "ofpart_airoha.h" #include "ofpart_bcm4908.h" #include "ofpart_linksys_ns.h" @@ -23,6 +24,10 @@ struct fixed_partitions_quirks { int (*post_parse)(struct mtd_info *mtd, struct mtd_partition *parts, int nr_parts); }; +static struct fixed_partitions_quirks airoha_partitions_quirks = { + .post_parse = airoha_partitions_post_parse, +}; + static struct fixed_partitions_quirks bcm4908_partitions_quirks = { .post_parse = bcm4908_partitions_post_parse, }; @@ -192,6 +197,7 @@ static const struct of_device_id parse_ofpart_match_table[] = { /* Generic */ { .compatible = "fixed-partitions" }, /* Customized */ + { .compatible = "airoha,fixed-partitions", .data = &airoha_partitions_quirks, }, { .compatible = "brcm,bcm4908-partitions", .data = &bcm4908_partitions_quirks, }, { .compatible = "linksys,ns-partitions", .data = &linksys_ns_partitions_quirks, }, {},