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.

SK-TDA4VM: 有关40引脚扩展spi设备树的启用

Part Number: SK-TDA4VM

我在官方提供的linux sdk中找到k3-j721e-sk.dti文件,但是里面似乎没有spi的相关节点内容,我们是要在里面自己去添加新的编写代码吗,在edge ai 文档中有k3-j721e-sk-rpi-hdr-ehrpwm.dtbo 40引脚叠加文件,但是默认配置没有spi,但是在用户指南里面指出40引脚中相应引脚为spi对应引脚,那么我现在应该去修改k3-j721e-sk.dti还是k3-j721e-sk-rpi-hdr-ehrpwm.dtbo,如何才能启用spi设备树,似乎官方文档指明有冲突,spi40引脚是否存在引脚复用,引脚复用模式在哪里查找

  • 您好,

    已经收到了您的案例,调查需要些时间,感谢您的耐心等待。

  •  我们尝试在k3-j721e-sk.dti文件的
    &main_pmx0 中建立spi,选择引脚复用模式为3
    &main_pmx0 {
    sk_mcspi4_pins_default: sk-mcspi4-pins-default-0 {
            pinctrl-single,pins = <
                /* offset, properties, mux_mode */
                /* V25 (SPI5 MOSI) - 偏移量 0x198 */
                J721E_IOPAD(0x198, PIN_OUTPUT, 3)

                /* W24 (SPI5 MISO) - 偏移量 0x1B0 */
                J721E_IOPAD(0x1B0, PIN_INPUT_PULLUP, 3)

                /* W29 (SPI5 SCLK) - 偏移量 0x1A0 */
                J721E_IOPAD(0x1A0, PIN_OUTPUT, 3)

                /* W27 (SPI5 CS0) - 偏移量 0x19C */
                J721E_IOPAD(0x19C, PIN_OUTPUT, 3)

                /* W25 (SPI5 CS1) - 偏移量 0x1B4, 现在启用这个片选 */
                /* J721E_IOPAD(0x1B4, PIN_OUTPUT, 3)*/
            >;
        };
    同时注释掉了也是在&main_pmx0下的部分部分与spi冲突的引脚
    rpi_header_gpio0_pins_default: rpi-header-gpio0-default-pins {
            pinctrl-single,pins = <
                J721E_IOPAD(0x01C, PIN_INPUT, 7) /* (AD22) PRG1_PRU0_GPO6.GPIO0_7 */
                J721E_IOPAD(0x120, PIN_INPUT, 7) /* (AA28) PRG0_PRU1_GPO8.GPIO0_71 */
                J721E_IOPAD(0x14C, PIN_INPUT, 7) /* (AA29) PRG0_PRU1_GPO19.GPIO0_82 */
                J721E_IOPAD(0x02C, PIN_INPUT, 7) /* (AD21) PRG1_PRU0_GPO10.GPIO0_11 */
                /*J721E_IOPAD(0x198, PIN_INPUT, 7) /* (V25) RGMII6_TD1.GPIO0_101 */
                /*J721E_IOPAD(0x1B0, PIN_INPUT, 7) /* (W24) RGMII6_RD1.GPIO0_107 */
                /*J721E_IOPAD(0x1A0, PIN_INPUT, 7) /* (W29) RGMII6_TXC.GPIO0_103 */
                J721E_IOPAD(0x008, PIN_INPUT, 7) /* (AG22) PRG1_PRU0_GPO1.GPIO0_2 */
                J721E_IOPAD(0x1D0, PIN_INPUT, 7) /* (AA3) SPI0_D1.GPIO0_115 */
                J721E_IOPAD(0x11C, PIN_INPUT, 7) /* (AA24) PRG0_PRU1_GPO7.GPIO0_70 */
                J721E_IOPAD(0x148, PIN_INPUT, 7) /* (AA26) PRG0_PRU1_GPO18.GPIO0_81 */
                J721E_IOPAD(0x004, PIN_INPUT, 7) /* (AC23) PRG1_PRU0_GPO0.GPIO0_1 */
                J721E_IOPAD(0x014, PIN_INPUT, 7) /* (AH23) PRG1_PRU0_GPO4.GPIO0_5 */
                J721E_IOPAD(0x020, PIN_INPUT, 7) /* (AE20) PRG1_PRU0_GPO7.GPIO0_8 */
                /*J721E_IOPAD(0x19C, PIN_INPUT, 7) /* (W27) RGMII6_TD0.GPIO0_102 */
                J721E_IOPAD(0x1B4, PIN_INPUT, 7) /* (W25) RGMII6_RD0.GPIO0_108 */
                J721E_IOPAD(0x188, PIN_INPUT, 7) /* (Y28) RGMII6_TX_CTL.GPIO0_97 */
                J721E_IOPAD(0x00C, PIN_INPUT, 7) /* (AF22) PRG1_PRU0_GPO2.GPIO0_3 */
                J721E_IOPAD(0x010, PIN_INPUT, 7) /* (AJ23) PRG1_PRU0_GPO3.GPIO0_4 */
                J721E_IOPAD(0x178, PIN_INPUT, 7) /* (U27) RGMII5_RD3.GPIO0_93 */
                J721E_IOPAD(0x17C, PIN_INPUT, 7) /* (U24) RGMII5_RD2.GPIO0_94 */
                J721E_IOPAD(0x190, PIN_INPUT, 7) /* (W23) RGMII6_TD3.GPIO0_99 */
                J721E_IOPAD(0x18C, PIN_INPUT, 7) /* (V23) RGMII6_RX_CTL.GPIO0_98 */
            >;
        };
    然后创立新的节点
    &main_spi4 {
        status = "okay";
        pinctrl-names = "default";
        pinctrl-0 = <&sk_mcspi4_pins_default>; /* 引用上面在 &main_pmx0 中定义的引脚配置 */
       
        /* 为用户空间访问 main_spi4 的片选0 (CS0) 配置spidev */
        /* spidev设备名会是 /dev/spidev4.0 */
        spidev@0 { // CS0
            compatible = "linux,spidev";
            reg = <0>;                    /* 对应片选0 (CS0) */
            spi-max-frequency = <24000000>; /* 最大SPI时钟频率*/
        };

    };将编译后的k3-j721e-sk.dto文件复制到板子正确的路径下,但是重新启动板子后,板子串口打印出

    ti_sci system-controller@44083000: ti_sci_get_response: Message receive failed. ret = -110

    ti-sci-pm-domains power-controller: ti_sci_power_domain_on: get_device(113) failed (-110)

    failed to set vqmmc-voltage to 3.3V

    failed to set vqmmc-voltage to 3.3V

    failed to set vqmmc-voltage to 3.3V

    failed to set vqmmc-voltage to 3.3V

    failed to set vqmmc-voltage to 1.8V

    failed to set vqmmc-voltage to 1.8V

    failed to set vqmmc-voltage to 1.8V

    failed to set vqmmc-voltage to 3.3V

    failed to set vqmmc-voltage to 3.3V

    failed to set vqmmc-voltage to 3.3V

    Card did not respond to voltage select! : -110

    mmc_init: -95, time 20115

    ti_sci system-controller@44083000: ti_sci_get_response: Message receive failed. ret = -110

    ti-sci-pm-domains power-controller: ti_sci_power_domain_on: get_device(113) failed (-110)

    failed to set vqmmc-voltage to 3.3V

    failed to set vqmmc-voltage to 3.3V

    failed to set vqmmc-voltage to 3.3V

    failed to set vqmmc-voltage to 3.3V

    failed to set vqmmc-voltage to 3.3V

    failed to set vqmmc-voltage to 3.3V

    Card did not respond to voltage select! : -110

    mmc_init: -95, time 10067

    ** Bad device specification mmc 1 **

    "Synchronous Abort" handler, esr 0x96000004, far 0xe90000ff001150

    elr: 00000000808395a8 lr : 00000000808395e8 (reloc)

    elr: 00000000ffef75a8 lr : 00000000ffef75e8

    x0 : 00000000fde9f720 x1 : 00e90000ff001148

    x2 : 00000000fde9dda0 x3 : 0000000000000065

    x4 : 00000000fde9de58 x5 : 0000000000000065

    x6 : 0000000000001150 x7 : 00000000fde79760

    x8 : 0000000000001140 x9 : 00000000fde78b5c

    x10: 0000000000000003 x11: 000000000000110c

    x12: 0000000000000000 x13: 00000000fde79760

    x14: 00000000ffffffff x15: 00000000fde77f4c

    x16: 00000000ffedf894 x17: 0000000000000000

    x18: 00000000fde9dda0 x19: 000000000000110c

    x20: 00000000fde78ce8 x21: 00000000fde78d50

    x22: 00000000fdeb3ae0 x23: 00000000fde78cb8

    x24: 00000000fdeb1960 x25: 0000000000000000

    x26: 00000000fdeb1940 x27: 0000000000000000

    x28: 00000000fdeb3c30 x29: 00000000fde78c50


    Code: 54000061 d2800000 d65f03c0 f9400401 (b9400821)

    Resetting CPU ...


    resetting ...

    修改后的设备树 (.dtb) 文件导致了MMC1(SD卡)初始化失败,从而使系统无法正常启动,那我究竟如何修改才能实现spi,相关的复用模式和编写形式仿照的k3-j721e-sk.dti文件。
  • 您好,

         如果你不在 dtsi 中添加 spi 节点,板子能够正常启动吗?

         请分享通过和失败情况的完整日志。

          从上述日志看,DM 似乎没有响应,请检查 DM 是否还在运行。