June 13, 2024

Zynq - the Zynq FSBL - build from "embeddedsw"

This is what I am going to work with. I "git clone" this, putting it on my machine at:
/u1/Projects/Ebaz/embeddedsw
There is a lot more here than just the FSBL. There is also support for other Zynq architectures such as ZynqMP.

Here are the instructions:

How to compile FSBL for Zynq:
Please refer to the steps in Readme.txt which is at lib/sw_apps/zynq_fsbl/misc/ directory
So, we go there and see:
Zynq FSBL has 3 directories.
	1. data - It contains files for SDK
	2. src  - It contains the FSBL source files
	3. misc - It contains miscellaneous files required to compile FSBL.
		  Builds for zc702, zc706 and zed boards are supported.

How to compile Zynq FSBL:

	1.Go to the Fsbl src directory "lib/sw_apps/zynq_fsbl/src/"
	2. make "BOARD=<>" "CC=<>"
		a. Values for BOARD  are zc702, zc706, zed
		b. Value for CC is arm-none-eabi-gcc. Default value is also same.
	3.Give "make" to compile the fsbl with BSP. By default it is
		built for zc702 board with arm-none-eabi-gcc compiler
	4.Below are the examples for compiling for different options
		a. To generate Fsbl for zc706 board
			i.make "BOARD=zc706"
		b.To generate Fsbl for zc702 board with debug enable and RSA support
			i.make "BOARD=zc702" "CFLAGS=-DFSBL_DEBUG_INFO -DRSA_SUPPORT"
		c.To generate Fsbl for zc706 board and compile with arm-none-eabi-gcc
		  with MMC support
			i.make "BOARD=zc706" "CC=arm-none-eabi-gcc" "CFLAGS=-DMMC_SUPPORT"
So, what are these 3 boards? So, my vote is to build for the zed. I have "arm-none-eabi-gcc" already installed on my Fedora system.
cd /u1/Projects/Ebaz/embeddedsw
cd lib/sw_apps/zynq_fsbl/src
I edit the Makefile so it builds for zed rather than zc702, then type "make". It takes only seconds. The output is here: The end result is fsbl.elf

This yields several pleasant discoveries:

Note that there are a bunch of source files in ../misc/ps7_contexa9_0/lib -- these get gathered up into:
-rw-r--r-- 1 tom tom   12530 Jun  6 21:11 librsa.a
-rw-r--r-- 1 tom tom 1268336 Jun  6 21:11 libxil.a
-rw-r--r-- 1 tom tom  121314 Jun  6 21:11 libxilffs.a
The link pulls them in via -lxil, -lrsa, and -lxilffs
Feedback? Questions? Drop me a line!

Tom's Computer Info / tom@mmto.org