Issue
I follow some document to boot embedded Linux on ARM board (ex: Freescale Vybrid tower) via sdcard. in the document there are steps to build uImage and write u-boot into sdcard as below:
sudo dd if=u-boot.imx of=/dev/sdX bs=512 seek=2
mkimage -A arm64 -O linux -T kernel -C none -a 0x81000000 -e 0x81000000 -n
“Linux” -d Image uImage
What I would like to know is from which datasheet/UM/RM or any document they get the number: bs=512 seek=2, -a 0x81000000 (Load address), -e 0x81000000 (Entry point)
Please also explain what Load address/entry point address mean?
Solution
What I would like to know is from which datasheet/UM/RM or any document they get the number: bs=512 seek=2, -a 0x81000000 (Load address), -e 0x81000000 (Entry point)
The bs=512 seek=2
specification should be from the NXP/Freescale reference manual for the SoC (e.g. the "Expansion Device: SD, eSD and SDXC" section of the System Boot chapter).
When configured to boot from an SDcard, the ROM boot program (of the SoC) will look for a program image (e.g. U-Boot) at byte offset 0x400 (or 2 * 512 = 1024), which is the third 512-byte sector.
The first sector is presumed to be the MBR, and the second sector is reserved for an optional Secondary Image Table (using terminology from NXP document).
Allwinner SoCs use a similar booting scheme for SDcard (i.e. the U-Boot image is at a fixed location in raw sectors not part of a partition), but the image starts at the 17th sector.
Instead of loading raw sectors, some SoCs (e.g. Atmel) boot from SDcard by loading a file from a FAT partition.
Please also explain what Load address/entry point address mean?
These values are specified to the mkimage utility so that they can be installed in the uImage header. U-Boot will then use these values when the uImage is loaded and unpacked.
The load address
specifies to U-Boot the required memory address to locate the image. The image is copied to that memory address.
The entry point
specifies to U-Boot the memory address to jump/branch to in order to execute the image. This value is typically the same address as the load address
.
For an ARM Linux kernel the recommended load and entry-point addresses are 0x8000 from the start of physical memory, according to (Vincent Sanders') Booting ARM Linux.
See Building kernel uImage using LOADADDR for more details.
Answered By - sawdust Answer Checked By - Robin (WPSolving Admin)