device tree --- #address-cells and #size-cells 属性

转载于:  https://www.cnblogs.com/youchihwang/p/7050846.html

Example1

/ {
        #address-cells = <0x1>;    // 在 root node 下使用 1 個 u32 來代表 address。
        #size-cells = <0x0>;       // 在 root node 下使用 0 個 u32 來代表 size。
        ...
        ...
        memory {        // memory device
                ...
                reg = <0x90000000>;
                // 0x90000000 是存取 memory 的 address
                ...
    };
        ...
        ...
}


Example2

/ {
        #address-cells = <0x1>;    // 在 root node 下使用 1 個 u32 來代表 address。
        #size-cells = <0x1>;       // 在 root node 下使用 1 個 u32 來代表 size。
        ...
        ...
        memory {        // memory device
                ...
                reg = <0x90000000 0x800000>;
                // 0x90000000 是存取 memory 的 address
                // 0x800000 是 memory 的 size。
                ...
        };
        ...
        ...
}


Example3

/ {
        #address-cells = <0x2>;    // 在 root node 下使用 2 個 u32 來代表 address。
        #size-cells = <0x1>;       // 在 root node 下使用 1 個 u32 來代表 size。
        ...
        ...
        memory {        // memory device
                ...
                reg = <0x90000000 00000000 0x800000>;
                // 0x90000000 00000000 是存取 memory 的 address
                // 0x800000 是 memory 的 size。
                ...
    };
        ...
        ...
}


Example4

/ {
        #address-cells = <0x2>;    // 在 root node 下使用 2 個 u32 來代表 address。
        #size-cells = <0x2>;       // 在 root node 下使用 2 個 u32 來代表 size。
        ...
        ...
        memory {        // memory device
                ...
                reg = <0x90000000 00000000 0x800000 00000000>;
                // 0x90000000 00000000 是存取 memory 的 address
                // 0x800000 00000000 是 memory 的 size。
                ...
        };
        ...
        ...
}

posted on 2020-03-10 23:39  Red_Point  阅读(404)  评论(0编辑  收藏  举报

导航