How to define reserved memory in device tree?

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

How to define reserved memory in device tree?

2,227 Views
trongthinh
Contributor IV

I am using iMX8MQ evk. I found that in file fsl-imx8mq-evk-m4.dts has some declaration for reserved memory that is used for Cortex M4.

reserved-memory {
   #address-cells = <2>;
   #size-cells = <2>;
   ranges;

   m4_reserved: m4@0x80000000 {
         no-map;
         reg = <0 0x80000000 0 0x1000000>;
   };

};

What does reg = <0 0x80000000 0 0x1000000> mean?

Labels (2)
0 Kudos
Reply
2 Replies

1,795 Views
b36401
NXP Employee
NXP Employee

You do not need to change original files.
You need to go to your build directory in <kernel_source>/arch/arm/boot/dts and find all the dtb sources (.dts and .dtsi).
Here you can place your new .dts file like myfile.dts and make your new .dtb with following commands:

# cd <Kernel_source>
# make myfile.dtb

So you get your dtb file in <kernel_source>/arch/arm/boot/dts/myfile.dtb file

Or you can use the dtc directly:

# cd <Kernel_source>/scripts/dtc
# dtc -I dts -O dtb -o <output_folder>/myfile.dtb ../../arch/arm/boot/dts/myfile.dts

Have a great day,
Victor

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,795 Views
trongthinh
Contributor IV

Thank for your hint. My question is "What does reg = <0 0x80000000 0 0x1000000> mean?"

Does it mean reserved-mem is 16MB and begins from address 0x80000000?

0 Kudos
Reply