sudo apt-get install gparted
sudo apt-get install qemu-system
sudo apt-get install device-tree-compiler
git clone git://git.denx.de/u-boot.git
- bootloader.
- ROM.
- TPL.
- Device tree.
- U-Boot.
- Labels.
- SRAM
- DRAM
- uImage
- zImage
- Booting Sequence.
- Emulating RASPI3
- Compile Device tree.
- Moving from Bootloader to Kernel.
- configure bootloader to run over SOC.
- Booting Sequence.
- Building U-Boot.
- installing U-Boot.
- Using U-Boot.
-
t1 ( Hardware Specific ) ▶ Power On self test ( state of hardware = undefined state )
-
t1 → t2 ( Running inside ROM code ( Vendor specific ) ).
-
t3: Running SPL ( Secondary program loader ) code (Vendor specific).
- initializing hardware ( DRAM and DRAM controller ).
- SPL can be found in first partition SD-CARD.
- Load Kernel to DRAM.
- Pass DTB to kernel ( Details Hardware ).
- Location + size initramfs ( optional ).
- Gives control to kernel.
- Device Tree → Binary.
dtc <name>.dts -o <name>.dtb # convert it into binary.
- Binary → Device tree.
dtc -I dtb -O dts -o output.dts input.dtb
- Support multiple architecture and boards.
- Downloading u-boot.
git clone git://git.denx.de/u-boot.git
cd u-boot
- Building u-boot for RASPI3.
make rpi_3_defconfig
make CROSS_COMPILE=<toolchain prefix>
#With PATH
make CROSS_COMPILE=`$raspi3`
make CROSS_COMPILE=`${raspi3}`
- Installing U-boot ( SD-CARD Version )
1. Using gparted tool to create FAT16 partiotion on top of SD-CARD.
2. Installing /boot partiotion.
3. insert SD-CARD into your Hardware.
- Installing U-boot on top of QEMU Emulator ( TARGET ).
source: https://github.com/ARM-software/u-boot/blob/master/doc/README.qemu-arm
qemu-system-aarch64 \
-M raspi3b \
-cpu cortex-a72 \
-append "rw earlyprintk loglevel=8 console=ttyAMA0,115200" \
-kernel u-boot.bin \
-m 1G -smp 4 \
-serial stdio \
-usb -device usb-mouse -device usb-kbd \
-device usb-net,netdev=net0 \
-netdev user,id=net0,hostfwd=tcp::5555-:22 \
- Using U-BOOT.
mkimage -A arm64 -O linux -T kernel -C gzip -a 0x80008000 (load address) \
-e 0x80008000 (entry point)
-n 'Linux' -d zImage (compressed image) uImage (uBoot Image)
nand read <RAM address> 280000<nand offset> 400000 <size> # read from nand into RAM.
bootm <Kernel address> <address of ramdisk> <address of dtb>