From c246cbe6f739ff56575b423c7fad50a12418b51b Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Wed, 10 Jul 2024 18:30:40 +0200 Subject: [PATCH 1/7] linux-raspberrypi: default to v6.1 Changelog-entry: default to Linux kernel v6.1 Signed-off-by: Alex Gonzalez --- .../meta-balena-raspberrypi/conf/layer.conf | 2 +- ...1-Add-tpm-slb9670-tis-spi-DT-overlay.patch | 12 +++----- ...06-overlays-Add-Hyperpixel4-overlays.patch | 28 ++++++++----------- ...append => linux-raspberrypi_6.1%.bbappend} | 7 ----- 4 files changed, 17 insertions(+), 32 deletions(-) rename layers/meta-balena-raspberrypi/recipes-kernel/linux/{linux-raspberrypi_5.15.bbappend => linux-raspberrypi_6.1%.bbappend} (95%) diff --git a/layers/meta-balena-raspberrypi/conf/layer.conf b/layers/meta-balena-raspberrypi/conf/layer.conf index 0722793a6..1f6d23743 100644 --- a/layers/meta-balena-raspberrypi/conf/layer.conf +++ b/layers/meta-balena-raspberrypi/conf/layer.conf @@ -137,7 +137,7 @@ RPI_KERNEL_DEVICETREE:append:revpi-connect-s = " broadcom/bcm2711-rpi-cm4s.dtb" RPI_KERNEL_DEVICETREE:remove:revpi-connect = "bcm2711-rpi-cm4s.dtb" RPI_KERNEL_DEVICETREE:remove:revpi-core-3 = "bcm2711-rpi-cm4s.dtb" -PREFERRED_VERSION:linux-raspberrypi = "5.10.%" +PREFERRED_VERSION_linux-raspberrypi = "6.1%" FIRMWARE_COMPRESSION:raspberrypi4-64 ?= "1" FIRMWARE_COMPRESSION:raspberrypi0-2w-64 ?= "1" diff --git a/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-Add-tpm-slb9670-tis-spi-DT-overlay.patch b/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-Add-tpm-slb9670-tis-spi-DT-overlay.patch index 3e104ae84..936ad92ce 100644 --- a/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-Add-tpm-slb9670-tis-spi-DT-overlay.patch +++ b/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-Add-tpm-slb9670-tis-spi-DT-overlay.patch @@ -1,4 +1,3 @@ -From d211b4e01d2621ce03854f722f8db5acfe457ae0 Mon Sep 17 00:00:00 2001 From: Michal Toman Date: Mon, 1 Feb 2021 16:05:38 +0100 Subject: [PATCH] Add tpm-slb9670-tis-spi DT overlay @@ -11,17 +10,17 @@ Signed-off-by: Michal Toman create mode 100644 arch/arm/boot/dts/overlays/tpm-slb9670-tis-spi-overlay.dts diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile -index d8a3677b583e..696b5789e64c 100644 +index 9203448db803..f6d410d31f8c 100644 --- a/arch/arm/boot/dts/overlays/Makefile +++ b/arch/arm/boot/dts/overlays/Makefile -@@ -194,6 +194,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ +@@ -276,6 +276,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ tc358743-audio.dtbo \ tinylcd35.dtbo \ tpm-slb9670.dtbo \ + tpm-slb9670-tis-spi.dtbo \ + tpm-slb9673.dtbo \ uart0.dtbo \ - uart1.dtbo \ - uart2.dtbo \ + uart0-pi5.dtbo \ diff --git a/arch/arm/boot/dts/overlays/tpm-slb9670-tis-spi-overlay.dts b/arch/arm/boot/dts/overlays/tpm-slb9670-tis-spi-overlay.dts new file mode 100644 index 000000000000..e43f8cd248ec @@ -49,6 +48,3 @@ index 000000000000..e43f8cd248ec + }; + }; +}; --- -2.26.2 - diff --git a/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0006-overlays-Add-Hyperpixel4-overlays.patch b/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0006-overlays-Add-Hyperpixel4-overlays.patch index 9a8de59f7..6c05171ba 100644 --- a/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0006-overlays-Add-Hyperpixel4-overlays.patch +++ b/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0006-overlays-Add-Hyperpixel4-overlays.patch @@ -1,4 +1,3 @@ -From ee5c0bab10e280cf54d3d2c06c6a4cc6b6ed627b Mon Sep 17 00:00:00 2001 From: Florin Sarbu Date: Thu, 17 Oct 2019 11:16:39 +0200 Subject: [PATCH] overlays: Add Hyperpixel4 overlays @@ -13,11 +12,11 @@ They each are taken from: Upstream-status: Inappropriate [not author] Signed-off-by: Florin Sarbu --- - arch/arm/boot/dts/overlays/Makefile | 4 + - .../boot/dts/overlays/hyperpixel4-pi3-overlay.dts | 98 ++++++++++++++++++++ - .../boot/dts/overlays/hyperpixel4-pi4-overlay.dts | 98 ++++++++++++++++++++ - .../overlays/hyperpixel4-square-pi3-overlay.dts | 103 +++++++++++++++++++++ - .../overlays/hyperpixel4-square-pi4-overlay.dts | 103 +++++++++++++++++++++ + arch/arm/boot/dts/overlays/Makefile | 4 + + .../dts/overlays/hyperpixel4-pi3-overlay.dts | 98 +++++++++++++++++ + .../dts/overlays/hyperpixel4-pi4-overlay.dts | 98 +++++++++++++++++ + .../hyperpixel4-square-pi3-overlay.dts | 103 ++++++++++++++++++ + .../hyperpixel4-square-pi4-overlay.dts | 103 ++++++++++++++++++ 5 files changed, 406 insertions(+) create mode 100644 arch/arm/boot/dts/overlays/hyperpixel4-pi3-overlay.dts create mode 100644 arch/arm/boot/dts/overlays/hyperpixel4-pi4-overlay.dts @@ -25,10 +24,10 @@ Signed-off-by: Florin Sarbu create mode 100644 arch/arm/boot/dts/overlays/hyperpixel4-square-pi4-overlay.dts diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile -index 87082d6..554756c 100644 +index dd34b091565d..9203448db803 100644 --- a/arch/arm/boot/dts/overlays/Makefile +++ b/arch/arm/boot/dts/overlays/Makefile -@@ -59,6 +59,10 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ +@@ -99,6 +99,10 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ hy28a.dtbo \ hy28b.dtbo \ hy28b-2017.dtbo \ @@ -38,10 +37,10 @@ index 87082d6..554756c 100644 + hyperpixel4-square-pi4.dtbo \ i-sabre-q2m.dtbo \ i2c-bcm2708.dtbo \ - i2c-gpio.dtbo \ + i2c-fan.dtbo \ diff --git a/arch/arm/boot/dts/overlays/hyperpixel4-pi3-overlay.dts b/arch/arm/boot/dts/overlays/hyperpixel4-pi3-overlay.dts new file mode 100644 -index 0000000..78bf59e +index 000000000000..78bf59ebcf19 --- /dev/null +++ b/arch/arm/boot/dts/overlays/hyperpixel4-pi3-overlay.dts @@ -0,0 +1,98 @@ @@ -145,7 +144,7 @@ index 0000000..78bf59e +}; diff --git a/arch/arm/boot/dts/overlays/hyperpixel4-pi4-overlay.dts b/arch/arm/boot/dts/overlays/hyperpixel4-pi4-overlay.dts new file mode 100644 -index 0000000..3757a99 +index 000000000000..3757a996aabd --- /dev/null +++ b/arch/arm/boot/dts/overlays/hyperpixel4-pi4-overlay.dts @@ -0,0 +1,98 @@ @@ -249,7 +248,7 @@ index 0000000..3757a99 +}; diff --git a/arch/arm/boot/dts/overlays/hyperpixel4-square-pi3-overlay.dts b/arch/arm/boot/dts/overlays/hyperpixel4-square-pi3-overlay.dts new file mode 100644 -index 0000000..f544a6c +index 000000000000..f544a6c7592f --- /dev/null +++ b/arch/arm/boot/dts/overlays/hyperpixel4-square-pi3-overlay.dts @@ -0,0 +1,103 @@ @@ -358,7 +357,7 @@ index 0000000..f544a6c + diff --git a/arch/arm/boot/dts/overlays/hyperpixel4-square-pi4-overlay.dts b/arch/arm/boot/dts/overlays/hyperpixel4-square-pi4-overlay.dts new file mode 100644 -index 0000000..f544a6c +index 000000000000..f544a6c7592f --- /dev/null +++ b/arch/arm/boot/dts/overlays/hyperpixel4-square-pi4-overlay.dts @@ -0,0 +1,103 @@ @@ -465,6 +464,3 @@ index 0000000..f544a6c + }; +}; + --- -2.7.4 - diff --git a/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.15.bbappend b/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_6.1%.bbappend similarity index 95% rename from layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.15.bbappend rename to layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_6.1%.bbappend index d4be7beed..4c6e05cb2 100644 --- a/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.15.bbappend +++ b/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_6.1%.bbappend @@ -1,12 +1,5 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:${THISDIR}/${MACHINE}:" -SRC_URI:append:fincm3 = " \ - file://0001-overlays-fin-add-internal-pull-ups-to-i2c_soft.patch \ - file://0004-mmc-pwrseq-Repurpose-for-Marvell-SD8777.patch \ - file://0005-balena-fin-wifi-sta-uap-mode.patch \ - file://0007-overlays-Add-spyfly.dts.patch \ -" - SRC_URI:append:raspberrypi4-superhub = " \ file://0001-Add-gpio-wdt-DT-overlay-for-Phoenix-Board.patch \ file://0002-Add-infineon-tpm-DT-overlay-for-Phoenix-Board.patch \ From 8238420f0ccd4a61fec42eb9653941352f15a0f6 Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Wed, 10 Jul 2024 20:07:21 +0200 Subject: [PATCH 2/7] linux-raspberrypi: remove configuration checks warning for 6.1 FB_TFT_WATTEROTT has been removed since v5.17 in afa9755e359dcabc Changelog-entry: remove linux kernel configuration checks warnings for 6.1 Signed-off-by: Alex Gonzalez --- .../recipes-kernel/linux/linux-raspberrypi_6.1%.bbappend | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_6.1%.bbappend b/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_6.1%.bbappend index 4c6e05cb2..d6c0f0af8 100644 --- a/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_6.1%.bbappend +++ b/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_6.1%.bbappend @@ -61,9 +61,12 @@ BALENA_CONFIGS[fbtft] = " \ CONFIG_FB_TFT_TLS8204=m \ CONFIG_FB_TFT_UC1701=m \ CONFIG_FB_TFT_UPD161704=m \ - CONFIG_FB_TFT_WATTEROTT=m \ " + +BALENA_CONFIGS:append = " ${@configure_from_version("5.17", "", " fb_tft_watterott", d)}" +BALENA_CONFIGS[fb_tft_watterott] = "CONFIG_FB_TFT_WATTEROTT=m" + BALENA_CONFIGS:append = " pca955_gpio_expander" BALENA_CONFIGS[pca955_gpio_expander] = " \ CONFIG_GPIO_PCA953X=y \ From 8c28477be9741026dbe3651760ca5a3c38dbda81 Mon Sep 17 00:00:00 2001 From: Florin Sarbu Date: Thu, 5 Dec 2024 11:53:57 +0000 Subject: [PATCH 3/7] linux-raspberrypi: Add back linux-raspberrypi_5.15.bbappend The Unipi Raspberry Pi boards we support need the unipi-kernel-modules recipe to compile against the kernel but these modules do not compile against kernel version 6 so until we hear back from the vendor we keep the 2 boards on the 5.15 kernel. Also we do not apply 0006-overlays-Add-Hyperpixel4-overlays.patch and 0001-Add-tpm-slb9670-tis-spi-DT-overlay.patch for the 5.15 anymore since the requests for them were not for the Unipi boards. Changelog-entry: Pin the Unipi boards to kernel 5.15 because of older unipi-kernel-modules Signed-off-by: Florin Sarbu --- .../machine/raspberrypi3-unipi-neuron.conf | 2 + .../machine/raspberrypi4-unipi-neuron.conf | 2 + .../linux/linux-raspberrypi_5.15.bbappend | 215 ++++++++++++++++++ 3 files changed, 219 insertions(+) create mode 100644 layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.15.bbappend diff --git a/layers/meta-balena-raspberrypi/conf/machine/raspberrypi3-unipi-neuron.conf b/layers/meta-balena-raspberrypi/conf/machine/raspberrypi3-unipi-neuron.conf index 3cc9be195..5a06ac6aa 100644 --- a/layers/meta-balena-raspberrypi/conf/machine/raspberrypi3-unipi-neuron.conf +++ b/layers/meta-balena-raspberrypi/conf/machine/raspberrypi3-unipi-neuron.conf @@ -6,3 +6,5 @@ MACHINEOVERRIDES = "raspberrypi3:${MACHINE}" include conf/machine/raspberrypi3.conf IMAGE_INSTALL:append = " unipi-kernel-modules unipi-tools" + +PREFERRED_VERSION_linux-raspberrypi = "5.15.%" diff --git a/layers/meta-balena-raspberrypi/conf/machine/raspberrypi4-unipi-neuron.conf b/layers/meta-balena-raspberrypi/conf/machine/raspberrypi4-unipi-neuron.conf index a91c05121..c64f35d2d 100644 --- a/layers/meta-balena-raspberrypi/conf/machine/raspberrypi4-unipi-neuron.conf +++ b/layers/meta-balena-raspberrypi/conf/machine/raspberrypi4-unipi-neuron.conf @@ -10,3 +10,5 @@ include conf/machine/raspberrypi4-64.conf MACHINEOVERRIDES := "${@'${MACHINEOVERRIDES}'.replace(':${MACHINE}',':raspberrypi4-64:${MACHINE}')}" IMAGE_INSTALL:append = " unipi-kernel-modules unipi-tools" + +PREFERRED_VERSION_linux-raspberrypi = "5.15.%" diff --git a/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.15.bbappend b/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.15.bbappend new file mode 100644 index 000000000..f41e4a98d --- /dev/null +++ b/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.15.bbappend @@ -0,0 +1,215 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:${THISDIR}/${MACHINE}:" + +SRC_URI:append:fincm3 = " \ + file://0001-overlays-fin-add-internal-pull-ups-to-i2c_soft.patch \ + file://0004-mmc-pwrseq-Repurpose-for-Marvell-SD8777.patch \ + file://0005-balena-fin-wifi-sta-uap-mode.patch \ + file://0007-overlays-Add-spyfly.dts.patch \ +" + +SRC_URI:append:raspberrypi4-superhub = " \ + file://0001-Add-gpio-wdt-DT-overlay-for-Phoenix-Board.patch \ + file://0002-Add-infineon-tpm-DT-overlay-for-Phoenix-Board.patch \ + file://0003-Add-spi1-DT-overlay-for-Phoenix-Board.patch \ + file://0004-Add-SD-host-DT-overlay-for-Phoenix-Board.patch \ +" + +SRC_URI:append = " \ + file://0002-wireless-wext-Bring-back-ndo_do_ioctl-fallback.patch \ + file://0001-Add-npe-x500-m3-overlay.patch \ + file://0010-dts-overlays-Add-UniPi-overlays.patch \ + file://0001-seeed-studio-can-bus-v2-Add-dtbo-for-this-can-bus.patch \ + file://0011-USB-serial-Add-support-for-more-Quectel-modules.patch \ + file://0001-waveshare-sim7600-Add-dtbo-for-this-modem.patch \ + file://0001-overlays-Add-overlay-for-Seeed-reComputer-R1000.patch \ +" + +SRC_URI:append:rt-rpi-300 = " \ + file://rt-rpi-300-Add-changes-for-this-dt.patch \ + file://rt-rpi-Add-ch-432t-driver-for-this-chip.patch \ +" + +# BalenaOS already disables gcc plugins, +# however the unipi-neuron adds an extra module +# which seems to override the default configuration +SRC_URI:append:raspberrypi3-unipi-neuron = " \ + file://0001-pi3neuron-disable-gccplugins.patch \ +" + +BALENA_CONFIGS:append = " fbtft" +BALENA_CONFIGS[fbtft] = " \ + CONFIG_STAGING=y \ + CONFIG_FB_TFT=m \ + CONFIG_FB_TFT_AGM1264K_FL=m \ + CONFIG_FB_TFT_BD663474=m \ + CONFIG_FB_TFT_HX8340BN=m \ + CONFIG_FB_TFT_HX8347D=m \ + CONFIG_FB_TFT_HX8353D=m \ + CONFIG_FB_TFT_ILI9163=m \ + CONFIG_FB_TFT_ILI9320=m \ + CONFIG_FB_TFT_ILI9325=m \ + CONFIG_FB_TFT_ILI9340=m \ + CONFIG_FB_TFT_ILI9341=m \ + CONFIG_FB_TFT_ILI9481=m \ + CONFIG_FB_TFT_ILI9486=m \ + CONFIG_FB_TFT_PCD8544=m \ + CONFIG_FB_TFT_RA8875=m \ + CONFIG_FB_TFT_S6D02A1=m \ + CONFIG_FB_TFT_S6D1121=m \ + CONFIG_FB_TFT_SSD1289=m \ + CONFIG_FB_TFT_SSD1306=m \ + CONFIG_FB_TFT_SSD1331=m \ + CONFIG_FB_TFT_SSD1351=m \ + CONFIG_FB_TFT_ST7735R=m \ + CONFIG_FB_TFT_TINYLCD=m \ + CONFIG_FB_TFT_TLS8204=m \ + CONFIG_FB_TFT_UC1701=m \ + CONFIG_FB_TFT_UPD161704=m \ + CONFIG_FB_TFT_WATTEROTT=m \ + " + +BALENA_CONFIGS:append = " pca955_gpio_expander" +BALENA_CONFIGS[pca955_gpio_expander] = " \ + CONFIG_GPIO_PCA953X=y \ + CONFIG_GPIO_PCA953X_IRQ=y \ + " + +KERNEL_MODULE_PROBECONF += "rtl8192cu" +module_conf_rtl8192cu = "blacklist rtl8192cu" + +# requested by customer (support for Kontron PLD devices) +BALENA_CONFIGS:append = " gpio_i2c_kempld" +BALENA_CONFIGS_DEPS[gpio_i2c_kempld] = " \ + CONFIG_GPIOLIB=y \ + CONFIG_I2C=y \ + CONFIG_HAS_IOMEM=y \ + CONFIG_MFD_KEMPLD=m \ +" +BALENA_CONFIGS[gpio_i2c_kempld] = " \ + CONFIG_GPIO_KEMPLD=m \ + CONFIG_I2C_KEMPLD=m \ +" + +# make sure watchdog gets enabled no matter of the BSP changes +BALENA_CONFIGS:append = " rpi_watchdog" +BALENA_CONFIGS_DEPS[rpi_watchdog] = " \ + CONFIG_WATCHDOG=y \ +" +BALENA_CONFIGS[rpi_watchdog] = " \ + CONFIG_BCM2835_WDT=y \ +" + +BALENA_CONFIGS:append = " kvaser_usb_can_driver" + +BALENA_CONFIGS[kvaser_usb_can_driver] = " \ + CONFIG_CAN_KVASER_USB=m \ +" + +BALENA_CONFIGS:append = " mcp251x_can_driver" + +BALENA_CONFIGS[mcp251x_can_driver] = " \ + CONFIG_CAN_MCP251X=m \ +" + +BALENA_CONFIGS_DEPS[mcp251x_can_driver] = " \ + CONFIG_SPI=y \ + CONFIG_HAS_DMA=y \ +" + +BALENA_CONFIGS:append = " can_calc_bittiming" + +BALENA_CONFIGS[can_calc_bittiming] = " \ + CONFIG_CAN_CALC_BITTIMING=y \ +" + +BALENA_CONFIGS_DEPS[can_calc_bittiming] = " \ + CONFIG_CAN_DEV=y \ +" + +BALENA_CONFIGS:append = " ds1307_rtc_driver" + +BALENA_CONFIGS[ds1307_rtc_driver] = " \ + CONFIG_RTC_DRV_DS1307=m \ +" + +BALENA_CONFIGS_DEPS[ds1307_rtc_driver] = " \ + CONFIG_I2C=y \ +" + +BALENA_CONFIGS:append = " sc16is7xx_serial_driver" + +BALENA_CONFIGS[sc16is7xx_serial_driver] = " \ + CONFIG_SERIAL_SC16IS7XX=m \ +" + +BALENA_CONFIGS_DEPS[sc16is7xx_serial_driver] = " \ + CONFIG_I2C=y \ +" + +BALENA_CONFIGS:append = " mcp3422_adc_driver" + +BALENA_CONFIGS[mcp3422_adc_driver] = " \ + CONFIG_MCP3422=m \ +" + +BALENA_CONFIGS_DEPS[mcp3422_adc_driver] = " \ + CONFIG_I2C=y \ +" + +BALENA_CONFIGS:append = " sd8787_pwrseq_driver" + +BALENA_CONFIGS[sd8787_pwrseq_driver] = " \ + CONFIG_PWRSEQ_SD8787=m \ +" + +BALENA_CONFIGS_DEPS[sd8787_pwrseq_driver] = " \ + CONFIG_OF=y \ +" + +BALENA_CONFIGS:append = " serial_8250" +BALENA_CONFIGS[serial_8250] = " \ + CONFIG_SERIAL_8250=y \ + CONFIG_SERIAL_8250_CONSOLE=y \ + CONFIG_SERIAL_8250_NR_UARTS=1 \ + CONFIG_SERIAL_8250_EXTENDED=y \ + CONFIG_SERIAL_8250_SHARE_IRQ=y \ + CONFIG_SERIAL_8250_BCM2835AUX=y \ +" + +BALENA_CONFIGS:append:rt-rpi-300 = " rtrpi300cfgs" +BALENA_CONFIGS[rtrpi300cfgs] = " \ + CONFIG_RTC_DRV_RX8010=m \ + CONFIG_SPI=y \ + CONFIG_SPI_BCM2835=m \ + CONFIG_CH432T_SPI=m \ +" + +# The Pi3-64 and Pi4-64 are the only boards very low on rootfs space for now +# so we add this as per https://github.com/balena-os/meta-balena/pull/2411 +BALENA_CONFIGS:append:raspberrypi4-64 = " optimize-size" +BALENA_CONFIGS:append:raspberrypi3-64 = " optimize-size" +BALENA_CONFIGS[optimize-size] = " \ + CONFIG_CC_OPTIMIZE_FOR_SIZE=y \ +" + +BALENA_CONFIGS:append = " iio_pressure_drivers" +BALENA_CONFIGS[iio_pressure_drivers] = " \ + CONFIG_BMP280=m \ +" + +# Fix dtbo loading on 64bits, +# see commit 949b88bb for details +get_cc_option () { + # Check if KERNEL_CC supports the option "file-prefix-map". + # This option allows us to build images with __FILE__ values that do not + # contain the host build path. + if ${KERNEL_CC} -Q --help=joined | grep -q "\-ffile-prefix-map="; then + echo "-ffile-prefix-map=${S}=/kernel-source/" + fi +} +do_compile:append() { + if [ "${SITEINFO_BITS}" = "64" ]; then + cc_extra=$(get_cc_option) + oe_runmake dtbs CC="${KERNEL_CC} $cc_extra " LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} + fi +} From fcc576f0e45c92e771f6a28f5bd81be1ea7e0c2f Mon Sep 17 00:00:00 2001 From: Florin Sarbu Date: Mon, 9 Dec 2024 12:56:02 +0000 Subject: [PATCH 4/7] rt-rpi-300.conf: Pin to kernel version 5.15 In order to use kernel 6.1 on this machine we'd need to rework some of the patches. Signed-off-by: Florin Sarbu --- .../meta-balena-raspberrypi/conf/machine/rt-rpi-300.conf | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/layers/meta-balena-raspberrypi/conf/machine/rt-rpi-300.conf b/layers/meta-balena-raspberrypi/conf/machine/rt-rpi-300.conf index 5468bedc3..452b82366 100644 --- a/layers/meta-balena-raspberrypi/conf/machine/rt-rpi-300.conf +++ b/layers/meta-balena-raspberrypi/conf/machine/rt-rpi-300.conf @@ -2,9 +2,8 @@ #@NAME: Rocktech-RPI-300 #@DESCRIPTION: Machine configuration for Rocktech-RPI-300 -MACHINEOVERRIDES = "raspberrypi4-64:${MACHINE}" +MACHINEOVERRIDES =. "raspberrypi4-64:" + include conf/machine/raspberrypi4-64.conf -# because we override the raspberrypi4-64 machine which in turn is an override of raspberrypi4, we need to do the following gimmick: -# courtesy of https://github.com/balena-os/balena-jetson/pull/112/commits/9d21df6899e595b4aeab4cc9a939ae6c564c669a -MACHINEOVERRIDES := "${@'${MACHINEOVERRIDES}'.replace(':${MACHINE}',':raspberrypi4-64:${MACHINE}')}" +PREFERRED_VERSION_linux-raspberrypi = "5.15.%" From 1c37a846d4424f537036a5e75e081ea13a2dd243 Mon Sep 17 00:00:00 2001 From: Michal Toman Date: Mon, 13 Jan 2025 11:33:50 +0100 Subject: [PATCH 5/7] rpi-cmdline: Limit earlycon configuration to Pi4 family At this moment, when building with OS_DEVELOPMENT=1, earlycon is added to kernel command line, however the current configuration is only valid on the Pi4 family. Using it with any other device type will make the kernel hang. This patch limits the configuration to Pi4, Pi400 and CM4. Change-type: patch Signed-off-by: Michal Toman --- .../recipes-bsp/bootfiles/rpi-cmdline.bbappend | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/layers/meta-balena-raspberrypi/recipes-bsp/bootfiles/rpi-cmdline.bbappend b/layers/meta-balena-raspberrypi/recipes-bsp/bootfiles/rpi-cmdline.bbappend index 3489d9390..e3da3fb4e 100644 --- a/layers/meta-balena-raspberrypi/recipes-bsp/bootfiles/rpi-cmdline.bbappend +++ b/layers/meta-balena-raspberrypi/recipes-bsp/bootfiles/rpi-cmdline.bbappend @@ -1,7 +1,12 @@ # Set console accordingly to build type CMDLINE += " dwc_otg.lpm_enable=0 rootwait" CMDLINE += "${OS_KERNEL_CMDLINE} ${@oe.utils.conditional('SIGN_API','','',"${OS_KERNEL_SECUREBOOT_CMDLINE}",d)}" -CMDLINE =+ " ${@bb.utils.contains('DISTRO_FEATURES','osdev-image',"earlycon=uart8250,mmio32,0xfe215040 console=tty1","",d)}" + +# Add earlycon with OS_DEVELOPMENT=1 +CMDLINE:prepend:raspberrypi4-64 = " ${@bb.utils.contains('DISTRO_FEATURES','osdev-image',"earlycon=uart8250,mmio32,0xfe215040 console=tty1","",d)}" +CMDLINE:prepend:raspberrypi400-64 = " ${@bb.utils.contains('DISTRO_FEATURES','osdev-image',"earlycon=uart8250,mmio32,0xfe215040 console=tty1","",d)}" +CMDLINE:prepend:raspberrypicm4-ioboard = " ${@bb.utils.contains('DISTRO_FEATURES','osdev-image',"earlycon=uart8250,mmio32,0xfe215040 console=tty1","",d)}" +CMDLINE:prepend:raspberrypicm4-ioboard-sb = " ${@bb.utils.contains('DISTRO_FEATURES','osdev-image',"earlycon=uart8250,mmio32,0xfe215040 console=tty1","",d)}" # See https://github.com/raspberrypi/linux/commit/9b0efcc1ec497b2985c6aaa60cd97f0d2d96d203 CMDLINE += " cgroup_enable=memory" From 40195ddfb5d28432f91c6bc65b4b37b6b945962b Mon Sep 17 00:00:00 2001 From: Florin Sarbu Date: Mon, 20 Jan 2025 14:06:34 +0000 Subject: [PATCH 6/7] meta-balena-raspberrypi/conf/layer.conf: Keep raspberrypi0-2w-64 on kernel 5.15 Until we fix some WiFi firmware related issues on the raspberrypi0-2w-64 we keep it on kernel version 5.15. Signed-off-by: Florin Sarbu --- layers/meta-balena-raspberrypi/conf/layer.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/layers/meta-balena-raspberrypi/conf/layer.conf b/layers/meta-balena-raspberrypi/conf/layer.conf index 1f6d23743..c46748aeb 100644 --- a/layers/meta-balena-raspberrypi/conf/layer.conf +++ b/layers/meta-balena-raspberrypi/conf/layer.conf @@ -139,6 +139,9 @@ RPI_KERNEL_DEVICETREE:remove:revpi-core-3 = "bcm2711-rpi-cm4s.dtb" PREFERRED_VERSION_linux-raspberrypi = "6.1%" +# for the raspberrypi0-2w-64 we remain on 5.15 because of WiFi firmware related issues +PREFERRED_VERSION_linux-raspberrypi:raspberrypi0-2w-64 = "5.15.%" + FIRMWARE_COMPRESSION:raspberrypi4-64 ?= "1" FIRMWARE_COMPRESSION:raspberrypi0-2w-64 ?= "1" From a141edbc4cd68a83c7ef7e3d054056f79c7a29a2 Mon Sep 17 00:00:00 2001 From: Florin Sarbu Date: Mon, 20 Jan 2025 14:08:12 +0000 Subject: [PATCH 7/7] rpi-bootfiles.bbappend: Update Pi firmware to version 20241126 Changelog-entry: Update rpi-bootfiles to verson 20241126 Signed-off-by: Florin Sarbu --- .../recipes-bsp/bootfiles/rpi-bootfiles.bbappend | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/layers/meta-balena-raspberrypi/recipes-bsp/bootfiles/rpi-bootfiles.bbappend b/layers/meta-balena-raspberrypi/recipes-bsp/bootfiles/rpi-bootfiles.bbappend index bfdbbeafa..0251aa66d 100644 --- a/layers/meta-balena-raspberrypi/recipes-bsp/bootfiles/rpi-bootfiles.bbappend +++ b/layers/meta-balena-raspberrypi/recipes-bsp/bootfiles/rpi-bootfiles.bbappend @@ -6,10 +6,16 @@ SRC_URI += " \ file://fincm3-dt-blob.bin \ " -RPIFW_DATE = "20230509~buster" +RPIFW_DATE = "20241126" +SRCREV = "9f24f4bc2bdd07ffd158cfbb4bce88a2efc4c1f5" +SHORTREV = "${@d.getVar("SRCREV", False).__str__()[:7]}" +RPIFW_SRC_URI = "https://api.github.com/repos/raspberrypi/firmware/tarball/9f24f4bc2bdd07ffd158cfbb4bce88a2efc4c1f5;downloadfilename=raspberrypi-firmware-${SHORTREV}.tar.gz" +RPIFW_S = "${WORKDIR}/raspberrypi-firmware-${SHORTREV}" -SRC_URI[md5sum] = "20053767dd390cff9543a9b29f01729d" -SRC_URI[sha256sum] = "1d9eb83111826b708f461101766fd2000d45f1c171ad573936d000f623ca8098" +SRC_URI = "${RPIFW_SRC_URI}" +SRC_URI[sha256sum] = "4b436f8946b139c6a1202375ef55d4848e3bcd8c1a9cb47000e06d7ecec828f7" + +PV = "${RPIFW_DATE}" do_deploy:append() { # exclude from balenaOS the binaries with additional debug assertions (they