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.

DRA821U: MCU_SPI driver loading issue

Part Number: DRA821U

Tool/software:

Hi Team,

I am working on a DRA821U base custom board. Am observing some issue while configuring the mcu_spi1,when am setting CONFIG_SPI_OMAP24XX=y in defconfig kernel panic is observed,kindly help me to resolve this issue

SDK : Linux SDK_09.02

[2024-10-09 10:01:29] [ 1.336557] 2810000.serial: ttyS3 at MMIO 0x2810000 (irq = 252, base_baud = 3000000) is a 8250
[2024-10-09 10:01:29] [ 1.346314] Unable to handle kernel paging request at virtual address ffffffffffffffed
[2024-10-09 10:01:29] [ 1.354228] Mem abort info:
[2024-10-09 10:01:29] [ 1.357012] ESR = 0x0000000096000004
[2024-10-09 10:01:29] [ 1.360750] EC = 0x25: DABT (current EL), IL = 32 bits
[2024-10-09 10:01:29] [ 1.366047] SET = 0, FnV = 0
[2024-10-09 10:01:29] [ 1.369090] EA = 0, S1PTW = 0
[2024-10-09 10:01:29] [ 1.372220] FSC = 0x04: level 0 translation fault
[2024-10-09 10:01:29] [ 1.377090] Data abort info:
[2024-10-09 10:01:29] [ 1.379960] ISV = 0, ISS = 0x00000004
[2024-10-09 10:01:29] [ 1.383783] CM = 0, WnR = 0
[2024-10-09 10:01:29] [ 1.386740] swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000082fae000
[2024-10-09 10:01:29] [ 1.393424] [ffffffffffffffed] pgd=0000000000000000, p4d=0000000000000000
[2024-10-09 10:01:29] [ 1.400201] Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
[2024-10-09 10:01:29] [ 1.406449] Modules linked in:
[2024-10-09 10:01:29] [ 1.409493] CPU: 1 PID: 53 Comm: kworker/u4:2 Not tainted 6.1.80-ti-g1c154b1fe4c4 #2
[2024-10-09 10:01:29] [ 1.417303] Hardware name: Texas Instruments J7200 EVM (DT)
[2024-10-09 10:01:29] [ 1.422857] Workqueue: events_unbound deferred_probe_work_func
[2024-10-09 10:01:29] [ 1.428687] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[2024-10-09 10:01:29] [ 1.435629] pc : clk_get_rate+0x20/0x80
[2024-10-09 10:01:29] [ 1.439454] lr : clk_get_rate+0x20/0x80
[2024-10-09 10:01:29] [ 1.443275] sp : ffff80000981bb20
[2024-10-09 10:01:29] [ 1.446576] x29: ffff80000981bb20 x28: 0000000000000000 x27: 0000000000000000
[2024-10-09 10:01:29] [ 1.453694] x26: ffff000000266c00 x25: ffff000000266c10 x24: ffff800008ef2cc0
[2024-10-09 10:01:29] [ 1.460811] x23: ffff800008ef2cc8 x22: 0000000000000000 x21: ffff000000ce5000
[2024-10-09 10:01:29] [ 1.467928] x20: 0000000000000060 x19: ffffffffffffffed x18: ffffffffffffffff
[2024-10-09 10:01:29] [ 1.475045] x17: 203d20647561625f x16: 65736162202c3235 x15: ffff80008981b9ed
[2024-10-09 10:01:29] [ 1.482162] x14: 000000000000016f x13: 0000000000000001 x12: 0000000000000000
[2024-10-09 10:01:29] [ 1.489279] x11: 0000000000000001 x10: 00000000000009b0 x9 : ffff80000981b8b0
[2024-10-09 10:01:29] [ 1.496396] x8 : ffff00007fbae180 x7 : 0000000000000000 x6 : ffff000000f5aac0
[2024-10-09 10:01:29] [ 1.503512] x5 : ffff000000f5aac0 x4 : 0000000000000000 x3 : ffff800009267f20
[2024-10-09 10:01:29] [ 1.510630] x2 : ffff000000f5aac0 x1 : ffff000000f5aac0 x0 : 0000000000000001
[2024-10-09 10:01:29] [ 1.517747] Call trace:
[2024-10-09 10:01:29] [ 1.520181] clk_get_rate+0x20/0x80
[2024-10-09 10:01:29] [ 1.523656] omap2_mcspi_probe+0x3a4/0x57c
[2024-10-09 10:01:29] [ 1.527742] platform_probe+0x68/0xe0
[2024-10-09 10:01:29] [ 1.531391] really_probe+0xbc/0x2dc
[2024-10-09 10:01:30] [ 1.534956] __driver_probe_device+0x78/0x114
[2024-10-09 10:01:30] [ 1.539300] driver_probe_device+0xd8/0x15c
[2024-10-09 10:01:30] [ 1.543469] __device_attach_driver+0xb8/0x134
[2024-10-09 10:01:30] [ 1.547898] bus_for_each_drv+0x7c/0xdc
[2024-10-09 10:01:30] [ 1.551720] __device_attach+0xac/0x1d0
[2024-10-09 10:01:30] [ 1.555543] device_initial_probe+0x14/0x20
[2024-10-09 10:01:30] [ 1.559711] bus_probe_device+0x9c/0xa4
[2024-10-09 10:01:30] [ 1.563533] deferred_probe_work_func+0x88/0xc0
[2024-10-09 10:01:30] [ 1.568049] process_one_work+0x1d0/0x320
[2024-10-09 10:01:30] [ 1.572049] worker_thread+0x2c8/0x444
[2024-10-09 10:01:30] [ 1.575786] kthread+0x10c/0x110
[2024-10-09 10:01:30] [ 1.579001] ret_from_fork+0x10/0x20
[2024-10-09 10:01:30] [ 1.582565] Code: d2800013 b40001a0 aa0003f3 97fff669 (f9400273)
[2024-10-09 10:01:30] [ 1.588640] ---[ end trace 0000000000000000 ]---

