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.

AM625: Enabling SPI Support in BeaglePlay using TI SDK Image

Part Number: AM625
Other Parts Discussed in Thread: TPS65912, PCM3060, PCM3168A, SYSCONFIG

Hello Team,

I am using the image tisdk-default-image-rt-beagleplay-ti-12.00.00.07.04.rootfs.wic and can successfully boot my BeaglePlay board. I believe UART, Ethernet, and I2C interfaces are enabled and working.

However, SPI is not enabled. It is not listed under /dev, and upon checking the DTB file, I found that the SPI nodes appear to be in a disabled state.

I attempted to convert the DTB to DTS and modify it to enable SPI, but I was unable to complete the process successfully.

Could you please suggest how to enable SPI support in this image?

 

 

Thanks & Regards

Aparna C Nair

 

  • Hello Sir,

    I have added the spidev node under main_spi2 in the k3-am625-beagleplay.dtb.

    I have a doubt regarding whether this change will be reflected in the fitimage. I noticed that the fitimage is present under the boot directory, and I am concerned that modifying the DTB may not take effect if the fitimage uses a separate embedded device tree.

    Could you please confirm whether changes made directly in k3-am625-beagleplay.dtb will automatically be picked up by the fitimage, or whether the fitimage needs to be rebuilt separately for the changes to take effect?

    Also, could you suggest the correct method to enable SPI in the tisdk-default-image-rt-beagleplay-ti-12.00.00.07.04.rootfs.wic image?

    Please find my attached modifications below for your reference, which I have made

    spi@20120000 {

                                                    compatible = "ti,am654-mcspi\0ti,omap4-mcspi";

                                                    reg = <0x00 0x20120000 0x00 0x400>;

                                                    interrupts = <0x00 0xae 0x04>;

                                                    #address-cells = <1>;

                                                    #size-cells = <0>;

                                                    power-domains = <0x03 0x8f 0x01>;

                                                    clocks = <0x02 0x8f 0x00>;

     

                                                    status = "okay";

     

                                                    pinctrl-names = "default";

                                                    pinctrl-0 = <0x1d>;

     

                                                    ti,spi-num-cs = <1>;   //

     

                                                    spidev@0 {

                                                    compatible = "linux,spidev";

                                                                    reg = <0>;

                                                    spi-max-frequency = <1000000>;   // use lower first

                                                                    };

                                    };

    this is for reference

    main_spi0 = "/bus@f0000/spi@20100000";

    main_spi1 = "/bus@f0000/spi@20110000";

    main_spi2 = "/bus@f0000/spi@20120000";

     

    Thanks & Regards

    Aparna C Nair

  • I think the SPI driver is enabled in the kernel. Please check.

    root@beagleplay-ti:~# zcat /proc/config.gz | grep SPI
    CONFIG_UNINLINE_SPIN_UNLOCK=y
    CONFIG_MUTEX_SPIN_ON_OWNER=y
    CONFIG_RWSEM_SPIN_ON_OWNER=y
    CONFIG_LOCK_SPIN_ON_OWNER=y
    CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y
    CONFIG_QUEUED_SPINLOCKS=y
    # CONFIG_NFC_NCI_SPI is not set
    # CONFIG_NFC_ST_NCI_SPI is not set
    CONFIG_REGMAP_SPI=y
    CONFIG_MTD_SPI_NAND=y
    CONFIG_MTD_SPI_NOR=y
    # CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
    # CONFIG_MTD_SPI_NOR_SWP_DISABLE is not set
    CONFIG_MTD_SPI_NOR_SWP_DISABLE_ON_VOLATILE=y
    # CONFIG_MTD_SPI_NOR_SWP_KEEP is not set
    # CONFIG_SENSORS_LIS3_SPI is not set
    # CONFIG_SCSI_SPI_ATTRS is not set
    # CONFIG_NET_DSA_VITESSE_VSC73XX_SPI is not set
    # CAN SPI interfaces
    # end of CAN SPI interfaces
    # CONFIG_WILC1000_SPI is not set
    # CONFIG_CC33XX_SPI is not set
    # CONFIG_WLCORE_SPI is not set
    CONFIG_TOUCHSCREEN_GOODIX_BERLIN_SPI=m
    # CONFIG_TOUCHSCREEN_SURFACE3_SPI is not set
    CONFIG_TCG_TIS_SPI=m
    CONFIG_TCG_TIS_SPI_CR50=y
    # CONFIG_TCG_TIS_ST33ZP24_SPI is not set
    CONFIG_SPI=y
    # CONFIG_SPI_DEBUG is not set
    CONFIG_SPI_MASTER=y
    CONFIG_SPI_MEM=y
    # SPI Master Controller Drivers
    # CONFIG_SPI_ALTERA is not set
    # CONFIG_SPI_AXI_SPI_ENGINE is not set
    # CONFIG_SPI_BITBANG is not set
    # CONFIG_SPI_CADENCE is not set
    CONFIG_SPI_CADENCE_QUADSPI=y
    # CONFIG_SPI_CADENCE_XSPI is not set
    # CONFIG_SPI_CH341 is not set
    # CONFIG_SPI_DESIGNWARE is not set
    # CONFIG_SPI_GPIO is not set
    # CONFIG_SPI_FSL_SPI is not set
    # CONFIG_SPI_MICROCHIP_CORE_QSPI is not set
    # CONFIG_SPI_OC_TINY is not set
    CONFIG_SPI_OMAP24XX=m
    # CONFIG_SPI_PCI1XXXX is not set
    # CONFIG_SPI_PL022 is not set
    # CONFIG_SPI_SC18IS602 is not set
    # CONFIG_SPI_SIFIVE is not set
    # CONFIG_SPI_SN_F_OSPI is not set
    # CONFIG_SPI_SG2044_NOR is not set
    # CONFIG_SPI_MXIC is not set
    # CONFIG_SPI_THUNDERX is not set
    # CONFIG_SPI_VIRTIO is not set
    # CONFIG_SPI_XCOMM is not set
    # CONFIG_SPI_XILINX is not set
    # CONFIG_SPI_ZYNQMP_GQSPI is not set
    # CONFIG_SPI_AMD is not set
    # SPI Multiplexer support
    # CONFIG_SPI_MUX is not set
    # SPI Protocol Masters
    CONFIG_SPI_SPIDEV=m
    # CONFIG_SPI_LOOPBACK_TEST is not set
    # CONFIG_SPI_TLE62X0 is not set
    # CONFIG_SPI_SLAVE is not set
    CONFIG_SPI_DYNAMIC=y
    # CONFIG_ZL3073X_SPI is not set
    # SPI GPIO expanders
    # end of SPI GPIO expanders
    # CONFIG_SENSORS_LTC2947_SPI is not set
    # CONFIG_MFD_CS40L50_SPI is not set
    # CONFIG_MFD_DA9052_SPI is not set
    # CONFIG_MFD_MC13XXX_SPI is not set
    CONFIG_MFD_RK8XX_SPI=y
    # CONFIG_MFD_TPS65912_SPI is not set
    # CONFIG_MFD_TPS6594_SPI is not set
    # CONFIG_MFD_ARIZONA_SPI is not set
    # CONFIG_MFD_WM831X_SPI is not set
    # CONFIG_MFD_INTEL_M10_BMC_SPI is not set
    # CONFIG_MFD_RSMU_SPI is not set
    # Media SPI Adapters
    # CONFIG_CXD2880_SPI_DRV is not set
    # end of Media SPI Adapters
    # CONFIG_SND_SPI is not set
    CONFIG_SND_SOC_I2C_AND_SPI=m
    # CONFIG_SND_SOC_ADAU1372_SPI is not set
    # CONFIG_SND_SOC_ADAU1761_SPI is not set
    # CONFIG_SND_SOC_CS35L41_SPI is not set
    # CONFIG_SND_SOC_CS35L45_SPI is not set
    # CONFIG_SND_SOC_CS35L56_SPI is not set
    # CONFIG_SND_SOC_CS4271_SPI is not set
    # CONFIG_SND_SOC_ES8328_SPI is not set
    # CONFIG_SND_SOC_PCM179X_SPI is not set
    # CONFIG_SND_SOC_PCM186X_SPI is not set
    # CONFIG_SND_SOC_PCM3060_SPI is not set
    # CONFIG_SND_SOC_PCM3168A_SPI is not set
    # CONFIG_SND_SOC_PCM512x_SPI is not set
    # CONFIG_SND_SOC_SSM2602_SPI is not set
    # CONFIG_SND_SOC_TLV320AIC23_SPI is not set
    # CONFIG_SND_SOC_TLV320AIC32X4_SPI is not set
    # CONFIG_SND_SOC_TLV320AIC3X_SPI is not set
    # CONFIG_SND_SOC_WM8731_SPI is not set
    # CONFIG_SND_SOC_WM8804_SPI is not set
    # CONFIG_HID_GOODIX_SPI is not set
    CONFIG_MMC_SPI=y
    # CONFIG_LEDS_SPI_BYTE is not set
    # SPI RTC drivers
    CONFIG_RTC_I2C_AND_SPI=y
    # SPI and I2C RTC drivers
    CONFIG_HWSPINLOCK=y
    CONFIG_HWSPINLOCK_OMAP=m
    # CONFIG_ADXL313_SPI is not set
    # CONFIG_ADXL345_SPI is not set
    # CONFIG_ADXL355_SPI is not set
    # CONFIG_ADXL367_SPI is not set
    # CONFIG_ADXL372_SPI is not set
    # CONFIG_ADXL380_SPI is not set
    # CONFIG_FXLS8962AF_SPI is not set
    # CONFIG_IIO_KX022A_SPI is not set
    # CONFIG_MMA7455_SPI is not set
    # CONFIG_AD7606_IFACE_SPI is not set
    CONFIG_IIO_ST_SENSORS_SPI=m
    # CONFIG_AD5624R_SPI is not set
    # CONFIG_AD5686_SPI is not set
    # CONFIG_BMI160_SPI is not set
    # CONFIG_BMI270_SPI is not set
    # CONFIG_BMI323_SPI is not set
    # CONFIG_FXOS8700_SPI is not set
    # CONFIG_INV_ICM42600_SPI is not set
    # CONFIG_INV_MPU6050_SPI is not set
    CONFIG_IIO_ST_LSM6DSX_SPI=m
    # CONFIG_BMC150_MAGN_SPI is not set
    CONFIG_IIO_ST_MAGN_SPI_3AXIS=m
    # CONFIG_SENSORS_HMC5843_SPI is not set
    # CONFIG_SENSORS_RM3100_SPI is not set
    # CONFIG_MPL115_SPI is not set
    # CONFIG_FPGA_MGR_ALTERA_PS_SPI is not set
    # CONFIG_FPGA_MGR_XILINX_SPI is not set
    # CONFIG_FPGA_MGR_ICE40_SPI is not set
    # CONFIG_FPGA_MGR_MACHXO2_SPI is not set
    # CONFIG_FPGA_MGR_MICROCHIP_SPI is not set
    # CONFIG_FPGA_MGR_LATTICE_SYSCONFIG_SPI is not set
    # CONFIG_DEBUG_SPINLOCK is not set

  • I Enabled SPI. Than You!


    root@beagleplay-ti:/dev# ls /dev/spidev*
    /dev/spidev0.0

  • I observed that /dev contains devices from ttyS0 to ttyS11. I would like to determine which of these serial ports is mapped to the mikroBUS UART.

    In the device tree, UART nodes are listed from serial@2800000 to serial@2860000. Could you please explain how to identify which ttySx device corresponds to the mikroBUS UART interface?

  • Hi Aparna,
    Typically, the correct way in general to identify such things is to first go to the board schematics, and check which UART instance is being directed to the port you are looking for. Then, in the board dts files, check which node this pinmux is defined, and in which peripheral instance that pinmux node been defined.

    For this case, there is a plausible shortcut, since the beagleplay dts file mentions `mikrobus_uart_pins_default` defined in `main_uart5`.
    Now, you need to find where the `main_uart5` is defined. On tracking the includes within the beagleplay dts, you'll find the following:
    k3-am625-beagleplay.dts -> k3-am625.dtsi -> k3-am62.dtsi -> k3-am62-main.dtsi

    The last file in above defines main_uart5, which will answer your question.

  • Thank you very much. I will check this.