Skip to content

Commit

Permalink
Rework specification of SDK and associated dependencies
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Araneidae committed Nov 25, 2019
1 parent 15215c2 commit 0b268b3
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 12 deletions.
10 changes: 6 additions & 4 deletions CONFIG.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 16 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)


# ------------------------------------------------------------------------------
Expand Down Expand Up @@ -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: %
Expand Down
19 changes: 19 additions & 0 deletions docs/building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
~~~~~~~
Expand Down
2 changes: 0 additions & 2 deletions initramfs/CONFIG
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion rootfs/CONFIG
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

# -----------------------------------------------------------------------------
# Package definitions for Zynq
TOOLCHAIN = xlnx-zynq

PACKAGES += busybox
busybox_VERSION = 1.23.2
Expand Down

0 comments on commit 0b268b3

Please sign in to comment.