diff mbox series

[meta-raspberrypi,1/4] machine: Define firmware packages from separate variables

Message ID 20220907213959.1115886-1-andrei@gherzan.com
State New
Headers show
Series [meta-raspberrypi,1/4] machine: Define firmware packages from separate variables | expand

Commit Message

Andrei Gherzan Sept. 7, 2022, 9:39 p.m. UTC
From: Andrei Gherzan <andrei.gherzan@huawei.com>

This approach allows someone to easily append firmware packages for
another target than the current set one. For now, we only define the
ones for Raspberry Pi 3 and Raspberry Pi 4 as they will be reused for
in multiconfig builds for generating images that support both of these
targets.

Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
---
 conf/machine/include/rpi-base.inc | 17 +++++++++++++++++
 conf/machine/raspberrypi3.conf    |  9 ++-------
 conf/machine/raspberrypi4.conf    | 11 +++--------
 3 files changed, 22 insertions(+), 15 deletions(-)
diff mbox series

Patch

diff --git a/conf/machine/include/rpi-base.inc b/conf/machine/include/rpi-base.inc
index a2edf06..6998460 100644
--- a/conf/machine/include/rpi-base.inc
+++ b/conf/machine/include/rpi-base.inc
@@ -150,3 +150,20 @@  do_image_wic[recrdeps] = "do_build"
 # The kernel image is installed into the FAT32 boot partition and does not need
 # to also be installed into the rootfs.
 RDEPENDS:${KERNEL_PACKAGE_NAME}-base = ""
+
+RASPBERRYPI_3_FIRMWARE_PACKAGES += "\
+    linux-firmware-rpidistro-bcm43430 \
+    linux-firmware-rpidistro-bcm43455 \
+    bluez-firmware-rpidistro-bcm43430a1-hcd \
+    bluez-firmware-rpidistro-bcm4345c0-hcd \
+"
+RASPBERRYPI_4_FIRMWARE_PACKAGES += "\
+    linux-firmware-rpidistro-bcm43455 \
+    bluez-firmware-rpidistro-bcm4345c0-hcd \
+    linux-firmware-rpidistro-bcm43456 \
+    bluez-firmware-rpidistro-bcm4345c5-hcd \
+"
+
+RASPBERRYPI_3_KERNEL ?= "kernel7.img"
+# 'l' stands for LPAE
+RASPBERRYPI_4_KERNEL ?= "kernel7l.img"
diff --git a/conf/machine/raspberrypi3.conf b/conf/machine/raspberrypi3.conf
index 1212498..46961b8 100644
--- a/conf/machine/raspberrypi3.conf
+++ b/conf/machine/raspberrypi3.conf
@@ -6,14 +6,9 @@  DEFAULTTUNE ?= "cortexa7thf-neon-vfpv4"
 require conf/machine/include/arm/armv7a/tune-cortexa7.inc
 include conf/machine/include/rpi-base.inc
 
-MACHINE_EXTRA_RRECOMMENDS += "\
-    linux-firmware-rpidistro-bcm43430 \
-    linux-firmware-rpidistro-bcm43455 \
-    bluez-firmware-rpidistro-bcm43430a1-hcd \
-    bluez-firmware-rpidistro-bcm4345c0-hcd \
-"
+MACHINE_EXTRA_RRECOMMENDS += "${RASPBERRYPI_3_FIRMWARE_PACKAGES}"
 
-SDIMG_KERNELIMAGE ?= "kernel7.img"
+SDIMG_KERNELIMAGE ?= "${RASPBERRYPI_3_KERNEL}"
 UBOOT_MACHINE = "rpi_3_32b_config"
 SERIAL_CONSOLES ?= "115200;ttyS0"
 
diff --git a/conf/machine/raspberrypi4.conf b/conf/machine/raspberrypi4.conf
index 86c57ed..56d0905 100644
--- a/conf/machine/raspberrypi4.conf
+++ b/conf/machine/raspberrypi4.conf
@@ -7,15 +7,10 @@  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"
+MACHINE_EXTRA_RRECOMMENDS += "${RASPBERRYPI_4_FIRMWARE_PACKAGES}"
+
+SDIMG_KERNELIMAGE ?= "${RASPBERRYPI_4_KERNEL}"
 UBOOT_MACHINE = "rpi_4_32b_config"
 SERIAL_CONSOLES ?= "115200;ttyS0"