Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751997AbdGESPH (ORCPT ); Wed, 5 Jul 2017 14:15:07 -0400 Received: from mail-qk0-f196.google.com ([209.85.220.196]:35898 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751659AbdGESPF (ORCPT ); Wed, 5 Jul 2017 14:15:05 -0400 Subject: Re: [PATCH] brcmnand: Fix up the flash cache register offset for older controllers To: Karl Beldan , linux-mtd@lists.infradead.org Cc: bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org, Brian Norris , Kamal Dasu , Boris Brezillon , Richard Weinberger , David Woodhouse , Marek Vasut , Cyrille Pitchen , Karl Beldan References: <20170705174653.21797-1-karl.beldan+oss@gmail.com> From: Florian Fainelli Message-ID: <7f7804da-e431-f197-31b9-c98359b9151a@gmail.com> Date: Wed, 5 Jul 2017 11:15:01 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170705174653.21797-1-karl.beldan+oss@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2110 Lines: 59 On 07/05/2017 10:46 AM, Karl Beldan wrote: > From: Karl Beldan > > Tested on BCM{63138,6838,63268} and cross checked with the various > *_map_part.h which the brcmnand_regs_v* in brcmnand.c have historically > been derived from. BCM63138 is using a 7.0 controller, 6838 uses a 5.0 controller, but has a separate flash cache register which does indeed end up at 0x400 bytes off the main FLASH block, and finally 63268 does have a v4.0 controller and the flash cache is also in a separate register that makes it end up at 0x400. Your change, as proposed would break chips like 7425 which use 5.0 controller with the flash cache at 0x200 bytes. The binding describes an optional flash-cache register cell that you can specify, so that's probably what you want to do here? > > Cc: Brian Norris > Cc: Kamal Dasu > Cc: Boris Brezillon > Cc: Richard Weinberger > Cc: David Woodhouse > Cc: Marek Vasut > Cc: Cyrille Pitchen > Signed-off-by: Karl Beldan > --- > drivers/mtd/nand/brcmnand/brcmnand.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/mtd/nand/brcmnand/brcmnand.c b/drivers/mtd/nand/brcmnand/brcmnand.c > index 7419c5c..e6371ff6 100644 > --- a/drivers/mtd/nand/brcmnand/brcmnand.c > +++ b/drivers/mtd/nand/brcmnand/brcmnand.c > @@ -250,7 +250,7 @@ static const u16 brcmnand_regs_v40[] = { > [BRCMNAND_OOB_READ_10_BASE] = 0x130, > [BRCMNAND_OOB_WRITE_BASE] = 0x30, > [BRCMNAND_OOB_WRITE_10_BASE] = 0, > - [BRCMNAND_FC_BASE] = 0x200, > + [BRCMNAND_FC_BASE] = 0x400, > }; > > /* BRCMNAND v5.0 */ > @@ -280,7 +280,7 @@ static const u16 brcmnand_regs_v50[] = { > [BRCMNAND_OOB_READ_10_BASE] = 0x130, > [BRCMNAND_OOB_WRITE_BASE] = 0x30, > [BRCMNAND_OOB_WRITE_10_BASE] = 0x140, > - [BRCMNAND_FC_BASE] = 0x200, > + [BRCMNAND_FC_BASE] = 0x400, > }; > > /* BRCMNAND v6.0 - v7.1 */ > -- Florian