Table of Contents

This is part 2 of the series Embedded Linux with Raspberry Pi 3 Model B. Please check earlier articles to get the grasp of current one.

Introduction

Every time we made some changes to the Linux kernel, drivers or the file system, it’s very cumbersome to copy the files to SD card and then inserting the card into Raspberry Pi. We automate this process using U-boot.

We use U-boot to do the following -

  • Initialized basic hardware
  • Load kernel, device tree from non volatile storage or network (through tptp).
  • Make Linux kernel to load network file system and pass other important command line parameters.
Cross compile U-boot for Rapsberry Pi 3 Model B
Cross compile U-boot for Rapsberry Pi 3 Model B

Download the U-boot

The U-Boot

cd ~/rpi3
git clone git://git.denx.de/u-boot.git
cd u-boot

The configs directory contains configuration file for the Raspberry Pi 3 Model B and other popular boards.

Compile U-boot for Raspberry Pi 3 Model B

RPI 3 model b has already a predefined configuration in the u-boot configs directory. Let’s compile the u-boot for this platform.

make clean; make mrproper; make distclean
export CROSS_COMPILE=aarch64-rpi3-linux-gnu-
make rpi_3_defconfig
make -j`nproc`

Make sure that the U-boot is compiled for ARM aarch64 architecture with the following command.

file u-boot