From: Biju Das <biju.das.jz@bp.renesas.com> To: Tudor Ambarus <tudor.ambarus@linaro.org>, Pratyush Yadav <pratyush@kernel.org>, Miquel Raynal <miquel.raynal@bootlin.com>, Richard Weinberger <richard@nod.at>, Vignesh Raghavendra <vigneshr@ti.com> Cc: Biju Das <biju.das.jz@bp.renesas.com>, Michael Walle <michael@walle.cc>, Mark Brown <broonie@kernel.org>, linux-mtd@lists.infradead.org, Geert Uytterhoeven <geert+renesas@glider.be>, Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>, Biju Das <biju.das.au@gmail.com>, linux-renesas-soc@vger.kernel.org Subject: [PATCH RFC 2/4] mtd: spi-nor: Add post_sfdp() callback Date: Wed, 8 Nov 2023 17:11:47 +0000 [thread overview] Message-ID: <20231108171149.258656-3-biju.das.jz@bp.renesas.com> (raw) In-Reply-To: <20231108171149.258656-1-biju.das.jz@bp.renesas.com> Some generic flash devices such as Renesas AT25QL128A serial nor flash requires the IO pins must be in high-impedance before the falling edge of the first data out clock for the Fast Read Quad IO. Add post_sfdp() callback for generic flash devices and then call spi_mem_set_iofv() to configure IO fixed value to control the pin state. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> --- drivers/mtd/spi-nor/core.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 1c443fe568cf..eef3c286b174 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -1997,6 +1997,21 @@ int spi_nor_sr2_bit7_quad_enable(struct spi_nor *nor) return 0; } +static int spi_nor_generic_post_sfdp_fixup(struct spi_nor *nor) +{ + struct spi_device *spi = nor->spimem->spi; + const u8 *id = nor->id; + + if (spi->mode & SPI_TX_QUAD && nor->spimem) { + const struct spi_nor_id *at25ql128a_id = SNOR_ID(0x1f, 0x42, 0x18); + + if (!memcmp(id, at25ql128a_id->bytes, at25ql128a_id->len)) + return spi_mem_set_iofv(nor->spimem, 0xff); + } + + return 0; +} + static const struct spi_nor_manufacturer *manufacturers[] = { &spi_nor_atmel, &spi_nor_eon, @@ -2015,8 +2030,13 @@ static const struct spi_nor_manufacturer *manufacturers[] = { &spi_nor_xmc, }; +static const struct spi_nor_fixups spi_nor_generic_fixups = { + .post_sfdp = spi_nor_generic_post_sfdp_fixup, +}; + static const struct flash_info spi_nor_generic_flash = { .name = "spi-nor-generic", + .fixups = &spi_nor_generic_fixups, }; static const struct flash_info *spi_nor_match_id(struct spi_nor *nor, -- 2.25.1
WARNING: multiple messages have this Message-ID (diff)
From: Biju Das <biju.das.jz@bp.renesas.com> To: Tudor Ambarus <tudor.ambarus@linaro.org>, Pratyush Yadav <pratyush@kernel.org>, Miquel Raynal <miquel.raynal@bootlin.com>, Richard Weinberger <richard@nod.at>, Vignesh Raghavendra <vigneshr@ti.com> Cc: Biju Das <biju.das.jz@bp.renesas.com>, Michael Walle <michael@walle.cc>, Mark Brown <broonie@kernel.org>, linux-mtd@lists.infradead.org, Geert Uytterhoeven <geert+renesas@glider.be>, Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>, Biju Das <biju.das.au@gmail.com>, linux-renesas-soc@vger.kernel.org Subject: [PATCH RFC 2/4] mtd: spi-nor: Add post_sfdp() callback Date: Wed, 8 Nov 2023 17:11:47 +0000 [thread overview] Message-ID: <20231108171149.258656-3-biju.das.jz@bp.renesas.com> (raw) In-Reply-To: <20231108171149.258656-1-biju.das.jz@bp.renesas.com> Some generic flash devices such as Renesas AT25QL128A serial nor flash requires the IO pins must be in high-impedance before the falling edge of the first data out clock for the Fast Read Quad IO. Add post_sfdp() callback for generic flash devices and then call spi_mem_set_iofv() to configure IO fixed value to control the pin state. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> --- drivers/mtd/spi-nor/core.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 1c443fe568cf..eef3c286b174 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -1997,6 +1997,21 @@ int spi_nor_sr2_bit7_quad_enable(struct spi_nor *nor) return 0; } +static int spi_nor_generic_post_sfdp_fixup(struct spi_nor *nor) +{ + struct spi_device *spi = nor->spimem->spi; + const u8 *id = nor->id; + + if (spi->mode & SPI_TX_QUAD && nor->spimem) { + const struct spi_nor_id *at25ql128a_id = SNOR_ID(0x1f, 0x42, 0x18); + + if (!memcmp(id, at25ql128a_id->bytes, at25ql128a_id->len)) + return spi_mem_set_iofv(nor->spimem, 0xff); + } + + return 0; +} + static const struct spi_nor_manufacturer *manufacturers[] = { &spi_nor_atmel, &spi_nor_eon, @@ -2015,8 +2030,13 @@ static const struct spi_nor_manufacturer *manufacturers[] = { &spi_nor_xmc, }; +static const struct spi_nor_fixups spi_nor_generic_fixups = { + .post_sfdp = spi_nor_generic_post_sfdp_fixup, +}; + static const struct flash_info spi_nor_generic_flash = { .name = "spi-nor-generic", + .fixups = &spi_nor_generic_fixups, }; static const struct flash_info *spi_nor_match_id(struct spi_nor *nor, -- 2.25.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2023-11-08 17:12 UTC|newest] Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-11-08 17:11 [PATCH RFC 0/4] Add set_iofv() callback Biju Das 2023-11-08 17:11 ` Biju Das 2023-11-08 17:11 ` [PATCH RFC 1/4] spi: spi-mem: " Biju Das 2023-11-08 17:11 ` Biju Das 2023-11-09 7:56 ` Geert Uytterhoeven 2023-11-09 7:56 ` Geert Uytterhoeven 2023-11-09 8:28 ` Biju Das 2023-11-08 17:11 ` Biju Das [this message] 2023-11-08 17:11 ` [PATCH RFC 2/4] mtd: spi-nor: Add post_sfdp() callback Biju Das 2023-11-08 17:11 ` [PATCH RFC 3/4] memory: renesas-rpc-if: Add support for overriding IO fixed values Biju Das 2023-11-21 9:08 ` Krzysztof Kozlowski 2023-11-08 17:11 ` [PATCH RFC 4/4] spi: rpc-if: Add set_iofv() callback Biju Das 2023-11-09 9:01 ` [PATCH RFC 0/4] " Michael Walle 2023-11-09 9:01 ` Michael Walle 2023-11-09 10:04 ` Biju Das 2023-11-09 10:48 ` Michael Walle 2023-11-09 10:48 ` Michael Walle 2023-11-09 11:48 ` Biju Das 2023-11-09 12:40 ` Michael Walle 2023-11-09 12:40 ` Michael Walle 2023-11-09 18:02 ` Biju Das 2023-11-10 10:11 ` Michael Walle 2023-11-10 10:11 ` Michael Walle 2023-11-10 11:35 ` Biju Das 2023-11-11 12:26 ` Biju Das 2023-11-11 13:08 ` Biju Das 2023-11-13 14:04 ` Michael Walle 2023-11-13 14:04 ` Michael Walle 2023-11-13 14:27 ` Biju Das 2023-11-13 14:48 ` Michael Walle 2023-11-13 14:48 ` Michael Walle 2023-11-13 14:59 ` Biju Das 2023-11-13 15:10 ` Michael Walle 2023-11-13 15:10 ` Michael Walle 2023-11-13 15:55 ` Biju Das 2023-11-14 10:05 ` Michael Walle 2023-11-14 10:05 ` Michael Walle 2023-11-12 20:24 ` Biju Das 2023-11-13 14:37 ` Michael Walle 2023-11-13 14:37 ` Michael Walle 2023-11-13 14:47 ` Michael Walle 2023-11-13 14:47 ` Michael Walle
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=20231108171149.258656-3-biju.das.jz@bp.renesas.com \ --to=biju.das.jz@bp.renesas.com \ --cc=biju.das.au@gmail.com \ --cc=broonie@kernel.org \ --cc=geert+renesas@glider.be \ --cc=linux-mtd@lists.infradead.org \ --cc=linux-renesas-soc@vger.kernel.org \ --cc=michael@walle.cc \ --cc=miquel.raynal@bootlin.com \ --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \ --cc=pratyush@kernel.org \ --cc=richard@nod.at \ --cc=tudor.ambarus@linaro.org \ --cc=vigneshr@ti.com \ /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: linkBe 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.