This series of patches provides initial support for the FVP in meta-morello. The images were successfully run using the FVP wrapper from meta-arm and behaviour of the pure-cap-app was as expected, this was confirmed via a telnet console.
The display, when using the python script, did not work for me and I was presented with:
Warning: Morello_Top: GPU model fails to read settings.ini! Default configuration options will be used. I have confirmed that this file actually exists and this is not the case when run manually.
Regardless, I do not really care about the display at this point.
The testimage functionality was not tested.
Pawel Zalewski (13): conf: replace machine configuration fvp: add ecosystem for Morello linux-image: correct the compatible machine classes: change the machine-driven appends fvp: add rom-binaries board-firmware: match the new machine configuration scp-firmware: match the new machine configuration tf-a: match the new machine configuration uefi: match the new machine configuration morello-image: match the new machine configuration grub: purecap c64 initramfs kas: match the new machine configuration README.md : update
README.md | 39 ++++---- classes/llvm-morello-native.bbclass | 6 +- conf/local.conf.sample | 3 +- conf/machine/include/morello-common.inc | 5 +- conf/machine/morello-bsp.conf | 9 -- conf/machine/morello-fvp.conf | 64 +++++++++++++ conf/machine/morello-linux-musl.conf | 17 ---- ...ello-linux-glibc.conf => morello-soc.conf} | 15 +-- conf/multiconfig/morello-firmware.conf | 1 - conf/multiconfig/morello-linux-glibc.conf | 1 - conf/multiconfig/morello-linux-musl.conf | 1 - kas/morello-fvp.yml | 29 ++++++ kas/morello-linux-glibc.yml | 8 -- kas/morello-linux-musl.yml | 8 -- kas/{morello-bsp.yml => morello-soc.yml} | 4 +- .../board-firmware/board-firmware-image.bb | 19 +++- .../board-firmware/board-firmware_1.4.bb | 4 +- .../board-firmware/board-morello-fvp.inc | 2 + .../board-firmware/board-morello-soc.inc | 1 + recipes-bsp/grub/files/grub-config.cfg | 18 ++-- recipes-bsp/rom-binaries/rom-binaries_1.5.bb | 37 +++++++ .../scp-firmware/scp-firmware-morello-fvp.inc | 1 + .../scp-firmware/scp-firmware-morello-soc.inc | 1 + .../scp-firmware/scp-firmware_2.10.%.bbappend | 8 +- .../tfa-firmware-morello-fvp.inc | 2 + .../tfa-firmware-morello-soc.inc | 2 + .../trusted-firmware-a_2.%.bbappend | 10 +- .../uefi/edk2-firmware-morello-fvp.inc | 2 + .../uefi/edk2-firmware-morello-soc.inc | 2 + recipes-bsp/uefi/edk2-firmware_%.bbappend | 8 +- recipes-core/busybox/busybox-morello.inc | 2 +- recipes-core/musl/musl_%.bbappend | 4 +- recipes-devtools/fvp/fvp-morello.bb | 10 ++ recipes-devtools/gdb/gdb_%.bbappend | 2 +- recipes-devtools/llvm/llvm-morello_13.0.bb | 2 +- recipes-kernel/linux/linux-morello.inc | 2 +- .../applications/pure-cap-app.bb | 2 +- .../files/init.sh | 15 --- .../files/initramfs.list.template | 0 .../images/morello-initramfs-musl.bb | 53 ---------- ...nitramfs-glibc.bb => morello-initramfs.bb} | 4 +- .../images/morello-linux-image-fvp.inc | 1 + .../images/morello-linux-image-musl.bb | 96 ------------------- .../images/morello-linux-image-soc.inc | 1 + ...-image-glibc.bb => morello-linux-image.bb} | 26 +++-- .../files/init.sh | 30 ++++-- .../files/initramfs.list.template | 2 - 47 files changed, 287 insertions(+), 292 deletions(-) delete mode 100644 conf/machine/morello-bsp.conf create mode 100644 conf/machine/morello-fvp.conf delete mode 100644 conf/machine/morello-linux-musl.conf rename conf/machine/{morello-linux-glibc.conf => morello-soc.conf} (53%) delete mode 100644 conf/multiconfig/morello-firmware.conf delete mode 100644 conf/multiconfig/morello-linux-glibc.conf delete mode 100644 conf/multiconfig/morello-linux-musl.conf create mode 100644 kas/morello-fvp.yml delete mode 100644 kas/morello-linux-glibc.yml delete mode 100644 kas/morello-linux-musl.yml rename kas/{morello-bsp.yml => morello-soc.yml} (55%) create mode 100644 recipes-bsp/board-firmware/board-morello-fvp.inc create mode 100644 recipes-bsp/board-firmware/board-morello-soc.inc create mode 100644 recipes-bsp/rom-binaries/rom-binaries_1.5.bb create mode 100644 recipes-bsp/scp-firmware/scp-firmware-morello-fvp.inc create mode 100644 recipes-bsp/scp-firmware/scp-firmware-morello-soc.inc create mode 100644 recipes-bsp/trusted-firmware-a/tfa-firmware-morello-fvp.inc create mode 100644 recipes-bsp/trusted-firmware-a/tfa-firmware-morello-soc.inc create mode 100644 recipes-bsp/uefi/edk2-firmware-morello-fvp.inc create mode 100644 recipes-bsp/uefi/edk2-firmware-morello-soc.inc create mode 100644 recipes-devtools/fvp/fvp-morello.bb rename recipes-morello/images/{morello-linux-glibc => morello-fvp}/files/init.sh (65%) rename recipes-morello/images/{morello-linux-glibc => morello-fvp}/files/initramfs.list.template (100%) delete mode 100644 recipes-morello/images/morello-initramfs-musl.bb rename recipes-morello/images/{morello-initramfs-glibc.bb => morello-initramfs.bb} (93%) create mode 100644 recipes-morello/images/morello-linux-image-fvp.inc delete mode 100644 recipes-morello/images/morello-linux-image-musl.bb create mode 100644 recipes-morello/images/morello-linux-image-soc.inc rename recipes-morello/images/{morello-linux-image-glibc.bb => morello-linux-image.bb} (80%) rename recipes-morello/images/{morello-linux-musl => morello-soc}/files/init.sh (65%) rename recipes-morello/images/{morello-linux-musl => morello-soc}/files/initramfs.list.template (93%)
The old bsp, glibc and musl machines are replaced with morello-soc and morello-fvp.
Signed-off-by: Pawel Zalewski pzalewski@thegoodpenguin.co.uk --- conf/local.conf.sample | 3 +- conf/machine/include/morello-common.inc | 5 +- conf/machine/morello-bsp.conf | 9 --- conf/machine/morello-fvp.conf | 64 +++++++++++++++++++ conf/machine/morello-linux-musl.conf | 17 ----- ...ello-linux-glibc.conf => morello-soc.conf} | 15 +++-- conf/multiconfig/morello-firmware.conf | 1 - conf/multiconfig/morello-linux-glibc.conf | 1 - conf/multiconfig/morello-linux-musl.conf | 1 - 9 files changed, 75 insertions(+), 41 deletions(-) delete mode 100644 conf/machine/morello-bsp.conf create mode 100644 conf/machine/morello-fvp.conf delete mode 100644 conf/machine/morello-linux-musl.conf rename conf/machine/{morello-linux-glibc.conf => morello-soc.conf} (53%) delete mode 100644 conf/multiconfig/morello-firmware.conf delete mode 100644 conf/multiconfig/morello-linux-glibc.conf delete mode 100644 conf/multiconfig/morello-linux-musl.conf
diff --git a/conf/local.conf.sample b/conf/local.conf.sample index ef7bc7d..1752f41 100644 --- a/conf/local.conf.sample +++ b/conf/local.conf.sample @@ -1,5 +1,4 @@ -MACHINE ?= "morello-linux-glibc" -BBMULTICONFIG = "morello-firmware morello-linux-glibc" +MACHINE ?= "morello-fvp"
BB_NUMBER_THREADS ?= "${@oe.utils.cpu_count()}" PARALLEL_MAKE ?= "-j ${@oe.utils.cpu_count()}" diff --git a/conf/machine/include/morello-common.inc b/conf/machine/include/morello-common.inc index 84af134..2279c71 100644 --- a/conf/machine/include/morello-common.inc +++ b/conf/machine/include/morello-common.inc @@ -23,7 +23,4 @@ GLOBAL_ARCH_TRIPLE ?= "${C64_ARCH_TRIPLE}" GLOBAL_LIB_TRIPLE ?= "${C64_LIB_TRIPLE}" GLOBAL_ARCH_FLAGS ?= "${C64_ARCH_FLAGS}"
-TMPDIR_BSP = "tmp-bsp" -TMPDIR_LINUX = "tmp-linux" - -APP_DIR ?= "pure-cap-apps" +APP_DIR ?= "pure-cap-apps" \ No newline at end of file diff --git a/conf/machine/morello-bsp.conf b/conf/machine/morello-bsp.conf deleted file mode 100644 index 45b12fb..0000000 --- a/conf/machine/morello-bsp.conf +++ /dev/null @@ -1,9 +0,0 @@ -require conf/machine/include/morello-common.inc - -PREFERRED_VERSION_scp-firmware = "2.10%" -PREFERRED_VERSION_trusted-firmware-a = "2.7%" -PREFERRED_VERSION_board-firmware = "1.4" - -TMPDIR = "${TOPDIR}/${TMPDIR_BSP}" - -TCLIBCAPPEND = "" \ No newline at end of file diff --git a/conf/machine/morello-fvp.conf b/conf/machine/morello-fvp.conf new file mode 100644 index 0000000..94e9437 --- /dev/null +++ b/conf/machine/morello-fvp.conf @@ -0,0 +1,64 @@ +require conf/machine/include/morello-common.inc + +MACHINEOVERRIDES =. "morello-fvp:" + +PREFERRED_VERSION_scp-firmware = "2.10%" +PREFERRED_VERSION_trusted-firmware-a = "2.7%" +PREFERRED_VERSION_board-firmware = "1.4" + +TCLIBCAPPEND = "" + +BSP_GRUB_DIR ?= "${TMPDIR}/deploy/images/morello-fvp/grub-efi" +BSP_DTB_DIR ?= "${TMPDIR}/deploy/images/morello-fvp" + +TMPDIR = "${TOPDIR}/tmp-fvp" + +MUSL_INSTALL_DIR ?= "${libdir}/${GLOBAL_ARCH_TRIPLE}" + +IMAGE_BASENAME = "rootfs" +IMAGE_FSTYPES:append = " ext4" + +# The rootfs image that will go on a bootable drive +MORELLO_ROOTFS_IMAGE = "core-image-minimal" + +IMAGE_INSTALL:append = " linux-firmware-rtl8168" +IMAGE_INSTALL:append = " musl-libc busybox-morello pure-cap-app llvm-morello gdbserver gdb llvm-morello-staticdev" + +DISTRO ?= "poky" + +SERIAL_CONSOLES = "115200;ttyAMA0" + +# FVP Config +FVP_PROVIDER ?= "fvp-morello-native" +FVP_EXE ?= "FVP_Morello" + +# FVP Parameters +FVP_DATA += "Morello_Top.css.scp.armcortexm7ct=${DEPLOY_DIR_IMAGE}/rom-binaries/scp_romfw.bin@0x0" +FVP_DATA += "Morello_Top.css.mcp.armcortexm7ct=${DEPLOY_DIR_IMAGE}/rom-binaries/mcp_romfw.bin@0x0" + +FVP_CONFIG[css.trustedBootROMloader.fname] ?= "${DEPLOY_DIR_IMAGE}/rom-binaries/bl1.bin" + +FVP_CONFIG[Morello_Top.soc.scp_qspi_loader.fname] ?= "${DEPLOY_DIR_IMAGE}/scp_fw.bin" +FVP_CONFIG[Morello_Top.soc.mcp_qspi_loader.fname] ?= "${DEPLOY_DIR_IMAGE}/mcp_fw.bin" + +FVP_CONFIG[board.ap_qspi_loader.fname] ?= "${DEPLOY_DIR_IMAGE}/fip.bin" + +FVP_CONFIG[board.virtioblockdevice.image_path] ?= "${DEPLOY_DIR_IMAGE}/morello-linux-image-c64-glibc.img" + +FVP_CONFIG[board.virtio_net.hostbridge.userNetworking] ?= "1" +FVP_CONFIG[board.virtio_net.enabled] ?= "1" +FVP_CONFIG[board.virtio_net.transport] ?= "legacy" +FVP_CONFIG[board.virtio_net.hostbridge.userNetPorts] ?= "8022=22" + +FVP_CONFIG[css.scp.armcortexm7ct.INITVTOR] ?= "0x0" +FVP_CONFIG[css.mcp.armcortexm7ct.INITVTOR] ?= "0x0" + +FVP_CONFIG[css.pl011_uart_ap.unbuffered_output] ?= "1" +FVP_CONFIG[board.virtio_rng.enabled] ?= "1" +FVP_CONFIG[board.virtio_rng.seed] ?= "0" +FVP_CONFIG[num_clusters] ?= "2" +FVP_CONFIG[num_cores] ?= "2" + +FVP_CONFIG[disable_visualisation] ?= "true" + +FVP_TERMINALs[terminal_uart_ap] ?= "AP" \ No newline at end of file diff --git a/conf/machine/morello-linux-musl.conf b/conf/machine/morello-linux-musl.conf deleted file mode 100644 index f33e31b..0000000 --- a/conf/machine/morello-linux-musl.conf +++ /dev/null @@ -1,17 +0,0 @@ -require conf/machine/include/morello-common.inc - -MACHINEOVERRIDES =. "morello-linux-musl:" - -TARGET_OS ?= "linux-musl" - -PREFFERED_PROVIDER_morello-linux-image = "morello-linux-image-musl" -PREFFERED_PROVIDER_morello-initramfs = "morello-initramfs-musl" - -TCLIBC = "musl" - -BSP_GRUB_DIR ?= "${TOPDIR}/${TMPDIR_BSP}/deploy/images/morello-bsp/grub-efi" -BSP_DTB_DIR ?= "${TOPDIR}/${TMPDIR_BSP}/deploy/images/morello-bsp" - -TMPDIR = "${TOPDIR}/${TMPDIR_LINUX}" - -DISTRO = "" diff --git a/conf/machine/morello-linux-glibc.conf b/conf/machine/morello-soc.conf similarity index 53% rename from conf/machine/morello-linux-glibc.conf rename to conf/machine/morello-soc.conf index 3ffd19f..cc8e6de 100644 --- a/conf/machine/morello-linux-glibc.conf +++ b/conf/machine/morello-soc.conf @@ -1,14 +1,17 @@ require conf/machine/include/morello-common.inc
-MACHINEOVERRIDES =. "morello-linux-glibc:" +MACHINEOVERRIDES =. "morello-soc:"
-PREFFERED_PROVIDER_morello-linux-image = "morello-linux-image-glibc" -PREFFERED_PROVIDER_morello-initramfs = "morello-initramfs-glibc" +PREFERRED_VERSION_scp-firmware = "2.10%" +PREFERRED_VERSION_trusted-firmware-a = "2.7%" +PREFERRED_VERSION_board-firmware = "1.4"
-BSP_GRUB_DIR ?= "${TOPDIR}/${TMPDIR_BSP}/deploy/images/morello-bsp/grub-efi" -BSP_DTB_DIR ?= "${TOPDIR}/${TMPDIR_BSP}/deploy/images/morello-bsp" +TCLIBCAPPEND = ""
-TMPDIR = "${TOPDIR}/${TMPDIR_LINUX}" +BSP_GRUB_DIR ?= "${TMPDIR}/deploy/images/morello-soc/grub-efi" +BSP_DTB_DIR ?= "${TMPDIR}/deploy/images/morello-soc" + +TMPDIR = "${TOPDIR}/tmp-soc"
MUSL_INSTALL_DIR ?= "${libdir}/${GLOBAL_ARCH_TRIPLE}"
diff --git a/conf/multiconfig/morello-firmware.conf b/conf/multiconfig/morello-firmware.conf deleted file mode 100644 index 1473440..0000000 --- a/conf/multiconfig/morello-firmware.conf +++ /dev/null @@ -1 +0,0 @@ -MACHINE="morello-bsp" \ No newline at end of file diff --git a/conf/multiconfig/morello-linux-glibc.conf b/conf/multiconfig/morello-linux-glibc.conf deleted file mode 100644 index 9f9a8e8..0000000 --- a/conf/multiconfig/morello-linux-glibc.conf +++ /dev/null @@ -1 +0,0 @@ -MACHINE="morello-linux-glibc" \ No newline at end of file diff --git a/conf/multiconfig/morello-linux-musl.conf b/conf/multiconfig/morello-linux-musl.conf deleted file mode 100644 index f8660f3..0000000 --- a/conf/multiconfig/morello-linux-musl.conf +++ /dev/null @@ -1 +0,0 @@ -MACHINE="morello-linux-musl" \ No newline at end of file
Added a new recipe for the Morello FVP.
Signed-off-by: Pawel Zalewski pzalewski@thegoodpenguin.co.uk --- recipes-devtools/fvp/fvp-morello.bb | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 recipes-devtools/fvp/fvp-morello.bb
diff --git a/recipes-devtools/fvp/fvp-morello.bb b/recipes-devtools/fvp/fvp-morello.bb new file mode 100644 index 0000000..764b9c3 --- /dev/null +++ b/recipes-devtools/fvp/fvp-morello.bb @@ -0,0 +1,10 @@ +require recipes-devtools/fvp/fvp-ecosystem.inc + +MODEL = "Morello%20Platform" +MODEL_CODE = "FVP_Morello" +PV = "0.11.34" + +SRC_URI[sha256sum] = "ed1e110fb7fa8732d4f1bea9af69491a9e3f7dbf57d2ce6ea916d3cdf910d324" + +LIC_FILES_CHKSUM = "file://license_terms/license_agreement.txt;md5=1a33828e132ba71861c11688dbb0bd16 \ + file://license_terms/third_party_licenses.txt;md5=3db0c4947b7e3405c40b943672d8de2f" \ No newline at end of file
Changed the compatible machine from morello-linux to morello, this was done to match the new machine config.
Signed-off-by: Pawel Zalewski pzalewski@thegoodpenguin.co.uk --- recipes-core/busybox/busybox-morello.inc | 2 +- recipes-core/musl/musl_%.bbappend | 4 ++-- recipes-devtools/gdb/gdb_%.bbappend | 2 +- recipes-devtools/llvm/llvm-morello_13.0.bb | 2 +- recipes-kernel/linux/linux-morello.inc | 2 +- recipes-morello-apps/applications/pure-cap-app.bb | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/recipes-core/busybox/busybox-morello.inc b/recipes-core/busybox/busybox-morello.inc index 7c5fd9d..97bb2ef 100644 --- a/recipes-core/busybox/busybox-morello.inc +++ b/recipes-core/busybox/busybox-morello.inc @@ -1,6 +1,6 @@ inherit llvm-morello-native
-COMPATIBLE_MACHINE = "morello-linux" +COMPATIBLE_MACHINE = "morello" SUMMARY = "CHERI enabled busybox" LICENSE = "GPL-2.0-only" SECTION = "base" diff --git a/recipes-core/musl/musl_%.bbappend b/recipes-core/musl/musl_%.bbappend index cfe23e8..4f899a9 100644 --- a/recipes-core/musl/musl_%.bbappend +++ b/recipes-core/musl/musl_%.bbappend @@ -1,8 +1,8 @@ require musl-morello-${MORELLO_ARCH}.inc musl-morello-${MORELLO_ARCH}-so.inc musl-morello-target.inc
MACHINE_INC ?= "" -MACHINE_INC:morello-linux-glibc = "override-glibc.inc" -MACHINE_INC:morello-linux-musl = "override-musl.inc" +MACHINE_INC:morello-soc = "override-glibc.inc" +MACHINE_INC:morello-fvp = "override-glibc.inc"
require ${MACHINE_INC}
diff --git a/recipes-devtools/gdb/gdb_%.bbappend b/recipes-devtools/gdb/gdb_%.bbappend index a73a113..631c79e 100644 --- a/recipes-devtools/gdb/gdb_%.bbappend +++ b/recipes-devtools/gdb/gdb_%.bbappend @@ -1,4 +1,4 @@ -COMPATIBLE_MACHINE = "morello-linux" +COMPATIBLE_MACHINE = "morello"
SRC_URI = "git://git.morello-project.org/morello/binutils-gdb.git;protocol=https;branch=${SRCBRANCH}" SRCBRANCH = "users/ARM/morello-binutils-gdb-master" diff --git a/recipes-devtools/llvm/llvm-morello_13.0.bb b/recipes-devtools/llvm/llvm-morello_13.0.bb index dc10f9d..61bc9bd 100644 --- a/recipes-devtools/llvm/llvm-morello_13.0.bb +++ b/recipes-devtools/llvm/llvm-morello_13.0.bb @@ -1,5 +1,5 @@
-COMPATIBLE_MACHINE = "morello-linux" +COMPATIBLE_MACHINE = "morello" DESCRIPTION = "The Morello LLVM Compiler Infrastructure for A64" SUMMARY = "LLVM Morello" HOMEPAGE = "https://git.morello-project.org/morello/llvm-project-releases" diff --git a/recipes-kernel/linux/linux-morello.inc b/recipes-kernel/linux/linux-morello.inc index cb9f1db..30f681f 100644 --- a/recipes-kernel/linux/linux-morello.inc +++ b/recipes-kernel/linux/linux-morello.inc @@ -1,6 +1,6 @@ inherit llvm-morello-native require recipes-kernel/linux/linux-yocto.inc -COMPATIBLE_MACHINE = "morello-linux" +COMPATIBLE_MACHINE = "morello" SUMMARY = "Morello Linux kernel fork" DESCRIPTION = "CHERI aware Linux kernel" OUTPUTS_NAME = "morello-linux" diff --git a/recipes-morello-apps/applications/pure-cap-app.bb b/recipes-morello-apps/applications/pure-cap-app.bb index a5b2e01..7f3c6db 100644 --- a/recipes-morello-apps/applications/pure-cap-app.bb +++ b/recipes-morello-apps/applications/pure-cap-app.bb @@ -1,6 +1,6 @@ inherit pure-cap-application llvm-morello-native
-COMPATIBLE_MACHINE = "morello-linux" +COMPATIBLE_MACHINE = "morello" SUMMARY = "Simple capability application" DESCRIPTION = "Application used in the series of blogs found @ https://www.thegoodpenguin.co.uk/blog/tag/morello/" OUTPUTS_NAME = "pure-cap-app"
Changed the class-target appends to match the new machine configuration.
Signed-off-by: Pawel Zalewski pzalewski@thegoodpenguin.co.uk --- classes/llvm-morello-native.bbclass | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/classes/llvm-morello-native.bbclass b/classes/llvm-morello-native.bbclass index d1e2397..3c1b9d3 100644 --- a/classes/llvm-morello-native.bbclass +++ b/classes/llvm-morello-native.bbclass @@ -6,9 +6,9 @@ LLVM_PATH = "${STAGING_DIR_NATIVE}/usr/bin"
INHIBIT_DEFAULT_DEPS = "1"
-DEPENDS += "virtual/llvm-morello-native" -DEPENDS:append:morello-linux-glibc:class-target = " virtual/musl-morello-libs-native" -DEPENDS:append:morello-linux-musl:class-target = " virtual/musl-morello-libs-native" +DEPENDS += "virtual/llvm-morello-native" +DEPENDS:append:morello-fvp:class-target = " virtual/musl-morello-libs-native" +DEPENDS:append:morello-soc:class-target = " virtual/musl-morello-libs-native"
# rough hack to deal with llvm-morello not being a proper toolchain in its own meta yet DEPENDS:remove = "libgcc"
Added a new recipe for rom-binaries that will be required for the FVP runs.
Signed-off-by: Pawel Zalewski pzalewski@thegoodpenguin.co.uk --- recipes-bsp/rom-binaries/rom-binaries_1.5.bb | 37 ++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 recipes-bsp/rom-binaries/rom-binaries_1.5.bb
diff --git a/recipes-bsp/rom-binaries/rom-binaries_1.5.bb b/recipes-bsp/rom-binaries/rom-binaries_1.5.bb new file mode 100644 index 0000000..461e20c --- /dev/null +++ b/recipes-bsp/rom-binaries/rom-binaries_1.5.bb @@ -0,0 +1,37 @@ +inherit deploy + +COMPATIBLE_MACHINE = "morello-fvp" +SUMMARY = "ROM binaries for Morello" +DESCRIPTION = "These are the ROM binaries that went into Morello silicon and we need to use the same on FVP to avoid deviations in the software stack." +HOMEPAGE = "https://git.morello-project.org/morello/rom-binaries" +LICENSE = "BSD-3-Clause" + +PROVIDES = "virtual/${BPN}" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +SRC_URI = "git://git.morello-project.org/morello/rom-binaries;protocol=https;branch=${SRCBRANCH}" +SRCREV = "c86e6a17563423d3938240799196ec68784f9e04" + +SRCBRANCH = "morello/release-1.5" + +LIC_FILES_CHKSUM = "file://LICENSES/bl1.txt;md5=8737ebfecb4a75675c676c10f7d07c70 \ + file://LICENSES/mcp_rom.txt;md5=ad686ac8d50ed47c030a1094ffdead49 \ + file://LICENSES/scp_rom.txt;md5=f4d01c71878528d6bb100cb606db590c \ + " + +S = "${WORKDIR}/git" + +do_install () { + install ${S}/bl1.bin ${D}/bl1.bin + install ${S}/scp_romfw.bin ${D}/scp_romfw.bin + install ${S}/mcp_romfw.bin ${D}/mcp_romfw.bin +} + +do_deploy() { + install -d ${DEPLOYDIR}/rom-binaries + install ${S}/bl1.bin ${DEPLOYDIR}/rom-binaries/bl1.bin + install ${S}/scp_romfw.bin ${DEPLOYDIR}/rom-binaries/scp_romfw.bin + install ${S}/mcp_romfw.bin ${DEPLOYDIR}/rom-binaries/mcp_romfw.bin +} +addtask deploy after do_install \ No newline at end of file
When the machine is a FVP we will fetch and delpoy rom-binaries as well.
Signed-off-by: Pawel Zalewski pzalewski@thegoodpenguin.co.uk --- .../board-firmware/board-firmware-image.bb | 19 ++++++++++++++++--- .../board-firmware/board-firmware_1.4.bb | 4 +++- .../board-firmware/board-morello-fvp.inc | 2 ++ .../board-firmware/board-morello-soc.inc | 1 + 4 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 recipes-bsp/board-firmware/board-morello-fvp.inc create mode 100644 recipes-bsp/board-firmware/board-morello-soc.inc
diff --git a/recipes-bsp/board-firmware/board-firmware-image.bb b/recipes-bsp/board-firmware/board-firmware-image.bb index b872a3a..2ab5e5f 100644 --- a/recipes-bsp/board-firmware/board-firmware-image.bb +++ b/recipes-bsp/board-firmware/board-firmware-image.bb @@ -8,9 +8,19 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ec OUTPUTS_NAME = "board-firmware-sd-image" SECTION = "firmware"
+MACHINE_BOARD_REQUIRE ?= "" +MACHINE_BOARD_REQUIRE:morello-fvp = "board-morello-fvp.inc" +MACHINE_BOARD_REQUIRE:morello-soc = "board-morello-soc.inc" +require ${MACHINE_BOARD_REQUIRE} + +PACKAGE_ARCH = "${MACHINE_ARCH}" + BB_DONT_CACHE = "1"
-DEPENDS += "virtual/board-firmware virtual/scp-firmware virtual/trusted-firmware-a virtual/uefi virtual/grub-efi mtools-native fiptool-native" +DEPENDS += "virtual/board-firmware virtual/scp-firmware \ + virtual/trusted-firmware-a virtual/uefi virtual/grub-efi \ + mtools-native fiptool-native" + PROVIDES = "virtual/board-firmware-image"
MCP_BLOB_ID = "54464222-a4cf-4bf8-b1b6-cee7dade539e" @@ -43,11 +53,11 @@ do_install[depends] += "virtual/trusted-firmware-a:do_populate_sysroot" do_install:prepend() {
fiptool create \ - --scp-fw "${FIRMWARE_PATH}/scp_ramfw_soc.bin" \ + --scp-fw "${FIRMWARE_PATH}/scp_ramfw_${TARGET_PLATFORM}.bin" \ "${FIRMWARE_PATH}/scp_fw.bin"
fiptool create \ - --blob uuid="${MCP_BLOB_ID}",file="${FIRMWARE_PATH}/mcp_ramfw_soc.bin" \ + --blob uuid="${MCP_BLOB_ID}",file="${FIRMWARE_PATH}/mcp_ramfw_${TARGET_PLATFORM}.bin" \ "${FIRMWARE_PATH}/mcp_fw.bin"
install -d "${FIRMWARE_PATH}/tfa_certs" @@ -78,5 +88,8 @@ do_install() {
do_deploy() { cp -rf ${D}/firmware/board-firmware-image/${OUTPUTS_NAME}.img ${DEPLOYDIR}/${OUTPUTS_NAME}.img + install ${SYSROOT_SOFTWARE_PATH}/fip.bin ${DEPLOYDIR}/fip.bin + install ${SYSROOT_SOFTWARE_PATH}/scp_fw.bin ${DEPLOYDIR}/scp_fw.bin + install ${SYSROOT_SOFTWARE_PATH}/mcp_fw.bin ${DEPLOYDIR}/mcp_fw.bin } addtask deploy after do_install \ No newline at end of file diff --git a/recipes-bsp/board-firmware/board-firmware_1.4.bb b/recipes-bsp/board-firmware/board-firmware_1.4.bb index 84a5394..9d98dc2 100644 --- a/recipes-bsp/board-firmware/board-firmware_1.4.bb +++ b/recipes-bsp/board-firmware/board-firmware_1.4.bb @@ -6,7 +6,9 @@ LICENSE = "STMicroelectronics & BSD-3-Clause & BSD-2-Clause" OUTPUTS_NAME = "board-firmware" SECTION = "firmware"
-PROVIDES += "virtual/${OUTPUTS_NAME}" +PROVIDES += "virtual/${OUTPUTS_NAME}" + +PACKAGE_ARCH = "${MACHINE_ARCH}"
SRC_URI = "git://git.morello-project.org/morello/board-firmware;protocol=https;branch=${SRCBRANCH}" SRCREV = "20e3e673f13e854109a069dd719f49e06336142d" diff --git a/recipes-bsp/board-firmware/board-morello-fvp.inc b/recipes-bsp/board-firmware/board-morello-fvp.inc new file mode 100644 index 0000000..fa62792 --- /dev/null +++ b/recipes-bsp/board-firmware/board-morello-fvp.inc @@ -0,0 +1,2 @@ +TARGET_PLATFORM = "fvp" +DEPENDS += "virtual/rom-binaries" diff --git a/recipes-bsp/board-firmware/board-morello-soc.inc b/recipes-bsp/board-firmware/board-morello-soc.inc new file mode 100644 index 0000000..94d624b --- /dev/null +++ b/recipes-bsp/board-firmware/board-morello-soc.inc @@ -0,0 +1 @@ +TARGET_PLATFORM = "soc" \ No newline at end of file
Request the machine dependent include file.
Signed-off-by: Pawel Zalewski pzalewski@thegoodpenguin.co.uk --- recipes-bsp/scp-firmware/scp-firmware-morello-fvp.inc | 1 + recipes-bsp/scp-firmware/scp-firmware-morello-soc.inc | 1 + recipes-bsp/scp-firmware/scp-firmware_2.10.%.bbappend | 8 ++++++-- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 recipes-bsp/scp-firmware/scp-firmware-morello-fvp.inc create mode 100644 recipes-bsp/scp-firmware/scp-firmware-morello-soc.inc
diff --git a/recipes-bsp/scp-firmware/scp-firmware-morello-fvp.inc b/recipes-bsp/scp-firmware/scp-firmware-morello-fvp.inc new file mode 100644 index 0000000..d109c66 --- /dev/null +++ b/recipes-bsp/scp-firmware/scp-firmware-morello-fvp.inc @@ -0,0 +1 @@ +FW_INSTALL = "ramfw_fvp romfw" \ No newline at end of file diff --git a/recipes-bsp/scp-firmware/scp-firmware-morello-soc.inc b/recipes-bsp/scp-firmware/scp-firmware-morello-soc.inc new file mode 100644 index 0000000..f3620c0 --- /dev/null +++ b/recipes-bsp/scp-firmware/scp-firmware-morello-soc.inc @@ -0,0 +1 @@ +FW_INSTALL = "ramfw_soc romfw" \ No newline at end of file diff --git a/recipes-bsp/scp-firmware/scp-firmware_2.10.%.bbappend b/recipes-bsp/scp-firmware/scp-firmware_2.10.%.bbappend index 10fb915..69fdd1d 100644 --- a/recipes-bsp/scp-firmware/scp-firmware_2.10.%.bbappend +++ b/recipes-bsp/scp-firmware/scp-firmware_2.10.%.bbappend @@ -4,6 +4,11 @@ COMPATIBLE_MACHINE = "morello" OUTPUTS_NAME = "scp-firmware" SECTION = "firmware"
+MACHINE_SCP_REQUIRE ?= "" +MACHINE_SCP_REQUIRE:morello-fvp = "scp-firmware-morello-fvp.inc" +MACHINE_SCP_REQUIRE:morello-soc = "scp-firmware-morello-soc.inc" +require ${MACHINE_SCP_REQUIRE} + DEPENDS += "virtual/board-firmware"
PROVIDES += "virtual/${OUTPUTS_NAME}" @@ -21,11 +26,10 @@ SENSOR = "${RECIPE_SYSROOT}/board-firmware/LIB/sensor.a" B = "${WORKDIR}/build/morello"
FW_TARGETS = "scp mcp" -FW_INSTALL = "ramfw_soc romfw"
unset do_configure[noexec] unset do_compile[cleandirs] -do_deploy[noexec] = "1" +do_configure[depends] += "board-firmware:do_install"
do_configure() {
Request the machine dependent include file. There was a bug in this recipe, TARGET_PLATFROM was missing a single quote.
Signed-off-by: Pawel Zalewski pzalewski@thegoodpenguin.co.uk --- .../trusted-firmware-a/tfa-firmware-morello-fvp.inc | 2 ++ .../trusted-firmware-a/tfa-firmware-morello-soc.inc | 2 ++ .../trusted-firmware-a/trusted-firmware-a_2.%.bbappend | 10 +++++++--- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 recipes-bsp/trusted-firmware-a/tfa-firmware-morello-fvp.inc create mode 100644 recipes-bsp/trusted-firmware-a/tfa-firmware-morello-soc.inc
diff --git a/recipes-bsp/trusted-firmware-a/tfa-firmware-morello-fvp.inc b/recipes-bsp/trusted-firmware-a/tfa-firmware-morello-fvp.inc new file mode 100644 index 0000000..8080147 --- /dev/null +++ b/recipes-bsp/trusted-firmware-a/tfa-firmware-morello-fvp.inc @@ -0,0 +1,2 @@ +TFA_INSTALL_TARGET = "bl1 bl2 bl31 dtbs morello-fvp morello_fw_config morello_tb_fw_config morello_nt_fw_config" +TARGET_PLATFORM = "fvp" \ No newline at end of file diff --git a/recipes-bsp/trusted-firmware-a/tfa-firmware-morello-soc.inc b/recipes-bsp/trusted-firmware-a/tfa-firmware-morello-soc.inc new file mode 100644 index 0000000..a1c8b06 --- /dev/null +++ b/recipes-bsp/trusted-firmware-a/tfa-firmware-morello-soc.inc @@ -0,0 +1,2 @@ +TFA_INSTALL_TARGET = "bl1 bl2 bl31 dtbs morello-soc morello_fw_config morello_tb_fw_config morello_nt_fw_config" +TARGET_PLATFORM = "soc" diff --git a/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.%.bbappend b/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.%.bbappend index 227dc57..da47a7a 100644 --- a/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.%.bbappend +++ b/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.%.bbappend @@ -5,6 +5,12 @@ SUMMARY = "TF-A to be compiled with LLVM Morello" OUTPUTS_NAME = "trusted-firmware-a" SECTION = "firmware"
+MACHINE_TFA_REQUIRE ?= "" +MACHINE_TFA_REQUIRE:morello-fvp = "tfa-firmware-morello-fvp.inc" +MACHINE_TFA_REQUIRE:morello-soc = "tfa-firmware-morello-soc.inc" + +require ${MACHINE_TFA_REQUIRE} + PROVIDES += "virtual/${OUTPUTS_NAME}"
SRC_URI = "gitsm://git.morello-project.org/morello/trusted-firmware-a;protocol=https;name=tfa;branch=${SRCBRANCH}" @@ -26,8 +32,6 @@ TFA_UBOOT = "0" TFA_BUILD_TARGET = "bl1 bl2 bl31 dtbs" TFA_DEBUG = "0"
-TFA_INSTALL_TARGET = "bl1 bl2 bl31 dtbs morello-soc morello_fw_config morello_tb_fw_config morello_nt_fw_config " - ARM_TF_ARCH = "aarch64"
EXTRA_OEMAKE += "\ @@ -36,7 +40,7 @@ EXTRA_OEMAKE += "\ ROT_KEY=plat/arm/board/common/rotpk/arm_rotprivk_rsa.pem \ TRUSTED_BOARD_BOOT=1 \ ARM_ROTPK_LOCATION=devel_rsa \ - TARGET_PLATFORM=soc \ + TARGET_PLATFORM='${TARGET_PLATFORM}' \ ENABLE_MORELLO_CAP=1 \ ARCH='${ARM_TF_ARCH}' \ "
Request the machine dependent include file.
Signed-off-by: Pawel Zalewski pzalewski@thegoodpenguin.co.uk --- recipes-bsp/uefi/edk2-firmware-morello-fvp.inc | 2 ++ recipes-bsp/uefi/edk2-firmware-morello-soc.inc | 2 ++ recipes-bsp/uefi/edk2-firmware_%.bbappend | 8 ++++++-- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 recipes-bsp/uefi/edk2-firmware-morello-fvp.inc create mode 100644 recipes-bsp/uefi/edk2-firmware-morello-soc.inc
diff --git a/recipes-bsp/uefi/edk2-firmware-morello-fvp.inc b/recipes-bsp/uefi/edk2-firmware-morello-fvp.inc new file mode 100644 index 0000000..5139a26 --- /dev/null +++ b/recipes-bsp/uefi/edk2-firmware-morello-fvp.inc @@ -0,0 +1,2 @@ +EDK2_PLATFORM = "morellofvp" +EDK2_PLATFORM_DSC = "edk2-platforms/Platform/ARM/Morello/MorelloPlatformFvp.dsc" \ No newline at end of file diff --git a/recipes-bsp/uefi/edk2-firmware-morello-soc.inc b/recipes-bsp/uefi/edk2-firmware-morello-soc.inc new file mode 100644 index 0000000..98763a6 --- /dev/null +++ b/recipes-bsp/uefi/edk2-firmware-morello-soc.inc @@ -0,0 +1,2 @@ +EDK2_PLATFORM = "morellosoc" +EDK2_PLATFORM_DSC = "edk2-platforms/Platform/ARM/Morello/MorelloPlatformSoc.dsc" \ No newline at end of file diff --git a/recipes-bsp/uefi/edk2-firmware_%.bbappend b/recipes-bsp/uefi/edk2-firmware_%.bbappend index 146c962..c561c0d 100644 --- a/recipes-bsp/uefi/edk2-firmware_%.bbappend +++ b/recipes-bsp/uefi/edk2-firmware_%.bbappend @@ -5,6 +5,11 @@ SUMMARY = "EDK2 to be compiled with LLVM Morello" OUTPUTS_NAME = "uefi" SECTION = "firmware"
+MACHINE_EDK2_REQUIRE ?= "" +MACHINE_EDK2_REQUIRE:morello-fvp = "edk2-firmware-morello-fvp.inc" +MACHINE_EDK2_REQUIRE:morello-soc = "edk2-firmware-morello-soc.inc" +require ${MACHINE_EDK2_REQUIRE} + PROVIDES += "virtual/${OUTPUTS_NAME}" DEPENDS += "acpica-native python3-native"
@@ -26,8 +31,7 @@ SRCREV_edk2-platforms = "6bae2381d664e668875720e7eb86f751cb1de373" PV = "git${SRCPV}"
EDK2_BUILD_RELEASE = "0" -EDK2_PLATFORM = "morellosoc" -EDK2_PLATFORM_DSC = "edk2-platforms/Platform/ARM/Morello/MorelloPlatformSoc.dsc" + EDK2_BIN_NAME = "BL33_AP_UEFI.fd" EDK2_ARCH = "AARCH64" EDK2_BUILD_FLAGS += "-D ENABLE_MORELLO_CAP=1"
Purge the old recipes and create images for soc/fvp which are actually the same at this point in time.
Signed-off-by: Pawel Zalewski pzalewski@thegoodpenguin.co.uk --- .../files/init.sh | 15 --- .../files/initramfs.list.template | 0 .../images/morello-initramfs-musl.bb | 53 ---------- ...nitramfs-glibc.bb => morello-initramfs.bb} | 4 +- .../images/morello-linux-image-fvp.inc | 1 + .../images/morello-linux-image-musl.bb | 96 ------------------- .../images/morello-linux-image-soc.inc | 1 + ...-image-glibc.bb => morello-linux-image.bb} | 26 +++-- .../files/init.sh | 30 ++++-- .../files/initramfs.list.template | 2 - 10 files changed, 44 insertions(+), 184 deletions(-) rename recipes-morello/images/{morello-linux-glibc => morello-fvp}/files/init.sh (65%) rename recipes-morello/images/{morello-linux-glibc => morello-fvp}/files/initramfs.list.template (100%) delete mode 100644 recipes-morello/images/morello-initramfs-musl.bb rename recipes-morello/images/{morello-initramfs-glibc.bb => morello-initramfs.bb} (93%) create mode 100644 recipes-morello/images/morello-linux-image-fvp.inc delete mode 100644 recipes-morello/images/morello-linux-image-musl.bb create mode 100644 recipes-morello/images/morello-linux-image-soc.inc rename recipes-morello/images/{morello-linux-image-glibc.bb => morello-linux-image.bb} (80%) rename recipes-morello/images/{morello-linux-musl => morello-soc}/files/init.sh (65%) rename recipes-morello/images/{morello-linux-musl => morello-soc}/files/initramfs.list.template (93%)
diff --git a/recipes-morello/images/morello-linux-glibc/files/init.sh b/recipes-morello/images/morello-fvp/files/init.sh similarity index 65% rename from recipes-morello/images/morello-linux-glibc/files/init.sh rename to recipes-morello/images/morello-fvp/files/init.sh index d98f607..1806644 100644 --- a/recipes-morello/images/morello-linux-glibc/files/init.sh +++ b/recipes-morello/images/morello-fvp/files/init.sh @@ -40,21 +40,6 @@ echo "Installing busybox..."
! grep -qE $'\t'"devtmpfs$" /proc/filesystems && mdev -s
-ROOT="/newroot" - -PARTUUID=$(cat proc/cmdline | sed 's/ /\n/g' | sed -n 's/^root=PARTUUID=*//p') - -DEVID=$(blkid | sed -n "s/UUID="$PARTUUID" TYPE="ext4"*//p" | sed 's/://') - -echo "Mounting ${DEVID} rootfs with PARTUUID: ${PARTUUID}" - -mount ${DEVID} ${ROOT} - -ulimit -c unlimited - -cd ${ROOT} -exec switch_root . /sbin/init </dev/ttyAMA0 >dev/ttyAMA0 2>&1 - echo "/bin/sh as PID 1!" echo "init.sh" exec setsid cttyhack sh diff --git a/recipes-morello/images/morello-linux-glibc/files/initramfs.list.template b/recipes-morello/images/morello-fvp/files/initramfs.list.template similarity index 100% rename from recipes-morello/images/morello-linux-glibc/files/initramfs.list.template rename to recipes-morello/images/morello-fvp/files/initramfs.list.template diff --git a/recipes-morello/images/morello-initramfs-musl.bb b/recipes-morello/images/morello-initramfs-musl.bb deleted file mode 100644 index 06cce37..0000000 --- a/recipes-morello/images/morello-initramfs-musl.bb +++ /dev/null @@ -1,53 +0,0 @@ -inherit deploy nopackages - -COMPATIBLE_MACHINE = "morello-linux-musl" -SUMMARY = "Initramfs for busybox" -DESCRIPTION = "Initramfs for busybox, bypassing the Yocto way" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" -OUTPUTS_NAME = "morello-initramfs" - -DEPENDS += "virtual/morello-busybox gen-init-cpio-native pure-cap-app" -PROVIDES = "${OUTPUTS_NAME}" - -BB_DONT_CACHE = "1" -INHIBIT_DEFAULT_DEPS = "1" - -FILESEXTRAPATHS:prepend := "${THISDIR}:" - -SRC_URI = "file://files/init.sh \ - file://files/initramfs.list.template \ - " -do_configure[noexec] = "1" -do_compile[noexec] = "1" -do_deploy[depends] = "virtual/morello-busybox:do_populate_sysroot" - - -do_install() { - - local sysroot_prefix="recipe-sysroot" - - sed -e "s@%FILES%@/files@" \ - "${WORKDIR}/files/initramfs.list.template" > "${WORKDIR}/files/initramfs.list.tmp1" - - sed -e "s@%BUSYBOX%@/${sysroot_prefix}/busybox@" \ - "${WORKDIR}/files/initramfs.list.tmp1" > "${WORKDIR}/files/initramfs.list.tmp2" - - sed -e "s@%APP_DIR%@/${APP_DIR}@" \ - "${WORKDIR}/files/initramfs.list.tmp2" > "${WORKDIR}/files/initramfs.list" - - install -d ${D}/${OUTPUTS_NAME} - - rm -f ${D}/${OUTPUTS_NAME}/initramfs - - { - env -C ${WORKDIR} ${STAGING_BINDIR_NATIVE}/gen_init_cpio "${WORKDIR}/files/initramfs.list" - env -C "${STAGING_DIR_TARGET}/" find . -not -path "./sysroot-providers*" -print0 | env -C "${STAGING_DIR_TARGET}/" cpio --null --owner +0:+0 --create --format=newc - } > ${D}/${OUTPUTS_NAME}/initramfs -} - -do_deploy() { - install -d ${DEPLOYDIR}/${OUTPUTS_NAME} - install ${D}/${OUTPUTS_NAME}/initramfs ${DEPLOYDIR}/${OUTPUTS_NAME}/initramfs -} -addtask deploy after do_install \ No newline at end of file diff --git a/recipes-morello/images/morello-initramfs-glibc.bb b/recipes-morello/images/morello-initramfs.bb similarity index 93% rename from recipes-morello/images/morello-initramfs-glibc.bb rename to recipes-morello/images/morello-initramfs.bb index 707842e..c3abac8 100644 --- a/recipes-morello/images/morello-initramfs-glibc.bb +++ b/recipes-morello/images/morello-initramfs.bb @@ -1,12 +1,14 @@ inherit deploy nopackages
-COMPATIBLE_MACHINE = "morello-linux-glibc" +COMPATIBLE_MACHINE = "morello" SUMMARY = "Initramfs for busybox" DESCRIPTION = "Initramfs for busybox, bypassing the Yocto way" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" OUTPUTS_NAME = "morello-initramfs"
+PACKAGE_ARCH = "${MACHINE_ARCH}" + DEPENDS += "virtual/morello-busybox gen-init-cpio-native" PROVIDES = "${OUTPUTS_NAME}"
diff --git a/recipes-morello/images/morello-linux-image-fvp.inc b/recipes-morello/images/morello-linux-image-fvp.inc new file mode 100644 index 0000000..1e0424c --- /dev/null +++ b/recipes-morello/images/morello-linux-image-fvp.inc @@ -0,0 +1 @@ +TARGET_PLATFORM = "fvp" \ No newline at end of file diff --git a/recipes-morello/images/morello-linux-image-musl.bb b/recipes-morello/images/morello-linux-image-musl.bb deleted file mode 100644 index 45196d0..0000000 --- a/recipes-morello/images/morello-linux-image-musl.bb +++ /dev/null @@ -1,96 +0,0 @@ -inherit deploy nopackages - -COMPATIBLE_MACHINE = "morello-linux-musl" -SUMMARY = "Bootable Morello Linux Image" -DESCRIPTION = "Image that goes on a bootable device, can be DD'ed onto a USB stick" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" -OUTPUTS_NAME = "morello-linux-image" - -INHIBIT_DEFAULT_DEPS = "1" - -DEPENDS += "virtual/kernel morello-initramfs mtools-native e2fsprogs-native coreutils-native bc-native util-linux-native" -PROVIDES = "${OUTPUTS_NAME}" - -IMAGE_SIZE = "100" - -IMAGE_SECTORS = "204800" - -LBA = "512" -PART_START_ALIGNMENT = "2048" - -ESP_IMAGE = "${OUTPUTS_NAME}-esp" - -do_configure[noexec] = "1" -do_compile[noexec] = "1" -do_install[mcdepends] = "mc:${BB_CURRENT_MC}:morello-firmware:board-firmware-image:do_deploy" - -def get_next_part_start (d): - next_image_start = int(d.getVar('IMAGE_SECTORS')) + int(d.getVar('PART_START_ALIGNMENT')) + int(d.getVar('PART_START_ALIGNMENT')) - 1 - next_image_start = next_image_start & ~(int(d.getVar('PART_START_ALIGNMENT')) -1) - return next_image_start - -add_to_image() { - mcopy -i ${1} -m -D overwrite ${2} ::${3} -} - -mult() { - local ret=$(echo "${1} * ${2}" | bc) - echo ${ret} -} - -create_gpt() { - - local esp_type="C12A7328-F81F-11D2-BA4B-00A0C93EC93B" - local linux_type="0FC63DAF-8483-4772-8E79-3D69D8477DE4" - - local part_start_esp=${PART_START_ALIGNMENT} - local part_start_linux="${@get_next_part_start(d)}" - - { - echo "label: gpt" - echo "start=${part_start_esp}, size=${IMAGE_SECTORS}, name=ESP, type=${esp_type}" - echo "start=${part_start_linux}, size=${IMAGE_SECTORS}, name=root, type=${linux_type}" - } | sfdisk -q "${1}" - - dd if="${2}" of="${1}" seek=$(mult ${part_start_esp} ${LBA}) bs=8M conv=notrunc,sparse oflag=seek_bytes status=progress - dd if="${3}" of="${1}" seek=$(mult ${part_start_linux} ${LBA}) bs=8M conv=notrunc,sparse oflag=seek_bytes status=progress -} - -do_install() { - - local part0="${BSP_GRUB_DIR}/grub-efi-bootaa64.efi" - local part1="${BSP_GRUB_DIR}/grub-config.cfg" - local part2="${BSP_DTB_DIR}/morello-soc.dtb" - local part3="${DEPLOY_DIR}/images/morello-linux-musl/Image" - local part4="${DEPLOY_DIR}/images/morello-linux-musl/morello-initramfs/initramfs" - - # create empty ext4 rootfs - : > ${D}/root.img - truncate --size="${IMAGE_SIZE}M" ${D}/root.img - mkfs.ext4 ${D}/root.img - - # create the ESP - dd if=/dev/zero of=${ESP_IMAGE}.img bs=1024K count=${IMAGE_SIZE} - mformat -i ${ESP_IMAGE}.img -v ESP :: - - mmd -i ${ESP_IMAGE}.img ::/EFI - mmd -i ${ESP_IMAGE}.img ::/EFI/BOOT - - add_to_image ${ESP_IMAGE}.img ${part0} /EFI/BOOT/BOOTAA64.EFI - add_to_image ${ESP_IMAGE}.img ${part1} /EFI/BOOT/grub.cfg - add_to_image ${ESP_IMAGE}.img ${part2} /morello.dtb - add_to_image ${ESP_IMAGE}.img ${part3} /Image - add_to_image ${ESP_IMAGE}.img ${part4} /initramfs - - : > ${OUTPUTS_NAME}.img - truncate --size="$(mult ${IMAGE_SIZE} 3)M" ${OUTPUTS_NAME}.img - - create_gpt ${OUTPUTS_NAME}.img ${ESP_IMAGE}.img ${D}/root.img - install ${OUTPUTS_NAME}.img ${D}/${OUTPUTS_NAME}.img -} - -do_deploy() { - install ${D}/${OUTPUTS_NAME}.img ${DEPLOYDIR}/${OUTPUTS_NAME}-${MORELLO_ARCH}-${TCLIBC}.img -} -addtask deploy after do_install diff --git a/recipes-morello/images/morello-linux-image-soc.inc b/recipes-morello/images/morello-linux-image-soc.inc new file mode 100644 index 0000000..94d624b --- /dev/null +++ b/recipes-morello/images/morello-linux-image-soc.inc @@ -0,0 +1 @@ +TARGET_PLATFORM = "soc" \ No newline at end of file diff --git a/recipes-morello/images/morello-linux-image-glibc.bb b/recipes-morello/images/morello-linux-image.bb similarity index 80% rename from recipes-morello/images/morello-linux-image-glibc.bb rename to recipes-morello/images/morello-linux-image.bb index 135ce9a..4c0f2bd 100644 --- a/recipes-morello/images/morello-linux-image-glibc.bb +++ b/recipes-morello/images/morello-linux-image.bb @@ -1,6 +1,6 @@ inherit deploy nopackages
-COMPATIBLE_MACHINE = "morello-linux-glibc" +COMPATIBLE_MACHINE = "morello" SUMMARY = "Bootable Morello Linux Image" DESCRIPTION = "Image that goes on a bootable device, can be DD'ed onto a USB stick" LICENSE = "MIT" @@ -9,7 +9,15 @@ OUTPUTS_NAME = "morello-linux-image"
INHIBIT_DEFAULT_DEPS = "1"
-DEPENDS += "virtual/kernel morello-initramfs mtools-native e2fsprogs-native coreutils-native bc-native util-linux-native" +MACHINE_LINUX_REQUIRE ?= "" +MACHINE_LINUX_REQUIRE:morello-fvp = "morello-linux-image-fvp.inc" +MACHINE_LINUX_REQUIRE:morello-soc = "morello-linux-image-soc.inc" + +require ${MACHINE_LINUX_REQUIRE} + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +DEPENDS += "virtual/kernel virtual/grub-efi morello-initramfs mtools-native e2fsprogs-native coreutils-native bc-native util-linux-native" PROVIDES = "${OUTPUTS_NAME}"
ESP_SIZE = "100" @@ -20,11 +28,11 @@ PART_START_ALIGNMENT = "2048"
ESP_IMAGE = "${OUTPUTS_NAME}-esp"
-ROOTFS = "${DEPLOY_DIR}/images/morello-linux-glibc/rootfs-morello-linux-glibc.ext4" +ROOTFS = "${DEPLOY_DIR}/images/morello-${TARGET_PLATFORM}/rootfs-morello-${TARGET_PLATFORM}.ext4"
-do_compile[noexec] = "1" -do_configure[depends] += "${MORELLO_ROOTFS_IMAGE}:do_image_complete morello-initramfs:do_deploy" -do_configure[mcdepends] += "mc:${BB_CURRENT_MC}:morello-firmware:board-firmware-image:do_deploy" +do_compile[noexec] = "1" +do_configure[depends] += "${MORELLO_ROOTFS_IMAGE}:do_image_complete morello-initramfs:do_deploy" +do_configure[depends] += "board-firmware-image:do_deploy"
def get_next_part_start (d): next_image_start = int(d.getVar('BOOT_SECTORS')) + int(d.getVar('PART_START_ALIGNMENT')) + int(d.getVar('PART_START_ALIGNMENT')) - 1 @@ -103,9 +111,9 @@ do_install() {
local part0="${BSP_GRUB_DIR}/grub-efi-bootaa64.efi" local part1="${BSP_GRUB_DIR}/grub-config.cfg.processed" - local part2="${BSP_DTB_DIR}/morello-soc.dtb" - local part3="${DEPLOY_DIR}/images/morello-linux-glibc/Image" - local part4="${DEPLOY_DIR}/images/morello-linux-glibc/morello-initramfs/initramfs" + local part2="${BSP_DTB_DIR}/morello-${TARGET_PLATFORM}.dtb" + local part3="${DEPLOY_DIR}/images/morello-${TARGET_PLATFORM}/Image" + local part4="${DEPLOY_DIR}/images/morello-${TARGET_PLATFORM}/morello-initramfs/initramfs"
rm -f ${ESP_IMAGE}.img
diff --git a/recipes-morello/images/morello-linux-musl/files/init.sh b/recipes-morello/images/morello-soc/files/init.sh similarity index 65% rename from recipes-morello/images/morello-linux-musl/files/init.sh rename to recipes-morello/images/morello-soc/files/init.sh index 7c1aa8d..1806644 100644 --- a/recipes-morello/images/morello-linux-musl/files/init.sh +++ b/recipes-morello/images/morello-soc/files/init.sh @@ -1,33 +1,47 @@ #!/bin/busybox sh
-# Copyright (c) 2021 Arm Limited. All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause - mount() { /bin/busybox mount "$@" }
+umount() { + /bin/busybox umount "$@" +} + grep() { /bin/busybox grep "$@" }
+cp() { + /bin/busybox cp "$@" +} + +mkdir() { + /bin/busybox mkdir "$@" +} + +switch_root () { + /bin/busybox switch_root "$@" +} + +sed () { + /bin/busybox sed "$@" +} + echo "Running init script"
mount -t proc proc /proc grep -qE $'\t'"devtmpfs$" /proc/filesystems && mount -t devtmpfs dev /dev mount -t sysfs sysfs /sys
-echo "Installing busybox" +echo "Installing busybox..."
/bin/busybox --install -s
! grep -qE $'\t'"devtmpfs$" /proc/filesystems && mdev -s
-ulimit -c unlimited - echo "/bin/sh as PID 1!" echo "init.sh" exec setsid cttyhack sh echo setsid ctty hack failed so "exec /bin/sh" fallback will be used -exec /bin/sh +exec /bin/sh \ No newline at end of file diff --git a/recipes-morello/images/morello-linux-musl/files/initramfs.list.template b/recipes-morello/images/morello-soc/files/initramfs.list.template similarity index 93% rename from recipes-morello/images/morello-linux-musl/files/initramfs.list.template rename to recipes-morello/images/morello-soc/files/initramfs.list.template index 3da25be..da55738 100644 --- a/recipes-morello/images/morello-linux-musl/files/initramfs.list.template +++ b/recipes-morello/images/morello-soc/files/initramfs.list.template @@ -12,7 +12,5 @@ dir /usr/lib 755 0 0 dir /usr/bin 755 0 0 dir /etc 755 0 0
-dir /%APP_DIR% 755 0 0 - file /bin/busybox .%BUSYBOX%/busybox 755 0 0 file /init .%FILES%/init.sh 755 0 0 \ No newline at end of file
Set the options to something more logical, the user can live inside a purecap busybox environment.
Signed-off-by: Pawel Zalewski pzalewski@thegoodpenguin.co.uk --- recipes-bsp/grub/files/grub-config.cfg | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/recipes-bsp/grub/files/grub-config.cfg b/recipes-bsp/grub/files/grub-config.cfg index 2273be7..b8d3b81 100644 --- a/recipes-bsp/grub/files/grub-config.cfg +++ b/recipes-bsp/grub/files/grub-config.cfg @@ -3,35 +3,33 @@ set term="vt100" set default="1" set timeout="5"
-menuentry 'BusyBox Morello Platform (Device Tree)' { +menuentry 'BusyBox Morello Platform (Device Tree) : a64 + c64 sysroot' { devicetree /morello.dtb linux /Image \ acpi=off \ - console=ttyAMA0,115200 \ debug \ earlycon=pl011,0x2A400000 \ ip=dhcp \ - - initrd /initramfs + root=PARTUUID=%UUID% \ }
-menuentry 'BusyBox Morello Platform (ACPI)' { +menuentry 'BusyBox Morello Platform (ACPI) : a64 + c64 sysroot' { linux /Image \ acpi=force \ debug \ earlycon=pl011,0x2A400000 \ ip=dhcp \ root=PARTUUID=%UUID% \ - - initrd /initramfs }
-menuentry 'BusyBox Morello Platform (ACPI) - no initramfs' { +menuentry 'BusyBox Morello Platform (Device Tree): initramfs pure c64' { + devicetree /morello.dtb linux /Image \ - acpi=force \ - console=ttyAMA0,115200 \ + acpi=off \ debug \ earlycon=pl011,0x2A400000 \ ip=dhcp \ root=PARTUUID=%UUID% \ + + initrd /initramfs } \ No newline at end of file
Reduce the machines to soc/fvp and add the testing functionality.
Signed-off-by: Pawel Zalewski pzalewski@thegoodpenguin.co.uk --- kas/morello-fvp.yml | 29 ++++++++++++++++++++++++ kas/morello-linux-glibc.yml | 8 ------- kas/morello-linux-musl.yml | 8 ------- kas/{morello-bsp.yml => morello-soc.yml} | 4 ++-- 4 files changed, 31 insertions(+), 18 deletions(-) create mode 100644 kas/morello-fvp.yml delete mode 100644 kas/morello-linux-glibc.yml delete mode 100644 kas/morello-linux-musl.yml rename kas/{morello-bsp.yml => morello-soc.yml} (55%)
diff --git a/kas/morello-fvp.yml b/kas/morello-fvp.yml new file mode 100644 index 0000000..cdcc001 --- /dev/null +++ b/kas/morello-fvp.yml @@ -0,0 +1,29 @@ +header: + version: 11 + includes: + - base.yml +machine: morello-fvp + +local_conf_header: + testimage-config: | + + LICENSE_FLAGS_ACCEPTED:append = " Arm-FVP-EULA" + + TESTIMAGE_AUTO = "1" + + TEST_TARGET_IP ?= "127.0.0.1:8022" + TEST_SERVER_IP ?= "127.0.1.1" + + PACKAGECONFIG:remove:pn-openssh = "rng-tools" + CORE_IMAGE_EXTRA_INSTALL:append = " ssh-pregen-hostkeys" + IMAGE_FEATURES:append = " ssh-server-dropbear" + + IMAGE_CLASSES:append = " testimage" + INHERIT += "fvpboot" + + TEST_TARGET = "OEFVPSerialTarget" + TEST_SUITES = "linuxboot" + + FVP_CONSOLES[default] = "terminal_uart_ap" +target: + - morello-linux-image \ No newline at end of file diff --git a/kas/morello-linux-glibc.yml b/kas/morello-linux-glibc.yml deleted file mode 100644 index 485d2f2..0000000 --- a/kas/morello-linux-glibc.yml +++ /dev/null @@ -1,8 +0,0 @@ -header: - version: 11 - includes: - - base.yml -machine: morello-linux-glibc -target: - - multiconfig:morello-firmware:board-firmware-image - - multiconfig:morello-linux-glibc:morello-linux-image \ No newline at end of file diff --git a/kas/morello-linux-musl.yml b/kas/morello-linux-musl.yml deleted file mode 100644 index d4a31b4..0000000 --- a/kas/morello-linux-musl.yml +++ /dev/null @@ -1,8 +0,0 @@ -header: - version: 11 - includes: - - base.yml -machine: morello-linux-musl -target: - - multiconfig:morello-firmware:board-firmware-image - - multiconfig:morello-linux-musl:morello-linux-image \ No newline at end of file diff --git a/kas/morello-bsp.yml b/kas/morello-soc.yml similarity index 55% rename from kas/morello-bsp.yml rename to kas/morello-soc.yml index da5a612..b46f836 100644 --- a/kas/morello-bsp.yml +++ b/kas/morello-soc.yml @@ -2,6 +2,6 @@ header: version: 11 includes: - base.yml -machine: morello-bsp +machine: morello-soc target: - - board-firmware-image \ No newline at end of file + - morello-linux-image \ No newline at end of file
Updated to reflect the recent changes.
Signed-off-by: Pawel Zalewski pzalewski@thegoodpenguin.co.uk --- README.md | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-)
diff --git a/README.md b/README.md index 28f1ea2..717c83e 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ meta-morello ==============
-Meta-morello provides the layer required to build the firmware that lives on the SD card and a Morello enabled -Linux kernel for the Morello System Development Platform. +Meta-morello provides the layer required to build the firmware that lives on the SD card and a `Morello` enabled +`Linux` kernel for the Morello System Development Platform.
--Use the provided kas scripts to get all of the dependencies. --Read on how to get and use kas here [1] +- Use the provided `kas` scripts to get all of the dependencies. +- Read on how to get and use `kas` here [1]
Booting the hardware -------------------- @@ -16,26 +16,29 @@ Machines --------
The machines have been split into: -- morello-bsp for the SD card -- morello-linux-musl for the Linux image with musl being the only libc -- morello-linux-glibc for the Linux image with an arbitrary Yocto image as the rootfs, there are two system loaders: - musl for capability aware applications, glibc for all of the rest +- morello-soc for the actual hardware +- morello-fvp for running a `FVP` image using `runfvp` script @ `meta-arm`
Building images --------------------
-kas build ./kas/morello-linux-glibc.yml +kas build ./kas/morello-soc.yml
or
-kas build ./kas/morello-linux-musl.yml +kas build ./kas/morello-fvp.yml + +FVP +--- + +For instructions on how to run the image with `FVP` go here [4]
Images ------
The outputs can be found under build/temp/deploy/images: - board-firmware-sd-image.img goes on the SD card via DD -- morello-linux-image-...img goes on the USB via DD +- morello-linux-image..img goes on the USB via DD
Linux and musl-libc ------------------- @@ -45,19 +48,18 @@ The linux kernel and musl-libc are locked in sync so that the release tags from Known limitations -----------------
-- the current state of this layer is meant to be just a starting point and foundation for further development, the main aim was to have working Linux images ASAP for the community, do not expect elegant Yocto solutions yet -- the rtl_nic driver is missing from the musl image +- the current state of this layer is meant to be just a starting point and foundation for further development, the main aim was to have working `Linux` images ASAP for the community, do not expect elegant `Yocto` solutions yet
Adding new recipes ------------------
-Follow the coding style found in other layers, the aim here is to keep them consistent where possible -and very easy to read. Follow the order found in the "headers" of each recipe and in general. +Follow the coding style found in other layers, the aim here is to keep them consistent where possible +and very easy to read. Follow the order found in the "headers" of each recipe and in general.
-.bb recipes that come from Morello gitlab and are Morello "edits"" of upstream inherit the name Morello in the recipe: package-name-morello -.bbappends do not need to do this even if they come from Morello gitlab as they would only change SRC_URI +`.bb` recipes that come from Morello gitlab and are Morello "edits"" of upstream inherit the name Morello in the recipe: package-name-morello +`.bbappends` do not need to do this even if they come from Morello gitlab as they would only change `SRC_URI`
-Whether to append or start a new recipe is up to the designer, whatever is the easiest. +Whether to append or start a new recipe at this stage is up to the designer, whatever is the easiest.
Mailing list @@ -71,3 +73,4 @@ References [1] https://kas.readthedocs.io/en/latest/ \ [2] https://developer.arm.com/documentation/den0132/0100/Setting-up-the-Morello-... \ [3] https://developer.arm.com/documentation/102278/0001/?lang=en +[4] https://github.com/jonmason/meta-arm/blob/master/documentation/runfvp.md \ No newline at end of file
linux-morello-distros@op-lists.linaro.org