设备树中#address-cells和#size-cells作用


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