J784S4XEVM: R5F locks up when accessing MCSPI0 registers

Part Number: J784S4XEVM


When I try to read the MCSPI registers (e.g. 0x02100000, or 0x021[1-7]0000) from within an app running on mcu4_0, the R5F appears to lock up. 
When I try to read the same registers using devmem2, the Linux kernel panics. 
What am I doing wrong? 
devmem2_read_0x02170000_panic.txt 
Thanks,

Bruce

 

  • Hello,

    Can you confirm the respective module is turned ON ?

    Let us say if you are using MCSPI0 and is the module powered ON and clock provided ? If not then we cannot read these registers.

    Regards

    Tarun Mukesh

  • The output of the k3conf command: k3conf dump device 376 shows that it was NOT enabled:

    k3conf dump device 376
    |------------------------------------------------------------------------------|
    | VERSION INFO                                                                 |
    |------------------------------------------------------------------------------|
    | K3CONF | (version 0.3-nogit built Fri Oct 06 12:20:16 UTC 2023)              |
    | SoC    | J784S4 SR1.0                                                        |
    | SYSFW  | ABI: 3.1 (firmware version 0x0009 '9.1.2--v09.01.02 (Kool Koala))') |
    |------------------------------------------------------------------------------|
    
    |--------------------------------------------------|
    | Device ID | Device Name       | Device Status    |
    |--------------------------------------------------|
    |   376     | J784S4_DEV_MCSPI0 | DEVICE_STATE_OFF |
    |--------------------------------------------------|
    
    

    I enabled it using the command: 

    k3conf enable device 376 

    And after that  k3conf dump device showed it as enabled and I was able to dump the associated registers.
    I was under the impression that adding the following to k3-j784s4-evm.dts was sufficient to enable the SPI device:

     

    &main_spi0 {
    	status = "okay";
    	pinctrl-0 = <&main_spi0_pins_default>;
    	pinctrl-names = "default";
    };
    

    Since that doesn't work, what to I need to add to my device tree to ensure that it is enabled?

    Thanks,

    Bruce

  • Hello,

    Good to know registers are accessible once module is enabled.

    In k3-j784s4-main.dtsi, you should see spi0 related info .If it is disable there then it gets disabled.

     

    	main_spi0: spi@2100000 {
    		compatible = "ti,am654-mcspi","ti,omap4-mcspi";
    		reg = <0x00 0x02100000 0x00 0x400>;
    		interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
    		#address-cells = <1>;
    		#size-cells = <0>;
    		power-domains = <&k3_pds 376 TI_SCI_PD_EXCLUSIVE>;
    		clocks = <&k3_clks 376 0>;
    		status = "disabled";
    	};

    Regards

    Tarun Mukesh

  • Hi Tarun,

    I changed the k3-j784s4-main.dtsi to set the status to "okay":

    	main_spi0: spi@2100000 {
    		compatible = "ti,am654-mcspi","ti,omap4-mcspi";
    		reg = <0x00 0x02100000 0x00 0x400>;
    		interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
    		#address-cells = <1>;
    		#size-cells = <0>;
    		power-domains = <&k3_pds 376 TI_SCI_PD_EXCLUSIVE>;
    		clocks = <&k3_clks 376 1>;
    		status = "okay";
    	};

    Interestingly, the exact same k3-j784s4-evm.dtb when the 'status = "okay"' is in the k3-j784s4-evm.dts. 


    Unfortunately, when I installed the new k3-j784s4-evm.dtb, the output of k3conf dump device 376 STILL shows that it was NOT enabled.
    I've attached the output of running the following command on the board:

    dtc -Idtb -Odts /boot/dtb/ti/k3-j784s4-evm.dtb > /tmp/k3-j784s4-evm_curr.txt

    k3-j784s4-evm_curr.txt

    Thanks,

    Bruce