From: Takahiro Kuwano <tkuw584924@gmail.com>
To: Tudor Ambarus <tudor.ambarus@linaro.org>,
takahiro.kuwano@infineon.com, michael@walle.cc
Cc: pratyush@kernel.org, linux-mtd@lists.infradead.org,
linux-kernel@vger.kernel.org, bacem.daassi@infineon.com,
miquel.raynal@bootlin.com, richard@nod.at
Subject: Re: [PATCH v4 10/11] mtd: spi-nor: spansion: switch s25hx_t to use vreg_offset for quad_enable()
Date: Wed, 26 Jul 2023 18:36:31 +0900 [thread overview]
Message-ID: <16f29fd8-ae31-bb93-3ccf-e722faf033ba@gmail.com> (raw)
In-Reply-To: <20230726075257.12985-11-tudor.ambarus@linaro.org>
On 7/26/2023 4:52 PM, Tudor Ambarus wrote:
> All s25hx_t flashes have single or multi chip flavors and already use
> n_dice and vreg_offset in cypress_nor_sr_ready_and_clear. Switch s25hx_t
> to always use vreg_offset for the quad_enable() method, so that we use
> the same code base for both single and multi chip package flashes.
>
> Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> ---
> drivers/mtd/spi-nor/spansion.c | 18 +++++++-----------
> 1 file changed, 7 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/mtd/spi-nor/spansion.c b/drivers/mtd/spi-nor/spansion.c
> index 30a3ffbfa381..6abef5b515a1 100644
> --- a/drivers/mtd/spi-nor/spansion.c
> +++ b/drivers/mtd/spi-nor/spansion.c
> @@ -24,8 +24,6 @@
> #define SPINOR_REG_CYPRESS_STR1V \
> (SPINOR_REG_CYPRESS_VREG + SPINOR_REG_CYPRESS_STR1)
> #define SPINOR_REG_CYPRESS_CFR1 0x2
> -#define SPINOR_REG_CYPRESS_CFR1V \
> - (SPINOR_REG_CYPRESS_VREG + SPINOR_REG_CYPRESS_CFR1)
> #define SPINOR_REG_CYPRESS_CFR1_QUAD_EN BIT(1) /* Quad Enable */
> #define SPINOR_REG_CYPRESS_CFR2 0x3
> #define SPINOR_REG_CYPRESS_CFR2V \
> @@ -348,10 +346,6 @@ static int cypress_nor_quad_enable_volatile(struct spi_nor *nor)
> u8 i;
> int ret;
>
> - if (!params->n_dice)
> - return cypress_nor_quad_enable_volatile_reg(nor,
> - SPINOR_REG_CYPRESS_CFR1V);
> -
> for (i = 0; i < params->n_dice; i++) {
> addr = params->vreg_offset[i] + SPINOR_REG_CYPRESS_CFR1;
> ret = cypress_nor_quad_enable_volatile_reg(nor, addr);
> @@ -657,15 +651,17 @@ static int s25hx_t_late_init(struct spi_nor *nor)
> {
> struct spi_nor_flash_parameter *params = nor->params;
>
> + if (!params->n_dice || !params->vreg_offset) {
> + dev_err(nor->dev, "%s failed. The volatile register offset could not be retrieved from SFDP.\n",
> + __func__);
> + return -EOPNOTSUPP;
> + }
> +
> /* Fast Read 4B requires mode cycles */
> params->reads[SNOR_CMD_READ_FAST].num_mode_clocks = 8;
> -
> + params->ready = cypress_nor_sr_ready_and_clear;
> cypress_nor_ecc_init(nor);
>
> - /* Replace ready() with multi die version */
> - if (params->n_dice)
> - params->ready = cypress_nor_sr_ready_and_clear;
> -
> return 0;
> }
>
Tested-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
next prev parent reply other threads:[~2023-07-26 9:37 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-26 7:52 [PATCH v4 00/11] mtd: spi-nor: spansion: Add support for Infineon S28HS02GT Tudor Ambarus
2023-07-26 7:52 ` [PATCH v4 01/11] mtd: spi-nor: spansion: use CLPEF as an alternative to CLSR Tudor Ambarus
2023-07-26 7:52 ` [PATCH v4 02/11] mtd: spi-nor: spansion: preserve CFR2V[7] when writing MEMLAT Tudor Ambarus
2023-07-26 7:52 ` [PATCH v4 03/11] mtd: spi-nor: spansion: prepare octal dtr methods for multi chip support Tudor Ambarus
2023-07-26 7:52 ` [PATCH v4 04/11] mtd: spi-nor: spansion: switch set_octal_dtr method to use vreg_offset Tudor Ambarus
2023-07-26 7:52 ` [PATCH v4 05/11] mtd: spi-nor: spansion: switch h28hx's ready() " Tudor Ambarus
2023-07-26 7:52 ` [PATCH v4 06/11] mtd: spi-nor: spansion: add MCP support in set_octal_dtr() Tudor Ambarus
2023-07-26 7:52 ` [PATCH v4 07/11] mtd: spi-nor: spansion: add octal DTR support in RD_ANY_REG_OP Tudor Ambarus
2023-07-26 7:52 ` [PATCH v4 08/11] mtd: spi-nor: spansion: add support for S28HS02GT Tudor Ambarus
2023-07-26 7:52 ` [PATCH v4 09/11] mtd: spi-nor: spansion: let SFDP determine the flash and sector size Tudor Ambarus
2023-07-26 9:37 ` Takahiro Kuwano
2023-07-26 7:52 ` [PATCH v4 10/11] mtd: spi-nor: spansion: switch s25hx_t to use vreg_offset for quad_enable() Tudor Ambarus
2023-07-26 9:36 ` Takahiro Kuwano [this message]
2023-07-26 7:52 ` [PATCH v4 11/11] mtd: spi-nor: spansion: switch cypress_nor_get_page_size() to use vreg_offset Tudor Ambarus
2023-07-26 9:34 ` Takahiro Kuwano
2023-07-26 9:41 ` [PATCH v4 00/11] mtd: spi-nor: spansion: Add support for Infineon S28HS02GT Tudor Ambarus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16f29fd8-ae31-bb93-3ccf-e722faf033ba@gmail.com \
--to=tkuw584924@gmail.com \
--cc=bacem.daassi@infineon.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=michael@walle.cc \
--cc=miquel.raynal@bootlin.com \
--cc=pratyush@kernel.org \
--cc=richard@nod.at \
--cc=takahiro.kuwano@infineon.com \
--cc=tudor.ambarus@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox