[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <494daaab-a93c-44cd-a437-d306a8269251@linaro.org>
Date: Mon, 22 Apr 2024 06:59:56 +0100
From: Tudor Ambarus <tudor.ambarus@...aro.org>
To: Michael Walle <mwalle@...nel.org>, Pratyush Yadav <pratyush@...nel.org>,
Miquel Raynal <miquel.raynal@...tlin.com>,
Richard Weinberger <richard@....at>, Vignesh Raghavendra <vigneshr@...com>
Cc: Ricardo Ribalda <ribalda@...nel.org>, linux-kernel@...r.kernel.org,
linux-mtd@...ts.infradead.org
Subject: Re: [PATCH v2 4/6] mtd: spi-nor: get rid of SPI_NOR_NO_FR
On 4/19/24 15:12, Michael Walle wrote:
> The evervision FRAM devices are the only user of the NO_FR flag. Dro
everspin is evervision?
> the global flag and instead use a manufacturer fixup for the evervision
> flashes to drop the fast read support.
>
> Signed-off-by: Michael Walle <mwalle@...nel.org>
> ---
> Please note, that the fast read opcode will still be set in
> spi_nor_init_default_params(), but the selection of the read opcodes
> just depends on the mask.
>
> That is also something I want to fix soon: the opcodes can always
> be set and the drivers/SFDP will only set the mask. Opcodes then can be
> switched between 3b and 4b ones if necessary.
> ---
> drivers/mtd/spi-nor/core.c | 9 ++-------
> drivers/mtd/spi-nor/core.h | 2 --
> drivers/mtd/spi-nor/everspin.c | 19 +++++++++++++++----
> 3 files changed, 17 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
> index f4c0b5185818..4e2ae6642d4c 100644
> --- a/drivers/mtd/spi-nor/core.c
> +++ b/drivers/mtd/spi-nor/core.c
> @@ -2923,15 +2923,10 @@ static void spi_nor_init_default_params(struct spi_nor *nor)
> params->page_size = info->page_size ?: SPI_NOR_DEFAULT_PAGE_SIZE;
> params->n_banks = info->n_banks ?: SPI_NOR_DEFAULT_N_BANKS;
>
> - if (!(info->flags & SPI_NOR_NO_FR)) {
> - /* Default to Fast Read for DT and non-DT platform devices. */
> + /* Default to Fast Read for non-DT and enable it if requested by DT. */
> + if (!np || of_property_read_bool(np, "m25p,fast-read"))
> params->hwcaps.mask |= SNOR_HWCAPS_READ_FAST;
>
> - /* Mask out Fast Read if not requested at DT instantiation. */
> - if (np && !of_property_read_bool(np, "m25p,fast-read"))
> - params->hwcaps.mask &= ~SNOR_HWCAPS_READ_FAST;
> - }
> -
You could do this in a dedicated patch, but I'm fine either way.
Reviewed-by: Tudor Ambarus <tudor.ambarus@...aro.org>
Powered by blists - more mailing lists