Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Documentation: spi-nor: rewrite some portions

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>

+20 -17
+20 -17
Documentation/mtd/spi-nor.txt
··· 1 1 SPI NOR framework 2 2 ============================================ 3 3 4 - Part I - why we need this framework? 5 - ------------------------------------- 4 + Part I - Why do we need this framework? 5 + --------------------------------------- 6 6 7 - The SPI bus controller only deals with the byte stream. 8 - Some controller does not works like a SPI bus controller, it works 9 - like a SPI NOR controller instead, such as the Freescale's QuadSPI controller. 7 + SPI bus controllers (drivers/spi/) only deal with streams of bytes; the bus 8 + controller operates agnostic of the specific device attached. However, some 9 + controllers (such as Freescale's QuadSPI controller) cannot easily handle 10 + arbitrary streams of bytes, but rather are designed specifically for SPI NOR. 10 11 11 - The Freescale's QuadSPI controller should know the NOR commands to 12 - find the right LUT sequence. Unfortunately, the old code can not meet 13 - this requirement. 12 + In particular, Freescale's QuadSPI controller must know the NOR commands to 13 + find the right LUT sequence. Unfortunately, the SPI subsystem has no notion of 14 + opcodes, addresses, or data payloads; a SPI controller simply knows to send or 15 + receive bytes (Tx and Rx). Therefore, we must define a new layering scheme under 16 + which the controller driver is aware of the opcodes, addressing, and other 17 + details of the SPI NOR protocol. 14 18 15 19 Part II - How does the framework work? 16 - ------------------------------------- 20 + -------------------------------------- 17 21 18 22 This framework just adds a new layer between the MTD and the SPI bus driver. 19 23 With this new layer, the SPI NOR controller driver does not depend on the ··· 44 40 ------------------------ 45 41 SPI NOR chip 46 42 47 - With the SPI NOR controller driver(Freescale QuadSPI), it looks like: 43 + With the SPI NOR controller driver (Freescale QuadSPI), it looks like: 48 44 MTD 49 45 ------------------------ 50 46 SPI NOR framework ··· 53 49 ------------------------ 54 50 SPI NOR chip 55 51 56 - Part III - How can the drivers use the framework 57 - ------------------------------------- 52 + Part III - How can drivers use the framework? 53 + --------------------------------------------- 58 54 59 - The main API is the spi_nor_scan(). Before you call the hook, you should 60 - initialize the necessary fields for spi_nor{}. 61 - Please see the drivers/mtd/spi-nor/spi-nor.c for detail. 62 - Please also reference to the fsl-quadspi.c when you want to write a new driver 63 - for a SPI NOR controller. 55 + The main API is spi_nor_scan(). Before you call the hook, a driver should 56 + initialize the necessary fields for spi_nor{}. Please see 57 + drivers/mtd/spi-nor/spi-nor.c for detail. Please also refer to fsl-quadspi.c 58 + when you want to write a new driver for a SPI NOR controller.