1
0
mirror of https://git.yoctoproject.org/meta-arm synced 2026-07-16 03:47:19 +00:00

add base recipes for tiny distro

Change-Id: Ibcab926c91ab472e05a9a9077ad06ea8372117b7
Signed-off-by: Rui Silva <rui.silva@arm.com>
This commit is contained in:
Rui Silva
2019-05-28 22:31:32 +01:00
committed by Tushar Khandelwal
parent 3d59929e06
commit c4057679c8
13 changed files with 409 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
+15
View File
@@ -0,0 +1,15 @@
# Iota has a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"
# Iota has a packages directory, add to BBFILES
BBFILES += " \
${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"
BBFILE_COLLECTIONS += "meta-iota"
BBFILE_PATTERN_meta-iota := "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-iota = "10"
LAYERSERIES_COMPAT_meta-iota = "thud"
INSTALL_GCC_ARM_LINUX_GNUEABIHF = "${bindir}/gcc-arm-linux-gnueabihf"
TC_ARM_LINUX_GNUEABIHF = "${STAGING_BINDIR_NATIVE}/gcc-arm-linux-gnueabihf"
@@ -0,0 +1,50 @@
SUMMARY = "Trusted Firmware for Cortex-A"
DESCRIPTION = "Trusted Firmware-A"
HOMEPAGE = "https://github.com/ARM-software/arm-trusted-firmware"
LICENSE = "BSD-3-Clause"
DEPENDS += " dtc-native u-boot gcc-arm-linux-eabi-native"
LIC_FILES_CHKSUM = "file://license.rst;md5=c709b197e22b81ede21109dbffd5f363"
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRCREV = "5ba32a7660051464ed1d56129adf2606db54b5e3"
SRC_URI = "git://github.com/ARM-software/arm-trusted-firmware;protocol=https;nobranch=1"
S = "${WORKDIR}/git"
B = "${WORKDIR}/build"
COMPATIBLE_MACHINE = "(vexpress-a5)"
PLATFORM_vexpress-a5 = "fvp_ve"
LDFLAGS[unexport] = "1"
do_compile_vexpress-a5() {
export PATH=${STAGING_BINDIR_NATIVE}/gcc-arm-linux-gnueabihf/bin:$PATH
mkdir -p ${B}
cp ${DEPLOY_DIR_IMAGE}/u-boot.bin \
${B}/
oe_runmake -C ${S} BUILD_BASE=${B} \
BUILD_PLAT=${B}/${PLATFORM}/ \
PLAT=${PLATFORM} \
ARM_ARCH_MAJOR=7 \
ARM_CORTEX_A5=yes \
FVP_HW_CONFIG_DTS=fdts/fvp-ve-Cortex-A5x1.dts \
ARM_XLAT_TABLES_LIB_V1=1 \
DEBUG=1 \
ARCH=aarch32 \
CROSS_COMPILE=arm-linux-gnueabihf- \
AARCH32_SP=sp_min \
BL33=${B}/u-boot.bin \
fip \
all
}
do_install() {
install -D -p -m 0644 ${B}/${PLATFORM}/bl1.bin ${DEPLOY_DIR_IMAGE}/bl1.bin
install -D -p -m 0644 ${B}/${PLATFORM}/fip.bin ${DEPLOY_DIR_IMAGE}/${PLATFORM}.fip
}
@@ -0,0 +1,35 @@
From 47aef59becef4abc86323ec0877104c9ffa331b8 Mon Sep 17 00:00:00 2001
From: Rui Miguel Silva <rui.silva@linaro.org>
Date: Fri, 3 Aug 2018 15:48:13 +0100
Subject: [PATCH] AArch32: initialise FPEXC only with support enable
Try to initialise FPEXC only when support with VFP is enable
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
include/common/aarch32/el3_common_macros.S | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/common/aarch32/el3_common_macros.S b/include/common/aarch32/el3_common_macros.S
index 5db88544..5b4c669b 100644
--- a/include/common/aarch32/el3_common_macros.S
+++ b/include/common/aarch32/el3_common_macros.S
@@ -85,6 +85,7 @@
stcopr r0, CPACR
isb
+#if SUPPORT_VFP
/* ---------------------------------------------------------------------
* Initialise FPEXC, setting all fields rather than relying on hw. Some
* fields are architecturally UNKNOWN on reset and are set to zero
@@ -97,6 +98,7 @@
ldr r0, =(FPEXC_RESET_VAL | FPEXC_EN_BIT)
vmsr FPEXC, r0
isb
+#endif
#if (ARM_ARCH_MAJOR > 7)
/* ---------------------------------------------------------------------
--
2.19.1
@@ -0,0 +1,28 @@
From a33f1a9eba489a67d69cc09dddb794aa8b9d1d35 Mon Sep 17 00:00:00 2001
From: Rui Silva <ruisil01@e121032-lin.cambridge.arm.com>
Date: Mon, 17 Dec 2018 22:47:41 +0000
Subject: [PATCH] tools: allow to override python
fix build of tools and use python given by env variable.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
tools/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/Makefile b/tools/Makefile
index cb1683e..9bf9ceb 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -138,7 +138,7 @@ tools/_libfdt.so: $(LIBFDT_SRCS) $(LIBFDT_SWIG)
CPPFLAGS="$(_hostc_flags)" OBJDIR=tools \
SOURCES="$(LIBFDT_SRCS) tools/libfdt.i" \
SWIG_OPTS="-I$(srctree)/lib/libfdt -I$(srctree)/lib" \
- $(libfdt_tree)/pylibfdt/setup.py --quiet build_ext \
+ ${PYTHON} $(libfdt_tree)/pylibfdt/setup.py --quiet build_ext \
--build-lib tools
ifneq ($(CONFIG_MX23)$(CONFIG_MX28),)
--
2.7.4
@@ -0,0 +1,50 @@
From 4f25bd32ee6307e2e3ac828426c1ef3adbc44292 Mon Sep 17 00:00:00 2001
From: Usama Arif <usama.arif@arm.com>
Date: Thu, 10 Jan 2019 10:27:04 +0000
Subject: [PATCH] vexpress64: setup kernel and rootfs from flash for
fvp versatile express model
Set and copy the kernel and rootfs from flash to memory before running the bootm
command.
Signed-off-by: Usama Arif <usama.arif@arm.com>
---
include/configs/vexpress_aemv8a.h | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/include/configs/vexpress_aemv8a.h b/include/configs/vexpress_aemv8a.h
index 4de9914..805f8c0 100644
--- a/include/configs/vexpress_aemv8a.h
+++ b/include/configs/vexpress_aemv8a.h
@@ -225,6 +225,7 @@
#elif defined(CONFIG_TARGET_VEXPRESS64_BASE_FVP) || \
defined(CONFIG_TARGET_VEXPRESS64_BASE_FVP_AARCH32)
+
#define CONFIG_EXTRA_ENV_SETTINGS \
"kernel_name=Image\0" \
"kernel_addr=0x80080000\0" \
@@ -239,9 +240,9 @@
"0x1c090000 debug user_debug=31 "\
"systemd.log_target=null "\
"androidboot.hardware=fvpbase "\
- "root=/dev/vda2 rw "\
- "rootwait "\
- "loglevel=9"
+ "loglevel=9 " \
+ "root=/dev/ram0 rw rootwait"
+
#define CONFIG_BOOTCOMMAND "if smhload ${fdt_name} ${fdt_addr}; then "\
" if smhload ${initrd_name} ${initrd_addr} "\
@@ -261,6 +262,8 @@
"fi; " \
"echo semihosting load failed, try booting "\
"with contents of DRAM; " \
+ "cp.b 0x0C100000 $kernel_addr 0x900000; " \
+ "cp.b 0x0CD00000 $initrd_addr 0x500000; " \
BOOT_TYPE " $kernel_addr $initrd_addr $fdt_addr"
#endif
--
2.7.4
@@ -0,0 +1,50 @@
From f09688c345597b7b6cb231bab5362d060632ba3b Mon Sep 17 00:00:00 2001
From: Rui Miguel Silva <rui.silva@linaro.org>
Date: Mon, 17 Dec 2018 14:36:46 +0000
Subject: [PATCH] vexpress64: setup kernel and rootfs from flash
Set and copy the kernel and rootfs from flash to memory before running the bootm
command.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
include/configs/vexpress_aemv8a.h | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/include/configs/vexpress_aemv8a.h b/include/configs/vexpress_aemv8a.h
index 4de9914128..9cb778ba91 100644
--- a/include/configs/vexpress_aemv8a.h
+++ b/include/configs/vexpress_aemv8a.h
@@ -225,6 +225,7 @@
#elif defined(CONFIG_TARGET_VEXPRESS64_BASE_FVP) || \
defined(CONFIG_TARGET_VEXPRESS64_BASE_FVP_AARCH32)
+
#define CONFIG_EXTRA_ENV_SETTINGS \
"kernel_name=Image\0" \
"kernel_addr=0x80080000\0" \
@@ -239,9 +240,9 @@
"0x1c090000 debug user_debug=31 "\
"systemd.log_target=null "\
"androidboot.hardware=fvpbase "\
- "root=/dev/vda2 rw "\
- "rootwait "\
- "loglevel=9"
+ "loglevel=9 " \
+ "root=/dev/ram0 rw rootwait"
+
#define CONFIG_BOOTCOMMAND "if smhload ${fdt_name} ${fdt_addr}; then "\
" if smhload ${initrd_name} ${initrd_addr} "\
@@ -261,6 +262,8 @@
"fi; " \
"echo semihosting load failed, try booting "\
"with contents of DRAM; " \
+ "cp.b 0x08100000 $kernel_addr 0x900000; " \
+ "cp.b 0x08D00000 $initrd_addr 0x500000; " \
BOOT_TYPE " $kernel_addr $initrd_addr $fdt_addr"
#endif
--
2.19.2
@@ -0,0 +1,32 @@
SRCREV = "9bed08a2ed8d4915e694e5b4a030bd361b829a52"
LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6"
SRC_URI_vexpress-a5 += "\
git://git.linaro.org/landing-teams/working/arm/u-boot;protocol=https;nobranch=1 \
file://0001-vexpress64-setup-kernel-and-rootfs-from-flash-for-fvpve.patch \
file://0001-tools-allow-to-override-python.patch \
"
S = "${WORKDIR}/git"
B = "${WORKDIR}/build"
PLATFORM_vexpress-a5 = "fvp_ve"
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
COMPATIBLE_MACHINE = "(vexpress-a5)"
do_compile_vexpress-a5() {
mkdir -p ${B}
oe_runmake -C ${S} BUILD_BASE=${B} \
BUILD_PLAT=${B}/${PLATFORM}/ \
vexpress_aemv8a_aarch32_defconfig \
O=${B}
oe_runmake -C ${S} BUILD_BASE=${B} \
BUILD_PLAT=${B}/${PLATFORM}/ \
SUPPORT_ARCH_TIMER=no \
O=${B}
}
@@ -0,0 +1,50 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (c) 2018 Linaro, LLC
# Copyright (c) 2018 ARM Limited
#
# Iota Recipe to build tiny minimal image
#
SUMARY = "Iota Tiny Minimal Image"
DESCRIPTION = "Tiny Linux image for Iota Distribution"
LICENSE = "MIT"
DEPENDS += "u-boot-mkimage-native"
IMAGE_LINGUAS = " "
IMAGE_FEATURES += "debug-tweaks"
inherit core-image
KERNEL_IMAGETYPE = "zImage"
# Remove Partition table if wic image is generated
do_cleanup_partition_table() {
echo "check if partition table exits in wic image"
header=$(head -c 4 ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.wic | md5sum -b | cut -d ' ' -f1)
if [ ${header}=="d9a7c187f1dc40d183b645f61daa500f" ]; then
echo "remove partition table from wic image"
tail -c +1025 ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.wic > ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.img
mv ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.img ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.wic
fi
#remove ramfs from previoes stage
rm -rf ${DEPLOY_DIR_IMAGE}/${IMAGE_BASENAME}-${MACHINE}.cpio.gz
}
addtask do_cleanup_partition_table after do_image_wic before do_image_complete
do_image_make_ramfs() {
echo "adding uboot header to cpio.gz"
mkimage -A arm -O linux -C none -T ramdisk -n ramdisk -a 0x84000000 -e 0x84000000 -n "Iota Ramdisk" -d ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.cpio.gz ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.initramfs.cpio.gz
cp -rf ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.initramfs.cpio.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_BASENAME}-${MACHINE}.cpio.gz
mv ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.initramfs.cpio.gz ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.cpio.gz
}
do_image_make_ramfs_corstone700() {
echo "uboot header not required for corstone700"
cp -f ${IMGDEPLOYDIR}/${IMAGE_BASENAME}-${MACHINE}.cpio.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_BASENAME}-${MACHINE}.cpio.gz
}
addtask do_image_make_ramfs after do_image_cpio before do_image_wic
@@ -0,0 +1,29 @@
# Recipe for fetching and installing the prebuilt gcc-arm
# linaro 6.2.1 toolchain.
# Recipe based on the meta-ti layer:
# http://git.yoctoproject.org/cgit/cgit.cgi/meta-ti/tree/recipes-ti/devtools/gcc-arm-none-eabi-native_4.9.2015q3.bb?h=master
#
# Linaro 6.2.1 is the recommended toolchain for arm-trusted-firmware
GCC_ARM_VERSION = "gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf"
LICENSE="GPLv3"
LIC_FILES_CHKSUM = "file://share/doc/gdb/gdb/Free-Software.html;md5=96c83aa6efb937afca4e4b5810f2b975"
inherit native
SRC_URI = "https://releases.linaro.org/components/toolchain/binaries/6.2-2016.11/arm-linux-gnueabihf/${GCC_ARM_VERSION}.tar.xz"
SRC_URI[md5sum] = "8f5c112ab5fa26248eb5d9110a09e030"
S = "${WORKDIR}/${GCC_ARM_VERSION}"
do_install() {
install -d ${D}${INSTALL_GCC_ARM_LINUX_GNUEABIHF}
cp -r ${S}/. ${D}${INSTALL_GCC_ARM_LINUX_GNUEABIHF}
}
FILES_${PN} = "${INSTALL_GCC_ARM_LINUX_GNUEABIHF}/"
INHIBIT_SYSROOT_STRIP = "1"
INSANE_SKIP_${PN} = "already-stripped"
@@ -0,0 +1,5 @@
SRC_URI = "git://git.kernel.org/pub/scm/utils/dtc/dtc.git"
SRCREV = "65cc4d2748a2c2e6f27f1cf39e07a5dbabd80ebf"
LIC_FILES_CHKSUM = "file://GPL;md5=94d55d512a9ba36caa9b7df079bae19f"
@@ -0,0 +1,37 @@
S = "${WORKDIR}/linux-${PV}"
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI = " \
git://git.linaro.org/landing-teams/working/arm/kernel-testing.git;protocol=https;branch=tinylinux_giot_demo \
"
SRCREV = "135e79d294c9ec552687cccd3a28147d2df69d29"
SRCREV_machine = "135e79d294c9ec552687cccd3a28147d2df69d29"
KBUILD_DEFCONFIG_vexpress-a5 ?= "tiny_vexpress_defconfig"
COMPATIBLE_MACHINE += "|vexpress-a5"
do_preconfigure() {
mkdir -p ${B}
echo "" > ${B}/.config
CONF_SED_SCRIPT=""
kernel_conf_variable LOCALVERSION "\"${LOCALVERSION}\""
kernel_conf_variable LOCALVERSION_AUTO y
sed -e "${CONF_SED_SCRIPT}" < '${S}/arch/arm/configs/${KBUILD_DEFCONFIG_vexpress}' >> '${B}/.config'
if [ "${SCMVERSION}" = "y" ]; then
# Add GIT revision to the local version
head=`git --git-dir=${S}/.git rev-parse --verify --short HEAD 2> /dev/null`
printf "%s%s" +g $head > ${S}/.scmversion
fi
}
do_install_append() {
install -d ${D}/boot
}
ALLOW_EMPTY_kernel-devicetree = "1"
+11
View File
@@ -0,0 +1,11 @@
# Partition for vexpress-a5
# Rawcopy of the FIP binary
part --source rawcopy --sourceparams="file=fvp_ve.fip" --no-table --align 1 --fixed-size 1
# Rawcopy of the kernel binary
part --source rawcopy --sourceparams="file=zImage" --no-table --fixed-size 12
# Rawcopy of the rootfs
part --source rawcopy --sourceparams="file=iota-tiny-image-vexpress-a5.cpio.gz" --no-table