Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is reg property in device tree?

What is address-cell and size-cells in the device tree? Is reg is related to address-cell and size-cell? If yes, then how?

For example:

memory: memory@20000000 { 
            #address-cells = <1>;
            #size-cells = <1>;
            device_type = "memory";
            reg = <0x20000000 0x80000000>;
    };

What is 0x20000000 ? from where we can get this ?

like image 833
Pankaj Suryawanshi Avatar asked Jun 20 '19 10:06

Pankaj Suryawanshi


People also ask

What is Reg in device tree?

The meaning of reg depends on the type of bus the device is connected to and is documented in the device tree binding for the bus. Here, memory is directly mapped in the CPU address space and reg is <address size> . So, this means that your DDR is starts at address 0x20000000 and has a size of 2GB.

What is compatible property in device tree?

Understanding the compatible Property compatible is the key an operating system uses to decide which device driver to bind to a device. compatible is a list of strings. The first string in the list specifies the exact device that the node represents in the form "<manufacturer>,<model>" .

What is memory node in device tree?

The /memory node provides basic information about the address and size. of the physical memory. This node is usually filled or updated by the. bootloader, depending on the actual memory configuration of the given. hardware.

What is Phandle device tree?

3.3 Phandle More simply put, it is a property in one node that contains a pointer to another node. A phandle is created either by the device tree compiler or U-Boot for each label. In the following example, <&label> is converted to the phandle for the labeled node by the DTC.


1 Answers

The meaning of reg depends on the type of bus the device is connected to and is documented in the device tree binding for the bus.

Here, memory is directly mapped in the CPU address space and reg is <address size>.

So, this means that your DDR is starts at address 0x20000000 and has a size of 2GB.

This address is supposed to be documented in the SoC datasheet if you can get it, in a sections that is named memories or memory maps.

like image 91
Alexandre Belloni Avatar answered Sep 30 '22 17:09

Alexandre Belloni