Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7419AC433F5 for ; Fri, 17 Sep 2021 16:51:33 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 788C361108 for ; Fri, 17 Sep 2021 16:51:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 788C361108 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D8DC183208; Fri, 17 Sep 2021 18:51:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="MmSjHQ1T"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4A0D183224; Fri, 17 Sep 2021 18:51:27 +0200 (CEST) Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 038CE83202 for ; Fri, 17 Sep 2021 18:51:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=p.yadav@ti.com Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 18HGpI1n099925; Fri, 17 Sep 2021 11:51:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1631897478; bh=6WRqI4UCKtaeK1kaJttJFHvtcsR47WzWJfm7EgIYQiY=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=MmSjHQ1Td+436Cqzk8UCHF1OKxUdi1dZqLqVMux49ihpmyi10jD9CB8Zxt8TQ9/dR QuapHliZnmcubcMq2G1YuVkGII+7DN6NPQxvh/P4dEUxCFGuRYqc6+PrgLUoTtqta0 Hi6SFLstD9wSYVbbNeKQy7LJedVYyRKa2IY/NxkA= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 18HGpHH0064379 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 17 Sep 2021 11:51:18 -0500 Received: from DFLE101.ent.ti.com (10.64.6.22) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Fri, 17 Sep 2021 11:51:17 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Fri, 17 Sep 2021 11:51:17 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 18HGpGUH030858; Fri, 17 Sep 2021 11:51:17 -0500 Date: Fri, 17 Sep 2021 22:21:16 +0530 From: Pratyush Yadav To: CC: , , , , Takahiro Kuwano Subject: Re: [PATCH 2/2] mtd: spi-nor-core: Add fixups for Spansion S25FL256L Message-ID: <20210917165114.uikwq65qrypidfug@ti.com> References: <518a2f98449bc956e0e3d6b19ff60b18b08d973a.1631088494.git.Takahiro.Kuwano@infineon.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <518a2f98449bc956e0e3d6b19ff60b18b08d973a.1631088494.git.Takahiro.Kuwano@infineon.com> User-Agent: NeoMutt/20171215 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On 08/09/21 05:47PM, tkuw584924@gmail.com wrote: > From: Takahiro Kuwano > > The S25FL256L is 32MB NOR Flash that does not support Bank Address > Register. This fixup is activated if CONFIG_SPI_FLASH_BAR is enabled and > returns ENOTSUPP in setup() hook to avoid further ops. > > Signed-off-by: Takahiro Kuwano > --- > drivers/mtd/spi/spi-nor-core.c | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > > diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c > index d5d905fa5a..4940b35682 100644 > --- a/drivers/mtd/spi/spi-nor-core.c > +++ b/drivers/mtd/spi/spi-nor-core.c > @@ -3222,6 +3222,23 @@ static struct spi_nor_fixups s25hx_t_fixups = { > .post_bfpt = s25hx_t_post_bfpt_fixup, > .post_sfdp = s25hx_t_post_sfdp_fixup, > }; > + > +#ifdef CONFIG_SPI_FLASH_BAR > +static int s25fl256l_setup(struct spi_nor *nor, const struct flash_info *info, > + const struct spi_nor_flash_parameter *params) > +{ > + return -ENOTSUPP; /* Bank Address Register is not supported */ I am not very familiar with BAR. Can you please explain what would happen if we don't do this? > +} > + > +static void s25fl256l_default_init(struct spi_nor *nor) > +{ > + nor->setup = s25fl256l_setup; > +} > + > +static struct spi_nor_fixups s25fl256l_fixups = { > + .default_init = s25fl256l_default_init, > +}; > +#endif > #endif > > #ifdef CONFIG_SPI_FLASH_S28HS512T > @@ -3644,6 +3661,10 @@ void spi_nor_set_fixups(struct spi_nor *nor) > break; > } > } > +#ifdef CONFIG_SPI_FLASH_BAR We should avoid using #ifdef as much as possible. Change this to if (CONFIG_IS_ENABLED(SPI_FLASH_BAR) && !strcmp()) > + if (!strcmp(nor->info->name, "s25fl256l")) > + nor->fixups = &s25fl256l_fixups; > +#endif *sigh* we really need to find a better way to specify fixups. Let me see if I can figure something out. In the meantime, this should be fine. > #endif > > #ifdef CONFIG_SPI_FLASH_S28HS512T > -- > 2.25.1 > -- Regards, Pratyush Yadav Texas Instruments Inc.