3 设备节点要求
3.1 基本设备节点类型
- 一个cpus节点
- 至少一个内存节点
3.2 根节点
3.3 aliases(别名)节点
aliases {
serial0 = "/[email protected]/[email protected]";
ethernet0 = "/[email protected]/[email protected]";
}
给定 alias serial0,客户机程序可以查看/aliases 节点,并确定 alias 是指设备路径/ [email protected] / [email protected]。
3.4 Memory(内存)节点
所有设备树都需要一个内存设备节点,它负责描述系统的物理内存布局。如果一个系统有多个内存范围,那么可以创建多个内存节点,或者可以在单个内存节点的reg属性中指定范围。
节点名的名称组件(见2.2.1)将是 memory
客户端程序可以使用它所选择的任何存储属特性访问未被任何内存预订所覆盖的内存。然而,在更改用于访问真实页面的存储属特性之前,客户机程序负责执行架构和实现所需要的操作,可能包括从缓存中刷新实际页面。引导程序负责确保在不采取与存储属性更改相关的任何操作的情况下,客户机程序可以安全地访问所有内存(包括内存保留的内存)。
像 WIMG= 0b001x 。即:
- 通过not Write Through Required
- not Caching Inhibited
- Memory Coherence Required
- either not Guarded or Guarded (i.e., WIMG = 0b001x)
给一个64位Power系统用如下物理内存布局:
RAM: starting address 0x0, length 0x80000000 (2GB)
RAM: starting address 0x100000000, length 0x100000000 (4GB)
Memory 节点能用如下方式定义,假设 #address-cells和 #size-cells的值为2:
Example #1
[email protected] {
device_type = "memory";
reg = <0x000000000 0x00000000 0x00000000 0x80000000
0x000000001 0x00000000 0x00000001 0x00000000>;
};
Example #2
[email protected] {
device_type = "memory";
reg = <0x000000000 0x00000000 0x00000000 0x80000000>;
};
[email protected] {
device_type = "memory";
reg = <0x000000001 0x00000000 0x00000001 0x00000000>;
};
reg属性用于定义两个内存范围的地址和大小。2 GB的I / O地址被跳过。注意,根节点的# address -cell和# size-cells属性指定了值为2,这意味着需要两个32位的单元格来定义内存节点的reg属性的地址和长度。
3.5 Chosen(选择)
chosen {
bootargs = “root=/dev/nfs rw nfsroot=192.168.1.1 console=ttyS0,115200”;
};