Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Understanding Linux load address for U-Boot process

I'm trying to understand embedded Linux principles and can't figure out addresses at u-boot output.

For example, I have UDOO board based on i.MX6 quad processor and I got following output from U-Boot:

U-Boot 2013.10-rc3 (Jan 20 2014 - 13:33:34)

CPU:   Freescale i.MX6Q rev1.2 at 792 MHz
Reset cause: POR
Board: UDOO
DRAM:  1 GiB
MMC:   FSL_SDHC: 0
No panel detected: default to LDB-WVGA
Display: LDB-WVGA (800x480)
In:    serial
Out:   serial
Err:   serial
Net:   using phy at 6
FEC [PRIME]
Warning: FEC MAC addresses don't match:
Address in SROM is         00:c0:08:88:a5:e6
Address in environment is  00:c0:08:88:9c:ce

Hit any key to stop autoboot:  0 
Booting from mmc ...
4788388 bytes read in 303 ms (15.1 MiB/s)
## Booting kernel from Legacy Image at 12000000 ...
   Image Name:   Linux-3.0.35
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4788324 Bytes = 4.6 MiB
   Load Address: 10008000
   Entry Point:  10008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

I don't understand the value of Load address 0x10008000. According to documentation for this particular processor, at address zone 0x10000000 - 0xffffffff is mapped main memory. But what is 0x8000 offset? I can't figure out reason for this value.

I also don't understand address 0x12000000, where the kernel image is loaded from. Is there mapped memory region for SD card?

Please, can you give me some explanation for these addresses or even better, some references to resources about this topic. My goal is to learn how to port u-boot and Linux kernel to another boards.

Thank you!

like image 399
Ivo Slanina Avatar asked Jan 24 '15 17:01

Ivo Slanina


People also ask

How is U-Boot loaded?

The load command is used to read a file from a filesystem into memory. The number of transferred bytes is saved in the environment variable filesize. The load address is saved in the environment variable fileaddr. interface for accessing the block device (mmc, sata, scsi, usb, ….)

How are the command line arguments passed to Linux kernel by the U-Boot?

You can pass the u-boot parameters by command "setenv bootargs <your argumets>" from u-boot terminal. After boot the kernel you can read it by "cat /proc/cmdline". The official images for i. MX6/7 support device tree and bootargs in default for all new kernels.

What is U-Boot and how does it work?

U-Boot boots an operating system by reading the kernel and any other required data (e.g. device tree and ramdisk image) into memory, and then executing the kernel with the appropriate arguments. U-Boot's commands are actually generalized commands which can be used to read or write any arbitrary data.

What is kernel load address?

Load Address is RAM location where the kernel binary image is to be copied. Entry Point is the Location of the copied binary to be executed by uboot to boot kernel. Your RAM is mapped at 80000000 and kernel LOAD ADDRESS is 80008000.


2 Answers

If you check the environment variables of the u-boot, you will find that kernel image is copied from boot device to the RAM location(Here, 12000000) through command like fatload.

Now, This is not the LOADADDRESS. You give LOADADDRESS to command line while compiling the kernel, This address is mostly at 32K offset from start of the RAM in Physical address space of the processor.

Your RAM is mapped at 10000000 and kernel LOADADDRESS is 10008000(32K offset). bootm command uncompress the kernel image from 12000000 to 10008000 address and then calls the kernel entry point.

like image 55
Jagdish Avatar answered Oct 08 '22 01:10

Jagdish


check out include/configs folder. It contains all the board definitions

i.MX uboot include/configs

To port uboot to another port, base on a very similar board and modify from there.

like image 1
alex Avatar answered Oct 08 '22 03:10

alex