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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 219D7C38142 for ; Mon, 23 Jan 2023 07:43:59 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0F7A4856F7; Mon, 23 Jan 2023 08:43:58 +0100 (CET) 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="L9IraGU2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6CBED856F9; Mon, 23 Jan 2023 08:43:56 +0100 (CET) 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 8B37D856F5 for ; Mon, 23 Jan 2023 08:43:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=d-gole@ti.com Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 30N7hgrR015908; Mon, 23 Jan 2023 01:43:42 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1674459822; bh=Hl2g4pseB6PCMwEPhetpYa0A9oY+iURwfbNe20mHY5g=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=L9IraGU2U+fAxTlfZV1lcl8gB+LLMxEb6x4br5XhQf4vqNpfQ77zpBTR5j9PeHy/M dJxRGw2SuwkhEmIxV02hhLcLK0kIi73d8uUVH+/xwZEUUqGKZgEz4vqL18ReVV/kTu vEMCSWXtY4HJNXnPSvqnQWlIFmZS4TUoqH6c7JaU= Received: from DFLE110.ent.ti.com (dfle110.ent.ti.com [10.64.6.31]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 30N7hgjV052813 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 23 Jan 2023 01:43:42 -0600 Received: from DFLE110.ent.ti.com (10.64.6.31) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Mon, 23 Jan 2023 01:43:42 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Mon, 23 Jan 2023 01:43:42 -0600 Received: from [10.250.234.171] (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 30N7hbWc106811; Mon, 23 Jan 2023 01:43:38 -0600 Message-ID: <5b5fd898-2b93-f8cc-ffa2-535fb4e6cb3d@ti.com> Date: Mon, 23 Jan 2023 13:13:37 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v2 2/2] mtd: spi-nor-core: Make CFRx reg fields generic Content-Language: en-US To: , CC: , , , , , Takahiro Kuwano References: <0d682dac20c031767aa9187357ed477b905c86fc.1674182603.git.Takahiro.Kuwano@infineon.com> From: Dhruva Gole In-Reply-To: <0d682dac20c031767aa9187357ed477b905c86fc.1674182603.git.Takahiro.Kuwano@infineon.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean On 20/01/23 08:58, tkuw584924@gmail.com wrote: > From: Takahiro Kuwano > > Cypress defines two flavors of configuration registers, volatile and > non volatile, and both use the same bit fields. Rename the bitfields in > the configuration registers so that they can be used for both flavors. > > Suggested-by: Tudor Ambarus > Signed-off-by: Takahiro Kuwano > --- Reviewed-by: Dhruva Gole > drivers/mtd/spi/spi-nor-core.c | 8 ++++---- > include/linux/mtd/spi-nor.h | 8 ++++---- > 2 files changed, 8 insertions(+), 8 deletions(-) > > diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c > index 1ea8363d9f89..a3198253ca63 100644 > --- a/drivers/mtd/spi/spi-nor-core.c > +++ b/drivers/mtd/spi/spi-nor-core.c > @@ -3373,7 +3373,7 @@ static int spi_nor_cypress_octal_dtr_enable(struct spi_nor *nor) > if (ret) > return ret; > > - buf = SPINOR_REG_CYPRESS_CFR2V_MEMLAT_11_24; > + buf = SPINOR_REG_CYPRESS_CFR2_MEMLAT_11_24; > op = (struct spi_mem_op)SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_WR_ANY_REG, 1), > SPI_MEM_OP_ADDR(addr_width, SPINOR_REG_CYPRESS_CFR2V, 1), > SPI_MEM_OP_NO_DUMMY, > @@ -3396,7 +3396,7 @@ static int spi_nor_cypress_octal_dtr_enable(struct spi_nor *nor) > if (ret) > return ret; > > - buf = SPINOR_REG_CYPRESS_CFR5V_OCT_DTR_EN; > + buf = SPINOR_REG_CYPRESS_CFR5_OCT_DTR_EN; > op = (struct spi_mem_op)SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_WR_ANY_REG, 1), > SPI_MEM_OP_ADDR(addr_width, SPINOR_REG_CYPRESS_CFR5V, 1), > SPI_MEM_OP_NO_DUMMY, > @@ -3444,7 +3444,7 @@ static int s28hx_t_setup(struct spi_nor *nor, const struct flash_info *info, > if (ret) > return ret; > > - if (!(buf & SPINOR_REG_CYPRESS_CFR3V_UNISECT)) > + if (!(buf & SPINOR_REG_CYPRESS_CFR3_UNISECT)) > nor->erase = s28hx_t_erase_non_uniform; > > return spi_nor_default_setup(nor, info, params); > @@ -3511,7 +3511,7 @@ static int s28hx_t_post_bfpt_fixup(struct spi_nor *nor, > if (ret) > return ret; > > - if (buf & SPINOR_REG_CYPRESS_CFR3V_PGSZ) > + if (buf & SPINOR_REG_CYPRESS_CFR3_PGSZ) > params->page_size = 512; > else > params->page_size = 256; > diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h > index 2fb4595fc756..605cddef4d06 100644 > --- a/include/linux/mtd/spi-nor.h > +++ b/include/linux/mtd/spi-nor.h > @@ -189,15 +189,15 @@ > #define SPINOR_OP_WR_ANY_REG 0x71 /* Write any register */ > #define SPINOR_OP_S28_SE_4K 0x21 > #define SPINOR_REG_CYPRESS_CFR2V 0x00800003 > -#define SPINOR_REG_CYPRESS_CFR2V_MEMLAT_11_24 0xb > +#define SPINOR_REG_CYPRESS_CFR2_MEMLAT_11_24 0xb > #define SPINOR_REG_CYPRESS_CFR3V 0x00800004 > -#define SPINOR_REG_CYPRESS_CFR3V_PGSZ BIT(4) /* Page size. */ > -#define SPINOR_REG_CYPRESS_CFR3V_UNISECT BIT(3) /* Uniform sector mode */ > +#define SPINOR_REG_CYPRESS_CFR3_PGSZ BIT(4) /* Page size. */ > +#define SPINOR_REG_CYPRESS_CFR3_UNISECT BIT(3) /* Uniform sector mode */ > #define SPINOR_REG_CYPRESS_CFR5V 0x00800006 > #define SPINOR_REG_CYPRESS_CFR5_BIT6 BIT(6) > #define SPINOR_REG_CYPRESS_CFR5_DDR BIT(1) > #define SPINOR_REG_CYPRESS_CFR5_OPI BIT(0) > -#define SPINOR_REG_CYPRESS_CFR5V_OCT_DTR_EN \ > +#define SPINOR_REG_CYPRESS_CFR5_OCT_DTR_EN \ > (SPINOR_REG_CYPRESS_CFR5_BIT6 | SPINOR_REG_CYPRESS_CFR5_DDR | \ > SPINOR_REG_CYPRESS_CFR5_OPI) > #define SPINOR_OP_CYPRESS_RD_FAST 0xee -- Best regards, Dhruva Gole Texas Instruments Incorporated