From 00647f6b57324b7a928dc459ca0ddc469ec0b800 Mon Sep 17 00:00:00 2001 From: Florin Sarbu Date: Mon, 23 Oct 2023 09:24:37 +0200 Subject: [PATCH] Add Raspberry Pi 5 Signed-off-by: Florin Sarbu --- conf/machine/include/rpi-default-versions.inc | 2 +- conf/machine/raspberrypi5-64.conf | 36 +++++++++++++++++++ conf/machine/raspberrypi5.conf | 23 ++++++++++++ recipes-kernel/linux/linux-raspberrypi.inc | 2 ++ recipes-kernel/linux/linux-raspberrypi_6.1.bb | 31 ++++++++++++++++ 5 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 conf/machine/raspberrypi5-64.conf create mode 100644 conf/machine/raspberrypi5.conf create mode 100644 recipes-kernel/linux/linux-raspberrypi_6.1.bb diff --git a/conf/machine/include/rpi-default-versions.inc b/conf/machine/include/rpi-default-versions.inc index 8ff283936..da1630ace 100644 --- a/conf/machine/include/rpi-default-versions.inc +++ b/conf/machine/include/rpi-default-versions.inc @@ -1,3 +1,3 @@ # RaspberryPi BSP default versions -PREFERRED_VERSION_linux-raspberrypi ??= "5.15.%" +PREFERRED_VERSION_linux-raspberrypi ??= "6.1.%" diff --git a/conf/machine/raspberrypi5-64.conf b/conf/machine/raspberrypi5-64.conf new file mode 100644 index 000000000..5b30248c8 --- /dev/null +++ b/conf/machine/raspberrypi5-64.conf @@ -0,0 +1,36 @@ +#@TYPE: Machine +#@NAME: RaspberryPi 5 Development Board (64bit) +#@DESCRIPTION: Machine configuration for the RaspberryPi 5 in 64 bits mode + +MACHINEOVERRIDES =. "raspberrypi5:" + +MACHINE_FEATURES += "pci" +MACHINE_EXTRA_RRECOMMENDS += "\ + linux-firmware-rpidistro-bcm43455 \ + bluez-firmware-rpidistro-bcm4345c0-hcd \ + linux-firmware-rpidistro-bcm43456 \ + bluez-firmware-rpidistro-bcm4345c5-hcd \ +" + +require conf/machine/include/arm/armv8-2a/tune-cortexa76.inc +include conf/machine/include/rpi-base.inc + +RPI_KERNEL_DEVICETREE = " \ + broadcom/bcm2712-rpi-5-b.dtb \ +" + +SDIMG_KERNELIMAGE ?= "kernel8.img" +SERIAL_CONSOLES ?= "115200;ttyS0" + +UBOOT_MACHINE = "rpi_arm64_config" + +VC4DTBO ?= "vc4-kms-v3d" + +# When u-boot is enabled we need to use the "Image" format and the "booti" +# command to load the kernel +KERNEL_IMAGETYPE_UBOOT ?= "Image" +# "zImage" not supported on arm64 and ".gz" images not supported by bootloader yet +KERNEL_IMAGETYPE_DIRECT ?= "Image" +KERNEL_BOOTCMD ?= "booti" + +ARMSTUB ?= "armstub8-gic.bin" diff --git a/conf/machine/raspberrypi5.conf b/conf/machine/raspberrypi5.conf new file mode 100644 index 000000000..8c4ed070c --- /dev/null +++ b/conf/machine/raspberrypi5.conf @@ -0,0 +1,23 @@ +#@TYPE: Machine +#@NAME: RaspberryPi 5 Development Board (32bit) +#@DESCRIPTION: Machine configuration for the RaspberryPi 5 in 32 bit mode + +DEFAULTTUNE ?= "cortexa7thf-neon-vfpv4" +require conf/machine/include/arm/armv7a/tune-cortexa7.inc +include conf/machine/include/rpi-base.inc + +MACHINE_FEATURES += "pci" +MACHINE_EXTRA_RRECOMMENDS += "\ + linux-firmware-rpidistro-bcm43455 \ + bluez-firmware-rpidistro-bcm4345c0-hcd \ + linux-firmware-rpidistro-bcm43456 \ + bluez-firmware-rpidistro-bcm4345c5-hcd \ +" + +# 'l' stands for LPAE +SDIMG_KERNELIMAGE ?= "kernel7l.img" +UBOOT_MACHINE = "rpi_4_32b_config" +SERIAL_CONSOLES ?= "115200;ttyS0" + +VC4DTBO ?= "vc4-kms-v3d" +ARMSTUB ?= "armstub7.bin" diff --git a/recipes-kernel/linux/linux-raspberrypi.inc b/recipes-kernel/linux/linux-raspberrypi.inc index 6362a73d7..924ea17c6 100644 --- a/recipes-kernel/linux/linux-raspberrypi.inc +++ b/recipes-kernel/linux/linux-raspberrypi.inc @@ -26,6 +26,8 @@ KBUILD_DEFCONFIG:raspberrypi3 ?= "bcm2709_defconfig" KBUILD_DEFCONFIG:raspberrypi3-64 ?= "bcmrpi3_defconfig" KBUILD_DEFCONFIG:raspberrypi4 ?= "bcm2711_defconfig" KBUILD_DEFCONFIG:raspberrypi4-64 ?= "bcm2711_defconfig" +KBUILD_DEFCONFIG:raspberrypi5 ?= "bcm2711_defconfig" +KBUILD_DEFCONFIG:raspberrypi5-64 ?= "bcm2711_defconfig" LINUX_VERSION_EXTENSION ?= "" diff --git a/recipes-kernel/linux/linux-raspberrypi_6.1.bb b/recipes-kernel/linux/linux-raspberrypi_6.1.bb new file mode 100644 index 000000000..b81e169b6 --- /dev/null +++ b/recipes-kernel/linux/linux-raspberrypi_6.1.bb @@ -0,0 +1,31 @@ +LINUX_VERSION ?= "6.1.54" +LINUX_RPI_BRANCH ?= "rpi-6.1.y" +LINUX_RPI_KMETA_BRANCH ?= "yocto-6.1" + +SRCREV_machine = "df4d584e66a660195422ca2b7ce1d68d1181f2a2" +SRCREV_meta = "e7488dd3776c76fb7d94cc92ae7a2216423f8ece" + +KMETA = "kernel-meta" + +SRC_URI = " \ + git://github.com/raspberrypi/linux.git;name=machine;branch=${LINUX_RPI_BRANCH};protocol=https \ + git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=${LINUX_RPI_KMETA_BRANCH};destsuffix=${KMETA} \ + file://powersave.cfg \ + file://android-drivers.cfg \ + " + +require linux-raspberrypi.inc + +KERNEL_DTC_FLAGS += "-@ -H epapr" + +RDEPENDS:${KERNEL_PACKAGE_NAME}:raspberrypi-armv7:append = " ${RASPBERRYPI_v7_KERNEL_PACKAGE_NAME}" +RDEPENDS:${KERNEL_PACKAGE_NAME}-base:raspberrypi-armv7:append = " ${RASPBERRYPI_v7_KERNEL_PACKAGE_NAME}-base" +RDEPENDS:${KERNEL_PACKAGE_NAME}-image:raspberrypi-armv7:append = " ${RASPBERRYPI_v7_KERNEL_PACKAGE_NAME}-image" +RDEPENDS:${KERNEL_PACKAGE_NAME}-dev:raspberrypi-armv7:append = " ${RASPBERRYPI_v7_KERNEL_PACKAGE_NAME}-dev" +RDEPENDS:${KERNEL_PACKAGE_NAME}-vmlinux:raspberrypi-armv7:append = " ${RASPBERRYPI_v7_KERNEL_PACKAGE_NAME}-vmlinux" +RDEPENDS:${KERNEL_PACKAGE_NAME}-modules:raspberrypi-armv7:append = " ${RASPBERRYPI_v7_KERNEL_PACKAGE_NAME}-modules" +RDEPENDS:${KERNEL_PACKAGE_NAME}-dbg:raspberrypi-armv7:append = " ${RASPBERRYPI_v7_KERNEL_PACKAGE_NAME}-dbg" + +DEPLOYDEP = "" +DEPLOYDEP:raspberrypi-armv7 = "${RASPBERRYPI_v7_KERNEL}:do_deploy" +do_deploy[depends] += "${DEPLOYDEP}"