From patchwork Mon Feb 26 19:42:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 40093 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25C05C48BF6 for ; Mon, 26 Feb 2024 19:42:16 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.2527.1708976526228926151 for ; Mon, 26 Feb 2024 11:42:06 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 65807DA7 for ; Mon, 26 Feb 2024 11:42:44 -0800 (PST) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 813843F762 for ; Mon, 26 Feb 2024 11:42:05 -0800 (PST) From: ross.burton@arm.com To: poky@lists.yoctoproject.org Subject: [RFC PATCH v2] Add genericarm64 MACHINE Date: Mon, 26 Feb 2024 19:42:01 +0000 Message-Id: <20240226194201.3777979-1-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 26 Feb 2024 19:42:16 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/poky/message/13277 From: Ross Burton Hi, I've now sent a first draft of a fragmented genericarm64 configuration to linux-yocto@[1] and this now uses it. I've boot tested it on a BeaglePlay: there's still plenty to be improved but it's a start. This can't be merged as-is as the SRCREV for the genericarm64 machine is wrong, which is why this is a RFC. When Bruce merges, I can update. Ross [1] https://lists.yoctoproject.org/g/linux-yocto/topic/kernel_cache_patch_3_3_add/104580425?p=,,,20,0,0,0::recentpostdate/sticky,,,20,2,0,104580425,previd%3D1708959762339753193,nextid%3D1708417860529990929&previd=1708959762339753193&nextid=1708417860529990929 --- .../conf/templates/default/local.conf.sample | 1 + meta-yocto-bsp/README.hardware.md | 18 ++++++++++++- meta-yocto-bsp/conf/machine/genericarm64.conf | 26 +++++++++++++++++++ .../linux/linux-yocto_6.6.bbappend | 5 ++++ meta-yocto-bsp/wic/genericarm64.wks.in | 11 ++++++++ 5 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 meta-yocto-bsp/conf/machine/genericarm64.conf create mode 100644 meta-yocto-bsp/wic/genericarm64.wks.in diff --git a/meta-poky/conf/templates/default/local.conf.sample b/meta-poky/conf/templates/default/local.conf.sample index 5fb6944f3f0..1a93c9bdcf3 100644 --- a/meta-poky/conf/templates/default/local.conf.sample +++ b/meta-poky/conf/templates/default/local.conf.sample @@ -31,6 +31,7 @@ # demonstration purposes: # #MACHINE ?= "beaglebone-yocto" +#MACHINE ?= "genericarm64" #MACHINE ?= "genericx86" #MACHINE ?= "genericx86-64" # diff --git a/meta-yocto-bsp/README.hardware.md b/meta-yocto-bsp/README.hardware.md index a8f38cb21a6..bb8f57913fd 100644 --- a/meta-yocto-bsp/README.hardware.md +++ b/meta-yocto-bsp/README.hardware.md @@ -28,6 +28,7 @@ Hardware Reference Boards The following boards are supported by the meta-yocto-bsp layer: * Texas Instruments Beaglebone (beaglebone-yocto) + * General 64-bit Arm SystemReady platforms (genericarm64) * General IA platforms (genericx86 and genericx86-64) For more information see the board's section below. The appropriate MACHINE @@ -55,7 +56,8 @@ Consumer Devices The following consumer devices are supported by the meta-yocto-bsp layer: - * Intel x86 based PCs and devices (genericx86) + * Arm-based SystemReady devices (genericarm64) + * Intel x86 based PCs and devices (genericx86 and genericx86-64) For more information see the device's section below. The appropriate MACHINE variable value corresponding to the device is given in brackets. @@ -126,6 +128,20 @@ USB Device: dd command to write the image to a USB stick. +SystemReady Arm Platforms +========================= + +The genericarm64 MACHINE is designed to work on standard SystemReady IR +compliant boards with preinstalled firmware. + +The genericarm64 MACHINE is currently tested on the following platforms: + + * Texas Instruments BeaglePlay + +The images built are EFI bootable disk images and can be written directly to a +SD card for booting, for example. + + Texas Instruments Beaglebone (beaglebone-yocto) =============================================== diff --git a/meta-yocto-bsp/conf/machine/genericarm64.conf b/meta-yocto-bsp/conf/machine/genericarm64.conf new file mode 100644 index 00000000000..2ea270d8b06 --- /dev/null +++ b/meta-yocto-bsp/conf/machine/genericarm64.conf @@ -0,0 +1,26 @@ +#@TYPE: Machine +#@NAME: genericarm64 +#@DESCRIPTION: Generic Arm64 machine for typical SystemReady platforms, which +#have working firmware and boot via EFI. + +require conf/machine/include/arm/arch-armv8a.inc + +# Arm Base System Architecture says v8.0+ is allowed, but FEAT_CRC32 is required +DEFAULTTUNE = "armv8a-crc" + +MACHINE_FEATURES = "acpi alsa bluetooth efi keyboard pci qemu-usermode rtc screen usbhost vfat wifi" + +# Install all the kernel modules and all the firmware +MACHINE_EXTRA_RRECOMMENDS += "kernel-modules linux-firmware" + +KERNEL_IMAGETYPE = "Image" +PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto" +INITRAMFS_IMAGE ?= "core-image-initramfs-boot" + +IMAGE_FSTYPES ?= "wic" +WKS_FILE ?= "genericarm64.wks.in" + +EFI_PROVIDER ?= "${@bb.utils.contains("DISTRO_FEATURES", "systemd", "systemd-boot", "grub-efi", d)}" + +# Try to bring up one physical serial console, or a virtualized serial console +SERIAL_CONSOLES ?= "115200;ttyAMA0 115200;hvc0" diff --git a/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_6.6.bbappend b/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_6.6.bbappend index 8e465c241e8..d4619ebfb76 100644 --- a/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_6.6.bbappend +++ b/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_6.6.bbappend @@ -1,19 +1,24 @@ +KBRANCH:genericarm64 = "v6.6/standard/base" KBRANCH:genericx86 = "v6.6/standard/base" KBRANCH:genericx86-64 = "v6.6/standard/base" KBRANCH:beaglebone-yocto = "v6.6/standard/beaglebone" +KMACHINE:genericarm64 ?= "genericarm64" KMACHINE:genericx86 ?= "common-pc" KMACHINE:genericx86-64 ?= "common-pc-64" KMACHINE:beaglebone-yocto ?= "beaglebone" +SRCREV_machine:genericarm64 ?= "332d4668fcc32826907d4f3c4938845206006089" SRCREV_machine:genericx86 ?= "332d4668fcc32826907d4f3c4938845206006089" SRCREV_machine:genericx86-64 ?= "332d4668fcc32826907d4f3c4938845206006089" SRCREV_machine:beaglebone-yocto ?= "332d4668fcc32826907d4f3c4938845206006089" +COMPATIBLE_MACHINE:genericarm64 = "genericarm64" COMPATIBLE_MACHINE:genericx86 = "genericx86" COMPATIBLE_MACHINE:genericx86-64 = "genericx86-64" COMPATIBLE_MACHINE:beaglebone-yocto = "beaglebone-yocto" +LINUX_VERSION:genericarm64 = "6.6.15" LINUX_VERSION:genericx86 = "6.6.15" LINUX_VERSION:genericx86-64 = "6.6.15" LINUX_VERSION:beaglebone-yocto = "6.6.15" diff --git a/meta-yocto-bsp/wic/genericarm64.wks.in b/meta-yocto-bsp/wic/genericarm64.wks.in new file mode 100644 index 00000000000..417d4d88104 --- /dev/null +++ b/meta-yocto-bsp/wic/genericarm64.wks.in @@ -0,0 +1,11 @@ +# short-description: Create an EFI disk image +# long-description: Creates a partitioned EFI disk image that the user +# can directly dd to boot media. + +part /boot --source bootimg-efi --sourceparams="loader=${EFI_PROVIDER},initrd=${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES}" --label boot --active --align 1024 --use-uuid + +part / --source rootfs --fstype=ext4 --label root --align 1024 --use-uuid + +part swap --size 44 --label swap --fstype=swap --use-uuid + +bootloader --ptable gpt --timeout=5 --append="rootwait rootfstype=ext4"