What is the use of memory node for DDR in device tree ?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

What is the use of memory node for DDR in device tree ?

跳至解决方案
6,328 次查看
vijaikumar
Contributor III

Hi All,

         I see the following node in sabresd and other freescale based boards device tree.

memory {

                reg = <0x10000000 0x40000000>;

        };

What is the exact use case of this?

Even if I change or remove it my kernel works fine.

1 解答
4,269 次查看
AnsonHuang
NXP Employee
NXP Employee

In case you want to overwirte the memory usage passed from u-boot, you can use "linux,usable-memory", such as below case, we reserve some ddr space:

12         memory {

13                 linux,usable-memory = <0x80000000 0x1ff00000>,

14                                 <0xa0000000 0x1ff00000>;

15         };

在原帖中查看解决方案

5 回复数
4,269 次查看
fabio_estevam
NXP Employee
NXP Employee

It is OK to remove it. The bootloader can pass the total RAM size to the kernel.

Regards,

Fabio Estevam

4,269 次查看
reyhanehyazdani
Contributor II

Hi Fabio,

I have a question regarding this topic.

I have some boards with same CPU but different memory size. It would be perfect if I have only one device tree for them.

Does the Barebox pass the RAM size to the kernel automatically?I removed memory node from Linux and also Barebox device tree and system is still working. I am not sure this is a correct way?  or maybe would I face a problem later?

P.S: We modified Barebox in a way that reads the memory size from GPIO just at the first step.

Regards,

Reyhaneh Yazdani

0 项奖励
4,269 次查看
fabio_estevam
NXP Employee
NXP Employee

Hi Reyhaneh ,

Yes, we do the same in some boards like imx6qdl-wandboard. 

You can let the bootloader detect and pass the correct amount of memory to the kernel.

Regards,

Fabio Estevam

4,269 次查看
reyhanehyazdani
Contributor II

Thanks :smileyhappy:

0 项奖励
4,270 次查看
AnsonHuang
NXP Employee
NXP Employee

In case you want to overwirte the memory usage passed from u-boot, you can use "linux,usable-memory", such as below case, we reserve some ddr space:

12         memory {

13                 linux,usable-memory = <0x80000000 0x1ff00000>,

14                                 <0xa0000000 0x1ff00000>;

15         };