You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Device Tree中#address-cells与#size-cells配置异常求助

解决STM32MP135设备树中TLV320AIC3110节点编译警告问题

你的问题出在ports/port节点的属性层级错误,以及多余的reg属性导致dtc解析混乱,下面是具体修正方案:

问题根源

  1. #address-cells和#size-cells应该属于ports父节点,用来定义子port节点的地址编码规则,你错误地把它们放在了port@0节点内,导致dtc工具无法识别,只能使用默认值,进而触发格式不匹配警告
  2. port@0节点不需要reg属性,graph框架下的port节点,其编号已经通过节点名的@0声明,额外添加reg会和父节点的地址规则冲突

修正后的设备树代码

&i2s1 {
    ...
    i2s1_port: port {
        i2s1_endpoint: endpoint {
            remote-endpoint = <&tlv320aic3110_tx_endpoint>;
            format = "i2s";
            mclk-fs = <256>;
        };
    };
};

&i2c1 {
    ...
    codec: codec@18 {
        ...
        ports {
            #address-cells = <1>;
            #size-cells = <0>;
            port@0 {
                tlv320aic3110_tx_endpoint: endpoint {
                    remote-endpoint = <&i2s1_endpoint>;
                };
            };
        };
    };
};

关键修正点说明

  • 把#address-cells = <1>;和#size-cells = <0>;移到ports节点下,让dtc正确识别子port节点的地址编码规则
  • 删除port@0节点内的reg = <0>;属性,避免和graph框架的port编号规则冲突
  • 保持endpoint的remote-endpoint引用不变,确保I2S链路的连接关系正确

重新编译设备树,这些警告应该会全部消失。

内容的提问来源于stack exchange,提问作者jesusjimsa

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.09 09:20:24