Part Number: TDA4VM
Other Parts Discussed in Thread: PCM3168A
Hi there,
I have successfully created a slave SPI device using the device tree with these settings:
in /psdkla/board-support/linux-4.19.94+gitAUTOINC+5a23bc00e0-g5a23bc00e0/arch/arm64/boot/dts/ti/k3-j721e-common-proc-board.dts
pinctrl-single,pins = <
J721E_IOPAD(0x144, PIN_OUTPUT, 4) /* (Y25) PRG0_PRU1_GPO17.SPI3_CLK */
J721E_IOPAD(0x148, PIN_OUTPUT, 4) /* (AA26) PRG0_PRU1_GPO18.SPI3_D0 */
J721E_IOPAD(0x14c, PIN_INPUT, 4) /* (AA29) PRG0_PRU1_GPO19.SPI3_D1 */
J721E_IOPAD(0xd4, PIN_OUTPUT, 4) /* (AB26) PRG0_PRU0_GPO9.SPI3_CS1 */
>;
};
pinctrl-single,pins = <
J721E_IOPAD(0x9c, PIN_INPUT, 4) /* (AC22) PRG1_PRU1_GPO17.SPI6_CLK */
J721E_IOPAD(0xa0, PIN_OUTPUT, 4) /* (AJ22) PRG1_PRU1_GPO18.SPI6_D0 */
J721E_IOPAD(0xa4, PIN_INPUT, 4) /* (AH22) PRG1_PRU1_GPO19.SPI6_D1 */
J721E_IOPAD(0x28, PIN_OUTPUT, 4) /* (AG20) PRG1_PRU0_GPO9.SPI6_CS1 */
>;
};
pinctrl-names = "default";
pinctrl-0 = <&main_spi3_pins_default>;
ti,spi-num-cs = <2>;
status = "okay";
spidev@3{
reg = <1>;
spi-max-frequency = <24000000>;
compatible = "linux,spidev";
};
};
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&main_spi6_pins_default>;
spi-slave;
slave@6{
reg = <0>;
spi-max-frequency = <24000000>;
compatible = "linux,spidev,spi-slave-time";
};
};
In /psdkla/board-support/linux-4.19.94+gitAUTOINC+5a23bc00e0-g5a23bc00e0/arch/arm64/boot/dts/ti/k3-j721e-main.dtsi
compatible = "ti,am654-mcspi","ti,omap4-mcspi";
reg = <0x0 0x2130000 0x0 0x400>;
interrupts = <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&k3_clks 269 1>;
power-domains = <&k3_pds 269 TI_SCI_PD_EXCLUSIVE>;
#address-cells = <1>;
#size-cells = <0>;
};
compatible = "ti,am654-mcspi","ti,omap4-mcspi";
reg = <0x0 0x2160000 0x0 0x400>;
interrupts = <GIC_SPI 190 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&k3_clks 272 1>;
power-domains = <&k3_pds 272 TI_SCI_PD_EXCLUSIVE>;
#address-cells = <1>;
#size-cells = <0>;
};
But sending data or connecting to it using the Linux spidev_test I get the following error:
[ 3475.367623] [0000000000000000] pgd=00000008cab80003, pud=00000008cab80003, pmd=00000008ca080003, pte=0000000000000000
[ 3475.378208] Internal error: Oops: 96000007 [#1] PREEMPT SMP
[ 3475.383761] Modules linked in: xfrm_user xfrm4_tunnel tunnel4 ipcomp xfrm_ipcomp esp4 ah4 af_key xfrm_algo xhci_plat_hcd xhci_hcd usbcore pru_rproc irq_pruss_intc ti_am335x_adc kfifo_buf omap_rng rng_core pruss cdns3 roles udc_core crc32_ce crct10dif_ce snd_soc_j721e_evm j721e_cpsw_virt_mac pvrsrvkm(O) ti_am335x_tscadc ti_k3_r5_remoteproc ntb_hw_epf pruss_soc_bus ntb mhdp8546 pci_endpoint_test sa2ul ti_k3_dsp_remoteproc sha512_generic virtio_rpmsg_bus authenc vxd_dec(O) remoteproc vxe_enc(O) videobuf2_dma_sg cdns3_ti snd_soc_pcm3168a_i2c snd_soc_pcm3168a rti_wdt sch_fq_codel rpmsg_kdrv_switch jailhouse(O) cryptodev(O) cmemk(O) ipv6
[ 3475.439620] Process spidev_test.o (pid: 8393, stack limit = 0x00000000ca9ff258)
[ 3475.446909] CPU: 0 PID: 8393 Comm: spidev_test.o Tainted: G O 4.19.94-g5a23bc00e0 #1
[ 3475.455931] Hardware name: Texas Instruments K3 J721E SoC (DT)
[ 3475.461745] pstate: a0000085 (NzCv daIf -PAN -UAO)
[ 3475.466526] pc : __wake_up_common+0x58/0x170
[ 3475.470781] lr : __wake_up_locked+0x18/0x20
[ 3475.474947] sp : ffff00000d8cfcf0
[ 3475.478247] x29: ffff00000d8cfcf0 x28: ffff80084a8e2880
[ 3475.483542] x27: 0000000000000000 x26: 0000000000000000
[ 3475.488837] x25: 0000000000000001 x24: 0000000000000000
[ 3475.494131] x23: 0000000000000000 x22: 0000000000000000
[ 3475.499426] x21: 0000000000000003 x20: ffff800841c8d7c0
[ 3475.504720] x19: ffff800841c8d7b8 x18: 0000000000000000
[ 3475.510015] x17: 0000000000000000 x16: 0000000000000000
[ 3475.515309] x15: 0000000000000000 x14: 0000000000000000
[ 3475.520603] x13: 0000000000000000 x12: 0000000000000000
[ 3475.525898] x11: 0000000000000000 x10: 0000000000000000
[ 3475.531192] x9 : 000000000000000f x8 : 0000000000000000
[ 3475.536487] x7 : ffffffffffffffe8 x6 : ffff800847f6e000
[ 3475.541781] x5 : 0000000000000000 x4 : 0000000000000000
[ 3475.547076] x3 : 0000000000000000 x2 : 0000000000000001
[ 3475.552370] x1 : 0000000000000003 x0 : 0000000000000000
[ 3475.557664] Call trace:
[ 3475.560098] __wake_up_common+0x58/0x170
[ 3475.564006] __wake_up_locked+0x18/0x20
[ 3475.567827] complete+0x48/0x68
[ 3475.570956] omap2_mcspi_slave_abort+0x24/0x48
[ 3475.575384] spi_slave_abort+0x20/0x30
[ 3475.579121] spidev_release+0x44/0xb8
[ 3475.582769] __fput+0x88/0x1b0
[ 3475.585811] ____fput+0xc/0x18
[ 3475.588853] task_work_run+0x90/0xb0
[ 3475.592414] do_notify_resume+0x108/0x110
[ 3475.596408] work_pending+0x8/0x10
[ 3475.599797] Code: aa0503f8 f9002bfb aa0403f7 5280001b (f9400cf3)
[ 3475.605872] ---[ end trace 4e7c9fc7368662cd ]---
[ 3475.610524] note: spidev_test.o[8393] exited with preempt_count 1
A help from TI would be nice, so I can find out what is not working, If I am guessing correctly the Memory Areas are configured wrongly.
Thanks a lot
Pouyan