diff --git a/source/linux/Foundational_Components/Kernel/Kernel_Drivers/SPI.rst b/source/linux/Foundational_Components/Kernel/Kernel_Drivers/SPI.rst index 173101e5e..da1cf2784 100644 --- a/source/linux/Foundational_Components/Kernel/Kernel_Drivers/SPI.rst +++ b/source/linux/Foundational_Components/Kernel/Kernel_Drivers/SPI.rst @@ -6,42 +6,47 @@ SPI .. rubric:: **Introduction** :name: introduction-linux-spi -- Serial interface - -- Synchronous - -- Master-slave configuration - -- Data Exchange - DMA/PIO +- Serial interface +- Synchronous +- Master-slave configuration +- Data Exchange - DMA/PIO .. rubric:: SOC Specific Information :name: soc-specific-information -+--------------+-----------+ -| SoC Family | Driver | -+==============+===========+ -| AM335x | McSPI | -+--------------+-----------+ -| AM437x | McSPI | -+--------------+-----------+ -| DRA7x | McSPI | -+--------------+-----------+ -| J721E | McSPI | -+--------------+-----------+ -| J7200 | McSPI | -+--------------+-----------+ -| J721S2 | McSPI | -+--------------+-----------+ -| AM62X | McSPI | -+--------------+-----------+ -| 66AK2Gx | McSPI | -+--------------+-----------+ -| 66AK2Lx | Davinci | -+--------------+-----------+ -| 66AK2Hx | Davinci | -+--------------+-----------+ -| 66AK2E | Davinci | -+--------------+-----------+ +.. ifconfig:: CONFIG_part_family in ('AM62X_family', 'AM62AX_family', 'AM64X_family', 'AM62PX_family') + + +------------------------+-----------+ + | SoC Family | Driver | + +========================+===========+ + | |__PART_FAMILY_NAME__| | McSPI | + +------------------------+-----------+ + +.. ifconfig:: CONFIG_part_family not in ('AM62X_family', 'AM62AX_family', 'AM64X_family', 'AM62PX_family') + + +--------------+-----------+ + | SoC Family | Driver | + +==============+===========+ + | AM335x | McSPI | + +--------------+-----------+ + | AM437x | McSPI | + +--------------+-----------+ + | DRA7x | McSPI | + +--------------+-----------+ + | J721E | McSPI | + +--------------+-----------+ + | J7200 | McSPI | + +--------------+-----------+ + | J721S2 | McSPI | + +--------------+-----------+ + | 66AK2Gx | McSPI | + +--------------+-----------+ + | 66AK2Lx | Davinci | + +--------------+-----------+ + | 66AK2Hx | Davinci | + +--------------+-----------+ + | 66AK2E | Davinci | + +--------------+-----------+ .. rubric:: Features Not Supported :name: SPI-features-not-supported @@ -66,19 +71,21 @@ The specific peripheral driver to enable depends on the SoC being used. .. rubric:: Enabling McSPI Driver :name: enabling-mcspi-driver -.. code-block:: text +.. code-block:: kconfig Device Drivers ---> [*] SPI support [*] McSPI driver for OMAP -.. rubric:: Enabling DaVinci Driver - :name: enabling-davinci-driver +.. ifconfig:: CONFIG_part_family not in ('AM62X_family', 'AM62AX_family', 'AM64X_family', 'AM62PX_family') -.. code-block:: text + .. rubric:: Enabling DaVinci Driver + :name: enabling-davinci-driver - Device Drivers ---> - [*] SPI support + .. code-block:: kconfig + + Device Drivers ---> + [*] SPI support [*] Texas Instruments DaVinci/DA8x/OMAP-L/AM1x SoC SPI controller .. rubric:: SPI Driver Usecases @@ -90,32 +97,34 @@ drivers along with their documentation can be found within the kernel sources. The below section attempts to provide information on SPI based chips that are located on TI's evms. -.. rubric:: Flash Storage - :name: flash-storage +.. ifconfig:: CONFIG_part_family not in ('AM62X_family', 'AM62AX_family', 'AM64X_family', 'AM62PX_family') + + .. rubric:: Flash Storage + :name: flash-storage -.. note:: - This section is not to be confused with flash storage through - the QSPI/OSPI modules. + .. note:: + This section is not to be confused with flash storage through + the QSPI/OSPI modules. -.. rubric:: Boards with SPI Flash - :name: boards-with-spi-flash + .. rubric:: Boards with SPI Flash + :name: boards-with-spi-flash -+------------------+--------------------+--------------+ -| EVM | Part # | Flash Size | -+==================+====================+==============+ -| AM335x ICE EVM | W25Q64 | 8 MB | -+------------------+--------------------+--------------+ -| K2E EVM | N25Q128A11ESF40F | 16 MB | -+------------------+--------------------+--------------+ -| K2HK EVM | N25Q128A11ESF40F | 16 MB | -+------------------+--------------------+--------------+ -| K2L EVM | N25Q128A11ESF40F | 16 MB | -+------------------+--------------------+--------------+ + +------------------+--------------------+--------------+ + | EVM | Part # | Flash Size | + +==================+====================+==============+ + | AM335x ICE EVM | W25Q64 | 8 MB | + +------------------+--------------------+--------------+ + | K2E EVM | N25Q128A11ESF40F | 16 MB | + +------------------+--------------------+--------------+ + | K2HK EVM | N25Q128A11ESF40F | 16 MB | + +------------------+--------------------+--------------+ + | K2L EVM | N25Q128A11ESF40F | 16 MB | + +------------------+--------------------+--------------+ .. rubric:: Kernel Configuration :name: kernel-configuration-1 -.. code-block:: text +.. code-block:: kconfig Device Drivers ---> <*> Memory Technology Device (MTD) support ---> @@ -132,13 +141,13 @@ particular SPI NOR partition is simple. A user simply needs to view the list of mtd devices along with its name. Below command will provide this information: -.. code-block:: text +.. code-block:: console cat /proc/mtd An example of this output performed on the AM571x IDK EVM can be seen below. -.. code-block:: text +.. code-block:: console dev: size erasesize name mtd0: 00040000 00010000 "QSPI.SPL" @@ -156,7 +165,7 @@ hex) are determined within the specific board's device tree file. Erasing a NOR partition can be performed by using the below command: -.. code-block:: text +.. code-block:: console flash_erase /dev/mtdX 0 0 @@ -171,7 +180,7 @@ The below step copies 8KiB from /dev/mtd2 partition (u-boot env) to /dev/mtd4 partition and reads the 8KiB image from /dev/mtd4 to a file and checks the md5sum. The md5sum of test.img and test1.img should be same. -.. code-block:: text +.. code-block:: console cd /tmp dd if=/dev/mtd2 of=test.img bs=8k count=1 @@ -189,7 +198,7 @@ simple means to send and receive SPI messages the spidev driver can be used. Spidev provides a user space accessible means to communicate with the SPI interface. Latest documentation regarding spidev driver can be found -`here `__. +`here `__. Spidev allows users to interact with the spi interface in a variety of programming languages that can communicate with kernel ioctls. @@ -197,7 +206,7 @@ programming languages that can communicate with kernel ioctls. .. rubric:: Kernel Configuration :name: kernel-configuration-2 -.. code-block:: text +.. code-block:: kconfig Device Drivers ---> [*] SPI support @@ -209,7 +218,7 @@ Below is an example of the device tree settings a user would use to enable the spidev driver. Like most drivers for a peripheral, the spidev driver is listed as a subnode of the main SPI peripheral driver. -.. code-block:: text +.. code-block:: dts &spi1 { status = "okay"; @@ -243,7 +252,7 @@ show a C application interacting with the SPI peripheral. the same overlay can be used with minor modifications to update for the PSIL thread id.Run the following commands in u-boot console to load the overlays: - .. code-block:: text + .. code-block:: console => setenv name_overlays k3-j7200-mcspi-loopback.dtbo => boot