This is the tutorial we're following...
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841738/Getting%2BStarted
...specifically the section entitled "Building Linux Yourself (DIY)"
This document makes the following assumptions:
-
You have cloned out (and/or checked out) the git repository containing the file you are currently reading.
-
The current working directory is the non-bare git repository containing the aforementioned clone (and/or checkout).
-
You have installed Xilinx SDK version 2018.3 to
~/xilinx/SDK/2018.3
and have anexport XILINX_SDK="${HOME}/xilinx/SDK/2018.3"
somewhere in your environment. Other, later versions are probably fine, too. -
You want to make software for the ZYNQ-7000 SoC ZC706 Evaluation Kit.
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842156/Fetch+Sources
The required sources are available as submodules in this repository. Cloning out this repository implies that you have fetched all required sources. They are repeated for convenience as follows:
https://github.com/Xilinx/linux-xlnx.git The Linux kernel with Xilinx patches and drivers
https://github.com/Xilinx/u-boot-xlnx.git The u-boot bootloader with Xilinx patches and drivers
https://github.com/Xilinx/device-tree-xlnx.git Device Tree generator plugin for xsdk
https://git.kernel.org/pub/scm/utils/dtc/dtc.git Device Tree compiler (required to build U-Boot)
https://github.com/Xilinx/arm-trusted-firmware.git ARM Trusted Firmware (required for Zynq UltraScale+ MPSoC
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841798/Build+FSBL
Pre-requisites:
-
${XILINX_SDK}/bin/hsi
-
A "System Hardware Project HDF file": this is a Hardware Description Format file generated by Vivado
Use the shell script build-fsbl
to generate the "First Stage Boot Loader"
into a lower directory:
$ mkdir -vp fsbl
$ PATH="${XILINX_SDK}/bin:${PATH}" ./build-fsbl -C fsbl ~/Downloads/zynq/zynq_linux.hdf
${XILINX_SDK}/bin/hsi
is weird in that it has a hard-coded dependency on
gmake
. If you, like virtually all Linux users, only have make
, then
build-fsbl
will work around this by creating a temporary symlink for gmake
to make
. hsi
seems to swallow this lie without incident.
Driven by build-fsbl
, hsi
populates the output directory with what looks
like a C-language project, complete with Makefile
s and include
directory
paths. More on that as I become aware of it...
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841988/Build+Device+Tree+Compiler+dtc
This one is easy:
$ make -C dtc
Like the previous step, it builds a bunch of new files that the Xilinx
documentation only vaguely references. Building dtc
apparently creates a
bunch of tools in there we're going to need later --- the Xilinx tutorial wants
you bring the dtc
directory into your PATH
like so:
$ export PATH="${PWD}/dtc:${PATH}"
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842462/Build+PMU+Firmware
My research indicates that the ZC706 does not physically possess a Platform Management Unit, so I'm skipping this part. Maybe you can, too.
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842305/Build+ARM+Trusted+Firmware+ATF
This page describes how to download and build the ARM Trusted Firmware (ATF) from the Xilinx Git repository. ATF is a mandatory part of the Xilinx software stack for Zynq UltraScale+ MPSoC. It is not used for Zynq-7000 or MicroBlaze systems.
Emphasis mine. Cool, I don't have to do this part, either.
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841973/Build+U-Boot
All commands have to be executed in your u-boot source directory.
They don't. Things work fine as long as you tell make
where to start
building.
What you do need, what Xilinx assumes, what Xilinx doesn't mention, is that you need to source a very particular file before you can build anything:
$ . ${XILINX_SDK}/.settings64-XSDK_Core_Tools.sh
Sourcing this file just adds a bunch of cross-toolchain bin
directories to
your PATH
. Doing this makes many cross-toolchain binaries available to
you. The subsequent export
invocations recommended by Xilinx are probably
only there to select which cross toolchan should be used from the multitude.
$ export CROSS_COMPILE='arm-linux-gnueabihf-'
$ export ARCH='arm'
$ make -C u-boot-xlnx distclean
$ make -C u-boot-xlnx zynq_zc706_defconfig
$ make -C u-boot-xlnx