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.

[参考译文] AM623:I2C 轮询模式 DTS 配置

Guru**** 2379650 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1502031/am623-i2c-polling-mode-dts-configuration

器件型号:AM623

工具/软件:

如何在 DTS 中将 I2C 从中断配置为轮询模式?

驱动程序中有轮询模式、但未找到在 DTS 中进行配置的方法。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Tony、

    今天我没有时间看这个主题。 如果我周四没有回复、请 ping 通该线程。

    此致、

    Nick

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    ping~~~

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Tony、

    感谢您的 ping。

    我知道可以肯定地在中断或轮询模式下使用 CAN 接口(实际上、在 AM62x Linux 上只能通过轮询模式与 MCU 域 CAN 交互)。 对于该特定驱动程序和一组器件树节点、只需从器件树文件中删除中断和中断名称条目:

    Documentation/devicetree/bindings/net/can/Bosch、m_can.yaml

        // Example with interrupts
        #include <dt-bindings/clock/imx6sx-clock.h>
        can@20e8000 {
          compatible = "bosch,m_can";
          reg = <0x020e8000 0x4000>, <0x02298000 0x4000>;
          reg-names = "m_can", "message_ram";
          interrupts = <0 114 0x04>, <0 114 0x04>;
          interrupt-names = "int0", "int1";
          clocks = <&clks IMX6SX_CLK_CANFD>,
                   <&clks IMX6SX_CLK_CANFD>;
          clock-names = "hclk", "cclk";
          bosch,mram-cfg = <0x0 0 0 32 0 0 0 1>;
    
          can-transceiver {
            max-bitrate = <5000000>;
          };
        };
    
      - |
        // Example with timer polling
        #include <dt-bindings/clock/imx6sx-clock.h>
        can@20e8000 {
          compatible = "bosch,m_can";
          reg = <0x020e8000 0x4000>, <0x02298000 0x4000>;
          reg-names = "m_can", "message_ram";
          clocks = <&clks IMX6SX_CLK_CANFD>,
                   <&clks IMX6SX_CLK_CANFD>;
          clock-names = "hclk", "cclk";
          bosch,mram-cfg = <0x0 0 0 32 0 0 0 1>;
    
          can-transceiver {
            max-bitrate = <5000000>;
          };
        };
    

    另一方面、I2C 绑定文档声称中断是器件树节点的必需属性:
    Documentation/devicetree/bindings/i2c/ti、OMAP4-i2c.YAML

     i2c-OMAP-Lc 驱动程序本身肯定具有执行轮询的调用、正如您所确定的那样。

    i2c-OMAP 驱动程序是一个低级驱动程序、用于与 I2C 外设交互、客户将需要使用更高级别的驱动程序来实际与其 I2C 外设交互。 我期望更高级别的驱动程序中的调用将决定是使用轮询还是中断-即使为 I2C 启用了中断、如果更高级别的驱动程序进行转换为 MASTER_XFER_ATOMIC 的调用、那么我希望使用轮询方法。

    此致、

    Nick