spi: cadence_spi: Add octal and quad write support
PATCH 1/1 spi: cadence_spi: Add octal and quad write support
In Commit d64077202158 ("spi: cadence_qspi: Move to spi-mem framework") it removes setting to quad write bit by accident. This commit restores it back and also adding checking for octal support.
--- drivers/spi/cadence_qspi_apb.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/spi/cadence_qspi_apb.c +6 -0
@@ -689,6 +689,12 @@ int cadence_qspi_apb_write_setup(struct cadence_spi_platdata *plat,/* Configure the opcode */ reg = op->cmd.opcode <<CQSPI_REG_WR_INSTR_OPCODE_LSB ; + +if (op->data.buswidth ==8 ) + reg |=CQSPI_INST_TYPE_OCTAL <<CQSPI_REG_WR_INSTR_TYPE_DATA_LSB ; +else if (op->data.buswidth ==4 ) + reg |=CQSPI_INST_TYPE_QUAD <<CQSPI_REG_WR_INSTR_TYPE_DATA_LSB ; +writel (reg, plat->regbase +CQSPI_REG_WR_INSTR );writel (op->addr.val, plat->regbase +CQSPI_REG_INDIRECTWRSTARTADDR );
Signature · 1 line
2.19.0
PATCH 1/1 spi: cadence_spi: Add octal and quad write support
Hi Ley,
Quoted 5 lines · Ley Foon Tan
In Commit
d64077202158("spi:cadence_qspi: Move to spi-mem framework") it removes setting to quad write bit by accident. This commit restores it back and also adding checking for octal support.Fixes d64077202158 ("spi: cadence_qspi: Move to spi-mem framework")
I sent a patch to add Octal DTR support for this controller [0]. It should also fix this problem (check cadence_qspi_set_protocol()).
[0] https://patchwork.ozlabs.org/project/uboot/patch/20200522124509.6901-5-p.yadav at ti.com/
Signature · 3 lines
Regards, Pratyush Yadav Texas Instruments India
Tan
PATCH 1/1 spi: cadence_spi: Add octal and quad write support
Quoted 20 lines
-----Original Message-----
From: Pratyush Yadav <[email protected]>
Sent: Wednesday, May 27, 2020 9:07 PM
To: Tan, Ley Foon <[email protected]>
Cc: u-boot at lists.denx.de; Jagan Teki <[email protected]>; Ley Foon Tan <[email protected]>; Vignesh Raghavendra <[email protected]>; See, Chin Liang <[email protected]>; Simon Goldschmidt <[email protected]>; Ang, Chee Hong <[email protected]>
Subject: Re: [PATCH] spi:cadence_spi: Add octal and quad write supportHi Ley,
Quoted 4 lines · Ley Foon Tan
In Commit
d64077202158("spi:cadence_qspi: Move to spi-mem framework") it removes setting to quad write bit by accident. This commit restores it back and also adding checking for octal support.
Quoted 9 lines
Quoted 1 line
Fixes d64077202158 ("spi: cadence_qspi: Move to spi-mem framework")I sent a patch to add Octal DTR support for this controller [0]. It should also fix this problem (check
cadence_qspi_set_protocol()).[0]
https://patchwork.ozlabs.org/project/uboot/patch/20200522124509.6901-
5-p.yadav at ti.com/
Hi
I have tried your patches with uboot/master, but it has compilation error below.
drivers/built-in.o: In function `spi_flash_std_remove':drivers/mtd/spi/sf_probe.c:160: undefined reference to spi_nor_remove' drivers/mtd/spi/sf_probe.c:160:(.text.spi_flash_std_remove+0x10): relocation truncated to fit: R_AARCH64_JUMP26 against undefined symbol spi_nor_remove' drivers/built-in.o:(.rodata.spi_nor_ids+0x258): undefined reference to mt35xu512aba_fixups' drivers/built-in.o:(.rodata.spi_nor_ids+0x578): undefined reference to s28hs512t_fixups'
Regards
Ley Foon
PATCH 1/1 spi: cadence_spi: Add octal and quad write support
Quoted 29 lines · Ley Foon
Quoted 20 lines
-----Original Message-----
From: Pratyush Yadav <[email protected]>
Sent: Wednesday, May 27, 2020 9:07 PM
To: Tan, Ley Foon <[email protected]>
Cc: u-boot at lists.denx.de; Jagan Teki <[email protected]>; Ley Foon Tan <[email protected]>; Vignesh Raghavendra <[email protected]>; See, Chin Liang <[email protected]>; Simon Goldschmidt <[email protected]>; Ang, Chee Hong <[email protected]>
Subject: Re: [PATCH] spi:cadence_spi: Add octal and quad write supportHi Ley,
Quoted 4 lines · Ley Foon Tan
In Commit
d64077202158("spi:cadence_qspi: Move to spi-mem framework") it removes setting to quad write bit by accident. This commit restores it back and also adding checking for octal support.Quoted 9 lines
Quoted 1 line
Fixes d64077202158 ("spi: cadence_qspi: Move to spi-mem framework")I sent a patch to add Octal DTR support for this controller [0]. It should also fix this problem (check
cadence_qspi_set_protocol()).[0]
https://patchwork.ozlabs.org/project/uboot/patch/20200522124509.6901-
5-p.yadav at ti.com/
Quoted 7 lines
Hi
I have tried your patches with uboot/master, but it has compilation error below.
drivers/built-in.o: In function `spi_flash_std_remove':drivers/mtd/spi/sf_probe.c:160: undefined reference tospi_nor_remove' drivers/mtd/spi/sf_probe.c:160:(.text.spi_flash_std_remove+0x10): relocation truncated to fit: R_AARCH64_JUMP26 against undefined symbolspi_nor_remove'
Curious. spi_nor_remove() is not inside an #ifdef, so I wonder why it would be an undefined reference.
Quoted 2 lines
drivers/built-in.o:(.rodata.spi_nor_ids+0x258): undefined reference to
mt35xu512aba_fixups' drivers/built-in.o:(.rodata.spi_nor_ids+0x578): undefined reference tos28hs512t_fixups'
Both these fixups are wrapped in #ifdefs, but I don't see any mis-match anywhere. If say CONFIG_SPI_FLASH_STMICRO is enabled, mt35xu512aba_fixups should be defined.
I suspect spi-nor-core.c is not being built. Are you using spi-nor-tiny instead of spi-nor-core (CONFIG_SPL_SPI_FLASH_TINY)?
Signature · 3 lines
Regards, Pratyush Yadav Texas Instruments India
Tan
PATCH 1/1 spi: cadence_spi: Add octal and quad write support
Quoted 64 lines
-----Original Message-----
From: Pratyush Yadav <[email protected]>
Sent: Thursday, May 28, 2020 5:17 PM
To: Tan, Ley Foon <[email protected]>
Cc: u-boot at lists.denx.de; Jagan Teki <[email protected]>; Ley Foon Tan <[email protected]>; Vignesh Raghavendra <[email protected]>; See, Chin Liang <[email protected]>; Simon Goldschmidt <[email protected]>; Ang, Chee Hong <[email protected]>
Subject: Re: [PATCH] spi:cadence_spi: Add octal and quad write supportQuoted 21 lines · Ley Foon
Quoted 21 lines
-----Original Message-----
From: Pratyush Yadav <[email protected]>
Sent: Wednesday, May 27, 2020 9:07 PM
To: Tan, Ley Foon <[email protected]>
Cc: u-boot at lists.denx.de; Jagan Teki <[email protected]>; Ley Foon Tan <[email protected]>; Vignesh Raghavendra <[email protected]>; See, Chin Liang <[email protected]>; Simon Goldschmidt <[email protected]>; Ang, Chee Hong <[email protected]>
Subject: Re: [PATCH] spi:cadence_spi: Add octal and quad write supportHi Ley,
Quoted 4 lines · Ley Foon Tan
In Commit
d64077202158("spi:cadence_qspi: Move to spi-mem framework") it removes setting to quad write bit by accident. This commit restores it back and also adding checking for octal support.Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
Fixes d64077202158 ("spi: cadence_qspi: Move to spi-memframework")
I sent a patch to add Octal DTR support for this controller [0]. It should also fix this problem (check
cadence_qspi_set_protocol()).[0]
https://patchwork.ozlabs.org/project/uboot/patch/20200522124509.6901
Quoted 6 lines
Quoted 3 lines
-
5-p.yadav at ti.com/Hi
I have tried your patches with uboot/master, but it has compilation error
below.
Quoted 4 lines
drivers/built-in.o: In function `spi_flash_std_remove':drivers/mtd/spi/sf_probe.c:160: undefined reference to `spi_nor_remove' drivers/mtd/spi/sf_probe.c:160:(.text.spi_flash_std_remove+0x10):relocation truncated to fit:
R_AARCH64_JUMP26against undefined symbol `spi_nor_remove'Curious.
spi_nor_remove()is not inside an #ifdef, so I wonder why it would be an undefined reference.Quoted 1 line
drivers/built-in.o:(.rodata.spi_nor_ids+0x258): undefined reference to
`mt35xu512aba_fixups'
Quoted 1 line
drivers/built-in.o:(.rodata.spi_nor_ids+0x578): undefined reference to
Quoted 8 lines
`s28hs512t_fixups'
Both these fixups are wrapped in #ifdefs, but I don't see any mis-match anywhere. If say
CONFIG_SPI_FLASH_STMICROis enabled,mt35xu512aba_fixupsshould be defined.I suspect
spi-nor-core.cis not being built. Are you using spi-nor-tiny instead of spi-nor-core (CONFIG_SPL_SPI_FLASH_TINY)?
Yes, CONFIG_SPL_SPI_FLASH_TINY is enabled.
You might want to try compile with CONFIG_SPL_SPI_FLASH_TINY enabled.
Regards
Ley Foon