mbox series

[0/2] Discover current address mode by CRC

Message ID cover.1660291281.git.Takahiro.Kuwano@infineon.com
Headers show
Series Discover current address mode by CRC | expand

Message

Takahiro Kuwano Aug. 12, 2022, 8:06 a.m. UTC
From: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>

Hello,

I introduced this series based on the discussion [0].

Patch#1 is needed to use READ_4B(13h) for offline CRC calculation. This
can replace spi_nor_read_raw() in SFDP, if it is OK.

Path#2 implements address mode discovery by:
  - determine factory default from BFPT DWORD16
  - read 4 bytes from address 0 by 13h opcode
  - calculate CRC from 4 byte data by offline
  - perform data integrity CRC op
  - read data integrity CRC register by Read Any Reg with 3- and/or 4-byte
    address bytes to determine the current address mode

[0] https://patchwork.ozlabs.org/project/linux-mtd/patch/e47ed0aa3e1a6fdca7689434ce7dea99ff4826e7.1659764848.git.Takahiro.Kuwano@infineon.com/

Takahiro Kuwano (2):
  mtd: spi-nor: core: Add a helper to read with alternative method
  mtd: spi-nor: spansion: Discover current address mode by CRC

 drivers/mtd/spi-nor/core.c     |  48 ++++++++++++
 drivers/mtd/spi-nor/core.h     |   2 +
 drivers/mtd/spi-nor/sfdp.h     |   1 +
 drivers/mtd/spi-nor/spansion.c | 130 +++++++++++++++++++++++++++++++++
 4 files changed, 181 insertions(+)

Comments

Takahiro Kuwano Sept. 13, 2022, 9:32 a.m. UTC | #1
Hi Tudor,

Have you had a chance to take a look?

Thanks,
Takahiro

On 8/12/2022 5:06 PM, tkuw584924@gmail.com wrote:
> From: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
> 
> Hello,
> 
> I introduced this series based on the discussion [0].
> 
> Patch#1 is needed to use READ_4B(13h) for offline CRC calculation. This
> can replace spi_nor_read_raw() in SFDP, if it is OK.
> 
> Path#2 implements address mode discovery by:
>   - determine factory default from BFPT DWORD16
>   - read 4 bytes from address 0 by 13h opcode
>   - calculate CRC from 4 byte data by offline
>   - perform data integrity CRC op
>   - read data integrity CRC register by Read Any Reg with 3- and/or 4-byte
>     address bytes to determine the current address mode
> 
> [0] https://patchwork.ozlabs.org/project/linux-mtd/patch/e47ed0aa3e1a6fdca7689434ce7dea99ff4826e7.1659764848.git.Takahiro.Kuwano@infineon.com/
> 
> Takahiro Kuwano (2):
>   mtd: spi-nor: core: Add a helper to read with alternative method
>   mtd: spi-nor: spansion: Discover current address mode by CRC
> 
>  drivers/mtd/spi-nor/core.c     |  48 ++++++++++++
>  drivers/mtd/spi-nor/core.h     |   2 +
>  drivers/mtd/spi-nor/sfdp.h     |   1 +
>  drivers/mtd/spi-nor/spansion.c | 130 +++++++++++++++++++++++++++++++++
>  4 files changed, 181 insertions(+)
>