Ticket Name: TDA4VM: Mcspi4 is slave in A72 Linux Unable to send and receive data Query Text: Part Number: TDA4VM Other Parts Discussed in Thread: TDA2 HI. sdk:ti-processor-sdk-linux-j7-evm-07_03_00_05 mcu_ Mcspi2 (Master) and mcspi4 (main domain mcu2-0) can send and receive. If mcspi4 does a slave on A72, it cannot be sent or received. e2e.ti.com/.../tda4vm-slave-mode-tda4vm-mcspi devicetree: main_spi4 { pinctrl-names = "default"; compatible = "ti,am654-mcspi","ti,omap4-mcspi"; reg = <0x0 0x2140000 0x0 0x400>; interrupts = ; clocks = <&k3_clks 270 1>; power-domains = <&k3_pds 270 TI_SCI_PD_EXCLUSIVE>; #address-cells = <1>; #size-cells = <0>; status="okay"; dmas = <&main_udmap 0xc624>, <&main_udmap 0x4624>; dma-names = "tx0", "rx0"; spi-slave; slave@0 { spi-max-frequency = <24000000>; reg = <0>; compatible = "linux,spidev"; }; Device node generated. root@j7-evm:/# ls /dev/spidev4.0 -l crw------- 1 root root 153, 0 Aug 20 13:44 /dev/spidev4.0 A72 Linux reads some register values of mcspi4: Read at address 0x02140000 : 0x40301A0B Read at address 0x02140004 : 0x00000009 Read at address 0x02140010 : 0x00000008 Read at address 0x02140110 : 0x00000015 Read at address 0x02140114 : 0x00000001 Read at address 0x02140118 : 0x00010001 Read at address 0x0214011C : 0x00020000 Read at address 0x02140120 : 0x00000001 Read at address 0x02140124 : 0x00000000 Read at address 0x02140128 : 0x00000004 Read at address 0x0214012C : 0x3811C3BC Read at address 0x02140130 : 0x0000002A Read at address 0x02140134 : 0x00000501 Read at address 0x02140138 : 0x00000000 Read at address 0x0214013C : 0x00000000 Can mcspi4 send and receive data by interrupt as a slave? Responses: Hi gj y, I really doubt the Linux supports McSPI in slave mode. So not a limitation from McSPI module, but i think driver is not supported on Linux. Can you check it on RTOS? RTOS driver supports McSPI in slave mode. Regards, Brijesh Hi Brijesh Mcspi slave mode polling is supported in RTOS, and the interrupt mode cannot be sent or received. About driver is not supported on Linux, The mcspi slave of tda2 is supported on Linux. Hi gj y, Even McSPI slave mode in interrupt mode can be supported in RTOS. Do you see any issue in enabling it? Regards, Brijesh Hi.Brijesh static void SPI_InitConfig(uint32_t instance, uint32_t chn) { SPI_HWAttrs spi_cfg; /* Get the default SPI init configurations */ SPI_socGetInitCfg(instance, &spi_cfg); /* Set the default SPI init configurations */ SPI_InitConfigDefault(&spi_cfg, chn); /* interrupt enabled */ spi_cfg.enableIntr = true; spi_cfg.edmaHandle = NULL; spi_cfg.dmaMode = FALSE; /* Transmit/Receive mode */ spi_cfg.chnCfg[chn].trMode = MCSPI_TX_RX_MODE; /* Set Pin direction */ spi_cfg.chnCfg[chn].dataLineCommMode = MCSPI_DATA_LINE_COMM_MODE_1; /* Set the SPI init configurations */ SPI_socSetInitCfg(instance, &spi_cfg); } /* interrupt enabled */ spi_cfg.enableIntr = true; if interrupt enabled spi_cfg.enableIntr = true; Can not send or receive . If spi_cfg.enableIntr =FALSE; Data can be received and sent. Hi gj y, I think for the interrupt mode to work for McSPI4 on main domain R5F, we would need to configure R5F Interrupt router. In TRM, i see that McSPI4 interrupt is connected to Interrupt 196 of the interrupt router input. Can you select one irq number for R5F, configure it in the output irq in interrupt router and use it in the driver? Regards, Brijesh HI. Brijesh The interrupt configuration is as follows: #define CSLR_MCU_R5FSS0_CORE1_INTR_MAIN2MCU_LVL_INTRTR0_OUTL_36 (196U) Mcspi 4 can't send and receive data. Read McSPI4 reg: Read at address 0x02140000 value: 0x40301A0B Read at address 0x02140004 value: 0x00000009 Read at address 0x02140010 value: 0x00000004 Read at address 0x02140110 value: 0x00000308 Read at address 0x02140114 value: 0x00000001 Read at address 0x02140118 value: 0x0001000E Read at address 0x0214011C value: 0x00000000 Read at address 0x02140120 value: 0x00000001 Read at address 0x02140124 value: 0x00000000 Read at address 0x02140128 value: 0x00000004 Read at address 0x0214012C value: 0x380103C0 Read at address 0x02140130 value: 0x0000004F Read at address 0x02140134 value: 0x00000001 Read at address 0x02140138 value: 0x00000000 Read at address 0x0214013C value: 0x00000013 Read at address 0x0214017C value: 0x00141313 Read at address 0x02140180 value: 0x00000000 Read at address 0x021401A0 value: 0x00000000 MCSPI_IRQSTATUS Register(0x02140118) value 0x0001000E. Hi gj y, On which R5F core are you trying to enable interrupt for McSPI4 instance? This macro is for main2mcu domain interrupt router.. Regards, Brijesh Hi.Brijesh main domain mcu2-1 core to enable interrupt for McSPI4 #define CSLR_R5FSS1_INTROUTER0_IN_MCSPI4_INTR_SPI_0 (197U) Mcspi 4 can't send and receive data. Hi gj y, I am bit confused here. Are you trying to access mcspi4 from Linux (A72) or RTOS(R5F)? I think Linux does not support mcspi in slave mode, so suggestion was to use R5F ie PDK based RTOS driver for mcspi4. Regards, Brijesh