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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
6,275 Views
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 Solution
4,216 Views
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         };

View solution in original post

5 Replies
4,216 Views
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,216 Views
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 Kudos
4,216 Views
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,216 Views
reyhanehyazdani
Contributor II

Thanks :smileyhappy:

0 Kudos
4,217 Views
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         };