mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-08-31 14:13:39 +00:00
mtd: spi-nor: spansion: add octal DTR support in RD_ANY_REG_OP
S28HS02GT uses RD_ANY_REG_OP to read status of each die. In Octal DTR mode, RD_ANY_REG_OP needs dummy cycles (same as params->rdsr_dummy) and data length should be 2. Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com> Link: https://lore.kernel.org/r/20230726075257.12985-8-tudor.ambarus@linaro.org Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
This commit is contained in:
parent
7d896a94bf
commit
eff9604390
@ -102,11 +102,17 @@ static void spansion_nor_clear_sr(struct spi_nor *nor)
|
|||||||
|
|
||||||
static int cypress_nor_sr_ready_and_clear_reg(struct spi_nor *nor, u64 addr)
|
static int cypress_nor_sr_ready_and_clear_reg(struct spi_nor *nor, u64 addr)
|
||||||
{
|
{
|
||||||
|
struct spi_nor_flash_parameter *params = nor->params;
|
||||||
struct spi_mem_op op =
|
struct spi_mem_op op =
|
||||||
CYPRESS_NOR_RD_ANY_REG_OP(nor->params->addr_mode_nbytes, addr,
|
CYPRESS_NOR_RD_ANY_REG_OP(params->addr_mode_nbytes, addr,
|
||||||
0, nor->bouncebuf);
|
0, nor->bouncebuf);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
if (nor->reg_proto == SNOR_PROTO_8_8_8_DTR) {
|
||||||
|
op.dummy.nbytes = params->rdsr_dummy;
|
||||||
|
op.data.nbytes = 2;
|
||||||
|
}
|
||||||
|
|
||||||
ret = spi_nor_read_any_reg(nor, &op, nor->reg_proto);
|
ret = spi_nor_read_any_reg(nor, &op, nor->reg_proto);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user