QSPI support in MTD

John Williams john.williams at petalogix.com
Sun Apr 15 23:44:59 EDT 2012


Hi,

We are looking into adding support for QSPI flash devices in MTD.
It's easy enough to hack this up with roughly the following:
 1. query the device's support for QSPI (vendor/device specific)
 2. enable QSPI transfers on the device (vendor/device specific)
 3. query or hope that the parent SPI controller is itself QSPI-capable
 4. hope that the PCB is actually connected for QSPI
 5. if (1),(3) and (4) are all true, use QPAGE read/write commands for
data transfer (vendor/device specific - maybe).

There's an awful lot of vendor and device specificity there, and also
a little more 'hope' that I feel comfortable with.

In our research so far we've seen two different versions of (1) and
(2), from a sample size of 2.  The QPAGE data transfer commands
themselves are the same between these two devices, so I'm not sure how
much variability we are looking at there.

Point (4) probably must remain at the 'hope' level - if there's a
QSPI-capable controller connected to a QSPI-capable flash device, then
short a destructive test where we speculatively write then read back a
page using quad mode, I'm not sure how we can ever hope to know with
any certainty that the board is actually wired for QSPI operations.

You could maybe try a normal page read followed by a QSPI page read,
but in the case of an empty flash device I suspect you'd get all 0xFF
bytes in either case.

Before we dive too far down this particular rabbit hole I'd really
like to hear from anyone else who has looked into or attempted this.
Our thinking so far is:

 * extend the vendor/device table to capture info about how to query
and set QSPI support for each particular known flash device
 * add some property on the SPI controllers themselves regarding QSPI
support, and have this be queried by the flash driver

The sad thing is that the quick hack, non-portable version of this is
a trivial patch, which may be how vendors are doing this already.
However, doing it properly in a generic, runtime queried and managed
way is already feeling like pain.  I hope I'm wrong.

Thanks in advance for any contributions to the discussion.  Maybe
someone's solved this already and we've just plain missed it.

Regards,

John
-- 
John Williams, PhD, B. Eng, B. IT
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com  p: +61-7-30090663  f: +61-7-30090663



More information about the linux-mtd mailing list