Commit 7d8cbefb authored by Oliver Horst's avatar Oliver Horst
Browse files

[chg] Made xilinx-bootbin target working

parent cdc3460e
DEPENDS += "${EXTRA_IMAGEDEPENDS}"
inherit deploy qemuboot
BINARY_NAME ?= "${PN}.elf"
do_deploy () {
install -d "${DEPLOYDIR}"
install -m 644 "${B}/${BINARY_NAME}" "${DEPLOYDIR}/${PN}.elf"
}
addtask do_deploy after do_install before do_build
QB_DEFAULT_KERNEL = "none"
QB_DEFAULT_FSTYPE = "none"
QB_ROOTFS = "none"
QB_DTB = ""
QB_NET = "none"
QB_NETWORK_DEVICE = ""
QB_OPT_APPEND = "-device loader,file=${DEPLOY_DIR_IMAGE}/toki-init.elf,cpu-num=0 -nographic"
fakeroot python do_rootfs () {
}
do_rootfs[dirs] = "${TOPDIR}"
do_rootfs[cleandirs] += "${IMGDEPLOYDIR}"
do_rootfs[umask] = "022"
addtask rootfs before do_build after do_deploy
fakeroot python do_image () {
}
do_image[dirs] = "${TOPDIR}"
do_image[umask] = "022"
addtask do_image after do_rootfs before do_build
fakeroot python do_image_complete () {
}
do_image_complete[dirs] = "${TOPDIR}"
do_image_complete[umask] = "022"
SSTATETASKS += "do_image_complete"
SSTATE_SKIP_CREATION_task-image-complete = '1'
do_image_complete[sstate-inputdirs] = "${IMGDEPLOYDIR}"
do_image_complete[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}"
do_image_complete[stamp-extra-info] = "${MACHINE}"
addtask do_image_complete after do_image before do_build
......@@ -50,7 +50,7 @@ def get_toki_hw_image(d):
path = config["hw-image"]
if not os.path.isabs(path):
path = os.path.join(os.getenv('TOKI_SRC_DIR', os.curdir), path)
path = os.path.join(d.getVar('TOKI_SRC_DIR', True), path)
return path
......
......@@ -40,7 +40,7 @@ DISTRO_EXTRA_RRECOMMENDS += " ${TOKI_DEFAULT_EXTRA_RRECOMMENDS}"
TCLIBCAPPEND = ""
QEMU_TARGETS ?= "aarch64"
QEMU_TARGETS ?= "aarch64 arm microblaze microblazeel"
PREMIRRORS ??= "\
bzr://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
......@@ -67,6 +67,7 @@ SANITY_TESTED_DISTROS ?= " \
ubuntu-16.04 \n \
ubuntu-16.10 \n \
ubuntu-17.04 \n \
ubuntu-18.04 \n \
fedora-26 \n \
centos-7 \n \
debian-9 \n \
......
require recipes-core/toki/toki-init_git.bb
python() {
# generate a bit-mask from the list of slave cores
slave_cores = d.getVar("TOKI_SLAVE_CORES", True)
......@@ -10,3 +8,5 @@ python() {
TARGET_LDFLAGS += "-Wl,--defsym,_AMP_USE_CORE=${TOKI_AMP_CORE} \
-Wl,--defsym,__AMP_SLAVE_MASK=${TOKI_SLAVE_MASK} \
-Wl,--defsym,__AMP_NUM_CORES=${@get_toki_num_cores(d)}"
require toki-init_git.inc
......@@ -6,8 +6,8 @@ python() {
master_core = d.getVar("TOKI_MASTER_CORE", True)
enabled_cores.add(master_core)
mc_template = "mc:amp-c0:amp-c{}:amp-image:do_build"
mc_depends_str = ' '.join(mc_template.format(core) for core in enabled_cores)
mc_template = "mc:amp-c{}:amp-c{}:toki-amp-instance:do_build"
mc_depends_str = ' '.join(mc_template.format(master_core, core) for core in enabled_cores)
d.setVarFlag('do_compile', 'mcdepends', mc_depends_str)
}
......@@ -19,26 +19,25 @@ python() {
do_compile() {
# get ALL (master+slave) images from the deploy directories
for i in ${TOKI_MASTER_CORE} ${TOKI_SLAVE_CORES}; do
image=$(find ${TOPDIR}/tmp/multiconfigs/amp-c${i}/deploy -name amp-image.elf)
cp $image ${B}/amp-image-${i}.elf
instance_binary=$(find ${TOPDIR}/tmp/multiconfigs/amp-c${i}/work/*/toki-amp-instance/*/image/ -name init.elf)
cp $instance_binary ${B}/toki-amp-instance-${i}.elf
done
for i in ${TOKI_SLAVE_CORES}; do
# prefix symbols i images
${OBJCOPY} --prefix-symbols=core_${i}_ amp-image-${i}.elf
${OBJCOPY} --prefix-symbols=core_${i}_ toki-amp-instance-${i}.elf
# remove ELF headers
${OBJCOPY} -O binary -R .comment amp-image-${i}.elf amp-image-${i}
${OBJCOPY} -O binary -R .comment toki-amp-instance-${i}.elf toki-amp-instance-${i}
# copy shrinked image files into the corresponding section of the master image
${OBJCOPY} --update-section .core_${i}_bin=amp-image-${i} amp-image-${TOKI_MASTER_CORE}.elf
${OBJCOPY} --update-section .core_${i}_bin=toki-amp-instance-${i} toki-amp-instance-${TOKI_MASTER_CORE}.elf
done
}
addtask do_compile before do_deploy
do_deploy() {
cp ${B}/amp-image-${TOKI_MASTER_CORE}.elf ${DEPLOY_DIR_IMAGE}/amp-master.elf
cp ${B}/toki-amp-instance-${TOKI_MASTER_CORE}.elf ${DEPLOY_DIR_IMAGE}/toki-amp-master.elf
}
addtask do_deploy after do_compile before do_build
......
......@@ -7,9 +7,7 @@ EXTERNALSRC = "${@relative_externalsrc(d, "init")}"
DEPENDS = "freertos ldscript app-list"
BINARY_NAME = "init.elf"
inherit cmake toki-image
inherit cmake
TARGET_CFLAGS += "-nostdlib"
TARGET_LDFLAGS += "-nostdlib"
......
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