From patchwork Tue Jun 6 23:12:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Zhang X-Patchwork-Id: 13269856 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 423F9C7EE2F for ; Tue, 6 Jun 2023 23:15:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Uy51J4jmRO1AUH5llVpDyQ1z5U4fPt3hJK0v8zo+EtA=; b=Ev/UB8gCuIQySP+CsLhIlKad4H OKMzeD4Bey+VpmTS5xfio5EM1PXFJPAvCNHlP6gQX/PuB/UMA8nsKY+NEGdGMFpf69qtC5+piEl+s 9SGUAJGrAoS9RL0Zrm5zFq3Ff6sDbW84cwv9f8EgNnh9/52NU6VosZqxviv0ZRQxpyK57pxMVnrk0 EQEhJ7iyfOAaP3GNMBajvpAwMmgSTA06ZM6tNnSrgy3NxlELg1AraPS+6qs8f5PD9fiQKfn0RrhLL usIlgu6sr4BklC141vNwsCzVkpRSU0zGLNQNdW4Exo5F2i2UaJePi9SFCSqspofCsu6DFwEW4v+D5 Id+vvGQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q6ftQ-003bN1-32; Tue, 06 Jun 2023 23:15:12 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6ftO-003bLt-32 for linux-arm-kernel@bombadil.infradead.org; Tue, 06 Jun 2023 23:15:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=UYHkVZ09U5yILOG7yblaFqtFMiyncO4wxfZya4PpJv8=; b=qjlkEF9OWoBJ6kBqZfk52xcDHa hP6/CzSU524RzM11tqVVdWAGWzdC3AG+Tl/Sy3JY5uul0zHjImTuncI5BjhSZEf5fhhp+ZZ84/Jtd 3WGoWhcCwNSaF/vS3IJPAY4tHZEJvpOAL2mWb141SB+utLyvt350sAOX0UHDV6H9/rIIE/yFG9ZeQ aRMDV9xhk7MNXNs5jw5//CxdsqAJlHwE/KNEhmWJr6BfZpMu5aXaWqUU4y2B8C8wE/7KRAGNbMS1a 33SpI1dyv0gn0LNTGevBx9P4k0Lz88IiV2rlWl0kR7uXMW+5hibMLSl9GUUfXasCIu5e5C//6CqY5 Zhp7oZmw==; Received: from mail-qk1-x72c.google.com ([2607:f8b0:4864:20::72c]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6fso-004DBV-1X for linux-arm-kernel@lists.infradead.org; Tue, 06 Jun 2023 23:14:44 +0000 Received: by mail-qk1-x72c.google.com with SMTP id af79cd13be357-75d536afa43so1864885a.1 for ; Tue, 06 Jun 2023 16:14:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1686093272; x=1688685272; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=UYHkVZ09U5yILOG7yblaFqtFMiyncO4wxfZya4PpJv8=; b=WKK555IhJywuiDxO/vcAqyAAobyIMk5foaRiv7+PGs25kkDXL4ivi7CkgrMt4UjvRz OT0jxPd1dQ+0S1sNtImApw4s/LvC8368AlYrWFqf7zgeeQx1uEbcKtTKHNkO6aSFNToL 3WbC6QLdCbtr/YKmyB7QWZF8KWIeTjBG61dpg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686093272; x=1688685272; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UYHkVZ09U5yILOG7yblaFqtFMiyncO4wxfZya4PpJv8=; b=WyaGwNlEgMIS2GUN5XIX6//+ATaU15FNWpA3DoZ1qseWp8qy7UQ4qQ3sD8oLrBmzri AnM9vKcirEfkNG1KFWv1WCFGtvKpwAT9aO73FStREbcIzJudMEpCLddcrF4l1NuSMMpT NgSA2tRGHht3JWeM5r3wZ/Ho0VwfmooRWdGhX/uSQYn3sJzaG5n8KM9/zAA4G8s+epZY 1fbGoOOQE75VqczUfNlY7u8mVN8vzt5XHZYdEJ8R7SWvhRto5cTZXEx3VC2tG0Xc833X d58q1gJd9sDVQG8peqIZlR3sBg+Gj9Ly85fmi3cV3ikFHNkfGWWoVVyYbFK8288GjnOP UL3A== X-Gm-Message-State: AC+VfDy7KIX4IY8ksBRun7CCU0ccbLiQgMxhrMcS/RDzMjGg70ANKkGO aUElq7InTbb/7JaheATvcprD0g== X-Google-Smtp-Source: ACHHUZ7UPhvmRNMHcXdrkJqI8JS17E1EEsrRMwwmJCIryUsTnOQU0RQbScDemOX+9Ivbl/J8K8IKbg== X-Received: by 2002:a37:e112:0:b0:75e:5141:f403 with SMTP id c18-20020a37e112000000b0075e5141f403mr12459qkm.23.1686093271889; Tue, 06 Jun 2023 16:14:31 -0700 (PDT) Received: from ubuntu-22.localdomain ([192.19.222.250]) by smtp.gmail.com with ESMTPSA id x9-20020ae9e909000000b0075b23e55640sm5221519qkf.123.2023.06.06.16.14.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 16:14:31 -0700 (PDT) From: William Zhang To: Broadcom Kernel List , Linux MTD List Cc: f.fainelli@gmail.com, rafal@milecki.pl, kursad.oney@broadcom.com, joel.peshkin@broadcom.com, computersforpeace@gmail.com, anand.gore@broadcom.com, dregan@mail.com, kamal.dasu@broadcom.com, tomer.yacoby@broadcom.com, dan.beygelman@broadcom.com, William Zhang , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , Rob Herring , linux-arm-kernel@lists.infradead.org Subject: [PATCH 06/12] ARM: dts: broadcom: bcmbca: Add NAND controller node Date: Tue, 6 Jun 2023 16:12:46 -0700 Message-Id: <20230606231252.94838-7-william.zhang@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230606231252.94838-1-william.zhang@broadcom.com> References: <20230606231252.94838-1-william.zhang@broadcom.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230607_001437_779828_567EB13D X-CRM114-Status: GOOD ( 14.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support for Broadcom STB NAND controller in BCMBCA ARMv7 chip dts files. Signed-off-by: William Zhang --- arch/arm/boot/dts/bcm47622.dtsi | 17 +++++++++++++++++ arch/arm/boot/dts/bcm63138.dtsi | 12 ++++++++++-- arch/arm/boot/dts/bcm63148.dtsi | 17 +++++++++++++++++ arch/arm/boot/dts/bcm63178.dtsi | 17 +++++++++++++++++ arch/arm/boot/dts/bcm6756.dtsi | 17 +++++++++++++++++ arch/arm/boot/dts/bcm6846.dtsi | 17 +++++++++++++++++ arch/arm/boot/dts/bcm6855.dtsi | 17 +++++++++++++++++ arch/arm/boot/dts/bcm6878.dtsi | 17 +++++++++++++++++ arch/arm/boot/dts/bcm947622.dts | 4 ++++ arch/arm/boot/dts/bcm963138.dts | 4 ++++ arch/arm/boot/dts/bcm963138dvt.dts | 12 +++++------- arch/arm/boot/dts/bcm963148.dts | 4 ++++ arch/arm/boot/dts/bcm963178.dts | 4 ++++ arch/arm/boot/dts/bcm96756.dts | 4 ++++ arch/arm/boot/dts/bcm96846.dts | 4 ++++ arch/arm/boot/dts/bcm96855.dts | 4 ++++ arch/arm/boot/dts/bcm96878.dts | 4 ++++ 17 files changed, 166 insertions(+), 9 deletions(-) diff --git a/arch/arm/boot/dts/bcm47622.dtsi b/arch/arm/boot/dts/bcm47622.dtsi index cd25ed2757b7..401e1ce1da6d 100644 --- a/arch/arm/boot/dts/bcm47622.dtsi +++ b/arch/arm/boot/dts/bcm47622.dtsi @@ -137,6 +137,23 @@ hsspi: spi@1000 { status = "disabled"; }; + nand_controller: nand-controller@1800 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "brcm,nand-bcmbca", "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/bcm63138.dtsi b/arch/arm/boot/dts/bcm63138.dtsi index 93281c47c9ba..2c9939e775fb 100644 --- a/arch/arm/boot/dts/bcm63138.dtsi +++ b/arch/arm/boot/dts/bcm63138.dtsi @@ -224,12 +224,20 @@ hsspi: spi@1000 { nand_controller: nand-controller@2000 { #address-cells = <1>; #size-cells = <0>; - compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.0", "brcm,brcmnand"; + compatible = "brcm,nand-bcmbca", "brcm,brcmnand-v7.0", "brcm,brcmnand"; reg = <0x2000 0x600>, <0xf0 0x10>; 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; + }; }; bootlut: bootlut@8000 { diff --git a/arch/arm/boot/dts/bcm63148.dtsi b/arch/arm/boot/dts/bcm63148.dtsi index ba7f265db121..de14d4564b14 100644 --- a/arch/arm/boot/dts/bcm63148.dtsi +++ b/arch/arm/boot/dts/bcm63148.dtsi @@ -118,5 +118,22 @@ hsspi: spi@1000 { num-cs = <8>; status = "disabled"; }; + + nand_controller: nand-controller@2000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "brcm,nand-bcmbca", "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/bcm63178.dtsi b/arch/arm/boot/dts/bcm63178.dtsi index d8268a1e889b..ae205408c5cd 100644 --- a/arch/arm/boot/dts/bcm63178.dtsi +++ b/arch/arm/boot/dts/bcm63178.dtsi @@ -128,6 +128,23 @@ hsspi: spi@1000 { status = "disabled"; }; + nand_controller: nand-controller@1800 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "brcm,nand-bcmbca", "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/bcm6756.dtsi b/arch/arm/boot/dts/bcm6756.dtsi index 49ecc1f0c18c..bbff47172dc1 100644 --- a/arch/arm/boot/dts/bcm6756.dtsi +++ b/arch/arm/boot/dts/bcm6756.dtsi @@ -138,6 +138,23 @@ hsspi: spi@1000 { status = "disabled"; }; + nand_controller: nand-controller@1800 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "brcm,nand-bcmbca", "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/bcm6846.dtsi b/arch/arm/boot/dts/bcm6846.dtsi index fbc7d3a5dc5f..26a36a577b44 100644 --- a/arch/arm/boot/dts/bcm6846.dtsi +++ b/arch/arm/boot/dts/bcm6846.dtsi @@ -118,5 +118,22 @@ hsspi: spi@1000 { num-cs = <8>; status = "disabled"; }; + + nand_controller: nand-controller@1800 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "brcm,nand-bcmbca", "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/bcm6855.dtsi b/arch/arm/boot/dts/bcm6855.dtsi index 5e0fe26530f1..0defcc10ca8a 100644 --- a/arch/arm/boot/dts/bcm6855.dtsi +++ b/arch/arm/boot/dts/bcm6855.dtsi @@ -128,6 +128,23 @@ hsspi: spi@1000 { status = "disabled"; }; + nand_controller: nand-controller@1800 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "brcm,nand-bcmbca", "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/bcm6878.dtsi b/arch/arm/boot/dts/bcm6878.dtsi index 96529d3d4dc2..f6ae07fe1b44 100644 --- a/arch/arm/boot/dts/bcm6878.dtsi +++ b/arch/arm/boot/dts/bcm6878.dtsi @@ -119,6 +119,23 @@ hsspi: spi@1000 { status = "disabled"; }; + nand_controller: nand-controller@1800 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "brcm,nand-bcmbca", "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/bcm947622.dts b/arch/arm/boot/dts/bcm947622.dts index 93b8ce22678d..22e3c4508e1a 100644 --- a/arch/arm/boot/dts/bcm947622.dts +++ b/arch/arm/boot/dts/bcm947622.dts @@ -32,3 +32,7 @@ &uart0 { &hsspi { status = "okay"; }; + +&nand_controller { + status = "okay"; +}; diff --git a/arch/arm/boot/dts/bcm963138.dts b/arch/arm/boot/dts/bcm963138.dts index 1b405c249213..450289d47dc7 100644 --- a/arch/arm/boot/dts/bcm963138.dts +++ b/arch/arm/boot/dts/bcm963138.dts @@ -29,3 +29,7 @@ &serial0 { &hsspi { status = "okay"; }; + +&nand_controller { + status = "okay"; +}; diff --git a/arch/arm/boot/dts/bcm963138dvt.dts b/arch/arm/boot/dts/bcm963138dvt.dts index b5af61853a07..f2140e512070 100644 --- a/arch/arm/boot/dts/bcm963138dvt.dts +++ b/arch/arm/boot/dts/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-sectors-size = <16>; }; &ahci { diff --git a/arch/arm/boot/dts/bcm963148.dts b/arch/arm/boot/dts/bcm963148.dts index 1f5d6d783f09..aa08b473c7cd 100644 --- a/arch/arm/boot/dts/bcm963148.dts +++ b/arch/arm/boot/dts/bcm963148.dts @@ -32,3 +32,7 @@ &uart0 { &hsspi { status = "okay"; }; + +&nand_controller { + status = "okay"; +}; diff --git a/arch/arm/boot/dts/bcm963178.dts b/arch/arm/boot/dts/bcm963178.dts index d036e99dd8d1..c0f504ac43a4 100644 --- a/arch/arm/boot/dts/bcm963178.dts +++ b/arch/arm/boot/dts/bcm963178.dts @@ -32,3 +32,7 @@ &uart0 { &hsspi { status = "okay"; }; + +&nand_controller { + status = "okay"; +}; diff --git a/arch/arm/boot/dts/bcm96756.dts b/arch/arm/boot/dts/bcm96756.dts index 8b104f3fb14a..2ce998f2b84f 100644 --- a/arch/arm/boot/dts/bcm96756.dts +++ b/arch/arm/boot/dts/bcm96756.dts @@ -32,3 +32,7 @@ &uart0 { &hsspi { status = "okay"; }; + +&nand_controller { + status = "okay"; +}; diff --git a/arch/arm/boot/dts/bcm96846.dts b/arch/arm/boot/dts/bcm96846.dts index 55852c229608..f4b9a07370ee 100644 --- a/arch/arm/boot/dts/bcm96846.dts +++ b/arch/arm/boot/dts/bcm96846.dts @@ -32,3 +32,7 @@ &uart0 { &hsspi { status = "okay"; }; + +&nand_controller { + status = "okay"; +}; diff --git a/arch/arm/boot/dts/bcm96855.dts b/arch/arm/boot/dts/bcm96855.dts index 2ad880af2104..5c94063bceaf 100644 --- a/arch/arm/boot/dts/bcm96855.dts +++ b/arch/arm/boot/dts/bcm96855.dts @@ -32,3 +32,7 @@ &uart0 { &hsspi { status = "okay"; }; + +&nand_controller { + status = "okay"; +}; diff --git a/arch/arm/boot/dts/bcm96878.dts b/arch/arm/boot/dts/bcm96878.dts index b7af8ade7a9d..910f7e125bad 100644 --- a/arch/arm/boot/dts/bcm96878.dts +++ b/arch/arm/boot/dts/bcm96878.dts @@ -32,3 +32,7 @@ &uart0 { &hsspi { status = "okay"; }; + +&nand_controller { + status = "okay"; +}; From patchwork Tue Jun 6 23:12:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Zhang X-Patchwork-Id: 13269864 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6639CC7EE2F for ; Tue, 6 Jun 2023 23:50:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=X+OyLaHS7lrI2HzDeqv2ITxGvDVJytLUp2/vNpAbk/M=; b=1HxQS2o4H5Q52GHUwxEwLZCKEq 6dAhzWR6u+BUPZ7seOd0wce2r6iAahjVzpP0GKbVYcpQ9+L8oEwwGODHaUqQFJsgMR+aaQRb2SLZt UIA/cLDq2G0951KOfFO32sVy+fDcg1tmqy5+DxfhfzyycVr3Gxl8csiUK2EBVBJw+zLMbwC+O0zJA DzTc0qa8Oe4vmZ9pxAtCJmoE8hMFc6d3Wx2mRnudt/5dtwqx2jLMlXUXhVtEEJ+3nLPF6Wka3Za1O NWern3cQmYKjbj6jRNR//3AuZ6L3unCL4Vsn9sIaDKHlnWVlG3JguUks9PI72Jb3EReISbHvyhesi PEHrrMbw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q6gR3-003gyF-1g; Tue, 06 Jun 2023 23:49:57 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6gR2-003gxp-0e for linux-arm-kernel@bombadil.infradead.org; Tue, 06 Jun 2023 23:49:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=pXfS0FlS2QbcznYOSQSiO5dmtknzoi2oaZpgc5EP9h0=; b=RtetJQR+z4DeXOr9ia70oOo10M PgGnwIhRI4cYoBLzkltvBHU9EoX03Lfl2DuMWgRpxY6B1IA7XWdwdDOiEUNaaQ7VTAD1nepgcdEew skqaE0mmO2grU31s0G8eWupMrewwnUwS+iBXmuQrqtl11IEVp8yIgyd9382FpoPbLuFULvvLTaeiy hKQqzfIN4qMsu6Gu3UdybwjcGt+1/Yeas43oetf5C5g1EZDXhMrSokfHxqDo/ANP1q0ccTnmPVRrT EAO7+lrGF58Bkk9L8izhe3yplc5IRHx5eGfRFzwF9jrfPnSjf9IHv/5Jq3J0+OmgTXesAEujaUGkm opAfieJQ==; Received: from mail-qk1-x729.google.com ([2607:f8b0:4864:20::729]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6fsr-004DBc-0M for linux-arm-kernel@lists.infradead.org; Tue, 06 Jun 2023 23:16:43 +0000 Received: by mail-qk1-x729.google.com with SMTP id af79cd13be357-75e4497597cso279512485a.2 for ; Tue, 06 Jun 2023 16:14:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1686093275; x=1688685275; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=pXfS0FlS2QbcznYOSQSiO5dmtknzoi2oaZpgc5EP9h0=; b=gYkidIHl6NSQlOjkulRoYL+skcnVXY99zVzir8Z99hi0RO14frhn7A4eUqGUrvvhXG hx9S8RfAu6iA5yLl329Vawyy03TFz8DsumFuqBYWVcB2hFko0KcJHgbNN3HcCI23Ub5W gEreWqEvqX9MQiesTN2yocWE4hRIpCCZEPGgQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686093275; x=1688685275; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pXfS0FlS2QbcznYOSQSiO5dmtknzoi2oaZpgc5EP9h0=; b=k1kUyPVg4SR6SYG3Au7favzKbTow08Gmg0YxUD+83L+kTHcdHV24xYXNeyB69SnBHF sTagcQBadah3ooi2dnjf3UjqEyPI+BbRbrjCZZP0MzhPJ8KOJ35XQRlmlVwrGEO7aSMW tAVf22PwDd6qDef9kpX3bmPcNzSly6eOdB00ZfvBixWHyOwOYtdu4IGOYRQx7U1T1ETx Zc+aYoFI5Vm8bTy9MbDzRpm8fLQWsdtY3sF28p8R+ODkriXyZFxnMQ2xVlq4y96r6PQ7 nGWAh9B8LlVj59smVME/K6F5T1aei23AWlF70d8BdhLWIsm5gYC5ub1ddxK+kIGaKey3 xioA== X-Gm-Message-State: AC+VfDyFUvWywTVpV9X1G4cdopYAmhS9hRR9LJDwB+oeUgLkBBznjHh2 637DILunRNeyPVjpxRiThhsiZQ== X-Google-Smtp-Source: ACHHUZ6KeIVF23V+rneWN/zjyYjbxPIkpWgQ0wLFTcMkMUyJLesoZunx0euMzbhzby+nGgVwIKEh5A== X-Received: by 2002:a05:620a:2856:b0:75b:23a0:d9f6 with SMTP id h22-20020a05620a285600b0075b23a0d9f6mr89094qkp.76.1686093275107; Tue, 06 Jun 2023 16:14:35 -0700 (PDT) Received: from ubuntu-22.localdomain ([192.19.222.250]) by smtp.gmail.com with ESMTPSA id x9-20020ae9e909000000b0075b23e55640sm5221519qkf.123.2023.06.06.16.14.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 16:14:34 -0700 (PDT) From: William Zhang To: Broadcom Kernel List , Linux MTD List Cc: f.fainelli@gmail.com, rafal@milecki.pl, kursad.oney@broadcom.com, joel.peshkin@broadcom.com, computersforpeace@gmail.com, anand.gore@broadcom.com, dregan@mail.com, kamal.dasu@broadcom.com, tomer.yacoby@broadcom.com, dan.beygelman@broadcom.com, William Zhang , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , Rob Herring , linux-arm-kernel@lists.infradead.org Subject: [PATCH 07/12] arm64: dts: broadcom: bcmbca: Add NAND controller node Date: Tue, 6 Jun 2023 16:12:47 -0700 Message-Id: <20230606231252.94838-8-william.zhang@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230606231252.94838-1-william.zhang@broadcom.com> References: <20230606231252.94838-1-william.zhang@broadcom.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230607_001443_205127_1C66843B X-CRM114-Status: GOOD ( 13.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support for Broadcom STB NAND controller in BCMBCA ARMv8 chip dts files. Signed-off-by: William Zhang --- .../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 457805efb385..acfedff89d19 100644 --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi @@ -591,16 +591,19 @@ hsspi: spi@1000{ nand-controller@1800 { #address-cells = <1>; #size-cells = <0>; - compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.1", "brcm,brcmnand"; + compatible = "brcm,nand-bcmbca", "brcm,brcmnand-v7.1", "brcm,brcmnand"; reg = <0x1800 0x600>, <0x2000 0x10>; 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 46aa8c0b7971..7c611c1978ac 100644 --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi @@ -137,6 +137,23 @@ hsspi: spi@1000 { status = "disabled"; }; + nand_controller: nand-controller@1800 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "brcm,nand-bcmbca", "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 7020f2e995e2..faf8b1198d8e 100644 --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm63146.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm63146.dtsi @@ -118,6 +118,23 @@ hsspi: spi@1000 { status = "disabled"; }; + nand_controller: nand-controller@1800 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "brcm,nand-bcmbca", "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 6a0242cbea57..24c344ed5dba 100644 --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm63158.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm63158.dtsi @@ -136,6 +136,23 @@ hsspi: spi@1000 { status = "disabled"; }; + nand_controller: nand-controller@1800 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "brcm,nand-bcmbca", "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 1a12905266ef..c3416146c946 100644 --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi @@ -137,6 +137,23 @@ hsspi: spi@1000 { status = "disabled"; }; + nand_controller: nand-controller@1800 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "brcm,nand-bcmbca", "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 f41ebc30666f..ab6866ab6107 100644 --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi @@ -107,6 +107,23 @@ uart0: serial@640 { status = "disabled"; }; + nand_controller: nand-controller@1800 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "brcm,nand-bcmbca", "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; + }; + }; + hsspi: spi@1000 { #address-cells = <1>; #size-cells = <0>; diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi index fa2688f41f06..390d5da67a3b 100644 --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi @@ -155,5 +155,22 @@ hsspi: spi@1000 { num-cs = <8>; status = "disabled"; }; + + nand_controller: nand-controller@1800 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "brcm,nand-bcmbca", "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 Tue Jun 6 23:12:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: William Zhang X-Patchwork-Id: 13269870 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B45DFC77B7A for ; Wed, 7 Jun 2023 00:30:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6LNyA0GsfZ2V/zH8z7SiszT/bPHydXUvJaVQ9M+xa3U=; b=SjP/WmCR790rbZJ/POBjIo1aiN TT4q4HmOm6LxzjjZtXKiKBkLuny00GsF5PbpuN5sXd3kO30JIMDoFY0r8PK6uoxrZlwOBHA9Znmwz LqmoRMFJtvSXr9u+xwGms/fYbgSkME5TmXpGiOT+CgQA5EKJVLQuZZblyNd6g9vlfoyxTETNS/7xM c19xwWHxE6bDKYqPw4gXUl10mil0QoWRXtKqdcB1ypARf1ljE5ulmNEljeISIoRYu5Hk2iaHvD2u0 NRPG+XVNXn01We+TXb4KT+SOyIC9Dab/E9XmoyofolVFQpcJVyT59knx6WAQ18nFmuLkbZ7cNw1z3 yqwL1Zlw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q6h4L-003mPk-27; Wed, 07 Jun 2023 00:30:33 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6fu0-003bbs-2o for linux-arm-kernel@bombadil.infradead.org; Tue, 06 Jun 2023 23:15:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=E2fQ5fC9naA4V2WuibRj5mVB6UKkKH1eAnLldDlK99g=; b=kdYKxbPMA9r6mOlVP/adAzDQj/ 2nVD+LOvs5kWzEJBvuwbsBP7d86v3FpmOgN3qfsFb9+bV6QCuYyoUm4c97FKecxe4v7w6n38yuTNg 4eIidEQbgEEjMX8iVsMD8TqkTohC05nmgnJ8iFv52+Q3UOtKufg2/5IyNzx6v+EX15l5op1Km0N2f a2OFNBx7KcLghKzuE7B+vADn/JoMuUgoc1YV6vJuM8iwzO+G7j6BD8cPvaLpgNk8VrLqpIgUmRSWF 9lp/HlsS+awJs3HDuk/CJ+z49S3gzKGDmaYGKct4Q/K7BQzWGMwrForqf9Gp+BeSmdb56zxz4DKVu xTT8BtGg==; Received: from mail-qk1-x72f.google.com ([2607:f8b0:4864:20::72f]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6fsu-004DBw-12 for linux-arm-kernel@lists.infradead.org; Tue, 06 Jun 2023 23:15:12 +0000 Received: by mail-qk1-x72f.google.com with SMTP id af79cd13be357-75d536afa43so1869885a.1 for ; Tue, 06 Jun 2023 16:14:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1686093278; x=1688685278; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=E2fQ5fC9naA4V2WuibRj5mVB6UKkKH1eAnLldDlK99g=; b=ORzT2g5KyGvcxpfMbrg8RfxqV+xq7yHfBwUeso+iG2KbOlDvM475aBjp/bRSk4wV9p oS4xRKAROHw20f45iEV/+27mIU7Dwvi3fYgTNomnQDt8EjBVE9K8ZBZ3+2KaFJR0VFuv 07s66e+peXlKemn56SXVYO7kXtQsrbB1RmAZk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686093278; x=1688685278; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=E2fQ5fC9naA4V2WuibRj5mVB6UKkKH1eAnLldDlK99g=; b=RzCBsy5YWVPNPBIwEA4VvZ84Qt4NB99HvgRa5n5gIf8/NPF8CGVptzpQ8HWqq9D7pt 8waKycrRYqFQbiUvOjzqb273tkejkgiqlGw8vRKRnnpPB7HCnSEO0FcHH3xkRAYE9Bd0 Sr/C79ad9HKKVitrBFSNRmlPUJvspeb8gcw9Jvj5clGnnmv8Vm+wS0fMBlAP/vdssatu uRXuDZI+gUKZKzUe2/RbUWjkTVmaiDpQQy75UDYCqvR5S2o3i8XiGFui5K7mAmRs2lQz jL564OTUCqjBEHc1dEc/Y9ejrgwbAxExZuXUgkO6Txr7rKFHe4KUAgCVvEw0obKIujyB d2fw== X-Gm-Message-State: AC+VfDyXk+tmtHBJYABejxt0bUmbCiWD0bTGH2c5ivHmfVUOXcdrKWfM cVBj9sw7KGFhA02QbsYtfqkY1g== X-Google-Smtp-Source: ACHHUZ7bYFLN1a5ufcqbE9UB68Hw5d0exaHSRtYM74Csd+WVyPQL4c5ckOiMe6trlx22UB4miZDl5A== X-Received: by 2002:a05:620a:6186:b0:75e:c7cb:d75d with SMTP id or6-20020a05620a618600b0075ec7cbd75dmr62038qkn.17.1686093278518; Tue, 06 Jun 2023 16:14:38 -0700 (PDT) Received: from ubuntu-22.localdomain ([192.19.222.250]) by smtp.gmail.com with ESMTPSA id x9-20020ae9e909000000b0075b23e55640sm5221519qkf.123.2023.06.06.16.14.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 16:14:37 -0700 (PDT) From: William Zhang To: Broadcom Kernel List , Linux MTD List Cc: f.fainelli@gmail.com, rafal@milecki.pl, kursad.oney@broadcom.com, joel.peshkin@broadcom.com, computersforpeace@gmail.com, anand.gore@broadcom.com, dregan@mail.com, kamal.dasu@broadcom.com, tomer.yacoby@broadcom.com, dan.beygelman@broadcom.com, William Zhang , Florian Fainelli , Miquel Raynal , linux-kernel@vger.kernel.org, Vignesh Raghavendra , Richard Weinberger , Kamal Dasu , linux-arm-kernel@lists.infradead.org Subject: [PATCH 08/12] mtd: rawnand: brcmnand: Rename bcm63138 nand driver Date: Tue, 6 Jun 2023 16:12:48 -0700 Message-Id: <20230606231252.94838-9-william.zhang@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230606231252.94838-1-william.zhang@broadcom.com> References: <20230606231252.94838-1-william.zhang@broadcom.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230607_001445_913998_FBAF5685 X-CRM114-Status: GOOD ( 22.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In preparing to support multiple BCMBCA SoCs, rename bcm63138 to bcmbca in the driver code and driver file name. Signed-off-by: William Zhang Acked-by: Florian Fainelli --- drivers/mtd/nand/raw/brcmnand/Makefile | 2 +- drivers/mtd/nand/raw/brcmnand/bcm63138_nand.c | 101 ------------------ drivers/mtd/nand/raw/brcmnand/bcmbca_nand.c | 101 ++++++++++++++++++ 3 files changed, 102 insertions(+), 102 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 71ddcc611f6e..000000000000 --- a/drivers/mtd/nand/raw/brcmnand/bcm63138_nand.c +++ /dev/null @@ -1,101 +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; - struct resource *res; - - priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); - if (!priv) - return -ENOMEM; - soc = &priv->soc; - - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand-int-base"); - priv->base = devm_ioremap_resource(dev, res); - 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 = 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..f51f857eeea6 --- /dev/null +++ b/drivers/mtd/nand/raw/brcmnand/bcmbca_nand.c @@ -0,0 +1,101 @@ +// 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; + struct resource *res; + + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + soc = &priv->soc; + + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand-int-base"); + priv->base = devm_ioremap_resource(dev, res); + 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 = 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 Tue Jun 6 23:12:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Zhang X-Patchwork-Id: 13269868 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 52CE7C77B7A for ; Wed, 7 Jun 2023 00:16:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XXaoMhPwaISy61fbNjER9PiOzEHcpxXKQ7Tt0xeV36U=; b=nGuQRPsClNg+MUz95Z/4AKXd+9 dJN6FsG1R2i26ZNqxtDj/IvClyZJ+fMC8et9ukztdq6mUyYbvmO/kdwgL4/IWEf7yhOtdHKN2DF2x S2S84NBF0N7/2aalXqmf0eWydEpEYvhXTWIhsouzTA1drXERU7SkmHuQmrAW56nDHtQDlU4iqnCQU 1y6FHt8Qli3/CdgSixbTa2XH9gXSeyk0fydg9lGLcGQ0iGJf95gWPMwwQLA0G+5XKJhatkRMPl0ud AoGc3N2mfwjFxpvWdIR/5jbuCFLUwiS0Pd2wa4BwvN9hO/dESj11nbY/TfysmlCkYQdeT+g1XVL1T 5fbxBe+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q6gpr-003kJT-02; Wed, 07 Jun 2023 00:15:35 +0000 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6fsw-003ays-21 for linux-arm-kernel@lists.infradead.org; Tue, 06 Jun 2023 23:14:43 +0000 Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-75d54faa03eso416558485a.1 for ; Tue, 06 Jun 2023 16:14:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1686093282; x=1688685282; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=RR/IGlMvHjvR6Bi0HmUspPjnXQh9Eqoipv41ZhGpXuA=; b=EfT8Zvut765BlYyP1cS6qDzJnacYaAvL7+6lRubYgcc4CVSIGAFankS2i1BPS6x0pY 9vSMQMTpMGs836e1pb7G0D1UrxjOD8K+IkniS847U5QyV7SS8o3y94tC/QxhIfVcQ1aC uwD+zJmA7GTTRK/PDbuiA9XTSYypM8HCWAsEM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686093282; x=1688685282; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RR/IGlMvHjvR6Bi0HmUspPjnXQh9Eqoipv41ZhGpXuA=; b=frpoahJO/gXSOfQeqNk1wT+JCmO8xS9J10e5fAL47oLV4z2PkvzE9rz1xdJg8iQblc y2n3aDfIqKBFm3bInGzVW4vlYC261F+M+6oHHoeGJJXgoUAlh86ra77xEqoWdXivAmev SKafvzwBCMjVXQWLzGMOa4Fx6BLv0QhhKNYtpfT4l5fPhmWzVowHNfOn3MF2DhxsuEvZ fmWiGuV6LCFt5LeO/J9pus07Bkq93nNgDpnzlLk7pjeVvSco9E1Fs5cWCBsBL4oaXW3R isxVlWHi0ZoZ2khip63ce8FnbU1qLce3ndbtvudmw0qHfvRDj5nVYja6sbCrPks08qGv b0Zg== X-Gm-Message-State: AC+VfDyUyfW9JUydc5t7vlPV7xEKP4dJFoIFl1oh0xGnjMbZTXsBvarl mG5/ixTNkT8UwEwst5y1JyNENw== X-Google-Smtp-Source: ACHHUZ6Wovo1qJpCi22vBt9tqciBsI2pdP/GTijX7xivbVHCuf50NXcoFpoXrCRLg9/QPCvlquzn6A== X-Received: by 2002:a05:620a:40cf:b0:75e:cec3:1ab1 with SMTP id g15-20020a05620a40cf00b0075ecec31ab1mr418749qko.0.1686093282119; Tue, 06 Jun 2023 16:14:42 -0700 (PDT) Received: from ubuntu-22.localdomain ([192.19.222.250]) by smtp.gmail.com with ESMTPSA id x9-20020ae9e909000000b0075b23e55640sm5221519qkf.123.2023.06.06.16.14.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 16:14:41 -0700 (PDT) From: William Zhang To: Broadcom Kernel List , Linux MTD List Cc: f.fainelli@gmail.com, rafal@milecki.pl, kursad.oney@broadcom.com, joel.peshkin@broadcom.com, computersforpeace@gmail.com, anand.gore@broadcom.com, dregan@mail.com, kamal.dasu@broadcom.com, tomer.yacoby@broadcom.com, dan.beygelman@broadcom.com, William Zhang , Miquel Raynal , linux-kernel@vger.kernel.org, Vignesh Raghavendra , Richard Weinberger , Kamal Dasu , linux-arm-kernel@lists.infradead.org Subject: [PATCH 09/12] mtd: rawnand: brcmnand: Add new compatible string Date: Tue, 6 Jun 2023 16:12:49 -0700 Message-Id: <20230606231252.94838-10-william.zhang@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230606231252.94838-1-william.zhang@broadcom.com> References: <20230606231252.94838-1-william.zhang@broadcom.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230606_161442_666780_B0CFB61D X-CRM114-Status: GOOD ( 11.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org To support the new BCMBCA SoCs, add brcm,nand-bcmbca to the driver of match table based on the updated binding document brcm,brcmnand.yaml. Signed-off-by: William Zhang --- drivers/mtd/nand/raw/brcmnand/bcmbca_nand.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/nand/raw/brcmnand/bcmbca_nand.c b/drivers/mtd/nand/raw/brcmnand/bcmbca_nand.c index f51f857eeea6..7e48b6a0bfa2 100644 --- a/drivers/mtd/nand/raw/brcmnand/bcmbca_nand.c +++ b/drivers/mtd/nand/raw/brcmnand/bcmbca_nand.c @@ -81,6 +81,7 @@ static int bcmbca_nand_probe(struct platform_device *pdev) static const struct of_device_id bcmbca_nand_of_match[] = { { .compatible = "brcm,nand-bcm63138" }, + { .compatible = "brcm,nand-bcmbca" }, {}, }; MODULE_DEVICE_TABLE(of, bcmbca_nand_of_match); From patchwork Tue Jun 6 23:12:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Zhang X-Patchwork-Id: 13269869 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D80FDC7EE29 for ; Wed, 7 Jun 2023 00:16:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/UowShQ/YwRUujnFtsDBEY/1nf1y+hi+7tizpYDPjG8=; b=nGuOJHFYtn4mjuW7EUusITQMqC ToqlHOV7h9elV5rtorftUTYs1DG4ScYFfU84aCCrh+uEzdxFTggwaQG6EYXhKQkseVxedtYmqNLt3 /fH2lSS7/Ob19MnFN0qoC/cSRcYxArYei8f/HmbLKW27C52Zrgq2qotumF+NEdBzVsImjLzi4cOss G3C2scUMdnmarhidi3Mk+aN/B6Hqq1Fh0eEgOI+SkWaBMTUltODG+dV7duyOWUG6sDukyZd+FcrPX pMDQfqvXxZjNR7CxIUP12jMIU1OunHGEmRWracXF9hu3caRCQO9rTqK025IacXnv67xJDhxNRV7de +DGI2MZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q6gpr-003kJh-1p; Wed, 07 Jun 2023 00:15:35 +0000 Received: from mail-qv1-xf2e.google.com ([2607:f8b0:4864:20::f2e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6ft0-003b8n-1y for linux-arm-kernel@lists.infradead.org; Tue, 06 Jun 2023 23:14:48 +0000 Received: by mail-qv1-xf2e.google.com with SMTP id 6a1803df08f44-62615694bb9so46811806d6.0 for ; Tue, 06 Jun 2023 16:14:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1686093285; x=1688685285; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=sHIp3UOquU2o1l5lFIHGKkt7xMYEXN2miZAkwuEtmkY=; b=VLImrW5Hl+Ski3lxrpH2m292uDAV2Yc1r/+EbMQJgedGhf4GY0EokNtq98qkANba7w bbndbKpH/k+7kkSI7HdG6uxKXVrcNrE/0CkO+rZFHlPSCicFQY+Ft7DYz3IJe+5Et72D bCzAnrHOnCS8OX6i9RR1c1yx8fldhMbML+Ws0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686093285; x=1688685285; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=sHIp3UOquU2o1l5lFIHGKkt7xMYEXN2miZAkwuEtmkY=; b=P0g6DzEbHm0tyqFuDEWs07dGfQU5ypx2/GuvqqxwZQHQFETSSx11RIPvPaOjO80/73 W7mOiRjckHThCCVLhF6Rb10OSaEu1E+kLiQyK18ZnK/dn2sRIIO3p4cZP2A8q8wSpRW6 wRGgNEkBNbg0rBc2wP/OZShCnP1j9MO6ysSPkHcrBE669n7oYmy9d+kVxpsksM2MvTD/ 4qI9Yldb8Ip7X53MRS/Qp9KU8vRkqP694OW0/xb+6gH79qbF6CgbjxR90T++xbEyNGTM RPD9zLCggMNHI0V45n+ftxKugMZZZfqBBCpxoPgIsZ1JXI6y/SJnaOYgMbULqEfod5kB 7B1Q== X-Gm-Message-State: AC+VfDwOCVVwrpJ6gs/bTvh6aaOUkLwgyNkIoSengaIiAVLBPPnvOyJZ J8HHVoB5Rk6SzcEKYVecF01PRw== X-Google-Smtp-Source: ACHHUZ4p6VJsHkRGkBs45zRnpfNOMlZkhwE4jIcAhqUivqadDeuCE+V7bL4UmxqL/46Y2rg+rR0tfQ== X-Received: by 2002:ad4:5c8e:0:b0:625:aa49:19f3 with SMTP id o14-20020ad45c8e000000b00625aa4919f3mr1208739qvh.64.1686093284715; Tue, 06 Jun 2023 16:14:44 -0700 (PDT) Received: from ubuntu-22.localdomain ([192.19.222.250]) by smtp.gmail.com with ESMTPSA id x9-20020ae9e909000000b0075b23e55640sm5221519qkf.123.2023.06.06.16.14.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 16:14:44 -0700 (PDT) From: William Zhang To: Broadcom Kernel List , Linux MTD List Cc: f.fainelli@gmail.com, rafal@milecki.pl, kursad.oney@broadcom.com, joel.peshkin@broadcom.com, computersforpeace@gmail.com, anand.gore@broadcom.com, dregan@mail.com, kamal.dasu@broadcom.com, tomer.yacoby@broadcom.com, dan.beygelman@broadcom.com, William Zhang , Miquel Raynal , linux-kernel@vger.kernel.org, Vignesh Raghavendra , Richard Weinberger , Kamal Dasu , linux-arm-kernel@lists.infradead.org Subject: [PATCH 10/12] mtd: rawnand: brcmnand: Add BCMBCA read data bus interface Date: Tue, 6 Jun 2023 16:12:50 -0700 Message-Id: <20230606231252.94838-11-william.zhang@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230606231252.94838-1-william.zhang@broadcom.com> References: <20230606231252.94838-1-william.zhang@broadcom.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230606_161446_675686_5C6A03AD X-CRM114-Status: GOOD ( 20.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The BCMBCA broadband SoC integrates the NAND controller differently than STB, iProc and other SoCs. It has different endianness for NAND cache data and ONFI parameter 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 --- drivers/mtd/nand/raw/brcmnand/bcmbca_nand.c | 36 +++++++++++++++++ drivers/mtd/nand/raw/brcmnand/brcmnand.c | 44 ++++++++++++++------- drivers/mtd/nand/raw/brcmnand/brcmnand.h | 2 + 3 files changed, 68 insertions(+), 14 deletions(-) diff --git a/drivers/mtd/nand/raw/brcmnand/bcmbca_nand.c b/drivers/mtd/nand/raw/brcmnand/bcmbca_nand.c index 7e48b6a0bfa2..899103a62c98 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,29 @@ 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, bool is_param) +{ + int i; + + if (!is_param) { + /* + * 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(flash_cache, buffer)) + memcpy((void *)buffer, (void *)flash_cache, fc_words * 4); + else + memcpy_fromio((void *)buffer, (void *)flash_cache, fc_words * 4); + } else { + /* Flash cache has same endian as the host for parameter pages */ + for (i = 0; i < fc_words; i++, buffer++) + *buffer = __raw_readl(flash_cache + i * 4); + } +} + static int bcmbca_nand_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -75,6 +110,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 d920e88c7f5b..656be4d73016 100644 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c @@ -814,6 +814,30 @@ 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, bool is_param) +{ + struct brcmnand_soc *soc = ctrl->soc; + int i; + + if (soc->read_data_bus) { + soc->read_data_bus(soc, flash_cache, buffer, fc_words, is_param); + } else { + if (!is_param) { + for (i = 0; i < fc_words; i++, buffer++) + *buffer = brcmnand_read_fc(ctrl, i); + } else { + for (i = 0; i < fc_words; i++) + /* + * Flash cache is big endian for parameter pages, at + * least on STB SoCs + */ + buffer[i] = be32_to_cpu(brcmnand_read_fc(ctrl, i)); + } + } +} + static void brcmnand_clear_ecc_addr(struct brcmnand_controller *ctrl) { @@ -1811,20 +1835,11 @@ static void brcmnand_cmdfunc(struct nand_chip *chip, unsigned command, native_cmd == CMD_PARAMETER_CHANGE_COL) { /* Copy flash cache word-wise */ u32 *flash_cache = (u32 *)ctrl->flash_cache; - int i; brcmnand_soc_data_bus_prepare(ctrl->soc, true); - /* - * Must cache the FLASH_CACHE now, since changes in - * SECTOR_SIZE_1K may invalidate it - */ - for (i = 0; i < FC_WORDS; i++) - /* - * Flash cache is big endian for parameter pages, at - * least on STB SoCs - */ - flash_cache[i] = be32_to_cpu(brcmnand_read_fc(ctrl, i)); + brcmnand_read_data_bus(ctrl, ctrl->nand_fc, flash_cache, + FC_WORDS, true); brcmnand_soc_data_bus_unprepare(ctrl->soc, true); @@ -2137,7 +2152,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); @@ -2150,8 +2165,9 @@ 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, false); + 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 f1f93d85f50d..88819bc395f8 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, bool is_param); const struct brcmnand_io_ops *ops; };