beautypg.com

Digilent Embedded Linux User Manual

Page 9

background image

Using Zynq with Linux

www.digilentinc.com

page 9 of 23

Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.

Section III: U-Boot

– Embedded Linux Boot Loader


Zynq AP SoC based platforms utilize a multi-stage booting scheme, consisting of BootROM (Stage 0),
FSBL and a Second Stage Boot Loader (SSBL) if required. Section I: Hardware Customization
discusses the FSBL in more detail. To boot Linux on the ZedBoard, Digilent Inc. recommends U-Boot,
a fully supported Second Stage Boot Loader that prepares the basic environment to boot and run the
embedded Linux software.

Booting Sequence


When you power on the Zynq AP SoC based development platform, the Stage 0 Boot Loader, located
in BootROM, will start to run. The codes will check the BootMode pins of the Zynq chip to determine
from which interface to load the FSBL. ZYNQ AP SoC based platforms support loading the FSBL from
five kinds of interfaces--JTAG, QSPI Flash, NAND Flash, NOR Flash, and SD card. Section III will
demonstrate booting from the SD Card.

Note: You must provide a kernel image, DTB, file systems, etc. to run embedded Linux. These files
may take up storage space from several mega-bytes to even a few giga-bytes. An SD card with up to
32GB of storage is the best fit for embedded Linux development. This manual will focus on SD card
booting as the fastest and most efficient means of booting.

You have to do two things before you can boot with the SD card. First, ensure that you configure the
BootMode pins of your board to SD Boot Mode (refer to the documentation Getting Started With
Embedded Linux
for your board). Second, make sure you have a properly partitioned SD card
according to the guidelines in the Getting Started with Embedded Linux for your board. If properly
configured, the Stage 0 Boot Loader will load the file “BOOT.BIN” in the first partition of your SD card
into On-Chip Memory (OCM), and start executing from the beginning of OCM.

The file BOOT.BIN comprises the FSBL, PL logic bit files, and the SSBL (u-boot.elf in this case).
The FSBL will download the PL logic bit file to the PL system, set up the PLL in the PS system and
execute some other fundamental bring-up routines for peripheral devices, and finally call up the SSBL
to take over control and begin loading the operating system.

Digilent Inc. uses U-Boot as the SSBL. U-Boot can obtain a kernel image from an SD Card,
partitioned QSPI Flash, and even through Ethernet using TFTP (Trivial FTP) if you have a functional
TFTP server. By default, U-Boot starts the procedure called autoboot, which looks for the
BootMode pin settings again for the source of the kernel image (in our case, an SD card). So, U-Boot
calls the procedure sdboot. The procedure sdboot does three things. First, sdboot reads the
kernel image (named zImage as shown below) from the FAT partition and copies it to 0x00008000.
Second, sdboot reads the DTB file (named as devicetree.dtb in Figure 5) and loads it to
0x01000000. Third, sdboot reads the zipped ramdisk file system named ramdisk8M.image.gz
(See Example 5.) and loads it to 0x00800000. After all the loading, U-Boot starts to run the kernel
image from where sdboot loaded it.