Commit ab64064d authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

initial

parents
This diff is collapsed.
META-EZYNQ
===========
This layer provides an unofficial support for Xilinx Zynq architecture
as well as evaluation boards.
ezynq-u-boot ...partially duplicates functionality of Xilinx proprietary tool
that creates fsbl (first stage boot loader) and bootgen (later).
It does not support secure boot functionality and loading the FPGA (PL) part
with a bitstream - it is planned to do under the control of the operating system -
if needed this feature can be implemented using u-boot...
Supported Boards/Machines
=========================
Boards Supported by this layer and sub-layers:
* Avnet/Digilent MicroZed (Zynq)
Dependencies
============
This layer depends on:
URI: git://git.openembedded.org/bitbake
URI: git://git.openembedded.org/openembedded-core
layers: meta
(for external toolchains only)
URI: git://github.com/MentorEmbedded/meta-sourcery.git
layers: meta-sourcery
URI: git://github.com/Xilinx/u-boot-xlnx.git;branch=master-next
URI: git://git.code.sf.net/p/elphel/ezynq
Sub-Layers
==========
This repository contains the meta-elphel layer as well as additional board
specific layers. Each of these board specific layers provide additional
configuration for the associated board. Please refer to the associated README
in each sub-layer for more details.
Note: sub-layers have no dependency between each other, all sub-layers can be
used at the same time without conflicts.
Build Instructions
==================
The following instructions require a Poky installation (or equivalent).
Initialize a build using the 'oe-init-build-env' script in Poky. Once
initialized configure bblayers.conf by adding the 'meta-elphel' layer as
well as any or all of the sub-layers of this repository, e.g.:
meta-ezynq \
meta-ezynq/meta-microzed \
To build a specific target BSP configure the associated machine in local.conf:
(See associated sub-layers for available machines and additional details)
MACHINE ?= "microzed"
Build U-Boot:
$ bitbake ezynq-u-boot
Once complete the images for the target machine will be available in the output
directory 'tmp/deploy/images'.
Images generated:
* boot.bin (fsbl is not required to boot)
Booting
=======
Please see the associated README for the target machine, located in the
associated sub-layer.
Configuring External Toolchain
==============================
In order to build with an external toolchain some additional configuration must
be set in the build environments local.conf. The 'meta-sourcery' layer must also
be setup in your bblayers.conf
First configure the use of an external toolchain, including the location to the
toolchain (this example is for a microblazeel toolchain, ensure that you insert
the relevant information for your target machine and target toolchain):
TCMODE = "external-csl"
CSL_TARGET_SYS_<machine name> = "microblazeel-xilinx-linux-gnu"
EXTERNAL_TOOLCHAIN = "<path to toolchain>/microblazeel-xilinx-linux-gnu"
EXTERNAL_TOOLCHAIN_SYSROOT = "<path to toolchain>/microblazeel-xilinx-linux-gnu/microblazeel-xilinx-linux-gnu/libc"
INSANE_SKIP_external-sourcery-toolchain-dev += "ldflags"
Additionally the preferred provider for various packages must be configured to
use the external toolchain:
PREFERRED_PROVIDER_linux-libc-headers = "external-sourcery-toolchain"
PREFERRED_PROVIDER_linux-libc-headers-dev = "external-sourcery-toolchain"
PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc = "external-sourcery-toolchain"
PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc-initial = "external-sourcery-toolchain"
PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc-intermediate = "external-sourcery-toolchain"
PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}g++ = "external-sourcery-toolchain"
PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}binutils = "external-sourcery-toolchain"
PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-initial = "external-sourcery-toolchain"
PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-for-gcc = "external-sourcery-toolchain"
PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}compilerlibs = "external-sourcery-toolchain"
PREFERRED_PROVIDER_libgcc = "external-sourcery-toolchain"
PREFERRED_PROVIDER_eglibc = "external-sourcery-toolchain"
PREFERRED_PROVIDER_virtual/libc = "external-sourcery-toolchain"
PREFERRED_PROVIDER_virtual/libintl = "external-sourcery-toolchain"
PREFERRED_PROVIDER_virtual/libiconv = "external-sourcery-toolchain"
PREFERRED_PROVIDER_glibc-thread-db = "external-sourcery-toolchain"
PREFERRED_PROVIDER_virtual/linux-libc-headers = "external-sourcery-toolchain"
PREFERRED_PROVIDER_virtual/linux-libc-headers-dev = "external-sourcery-toolchain"
PREFERRED_PROVIDER_gdbserver = "external-sourcery-toolchain"
# We have a conf and classes directory, add to BBPATH
BBPATH := "${BBPATH}:${LAYERDIR}"
# We have a packages directory, add to BBFILES
BBFILES := "${BBFILES} ${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"
# Leaving as is until better understanding
BBFILE_COLLECTIONS += "elphel"
BBFILE_PATTERN_elphel := "^${LAYERDIR}/"
BBFILE_PRIORITY_elphel = "8"
DEFAULTTUNE ?= "zynq"
SOC_FAMILY ?= "zynq"
require conf/machine/include/tune-cortexa9.inc
require conf/machine/include/soc-family.inc
TUNEVALID[zynq] = "Zynq"
AVAILTUNES += "zynq"
TUNE_FEATURES_tune-zynq += "${TUNE_FEATURES_tune-armv7a-neon} zynq"
ARMPKGARCH = "${ARMPKGARCH_tune-armv7a-neon}"
PACKAGE_EXTRA_ARCHS_tune-zynq = "${PACKAGE_EXTRA_ARCHS_tune-armv7a-neon} zynq"
# Linux Configuration
PREFERRED_PROVIDER_virtual/kernel ?= "linux-xlnx"
PREFERRED_VERSION_linux-xlnx ?= "3.8%"
KERNEL_IMAGETYPE ?= "uImage"
# Set default load address.
# Override with KERNEL_EXTRA_ARGS_<board> += "..." in machine file if required
KERNEL_EXTRA_ARGS_zynq += "UIMAGE_LOADADDR=0x8000"
# File System Configuration
IMAGE_FSTYPES ?= "cpio ext2 ext2.gz.u-boot ext2.gz"
IMAGE_CLASSES += "image_types_uboot"
# U-Boot Configuration
PREFERRED_PROVIDER_ezynq-u-boot ?= "ezynq"
PREFERRED_VERSION_ezynq-u-boot ?= "v2013.01%"
This diff is collapsed.
meta-microzed
==========
This README file contains information on using the meta-microzed BSP layer.
The Microzed board is an evaluation board by Avnet/Digilent for the Zynq architecture:
http://www.microzed.org/
Please refer to the meta-ezynq/README for details regarding patch submission,
layer dependencies, build process, etc.
Supported Boards/Machines
=========================
Avnet/Digilent ZedBoard (Zynq) - 'microzed'
Reference files and documents
=============================
http://www.microzed.org/
SD Card Boot
============
Note: This boot flow generates a working boot.bin.
Copy 'boot.bin' onto the SD Card.
Might not work:
#Copy the following to the SD card (ensure to rename the files where appropriate):
# Kernel: uImage
# RootFS: uramdisk.image.gz (core-image-minimal-<machine name>.ext2.gz.u-boot)
# DTB: devicetree.dtb (uImage-<machine name>.dtb)
Insert SD Card, connect UART to Terminal program and boot board (Ensure the
board is configured for SD Boot).
When in u-boot comand line to boot uImage type:
u-boot> boot
\ No newline at end of file
# We have a conf and classes directory, add to BBPATH
BBPATH := "${BBPATH}:${LAYERDIR}"
# We have a packages directory, add to BBFILES
BBFILES := "${BBFILES} ${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"
#leaving as is until better understanding
BBFILE_COLLECTIONS += "microzed"
BBFILE_PATTERN_microzed := "^${LAYERDIR}/"
BBFILE_PRIORITY_microzed = "8"
#@TYPE: Machine
#@NAME: microzed
#@DESCRIPTION: Machine support for microzed.
# Versions corresponding to zedboard documentation
#PREFERRED_VERSION_linux-xlnx ?= "3.8%"
#PREFERRED_VERSION_ezynq ?= "v2013.01%"
require conf/machine/include/tune-zynq.inc
# Microzed machine definition known by Xilinx UBOOT (patched with EZYNQ)
UBOOT_MACHINE = "zynq_microzed_config"
#this parameter is not used (taken from zedboard example)
#SERIAL_CONSOLE = "115200 ttyPS0"
##########################################################################################
# SRC_URI - Couldn't find how to deal with multiple git repos:
# 1. Tried and it didn't work: http://lists.linuxtogo.org/pipermail/openembedded-core/2011-October/010926.html
# 2. No *.bb examples found
# Overriding do_fetch:
do_fetch(){
echo "Fetching ezynq..."
if [ ! -d "${GITDIR_ezynq}/.git" ]; then
# if anything left after do_clean - delete it
if [ -d ${GITDIR_ezynq} ]; then
rm -r ${GITDIR_ezynq}
fi
git clone -b ${SRC_URI_ezynq_branch} ${SRC_URI_ezynq} ${GITDIR_ezynq}
cd ${GITDIR_ezynq}
git checkout ${SRCREV_ezynq}
cd ${WORKDIR}
echo "Cloning ezynq done."
else
echo "Skipped: ezynq is already cloned."
fi
echo "Fetching u-boot-xlnx..."
if [ ! -d "${GITDIR_uboot}/.git" ]; then
# not really needed - for consistency
if [ -d ${GITDIR_uboot} ]; then
rm -r ${GITDIR_uboot}
fi
git clone -b ${SRC_URI_uboot_branch} ${SRC_URI_uboot} ${GITDIR_uboot}
cd ${GITDIR_uboot}
git checkout ${SRCREV_uboot}
cd ${WORKDIR}
echo "Cloning u-boot-xlnx done."
else
echo "Skipped: u-boot-xlnx is already cloned."
fi
}
##########################################################################################
# In the overridden do_unpack() a patch file is created
do_unpack(){
echo "Linking and creating a patch file..."
if [ ! -h "${GITDIR_uboot}/${GITDIR_ezynq_label}" ]; then
ln -s ${GITDIR_ezynq} "${GITDIR_uboot}/${GITDIR_ezynq_label}"
fi
if [ ! -f "${GITDIR_ezynq}/${PATCH_NAME}" ]; then
cd ${GITDIR_ezynq}
diff -rubPB "${GITDIR_uboot_dir}" "${GITDIR_ezynq_u-boot-tree}" > "${PATCH_NAME}" || exit 0
cd ${WORKDIR}
echo "Done."
else
echo "Already exists."
fi
}
##########################################################################################
# overriding do_patch()
do_patch(){
echo "Applying the patch..."
cd ${GITDIR_uboot}
patch -r - -Np1 < "../${PATCH_NAME}" || exit 0
cd ${WORKDIR}
}
##########################################################################################
#overriding do_configure()
do_configure(){
echo "Configuring..."
cd ${GITDIR_uboot}
#no need to source init_env
#. ./init_env
oe_runmake clean
oe_runmake ${UBOOT_MACHINE}
oe_runmake include/autoconf.mk
cd ${WORKDIR}
}
##########################################################################################
#overriding do_compile()
do_compile(){
echo "Compiling..."
cd ${GITDIR_uboot}
echo "Running ezynqcfg.py for the first time - u-boot.bin length is not known yet, generating arch/arm/cpu/armv7/zynq/ezynq.c"
${GITDIR_ezynq_label}/ezynqcfg.py -c include/autoconf.mk --html u-boot.html -o boot_head.bin --html-mask 0x3ff --lowlevel arch/arm/cpu/armv7/zynq/ezynq.c
unset LDFLAGS
unset CFLAGS
unset CPPFLAGS
oe_runmake
echo "Running ezynqcfg.py for the second time - u-boot.bin length is known and will be used in the RBL header"
echo "Other files are already created, repeating it here just to remind their paths"
${GITDIR_ezynq_label}/ezynqcfg.py -c include/autoconf.mk -o boot_head.bin --uboot u-boot.bin --html u-boot.html --html-mask 0x3ff --lowlevel arch/arm/cpu/armv7/zynq/ezynq.c
cat boot_head.bin u-boot.bin > boot.bin
cd ${WORKDIR}
}
##########################################################################################
\ No newline at end of file
require recipes-bsp/u-boot/u-boot.inc
LICENSE = "GPLv2+ & GPLv3"
LIC_FILES_CHKSUM = "file://${GITDIR_uboot}/COPYING;md5=1707d6db1d42237583f50183a5651ecb \
file://${GITDIR_ezynq}/LICENSE;md5=891e49b3c2a8c133ffe7985e54245aff"
# Supposed source directory?
S = "${WORKDIR}/git/${GITDIR_uboot_dir}"
##########################################################################################
# Defining u-boot.inc parameters
# UBOOT_MACHINE is defined in meta-<board>/conf/machine/<board>.conf
# (e.g., meta-microzed/conf/machine/microzed.conf: UBOOT_MACHINE= zynq_microzed_config)
UBOOT_SUFFIX = "bin"
UBOOT_IMAGE = "boot-${MACHINE}-${PV}-${PR}.${UBOOT_SUFFIX}"
UBOOT_BINARY = "boot.${UBOOT_SUFFIX}"
UBOOT_SYMLINK = "boot-${MACHINE}.${UBOOT_SUFFIX}"
UBOOT_MAKE_TARGET = "all"
##########################################################################################
# Variables used in the below overridden functions
GITDIR_ezynq_dir= "git"
GITDIR_ezynq_label = "ezynq"
GITDIR_ezynq= "${WORKDIR}/${GITDIR_ezynq_dir}"
GITDIR_ezynq_u-boot-tree= "${GITDIR_ezynq}/u-boot-tree"
GITDIR_uboot_dir= "u-boot-xlnx"
GITDIR_uboot= "${WORKDIR}/git/${GITDIR_uboot_dir}"
SRC_URI_ezynq= "git://git.code.sf.net/p/elphel/ezynq"
SRC_URI_ezynq_branch= "master"
SRC_URI_uboot= "git://github.com/Xilinx/u-boot-xlnx.git"
SRC_URI_uboot_branch= "master-next"
SRCREV_ezynq= "023675f31ec08fe9c6c1e93e9cdfb4417125fbeb"
SRCREV_uboot= "bbd91fc9ae290c31dc52fd8322f43f67ddd39247"
PATCH_NAME= "ezynq.patch"
include ezynq-u-boot-tasks.inc
\ No newline at end of file
DESCRIPTION = "EZYNQ is the Xilinx's bootgen (fsbl) replacement + u-boot. The output is a working BOOT.BIN"
HOMEPAGE = "http://elphel.com;http://blog.elphel.com"
SECTION = "bootloaders"
#Project Version
PV = "v2013.01"
#Project Revision
PR = "r0"
include ezynq-u-boot.inc
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment