device tree --- #address-cells and #size-cells property


device tree source


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。
                ...
        };
        ...
        ...
}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM