How uboot passes hardware information to kernel wi

2019-03-02 12:02发布

问题:

I am new to embedded Linux development. I have to port uboot and custom Linux distribution to a new ARM based board.

The uboot we are using (2009.08) does not have Arch and DTS folders. I suppose it is an older version which does not use use DTS to pass hardware information to the Kernel (v 3.0). I have read a lot about DTS but here is not enough information on internet about this (obsolete?) method of passing hardware information from uboot to kernel that we are using. Internet tells me that there are C files for this task both in uboot and kernel source code that have to be sync'd, but can some one point me in that direction? Also, please correct me if my assumptions are wrong, and ask for more info if needed.

回答1:

The (old) method to pass data between U-Boot and the Linux ARM kernel is called the ATAG memory list. Information such as usable memory regions, machine type and board information are passed from U-Boot to the Linux ARM kernel using this data list.

In U-Boot, ATAGs are built in lib_arm/armlinux.c (1.1.5) or lib_arm/bootm.c (2009.08) or arch/arm/lib/bootm.c (2015.04), and require the configuration options CONFIG_SETUP_MEMORY_TAGS and salient CONFIG_xxx_TAG s.
Then the ATAGs are processed by Linux in arch/arm/kernel/setup.c.

For documentation see Section 8 of this or this alt site.

Addendum

Also see slide #4 of this presentation about before-Device_Tree booting