设备树用户使用手册

在linux-4.9.31\Documentation\devicetree下有个usage-model.txt 里面有个网址

[1] http://devicetree.org/Device_Tree_Usage


下面有个目录




1.基本数据结构

2.基本内容(基本概念)

3.如何编码工作

4.中断如何工作

5.设备数特定数据

6.设备树特殊节点

7.设备树高级主题

8.注意事项


1.基本数据格式

/ {
    node1 {
        a-string-property = "A string";
        a-string-list-property = "first string", "second string";
        // hex is implied in byte arrays. no '0x' prefix is required
        a-byte-data-property = [01 23 34 56];
        child-node1 {
            first-child-property;
            second-child-property = <1>;
            a-string-property = "Hello, world";
        };
        child-node2 {
        };
    };
    node2 {
        an-empty-property;
        a-cell-property = <1 2 3 4>; /* each number (cell) is a uint32 */
        child-node1 {
        };
    };
};

This tree is obviously pretty useless because it doesn't describe anything, but it does show the structure of nodes and properties. There is:

  • a single root node: "/"
  • a couple of child nodes: "node1" and "node2"
  • a couple of children for node1: "child-node1" and "child-node2"
  • a bunch of properties scattered through the tree.

Properties are simple key-value pairs where the value can either be empty or contain an arbitrary byte stream. While data types are not encoded into the data structure, there are a few fundamental data representations that can be expressed in a device tree source file.

  • Text strings (null terminated) are represented with double quotes:
    • string-property = "a string";
  • 'Cells' are 32 bit unsigned integers delimited by angle brackets:
    • cell-property = <0xbeef 123 0xabcd1234>;
  • Binary data is delimited with square brackets:
    • binary-property = [0x01 0x23 0x45 0x67];
  • Data of differing representations can be concatenated together using a comma:
    • mixed-property = "a string", [0x01 0x23 0x45 0x67], <0x12345678>;
  • Commas are also used to create lists of strings:
    • string-list = "red fish", "blue fish";


### 回答1: Linux设备树使用手册(注释版)是一份非常有用的资源,可以帮助用户了解和掌握Linux设备树的相关知识。这份手册是一个注释版,它包含了非常详细的注释,使得用户可以更快地理解和掌握设备树的使用。 设备树是用于描述硬件信息的一种数据结构。在Linux系统中,设备树是将系统硬件信息映射到内核空间的一种机制。它可以方便地解决硬件之间的依赖关系和相互作用问题。同时,它也可以提高系统的性能和可靠性。 在这份手册中,用户可以学习到如何创建和编译设备树文件、如何在设备树中定义设备节点、如何使用设备节点来控制硬件等等。此外,该手册还提供了相关的代码示例和步骤说明,使得用户可以更加容易地跟随和理解。 总之,Linux设备树使用手册(注释版)是一份非常有用的工具,不仅可以帮助用户更好地理解设备树的概念和原理,也可以帮助用户更快地掌握实际应用。对于需要使用设备树的Linux用户来说,这份手册是一个必备的资源。 ### 回答2: Linux设备树使用手册(注释版)是一本对于设备树的使用和理解起到了很好的指导作用的书籍,它适合于想深入了解设备树的开发人员和爱好者使用。该书主要分为基础、高级、特定平台和常用的四个部分,每一部分都涵盖了相应的主题。其中,基础部分介绍了设备树的基本概念和使用方法,如何编写简单的设备树描述以及设备树的编译和加载等;高级篇深入介绍了独立设备树节点和复合设备树节点的使用方法,包括节点的绑定和解绑以及设备树的匹配等内容;特定平台部分介绍了一些特定于某种硬件平台的设备树编写方法和使用技巧;最后,常用部分则介绍了一些常用的设备树属性和设备树编写技巧,如设备树引用、属性和绑定等。 该书从注释的角度出发,比较详尽的讲述了设备树的使用方法,同时提供了许多实例和示例代码,有助于读者更好地理解和掌握设备树的使用方法。另外,在书籍的结尾部分,还提供了一些附录,包括设备树的格式和语法,设备树的节点类型和属性等相关内容,对于读者的参考与使用都是非常有帮助的。 总之,该书详实的介绍了Linux下设备树的使用方法,不仅适合正在进行设备树开发的开发人员参考,也适合广大爱好者进行学习和了解。同时,由于该书注重实例的使用,也让读者更加直观的感受到了设备树的威力和作用,是一本非常好的实用型书籍。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值