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 ?
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.
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>" .
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With