英文:
Device tree: Value out of range for 32-bit array element
问题
在我的硬件中,我想要访问8GB的RAM内存,但编译失败并显示错误:“32位数组元素超出范围”。是否有一种方法可以在内存属性中使用64位数字?我在内核树的文档目录中找不到与此属性相关的绑定文件...有人可以指导我正确的位置吗?
memory@200000000 {
device_type = "memory";
/* 8G RAM */
reg = <0x000000000 0x200000000 0x000000000 0x200000000>;
};
英文:
In my hardware I want to address 8GB RAM memory but compilation fails with error: "Value out of range for 32-bit array element". Is there any workaround that allow use 64bit numbers in memory property? I can't find binding file for this property in Documentation directory of kernel tree... Can anyone point me right place?
memory@200000000 {
device_type = "memory";
/* 8G RAM */
reg = <0x000000000 0x200000000 0x000000000 0x200000000>;
};
Thanks
答案1
得分: 1
是的,区域数组中的元素(reg =)是32位的,但您可以使用2x32位来指定大小(类似于高/低地址)。
所以对于从0x20000000开始的8GB内存,应该如下所示:
memory@200000000 {
device_type = "memory";
/* 8G RAM */
reg = <0x0 0x0000000020000000 0x00000001 0x00000000>,
<0x1 0x0000000000000000 0x00000001 0x00000000>;
};
其中,0x00000001 0x00000000 实际上表示4GB(0x1000000000),但以2x32位值的方式写入。
英文:
Yes the elements in the regions array (reg =) are 32bit but you can use 2x32bit to specify the size (like hi/low addresses).
So for a 8GB memory starting at 0x20000000 it should look like this:
memory@200000000 {
device_type = "memory";
/* 8G RAM */
reg = <0x0 0x0000000020000000 0x00000001 0x00000000>,
<0x1 0x0000000000000000 0x00000001 0x00000000>;
};
Where 0x00000001 0x00000000 actually represent the 4GB (0x1000000000) but written as 2x32bit values.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论