ARM Linux Atags vs. Device Tree

What is the difference between device tree and ATAG? Also, are ATAGs mandatory and does the kernel expect them at a fixed address or expects them at r0-r3?

+8
linux arm linux-kernel device-tree
source share
2 answers

The device tree describes all the hardware that the kernel uses to select drivers to boot, where all the MMIO interfaces, etc. at runtime. ATAG just describes things like finding initrd and kernel parameters, memory, etc. - everything else about the machine is hard-coded in the kernel.

The preferred method is to use device trees instead of ATAG. One of the advantages is the fact that adding a new platform does not always require adding new code to the kernel.

To answer the second question, if you read the documentation for booting Linux on the ARM platform , you will find that the kernel expects the following to be placed in registers before control is passed to the kernel:

r0 = 0, r1 = machine type number discovered in (3) above. r2 = physical address of tagged list in system RAM, or physical address of device tree block (dtb) in system RAM 

I believe that there is (or at least was) the option of loading ATAG from a fixed location instead of the address found in r2. However, the use of ATAG is now deprecated and deprecated, and new platforms should not use it.

+12
source share

Basically, ATAGs were used to send information to the linux kernel about specific information about the machine in the panel, such as memory, console information, etc., and these ATAGs were used by the linux kernel to initialize the MMU and other subsystems.

But with the advent of the device tree (moreover, using it with the hand because it is already used to the powerpc architecture.), Now all the information related to the machine can be transmitted using FDT (device tree block).

Some ideas were expressed for sending device tree information to the kernel using the new atag "atag_dtd", but later a discussion arose about not using ATAG at all, because it was not necessary to use two seprate methods to do one thing. So, The kernel now expects the bootloader to provide the following information.

 r0 = 0 r1 = Same type of SOC fdt machine id. r2 = physical address where the dtd can be found. 

It uses the same structure that the loader used to send atag information so that it can be backward compatible.

Hope this helps.

+3
source share

All Articles