From patchwork Sun Apr 19 12:51:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Brezillon X-Patchwork-Id: 1272862 X-Patchwork-Delegate: miquel.raynal@bootlin.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=T4jluyoq; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 494qVR2GKRz9s71 for ; Sun, 19 Apr 2020 22:52:31 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc: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:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tX8Mno1GQon+wW1kZTcoyG9Yxdbkjgn4uSGiuDa8HWY=; b=T4jluyoqJDufx/ VGm3/G15phiMe9yoAVxnEUxgdYLxYmco2vHaAee2OhdxC8HHlGUlYaB/kqNNPdSQn6K8pdVvu6EK2 4TqNei2Hb5Rnf5//N0jMLQXcx55DDt4Iq8PtRnBVFneX785s1Tdt4e+VZ+KZdfbPmBZf9wJWM+xya wFtHCvIBizsRTrWMIhr2wvwsFjKoCdtgaaYPoVpOn+MPMjj5lNjJCG3yuo872MGsk0bxw9Y0n9PzH 74HtFC6hpo8vXFxnGpQ0okwEqh+HJO7Vu27jl3JBCeUIH8XW8kPZMtN7pcRBkhKtWAXgl4V9aql+Y h1zR23lQLcJf1N1I90AQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jQ9Qo-0006Nx-Gr; Sun, 19 Apr 2020 12:52:18 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jQ9QI-0005sb-E3 for linux-mtd@lists.infradead.org; Sun, 19 Apr 2020 12:51:49 +0000 Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id BC23F2A0072; Sun, 19 Apr 2020 13:51:44 +0100 (BST) From: Boris Brezillon To: Miquel Raynal , linux-mtd@lists.infradead.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 1/9] mtd: rawnand: Add an is_last flag to nand_subop Date: Sun, 19 Apr 2020 14:51:32 +0200 Message-Id: <20200419125140.1307309-2-boris.brezillon@collabora.com> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200419125140.1307309-1-boris.brezillon@collabora.com> References: <20200419125140.1307309-1-boris.brezillon@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200419_055146_604936_CE5C55E0 X-CRM114-Status: GOOD ( 11.27 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [46.235.227.227 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh Raghavendra , Tudor Ambarus , Richard Weinberger , Boris Brezillon , Boris Brezillon , bcm-kernel-feedback-list@broadcom.com, openwrt-devel@lists.openwrt.org Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Some controllers need to know when they're passed the last subop so they can de-assert the CE pin. Signed-off-by: Boris Brezillon Reviewed-by: Miquel Raynal Reviewed-by: Miquel Raynal Reviewed-by: Miquel Raynal --- drivers/mtd/nand/raw/nand_base.c | 2 ++ include/linux/mtd/rawnand.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c index fa9ac18e97a1..f81b54634061 100644 --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c @@ -2101,6 +2101,8 @@ nand_op_parser_match_pat(const struct nand_op_parser_pattern *pat, */ ctx->subop.ninstrs = ninstrs; ctx->subop.last_instr_end_off = instr_offset; + if (ctx->subop.instrs + ninstrs == end && !instr_offset) + ctx->subop.is_last = true; return true; } diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h index 8e8d1a61e2fb..99f4ac47c8d3 100644 --- a/include/linux/mtd/rawnand.h +++ b/include/linux/mtd/rawnand.h @@ -701,6 +701,7 @@ struct nand_op_instr { * of the sub-operation * @last_instr_end_off: offset to end at (excluded) for the last instruction * of the sub-operation + * @is_last: this sub-operation is the last one * * Both @first_instr_start_off and @last_instr_end_off only apply to data or * address instructions. @@ -715,6 +716,7 @@ struct nand_subop { unsigned int ninstrs; unsigned int first_instr_start_off; unsigned int last_instr_end_off; + bool is_last; }; unsigned int nand_subop_get_addr_start_off(const struct nand_subop *subop, From patchwork Sun Apr 19 12:51:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Brezillon X-Patchwork-Id: 1272863 X-Patchwork-Delegate: miquel.raynal@bootlin.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=nm3PzHpk; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 494qVX33zjz9s71 for ; Sun, 19 Apr 2020 22:52:36 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc: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:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5IzbBCT3ZSxJXpl1SJyZqV7AodG7YFxOQH4YppQYx8U=; b=nm3PzHpkxVY2h7 KhsNaQqVPZ/SGi1eyZDUKrARHG7a/a+jbRD8NwiE+s8hFtT1dhozSFGEiiEz0dJxHhR4g0HdcR/lz KhM0CunsDc71FpxgaZSKaBtH75iA8nPjtffjQQ8QZtwH/QB75+og0njG1UlDytjWCbGXpuMvySifE Wf5OcqSLLTrg4V2d5IXds/CNKcAszug9TXGimxUanobyjsts6ZCK82JuhIL4XvYVI6C6aTo8yDFNw 3zXe5N41bdZclUufzTYru33chdxoi1FVKmvJK9SUwAo1eTkfNod5zPM8XgulZfJcrEW08P0QMh8tj /L4xAvHEsna+N9Hr+p/A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jQ9R2-0006d0-Uf; Sun, 19 Apr 2020 12:52:32 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jQ9QI-0005si-Mm for linux-mtd@lists.infradead.org; Sun, 19 Apr 2020 12:51:49 +0000 Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 2028E2A0D5C; Sun, 19 Apr 2020 13:51:45 +0100 (BST) From: Boris Brezillon To: Miquel Raynal , linux-mtd@lists.infradead.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 2/9] mtd: rawnand: bcm47xx: Drop dependency on BCMA Date: Sun, 19 Apr 2020 14:51:33 +0200 Message-Id: <20200419125140.1307309-3-boris.brezillon@collabora.com> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200419125140.1307309-1-boris.brezillon@collabora.com> References: <20200419125140.1307309-1-boris.brezillon@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200419_055146_881148_667D88C6 X-CRM114-Status: GOOD ( 10.72 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh Raghavendra , Tudor Ambarus , Richard Weinberger , Boris Brezillon , Boris Brezillon , bcm-kernel-feedback-list@broadcom.com, openwrt-devel@lists.openwrt.org Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org BCMA_NFLASH can only be selected if BCMA is enabled and we already depend on BCMA_NFLASH, making the dependency on BCMA useless. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/raw/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig index a80a46bb5b8b..60c4eb9d382f 100644 --- a/drivers/mtd/nand/raw/Kconfig +++ b/drivers/mtd/nand/raw/Kconfig @@ -243,7 +243,6 @@ config MTD_NAND_BRCMNAND config MTD_NAND_BCM47XXNFLASH tristate "BCM4706 BCMA NAND controller" depends on BCMA_NFLASH - depends on BCMA help BCMA bus can have various flash memories attached, they are registered by bcma as platform devices. This enables driver for From patchwork Sun Apr 19 12:51:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Brezillon X-Patchwork-Id: 1272866 X-Patchwork-Delegate: miquel.raynal@bootlin.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=o8ya7F3+; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 494qWR5Yxsz9sSG for ; Sun, 19 Apr 2020 22:53:23 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc: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:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kvliYQ/COjpP+TihsfN6/loDMk1W6V9pSzP/rLsMVL8=; b=o8ya7F3+BMn3Ve en4YxfSMjan2Cs7A1v5HaWkeIqAkOg13WbwmYww68Fg97R+ymP6S5CPMCaUgxtrmg8DuG0MgSkmWP /p276K321ds6fbJ0dvjZiP9fNw6qFj5iA7MT2rXqnOPHPCpDL4iPu1oOUqJgmcCPqKgwnpnv4ndiQ 9mW3nxB4kGaIY3ml3VEuxkZJA3BwPka/tGlKGHDA0rtdg+VR5A4fYXajL7XcaJ5Cgam2KpOYP3EEp sk8HFuHRsghQ3LmwTRsYV30inMlxM0rbdcea45lWr+z+MD2s7JJ9oSxEr1M70VqY1IxTm82KoCzSq 3+DD5xlZFdIYJRAm19jQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jQ9Ro-0007OO-Ry; Sun, 19 Apr 2020 12:53:20 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jQ9QI-0005sk-Q4 for linux-mtd@lists.infradead.org; Sun, 19 Apr 2020 12:51:50 +0000 Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 755EB2A0D63; Sun, 19 Apr 2020 13:51:45 +0100 (BST) From: Boris Brezillon To: Miquel Raynal , linux-mtd@lists.infradead.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 3/9] mtd: rawnand: bcm47xx: Allow compiling the driver when COMPILE_TEST=y Date: Sun, 19 Apr 2020 14:51:34 +0200 Message-Id: <20200419125140.1307309-4-boris.brezillon@collabora.com> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200419125140.1307309-1-boris.brezillon@collabora.com> References: <20200419125140.1307309-1-boris.brezillon@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200419_055146_967602_441042F9 X-CRM114-Status: GOOD ( 12.56 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [46.235.227.227 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh Raghavendra , Tudor Ambarus , Richard Weinberger , Boris Brezillon , Boris Brezillon , bcm-kernel-feedback-list@broadcom.com, openwrt-devel@lists.openwrt.org Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Makes it easier to spot compile-time issues. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/raw/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig index 60c4eb9d382f..1f8aa353f764 100644 --- a/drivers/mtd/nand/raw/Kconfig +++ b/drivers/mtd/nand/raw/Kconfig @@ -242,7 +242,7 @@ config MTD_NAND_BRCMNAND config MTD_NAND_BCM47XXNFLASH tristate "BCM4706 BCMA NAND controller" - depends on BCMA_NFLASH + depends on BCMA_NFLASH || COMPILE_TEST help BCMA bus can have various flash memories attached, they are registered by bcma as platform devices. This enables driver for From patchwork Sun Apr 19 12:51:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Brezillon X-Patchwork-Id: 1272868 X-Patchwork-Delegate: miquel.raynal@bootlin.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=hwNdqzCq; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 494qXL3RjFz9s71 for ; Sun, 19 Apr 2020 22:54:10 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc: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:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2DLtcTWo18LFhKscz8GjgTMsDjStwg3tKQW8IstkT5g=; b=hwNdqzCqWfCDai qhtrfgw/Iq1vq9Kj3/m613lQviyKzDuMguMVPLaHIa6t+VIEc3o1Gl1wklnKyG63ezxdKyNc2XBPM 5cS8p5YLJLnT8LC7rJHzKknuyKblA4JDvIHno/EkVf5uoo2OBE0ESQfRaaNEpNN9qNOt+qJfDdcva kqYeeamDoYHmHCxuP6dlVuVNi5MShMWSkV6TxQ0/3jNTWRYaCMVk81FamT2pYvCzxUYd4E82fP893 txC7jlDPXTwAQb44DEOmMomhKINUGOvRGDQfJ1qwe/xKTgzI17WHYgke9zMo9Kr9KjgB3IarPBBA4 31Mj84sRjDtbcHttwCLw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jQ9SI-00083V-Qd; Sun, 19 Apr 2020 12:53:50 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jQ9QJ-0005so-A4 for linux-mtd@lists.infradead.org; Sun, 19 Apr 2020 12:51:52 +0000 Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id CD6A12A0D69; Sun, 19 Apr 2020 13:51:45 +0100 (BST) From: Boris Brezillon To: Miquel Raynal , linux-mtd@lists.infradead.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 4/9] mtd: rawnand: bcm47xx: Demistify a few more things Date: Sun, 19 Apr 2020 14:51:35 +0200 Message-Id: <20200419125140.1307309-5-boris.brezillon@collabora.com> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200419125140.1307309-1-boris.brezillon@collabora.com> References: <20200419125140.1307309-1-boris.brezillon@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200419_055147_606024_E4AD7D17 X-CRM114-Status: GOOD ( 16.12 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh Raghavendra , Tudor Ambarus , Richard Weinberger , Boris Brezillon , Boris Brezillon , bcm-kernel-feedback-list@broadcom.com, openwrt-devel@lists.openwrt.org Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org There were a few places were raw hex values were used instead of the macro def. We also add macros to help forming the conf value (note that we still have one magic bit whose meaning I couldn't extract from the code), and add an extra macro to specify the number of DATA cycles to issue when the READ or WRITE flag is set. Signed-off-by: Boris Brezillon Reviewed-by: Miquel Raynal --- .../mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c | 34 +++++++++++++++---- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b/drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c index 591775173034..fbb7acebc8f7 100644 --- a/drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c +++ b/drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c @@ -25,12 +25,29 @@ #define NCTL_CMD1W 0x00080000 #define NCTL_READ 0x00100000 #define NCTL_WRITE 0x00200000 +/* When the SPECADDR is set CMD1 is interpreted as a single ADDR cycle */ #define NCTL_SPECADDR 0x01000000 #define NCTL_READY 0x04000000 #define NCTL_ERR 0x08000000 +/* + * Number of DATA cycles to issue when NCTL_{READ,WRITE} is set. The minimum + * value is 1 and the maximum value is 4. Those bytes are then stored in the + * BCMA_CC_NFLASH_DATA register. + */ +#define NCTL_DATA_CYCLES(x) ((((x) - 1) & 0x3) << 28) +/* + * The CS pin seems to be asserted even if NCTL_CSA is not set. All this bit + * seems to encode is whether the CS line should stay asserted after the + * operation has been executed. In other words, you should only set it if if + * you intend to do more operations on the NAND bus. + */ #define NCTL_CSA 0x40000000 #define NCTL_START 0x80000000 +#define CONF_MAGIC_BIT 0x00000002 +#define CONF_COL_BYTES(x) (((x) - 1) << 4) +#define CONF_ROW_BYTES(x) (((x) - 1) << 6) + /************************************************** * Various helpers **************************************************/ @@ -118,7 +135,7 @@ static void bcm47xxnflash_ops_bcm4706_read(struct mtd_info *mtd, uint8_t *buf, /* Eventually read some data :) */ for (i = 0; i < toread; i += 4, dest++) { - ctlcode = NCTL_CSA | 0x30000000 | NCTL_READ; + ctlcode = NCTL_CSA | NCTL_DATA_CYCLES(4) | NCTL_READ; if (i == toread - 4) /* Last read goes without that */ ctlcode &= ~NCTL_CSA; if (bcm47xxnflash_ops_bcm4706_ctl_cmd(b47n->cc, @@ -150,7 +167,7 @@ static void bcm47xxnflash_ops_bcm4706_write(struct mtd_info *mtd, for (i = 0; i < len; i += 4, data++) { bcma_cc_write32(cc, BCMA_CC_NFLASH_DATA, *data); - ctlcode = NCTL_CSA | 0x30000000 | NCTL_WRITE; + ctlcode = NCTL_CSA | NCTL_DATA_CYCLES(4) | NCTL_WRITE; if (i == len - 4) /* Last read goes without that */ ctlcode &= ~NCTL_CSA; if (bcm47xxnflash_ops_bcm4706_ctl_cmd(cc, ctlcode)) { @@ -229,7 +246,7 @@ static void bcm47xxnflash_ops_bcm4706_cmdfunc(struct nand_chip *nand_chip, nand_wait_ready(nand_chip); break; case NAND_CMD_READID: - ctlcode = NCTL_CSA | 0x01000000 | NCTL_CMD1W | NCTL_CMD0; + ctlcode = NCTL_CSA | NCTL_SPECADDR | NCTL_CMD1W | NCTL_CMD0; ctlcode |= NAND_CMD_READID; if (bcm47xxnflash_ops_bcm4706_ctl_cmd(b47n->cc, ctlcode)) { pr_err("READID error\n"); @@ -242,7 +259,7 @@ static void bcm47xxnflash_ops_bcm4706_cmdfunc(struct nand_chip *nand_chip, * to perform, so cache everything. */ for (i = 0; i < ARRAY_SIZE(b47n->id_data); i++) { - ctlcode = NCTL_CSA | NCTL_READ; + ctlcode = NCTL_CSA | NCTL_READ | NCTL_DATA_CYCLES(1); if (i == ARRAY_SIZE(b47n->id_data) - 1) ctlcode &= ~NCTL_CSA; if (bcm47xxnflash_ops_bcm4706_ctl_cmd(b47n->cc, @@ -285,7 +302,7 @@ static void bcm47xxnflash_ops_bcm4706_cmdfunc(struct nand_chip *nand_chip, b47n->curr_page_addr); /* Prepare to write */ - ctlcode = 0x40000000 | NCTL_ROW | NCTL_COL | NCTL_CMD0; + ctlcode = NCTL_CSA | NCTL_ROW | NCTL_COL | NCTL_CMD0; ctlcode |= NAND_CMD_SEQIN; if (bcm47xxnflash_ops_bcm4706_ctl_cmd(cc, ctlcode)) pr_err("SEQIN failed\n"); @@ -320,7 +337,9 @@ static u8 bcm47xxnflash_ops_bcm4706_read_byte(struct nand_chip *nand_chip) } return b47n->id_data[b47n->curr_column++]; case NAND_CMD_STATUS: - if (bcm47xxnflash_ops_bcm4706_ctl_cmd(cc, NCTL_READ)) + if (bcm47xxnflash_ops_bcm4706_ctl_cmd(cc, + NCTL_READ | + NCTL_DATA_CYCLES(1))) return 0; return bcma_cc_read32(cc, BCMA_CC_NFLASH_DATA) & 0xff; case NAND_CMD_READOOB: @@ -439,7 +458,8 @@ int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n) row_bits = tbits - col_bits + 1; row_bsize = (row_bits + 7) / 8; - val = ((row_bsize - 1) << 6) | ((col_size - 1) << 4) | 2; + val = CONF_ROW_BYTES(row_bsize) | CONF_COL_BYTES(col_size) | + CONF_MAGIC_BIT; bcma_cc_write32(b47n->cc, BCMA_CC_NFLASH_CONF, val); exit: From patchwork Sun Apr 19 12:51:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Brezillon X-Patchwork-Id: 1272872 X-Patchwork-Delegate: miquel.raynal@bootlin.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=mKFRdDgn; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 494qYB0Ry0z9s71 for ; Sun, 19 Apr 2020 22:54:54 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc: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:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9PllStRJktC8680tgd39cSpFYN0cIcCxuVQ4942OIrg=; b=mKFRdDgnZ4/KaZ t3fnAf7lNE2lK3TSpi40AyfLTl/mMMUv2SIbfPmQqaOCRwpachTiDv3f5W4gWkeHUFM6ISrQ9CztS TBfG1AxP9YoUl1zLVrF6iSS+XE7k4KCbFMV5z4luhoYrKomTn9fK5FMAEnTHxDqNWOIUdKIRgzEtN 0IMnPW5Cftkyt1IUiqlQkS8td54p8XwZyQVLgdePns0/qAtt8H84oMXpPNjSp39Tt7n5O+oRTYZvO kPoFTnIYbZGAV3jdBSdk8SKgaKF88ruPIDImaIMnUUpDiR+8+OTM0tJOtO9kh/wce3nNcDWLPG22T SsaNexSdiJTE88OR3uyA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jQ9TH-0000bY-31; Sun, 19 Apr 2020 12:54:51 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jQ9QK-0005vT-VN for linux-mtd@lists.infradead.org; Sun, 19 Apr 2020 12:51:54 +0000 Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 43D5A2A0D6C; Sun, 19 Apr 2020 13:51:46 +0100 (BST) From: Boris Brezillon To: Miquel Raynal , linux-mtd@lists.infradead.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 5/9] mtd: rawnand: bcm47xx: Implement the exec_op() interface Date: Sun, 19 Apr 2020 14:51:36 +0200 Message-Id: <20200419125140.1307309-6-boris.brezillon@collabora.com> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200419125140.1307309-1-boris.brezillon@collabora.com> References: <20200419125140.1307309-1-boris.brezillon@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200419_055149_294261_FC8EF319 X-CRM114-Status: GOOD ( 18.72 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh Raghavendra , Tudor Ambarus , Richard Weinberger , Boris Brezillon , Boris Brezillon , bcm-kernel-feedback-list@broadcom.com, openwrt-devel@lists.openwrt.org Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Implement the exec_op() interface so we can get rid of the convoluted cmdfunc() implementation. Signed-off-by: Boris Brezillon --- This is based on my understanding of how this controller works, and I think it covers all the use cases covered by the custom cmdfunc() implementation. I might be wrong of course, so it'd be great to have someone test on real HW. --- .../nand/raw/bcm47xxnflash/bcm47xxnflash.h | 1 + .../mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c | 150 ++++++++++++++++++ 2 files changed, 151 insertions(+) diff --git a/drivers/mtd/nand/raw/bcm47xxnflash/bcm47xxnflash.h b/drivers/mtd/nand/raw/bcm47xxnflash/bcm47xxnflash.h index 201b9baa52a0..00d0974b73cb 100644 --- a/drivers/mtd/nand/raw/bcm47xxnflash/bcm47xxnflash.h +++ b/drivers/mtd/nand/raw/bcm47xxnflash/bcm47xxnflash.h @@ -10,6 +10,7 @@ #include struct bcm47xxnflash { + struct nand_controller base; struct bcma_drv_cc *cc; struct nand_chip nand_chip; diff --git a/drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b/drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c index fbb7acebc8f7..184f78b3d45a 100644 --- a/drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c +++ b/drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c @@ -382,6 +382,153 @@ static void bcm47xxnflash_ops_bcm4706_write_buf(struct nand_chip *nand_chip, pr_err("Invalid command for buf write: 0x%X\n", b47n->curr_command); } +static int +bcm47xxnflash_ops_bcm4706_exec_cmd_addr(struct nand_chip *chip, + const struct nand_subop *subop) +{ + struct bcm47xxnflash *b47n = nand_get_controller_data(chip); + u32 nctl = 0, col = 0, row = 0, ncols = 0, nrows = 0; + unsigned int i, j; + + for (i = 0; i < subop->ninstrs; i++) { + const struct nand_op_instr *instr = &subop->instrs[i]; + + switch (instr->type) { + case NAND_OP_CMD_INSTR: + if (WARN_ON_ONCE((nctl & NCTL_CMD0) && + (nctl & NCTL_CMD1W))) + return -EINVAL; + else if (nctl & NCTL_CMD0) + nctl |= NCTL_CMD1W | + ((u32)instr->ctx.cmd.opcode << 8); + else + nctl |= NCTL_CMD0 | instr->ctx.cmd.opcode; + break; + case NAND_OP_ADDR_INSTR: + for (j = 0; j < instr->ctx.addr.naddrs; j++) { + u32 addr = instr->ctx.addr.addrs[j]; + + if (i < 2) { + col |= addr << i * 8; + nctl |= NCTL_COL; + ncols++; + } else { + row |= addr << (i - 2) * 8; + nctl |= NCTL_ROW; + nrows++; + } + } + break; + default: + WARN_ON_ONCE(1); + return -EINVAL; + } + } + + /* Keep the CS line asserted if there's something else to execute. */ + if (!subop->is_last) + nctl |= NCTL_CSA; + + bcma_cc_write32(b47n->cc, BCMA_CC_NFLASH_CONF, + CONF_MAGIC_BIT | + CONF_COL_BYTES(ncols) | + CONF_ROW_BYTES(nrows)); + return bcm47xxnflash_ops_bcm4706_ctl_cmd(b47n->cc, nctl); +} + +static int +bcm47xxnflash_ops_bcm4706_exec_waitrdy(struct nand_chip *chip, + const struct nand_subop *subop) +{ + struct bcm47xxnflash *b47n = nand_get_controller_data(chip); + const struct nand_op_instr *instr = &subop->instrs[0]; + unsigned long timeout_jiffies = jiffies; + + if (WARN_ON(subop->ninstrs != 1 || + instr->type != NAND_OP_DATA_IN_INSTR)) + return -EINVAL; + + timeout_jiffies += msecs_to_jiffies(instr->ctx.waitrdy.timeout_ms) + 1; + do { + if (bcma_cc_read32(b47n->cc, BCMA_CC_NFLASH_CTL) & NCTL_READY) + return 0; + + usleep_range(10, 100); + } while (time_before(jiffies, timeout_jiffies)); + + return -ETIMEDOUT; +} + +static int +bcm47xxnflash_ops_bcm4706_exec_rw(struct nand_chip *chip, + const struct nand_subop *subop) +{ + struct bcm47xxnflash *b47n = nand_get_controller_data(chip); + const struct nand_op_instr *instr = &subop->instrs[0]; + unsigned int i; + int ret; + + if (WARN_ON(subop->ninstrs != 1 || + (instr->type != NAND_OP_DATA_IN_INSTR && + instr->type != NAND_OP_DATA_OUT_INSTR))) + return -EINVAL; + + for (i = 0; i < instr->ctx.data.len; i += 4) { + unsigned int nbytes = min_t(unsigned int, + instr->ctx.data.len - i, 4); + u32 nctl, data; + + nctl = NCTL_CSA | NCTL_DATA_CYCLES(nbytes); + if (instr->type == NAND_OP_DATA_IN_INSTR) { + nctl |= NCTL_READ; + } else { + nctl |= NCTL_WRITE; + memcpy(&data, instr->ctx.data.buf.in + i, nbytes); + bcma_cc_write32(b47n->cc, BCMA_CC_NFLASH_DATA, data); + } + + if (i + nbytes < instr->ctx.data.len) + nctl |= NCTL_CSA; + + ret = bcm47xxnflash_ops_bcm4706_ctl_cmd(b47n->cc, nctl); + if (ret) + return ret; + + if (instr->type == NAND_OP_DATA_IN_INSTR) { + data = bcma_cc_read32(b47n->cc, BCMA_CC_NFLASH_DATA); + memcpy(instr->ctx.data.buf.in + i, &data, nbytes); + } + } + + return 0; +} + +static const struct nand_op_parser bcm47xxnflash_op_parser = NAND_OP_PARSER( + NAND_OP_PARSER_PATTERN(bcm47xxnflash_ops_bcm4706_exec_cmd_addr, + NAND_OP_PARSER_PAT_CMD_ELEM(true), + NAND_OP_PARSER_PAT_ADDR_ELEM(true, 5), + NAND_OP_PARSER_PAT_CMD_ELEM(true)), + NAND_OP_PARSER_PATTERN(bcm47xxnflash_ops_bcm4706_exec_waitrdy, + NAND_OP_PARSER_PAT_WAITRDY_ELEM(false)), + NAND_OP_PARSER_PATTERN(bcm47xxnflash_ops_bcm4706_exec_rw, + NAND_OP_PARSER_PAT_DATA_IN_ELEM(false, 0x200)), + NAND_OP_PARSER_PATTERN(bcm47xxnflash_ops_bcm4706_exec_rw, + NAND_OP_PARSER_PAT_DATA_OUT_ELEM(false, 0x200)), +); + +static int +bcm47xxnflash_ops_bcm4706_exec_op(struct nand_chip *chip, + const struct nand_operation *op, + bool check_only) +{ + return nand_op_parser_exec_op(chip, &bcm47xxnflash_op_parser, op, + check_only); +} + +static const struct nand_controller_ops bcm47xxnflash_ops = { + .exec_op = bcm47xxnflash_ops_bcm4706_exec_op, +}; + /************************************************** * Init **************************************************/ @@ -398,6 +545,9 @@ int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n) u8 tbits, col_bits, col_size, row_bits, row_bsize; u32 val; + nand_controller_init(&b47n->base); + b47n->base.ops = &bcm47xxnflash_ops; + b47n->nand_chip.controller = &b47n->base; nand_chip->legacy.select_chip = bcm47xxnflash_ops_bcm4706_select_chip; nand_chip->legacy.cmd_ctrl = bcm47xxnflash_ops_bcm4706_cmd_ctrl; nand_chip->legacy.dev_ready = bcm47xxnflash_ops_bcm4706_dev_ready; From patchwork Sun Apr 19 12:51:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Brezillon X-Patchwork-Id: 1272877 X-Patchwork-Delegate: miquel.raynal@bootlin.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=El24WBbP; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 494qZZ4wfLz9sSM for ; Sun, 19 Apr 2020 22:56:06 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc: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:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=H5Ry881MacDInjvCbrVZr+9x6LJEMVi5UvGfB4etU/A=; b=El24WBbP1x9Dsw utwkIUwE+2B9rQQCa1ktTGIfOMRzSFg3/dVkDhX216TgcRwb6u2dT5msb+Gw1gOcTMCnZ/Hf4qgRd lwigGpNs1Ji7AqdSQU05epSWbcJfNm4di+rJvDqH3P9n+znBluRUD/saTcoa4dLsCjpqRCHb8q8oO u4STsjq/6U3ueJBbnZuTEgb+wJGHRWa2wOI4oKGJajQoDikqfrjijqxLQW6e2KS9LZFkjiutDD+we iIXmhrjevfwvCcgQTWy7j/AewvLW/REinhTSabFTdn4KcToBjOgbq7MbeUG2Qw8tHekv4rAUXv6iq c+vKU+/5pbvjWdnyAdjQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jQ9UR-00041S-98; Sun, 19 Apr 2020 12:56:03 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jQ9QK-0005vU-VA for linux-mtd@lists.infradead.org; Sun, 19 Apr 2020 12:51:56 +0000 Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 996FD2A0D73; Sun, 19 Apr 2020 13:51:46 +0100 (BST) From: Boris Brezillon To: Miquel Raynal , linux-mtd@lists.infradead.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 6/9] mtd: rawnand: bcm47xx: Get rid of the legacy implementation Date: Sun, 19 Apr 2020 14:51:37 +0200 Message-Id: <20200419125140.1307309-7-boris.brezillon@collabora.com> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200419125140.1307309-1-boris.brezillon@collabora.com> References: <20200419125140.1307309-1-boris.brezillon@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200419_055149_304632_4288C489 X-CRM114-Status: GOOD ( 16.51 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh Raghavendra , Tudor Ambarus , Richard Weinberger , Boris Brezillon , Boris Brezillon , bcm-kernel-feedback-list@broadcom.com, openwrt-devel@lists.openwrt.org Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Now that exec_op() is implemented we don't need to implement all those legacy hooks, which simplifies the code quite a bit. Signed-off-by: Boris Brezillon Reviewed-by: Miquel Raynal --- .../nand/raw/bcm47xxnflash/bcm47xxnflash.h | 6 - .../mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c | 315 ------------------ 2 files changed, 321 deletions(-) diff --git a/drivers/mtd/nand/raw/bcm47xxnflash/bcm47xxnflash.h b/drivers/mtd/nand/raw/bcm47xxnflash/bcm47xxnflash.h index 00d0974b73cb..8de0e7e0a3a4 100644 --- a/drivers/mtd/nand/raw/bcm47xxnflash/bcm47xxnflash.h +++ b/drivers/mtd/nand/raw/bcm47xxnflash/bcm47xxnflash.h @@ -14,12 +14,6 @@ struct bcm47xxnflash { struct bcma_drv_cc *cc; struct nand_chip nand_chip; - - unsigned curr_command; - int curr_page_addr; - int curr_column; - - u8 id_data[8]; }; int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n); diff --git a/drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b/drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c index 184f78b3d45a..4e38b685d207 100644 --- a/drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c +++ b/drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c @@ -75,313 +75,10 @@ static int bcm47xxnflash_ops_bcm4706_ctl_cmd(struct bcma_drv_cc *cc, u32 code) return 0; } -static int bcm47xxnflash_ops_bcm4706_poll(struct bcma_drv_cc *cc) -{ - int i; - - for (i = 0; i < NFLASH_READY_RETRIES; i++) { - if (bcma_cc_read32(cc, BCMA_CC_NFLASH_CTL) & NCTL_READY) { - if (bcma_cc_read32(cc, BCMA_CC_NFLASH_CTL) & - BCMA_CC_NFLASH_CTL_ERR) { - pr_err("Error on polling\n"); - return -EBUSY; - } else { - return 0; - } - } - } - - pr_err("Polling timeout!\n"); - return -EBUSY; -} - -/************************************************** - * R/W - **************************************************/ - -static void bcm47xxnflash_ops_bcm4706_read(struct mtd_info *mtd, uint8_t *buf, - int len) -{ - struct nand_chip *nand_chip = mtd_to_nand(mtd); - struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); - - u32 ctlcode; - u32 *dest = (u32 *)buf; - int i; - int toread; - - BUG_ON(b47n->curr_page_addr & ~nand_chip->pagemask); - /* Don't validate column using nand_chip->page_shift, it may be bigger - * when accessing OOB */ - - while (len) { - /* We can read maximum of 0x200 bytes at once */ - toread = min(len, 0x200); - - /* Set page and column */ - bcma_cc_write32(b47n->cc, BCMA_CC_NFLASH_COL_ADDR, - b47n->curr_column); - bcma_cc_write32(b47n->cc, BCMA_CC_NFLASH_ROW_ADDR, - b47n->curr_page_addr); - - /* Prepare to read */ - ctlcode = NCTL_CSA | NCTL_CMD1W | NCTL_ROW | NCTL_COL | - NCTL_CMD0; - ctlcode |= NAND_CMD_READSTART << 8; - if (bcm47xxnflash_ops_bcm4706_ctl_cmd(b47n->cc, ctlcode)) - return; - if (bcm47xxnflash_ops_bcm4706_poll(b47n->cc)) - return; - - /* Eventually read some data :) */ - for (i = 0; i < toread; i += 4, dest++) { - ctlcode = NCTL_CSA | NCTL_DATA_CYCLES(4) | NCTL_READ; - if (i == toread - 4) /* Last read goes without that */ - ctlcode &= ~NCTL_CSA; - if (bcm47xxnflash_ops_bcm4706_ctl_cmd(b47n->cc, - ctlcode)) - return; - *dest = bcma_cc_read32(b47n->cc, BCMA_CC_NFLASH_DATA); - } - - b47n->curr_column += toread; - len -= toread; - } -} - -static void bcm47xxnflash_ops_bcm4706_write(struct mtd_info *mtd, - const uint8_t *buf, int len) -{ - struct nand_chip *nand_chip = mtd_to_nand(mtd); - struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); - struct bcma_drv_cc *cc = b47n->cc; - - u32 ctlcode; - const u32 *data = (u32 *)buf; - int i; - - BUG_ON(b47n->curr_page_addr & ~nand_chip->pagemask); - /* Don't validate column using nand_chip->page_shift, it may be bigger - * when accessing OOB */ - - for (i = 0; i < len; i += 4, data++) { - bcma_cc_write32(cc, BCMA_CC_NFLASH_DATA, *data); - - ctlcode = NCTL_CSA | NCTL_DATA_CYCLES(4) | NCTL_WRITE; - if (i == len - 4) /* Last read goes without that */ - ctlcode &= ~NCTL_CSA; - if (bcm47xxnflash_ops_bcm4706_ctl_cmd(cc, ctlcode)) { - pr_err("%s ctl_cmd didn't work!\n", __func__); - return; - } - } - - b47n->curr_column += len; -} - /************************************************** * NAND chip ops **************************************************/ -static void bcm47xxnflash_ops_bcm4706_cmd_ctrl(struct nand_chip *nand_chip, - int cmd, unsigned int ctrl) -{ - struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); - u32 code = 0; - - if (cmd == NAND_CMD_NONE) - return; - - if (cmd & NAND_CTRL_CLE) - code = cmd | NCTL_CMD0; - - /* nCS is not needed for reset command */ - if (cmd != NAND_CMD_RESET) - code |= NCTL_CSA; - - bcm47xxnflash_ops_bcm4706_ctl_cmd(b47n->cc, code); -} - -/* Default nand_select_chip calls cmd_ctrl, which is not used in BCM4706 */ -static void bcm47xxnflash_ops_bcm4706_select_chip(struct nand_chip *chip, - int cs) -{ - return; -} - -static int bcm47xxnflash_ops_bcm4706_dev_ready(struct nand_chip *nand_chip) -{ - struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); - - return !!(bcma_cc_read32(b47n->cc, BCMA_CC_NFLASH_CTL) & NCTL_READY); -} - -/* - * Default nand_command and nand_command_lp don't match BCM4706 hardware layout. - * For example, reading chip id is performed in a non-standard way. - * Setting column and page is also handled differently, we use a special - * registers of ChipCommon core. Hacking cmd_ctrl to understand and convert - * standard commands would be much more complicated. - */ -static void bcm47xxnflash_ops_bcm4706_cmdfunc(struct nand_chip *nand_chip, - unsigned command, int column, - int page_addr) -{ - struct mtd_info *mtd = nand_to_mtd(nand_chip); - struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); - struct bcma_drv_cc *cc = b47n->cc; - u32 ctlcode; - int i; - - if (column != -1) - b47n->curr_column = column; - if (page_addr != -1) - b47n->curr_page_addr = page_addr; - - switch (command) { - case NAND_CMD_RESET: - nand_chip->legacy.cmd_ctrl(nand_chip, command, NAND_CTRL_CLE); - - ndelay(100); - nand_wait_ready(nand_chip); - break; - case NAND_CMD_READID: - ctlcode = NCTL_CSA | NCTL_SPECADDR | NCTL_CMD1W | NCTL_CMD0; - ctlcode |= NAND_CMD_READID; - if (bcm47xxnflash_ops_bcm4706_ctl_cmd(b47n->cc, ctlcode)) { - pr_err("READID error\n"); - break; - } - - /* - * Reading is specific, last one has to go without NCTL_CSA - * bit. We don't know how many reads NAND subsystem is going - * to perform, so cache everything. - */ - for (i = 0; i < ARRAY_SIZE(b47n->id_data); i++) { - ctlcode = NCTL_CSA | NCTL_READ | NCTL_DATA_CYCLES(1); - if (i == ARRAY_SIZE(b47n->id_data) - 1) - ctlcode &= ~NCTL_CSA; - if (bcm47xxnflash_ops_bcm4706_ctl_cmd(b47n->cc, - ctlcode)) { - pr_err("READID error\n"); - break; - } - b47n->id_data[i] = - bcma_cc_read32(b47n->cc, BCMA_CC_NFLASH_DATA) - & 0xFF; - } - - break; - case NAND_CMD_STATUS: - ctlcode = NCTL_CSA | NCTL_CMD0 | NAND_CMD_STATUS; - if (bcm47xxnflash_ops_bcm4706_ctl_cmd(cc, ctlcode)) - pr_err("STATUS command error\n"); - break; - case NAND_CMD_READ0: - break; - case NAND_CMD_READOOB: - if (page_addr != -1) - b47n->curr_column += mtd->writesize; - break; - case NAND_CMD_ERASE1: - bcma_cc_write32(cc, BCMA_CC_NFLASH_ROW_ADDR, - b47n->curr_page_addr); - ctlcode = NCTL_ROW | NCTL_CMD1W | NCTL_CMD0 | - NAND_CMD_ERASE1 | (NAND_CMD_ERASE2 << 8); - if (bcm47xxnflash_ops_bcm4706_ctl_cmd(cc, ctlcode)) - pr_err("ERASE1 failed\n"); - break; - case NAND_CMD_ERASE2: - break; - case NAND_CMD_SEQIN: - /* Set page and column */ - bcma_cc_write32(cc, BCMA_CC_NFLASH_COL_ADDR, - b47n->curr_column); - bcma_cc_write32(cc, BCMA_CC_NFLASH_ROW_ADDR, - b47n->curr_page_addr); - - /* Prepare to write */ - ctlcode = NCTL_CSA | NCTL_ROW | NCTL_COL | NCTL_CMD0; - ctlcode |= NAND_CMD_SEQIN; - if (bcm47xxnflash_ops_bcm4706_ctl_cmd(cc, ctlcode)) - pr_err("SEQIN failed\n"); - break; - case NAND_CMD_PAGEPROG: - if (bcm47xxnflash_ops_bcm4706_ctl_cmd(cc, NCTL_CMD0 | - NAND_CMD_PAGEPROG)) - pr_err("PAGEPROG failed\n"); - if (bcm47xxnflash_ops_bcm4706_poll(cc)) - pr_err("PAGEPROG not ready\n"); - break; - default: - pr_err("Command 0x%X unsupported\n", command); - break; - } - b47n->curr_command = command; -} - -static u8 bcm47xxnflash_ops_bcm4706_read_byte(struct nand_chip *nand_chip) -{ - struct mtd_info *mtd = nand_to_mtd(nand_chip); - struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); - struct bcma_drv_cc *cc = b47n->cc; - u32 tmp = 0; - - switch (b47n->curr_command) { - case NAND_CMD_READID: - if (b47n->curr_column >= ARRAY_SIZE(b47n->id_data)) { - pr_err("Requested invalid id_data: %d\n", - b47n->curr_column); - return 0; - } - return b47n->id_data[b47n->curr_column++]; - case NAND_CMD_STATUS: - if (bcm47xxnflash_ops_bcm4706_ctl_cmd(cc, - NCTL_READ | - NCTL_DATA_CYCLES(1))) - return 0; - return bcma_cc_read32(cc, BCMA_CC_NFLASH_DATA) & 0xff; - case NAND_CMD_READOOB: - bcm47xxnflash_ops_bcm4706_read(mtd, (u8 *)&tmp, 4); - return tmp & 0xFF; - } - - pr_err("Invalid command for byte read: 0x%X\n", b47n->curr_command); - return 0; -} - -static void bcm47xxnflash_ops_bcm4706_read_buf(struct nand_chip *nand_chip, - uint8_t *buf, int len) -{ - struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); - - switch (b47n->curr_command) { - case NAND_CMD_READ0: - case NAND_CMD_READOOB: - bcm47xxnflash_ops_bcm4706_read(nand_to_mtd(nand_chip), buf, - len); - return; - } - - pr_err("Invalid command for buf read: 0x%X\n", b47n->curr_command); -} - -static void bcm47xxnflash_ops_bcm4706_write_buf(struct nand_chip *nand_chip, - const uint8_t *buf, int len) -{ - struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); - - switch (b47n->curr_command) { - case NAND_CMD_SEQIN: - bcm47xxnflash_ops_bcm4706_write(nand_to_mtd(nand_chip), buf, - len); - return; - } - - pr_err("Invalid command for buf write: 0x%X\n", b47n->curr_command); -} - static int bcm47xxnflash_ops_bcm4706_exec_cmd_addr(struct nand_chip *chip, const struct nand_subop *subop) @@ -535,7 +232,6 @@ static const struct nand_controller_ops bcm47xxnflash_ops = { int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n) { - struct nand_chip *nand_chip = (struct nand_chip *)&b47n->nand_chip; int err; u32 freq; u16 clock; @@ -548,17 +244,6 @@ int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n) nand_controller_init(&b47n->base); b47n->base.ops = &bcm47xxnflash_ops; b47n->nand_chip.controller = &b47n->base; - nand_chip->legacy.select_chip = bcm47xxnflash_ops_bcm4706_select_chip; - nand_chip->legacy.cmd_ctrl = bcm47xxnflash_ops_bcm4706_cmd_ctrl; - nand_chip->legacy.dev_ready = bcm47xxnflash_ops_bcm4706_dev_ready; - b47n->nand_chip.legacy.cmdfunc = bcm47xxnflash_ops_bcm4706_cmdfunc; - b47n->nand_chip.legacy.read_byte = bcm47xxnflash_ops_bcm4706_read_byte; - b47n->nand_chip.legacy.read_buf = bcm47xxnflash_ops_bcm4706_read_buf; - b47n->nand_chip.legacy.write_buf = bcm47xxnflash_ops_bcm4706_write_buf; - b47n->nand_chip.legacy.set_features = nand_get_set_features_notsupp; - b47n->nand_chip.legacy.get_features = nand_get_set_features_notsupp; - - nand_chip->legacy.chip_delay = 50; b47n->nand_chip.bbt_options = NAND_BBT_USE_FLASH; b47n->nand_chip.ecc.mode = NAND_ECC_NONE; /* TODO: implement ECC */ From patchwork Sun Apr 19 12:51:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Brezillon X-Patchwork-Id: 1272879 X-Patchwork-Delegate: miquel.raynal@bootlin.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=JdPYKfAn; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 494qbT5bhyz9s71 for ; Sun, 19 Apr 2020 22:56:53 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc: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:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ckQF5+THkTvGS1KIeuMokmNleBQaWE8t8GrpjTJ4fqU=; b=JdPYKfAngb2FIK lYUK8fOzGrDSnT+r4Y7C+/Z7v9F67X1KLd9lA3N8U0IGo4uT+D75DeBYhB1Qw51kVAxD9IUxZ4L+o NUvHGJ69I7ng8xT+2J9XeqqE2Utysw0YrqLIec1Y4Kymu8qTuKOt51poghXF9vtlnrXOhukFVV1oy Bd5mp4Ut1qzeZO3YyBLS09BKEpHghiq/kRpjgXSFL1kJ4P0fBQIxVfXh16UhFR/vqyNQXCox96pXq sCOf79rXNlq0hy68vD26LVcsOL+bKWv6ejbad+mAPr6Jh2Ia4YMg1IBJsGCtXLfuP7BRN/2SkAZDF XiP0BEJAzmd2t8UP/IzA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jQ9V2-0004Vd-Hx; Sun, 19 Apr 2020 12:56:40 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jQ9QM-0005wh-Co for linux-mtd@lists.infradead.org; Sun, 19 Apr 2020 12:51:56 +0000 Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id F35252A0D8D; Sun, 19 Apr 2020 13:51:46 +0100 (BST) From: Boris Brezillon To: Miquel Raynal , linux-mtd@lists.infradead.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 7/9] mtd: rawnand: bcm47xx: Simplify the init() function Date: Sun, 19 Apr 2020 14:51:38 +0200 Message-Id: <20200419125140.1307309-8-boris.brezillon@collabora.com> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200419125140.1307309-1-boris.brezillon@collabora.com> References: <20200419125140.1307309-1-boris.brezillon@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200419_055150_638028_235FF29B X-CRM114-Status: GOOD ( 13.65 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [46.235.227.227 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh Raghavendra , Tudor Ambarus , Richard Weinberger , Boris Brezillon , Boris Brezillon , bcm-kernel-feedback-list@broadcom.com, openwrt-devel@lists.openwrt.org Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The row and column sizes are now set as part of the exec_op() procedure and adjusted to match the requested number of address cycles. No need to set them in the init() function since those values will be overwritten anyway. As for the other sanity check that was done on the chip size, I don't think it's really needed. Signed-off-by: Boris Brezillon Reviewed-by: Miquel Raynal --- .../mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c | 31 ++----------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b/drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c index 4e38b685d207..ab989de54cfc 100644 --- a/drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c +++ b/drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c @@ -237,10 +237,6 @@ int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n) u16 clock; u8 w0, w1, w2, w3, w4; - unsigned long chipsize; /* MiB */ - u8 tbits, col_bits, col_size, row_bits, row_bsize; - u32 val; - nand_controller_init(&b47n->base); b47n->base.ops = &bcm47xxnflash_ops; b47n->nand_chip.controller = &b47n->base; @@ -274,32 +270,9 @@ int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n) err = nand_scan(&b47n->nand_chip, 1); if (err) { pr_err("Could not scan NAND flash: %d\n", err); - goto exit; - } - - /* Configure FLASH */ - chipsize = nanddev_target_size(&b47n->nand_chip.base) >> 20; - tbits = ffs(chipsize); /* find first bit set */ - if (!tbits || tbits != fls(chipsize)) { - pr_err("Invalid flash size: 0x%lX\n", chipsize); - err = -ENOTSUPP; - goto exit; - } - tbits += 19; /* Broadcom increases *index* by 20, we increase *pos* */ - - col_bits = b47n->nand_chip.page_shift + 1; - col_size = (col_bits + 7) / 8; - - row_bits = tbits - col_bits + 1; - row_bsize = (row_bits + 7) / 8; - - val = CONF_ROW_BYTES(row_bsize) | CONF_COL_BYTES(col_size) | - CONF_MAGIC_BIT; - bcma_cc_write32(b47n->cc, BCMA_CC_NFLASH_CONF, val); - -exit: - if (err) bcma_cc_mask32(b47n->cc, BCMA_CC_4706_FLASHSCFG, ~BCMA_CC_4706_FLASHSCFG_NF1); + } + return err; } From patchwork Sun Apr 19 12:51:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Boris Brezillon X-Patchwork-Id: 1272875 X-Patchwork-Delegate: miquel.raynal@bootlin.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=RigRyewV; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 494qZJ22HKz9sRN for ; Sun, 19 Apr 2020 22:55:52 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc: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:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zQZo+kBxvTMXfH8jWg16pOakCJlhK93nVrD7bPFJmGo=; b=RigRyewVcAy077 NWs1rikvcLCOlKMzeh3Mdf30dMf/G+zBYL6QTZnWAMJNW2LYmj1u//5INWzB1CxONuseACaF3wBHw YDbZa3z6kUILWDjdTWg5PZBMCMjHoUt1Ze+7k+bT34n/SrM8erXcxr21jTrPf09Q7fWtVZeFZIh1g LQddqjiJeUEMVf8+OELGtpnH9vuO/eyzg4Ib7h3uujf3cg3AChrAF10/9J33s5p59xAL9/OicSjpo eU2Th8KEuq5TItej9VCOcnE5b7hmTSnlv5DlTseLJ82LSKbMK6VNKV8vBnsV8a2+5QTaGUtzFUvtV +/0+Uy9w1IW6l9zxkhcg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jQ9UD-0003n6-5T; Sun, 19 Apr 2020 12:55:49 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jQ9QM-0005wg-CV for linux-mtd@lists.infradead.org; Sun, 19 Apr 2020 12:51:56 +0000 Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 55A312A0D8E; Sun, 19 Apr 2020 13:51:47 +0100 (BST) From: Boris Brezillon To: Miquel Raynal , linux-mtd@lists.infradead.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 8/9] mtd: rawnand: bcm47xx: Merge all source files Date: Sun, 19 Apr 2020 14:51:39 +0200 Message-Id: <20200419125140.1307309-9-boris.brezillon@collabora.com> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200419125140.1307309-1-boris.brezillon@collabora.com> References: <20200419125140.1307309-1-boris.brezillon@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200419_055150_721333_6EF8C499 X-CRM114-Status: GOOD ( 17.26 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh Raghavendra , Tudor Ambarus , Richard Weinberger , Boris Brezillon , Boris Brezillon , bcm-kernel-feedback-list@broadcom.com, openwrt-devel@lists.openwrt.org Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Given the number of lines it doesn't make them to split the code. Let's merge everything in main.c and rename the file into bcm47xxnflash.c. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/raw/bcm47xxnflash/Makefile | 3 - .../{ops_bcm4706.c => bcm47xxnflash.c} | 81 ++++++++++++++++++- .../nand/raw/bcm47xxnflash/bcm47xxnflash.h | 21 ----- drivers/mtd/nand/raw/bcm47xxnflash/main.c | 77 ------------------ 4 files changed, 78 insertions(+), 104 deletions(-) rename drivers/mtd/nand/raw/bcm47xxnflash/{ops_bcm4706.c => bcm47xxnflash.c} (82%) delete mode 100644 drivers/mtd/nand/raw/bcm47xxnflash/bcm47xxnflash.h delete mode 100644 drivers/mtd/nand/raw/bcm47xxnflash/main.c diff --git a/drivers/mtd/nand/raw/bcm47xxnflash/Makefile b/drivers/mtd/nand/raw/bcm47xxnflash/Makefile index b531a630c9cf..71a953078799 100644 --- a/drivers/mtd/nand/raw/bcm47xxnflash/Makefile +++ b/drivers/mtd/nand/raw/bcm47xxnflash/Makefile @@ -1,5 +1,2 @@ # SPDX-License-Identifier: GPL-2.0-only -bcm47xxnflash-y += main.o -bcm47xxnflash-y += ops_bcm4706.o - obj-$(CONFIG_MTD_NAND_BCM47XXNFLASH) += bcm47xxnflash.o diff --git a/drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b/drivers/mtd/nand/raw/bcm47xxnflash/bcm47xxnflash.c similarity index 82% rename from drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c rename to drivers/mtd/nand/raw/bcm47xxnflash/bcm47xxnflash.c index ab989de54cfc..ae0391c1ee28 100644 --- a/drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c +++ b/drivers/mtd/nand/raw/bcm47xxnflash/bcm47xxnflash.c @@ -5,13 +5,14 @@ * Copyright (C) 2012 Rafał Miłecki */ -#include "bcm47xxnflash.h" - +#include #include #include #include -#include +#include #include +#include +#include /* Broadcom uses 1'000'000 but it seems to be too many. Tests on WNDR4500 has * shown ~1000 retries as maxiumum. */ @@ -48,6 +49,17 @@ #define CONF_COL_BYTES(x) (((x) - 1) << 4) #define CONF_ROW_BYTES(x) (((x) - 1) << 6) +#ifndef pr_fmt +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#endif + +struct bcm47xxnflash { + struct nand_controller base; + struct bcma_drv_cc *cc; + + struct nand_chip nand_chip; +}; + /************************************************** * Various helpers **************************************************/ @@ -276,3 +288,66 @@ int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n) return err; } + +static const char *probes[] = { "bcm47xxpart", NULL }; + +static int bcm47xxnflash_probe(struct platform_device *pdev) +{ + struct bcma_nflash *nflash = dev_get_platdata(&pdev->dev); + struct bcm47xxnflash *b47n; + struct mtd_info *mtd; + int err = 0; + + b47n = devm_kzalloc(&pdev->dev, sizeof(*b47n), GFP_KERNEL); + if (!b47n) + return -ENOMEM; + + nand_set_controller_data(&b47n->nand_chip, b47n); + mtd = nand_to_mtd(&b47n->nand_chip); + mtd->dev.parent = &pdev->dev; + b47n->cc = container_of(nflash, struct bcma_drv_cc, nflash); + + if (b47n->cc->core->bus->chipinfo.id == BCMA_CHIP_ID_BCM4706) { + err = bcm47xxnflash_ops_bcm4706_init(b47n); + } else { + pr_err("Device not supported\n"); + err = -ENOTSUPP; + } + if (err) { + pr_err("Initialization failed: %d\n", err); + return err; + } + + platform_set_drvdata(pdev, b47n); + + err = mtd_device_parse_register(mtd, probes, NULL, NULL, 0); + if (err) { + pr_err("Failed to register MTD device: %d\n", err); + return err; + } + + return 0; +} + +static int bcm47xxnflash_remove(struct platform_device *pdev) +{ + struct bcm47xxnflash *nflash = platform_get_drvdata(pdev); + + nand_release(&nflash->nand_chip); + + return 0; +} + +static struct platform_driver bcm47xxnflash_driver = { + .probe = bcm47xxnflash_probe, + .remove = bcm47xxnflash_remove, + .driver = { + .name = "bcma_nflash", + }, +}; +module_platform_driver(bcm47xxnflash_driver); + +MODULE_DESCRIPTION("NAND flash driver for BCMA bus"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Rafał Miłecki"); + diff --git a/drivers/mtd/nand/raw/bcm47xxnflash/bcm47xxnflash.h b/drivers/mtd/nand/raw/bcm47xxnflash/bcm47xxnflash.h deleted file mode 100644 index 8de0e7e0a3a4..000000000000 --- a/drivers/mtd/nand/raw/bcm47xxnflash/bcm47xxnflash.h +++ /dev/null @@ -1,21 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __BCM47XXNFLASH_H -#define __BCM47XXNFLASH_H - -#ifndef pr_fmt -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -#endif - -#include -#include - -struct bcm47xxnflash { - struct nand_controller base; - struct bcma_drv_cc *cc; - - struct nand_chip nand_chip; -}; - -int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n); - -#endif /* BCM47XXNFLASH */ diff --git a/drivers/mtd/nand/raw/bcm47xxnflash/main.c b/drivers/mtd/nand/raw/bcm47xxnflash/main.c deleted file mode 100644 index 8dae97c1dbe7..000000000000 --- a/drivers/mtd/nand/raw/bcm47xxnflash/main.c +++ /dev/null @@ -1,77 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * BCM47XX NAND flash driver - * - * Copyright (C) 2012 Rafał Miłecki - */ - -#include "bcm47xxnflash.h" - -#include -#include -#include -#include -#include - -MODULE_DESCRIPTION("NAND flash driver for BCMA bus"); -MODULE_LICENSE("GPL"); -MODULE_AUTHOR("Rafał Miłecki"); - -static const char *probes[] = { "bcm47xxpart", NULL }; - -static int bcm47xxnflash_probe(struct platform_device *pdev) -{ - struct bcma_nflash *nflash = dev_get_platdata(&pdev->dev); - struct bcm47xxnflash *b47n; - struct mtd_info *mtd; - int err = 0; - - b47n = devm_kzalloc(&pdev->dev, sizeof(*b47n), GFP_KERNEL); - if (!b47n) - return -ENOMEM; - - nand_set_controller_data(&b47n->nand_chip, b47n); - mtd = nand_to_mtd(&b47n->nand_chip); - mtd->dev.parent = &pdev->dev; - b47n->cc = container_of(nflash, struct bcma_drv_cc, nflash); - - if (b47n->cc->core->bus->chipinfo.id == BCMA_CHIP_ID_BCM4706) { - err = bcm47xxnflash_ops_bcm4706_init(b47n); - } else { - pr_err("Device not supported\n"); - err = -ENOTSUPP; - } - if (err) { - pr_err("Initialization failed: %d\n", err); - return err; - } - - platform_set_drvdata(pdev, b47n); - - err = mtd_device_parse_register(mtd, probes, NULL, NULL, 0); - if (err) { - pr_err("Failed to register MTD device: %d\n", err); - return err; - } - - return 0; -} - -static int bcm47xxnflash_remove(struct platform_device *pdev) -{ - struct bcm47xxnflash *nflash = platform_get_drvdata(pdev); - - nand_release(&nflash->nand_chip); - - return 0; -} - -static struct platform_driver bcm47xxnflash_driver = { - .probe = bcm47xxnflash_probe, - .remove = bcm47xxnflash_remove, - .driver = { - .name = "bcma_nflash", - }, -}; - -module_platform_driver(bcm47xxnflash_driver); From patchwork Sun Apr 19 12:51:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Brezillon X-Patchwork-Id: 1272871 X-Patchwork-Delegate: miquel.raynal@bootlin.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=XJMcDdlP; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 494qXs5yT0z9s71 for ; Sun, 19 Apr 2020 22:54:37 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc: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:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=x3uusd+PDXEWUCCXN5DixywuBpDJdaHBKLgLK5R+n5s=; b=XJMcDdlP/mTtNW 2mL0cUwMQyB42CGdeMWKVFwZrK/zmfWB5oAtI5872qi+9D7VYkJJM/ayLKie4FZE0/9B1NYn1plKR A5e4WYjMYJYJYotoNHsGD4y0b5t8/pK+kywSRAXl591CoSomM4QKXlWFZyh3QHzYUw77biYsz7xpN 8ZRrcvf4kfZh2+i96E75Q2K+X1gffmP8bYmmAaPgJ1aRBThd7e1euux4uHT9q5v96JcNTDQXnaiJ3 98X8CXCbQyWA2z53AqAEWxj5zllZ0IX+1hlwcvRcDQkAwmvLfGHEkxQhwjO0FA4YC+EJKp8OXRwon ObpA4jcraBgHXVpOLwow==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jQ9T1-0000LX-4K; Sun, 19 Apr 2020 12:54:35 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jQ9QM-0005wi-CU for linux-mtd@lists.infradead.org; Sun, 19 Apr 2020 12:51:54 +0000 Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id B9EDB2A0D95; Sun, 19 Apr 2020 13:51:47 +0100 (BST) From: Boris Brezillon To: Miquel Raynal , linux-mtd@lists.infradead.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 9/9] mtd: rawnand: bcm47xx: Move the driver to drivers/mtd/nand/raw/ Date: Sun, 19 Apr 2020 14:51:40 +0200 Message-Id: <20200419125140.1307309-10-boris.brezillon@collabora.com> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200419125140.1307309-1-boris.brezillon@collabora.com> References: <20200419125140.1307309-1-boris.brezillon@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200419_055150_584496_FCEDF797 X-CRM114-Status: GOOD ( 11.89 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [46.235.227.227 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh Raghavendra , Tudor Ambarus , Richard Weinberger , Boris Brezillon , Boris Brezillon , bcm-kernel-feedback-list@broadcom.com, openwrt-devel@lists.openwrt.org Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Now that we have a single we can move it to the directory where all single source file drivers live. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/raw/Makefile | 1 + drivers/mtd/nand/raw/{bcm47xxnflash => }/bcm47xxnflash.c | 0 drivers/mtd/nand/raw/bcm47xxnflash/Makefile | 2 -- 3 files changed, 1 insertion(+), 2 deletions(-) rename drivers/mtd/nand/raw/{bcm47xxnflash => }/bcm47xxnflash.c (100%) delete mode 100644 drivers/mtd/nand/raw/bcm47xxnflash/Makefile diff --git a/drivers/mtd/nand/raw/Makefile b/drivers/mtd/nand/raw/Makefile index 2d136b158fb7..703d696c2d61 100644 --- a/drivers/mtd/nand/raw/Makefile +++ b/drivers/mtd/nand/raw/Makefile @@ -58,6 +58,7 @@ obj-$(CONFIG_MTD_NAND_TEGRA) += tegra_nand.o obj-$(CONFIG_MTD_NAND_STM32_FMC2) += stm32_fmc2_nand.o obj-$(CONFIG_MTD_NAND_MESON) += meson_nand.o obj-$(CONFIG_MTD_NAND_CADENCE) += cadence-nand-controller.o +obj-$(CONFIG_MTD_NAND_BCM47XXNFLASH) += bcm47xxnflash.o nand-objs := nand_base.o nand_legacy.o nand_bbt.o nand_timings.o nand_ids.o nand-objs += nand_onfi.o diff --git a/drivers/mtd/nand/raw/bcm47xxnflash/bcm47xxnflash.c b/drivers/mtd/nand/raw/bcm47xxnflash.c similarity index 100% rename from drivers/mtd/nand/raw/bcm47xxnflash/bcm47xxnflash.c rename to drivers/mtd/nand/raw/bcm47xxnflash.c diff --git a/drivers/mtd/nand/raw/bcm47xxnflash/Makefile b/drivers/mtd/nand/raw/bcm47xxnflash/Makefile deleted file mode 100644 index 71a953078799..000000000000 --- a/drivers/mtd/nand/raw/bcm47xxnflash/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only -obj-$(CONFIG_MTD_NAND_BCM47XXNFLASH) += bcm47xxnflash.o