This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

EVMK2GX: How to enable the Linux SPI driver on K2G EVM

Part Number: EVMK2GX

Hi !

I wanna use four SPIs to connect ADC and our custom module under the TI linux. A NOR flash memory on SPI1 will be removed and then SPI1 may be used to connect our module.

When K2G EVM is booted in linux, any spi device driver such as spidev0 etc are not found under /dev directory.

So how to enable the linux SPI driver on K2G EVM

Thank you !

From Younghee Lee

  • Hi !

    I tri to use SPI0 on K2GEVM in the following manner.

    1. follow the SPI kernel driver configuration guide( https://software-dl.ti.com/processor-sdk-linux/esd/docs/06_03_00_106/linux/Foundational_Components/Kernel/Kernel_Drivers/SPI.html )

        Fig1. SoC Specific Information

     -  66AK2Gx processor is used in k2gevm, so SPI driver is McSPI.  McSPI driver is enabled in kernel configuration, that is shown in the Fig. 2.

      Fig. 2. Enabling McSPI driver

    - and in order to use the spidev driver under /dev directory, kernel configuration shown in fig.3 is selected.

          Fig. 3. Kernel configuration for spidev

    - Since SPI0 is used to connect our peripheral, the followings are added to keystone-k2g-evm.dts file.

    - And then build zImage -> compile the device tree binary such as keystone-k2g-evm.dtb -> compile kernel modules -> copy zImage, dtb, and kernel modules to SD card.

    - When k2gevm is booted with this new kernel, /dev/spidev* file is not created.

    So how to enable the linux spi device driver ?

  • Hello Younghee,

    Do you still need assistance, or did you resolve your issue? If you still need assistance, are you seeing any debug output during boot that indicates that the SPI device is failing to load? Did you actually connect anything to the SPI pins?

    Regards,

    Nick

  • Hi !

    Still I need assistance to resolve SPI driver, i.e. /dev/spidev.

    There is no slave device to be connected. At this time, K2G EVM is used to evaluate SPI device.

    The following message is the one that is relevant to SPI device during boot.

    ----------------------------------------------------------------------------------------------------------------------

    [ 2.623123] cadence-qspi 2940000.spi: non-uniform erase sector maps are not supported yet.
    [ 2.631451] cadence-qspi 2940000.spi: s25fl512s (65536 Kbytes)
    [ 2.637333] 6 fixed-partitions partitions found on MTD device 2940000.spi.0
    [ 2.644299] Creating 6 MTD partitions on "2940000.spi.0":
    [ 2.649690] 0x000000000000-0x000000100000 : "QSPI.u-boot-spl-os"
    [ 2.656563] 0x000000100000-0x000000140000 : "QSPI.u-boot-env"
    [ 2.663084] 0x000000140000-0x000000180000 : "QSPI.skern"
    [ 2.669096] 0x000000180000-0x0000001c0000 : "QSPI.pmmc-firmware"
    [ 2.675832] 0x0000001c0000-0x0000009c0000 : "QSPI.kernel"
    [ 2.681948] 0x0000009c0000-0x000004000000 : "QSPI.file-system"
    [ 2.689276] of_get_named_gpiod_flags: can't parse 'cs-gpios' property of node '/soc@0/spi@21805400[0]'
    [ 2.689292] of_get_named_gpiod_flags: can't parse 'cs-gpios' property of node '/soc@0/spi@21805400[1]'
    [ 2.689304] of_get_named_gpiod_flags: can't parse 'cs-gpios' property of node '/soc@0/spi@21805400[2]'
    [ 2.689317] of_get_named_gpiod_flags: can't parse 'cs-gpios' property of node '/soc@0/spi@21805400[3]'
    [ 2.689330] spi_davinci 21805400.spi: DMA is not supported (-19)
    [ 2.695711] spi_davinci 21805400.spi: Controller at 0x(ptrval)
    [ 2.702297] of_get_named_gpiod_flags: can't parse 'cs-gpios' property of node '/soc@0/spi@21805800[0]'
    [ 2.702312] of_get_named_gpiod_flags: can't parse 'cs-gpios' property of node '/soc@0/spi@21805800[1]'
    [ 2.702324] of_get_named_gpiod_flags: can't parse 'cs-gpios' property of node '/soc@0/spi@21805800[2]'
    [ 2.702336] of_get_named_gpiod_flags: can't parse 'cs-gpios' property of node '/soc@0/spi@21805800[3]'
    [ 2.702347] spi_davinci 21805800.spi: DMA is not supported (-19)
    [ 2.709808] m25p80 spi1.0: n25q128a13 (16384 Kbytes)
    [ 2.714836] 2 fixed-partitions partitions found on MTD device spi1.0
    [ 2.721177] Creating 2 MTD partitions on "spi1.0":
    [ 2.725978] 0x000000000000-0x000000100000 : "u-boot-spl"
    [ 2.732146] 0x000000100000-0x000001000000 : "misc"
    [ 2.737684] spi_davinci 21805800.spi: Controller at 0x(ptrval)
    [ 2.744245] of_get_named_gpiod_flags: can't parse 'cs-gpios' property of node '/soc@0/spi@21805c00[0]'
    [ 2.744260] of_get_named_gpiod_flags: can't parse 'cs-gpios' property of node '/soc@0/spi@21805c00[1]'
    [ 2.744272] of_get_named_gpiod_flags: can't parse 'cs-gpios' property of node '/soc@0/spi@21805c00[2]'
    [ 2.744284] of_get_named_gpiod_flags: can't parse 'cs-gpios' property of node '/soc@0/spi@21805c00[3]'
    [ 2.744295] spi_davinci 21805c00.spi: DMA is not supported (-19)
    [ 2.750635] spi_davinci 21805c00.spi: Controller at 0x(ptrval)
    [ 2.757155] of_get_named_gpiod_flags: can't parse 'cs-gpios' property of node '/soc@0/spi@21806000[0]'
    [ 2.757169] of_get_named_gpiod_flags: can't parse 'cs-gpios' property of node '/soc@0/spi@21806000[1]'
    [ 2.757182] of_get_named_gpiod_flags: can't parse 'cs-gpios' property of node '/soc@0/spi@21806000[2]'
    [ 2.757194] of_get_named_gpiod_flags: can't parse 'cs-gpios' property of node '/soc@0/spi@21806000[3]'
    [ 2.757205] spi_davinci 21806000.spi: DMA is not supported (-19)
    [ 2.763564] spi_davinci 21806000.spi: Controller at 0x(ptrval)
    [ 2.769876] mdio_bus 4200f00.mdio: GPIO lookup for consumer reset

    ----------------------------------------------------------------------------------------------------------------------

    Thank you.