Re: [poky] [PATCH v4] Add genericarm64 MACHINE

Mark Hatle <[email protected]>
Newsgroups org.yoctoproject.lists.poky
Message-ID <[email protected]>
On 2/29/24 10:24 AM, Ross Burton wrote:
> From: Ross Burton <[email protected]>
> 
> This is a new 64-bit "generic" Arm machine, that expects the hardware to
> be SystemReady compatible.
> 
> Signed-off-by: Ross Burton <[email protected]>
> ---
>   .../conf/templates/default/local.conf.sample  |  1 +
>   meta-yocto-bsp/README.hardware.md             | 18 ++++++++++-
>   meta-yocto-bsp/conf/machine/genericarm64.conf | 31 +++++++++++++++++++
>   .../linux/linux-yocto_6.6.bbappend            |  5 +++
>   meta-yocto-bsp/wic/genericarm64.wks.in        | 11 +++++++
>   5 files changed, 65 insertions(+), 1 deletion(-)
>   create mode 100644 meta-yocto-bsp/conf/machine/genericarm64.conf
>   create mode 100644 meta-yocto-bsp/wic/genericarm64.wks.in

...

> +SystemReady Arm Platforms
> +=========================
> +
> +The genericarm64 MACHINE is designed to work on standard SystemReady IR/SR
> +compliant boards with preinstalled firmware.
> +
> +The genericarm64 MACHINE is currently tested on the following platforms:
> +
> +  * Texas Instruments BeaglePlay (IR)
> +
> +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..33ffa3fc019
> --- /dev/null
> +++ b/meta-yocto-bsp/conf/machine/genericarm64.conf
> @@ -0,0 +1,31 @@
> +#@TYPE: Machine
> +#@NAME: genericarm64
> +#@DESCRIPTION: Generic Arm64 machine for typical SystemReady IR/ES 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"

SystemReady IR supports u-boot booting, as far as I'm aware, but this looks like 
it now requires (vs allows) EFI.  Is this the case, or am I reading it wrong?

> +
> +KERNEL_IMAGETYPE = "Image"
> +PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
> +
> +# Install all the kernel modules into the rootfs
> +MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
> +# Install selected pieces of firmware
> +MACHINE_EXTRA_RRECOMMENDS += "linux-firmware-wl12xx linux-firmware-wl18xx linux-firmware-wlcommon linux-firmware-rtl-nic"
> +
> +# Use an initramfs and populate it with the kernel modules and key firmware
> +INITRAMFS_IMAGE ?= "core-image-initramfs-boot"
> +PACKAGE_INSTALL:append:pn-core-image-initramfs-boot = " kernel-modules linux-firmware-rtl-nic"

Is initramfs loading required?  Or is this for a specific

> +
> +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/wic/genericarm64.wks.in b/meta-yocto-bsp/wic/genericarm64.wks.in
> new file mode 100644
> index 00000000000..f76e5444be4
> --- /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

This makes me thing that the initrd IS required as is EFI.

> +
> +part swap --size 32 --label swap --fstype=swap --use-uuid
> +
> +part / --source rootfs --fstype=ext4 --label root --align 1024 --use-uuid
> +
> +bootloader --ptable gpt --timeout=5 --append="rootwait rootfstype=ext4"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.