【问题标题】:model field of root node in device tree设备树根节点的模型字段
【发布时间】:2018-02-18 12:30:02
【问题描述】:

我正在探索设备树。查看 imx6l-sabresd.dts

/dts-v1/;

#include "imx6dl.dtsi"
#include "imx6qdl-sabresd.dtsi"

/ {
        model = "Freescale i.MX6 DualLite SABRE Smart Device Board";
        compatible = "fsl,imx6dl-sabresd", "fsl,imx6dl";
};

根节点中有“模型”字段。这个字段几乎出现在每个设备树中,但是当我用 grep 查找谁在阅读这个模型时。只有飞思卡尔 CPU 机器代码在访问它。这个字段不是强制性的吗?

jamal@jamal:~/rpi/rpi-build/tmp/work-shared/raspberrypi3/kernel-source$ grep -nr "of_property_read_string(root,"
arch/arm/mach-imx/cpu.c:91: ret = of_property_read_string(root, "model", &soc_dev_attr->machine);
arch/arm/mach-mxs/mach-mxs.c:469:   ret = of_property_read_string(root, "model", &soc_dev_attr->machine); 

谁能解释一下这个领域的意义。

【问题讨论】:

    标签: linux linux-kernel arm device-tree


    【解决方案1】:

    搜索 Linux 源代码找到了内核使用模型字段的位置。它正在控制台上打印值。

    ./arch/arm/kernel/devtree.c:236:       
     model = of_get_flat_dt_prop(dt_root, "model", NULL);
     pr_info("Machine: %s, model: %s\n", mdesc_best->name, model);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-06-08
      • 1970-01-01
      • 2020-11-02
      • 2021-07-09
      • 1970-01-01
      • 1970-01-01
      • 2019-04-15
      相关资源
      最近更新 更多