Best regards,
Madhusankar

  • Hi Madhusankar,

    Could you share the device tree changes, if any? Some things I am suspecting are issues with pin configuration or clock. Especially clock since the kernel panic is happening with some clock related function.

    Regards, 

    Takuma

  • Hi Takuma,

    please find the device tree settings for MCU_SPI.

    &main_pmx0 {
            tpm_reset_pins_default: tpm-reset-pins-default {
                    pinctrl-single,pins = <
                    J721E_IOPAD(0xc0, PIN_INPUT, 7) /* (W3) SPI0_CS0.UART0_CTSn */
                    >;
            };
    };

    &wkup_pmx2 {
            spi_pins_default: spi-pins-default {
                    pinctrl-single,pins = <
                    J721E_WKUP_IOPAD(0x58, PIN_OUTPUT, 0) /* (B18) WKUP_GPIO0_0.MCU_SPI1_CLK */
                    J721E_WKUP_IOPAD(0x5c, PIN_OUTPUT, 0) /* (B19) WKUP_GPIO0_1.MCU_SPI1_D0 */
                    J721E_WKUP_IOPAD(0x60, PIN_INPUT, 0) /* (D14) WKUP_GPIO0_2.MCU_SPI1_D1 */
                    >;
            };
            chipselect0: chipselect0-pins-defaul {
                    pinctrl-single,pins = <
                    J721E_WKUP_IOPAD(0x64, PIN_OUTPUT, 0) /* (B21) WKUP_GPIO0_3.MCU_SPI1_CS0 */
                    >;
            };
            chipselect1: chipselect1-pins-defaul {
                    pinctrl-single,pins = <
                    J721E_WKUP_IOPAD(0x6c, PIN_OUTPUT, 2) /* (B16) WKUP_GPIO0_5.MCU_MCAN1_RX */
                    >;
            };
    };

    &wkup_pmx1 {
            d5_pins_default: d5-pins-default {
            pinctrl-single,pins = <
                    J721E_WKUP_IOPAD(0x4, PIN_OUTPUT, 7) /* (D5)*/
                    >;
            };
    };
    &wkup_pmx0 {
            b7_pins_default: b7-pins-default {
            pinctrl-single,pins = <
                    J721E_WKUP_IOPAD(0x8, PIN_OUTPUT, 2) /* (B7)*/
                    >;
            };
    };

    &mcu_spi1 {
            status = "okay";
        compatible = "ti,am654-mcspi\0ti,omap4-mcspi";
            pinctrl-names = "default";
            pinctrl-0 = <&spi_pins_default &d5_pins_default &b7_pins_default &chipselect1 &chipselect0>;
            bus-num = <0>;
            ti,spi-num-cs = <2>;
            ti,pindir-d0-out-d1-in;
            spi-sram@0 {
                    status = "okay";
                    #address-cells = <1>;
                    #size-cells = <1>;
                    compatible = "microchip,mchp23a512";
                    reg = <0>;
                    spi-max-frequency = <20000000>;
            };
            tpm_tis@1 {
                    status = "okay";
                    pinctrl-names = "default";
                    pinctrl-0 = <&tpm_reset_pins_default>;
                    reg = <1>;
                    compatible = "tcg,tpm_tis-spi";
                    reset-gpio = <&main_gpio0 51 GPIO_ACTIVE_LOW>;
                    spi-max-frequency = <16000000>;
            };


    };

  • Hi Madhusankar,

    Looks to be a bug in our dts file. Could you apply this patch: https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/0001_2D00_update_2D00_mcu_5F00_spi1_2D00_clock_2D00_to_2D00_DEV_5F00_MCU_5F00_MCSPI1_5F00_VBUSP_5F00_CLK.patch

    Regards,

    Takuma

  • Hi Takuma,

    Thanks for your support the provided patch file has fixed the crash issue.But now an facing issue with slave devices , there are two slaves connected to mcu_spi but only one slave is detecting am getting the following error message.Kindly help me to resolve the issue

    "tpm_tis_spi: probe of spi0.1 failed with error -110"

    Best,Regards

    Madhusankar

  • Hi Madhusankar,

    As a disclaimer, we can help with Linux generic issues or TI SoC specific issues relatively well, but this will fall slightly out of TI expertise as tpm_tis_spi looks to be a driver for a Trusted Platform Module from either STM or Infineon. 

    In any case, what I can say with the current information given:

    What I would like to know is:

    • What device is being used
    • Could you share the full dmesg logs?
    • Do you know if there are some special kernel configuration that needs to be enabled for this driver?

    Regards,

    Takuma