From: Pratyush Yadav <pratyush@kernel.org>
To: Tudor Ambarus <tudor.ambarus@linaro.org>
Cc: michael@walle.cc, pratyush@kernel.org,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
Mamta Shukla <mamta.shukla@leica-geosystems.com>
Subject: Re: [PATCH v4 2/2] mtd: spi-nor: micron-st: use SFDP table for mt25qu512a
Date: Tue, 17 Oct 2023 17:09:13 +0200 [thread overview]
Message-ID: <mafs0lec1mgkm.fsf@kernel.org> (raw)
In-Reply-To: <20231017074711.12167-2-tudor.ambarus@linaro.org> (Tudor Ambarus's message of "Tue, 17 Oct 2023 10:47:11 +0300")
On Tue, Oct 17 2023, Tudor Ambarus wrote:
> From: Mamta Shukla <mamta.shukla@leica-geosystems.com>
>
[...]
> diff --git a/drivers/mtd/spi-nor/micron-st.c b/drivers/mtd/spi-nor/micron-st.c
> index 756391c906e5..8920547c12bf 100644
> --- a/drivers/mtd/spi-nor/micron-st.c
> +++ b/drivers/mtd/spi-nor/micron-st.c
> @@ -180,6 +180,18 @@ static const struct flash_info micron_nor_parts[] = {
> },
> };
>
> +static int mt25qu512a_post_bfpt_fixup(struct spi_nor *nor,
> + const struct sfdp_parameter_header *bfpt_header,
> + const struct sfdp_bfpt *bfpt)
> +{
> + nor->flags &= ~SNOR_F_HAS_16BIT_SR;
> + return 0;
> +}
> +
> +static struct spi_nor_fixups mt25qu512a_fixups = {
> + .post_bfpt = mt25qu512a_post_bfpt_fixup,
> +};
> +
> static const struct flash_info st_nor_parts[] = {
> {
> .name = "m25p05-nonjedec",
> @@ -407,10 +419,8 @@ static const struct flash_info st_nor_parts[] = {
> .name = "mt25qu512a",
> .flags = SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_4BIT_BP |
> SPI_NOR_BP3_SR_BIT6,
> - .size = SZ_64M,
> - .no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
> - .fixup_flags = SPI_NOR_4B_OPCODES,
Hmm, I have missed some recent developments in SPI NOR and I was
confused why you did not add a PARSE_SFDP flag. But now I understand
that you just need to drop the .size parameter and it will automatically
use SFDP. So LGTM.
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
> .mfr_flags = USE_FSR,
> + .fixups = &mt25qu512a_fixups,
> }, {
> .id = SNOR_ID(0x20, 0xbb, 0x20),
> .name = "n25q512a",
--
Regards,
Pratyush Yadav
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
WARNING: multiple messages have this Message-ID (diff)
From: Pratyush Yadav <pratyush@kernel.org>
To: Tudor Ambarus <tudor.ambarus@linaro.org>
Cc: michael@walle.cc, pratyush@kernel.org,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
Mamta Shukla <mamta.shukla@leica-geosystems.com>
Subject: Re: [PATCH v4 2/2] mtd: spi-nor: micron-st: use SFDP table for mt25qu512a
Date: Tue, 17 Oct 2023 17:09:13 +0200 [thread overview]
Message-ID: <mafs0lec1mgkm.fsf@kernel.org> (raw)
In-Reply-To: <20231017074711.12167-2-tudor.ambarus@linaro.org> (Tudor Ambarus's message of "Tue, 17 Oct 2023 10:47:11 +0300")
On Tue, Oct 17 2023, Tudor Ambarus wrote:
> From: Mamta Shukla <mamta.shukla@leica-geosystems.com>
>
[...]
> diff --git a/drivers/mtd/spi-nor/micron-st.c b/drivers/mtd/spi-nor/micron-st.c
> index 756391c906e5..8920547c12bf 100644
> --- a/drivers/mtd/spi-nor/micron-st.c
> +++ b/drivers/mtd/spi-nor/micron-st.c
> @@ -180,6 +180,18 @@ static const struct flash_info micron_nor_parts[] = {
> },
> };
>
> +static int mt25qu512a_post_bfpt_fixup(struct spi_nor *nor,
> + const struct sfdp_parameter_header *bfpt_header,
> + const struct sfdp_bfpt *bfpt)
> +{
> + nor->flags &= ~SNOR_F_HAS_16BIT_SR;
> + return 0;
> +}
> +
> +static struct spi_nor_fixups mt25qu512a_fixups = {
> + .post_bfpt = mt25qu512a_post_bfpt_fixup,
> +};
> +
> static const struct flash_info st_nor_parts[] = {
> {
> .name = "m25p05-nonjedec",
> @@ -407,10 +419,8 @@ static const struct flash_info st_nor_parts[] = {
> .name = "mt25qu512a",
> .flags = SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_4BIT_BP |
> SPI_NOR_BP3_SR_BIT6,
> - .size = SZ_64M,
> - .no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
> - .fixup_flags = SPI_NOR_4B_OPCODES,
Hmm, I have missed some recent developments in SPI NOR and I was
confused why you did not add a PARSE_SFDP flag. But now I understand
that you just need to drop the .size parameter and it will automatically
use SFDP. So LGTM.
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
> .mfr_flags = USE_FSR,
> + .fixups = &mt25qu512a_fixups,
> }, {
> .id = SNOR_ID(0x20, 0xbb, 0x20),
> .name = "n25q512a",
--
Regards,
Pratyush Yadav
next prev parent reply other threads:[~2023-10-17 15:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-17 7:47 [PATCH v4 1/2] mtd: spi-nor: micron-st: enable lock/unlock for mt25qu512a Tudor Ambarus
2023-10-17 7:47 ` Tudor Ambarus
2023-10-17 7:47 ` [PATCH v4 2/2] mtd: spi-nor: micron-st: use SFDP table " Tudor Ambarus
2023-10-17 7:47 ` Tudor Ambarus
2023-10-17 15:09 ` Pratyush Yadav [this message]
2023-10-17 15:09 ` Pratyush Yadav
2023-10-18 4:50 ` [PATCH v4 1/2] mtd: spi-nor: micron-st: enable lock/unlock " Tudor Ambarus
2023-10-18 4:50 ` 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=mafs0lec1mgkm.fsf@kernel.org \
--to=pratyush@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=mamta.shukla@leica-geosystems.com \
--cc=michael@walle.cc \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.