Re: [PATCH v2 4/8] mtd: spi-nor: core: Introduce method for RDID op

From: Michael Walle
Date: Tue Mar 22 2022 - 04:19:59 EST


Am 2022-03-22 08:32, schrieb Pratyush Yadav:
On 21/03/22 11:56PM, Michael Walle wrote:
Am 2022-02-28 12:17, schrieb Tudor Ambarus:
> RDID is used in the core to auto detect the flash, but also by some
> manufacturer drivers that contain flashes that support Octal DTR mode,
> so that they can read the flash ID after the switch to Octal DTR was
> made
> to test if the switch was successful. Introduce a core method for RDID
> op
> to avoid code duplication.

Some or all? Is that specific to the flash or can we just check that
readid works in spi_nor_octal_dtr_enable()? That way we could also
just get rid of the proto parameter for the read_id because it can
be called after we set the reg_proto.

It is specific to the flash. Not all flashes support RDID in 8D mode.
And the RDID command is also different in 8D mode for various flashes.
For example, Micron MT35XU512ABA flash expects 8 dummy cycles and 0
address cycles. Cypress S28HS512T expects 4 address cycles and 3 dummy
cycles.

The octal_dtr_enable hook would know what parameters to use but it is
harder for the core to know since this information is not discoverable
via SFDP.

Ah, I see, thanks for clarification.

-michael