···11 SPI NOR framework22 ============================================3344-Part I - why we need this framework?55--------------------------------------44+Part I - Why do we need this framework?55+---------------------------------------6677-The SPI bus controller only deals with the byte stream.88-Some controller does not works like a SPI bus controller, it works99-like a SPI NOR controller instead, such as the Freescale's QuadSPI controller.77+SPI bus controllers (drivers/spi/) only deal with streams of bytes; the bus88+controller operates agnostic of the specific device attached. However, some99+controllers (such as Freescale's QuadSPI controller) cannot easily handle1010+arbitrary streams of bytes, but rather are designed specifically for SPI NOR.10111111-The Freescale's QuadSPI controller should know the NOR commands to1212-find the right LUT sequence. Unfortunately, the old code can not meet1313-this requirement.1212+In particular, Freescale's QuadSPI controller must know the NOR commands to1313+find the right LUT sequence. Unfortunately, the SPI subsystem has no notion of1414+opcodes, addresses, or data payloads; a SPI controller simply knows to send or1515+receive bytes (Tx and Rx). Therefore, we must define a new layering scheme under1616+which the controller driver is aware of the opcodes, addressing, and other1717+details of the SPI NOR protocol.14181519Part II - How does the framework work?1616--------------------------------------2020+--------------------------------------17211822This framework just adds a new layer between the MTD and the SPI bus driver.1923With this new layer, the SPI NOR controller driver does not depend on the···4440 ------------------------4541 SPI NOR chip46424747- With the SPI NOR controller driver(Freescale QuadSPI), it looks like:4343+ With the SPI NOR controller driver (Freescale QuadSPI), it looks like:4844 MTD4945 ------------------------5046 SPI NOR framework···5349 ------------------------5450 SPI NOR chip55515656-Part III - How can the drivers use the framework5757--------------------------------------5252+Part III - How can drivers use the framework?5353+---------------------------------------------58545959-The main API is the spi_nor_scan(). Before you call the hook, you should6060-initialize the necessary fields for spi_nor{}.6161-Please see the drivers/mtd/spi-nor/spi-nor.c for detail.6262-Please also reference to the fsl-quadspi.c when you want to write a new driver6363-for a SPI NOR controller.5555+The main API is spi_nor_scan(). Before you call the hook, a driver should5656+initialize the necessary fields for spi_nor{}. Please see5757+drivers/mtd/spi-nor/spi-nor.c for detail. Please also refer to fsl-quadspi.c5858+when you want to write a new driver for a SPI NOR controller.