This page needs tagging. Please add keywords describing what this page is about.
Overview
Important Note: On Arria 10 there are two different Device Trees: one required by Bootloader (U-Boot) and one required by the Linux kernel. The Device Treee referred to in this page is the U-Boot one.
Important Note: The U-Boot Device Tree Generation is supported on both Linux and Windows host machines, but U-Boot compilation is supported only on Linux host machines.
The following figure presents an overview of the bootloader flow:
Note that all the operations are automated through the Makefile generated by the Bootloader Generator (BSP Editor in the above figure). Therefore the user does not need to manually call utilities such as "cat' or 'mkpimage' as shown in the figure.
Prerequisites
The following are required
- Host PC, running Linux
- SoC EDS 15.1.1 b60
- Already compiled GHRD (the following assume a re-compiled copy of GHRD copied from SoC EDS to the user home folder. But directly using the pre-compiled version that comes with SoC EDS will also work).
Generating Bootloader
This section presents how to run the Bootloader Generator (BSP Editor) to:
- Generate the Device Tree
- Generate the U-Boot Makefile
The above are generated based on the hardware handoff information and user options.
1. Start an Embedded Command Shell:
$ ~/altera/15.1/embedded/embedded_command_shell.sh
2. Start the BSP Editor:
$ bsp-editor&
3. In the BSP Editor window, go to
File → New HPS BSP ... This will open the
New BSP window.
4. In the
New BSP window, click the
... (Browse) button for the
Preloader Settings Directory. This will open a file browser window.
5. Browse to the folder ~/a10_soc_devkit_ghrd/hps_isw_handoff and click
Open to get back to the
New BSP window.
6. In the
New BSP window:
- Select the Operating System to be U-Boot Bootloader (Arria 10 HPS)
- Leave the Use default locations enabled. This will create the new BSP in the ~/a10_soc_devkit_ghrd/software/uboot_bsp folder.
8. Click
OK. That will create the BSP settings file and close the
New BSP window.
9. Edit BSP settings as follows:
- boot_device: Boot from SD/MMC (default)
- model: SOCFPGA Arria 10 <nop>DevKit (default)
- rbf_filename: ghrd_10as066n2.rbf (default)
- disable_ubot_build: unchecked (default)
10. In
BSP Editor window, click
Generate to generate the source code and the U-Boot Device Tree.
11. In
BSP Editor window, click
Close to close the generator window.
Creating Bootable Image
This section presents how to:
- Build U-Boot
- Compile U-Boot Device Tree Source into Device Tree Binary
- Concatenate U-Boot Binary and Device Tree Binary
- Add BootROM required header to the combined image
It can all be done by running a single make command.
12. Within the Altera Command Shell, go to the U-Boot folder and run make:
$ cd ~/a10_soc_devkit_ghrd/software/uboot_bsp
$ make
This will create the following files in the folder ~/a10_soc_devkit_ghrd/software/uboot_bsp:
- u-boot_w_dtb.bin – concatenation of the U-boot binary and the device tree binary
- uboot_w_dtb-mkpimage.bin – bootable image, containing 4 of the above images, each wrapped with the mkpimage header.