From 0b268b3525433419efa0bae7ab192d31c1e3c74e Mon Sep 17 00:00:00 2001 From: Michael Abbott Date: Mon, 25 Nov 2019 14:34:22 +0000 Subject: [PATCH] Rework specification of SDK and associated dependencies Ensure that the SDK toolchain is properly pushed through to rootfs. Note however that this commit needs the current version of rootfs (at least commit 13a8096a). The SDK is now either specified as a single SDK_ROOT key, as before, or as individual keys for the separate BOOTGEN, BINUTILS_DIR, and possibly SYSROOT components. --- CONFIG.example | 10 ++++++---- Makefile | 21 ++++++++++++++++----- docs/building.rst | 19 +++++++++++++++++++ initramfs/CONFIG | 2 -- rootfs/CONFIG | 1 - 5 files changed, 41 insertions(+), 12 deletions(-) diff --git a/CONFIG.example b/CONFIG.example index 5facb632..9caa3c5e 100644 --- a/CONFIG.example +++ b/CONFIG.example @@ -3,12 +3,14 @@ # Copy this file to CONFIG and edit the settings below to suit your # environment. -# Location of rootfs builder. This needs to be at least version 1.10 and can be +# Location of rootfs builder. This needs to be at least version 1.13 and can be # downloaded from https://github.com/araneidae/rootfs -ROOTFS_TOP = /dls_sw/prod/targetOS/rootfs/1-10 +ROOTFS_TOP = /dls_sw/prod/targetOS/rootfs/1.13 -# Location of SDK used to build target -SDK_ROOT = /dls_sw/apps/FPGA/Xilinx/SDK/2015.1 +# Location of SDK used to build target. There are a couple of ways that this +# can be specified, depending on precisely where the toolchain is installed. +# The simplest option is to specify SDK_ROOT. +SDK_ROOT = /dls_sw/apps/FPGA/Xilinx/SDK/2016.4 # Where to find source files TAR_FILES = /dls_sw/prod/targetOS/tar-files diff --git a/Makefile b/Makefile index 2e05d721..959a387e 100644 --- a/Makefile +++ b/Makefile @@ -15,10 +15,8 @@ MD5_SUM_linux-xlnx-xilinx-v2015.1 = 930d126df2113221e63c4ec4ce356f2c SPHINX_BUILD = sphinx-build # Locations of key files in the SDK -BOOTGEN = $(SDK_ROOT)/bin/bootgen -BINUTILS_DIR = $(SDK_ROOT)/gnu/arm/lin/bin # Cross-compilation tuple for toolkit -CROSS_COMPILE = arm-xilinx-linux-gnueabi- +COMPILER_PREFIX = arm-xilinx-linux-gnueabi # The final boot image is assembled here BOOT_IMAGE = $(PANDA_ROOT)/boot @@ -35,8 +33,20 @@ KERNEL_TAG = xilinx-v2015.1 # Configuration and local settings. include CONFIG + +CROSS_COMPILE = $(COMPILER_PREFIX)- + +ifdef SDK_ROOT + BOOTGEN ?= $(SDK_ROOT)/bin/bootgen + BINUTILS_DIR ?= $(SDK_ROOT)/gnu/arm/lin +endif + +ifdef BINUTILS_DIR + SYSROOT ?= $(BINUTILS_DIR)/$(COMPILER_PREFIX)/libc +endif + # We'll check that these symbols have been defined. -REQUIRED_SYMBOLS = ROOTFS_TOP SDK_ROOT TAR_FILES PANDA_ROOT +REQUIRED_SYMBOLS = ROOTFS_TOP BOOTGEN BINUTILS_DIR SYSROOT TAR_FILES PANDA_ROOT default: boot @@ -54,7 +64,7 @@ BOOT_BUILD = $(BUILD_ROOT)/boot U_BOOT_TOOLS = $(U_BOOT_BUILD)/tools -export PATH := $(BINUTILS_DIR):$(U_BOOT_TOOLS):$(PATH) +export PATH := $(BINUTILS_DIR)/bin:$(U_BOOT_TOOLS):$(PATH) # ------------------------------------------------------------------------------ @@ -216,6 +226,7 @@ u-boot-src: $(U_BOOT_SRC) # Command for building rootfs. Need to specify both action and target name. MAKE_ROOTFS = \ + $(call EXPORT,COMPILER_PREFIX SYSROOT) \ $(ROOTFS_TOP)/rootfs -f '$(TAR_FILES)' -r $(PANDA_ROOT) -t $(CURDIR)/$1 $2 %.gz: % diff --git a/docs/building.rst b/docs/building.rst index 27a0a50d..51aae08e 100644 --- a/docs/building.rst +++ b/docs/building.rst @@ -53,6 +53,25 @@ and modify the following fields as required: This needs to point to the root directory of the Diamond rootfs builder, download from the github location given above. +Three files and directories are taken from ``SDK_ROOT``, and they can instead be +specified directly. Note that in this case ``SDK_ROOT`` must *not* be set. + +``BOOTGEN`` + This is the path to a Xilinx toolchain tool used to build the ``boot.bin`` + file. By default this is set to ``$(SDK_ROOT)/bin/bootgen``. + +``BINUTILS_DIR`` + This is the path to the gcc cross-compiler toolchain to use. By default + this is set to ``$(SDK_ROOT)/gnu/arm/lin``. The directory + ``$(BINUTILS_DIR)/bin`` will be added to the path during the build. + +``SYSROOT`` + This is the path to the compiled system root (derived from libc). Normally + this is part of the installed toolchain, and if not set elsewhere this is + set to ``$(BINUTILS_DIR)/$(COMPILER_PREFIX)/libc``. + +Note that the ``COMPILER_PREFIX`` symbol can also be overwritten if required. +The default value is ``arm-xilinx-linux-gnueabi``. Sources ~~~~~~~ diff --git a/initramfs/CONFIG b/initramfs/CONFIG index 2737abfb..7fedb958 100644 --- a/initramfs/CONFIG +++ b/initramfs/CONFIG @@ -1,8 +1,6 @@ # Kernel initramfs definition. This is a minimal image with just enough to do # what we need to prepare to run the true system. -TOOLCHAIN = xlnx-zynq - PACKAGES += busybox busybox_VERSION = 1.23.2 busybox_CONFIG = $(configdir)/busybox.config diff --git a/rootfs/CONFIG b/rootfs/CONFIG index ac31a4d1..57d2b088 100644 --- a/rootfs/CONFIG +++ b/rootfs/CONFIG @@ -2,7 +2,6 @@ # ----------------------------------------------------------------------------- # Package definitions for Zynq -TOOLCHAIN = xlnx-zynq PACKAGES += busybox busybox_VERSION = 1.23.2