From patchwork Thu Jan 18 19:53:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Regan X-Patchwork-Id: 1888213 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=ePCgJfct; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=broadcom.com header.i=@broadcom.com header.a=rsa-sha256 header.s=google header.b=cpDtiElE; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=198.137.202.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 [198.137.202.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 4TGD4S20kVz1yQ0 for ; Fri, 19 Jan 2024 06:55:19 +1100 (AEDT) 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=/p4EQMbGbq9WkbQ+vwNKpOfS3H84oJf/vH9LQ6XXZX0=; b=ePCgJfctWuEAah 0ubM7n5413GGdHc9gtwEeCoZ0XiK0wUPs9hLzLk1rTwREmGb9aTtkBSK1UP6y73JbTeSno+ZCFPfu TGxLi2D1vhsc7H+UVNW7rR/c9ZAq9rmNj0zkb2jA+2Ms2jmRyRdsXdlOhq7QOQN6LyrIfgDQ9yTK2 TSEV5PevCQAocgCh4merluEfcp3OBORUqSDARhmpWgHLRSHlVRvBJQsZY898/YXFmJrnlp/v49pTZ JpvxLJi/nsH7TvbajPgUZ9nwnN0tonSifxVxfrIJaDRAMYlknbOe4mO39hKhizmfJjtLbePSBoJhD KHpIjmH8gOw3uT7OAnvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQYTC-003gJj-27; Thu, 18 Jan 2024 19:54:34 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQYT6-003gEw-1F for linux-mtd@lists.infradead.org; Thu, 18 Jan 2024 19:54:31 +0000 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-2902b142211so67429a91.3 for ; Thu, 18 Jan 2024 11:54:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1705607664; x=1706212464; 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=x+1SWW+Ig8UbJFSMxb59hrypayblGZkJ0hxIP2opRhk=; b=cpDtiElEKOBWzRJZ5G6Av8ik5Tk2PyIIomhq1xN45e9B+GXTQxvy822ceUJ9HfszD7 EsCuOIwYP1P3sWEJZyXk0qTirhD+mm6KCh/0SgY2YsjimgcLxs6PAC2aeL7psB2A2yT8 hbi1bN8fqmiuvdT2MZzxMtleexKGTnH8RF87c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705607664; x=1706212464; 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=x+1SWW+Ig8UbJFSMxb59hrypayblGZkJ0hxIP2opRhk=; b=rrYGWhN4C84/tZFikp3PNHTbxp5iq0QUIcG3YBHkkHyHQfE7T1T02btYuLzeJzX7Zd 3urSO0yCP4KqE5bN5fa0vISTslZ4r7JF8l1uBFMbHJFFF8iXU+UynUm3H9IM4yIjZmL2 ph6Tt+fxKAE3N9xvilPwL2Oev9rRUFoiJ9n68TBfcFljJPjHp2paSjxCcq+XJHQREw8p pGw8AE7mzZm1cHj7eEllqUAbwwe1obDnbPCkXvTCL/4tihiTAEBUpOFtRYbgRNStxY5c Hu9/K10HjK9alZVR1yrJunUxxkgZ4AJo0HaD8d6jHTCDpW8zf625hfIoE5OMoLR8x/8n ttRQ== X-Gm-Message-State: AOJu0YyEFnHKbi1KM82UFEw8adhEoRn3lQLhD7UM35jHPe3uslGrkmKl LISA59F4dFMgfHS6W3PD3i72dwqJHWsCgh1VRPOrpb1CXTiVE5Kgv31wK8KSyQ== X-Google-Smtp-Source: AGHT+IFJN5qdqCj4U1EPyvoOMfY4T24rq4BxUvtFH94/vWLwCV5OWIm6tnON7+tYz1c8hDwFg68IcQ== X-Received: by 2002:a17:90a:9a94:b0:290:4a:bfc0 with SMTP id e20-20020a17090a9a9400b00290004abfc0mr1068043pjp.4.1705607664535; Thu, 18 Jan 2024 11:54:24 -0800 (PST) Received: from bcacpedev-irv-3.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id rr12-20020a17090b2b4c00b0028d9b5d41edsm2263805pjb.38.2024.01.18.11.54.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2024 11:54:24 -0800 (PST) From: dregan@broadcom.com To: dregan@broadcom.com, dregan@mail.com, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, computersforpeace@gmail.com, kdasu.kdev@gmail.com, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, joel.peshkin@broadcom.com, tomer.yacoby@broadcom.com, dan.beygelman@broadcom.com, william.zhang@broadcom.com, anand.gore@broadcom.com, kursad.oney@broadcom.com, florian.fainelli@broadcom.com, rafal@milecki.pl, bcm-kernel-feedback-list@broadcom.com, andre.przywara@arm.com, baruch@tkos.co.il, linux-arm-kernel@lists.infradead.org, dan.carpenter@linaro.org Subject: [PATCH v2 01/10] dt-bindings: mtd: brcmnand: Updates for bcmbca SoCs Date: Thu, 18 Jan 2024 11:53:47 -0800 Message-Id: <20240118195356.133391-2-dregan@broadcom.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20240118195356.133391-1-dregan@broadcom.com> References: <20240118195356.133391-1-dregan@broadcom.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240118_115428_425353_C4C56886 X-CRM114-Status: GOOD ( 17.19 ) X-Spam-Score: -0.4 (/) 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: From: William Zhang Update the descriptions to reflect different families of broadband SoC and use the general name bcmbca for ARM based SoC. Add brcm,nand-use-wp property to have an option for disabling this feature on broadband board design that does not use write protection. Content analysis details: (-0.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1032 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender 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 From: William Zhang Update the descriptions to reflect different families of broadband SoC and use the general name bcmbca for ARM based SoC. Add brcm,nand-use-wp property to have an option for disabling this feature on broadband board design that does not use write protection. Add brcm,nand-ecc-use-strap to get ecc setting from board boot strap for broadband board designs because they do not specify ecc setting in dts but rather using the strap setting. Remove the requirement of interrupts property to reflect the driver code. Also add myself to the list of maintainers. Signed-off-by: William Zhang Reviewed-by: David Regan --- Changes in v2: - Revert the new compatible string nand-bcmbca - Drop the BCM63168 compatible fix to avoid any potential ABI incompatibility issue - Simplify the explanation for brcm,nand-use-wp - Keep the interrupt name requirement when interrupt number is specified --- .../bindings/mtd/brcm,brcmnand.yaml | 36 +++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml b/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml index f57e96374e67..56176ec1a992 100644 --- a/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml +++ b/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml @@ -9,6 +9,7 @@ title: Broadcom STB NAND Controller maintainers: - Brian Norris - Kamal Dasu + - William Zhang description: | The Broadcom Set-Top Box NAND controller supports low-level access to raw NAND @@ -18,9 +19,10 @@ description: | supports basic PROGRAM and READ functions, among other features. This controller was originally designed for STB SoCs (BCM7xxx) but is now - available on a variety of Broadcom SoCs, including some BCM3xxx, BCM63xx, and - iProc/Cygnus. Its history includes several similar (but not fully register - compatible) versions. + available on a variety of Broadcom SoCs, including some BCM3xxx, MIPS based + Broadband SoC (BCM63xx), ARM based Broadband SoC (BCMBCA) and iProc/Cygnus. + Its history includes several similar (but not fully register compatible) + versions. -- Additional SoC-specific NAND controller properties -- @@ -53,7 +55,7 @@ properties: - brcm,brcmnand-v7.2 - brcm,brcmnand-v7.3 - const: brcm,brcmnand - - description: BCM63138 SoC-specific NAND controller + - description: BCMBCA SoC-specific NAND controller items: - const: brcm,nand-bcm63138 - enum: @@ -65,7 +67,7 @@ properties: - const: brcm,nand-iproc - const: brcm,brcmnand-v6.1 - const: brcm,brcmnand - - description: BCM63168 SoC-specific NAND controller + - description: BCM63xx SoC-specific NAND controller items: - const: brcm,nand-bcm63168 - const: brcm,nand-bcm6368 @@ -111,6 +113,17 @@ properties: earlier versions of this core that include WP type: boolean + brcm,nand-use-wp: + description: + Use this property to indicate if board design uses + controller's write protection feature and connects its + NAND_WPb pin to nand chip's WP_L pin. Driver defaults to + use this feature when this property does not exist. + Set to 0 if WP pins are not connected and feature is not + used. Set to 1 if WP pins are connected and feature is used. + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1] + patternProperties: "^nand@[a-f0-9]$": type: object @@ -137,6 +150,16 @@ patternProperties: layout. $ref: /schemas/types.yaml#/definitions/uint32 + brcm,nand-ecc-use-strap: + description: + This flag is used by the driver to get the ecc strength and + spare area size from the SoC NAND boot strap setting. This + is commonly used by the BCMBCA SoC board design. If ecc + strength and spare area size are set by nand-ecc-strength + and brcm,nand-oob-sector-size in the dts, these settings + have precedence and override this flag. + $ref: /schemas/types.yaml#/definitions/flag + unevaluatedProperties: false allOf: @@ -177,6 +200,8 @@ allOf: - const: iproc-idm - const: iproc-ext - if: + required: + - interrupts properties: interrupts: minItems: 2 @@ -189,7 +214,6 @@ unevaluatedProperties: false required: - reg - reg-names - - interrupts examples: - | From patchwork Thu Jan 18 19:53:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Regan X-Patchwork-Id: 1888216 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=NDjOzQDQ; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=broadcom.com header.i=@broadcom.com header.a=rsa-sha256 header.s=google header.b=SfK8Km3C; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=198.137.202.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 [198.137.202.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 4TGD4S5jbcz23fF for ; Fri, 19 Jan 2024 06:55:20 +1100 (AEDT) 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=W9FdKZzSCCwDaUlP40zfYSUog6uLifmCYs5LzeTtTvI=; b=NDjOzQDQVqNceq B28lpgsGoF3LZoudJyhICqYPuThGBmUn7idbzzWX5q0yh2SmVWuw/1e+AovlR/Cqj21y3CSuHE+OV LKaZZoVr8NSzYH5C7jcEynp7xqof2TRC79fZfDMHk3Wbr4vIg0t3mjKnjocMpJKL7yFdje1bVhmM3 64yyg4P375VhXRxvrDJNCe0QvmwKigfXxplX3u4MzmJ9NbT22taooq6Dq8H0Uq6bUz/qjJzVnGeCG TYmXty6H5Y0QZgmxlC0NW+K2JnXsoaqXLPTHoPMZTw9eqnpySH7gpyTPPii/kmghg+LQ0/rOBWs2d n2iA8IeVk6gKmzJyUowg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQYTJ-003gOg-0O; Thu, 18 Jan 2024 19:54:41 +0000 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQYT7-003gFO-0n for linux-mtd@lists.infradead.org; Thu, 18 Jan 2024 19:54:34 +0000 Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-28be8ebcdc1so87195a91.0 for ; Thu, 18 Jan 2024 11:54:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1705607666; x=1706212466; 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=P7YdlaHtDicZ9S/nNPczTdCxtxFMN2pJg3+moTPaeDY=; b=SfK8Km3ChPduuGvOEp/UnTinqmlg541z+DS4Qk4NOtCOeBkFwNRGoN4MvrW5JWlQES XKmM9EkiaUx9zlG+8UpQtYIt0eB3EIUfRXpdpP5Ehu3gmtKTc0abEVOZALUxO47wyhqi wjIc7EbKEdZNfHVxhaMIjPulKvJyt3cyWlvcU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705607666; x=1706212466; 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=P7YdlaHtDicZ9S/nNPczTdCxtxFMN2pJg3+moTPaeDY=; b=aY5ZgM+b9oVTNjhBNoZHTM8MYONeXMCu56G2uZROyuof/zuVmNGa1G6ihkCQCfS5+e wldtaT9FmqDamOO227zus6tfs4YDU671RYxSAKL/PSLzzCPyJ3m0y/5yVxKgFtA0sIBG kwEimcEWZfEKbnJEgDVn6o5AQuO0F/xTTtLV/3vnns0RB8xtn+kYAeXSaXoCLL57u3VZ t/gIdTcBttCPbUZPYNIDFLkk2ikuMWGeVMK+8hOPdOEfpfHhoK+ugs4CNXmAduB75IYj OxNyr5H+5q7kdIe78em5NV6x4HLFObjn0WgW6aVgzViesru3aYrXK0aE34YCpShEZtZ9 2oIQ== X-Gm-Message-State: AOJu0YyhDrwXL0zX3pxh5Cd5UNKzqqPT14rll7AExY36I7ufdhNEebwT 7tZr0tp4JwtsPJ2gS1TvKmo51KnKMXkcey9WEAr3G9n7NZ3EqJb6NzMwy9LVUw== X-Google-Smtp-Source: AGHT+IEoxUIUXKVf4ieGnqL9RGAv8SCgN30MM0zhDQgEa5AiaT4yw1zAbStUyQ7x7a1Q5OBDK+J3iA== X-Received: by 2002:a17:90a:c292:b0:28d:280a:7e4e with SMTP id f18-20020a17090ac29200b0028d280a7e4emr1045900pjt.56.1705607666218; Thu, 18 Jan 2024 11:54:26 -0800 (PST) Received: from bcacpedev-irv-3.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id rr12-20020a17090b2b4c00b0028d9b5d41edsm2263805pjb.38.2024.01.18.11.54.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2024 11:54:25 -0800 (PST) From: dregan@broadcom.com To: dregan@broadcom.com, dregan@mail.com, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, computersforpeace@gmail.com, kdasu.kdev@gmail.com, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, joel.peshkin@broadcom.com, tomer.yacoby@broadcom.com, dan.beygelman@broadcom.com, william.zhang@broadcom.com, anand.gore@broadcom.com, kursad.oney@broadcom.com, florian.fainelli@broadcom.com, rafal@milecki.pl, bcm-kernel-feedback-list@broadcom.com, andre.przywara@arm.com, baruch@tkos.co.il, linux-arm-kernel@lists.infradead.org, dan.carpenter@linaro.org Subject: [PATCH v2 02/10] ARM: dts: broadcom: bcmbca: Add NAND controller node Date: Thu, 18 Jan 2024 11:53:48 -0800 Message-Id: <20240118195356.133391-3-dregan@broadcom.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20240118195356.133391-1-dregan@broadcom.com> References: <20240118195356.133391-1-dregan@broadcom.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240118_115429_354806_000066C8 X-CRM114-Status: GOOD ( 10.38 ) X-Spam-Score: -0.4 (/) 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: From: William Zhang Add support for Broadcom STB NAND controller in BCMBCA ARMv7 chip dts files. Signed-off-by: William Zhang Reviewed-by: David Regan --- Changes in v2: None --- arch/arm/boot/dts/broadcom/bcm47622.dtsi | 17 +++++++++++++++++ arc [...] Content analysis details: (-0.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1030 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender 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 From: William Zhang Add support for Broadcom STB NAND controller in BCMBCA ARMv7 chip dts files. Signed-off-by: William Zhang Reviewed-by: David Regan --- Changes in v2: None --- arch/arm/boot/dts/broadcom/bcm47622.dtsi | 17 +++++++++++++++++ arch/arm/boot/dts/broadcom/bcm63138.dtsi | 10 +++++++++- arch/arm/boot/dts/broadcom/bcm63148.dtsi | 17 +++++++++++++++++ arch/arm/boot/dts/broadcom/bcm63178.dtsi | 17 +++++++++++++++++ arch/arm/boot/dts/broadcom/bcm6756.dtsi | 17 +++++++++++++++++ arch/arm/boot/dts/broadcom/bcm6846.dtsi | 17 +++++++++++++++++ arch/arm/boot/dts/broadcom/bcm6855.dtsi | 17 +++++++++++++++++ arch/arm/boot/dts/broadcom/bcm6878.dtsi | 17 +++++++++++++++++ arch/arm/boot/dts/broadcom/bcm947622.dts | 4 ++++ arch/arm/boot/dts/broadcom/bcm963138.dts | 4 ++++ arch/arm/boot/dts/broadcom/bcm963138dvt.dts | 12 +++++------- arch/arm/boot/dts/broadcom/bcm963148.dts | 4 ++++ arch/arm/boot/dts/broadcom/bcm963178.dts | 4 ++++ arch/arm/boot/dts/broadcom/bcm96756.dts | 4 ++++ arch/arm/boot/dts/broadcom/bcm96846.dts | 4 ++++ arch/arm/boot/dts/broadcom/bcm96855.dts | 4 ++++ arch/arm/boot/dts/broadcom/bcm96878.dts | 4 ++++ 17 files changed, 165 insertions(+), 8 deletions(-) diff --git a/arch/arm/boot/dts/broadcom/bcm47622.dtsi b/arch/arm/boot/dts/broadcom/bcm47622.dtsi index 7cd38de118c3..55ff18043d96 100644 --- a/arch/arm/boot/dts/broadcom/bcm47622.dtsi +++ b/arch/arm/boot/dts/broadcom/bcm47622.dtsi @@ -138,6 +138,23 @@ hsspi: spi@1000 { status = "disabled"; }; + nand_controller: nand-controller@1800 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.1", "brcm,brcmnand"; + reg = <0x1800 0x600>, <0x2000 0x10>; + reg-names = "nand", "nand-int-base"; + brcm,nand-use-wp = <0>; + status = "disabled"; + + nandcs: nand@0 { + compatible = "brcm,nandcs"; + reg = <0>; + nand-on-flash-bbt; + brcm,nand-ecc-use-strap; + }; + }; + uart0: serial@12000 { compatible = "arm,pl011", "arm,primecell"; reg = <0x12000 0x1000>; diff --git a/arch/arm/boot/dts/broadcom/bcm63138.dtsi b/arch/arm/boot/dts/broadcom/bcm63138.dtsi index 4ef02283612b..3aaee1c6994e 100644 --- a/arch/arm/boot/dts/broadcom/bcm63138.dtsi +++ b/arch/arm/boot/dts/broadcom/bcm63138.dtsi @@ -229,7 +229,15 @@ nand_controller: nand-controller@2000 { reg-names = "nand", "nand-int-base"; status = "disabled"; interrupts = ; - interrupt-names = "nand"; + interrupt-names = "nand_ctlrdy"; + brcm,nand-use-wp = <0>; + + nandcs: nand@0 { + compatible = "brcm,nandcs"; + reg = <0>; + nand-on-flash-bbt; + brcm,nand-ecc-use-strap; + }; }; serial@4400 { diff --git a/arch/arm/boot/dts/broadcom/bcm63148.dtsi b/arch/arm/boot/dts/broadcom/bcm63148.dtsi index 24431de1810e..6ecd530a7225 100644 --- a/arch/arm/boot/dts/broadcom/bcm63148.dtsi +++ b/arch/arm/boot/dts/broadcom/bcm63148.dtsi @@ -119,5 +119,22 @@ hsspi: spi@1000 { num-cs = <8>; status = "disabled"; }; + + nand_controller: nand-controller@2000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.1", "brcm,brcmnand"; + reg = <0x2000 0x600>, <0xf0 0x10>; + reg-names = "nand", "nand-int-base"; + brcm,nand-use-wp = <0>; + status = "disabled"; + + nandcs: nand@0 { + compatible = "brcm,nandcs"; + reg = <0>; + nand-on-flash-bbt; + brcm,nand-ecc-use-strap; + }; + }; }; }; diff --git a/arch/arm/boot/dts/broadcom/bcm63178.dtsi b/arch/arm/boot/dts/broadcom/bcm63178.dtsi index 3f9aed96babf..742991fc7544 100644 --- a/arch/arm/boot/dts/broadcom/bcm63178.dtsi +++ b/arch/arm/boot/dts/broadcom/bcm63178.dtsi @@ -129,6 +129,23 @@ hsspi: spi@1000 { status = "disabled"; }; + nand_controller: nand-controller@1800 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.1", "brcm,brcmnand"; + reg = <0x1800 0x600>, <0x2000 0x10>; + reg-names = "nand", "nand-int-base"; + brcm,nand-use-wp = <0>; + status = "disabled"; + + nandcs: nand@0 { + compatible = "brcm,nandcs"; + reg = <0>; + nand-on-flash-bbt; + brcm,nand-ecc-use-strap; + }; + }; + uart0: serial@12000 { compatible = "arm,pl011", "arm,primecell"; reg = <0x12000 0x1000>; diff --git a/arch/arm/boot/dts/broadcom/bcm6756.dtsi b/arch/arm/boot/dts/broadcom/bcm6756.dtsi index 1d8d957d65dd..0f08b99d93c2 100644 --- a/arch/arm/boot/dts/broadcom/bcm6756.dtsi +++ b/arch/arm/boot/dts/broadcom/bcm6756.dtsi @@ -139,6 +139,23 @@ hsspi: spi@1000 { status = "disabled"; }; + nand_controller: nand-controller@1800 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.1", "brcm,brcmnand"; + reg = <0x1800 0x600>, <0x2000 0x10>; + reg-names = "nand", "nand-int-base"; + brcm,nand-use-wp = <0>; + status = "disabled"; + + nandcs: nand@0 { + compatible = "brcm,nandcs"; + reg = <0>; + nand-on-flash-bbt; + brcm,nand-ecc-use-strap; + }; + }; + uart0: serial@12000 { compatible = "arm,pl011", "arm,primecell"; reg = <0x12000 0x1000>; diff --git a/arch/arm/boot/dts/broadcom/bcm6846.dtsi b/arch/arm/boot/dts/broadcom/bcm6846.dtsi index cf92cf8c4693..856fd2352cca 100644 --- a/arch/arm/boot/dts/broadcom/bcm6846.dtsi +++ b/arch/arm/boot/dts/broadcom/bcm6846.dtsi @@ -119,5 +119,22 @@ hsspi: spi@1000 { num-cs = <8>; status = "disabled"; }; + + nand_controller: nand-controller@1800 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.1", "brcm,brcmnand"; + reg = <0x1800 0x600>, <0x2000 0x10>; + reg-names = "nand", "nand-int-base"; + brcm,nand-use-wp = <0>; + status = "disabled"; + + nandcs: nand@0 { + compatible = "brcm,nandcs"; + reg = <0>; + nand-on-flash-bbt; + brcm,nand-ecc-use-strap; + }; + }; }; }; diff --git a/arch/arm/boot/dts/broadcom/bcm6855.dtsi b/arch/arm/boot/dts/broadcom/bcm6855.dtsi index 52d6bc89f9f8..ad6f63a92c3a 100644 --- a/arch/arm/boot/dts/broadcom/bcm6855.dtsi +++ b/arch/arm/boot/dts/broadcom/bcm6855.dtsi @@ -129,6 +129,23 @@ hsspi: spi@1000 { status = "disabled"; }; + nand_controller: nand-controller@1800 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.1", "brcm,brcmnand"; + reg = <0x1800 0x600>, <0x2000 0x10>; + reg-names = "nand", "nand-int-base"; + brcm,nand-use-wp = <0>; + status = "disabled"; + + nandcs: nand@0 { + compatible = "brcm,nandcs"; + reg = <0>; + nand-on-flash-bbt; + brcm,nand-ecc-use-strap; + }; + }; + uart0: serial@12000 { compatible = "arm,pl011", "arm,primecell"; reg = <0x12000 0x1000>; diff --git a/arch/arm/boot/dts/broadcom/bcm6878.dtsi b/arch/arm/boot/dts/broadcom/bcm6878.dtsi index 2c5d706bac7e..540aac1b82f9 100644 --- a/arch/arm/boot/dts/broadcom/bcm6878.dtsi +++ b/arch/arm/boot/dts/broadcom/bcm6878.dtsi @@ -120,6 +120,23 @@ hsspi: spi@1000 { status = "disabled"; }; + nand_controller: nand-controller@1800 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.1", "brcm,brcmnand"; + reg = <0x1800 0x600>, <0x2000 0x10>; + reg-names = "nand", "nand-int-base"; + brcm,nand-use-wp = <0>; + status = "disabled"; + + nandcs: nand@0 { + compatible = "brcm,nandcs"; + reg = <0>; + nand-on-flash-bbt; + brcm,nand-ecc-use-strap; + }; + }; + uart0: serial@12000 { compatible = "arm,pl011", "arm,primecell"; reg = <0x12000 0x1000>; diff --git a/arch/arm/boot/dts/broadcom/bcm947622.dts b/arch/arm/boot/dts/broadcom/bcm947622.dts index 93b8ce22678d..22e3c4508e1a 100644 --- a/arch/arm/boot/dts/broadcom/bcm947622.dts +++ b/arch/arm/boot/dts/broadcom/bcm947622.dts @@ -32,3 +32,7 @@ &uart0 { &hsspi { status = "okay"; }; + +&nand_controller { + status = "okay"; +}; diff --git a/arch/arm/boot/dts/broadcom/bcm963138.dts b/arch/arm/boot/dts/broadcom/bcm963138.dts index 1b405c249213..450289d47dc7 100644 --- a/arch/arm/boot/dts/broadcom/bcm963138.dts +++ b/arch/arm/boot/dts/broadcom/bcm963138.dts @@ -29,3 +29,7 @@ &serial0 { &hsspi { status = "okay"; }; + +&nand_controller { + status = "okay"; +}; diff --git a/arch/arm/boot/dts/broadcom/bcm963138dvt.dts b/arch/arm/boot/dts/broadcom/bcm963138dvt.dts index b5af61853a07..22107d14a120 100644 --- a/arch/arm/boot/dts/broadcom/bcm963138dvt.dts +++ b/arch/arm/boot/dts/broadcom/bcm963138dvt.dts @@ -33,14 +33,12 @@ &serial1 { &nand_controller { status = "okay"; +}; - nand@0 { - compatible = "brcm,nandcs"; - reg = <0>; - nand-ecc-strength = <4>; - nand-ecc-step-size = <512>; - brcm,nand-oob-sectors-size = <16>; - }; +&nandcs { + nand-ecc-strength = <4>; + nand-ecc-step-size = <512>; + brcm,nand-oob-sector-size = <16>; }; &ahci { diff --git a/arch/arm/boot/dts/broadcom/bcm963148.dts b/arch/arm/boot/dts/broadcom/bcm963148.dts index 1f5d6d783f09..aa08b473c7cd 100644 --- a/arch/arm/boot/dts/broadcom/bcm963148.dts +++ b/arch/arm/boot/dts/broadcom/bcm963148.dts @@ -32,3 +32,7 @@ &uart0 { &hsspi { status = "okay"; }; + +&nand_controller { + status = "okay"; +}; diff --git a/arch/arm/boot/dts/broadcom/bcm963178.dts b/arch/arm/boot/dts/broadcom/bcm963178.dts index d036e99dd8d1..c0f504ac43a4 100644 --- a/arch/arm/boot/dts/broadcom/bcm963178.dts +++ b/arch/arm/boot/dts/broadcom/bcm963178.dts @@ -32,3 +32,7 @@ &uart0 { &hsspi { status = "okay"; }; + +&nand_controller { + status = "okay"; +}; diff --git a/arch/arm/boot/dts/broadcom/bcm96756.dts b/arch/arm/boot/dts/broadcom/bcm96756.dts index 8b104f3fb14a..2ce998f2b84f 100644 --- a/arch/arm/boot/dts/broadcom/bcm96756.dts +++ b/arch/arm/boot/dts/broadcom/bcm96756.dts @@ -32,3 +32,7 @@ &uart0 { &hsspi { status = "okay"; }; + +&nand_controller { + status = "okay"; +}; diff --git a/arch/arm/boot/dts/broadcom/bcm96846.dts b/arch/arm/boot/dts/broadcom/bcm96846.dts index 55852c229608..f4b9a07370ee 100644 --- a/arch/arm/boot/dts/broadcom/bcm96846.dts +++ b/arch/arm/boot/dts/broadcom/bcm96846.dts @@ -32,3 +32,7 @@ &uart0 { &hsspi { status = "okay"; }; + +&nand_controller { + status = "okay"; +}; diff --git a/arch/arm/boot/dts/broadcom/bcm96855.dts b/arch/arm/boot/dts/broadcom/bcm96855.dts index 2ad880af2104..5c94063bceaf 100644 --- a/arch/arm/boot/dts/broadcom/bcm96855.dts +++ b/arch/arm/boot/dts/broadcom/bcm96855.dts @@ -32,3 +32,7 @@ &uart0 { &hsspi { status = "okay"; }; + +&nand_controller { + status = "okay"; +}; diff --git a/arch/arm/boot/dts/broadcom/bcm96878.dts b/arch/arm/boot/dts/broadcom/bcm96878.dts index b7af8ade7a9d..910f7e125bad 100644 --- a/arch/arm/boot/dts/broadcom/bcm96878.dts +++ b/arch/arm/boot/dts/broadcom/bcm96878.dts @@ -32,3 +32,7 @@ &uart0 { &hsspi { status = "okay"; }; + +&nand_controller { + status = "okay"; +}; From patchwork Thu Jan 18 19:53:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Regan X-Patchwork-Id: 1888217 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=d3cIZvVR; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=broadcom.com header.i=@broadcom.com header.a=rsa-sha256 header.s=google header.b=EvlIwPuO; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=198.137.202.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 [198.137.202.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 4TGD4S6SLqz23fH for ; Fri, 19 Jan 2024 06:55:20 +1100 (AEDT) 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=MZKCvoXeCIKTgtxd1G6FBz0B5rQPg3MTSpwV7XMUV2I=; b=d3cIZvVRRgNK7Y FRDnSvo1JBDqua4FolMsraQCjvd4xswMtYRSD++ZmNEG/x0KKlaC40bJ+UUU82w3PVzr81n9hhwrP XukB2goax8eCHSbSwVHZAlkPAc/mSz8PUoqH/8m6kBsj3Jx7rQOfXJGBMpdWGyecEG9R5YhRA4oYN giI+mse7tZYQX2vIg4O8f0VUfF2gGqFy3lEb1okzpIJ1c3kDa/jicos5OIQMqY+WLnTUPPFwtJXs1 /8c/8jjHX/hwqJzM8cKkQ707G+Z4oVxNoidRJPPGzaO+6fpFqIE9UVi/1LtYTHarMab7dOmYG5aTI g2aFKnDMt93bQpzy1jag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQYTM-003gQe-1G; Thu, 18 Jan 2024 19:54:44 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQYT9-003gG9-1u for linux-mtd@lists.infradead.org; Thu, 18 Jan 2024 19:54:34 +0000 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1d51ba18e1bso105285925ad.0 for ; Thu, 18 Jan 2024 11:54:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1705607668; x=1706212468; 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=0hDcE9X5TULuB647AhqBvpK0WvuIC7BaHkURSvG7o60=; b=EvlIwPuOFC9tOj+bGFYwHWe9FQmp8qbd4YIfeJOyvy4fenIkAI0albQH0JJA3rEVSg zxtcwfBv+yTrEBu4fP6kOjH5c4e6kMll4h1rNJeKhVM18LbchorMczmljsHiC6mtEaF2 WiwxWExImcbvtpR8vp82qkhgM7prxzigTFxjI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705607668; x=1706212468; 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=0hDcE9X5TULuB647AhqBvpK0WvuIC7BaHkURSvG7o60=; b=Kdje3nmBpdtp4q/K0+Sn09VIYcBCOVGL6g1WTTUh5sK80OgdttEjdnTTSOg0AFnbGG 8dg0JXB5e+306A+nN5lKGIIsf6RqxT9nRNih2dRpezM+dtyXZKjWFGRcAj4jZjDlGA8/ cz2rUCruFz6CO3OWTPJTOo/kkhuO7oP3WYaFbdxuwjhC68TvvHaSppPfi+uqvYzIOTnj 8cirArXB1+YMGqId+zj8zF7Fs9JvPMF9OG169NAe1U8whQdX9yZ40CAD+DA6moyBbxxK Tk8lM0mfnkS5r0UhQBc8DLIGPr6/JOROzTCubWBNPDM6KpBYX4Vj7HCATgOAG3QCRuWz N+HQ== X-Gm-Message-State: AOJu0YyPca2lZpb6K+/GNNjS4mm5O7XZywE0O1yQuyF7xq+vSgvsQdJQ ijBOfG1a/ihUdlYT1DJ/IXOKmcLr2Ypiy4cDTYB+X0/iteePG0jXmiyQAn8ROg== X-Google-Smtp-Source: AGHT+IGGw4SKESvl3UhBCttzEHwT8TIeVCYclrj8MzDyiyhnEgfTOVt4tgOxdY5pwMLXEkwz/tom5g== X-Received: by 2002:a17:902:6b01:b0:1d5:c398:efa2 with SMTP id o1-20020a1709026b0100b001d5c398efa2mr1226528plk.110.1705607667872; Thu, 18 Jan 2024 11:54:27 -0800 (PST) Received: from bcacpedev-irv-3.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id rr12-20020a17090b2b4c00b0028d9b5d41edsm2263805pjb.38.2024.01.18.11.54.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2024 11:54:27 -0800 (PST) From: dregan@broadcom.com To: dregan@broadcom.com, dregan@mail.com, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, computersforpeace@gmail.com, kdasu.kdev@gmail.com, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, joel.peshkin@broadcom.com, tomer.yacoby@broadcom.com, dan.beygelman@broadcom.com, william.zhang@broadcom.com, anand.gore@broadcom.com, kursad.oney@broadcom.com, florian.fainelli@broadcom.com, rafal@milecki.pl, bcm-kernel-feedback-list@broadcom.com, andre.przywara@arm.com, baruch@tkos.co.il, linux-arm-kernel@lists.infradead.org, dan.carpenter@linaro.org Subject: [PATCH v2 03/10] arm64: dts: broadcom: bcmbca: Add NAND controller node Date: Thu, 18 Jan 2024 11:53:49 -0800 Message-Id: <20240118195356.133391-4-dregan@broadcom.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20240118195356.133391-1-dregan@broadcom.com> References: <20240118195356.133391-1-dregan@broadcom.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240118_115431_661856_BC24B000 X-CRM114-Status: GOOD ( 10.76 ) X-Spam-Score: -0.4 (/) 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: From: William Zhang Add support for Broadcom STB NAND controller in BCMBCA ARMv8 chip dts files. Signed-off-by: William Zhang Reviewed-by: David Regan --- Changes in v2: - Add nand controller node label for 4908 so it is consistent with other SoC [...] Content analysis details: (-0.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:630 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender 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 From: William Zhang Add support for Broadcom STB NAND controller in BCMBCA ARMv8 chip dts files. Signed-off-by: William Zhang Reviewed-by: David Regan --- Changes in v2: - Add nand controller node label for 4908 so it is consistent with other SoCs and can be referenced by board dts file --- .../arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi | 5 ++++- .../arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi | 17 +++++++++++++++++ .../boot/dts/broadcom/bcmbca/bcm63146.dtsi | 17 +++++++++++++++++ .../boot/dts/broadcom/bcmbca/bcm63158.dtsi | 17 +++++++++++++++++ .../arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi | 17 +++++++++++++++++ .../arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi | 17 +++++++++++++++++ .../arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi | 17 +++++++++++++++++ .../arm64/boot/dts/broadcom/bcmbca/bcm94912.dts | 4 ++++ .../boot/dts/broadcom/bcmbca/bcm963146.dts | 4 ++++ .../boot/dts/broadcom/bcmbca/bcm963158.dts | 4 ++++ .../arm64/boot/dts/broadcom/bcmbca/bcm96813.dts | 4 ++++ .../arm64/boot/dts/broadcom/bcmbca/bcm96856.dts | 4 ++++ .../arm64/boot/dts/broadcom/bcmbca/bcm96858.dts | 4 ++++ 13 files changed, 130 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi index 2f124b027bbf..03a516d02501 100644 --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi @@ -589,7 +589,7 @@ hsspi: spi@1000 { status = "disabled"; }; - nand-controller@1800 { + nand_controller: nand-controller@1800 { #address-cells = <1>; #size-cells = <0>; compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.1", "brcm,brcmnand"; @@ -597,11 +597,14 @@ nand-controller@1800 { reg-names = "nand", "nand-int-base"; interrupts = ; interrupt-names = "nand_ctlrdy"; + brcm,nand-use-wp = <0>; status = "okay"; nandcs: nand@0 { compatible = "brcm,nandcs"; reg = <0>; + nand-on-flash-bbt; + brcm,nand-ecc-use-strap; }; }; diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi index d658c81f7285..92a829542467 100644 --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi @@ -138,6 +138,23 @@ hsspi: spi@1000 { status = "disabled"; }; + nand_controller: nand-controller@1800 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.1", "brcm,brcmnand"; + reg = <0x1800 0x600>, <0x2000 0x10>; + reg-names = "nand", "nand-int-base"; + brcm,nand-use-wp = <0>; + status = "disabled"; + + nandcs: nand@0 { + compatible = "brcm,nandcs"; + reg = <0>; + nand-on-flash-bbt; + brcm,nand-ecc-use-strap; + }; + }; + uart0: serial@12000 { compatible = "arm,pl011", "arm,primecell"; reg = <0x12000 0x1000>; diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm63146.dtsi b/arch/arm64/boot/dts/broadcom/bcmbca/bcm63146.dtsi index 4f474d47022e..2283fd81ece6 100644 --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm63146.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm63146.dtsi @@ -119,6 +119,23 @@ hsspi: spi@1000 { status = "disabled"; }; + nand_controller: nand-controller@1800 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.1", "brcm,brcmnand"; + reg = <0x1800 0x600>, <0x2000 0x10>; + reg-names = "nand", "nand-int-base"; + brcm,nand-use-wp = <0>; + status = "disabled"; + + nandcs: nand@0 { + compatible = "brcm,nandcs"; + reg = <0>; + nand-on-flash-bbt; + brcm,nand-ecc-use-strap; + }; + }; + uart0: serial@12000 { compatible = "arm,pl011", "arm,primecell"; reg = <0x12000 0x1000>; diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm63158.dtsi b/arch/arm64/boot/dts/broadcom/bcmbca/bcm63158.dtsi index 909f254dc47d..c70177066a15 100644 --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm63158.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm63158.dtsi @@ -137,6 +137,23 @@ hsspi: spi@1000 { status = "disabled"; }; + nand_controller: nand-controller@1800 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.1", "brcm,brcmnand"; + reg = <0x1800 0x600>, <0x2000 0x10>; + reg-names = "nand", "nand-int-base"; + brcm,nand-use-wp = <0>; + status = "disabled"; + + nandcs: nand@0 { + compatible = "brcm,nandcs"; + reg = <0>; + nand-on-flash-bbt; + brcm,nand-ecc-use-strap; + }; + }; + uart0: serial@12000 { compatible = "arm,pl011", "arm,primecell"; reg = <0x12000 0x1000>; diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi index 685ae32951c9..09115e3af694 100644 --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi @@ -138,6 +138,23 @@ hsspi: spi@1000 { status = "disabled"; }; + nand_controller: nand-controller@1800 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.1", "brcm,brcmnand"; + reg = <0x1800 0x600>, <0x2000 0x10>; + reg-names = "nand", "nand-int-base"; + brcm,nand-use-wp = <0>; + status = "disabled"; + + nandcs: nand@0 { + compatible = "brcm,nandcs"; + reg = <0>; + nand-on-flash-bbt; + brcm,nand-ecc-use-strap; + }; + }; + uart0: serial@12000 { compatible = "arm,pl011", "arm,primecell"; reg = <0x12000 0x1000>; diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi index 820553ce541b..03ed65b35dbc 100644 --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi @@ -119,5 +119,22 @@ hsspi: spi@1000 { num-cs = <8>; status = "disabled"; }; + + nand_controller: nand-controller@1800 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.1", "brcm,brcmnand"; + reg = <0x1800 0x600>, <0x2000 0x10>; + reg-names = "nand", "nand-int-base"; + brcm,nand-use-wp = <0>; + status = "disabled"; + + nandcs: nand@0 { + compatible = "brcm,nandcs"; + reg = <0>; + nand-on-flash-bbt; + brcm,nand-ecc-use-strap; + }; + }; }; }; diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi index 0eb93c298297..36f1fc06fcec 100644 --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi @@ -156,5 +156,22 @@ hsspi: spi@1000 { num-cs = <8>; status = "disabled"; }; + + nand_controller: nand-controller@1800 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.1", "brcm,brcmnand"; + reg = <0x1800 0x600>, <0x2000 0x10>; + reg-names = "nand", "nand-int-base"; + brcm,nand-use-wp = <0>; + status = "disabled"; + + nandcs: nand@0 { + compatible = "brcm,nandcs"; + reg = <0>; + nand-on-flash-bbt; + brcm,nand-ecc-use-strap; + }; + }; }; }; diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm94912.dts b/arch/arm64/boot/dts/broadcom/bcmbca/bcm94912.dts index e69cd683211a..4d1ea501e384 100644 --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm94912.dts +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm94912.dts @@ -32,3 +32,7 @@ &uart0 { &hsspi { status = "okay"; }; + +&nand_controller { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm963146.dts b/arch/arm64/boot/dts/broadcom/bcmbca/bcm963146.dts index db2c82d6dfd8..810b5a23da7b 100644 --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm963146.dts +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm963146.dts @@ -32,3 +32,7 @@ &uart0 { &hsspi { status = "okay"; }; + +&nand_controller { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm963158.dts b/arch/arm64/boot/dts/broadcom/bcmbca/bcm963158.dts index 25c12bc63545..3aaae5dbb568 100644 --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm963158.dts +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm963158.dts @@ -32,3 +32,7 @@ &uart0 { &hsspi { status = "okay"; }; + +&nand_controller { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm96813.dts b/arch/arm64/boot/dts/broadcom/bcmbca/bcm96813.dts index faba21f03120..6b167cc2af76 100644 --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm96813.dts +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm96813.dts @@ -32,3 +32,7 @@ &uart0 { &hsspi { status = "okay"; }; + +&nand_controller { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm96856.dts b/arch/arm64/boot/dts/broadcom/bcmbca/bcm96856.dts index 9808331eede2..d598cd618b57 100644 --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm96856.dts +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm96856.dts @@ -32,3 +32,7 @@ &uart0 { &hsspi { status = "okay"; }; + +&nand_controller { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm96858.dts b/arch/arm64/boot/dts/broadcom/bcmbca/bcm96858.dts index 1f561c8e13b0..e50ddbf6f58c 100644 --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm96858.dts +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm96858.dts @@ -32,3 +32,7 @@ &uart0 { &hsspi { status = "okay"; }; + +&nand_controller { + status = "okay"; +}; From patchwork Thu Jan 18 19:53:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Regan X-Patchwork-Id: 1888220 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=GHLeAEbz; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=broadcom.com header.i=@broadcom.com header.a=rsa-sha256 header.s=google header.b=exUtFmkR; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=198.137.202.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 [198.137.202.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 4TGD4b1x00z23fB for ; Fri, 19 Jan 2024 06:55:27 +1100 (AEDT) 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=y11sONtdstH5cJaDZdTvRjLZjrCkBbuoKKg0Mjip6lc=; b=GHLeAEbz0fXyvl YpkWP+RdnkCb2hXffIkPszyDS2SLcGRIvNDhTf4EzTt+3jdswjzRPI+pczWYb6RK56db1e4ZwWVNU 3+pqwZ1UWXJUeLP4dj3OtNDrnvlCpG02x0K5dZBIFBVlFjI8irrVoUOGul9QuXE5OjhwZQVn8safQ CibyxKxRoKKEgnvKaaMX3L57bzczweyrmxa2ALXmn8gSIXxdVX9r/5Pi8fRJ5jCfynqBCl2X9AQr3 PwredGwiXyxC0q7A6WVHDYRQMJVc7w0IDzUduQu7hlWjYHY62o2e9LHCf+RfjNeqJfn8rFK+o/2Ra 6+txeePseeFRU47tNsSg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQYTY-003ga5-2p; Thu, 18 Jan 2024 19:54:56 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQYTB-003gHZ-0m for linux-mtd@lists.infradead.org; Thu, 18 Jan 2024 19:54:37 +0000 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1d41bb4da91so76729525ad.0 for ; Thu, 18 Jan 2024 11:54:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1705607669; x=1706212469; 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=Jja3d4MjXLOFSymCPf/lawx88oSJHo/XoqweGhZS6o4=; b=exUtFmkRifM3R0OkXokYUtiblLl6NmwcJAYXmSorbJdC9uVLq/bdeKEnjNP/6A8W1P m0ghneffyN8jfmosZemYq6VSu30WXYR2Tv3Zqce1WkusuSPSSwteFDxfGY1r87w62KSd h1gWPJeLsNSiIP6NnZgnxfeihiGNk3wqvTCkc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705607669; x=1706212469; 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=Jja3d4MjXLOFSymCPf/lawx88oSJHo/XoqweGhZS6o4=; b=hlyl9FL3rffZxmaURjXHyNv6ZZGA1nwL6jk08OkdefycBDY1N5+H7VC5iEpx1sNX7s OfO9kc8ABEqSyx/Nv6fektuXimCtudxhBXwTaNmlLs7i3i1szK4d/hzWPIi19DNmRCOT 0jdt0be37io0yuydnysmXiu1Dzakn/XO/AwR6nT9COaCCOTDYGmuQVTR/3kjsXBWX1eq Xf1n+ERafn56Nl2J8aUepX4gHJ1Yi4KTJ8LJPqx+PLq/8t2KQxdEMN3YqOvWDUfgvgla jEMF8apsqMa6WVSH3V+aCZrV6Rod1aEVQmfaD2iYeBR6UbwODcSrKOPWpLMXD5+0xq2z ZR/w== X-Gm-Message-State: AOJu0YzPH0hVCV/NJOdQt7LOoTMM/27izjtF61IRYw7wj9BUy6LDgndk H674F1jnjt7IjDy6W84uinCcfs/oNl/X6oeBrs4MRC25IZL0pddcH3nP4u1Wlg== X-Google-Smtp-Source: AGHT+IGWaTCuAGpakDPXPQVCgRpiaK5V07i0ywdIak6g2Fqi80lRf2SNBFR3l9QCrOG60CmvedyNcw== X-Received: by 2002:a17:90a:5d8d:b0:290:14a1:d6be with SMTP id t13-20020a17090a5d8d00b0029014a1d6bemr963862pji.75.1705607669413; Thu, 18 Jan 2024 11:54:29 -0800 (PST) Received: from bcacpedev-irv-3.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id rr12-20020a17090b2b4c00b0028d9b5d41edsm2263805pjb.38.2024.01.18.11.54.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2024 11:54:29 -0800 (PST) From: dregan@broadcom.com To: dregan@broadcom.com, dregan@mail.com, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, computersforpeace@gmail.com, kdasu.kdev@gmail.com, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, joel.peshkin@broadcom.com, tomer.yacoby@broadcom.com, dan.beygelman@broadcom.com, william.zhang@broadcom.com, anand.gore@broadcom.com, kursad.oney@broadcom.com, florian.fainelli@broadcom.com, rafal@milecki.pl, bcm-kernel-feedback-list@broadcom.com, andre.przywara@arm.com, baruch@tkos.co.il, linux-arm-kernel@lists.infradead.org, dan.carpenter@linaro.org Subject: [PATCH v2 04/10] mtd: rawnand: brcmnand: Rename bcm63138 nand driver Date: Thu, 18 Jan 2024 11:53:50 -0800 Message-Id: <20240118195356.133391-5-dregan@broadcom.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20240118195356.133391-1-dregan@broadcom.com> References: <20240118195356.133391-1-dregan@broadcom.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240118_115433_297721_03790E87 X-CRM114-Status: GOOD ( 21.09 ) X-Spam-Score: -0.4 (/) 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: From: William Zhang In preparing to support multiple BCMBCA SoCs, rename bcm63138 to bcmbca in the driver code and driver file name. Signed-off-by: William Zhang Reviewed-by: David Regan Acked-by: Florian Fainelli --- Changes in v2: None --- drivers/ [...] Content analysis details: (-0.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:632 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender 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 From: William Zhang In preparing to support multiple BCMBCA SoCs, rename bcm63138 to bcmbca in the driver code and driver file name. Signed-off-by: William Zhang Reviewed-by: David Regan Acked-by: Florian Fainelli --- Changes in v2: None --- drivers/mtd/nand/raw/brcmnand/Makefile | 2 +- drivers/mtd/nand/raw/brcmnand/bcm63138_nand.c | 99 ------------------- drivers/mtd/nand/raw/brcmnand/bcmbca_nand.c | 99 +++++++++++++++++++ 3 files changed, 100 insertions(+), 100 deletions(-) delete mode 100644 drivers/mtd/nand/raw/brcmnand/bcm63138_nand.c create mode 100644 drivers/mtd/nand/raw/brcmnand/bcmbca_nand.c diff --git a/drivers/mtd/nand/raw/brcmnand/Makefile b/drivers/mtd/nand/raw/brcmnand/Makefile index 9907e3ec4bb2..0536568c6467 100644 --- a/drivers/mtd/nand/raw/brcmnand/Makefile +++ b/drivers/mtd/nand/raw/brcmnand/Makefile @@ -2,7 +2,7 @@ # link order matters; don't link the more generic brcmstb_nand.o before the # more specific iproc_nand.o, for instance obj-$(CONFIG_MTD_NAND_BRCMNAND_IPROC) += iproc_nand.o -obj-$(CONFIG_MTD_NAND_BRCMNAND_BCMBCA) += bcm63138_nand.o +obj-$(CONFIG_MTD_NAND_BRCMNAND_BCMBCA) += bcmbca_nand.o obj-$(CONFIG_MTD_NAND_BRCMNAND_BCM63XX) += bcm6368_nand.o obj-$(CONFIG_MTD_NAND_BRCMNAND_BRCMSTB) += brcmstb_nand.o obj-$(CONFIG_MTD_NAND_BRCMNAND) += brcmnand.o diff --git a/drivers/mtd/nand/raw/brcmnand/bcm63138_nand.c b/drivers/mtd/nand/raw/brcmnand/bcm63138_nand.c deleted file mode 100644 index 968c5b674b08..000000000000 --- a/drivers/mtd/nand/raw/brcmnand/bcm63138_nand.c +++ /dev/null @@ -1,99 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * Copyright © 2015 Broadcom Corporation - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "brcmnand.h" - -struct bcm63138_nand_soc { - struct brcmnand_soc soc; - void __iomem *base; -}; - -#define BCM63138_NAND_INT_STATUS 0x00 -#define BCM63138_NAND_INT_EN 0x04 - -enum { - BCM63138_CTLRDY = BIT(4), -}; - -static bool bcm63138_nand_intc_ack(struct brcmnand_soc *soc) -{ - struct bcm63138_nand_soc *priv = - container_of(soc, struct bcm63138_nand_soc, soc); - void __iomem *mmio = priv->base + BCM63138_NAND_INT_STATUS; - u32 val = brcmnand_readl(mmio); - - if (val & BCM63138_CTLRDY) { - brcmnand_writel(val & ~BCM63138_CTLRDY, mmio); - return true; - } - - return false; -} - -static void bcm63138_nand_intc_set(struct brcmnand_soc *soc, bool en) -{ - struct bcm63138_nand_soc *priv = - container_of(soc, struct bcm63138_nand_soc, soc); - void __iomem *mmio = priv->base + BCM63138_NAND_INT_EN; - u32 val = brcmnand_readl(mmio); - - if (en) - val |= BCM63138_CTLRDY; - else - val &= ~BCM63138_CTLRDY; - - brcmnand_writel(val, mmio); -} - -static int bcm63138_nand_probe(struct platform_device *pdev) -{ - struct device *dev = &pdev->dev; - struct bcm63138_nand_soc *priv; - struct brcmnand_soc *soc; - - priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); - if (!priv) - return -ENOMEM; - soc = &priv->soc; - - priv->base = devm_platform_ioremap_resource_byname(pdev, "nand-int-base"); - if (IS_ERR(priv->base)) - return PTR_ERR(priv->base); - - soc->ctlrdy_ack = bcm63138_nand_intc_ack; - soc->ctlrdy_set_enabled = bcm63138_nand_intc_set; - - return brcmnand_probe(pdev, soc); -} - -static const struct of_device_id bcm63138_nand_of_match[] = { - { .compatible = "brcm,nand-bcm63138" }, - {}, -}; -MODULE_DEVICE_TABLE(of, bcm63138_nand_of_match); - -static struct platform_driver bcm63138_nand_driver = { - .probe = bcm63138_nand_probe, - .remove_new = brcmnand_remove, - .driver = { - .name = "bcm63138_nand", - .pm = &brcmnand_pm_ops, - .of_match_table = bcm63138_nand_of_match, - } -}; -module_platform_driver(bcm63138_nand_driver); - -MODULE_LICENSE("GPL v2"); -MODULE_AUTHOR("Brian Norris"); -MODULE_DESCRIPTION("NAND driver for BCM63138"); diff --git a/drivers/mtd/nand/raw/brcmnand/bcmbca_nand.c b/drivers/mtd/nand/raw/brcmnand/bcmbca_nand.c new file mode 100644 index 000000000000..3e2f3b79788d --- /dev/null +++ b/drivers/mtd/nand/raw/brcmnand/bcmbca_nand.c @@ -0,0 +1,99 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright © 2015 Broadcom Corporation + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "brcmnand.h" + +struct bcmbca_nand_soc { + struct brcmnand_soc soc; + void __iomem *base; +}; + +#define BCMBCA_NAND_INT_STATUS 0x00 +#define BCMBCA_NAND_INT_EN 0x04 + +enum { + BCMBCA_CTLRDY = BIT(4), +}; + +static bool bcmbca_nand_intc_ack(struct brcmnand_soc *soc) +{ + struct bcmbca_nand_soc *priv = + container_of(soc, struct bcmbca_nand_soc, soc); + void __iomem *mmio = priv->base + BCMBCA_NAND_INT_STATUS; + u32 val = brcmnand_readl(mmio); + + if (val & BCMBCA_CTLRDY) { + brcmnand_writel(val & ~BCMBCA_CTLRDY, mmio); + return true; + } + + return false; +} + +static void bcmbca_nand_intc_set(struct brcmnand_soc *soc, bool en) +{ + struct bcmbca_nand_soc *priv = + container_of(soc, struct bcmbca_nand_soc, soc); + void __iomem *mmio = priv->base + BCMBCA_NAND_INT_EN; + u32 val = brcmnand_readl(mmio); + + if (en) + val |= BCMBCA_CTLRDY; + else + val &= ~BCMBCA_CTLRDY; + + brcmnand_writel(val, mmio); +} + +static int bcmbca_nand_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct bcmbca_nand_soc *priv; + struct brcmnand_soc *soc; + + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + soc = &priv->soc; + + priv->base = devm_platform_ioremap_resource_byname(pdev, "nand-int-base"); + if (IS_ERR(priv->base)) + return PTR_ERR(priv->base); + + soc->ctlrdy_ack = bcmbca_nand_intc_ack; + soc->ctlrdy_set_enabled = bcmbca_nand_intc_set; + + return brcmnand_probe(pdev, soc); +} + +static const struct of_device_id bcmbca_nand_of_match[] = { + { .compatible = "brcm,nand-bcm63138" }, + {}, +}; +MODULE_DEVICE_TABLE(of, bcmbca_nand_of_match); + +static struct platform_driver bcmbca_nand_driver = { + .probe = bcmbca_nand_probe, + .remove_new = brcmnand_remove, + .driver = { + .name = "bcmbca_nand", + .pm = &brcmnand_pm_ops, + .of_match_table = bcmbca_nand_of_match, + } +}; +module_platform_driver(bcmbca_nand_driver); + +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Brian Norris"); +MODULE_DESCRIPTION("NAND driver for BCMBCA"); From patchwork Thu Jan 18 19:53:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Regan X-Patchwork-Id: 1888214 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=lEOAH7c6; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=broadcom.com header.i=@broadcom.com header.a=rsa-sha256 header.s=google header.b=T83LGlFz; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=198.137.202.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 [198.137.202.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 4TGD4S3xy7z23fB for ; Fri, 19 Jan 2024 06:55:19 +1100 (AEDT) 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=VHJed7DxLSJmkjb76xSzgJDPN37f/RLQQbZ8ZWuFvr8=; b=lEOAH7c6vcdW/R ESRj981rTcym7RNv91qM/8sAy43+CjaCpAidNnOU1dYHFOygGyfFk2LPMr5uC1vGZQAbGcjWX30ww blFpUQPCNZYXQZr5gYWmsEGcCsdepp1/7vk+yoKyFEof846uVXb8g0fnRH0S6kPWNfZBi5RzdNEWI JIrU4eUpKMe0dNt5pBA5bnE09YYhwLLjz6EetnxugR+gd5+dIOmPy/bvrIDVsrUJG4DQX+eGP1gms xLHgRlIdEIDRpbzRZcsUFZQd/A1BT8hXCArH1Wd1aC/MQirCIbhQGM45DLNYuHta2T3gt7Temy3r5 2HPVDGDEQhw+6O8NP20Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQYTR-003gTL-1f; Thu, 18 Jan 2024 19:54:49 +0000 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQYTB-003gHk-0Z for linux-mtd@lists.infradead.org; Thu, 18 Jan 2024 19:54:36 +0000 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-2901ac9ba23so61604a91.3 for ; Thu, 18 Jan 2024 11:54:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1705607671; x=1706212471; 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=a9nIEwVNU9nrVzzdc3UDxZ1mL6R1G/Zg0+QNVyqab1M=; b=T83LGlFz+MwBq+DI7QG5M4xjJz56lGB586YsJAPqSX/FF5UW1C/QtOWwL9aJoJZ9XK LlPu1VnGaS/6Gz8luZMh8xW3wqfV3GDxgB1FZsUEChUVWqzV8+lQpes90fdy7NSQiAYR DowEjUl+go+pZrb18CXAamVEaYJOnPt+wL8e8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705607671; x=1706212471; 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=a9nIEwVNU9nrVzzdc3UDxZ1mL6R1G/Zg0+QNVyqab1M=; b=jKPi6YnWQ2Zuf6txvWe5f0D4eXTuWZBEyP5c5pi+/Le1CwjtrfWE2XGU2nbVzSTMiG AoWh2WaeNXqybJBY1SIZRQel+uyATo2ptTPMjtujxFYex5nPB1o9mpNc8ju8AwaoQUqF p53SELl5+hAqhxYKc1xOG5b8LgOs+D1+CewMX1xJXhufdzAYkgRMzHdaG1za6cbRvVQ9 y+cdNV/n1CGrlwya3BOx5XtuWW3dIYEJaJnPjVGCGMdCXGQtqSYBb/exbKQyTnbpI+Ts SoCehmyzDUhX1EP38Mgval5GIafaNzyBhLq5TvDJtSofu+09cmmxbYxmy3VA4r27k7bD +mFw== X-Gm-Message-State: AOJu0YwW0/zSnD1vEZNV6wwOdTUaRFhrCTjUDXF2bAgVGWZsmR2eBGT6 foVaS0dLPCx/Fy1OrR9tDlh37USdjbZAqf/6Am2lN0FG6bLzJY82y5RzxtGLPw== X-Google-Smtp-Source: AGHT+IF1uT0tnXlf2HtFn/G/H7HDpbxtrhjrJDgSlPbjmMYqYcWSwA5NLVB+e4W2YIcoiYdUjoGaIQ== X-Received: by 2002:a17:90a:1f4a:b0:28e:8012:1329 with SMTP id y10-20020a17090a1f4a00b0028e80121329mr1196921pjy.23.1705607671061; Thu, 18 Jan 2024 11:54:31 -0800 (PST) Received: from bcacpedev-irv-3.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id rr12-20020a17090b2b4c00b0028d9b5d41edsm2263805pjb.38.2024.01.18.11.54.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2024 11:54:30 -0800 (PST) From: dregan@broadcom.com To: dregan@broadcom.com, dregan@mail.com, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, computersforpeace@gmail.com, kdasu.kdev@gmail.com, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, joel.peshkin@broadcom.com, tomer.yacoby@broadcom.com, dan.beygelman@broadcom.com, william.zhang@broadcom.com, anand.gore@broadcom.com, kursad.oney@broadcom.com, florian.fainelli@broadcom.com, rafal@milecki.pl, bcm-kernel-feedback-list@broadcom.com, andre.przywara@arm.com, baruch@tkos.co.il, linux-arm-kernel@lists.infradead.org, dan.carpenter@linaro.org Subject: [PATCH v2 05/10] mtd: rawnand: brcmnand: Add BCMBCA read data bus interface Date: Thu, 18 Jan 2024 11:53:51 -0800 Message-Id: <20240118195356.133391-6-dregan@broadcom.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20240118195356.133391-1-dregan@broadcom.com> References: <20240118195356.133391-1-dregan@broadcom.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240118_115433_225487_85D22385 X-CRM114-Status: GOOD ( 21.00 ) X-Spam-Score: -0.4 (/) 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: From: William Zhang The BCMBCA broadband SoC integrates the NAND controller differently than STB, iProc and other SoCs. It has different endianness for NAND cache data. Add a SoC read data bus shim for BCMBCA to meet the specific SoC need and performance improvement using the optimized memcpy function on NAND cache memory. Content analysis details: (-0.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:102f listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender 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 From: William Zhang The BCMBCA broadband SoC integrates the NAND controller differently than STB, iProc and other SoCs. It has different endianness for NAND cache data. Add a SoC read data bus shim for BCMBCA to meet the specific SoC need and performance improvement using the optimized memcpy function on NAND cache memory. Signed-off-by: William Zhang Reviewed-by: David Regan --- Changes in v2: - Drop the is_param argument to the read data bus function now that we have the exec_op API to read the parameter page and ONFI data - Remove be32_to_cpu from brcmnand_read_data_bus --- drivers/mtd/nand/raw/brcmnand/bcmbca_nand.c | 27 +++++++++++++++++++++ drivers/mtd/nand/raw/brcmnand/brcmnand.c | 20 ++++++++++++--- drivers/mtd/nand/raw/brcmnand/brcmnand.h | 2 ++ 3 files changed, 46 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/raw/brcmnand/bcmbca_nand.c b/drivers/mtd/nand/raw/brcmnand/bcmbca_nand.c index 3e2f3b79788d..e97e13ae246c 100644 --- a/drivers/mtd/nand/raw/brcmnand/bcmbca_nand.c +++ b/drivers/mtd/nand/raw/brcmnand/bcmbca_nand.c @@ -26,6 +26,18 @@ enum { BCMBCA_CTLRDY = BIT(4), }; +#if defined(CONFIG_ARM64) +#define ALIGN_REQ 8 +#else +#define ALIGN_REQ 4 +#endif + +static inline bool bcmbca_nand_is_buf_aligned(void *flash_cache, void *buffer) +{ + return IS_ALIGNED((uintptr_t)buffer, ALIGN_REQ) && + IS_ALIGNED((uintptr_t)flash_cache, ALIGN_REQ); +} + static bool bcmbca_nand_intc_ack(struct brcmnand_soc *soc) { struct bcmbca_nand_soc *priv = @@ -56,6 +68,20 @@ static void bcmbca_nand_intc_set(struct brcmnand_soc *soc, bool en) brcmnand_writel(val, mmio); } +static void bcmbca_read_data_bus(struct brcmnand_soc *soc, + void __iomem *flash_cache, u32 *buffer, int fc_words) +{ + /* + * memcpy can do unaligned aligned access depending on source + * and dest address, which is incompatible with nand cache. Fallback + * to the memcpy for io version + */ + if (bcmbca_nand_is_buf_aligned((void *)flash_cache, buffer)) + memcpy((void *)buffer, (void *)flash_cache, fc_words * 4); + else + memcpy_fromio((void *)buffer, flash_cache, fc_words * 4); +} + static int bcmbca_nand_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -73,6 +99,7 @@ static int bcmbca_nand_probe(struct platform_device *pdev) soc->ctlrdy_ack = bcmbca_nand_intc_ack; soc->ctlrdy_set_enabled = bcmbca_nand_intc_set; + soc->read_data_bus = bcmbca_read_data_bus; return brcmnand_probe(pdev, soc); } diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c index 8faca43ae1ff..73fdf7ce21aa 100644 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c @@ -851,6 +851,20 @@ static inline u32 edu_readl(struct brcmnand_controller *ctrl, return brcmnand_readl(ctrl->edu_base + offs); } +static inline void brcmnand_read_data_bus(struct brcmnand_controller *ctrl, + void __iomem *flash_cache, u32 *buffer, int fc_words) +{ + struct brcmnand_soc *soc = ctrl->soc; + int i; + + if (soc->read_data_bus) { + soc->read_data_bus(soc, flash_cache, buffer, fc_words); + } else { + for (i = 0; i < fc_words; i++) + buffer[i] = brcmnand_read_fc(ctrl, i); + } +} + static void brcmnand_clear_ecc_addr(struct brcmnand_controller *ctrl) { @@ -1975,7 +1989,7 @@ static int brcmnand_read_by_pio(struct mtd_info *mtd, struct nand_chip *chip, { struct brcmnand_host *host = nand_get_controller_data(chip); struct brcmnand_controller *ctrl = host->ctrl; - int i, j, ret = 0; + int i, ret = 0; brcmnand_clear_ecc_addr(ctrl); @@ -1988,8 +2002,8 @@ static int brcmnand_read_by_pio(struct mtd_info *mtd, struct nand_chip *chip, if (likely(buf)) { brcmnand_soc_data_bus_prepare(ctrl->soc, false); - for (j = 0; j < FC_WORDS; j++, buf++) - *buf = brcmnand_read_fc(ctrl, j); + brcmnand_read_data_bus(ctrl, ctrl->nand_fc, buf, FC_WORDS); + buf += FC_WORDS; brcmnand_soc_data_bus_unprepare(ctrl->soc, false); } diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.h b/drivers/mtd/nand/raw/brcmnand/brcmnand.h index 928114c0be5e..7261a69989fe 100644 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.h +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.h @@ -24,6 +24,8 @@ struct brcmnand_soc { void (*ctlrdy_set_enabled)(struct brcmnand_soc *soc, bool en); void (*prepare_data_bus)(struct brcmnand_soc *soc, bool prepare, bool is_param); + void (*read_data_bus)(struct brcmnand_soc *soc, void __iomem *flash_cache, + u32 *buffer, int fc_words); const struct brcmnand_io_ops *ops; }; From patchwork Thu Jan 18 19:53:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Regan X-Patchwork-Id: 1888221 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=JyA41ok7; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=broadcom.com header.i=@broadcom.com header.a=rsa-sha256 header.s=google header.b=eEx5Cay6; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=198.137.202.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 [198.137.202.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 4TGD4k05KWz1yQ0 for ; Fri, 19 Jan 2024 06:55:34 +1100 (AEDT) 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=iIOu6Q8N3Btw9VkC/DlZW0GaA6I+/bT3PhDPEDi3bRo=; b=JyA41ok75gpedy PqiI4bc93/E18JQ+HAlMYtg7DdnQcfhmUZsy/WJMkjZKdnVN3HQ55WVe2q5j/2iQKR5KHzKNTrSeK f2rWqvaIWt8jPxkFD4L6lU4eJCEv2TLr7pWlShQOxhnwXrUCXp38vlSgCrcjDWadMnOKABBUT9MYF RE2MLErqe6La+ZWA1Wq8nc3jRmBY9tBw6R6YqC2qZ7lgMVADypY0qe1M+or/P9KVmgaUJhoP2RrqF HtqN5UmtiRdtnXLZ7bbT0El2lFzZVxBdxWGXdvapqal5ZnYjUt5rtPoOV7obw0d2W5IhfIKIduKD+ NHbzsFSPymgdE57cNoOQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQYTf-003gg9-1v; Thu, 18 Jan 2024 19:55:03 +0000 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQYTC-003gJ6-2c for linux-mtd@lists.infradead.org; Thu, 18 Jan 2024 19:54:39 +0000 Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-5cf450eba00so36162a12.0 for ; Thu, 18 Jan 2024 11:54:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1705607672; x=1706212472; 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=mHG/CBC8rn6ZfrmjB7OHI3uZq/Vu0lS8L/ATSVkqU0I=; b=eEx5Cay6Qh6GB1QRbL7DXKtcz7AY+slyjyelg/CDpD2L2wxXxG6rsMQHaDJITFBq+T gUoVHivdly0gqlFXtwTt4xPLhZ6ETY1KvwsNdbNriibOc37r1V72maBXO5xhGmQFtOPK w2ci53H9eiNKr/QGLl7eMryrz+zVNh1Jr5cUk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705607672; x=1706212472; 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=mHG/CBC8rn6ZfrmjB7OHI3uZq/Vu0lS8L/ATSVkqU0I=; b=UOvIZ2oBLKpIMc6AzziZBj91Ay1aq76QIp1LmG2MAGZ+kZxALpnhUXhu+Rc9lsSkZY fdHV/6g2jFoGTyc0SFVkepqwLo+6FXofgvoCA3ZHrb9s/m76skqAZIaiUDgZqyRbTLy2 zsXEU99758Mx9XTzI932+BvYKNyMWBhVGYWJeijrMjnO92hxxoNlT3eOgtU/2O0rCR+a ZHEvt/BBITL+Zb7ztNSB9xPJlLbI0vYW1aclBcf1AsMhut3qLg3TQITbz1rtsJ+le3Gl TgeqFJOKLOawkIZiJybkT3WnAZ05vdetLNSlnq+l6a3HK18XgOk+bqEsBoByenq55sIO Bssg== X-Gm-Message-State: AOJu0YzNjZUEmkazbPtNw4d9U83tYdwHyuA61o5XcsqJ5Mw0M45n4hTH SZnF5mOgErzQ4GEoUpbm4WPKVn1vIqk77MLNa3nS43d6GR9OZNUUQBhEBYDEeg== X-Google-Smtp-Source: AGHT+IGhfcEKMuaixl56xZn2ojB4l1QrXGrP4PaGBMLyQt8DPvX03FhtlIfLh5G35v/NPeIgeG6OAQ== X-Received: by 2002:a17:90a:e557:b0:28e:7e16:6ff6 with SMTP id ei23-20020a17090ae55700b0028e7e166ff6mr1190925pjb.31.1705607672680; Thu, 18 Jan 2024 11:54:32 -0800 (PST) Received: from bcacpedev-irv-3.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id rr12-20020a17090b2b4c00b0028d9b5d41edsm2263805pjb.38.2024.01.18.11.54.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2024 11:54:32 -0800 (PST) From: dregan@broadcom.com To: dregan@broadcom.com, dregan@mail.com, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, computersforpeace@gmail.com, kdasu.kdev@gmail.com, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, joel.peshkin@broadcom.com, tomer.yacoby@broadcom.com, dan.beygelman@broadcom.com, william.zhang@broadcom.com, anand.gore@broadcom.com, kursad.oney@broadcom.com, florian.fainelli@broadcom.com, rafal@milecki.pl, bcm-kernel-feedback-list@broadcom.com, andre.przywara@arm.com, baruch@tkos.co.il, linux-arm-kernel@lists.infradead.org, dan.carpenter@linaro.org Subject: [PATCH v2 06/10] mtd: rawnand: brcmnand: Add support for getting ecc setting from strap Date: Thu, 18 Jan 2024 11:53:52 -0800 Message-Id: <20240118195356.133391-7-dregan@broadcom.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20240118195356.133391-1-dregan@broadcom.com> References: <20240118195356.133391-1-dregan@broadcom.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240118_115434_890476_FD6373BB X-CRM114-Status: GOOD ( 19.31 ) X-Spam-Score: -0.4 (/) 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: From: William Zhang BCMBCA broadband SoC based board design does not specify ecc setting in dts but rather use the SoC NAND strap info to obtain the ecc strength and spare area size setting. Add brcm,nand-ecc-use-strap d [...] Content analysis details: (-0.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:52a listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender 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 From: William Zhang BCMBCA broadband SoC based board design does not specify ecc setting in dts but rather use the SoC NAND strap info to obtain the ecc strength and spare area size setting. Add brcm,nand-ecc-use-strap dts propety for this purpose and update driver to support this option. The generic nand ecc settings still take precedence over this flag. For example, if nand-ecc-strength is set in the dts, the driver ignores the strap setting and falls back to original behavior. This makes sure that the existing BCMBCA board dts still works the old way even the strap flag is set in the BCMBCA chip dtsi. Signed-off-by: William Zhang Reviewed-by: David Regan --- Changes in v2: - Minor cosmetic fixes --- drivers/mtd/nand/raw/brcmnand/brcmnand.c | 83 ++++++++++++++++++++++-- 1 file changed, 76 insertions(+), 7 deletions(-) diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c index 73fdf7ce21aa..869ea64e9189 100644 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c @@ -1038,6 +1038,19 @@ static inline int brcmnand_sector_1k_shift(struct brcmnand_controller *ctrl) return -1; } +static int brcmnand_get_sector_size_1k(struct brcmnand_host *host) +{ + struct brcmnand_controller *ctrl = host->ctrl; + int shift = brcmnand_sector_1k_shift(ctrl); + u16 acc_control_offs = brcmnand_cs_offset(ctrl, host->cs, + BRCMNAND_CS_ACC_CONTROL); + + if (shift < 0) + return 0; + + return (nand_readreg(ctrl, acc_control_offs) >> shift) & 0x1; +} + static void brcmnand_set_sector_size_1k(struct brcmnand_host *host, int val) { struct brcmnand_controller *ctrl = host->ctrl; @@ -1055,6 +1068,38 @@ static void brcmnand_set_sector_size_1k(struct brcmnand_host *host, int val) nand_writereg(ctrl, acc_control_offs, tmp); } +static int brcmnand_get_spare_size(struct brcmnand_host *host) +{ + struct brcmnand_controller *ctrl = host->ctrl; + u16 acc_control_offs = brcmnand_cs_offset(ctrl, host->cs, + BRCMNAND_CS_ACC_CONTROL); + u32 acc = nand_readreg(ctrl, acc_control_offs); + + return (acc & brcmnand_spare_area_mask(ctrl)); +} + +static int brcmnand_get_ecc_strength(struct brcmnand_host *host) +{ + struct brcmnand_controller *ctrl = host->ctrl; + u16 acc_control_offs = brcmnand_cs_offset(ctrl, host->cs, + BRCMNAND_CS_ACC_CONTROL); + int sector_size_1k = brcmnand_get_sector_size_1k(host); + int spare_area_size, ecc_level, ecc_strength; + u32 acc; + + spare_area_size = brcmnand_get_spare_size(host); + acc = nand_readreg(ctrl, acc_control_offs); + ecc_level = (acc & brcmnand_ecc_level_mask(ctrl)) >> ctrl->ecc_level_shift; + if (sector_size_1k) + ecc_strength = ecc_level * 2; + else if (spare_area_size == 16 && ecc_level == 15) + ecc_strength = 1; /* hamming */ + else + ecc_strength = ecc_level; + + return ecc_strength; +} + /*********************************************************************** * CS_NAND_SELECT ***********************************************************************/ @@ -2622,19 +2667,43 @@ static int brcmnand_setup_dev(struct brcmnand_host *host) nanddev_get_memorg(&chip->base); struct brcmnand_controller *ctrl = host->ctrl; struct brcmnand_cfg *cfg = &host->hwcfg; - char msg[128]; + struct device_node *np = nand_get_flash_node(chip); u32 offs, tmp, oob_sector; - int ret; + int ret, sector_size_1k = 0; + bool use_strap = false; + char msg[128]; memset(cfg, 0, sizeof(*cfg)); + use_strap = of_property_read_bool(np, "brcm,nand-ecc-use-strap"); - ret = of_property_read_u32(nand_get_flash_node(chip), - "brcm,nand-oob-sector-size", + /* + * Set ECC size and strength based on hw configuration from strap + * if device tree does not specify them and use strap property is set + * If ecc strength is set in dts, don't use strap setting. + */ + if (chip->ecc.strength) + use_strap = 0; + + if (use_strap) { + chip->ecc.strength = brcmnand_get_ecc_strength(host); + sector_size_1k = brcmnand_get_sector_size_1k(host); + if (chip->ecc.size == 0) { + if (sector_size_1k < 0) + chip->ecc.size = 512; + else + chip->ecc.size = 512 << sector_size_1k; + } + } + + ret = of_property_read_u32(np, "brcm,nand-oob-sector-size", &oob_sector); if (ret) { - /* Use detected size */ - cfg->spare_area_size = mtd->oobsize / - (mtd->writesize >> FC_SHIFT); + if (use_strap) + cfg->spare_area_size = brcmnand_get_spare_size(host); + else + /* Use detected size */ + cfg->spare_area_size = mtd->oobsize / + (mtd->writesize >> FC_SHIFT); } else { cfg->spare_area_size = oob_sector; } From patchwork Thu Jan 18 19:53:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Regan X-Patchwork-Id: 1888219 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=LPkPY/Xl; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=broadcom.com header.i=@broadcom.com header.a=rsa-sha256 header.s=google header.b=f1jlSpsE; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=198.137.202.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 [198.137.202.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 4TGD4Z6lL3z1yQ0 for ; Fri, 19 Jan 2024 06:55:26 +1100 (AEDT) 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=pfAjXO9UvNd7Lrb3fvwCJjTuM+tSdVAZL0tX6TY80r0=; b=LPkPY/XlMk7gfw vmAUJiglJaxiNLtZUAb/QuKoxah8UNAJDNRvK9rMzgAsdejUG7tW5UTvX6ydi1VQHMYVrn3RusF70 YgBfo7Ez0qNV0PsizJ0sU1rAxQTBbt66MD/3KTjY1ehl9eRDK7I+3fcq1YGcR6R5y/7tZSA9A+Yy2 v6qV0rP6jJXNx8AmXp5X488LwKkaNjyMMiJrz6VTqY265rZ0acmOeO3I6QP7nkIipBbf9x8dw0r5O 9t+Hu2AZ4174IUeCtwEkO9+kE5MQ76OLDM8c0bZMeDDUOa+kgcGu1MBuKemppBLotFuGDwsXEZvM2 zz7i/ObmCqHnz+oaHRcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQYTZ-003gb0-2V; Thu, 18 Jan 2024 19:54:57 +0000 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQYTC-003gKP-2S for linux-mtd@lists.infradead.org; Thu, 18 Jan 2024 19:54:38 +0000 Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-2901ceb0d33so841262a91.1 for ; Thu, 18 Jan 2024 11:54:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1705607674; x=1706212474; 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=q+ZNuMLiQVEBIU4qP2AxAyGfcGqRo4EmDBOaCTelFQA=; b=f1jlSpsEO5dPxELXhYJaaHc4vRucETdQm8Wnxu31ySPQ989GM9Y06I61jlfwGkNpke 2OJt6YoUW5OJvRcjmgI970JlIp01ogw3yddg70AW+GWOxhQ29QSOSED/0YupJpguA+6w K9OOHqwj8ZI2wXEhUtU+gCOW3JiFwY1+uYw+c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705607674; x=1706212474; 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=q+ZNuMLiQVEBIU4qP2AxAyGfcGqRo4EmDBOaCTelFQA=; b=YD+s0FLwsMnr7Krgzuba9pbE8n9xKeFMp/M94gttAMC6JMOhzGrKqQA2WOIiwR6A57 0PVLRc67vB4Nuhr9C4OCG4T56KYPtivlfVGcUt+PUdnALMiO/n6S3pfi/8Vl3FbhH5hF V9fMOsRz7ZPbkPuRBLSgyiZ4XzT+vKy2a6JaJlEBNEwH1vID9cZPnvV7EkdweyC/yeTp b83YA/CU8JcZEDivJapBHMja0v3Fd433YNFJM01eZDozhiFxXXxyYyLI3W6nQat8cm0K M5onpYzEiCAXwuxlIspRp+6WpWpRJ/3rjkiISvoLmI+WYIN87fmbMrt2tQulhN7Wq1CS u6Xg== X-Gm-Message-State: AOJu0YxX898nrOlzI0PwE50NI76ZnQ4mhPKtLa2aZoNXAakSsc+aXEeq 1AUkkvYVoFTByXfLAdSKsiF/saOjSlHNzTWXGOAXBjJtlk5ZBZGv3vb3ISwbzg== X-Google-Smtp-Source: AGHT+IEJ3qIWczlfChoU8rtUAqv8+jLQdgG90HPXrESS4HZTszddZNh5owLB7/ayia0byi0ZhWT++w== X-Received: by 2002:a17:90a:241:b0:28f:f249:3c4a with SMTP id t1-20020a17090a024100b0028ff2493c4amr3931395pje.19.1705607674171; Thu, 18 Jan 2024 11:54:34 -0800 (PST) Received: from bcacpedev-irv-3.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id rr12-20020a17090b2b4c00b0028d9b5d41edsm2263805pjb.38.2024.01.18.11.54.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2024 11:54:33 -0800 (PST) From: dregan@broadcom.com To: dregan@broadcom.com, dregan@mail.com, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, computersforpeace@gmail.com, kdasu.kdev@gmail.com, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, joel.peshkin@broadcom.com, tomer.yacoby@broadcom.com, dan.beygelman@broadcom.com, william.zhang@broadcom.com, anand.gore@broadcom.com, kursad.oney@broadcom.com, florian.fainelli@broadcom.com, rafal@milecki.pl, bcm-kernel-feedback-list@broadcom.com, andre.przywara@arm.com, baruch@tkos.co.il, linux-arm-kernel@lists.infradead.org, dan.carpenter@linaro.org Subject: [PATCH v2 07/10] mtd: rawnand: brcmnand: Support write protection setting from dts Date: Thu, 18 Jan 2024 11:53:53 -0800 Message-Id: <20240118195356.133391-8-dregan@broadcom.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20240118195356.133391-1-dregan@broadcom.com> References: <20240118195356.133391-1-dregan@broadcom.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240118_115434_857004_48010A8C X-CRM114-Status: GOOD ( 14.47 ) X-Spam-Score: -0.4 (/) 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: From: William Zhang The write protection feature is controlled by the module parameter wp_on with default set to enabled. But not all the board use this feature especially in BCMBCA broadband board. And module parameter [...] Content analysis details: (-0.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:102e listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender 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 From: William Zhang The write protection feature is controlled by the module parameter wp_on with default set to enabled. But not all the board use this feature especially in BCMBCA broadband board. And module parameter is not sufficient as different board can have different option. Add a device tree property and allow this feature to be configured through the board dts on per board basis. Signed-off-by: William Zhang Reviewed-by: Florian Fainelli Reviewed-by: Kamal Dasu Reviewed-by: David Regan --- Changes in v2: None --- drivers/mtd/nand/raw/brcmnand/brcmnand.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c index 869ea64e9189..9a904c7c6dad 100644 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c @@ -3081,7 +3081,7 @@ int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc) struct brcmnand_controller *ctrl; struct brcmnand_host *host; struct resource *res; - int ret; + int ret, wp_dt; if (dn && !of_match_node(brcmnand_of_match, dn)) return -ENODEV; @@ -3218,6 +3218,12 @@ int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc) /* Disable XOR addressing */ brcmnand_rmw_reg(ctrl, BRCMNAND_CS_XOR, 0xff, 0, 0); + /* Not all boards support write protect (WP), check DT property */ + if (of_property_read_u32(dn, "brcm,nand-use-wp", &wp_dt) == 0) { + if (wp_dt >= 0 && wp_dt <= 2) + wp_on = wp_dt; + } + if (ctrl->features & BRCMNAND_HAS_WP) { /* Permanently disable write protection */ if (wp_on == 2) From patchwork Thu Jan 18 19:53:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Regan X-Patchwork-Id: 1888222 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=wgruOoAH; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=broadcom.com header.i=@broadcom.com header.a=rsa-sha256 header.s=google header.b=el8ecWTY; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=198.137.202.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 [198.137.202.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 4TGD4r5xB8z23fB for ; Fri, 19 Jan 2024 06:55:40 +1100 (AEDT) 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=KU384gKiIb796EDzsCMh5qR3JLmq+zt5yd+xm1ss3eg=; b=wgruOoAHgg8VJB o2+WcnlpIc2oM2JNLZ24RusKuWLnEkVd4V+DjVJPp5MS0gG6ZzNu6sI1IQ/bUayL5skZ05weC01wq RCU8J9OfF1468eZEUytxAoJBvWm8me3rRndfQ7g8FdNzlDkDzlHdvXM4p/3e/9biZ3W22G+kr6ENX Y3b6UWi02bdWIvjresIjdxYc9qbpVjkMeiX2QL8LMqxakJYBxPUUwiLCMZs9WkeiCyjkq91Jl+R0x xi6NanB9tMkjny2vJMb7KL+1aSjUWJfqBXeZ2JuShvkcQR37Ae/NDJAmGsfsQ7o/kEs4RZv8uvSsE IE0fmT7mAIf4C7Ox9uKA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQYTm-003gls-2X; Thu, 18 Jan 2024 19:55:10 +0000 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQYTF-003gLf-2g for linux-mtd@lists.infradead.org; Thu, 18 Jan 2024 19:54:40 +0000 Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-5cd8667c59eso28429a12.2 for ; Thu, 18 Jan 2024 11:54:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1705607676; x=1706212476; 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=vQ0KMT7YinNWTDLRkt/ik0/tsSQLLOEO8iME5kKq+rI=; b=el8ecWTY92YnGdTiaypfXC8Ni98SzVq1O04YE8V485GX6tN24wfK3Ed/5nO6K4r4Bq eNG4/3TjIlgPXhvERESjixhcNMBejhRRz8CWN3dXKyvs4OLed5MRP4JPNCPl9eTsC79g vDQozoXjXODYRUgx56IKVewpGhnEpuuWj8u4Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705607676; x=1706212476; 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=vQ0KMT7YinNWTDLRkt/ik0/tsSQLLOEO8iME5kKq+rI=; b=bj2X6O5Qk9u0ICZi/PeUjb5Kq+ojdTrCuJSUyYhxfHLPFr9vo7WRTzpeN1w9Ye2JSc AJ7TWKlKB1xhyRNY/SaTHxPJF31Vm3Nw7J1fKySXYkqoeyWK0BNCS6kNVI5tiIOOGlhe oHv1BupyK7LUhMqWJHuBBEda9SX4+R8vQKotOtAVbisHI+JqYkwaTpqWP0Biqc8isVGh LHC2Y7FuFn/Px8xw+GmlzVLX3QwSEyfOZPqj0VmGe7Z5OgauH3hjpxLEqkxmEVBuk+fU 2Fp8zTV6tkKlt1vKiCTbyeueqMg+CB4CyZcm6AEX9TaFzFxrHunXhJPDn5hT9H87rNkw 2fwA== X-Gm-Message-State: AOJu0YxWcRSJnZSVJHxmU/99m5bDo0HqvGsd755hHBTI4Td2c9dIPm4s atR0tZHivCfbzLeSf4tjRnqfkej1WE0lfEN20xPMZ1dGShqKNrUzOI1HeJlNfQ== X-Google-Smtp-Source: AGHT+IGJ5PSS/zL5LeT8Z2TjlL7IRE7vXLwG16dkY25ybhY9hLXWwD/0TI/ZkCDk1mnTsOWnNsSZLw== X-Received: by 2002:a17:90a:740f:b0:290:4168:e0f3 with SMTP id a15-20020a17090a740f00b002904168e0f3mr415735pjg.99.1705607675755; Thu, 18 Jan 2024 11:54:35 -0800 (PST) Received: from bcacpedev-irv-3.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id rr12-20020a17090b2b4c00b0028d9b5d41edsm2263805pjb.38.2024.01.18.11.54.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2024 11:54:35 -0800 (PST) From: dregan@broadcom.com To: dregan@broadcom.com, dregan@mail.com, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, computersforpeace@gmail.com, kdasu.kdev@gmail.com, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, joel.peshkin@broadcom.com, tomer.yacoby@broadcom.com, dan.beygelman@broadcom.com, william.zhang@broadcom.com, anand.gore@broadcom.com, kursad.oney@broadcom.com, florian.fainelli@broadcom.com, rafal@milecki.pl, bcm-kernel-feedback-list@broadcom.com, andre.przywara@arm.com, baruch@tkos.co.il, linux-arm-kernel@lists.infradead.org, dan.carpenter@linaro.org Subject: [PATCH v2 08/10] mtd: rawnand: brcmnand: exec_op helper functions return type fixes Date: Thu, 18 Jan 2024 11:53:54 -0800 Message-Id: <20240118195356.133391-9-dregan@broadcom.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20240118195356.133391-1-dregan@broadcom.com> References: <20240118195356.133391-1-dregan@broadcom.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240118_115437_897434_1378CD78 X-CRM114-Status: GOOD ( 13.60 ) X-Spam-Score: -0.4 (/) 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: From: David Regan fix return type for exec_op reset and status detect helper functions Reported-by: Dan Carpenter Closes: http://lists.infradead.org/pipermail/linux-mtd/2023-December/102423.html Fixes: 3cc4718fa644 ("mtd: rawnand: brcmnand: exec_op implementat [...] Content analysis details: (-0.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:536 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender 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 From: David Regan fix return type for exec_op reset and status detect helper functions Reported-by: Dan Carpenter Closes: http://lists.infradead.org/pipermail/linux-mtd/2023-December/102423.html Fixes: 3cc4718fa644 ("mtd: rawnand: brcmnand: exec_op implementation") Signed-off-by: David Regan Reviewed-by: William Zhang --- Changes in v2: - Added to patch series --- drivers/mtd/nand/raw/brcmnand/brcmnand.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c index 9a904c7c6dad..6b5d76eff0ec 100644 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c @@ -625,7 +625,7 @@ enum { /* Only for v7.2 */ #define ACC_CONTROL_ECC_EXT_SHIFT 13 -static u8 brcmnand_status(struct brcmnand_host *host); +static int brcmnand_status(struct brcmnand_host *host); static inline bool brcmnand_non_mmio_ops(struct brcmnand_controller *ctrl) { @@ -1749,7 +1749,7 @@ static int brcmnand_waitfunc(struct nand_chip *chip) INTFC_FLASH_STATUS; } -static u8 brcmnand_status(struct brcmnand_host *host) +static int brcmnand_status(struct brcmnand_host *host) { struct nand_chip *chip = &host->chip; struct mtd_info *mtd = nand_to_mtd(chip); @@ -1760,7 +1760,7 @@ static u8 brcmnand_status(struct brcmnand_host *host) return brcmnand_waitfunc(chip); } -static u8 brcmnand_reset(struct brcmnand_host *host) +static int brcmnand_reset(struct brcmnand_host *host) { struct nand_chip *chip = &host->chip; @@ -2492,11 +2492,14 @@ static int brcmnand_exec_op(struct nand_chip *chip, if (brcmnand_op_is_status(op)) { status = op->instrs[1].ctx.data.buf.in; - *status = brcmnand_status(host); + ret = brcmnand_status(host); + if (ret < 0) + return ret; + + *status = ret & 0xFF; return 0; - } - else if (brcmnand_op_is_reset(op)) { + } else if (brcmnand_op_is_reset(op)) { ret = brcmnand_reset(host); if (ret < 0) return ret; From patchwork Thu Jan 18 19:53:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Regan X-Patchwork-Id: 1888223 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=0TC02tPI; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=broadcom.com header.i=@broadcom.com header.a=rsa-sha256 header.s=google header.b=g66j1zFo; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=198.137.202.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 [198.137.202.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 4TGD570TwQz1yQ0 for ; Fri, 19 Jan 2024 06:55:55 +1100 (AEDT) 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=saRiS8bQTwXyKy21RfVJ2PUIqgT3ljoCZ/RGeSpO2/E=; b=0TC02tPIfqSGC+ iIKgPZ/Evz38XbPB/rC+ACnglgnA5DHb2TWWvS/RaGvMcg76aVnW/pksEyJFSBWFgPUTJwtyobX69 SG9IAnhvpMzA9FuDBO4RzXZ18CTRA0ZW3YDXTRNV61LOODODcDHZ/Mm8wxfjlZDqSjP1ZtYKcoRnn 8F8pHfadHGpVXrGclSY3QKb3Ud9at/h+jmU/V7B5fY9zr5MBAwGnUKDUK7EmHui7Il3vz4hW7r+Pp oit+eMRTrw4vOH6tZeA7RbfWqHFaq2HbpBZrSGo4bbB0ql6a3n4U1hDjCd6tN6qwAr4phPasTgh1g 6eQ/7gtMJOBTMO4f00Sw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQYU1-003gyT-30; Thu, 18 Jan 2024 19:55:26 +0000 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQYTI-003gMf-1e for linux-mtd@lists.infradead.org; Thu, 18 Jan 2024 19:54:41 +0000 Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-2902264d2edso76905a91.1 for ; Thu, 18 Jan 2024 11:54:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1705607677; x=1706212477; 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=CghvPoNxLJl4lLRdVw4tb22f1/3nanFbn4ZhOjlHkeo=; b=g66j1zFobNMMrViK4vRLBkbC9wTVqMVx/OqAAESNgTZqlS3tE5ga2R6LhA+sSl17JF cv/A1iFCtymsl9qp+JXQDXyqzfYv+VlMOFVU3Dk/S8wUJ3136QRPJ+1EE5FMjMy7/Bx1 z+bn6KB1A0PSOyfdYOJH9ssKpFrtlxAjfd93c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705607677; x=1706212477; 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=CghvPoNxLJl4lLRdVw4tb22f1/3nanFbn4ZhOjlHkeo=; b=m3AMLSkXbeJ6K76oc6mpfOLVc57ozh3fdQaFm8Xq5i0DtZdcvdJOG7qaiIUWjyEzG1 HbcJf/h2nBmvr6o66Igd3Tf5dP8fQR4KutBUmaEMY3SJxvq7sS4nOQEeQwoOCl1CS3C5 0r3tcooM7XoMTErx7VM7vQLZlOej7cQUALA7JtoCdBgouH5c502E6ahmirOtFjsk2g1N zC1xPw51ney16STEkasHqW3RSSX3oeMKvTujUb44rwTBopy9V4hKNVpQRH1L4vHUS5W0 j7UOYArdorYndN+fBktR2YaZiixlTLqkf1/39+LG4A5KZhXrFdYDJ4xzpV3SO5GukXiO rAug== X-Gm-Message-State: AOJu0Yyzr0oZ4rRhLY9UfMyPr16IbGjNVMlTAYiDCOBn3vgiqLnoBIT1 aNHnBc32z8wNPcWGKisAoJRN0zdwgHUcYCMIvus0zwOP/dfJHIwHYJ0hjNsJHQ== X-Google-Smtp-Source: AGHT+IGpduvvbCU9h++TkrPZzn6xG8chMBt4/0ohm/34e0CnY9xnW4nf7DjMx4QEdaOxW+UnTH2Dog== X-Received: by 2002:a17:90a:1347:b0:290:3e62:92ab with SMTP id y7-20020a17090a134700b002903e6292abmr571455pjf.29.1705607677448; Thu, 18 Jan 2024 11:54:37 -0800 (PST) Received: from bcacpedev-irv-3.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id rr12-20020a17090b2b4c00b0028d9b5d41edsm2263805pjb.38.2024.01.18.11.54.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2024 11:54:37 -0800 (PST) From: dregan@broadcom.com To: dregan@broadcom.com, dregan@mail.com, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, computersforpeace@gmail.com, kdasu.kdev@gmail.com, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, joel.peshkin@broadcom.com, tomer.yacoby@broadcom.com, dan.beygelman@broadcom.com, william.zhang@broadcom.com, anand.gore@broadcom.com, kursad.oney@broadcom.com, florian.fainelli@broadcom.com, rafal@milecki.pl, bcm-kernel-feedback-list@broadcom.com, andre.przywara@arm.com, baruch@tkos.co.il, linux-arm-kernel@lists.infradead.org, dan.carpenter@linaro.org Subject: [PATCH v2 09/10] mtd: rawnand: brcmnand: update log level messages Date: Thu, 18 Jan 2024 11:53:55 -0800 Message-Id: <20240118195356.133391-10-dregan@broadcom.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20240118195356.133391-1-dregan@broadcom.com> References: <20240118195356.133391-1-dregan@broadcom.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240118_115440_604684_75AD8A48 X-CRM114-Status: GOOD ( 10.91 ) X-Spam-Score: -0.4 (/) 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: From: David Regan Update log level messages so that more critical messages can be seen. Signed-off-by: David Regan Reviewed-by: William Zhang --- Changes in v2: - Added to patch series --- drivers/mtd/nand/raw/brcmnand/brcmnand.c | 6 +++ [...] Content analysis details: (-0.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:102d listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender 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 From: David Regan Update log level messages so that more critical messages can be seen. Signed-off-by: David Regan Reviewed-by: William Zhang --- Changes in v2: - Added to patch series --- drivers/mtd/nand/raw/brcmnand/brcmnand.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c index 6b5d76eff0ec..a4e311b6798c 100644 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c @@ -1143,7 +1143,7 @@ static int bcmnand_ctrl_poll_status(struct brcmnand_host *host, if ((val & mask) == expected_val) return 0; - dev_warn(ctrl->dev, "timeout on status poll (expected %x got %x)\n", + dev_err(ctrl->dev, "timeout on status poll (expected %x got %x)\n", expected_val, val & mask); return -ETIMEDOUT; @@ -2196,7 +2196,7 @@ static int brcmnand_read(struct mtd_info *mtd, struct nand_chip *chip, return err; } - dev_dbg(ctrl->dev, "uncorrectable error at 0x%llx\n", + dev_err(ctrl->dev, "uncorrectable error at 0x%llx\n", (unsigned long long)err_addr); mtd->ecc_stats.failed++; /* NAND layer expects zero on ECC errors */ @@ -2211,7 +2211,7 @@ static int brcmnand_read(struct mtd_info *mtd, struct nand_chip *chip, err = brcmnand_read_by_pio(mtd, chip, addr, trans, buf, oob, &err_addr); - dev_dbg(ctrl->dev, "corrected error at 0x%llx\n", + dev_info(ctrl->dev, "corrected error at 0x%llx\n", (unsigned long long)err_addr); mtd->ecc_stats.corrected += corrected; /* Always exceed the software-imposed threshold */ From patchwork Thu Jan 18 19:53:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Regan X-Patchwork-Id: 1888224 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=qx4V9DeJ; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=broadcom.com header.i=@broadcom.com header.a=rsa-sha256 header.s=google header.b=NYxhS921; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=198.137.202.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 [198.137.202.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 4TGD594ltZz1yQ0 for ; Fri, 19 Jan 2024 06:55:57 +1100 (AEDT) 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=SEmaOhuYO34IZUnbPnYYEkzXdUKVWujSXsKDP1WEUAA=; b=qx4V9DeJHbWcpg XGCOBT+05dYgWHL5sPNrODjLSutCIXmJIpOLrYjlVeeGRIykSvI3cXE3jAR3kBMyOJ8ibMI/jYQXz nU3a7Vk4BFEkGz2mdzq0PKqchizkK6l2sFPNqJ8LO+mfMUTMXqNNBCD+Z/Jja6/2vMGE0RRHdlKUD 6TCbe7eFVrzYSnSGv62jT/06xw2SUnOI8mVd7oezGpgbKnIthELhMAg7TQzGB4XHl4Q1+Xo4ntal9 l7i3KpBUu/LgD6WgPylXzobz4FIDl7NQRnh5pdcfp030kAEmeDwY7865a5EiPdQ/+oJuIv9USE8pP weB4dxQfx71ZSYX9jNXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQYU9-003h7z-0O; Thu, 18 Jan 2024 19:55:33 +0000 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQYTJ-003gNc-1c for linux-mtd@lists.infradead.org; Thu, 18 Jan 2024 19:54:43 +0000 Received: by mail-pg1-x531.google.com with SMTP id 41be03b00d2f7-53fa455cd94so18601a12.2 for ; Thu, 18 Jan 2024 11:54:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1705607679; x=1706212479; 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=BeH1TIJtMu9dNiviTF/nkxwiev6sYu4cBkxn5iUmNwA=; b=NYxhS921R9ha0UaTeRIakdj7z+jD+TuUScesLJla7lCS93CRvp3c6D9vNRE9PYEWYI Z9QCiCzG4CCJHeoGykl97VyxIlJW4nyWOBTKEOGG999ucSpbeL7CADfWKyyGLshCoXai CrS10N+o39RwZRIEiyA1dx0tyaKcuXPTGDT8A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705607679; x=1706212479; 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=BeH1TIJtMu9dNiviTF/nkxwiev6sYu4cBkxn5iUmNwA=; b=KGMihk4g0PnbGle9pk3XRwXo2bu9jDu4j2sgTbFaUugDNpZcT/58xtqY6XlenSJXte xEKQ+x/AZbtghZTnSiWg0hdQbfRhv9D1rMHFhKfYptS6BSQ/9Cc/pssniJv5Wr7HxMC4 gECL30F404N+kvnRlPMGkp8Fg+UEJYJdJpRddhfRu5dL9DHbj+D8fkSXMKwIebOQOEDB zVeQAoozQ+5nAfr0137YgODhW7cNUhLII5RAVvBEpcYvhv0MBTMyfZcpu1gI9aiXu/j9 ZrA6bZ7gSriCjrA3lPLTLv+ovnsUHckfD7Yu/TUTRJLSW6XJCldoL9zkiWI2RR5bKsU8 8JMQ== X-Gm-Message-State: AOJu0Ywx/tqC/X5onZefYn3T9DFU8DBsoAyl1AAtCkGrGSicBeuqtVZi waeTfxbO2DjOpCnEZnVD/wTPlOdykBo5EPx5nfmzqZJoFIwuNpbv70xlUzZmKw== X-Google-Smtp-Source: AGHT+IHACuKl4Ub94+Xnxo/jnjCOYBw1yW1Eo6Y2FDr3CuoZ6RFhJZAwMW6S4Z0cAarZk55E4E+D7g== X-Received: by 2002:a17:90b:2349:b0:290:1d33:cc66 with SMTP id ms9-20020a17090b234900b002901d33cc66mr1276623pjb.91.1705607679035; Thu, 18 Jan 2024 11:54:39 -0800 (PST) Received: from bcacpedev-irv-3.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id rr12-20020a17090b2b4c00b0028d9b5d41edsm2263805pjb.38.2024.01.18.11.54.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2024 11:54:38 -0800 (PST) From: dregan@broadcom.com To: dregan@broadcom.com, dregan@mail.com, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, computersforpeace@gmail.com, kdasu.kdev@gmail.com, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, joel.peshkin@broadcom.com, tomer.yacoby@broadcom.com, dan.beygelman@broadcom.com, william.zhang@broadcom.com, anand.gore@broadcom.com, kursad.oney@broadcom.com, florian.fainelli@broadcom.com, rafal@milecki.pl, bcm-kernel-feedback-list@broadcom.com, andre.przywara@arm.com, baruch@tkos.co.il, linux-arm-kernel@lists.infradead.org, dan.carpenter@linaro.org Subject: [PATCH v2 10/10] mtd: rawnand: brcmnand: allow for on-die ecc Date: Thu, 18 Jan 2024 11:53:56 -0800 Message-Id: <20240118195356.133391-11-dregan@broadcom.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20240118195356.133391-1-dregan@broadcom.com> References: <20240118195356.133391-1-dregan@broadcom.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240118_115441_540412_D48499B1 X-CRM114-Status: GOOD ( 10.98 ) X-Spam-Score: -0.4 (/) 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: From: David Regan Allow settings for on-die ecc such that if on-die ECC is selected don't error out but require ECC strap setting of zero Signed-off-by: David Regan Reviewed-by: William Zhang --- Changes in v2: - Added to patch series --- drivers/mtd/nand/raw/brcmnand/brcmnand.c | 14 ++ [...] Content analysis details: (-0.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:531 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender 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 From: David Regan Allow settings for on-die ecc such that if on-die ECC is selected don't error out but require ECC strap setting of zero Signed-off-by: David Regan Reviewed-by: William Zhang --- Changes in v2: - Added to patch series --- drivers/mtd/nand/raw/brcmnand/brcmnand.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c index a4e311b6798c..42526f3250c9 100644 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c @@ -2727,9 +2727,11 @@ static int brcmnand_setup_dev(struct brcmnand_host *host) cfg->blk_adr_bytes = get_blk_adr_bytes(mtd->size, mtd->writesize); if (chip->ecc.engine_type != NAND_ECC_ENGINE_TYPE_ON_HOST) { - dev_err(ctrl->dev, "only HW ECC supported; selected: %d\n", - chip->ecc.engine_type); - return -EINVAL; + if (chip->ecc.strength) { + dev_err(ctrl->dev, "ERROR!!! HW ECC must be set to zero for non-hardware ECC; selected: %d\n", + chip->ecc.strength); + return -EINVAL; + } } if (chip->ecc.algo == NAND_ECC_ALGO_UNKNOWN) { @@ -2797,7 +2799,11 @@ static int brcmnand_setup_dev(struct brcmnand_host *host) if (ret) return ret; - brcmnand_set_ecc_enabled(host, 1); + if (chip->ecc.engine_type == NAND_ECC_ENGINE_TYPE_ON_DIE) { + dev_dbg(ctrl->dev, "Disable HW ECC for on-die ECC\n"); + brcmnand_set_ecc_enabled(host, 0); + } else + brcmnand_set_ecc_enabled(host, 1); brcmnand_print_cfg(host, msg, cfg); dev_info(ctrl->dev, "detected %s\n", msg);