This shows you the differences between two versions of the page.
ass:laboratoare:01 [2023/07/11 12:29] radu.mantu |
ass:laboratoare:01 [2024/08/05 14:14] (current) florin.stancu |
||
---|---|---|---|
Line 1: | Line 1: | ||
~~NOTOC~~ | ~~NOTOC~~ | ||
- | ===== Lab 01 - Booting to Linux ===== | + | ===== 01 - Firmware & Bootloaders ===== |
===== Objectives ===== | ===== Objectives ===== | ||
* Learn about Exception Levels & the boot process for ARMv8 | * Learn about Exception Levels & the boot process for ARMv8 | ||
- | * Expect comparisons with x86 | + | * Generate a Firmware Image Package (FIP) with U-boot & Trusted Firmware-A |
- | * Create a ramdisk with Buildroot | + | * Load the FIP onto an i.MX8M board via the Serial Download Protocol |
- | * Generate a Firmware Image Package with U-boot & Trusted Firmware-A | + | |
- | * Get a functioning Linux onto the board | + | |
===== Contents ===== | ===== Contents ===== | ||
- | {{page>:ass:laboratoare:01:meta:nav&nofooter&noeditbutton}} | + | **Tasks** |
+ | {{indexmenu>:ass:laboratoare:01:tasks|skipfile}} | ||
- | ===== Introduction ===== | + | ===== Lecture ===== |
- | {{namespace>:ass:laboratoare:01:theory&nofooter&noeditbutton}} | + | Before beginning the tasks, please check out the [[:ass:cursuri:01|lecture slides & notes here]]. |
===== Tasks ===== | ===== Tasks ===== | ||
+ | Our aim for this lab is to better understand the boot process and the role of each component making up the firmware of an ARM device. | ||
+ | |||
+ | For this, we will be using a [[https://www.technexion.com/shop/pico-pi-imx8m|TechNexion PICO-PI-IMX8M]] featuring a [[https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/i-mx-applications-processors/i-mx-8-applications-processors/i-mx-8m-family-armcortex-a53-cortex-m4-audio-voice-video:i.MX8M|NXP i.MX8M Quad]] ARM Cortex-A53 + M4 SoC with 2GB DRAM. | ||
+ | |||
+ | The following tasks will walk you through configuring and compiling the whole boot package containing the Secondary Program Loader (**BL2**) with various firmware binaries embedded within, the ARM Trusted Firmware (**BL31**) and, of course, the normal OS bootloader (**BL33**). | ||
+ | |||
+ | When everything is ready, you'll get to fire up the board, upload the firmware image package using NXP's specific serial boot protocol and play with it! | ||
<note tip> | <note tip> | ||
- | The following tasks will walk you through compiling your own firmware, kernel and userspace environment (i.e.: bash, binutils, etc.), followed by getting it up and running on the board. | + | **Suggestion #1:** After manually solving each task, automate the steps you've taken by writing a [[https://makefiletutorial.com/|Makefile]]. Chances are that you're going to have to rebuild things (at least partially) dozens of times, and you'll also need to reuse your scripts usable for the next labs as well! E.g.: <code Makefile> |
+ | export CROSS_COMPILE = /path/to/your/toolchain/gcc-prefix...- | ||
- | **Suggestion #1:** After manually solving each task, automate the steps you've taken by writing a Makefile. Chances are that you're going to have to rebuild things (at least partially) dozens of times. | + | ATF_DIR = imx-atf |
+ | ATF_MAKE_FLAGS = SPD=none PLAT=TODO... | ||
+ | atf: | ||
+ | cd "$(ATF_DIR)" && \ | ||
+ | make $(ATF_MAKE_FLAGS) | ||
- | **Suggestion #2:** Since you won't be working alone, run a ''git init'' and add dependent repositories as submodules so that your partner's on the same page. Don't forget to add ''%%--%%depth 1'' to the ''git submodule add'' in order to reduce the cloning tine and size of your subrepos. | + | UBOOT_DIR = u-boot-tn-imx |
+ | UBOOT_MAKE_FLAGS = | ||
+ | uboot: | ||
+ | cd "$(UBOOT_DIR)" && \ | ||
+ | make $(UBOOT_MAKE_FLAGS) | ||
+ | |||
+ | .PHONY: uboot atf | ||
+ | # ... and so on ! | ||
+ | </code> | ||
+ | |||
+ | **Suggestion #2:** You can use git and add the third party projects as submodules! But beware though: Linux's repo is quite huge (several GBs -- but you'll see it yourself in the next lab)! | ||
</note> | </note> | ||
{{namespace>:ass:laboratoare:01:tasks&nofooter&noeditbutton}} | {{namespace>:ass:laboratoare:01:tasks&nofooter&noeditbutton}} | ||
+ |