1

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.

sawdust
  • 16,103
  • 3
  • 40
  • 50
Hamzahfrq
  • 696
  • 1
  • 6
  • 25
  • 1
    Look for your board specific file it would be something like this linux/arch/arm/mach-xxx/board-xx.c or search for MACHINE_START under arch/arm/ – Sasi V May 16 '14 at 14:17
  • http://www.amazon.com/Embedded-Linux-Primer-Practical-Real-World/dp/0137017839 – Joe Kul May 16 '14 at 15:55
  • @Sasi looks like this is the place what I had been looking for. If you could post it as an answer and a pointer to the documentation so that I understand what's going on and how can I modify it (or generate it for a new board which is using device tree structure), I can accept it as the right answer – Hamzahfrq May 19 '14 at 09:28
  • @Hamzahfrq: I dont have any document. I was looking at the code. Thats it. most of ARM code was defined like that. you can take any one board code and modify it to suit your requirement. – Sasi V May 22 '14 at 15:11

1 Answers1

5

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

sawdust
  • 16,103
  • 3
  • 40
  • 50
  • I can't locate the file lib_arm/armlinix. The parameters are found in `include/asm-arm/setup.h` and `lib_arm/bootm.c`. Am I missing something? Secondly, I couldn't find information about hardware peripherals in these ATAGS. How does kernel know what devices it has for which it has to load related drivers? – Hamzahfrq May 19 '14 at 09:24
  • Sorry, I provided the filename for older versions of U-Boot. You found the correct code, **bootm.c** is the source module for 2009.08. The board configuration is intertwined into the code (hence the push for Device Tree). Early board initialization is performed by a board file from arch/arm/mach-xxx, and would have hardcoded property structures for the the devices defined at build-time. All device drivers required for booting and mounting the rootfs have to be statically linked with the kernel – sawdust May 19 '14 at 18:20