meta-raspberrypi: subtree update:e2c1992955..cc6074c660

Andrei Gherzan (1):
      sdcard_image-rpi.bbclass: Fix when RPI_SDIMG_EXTRA_DEPENDS not defined

Christopher Clark (2):
      sdcard_image-rpi.bbclass: enable extensible inclusion into boot
      docs/extra-build-config.md: document vars to add to boot partition

Fabio Berton (1):
      u-boot: Move fw_env.config to u-boot append

Jakub Luzny (2):
      rpi-config: Add CAN_OSCILLATOR variable to set mcp2515 crystal frequency
      docs/extra-build-config.md: Document CAN_OSCILLATOR variable

Jeff Ithier (1):
      Generalize the naming of the bootfiles deploy directory

Martin Jansa (1):
      linux-raspberrypi-5.4: bump SRCREV to latest to fix perf build

Pierre-Jean Texier (3):
      rpi-default-versions: Switch defaults to 5.4
      raspberrypi-firmware: update to current HEAD
      linux-raspberrypi: bump to revision 4b945d5

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I50eca26a801bfe014d3cea271f0cb91e7b653445
diff --git a/meta-raspberrypi/classes/sdcard_image-rpi.bbclass b/meta-raspberrypi/classes/sdcard_image-rpi.bbclass
index 43426b2..8197978 100644
--- a/meta-raspberrypi/classes/sdcard_image-rpi.bbclass
+++ b/meta-raspberrypi/classes/sdcard_image-rpi.bbclass
@@ -26,7 +26,7 @@
 IMAGE_TYPEDEP_rpi-sdimg = "${SDIMG_ROOTFS_TYPE}"
 
 # Set kernel and boot loader
-IMAGE_BOOTLOADER ?= "bcm2835-bootfiles"
+IMAGE_BOOTLOADER ?= "bootfiles"
 
 # Kernel image name
 SDIMG_KERNELIMAGE_raspberrypi  ?= "kernel.img"
@@ -49,6 +49,8 @@
 # For the names of kernel artifacts
 inherit kernel-artifact-names
 
+RPI_SDIMG_EXTRA_DEPENDS ?= ""
+
 do_image_rpi_sdimg[depends] = " \
     parted-native:do_populate_sysroot \
     mtools-native:do_populate_sysroot \
@@ -59,6 +61,7 @@
     ${@bb.utils.contains('MACHINE_FEATURES', 'armstub', 'armstubs:do_deploy', '' ,d)} \
     ${@bb.utils.contains('RPI_USE_U_BOOT', '1', 'u-boot:do_deploy', '',d)} \
     ${@bb.utils.contains('RPI_USE_U_BOOT', '1', 'u-boot-default-script:do_deploy', '',d)} \
+    ${RPI_SDIMG_EXTRA_DEPENDS} \
 "
 
 do_image_rpi_sdimg[recrdeps] = "do_build"
@@ -114,7 +117,7 @@
     BOOT_BLOCKS=$(LC_ALL=C parted -s ${SDIMG} unit b print | awk '/ 1 / { print substr($4, 1, length($4 -1)) / 512 /2 }')
     rm -f ${WORKDIR}/boot.img
     mkfs.vfat -F32 -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${WORKDIR}/boot.img $BOOT_BLOCKS
-    mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/* ::/ || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/* into boot.img"
+    mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${BOOTFILES_DIR_NAME}/* ::/ || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/${BOOTFILES_DIR_NAME}/* into boot.img"
     if [ "${@bb.utils.contains("MACHINE_FEATURES", "armstub", "1", "0", d)}" = "1" ]; then
         mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/armstubs/${ARMSTUB} ::/ || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/armstubs/${ARMSTUB} into boot.img"
     fi
@@ -148,6 +151,22 @@
         fi
     fi
 
+    # Add files (eg. hypervisor binaries) from the deploy dir
+    if [ -n "${DEPLOYPAYLOAD}" ] ; then
+        echo "Copying deploy file payload into VFAT"
+        for entry in ${DEPLOYPAYLOAD} ; do
+            # Split entry at optional ':' to enable file renaming for the destination
+            if [ $(echo "$entry" | grep -c :) = "0" ] ; then
+                DEPLOY_FILE="$entry"
+                DEST_FILENAME="$entry"
+            else
+                DEPLOY_FILE="$(echo "$entry" | cut -f1 -d:)"
+                DEST_FILENAME="$(echo "$entry" | cut -f2- -d:)"
+            fi
+            mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${DEPLOY_FILE} ::${DEST_FILENAME} || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/${DEPLOY_FILE} into boot.img"
+        done
+    fi
+
     if [ -n "${FATPAYLOAD}" ] ; then
         echo "Copying payload into VFAT"
         for entry in ${FATPAYLOAD} ; do
diff --git a/meta-raspberrypi/conf/machine/include/rpi-base.inc b/meta-raspberrypi/conf/machine/include/rpi-base.inc
index 5f9a1e3..cd6d0b0 100644
--- a/meta-raspberrypi/conf/machine/include/rpi-base.inc
+++ b/meta-raspberrypi/conf/machine/include/rpi-base.inc
@@ -85,6 +85,10 @@
 
 SERIAL_CONSOLES_CHECK ??= "${SERIAL_CONSOLES}"
 
+# The name of the deploy directory for raspberry pi boot files.
+# This variable is referred to by recipes fetching / generating the files.
+BOOTFILES_DIR_NAME ?= "bootfiles"
+
 # Set Raspberrypi splash image
 SPLASH = "psplash-raspberrypi"
 
@@ -111,14 +115,14 @@
     return ' '.join([transform(dtb) for dtb in alldtbs.split(' ') if dtb])
 
 
-IMAGE_BOOT_FILES ?= "bcm2835-bootfiles/* \
+IMAGE_BOOT_FILES ?= "${BOOTFILES_DIR_NAME}/* \
                  ${@make_dtb_boot_files(d)} \
                  ${@bb.utils.contains('RPI_USE_U_BOOT', '1', \
                     '${KERNEL_IMAGETYPE} u-boot.bin;${SDIMG_KERNELIMAGE} boot.scr', \
                     '${KERNEL_IMAGETYPE};${SDIMG_KERNELIMAGE}', d)} \
                  "
 do_image_wic[depends] += " \
-    bcm2835-bootfiles:do_deploy \
+    bootfiles:do_deploy \
     ${@bb.utils.contains('RPI_USE_U_BOOT', '1', 'u-boot:do_deploy', '',d)} \
     "
 
diff --git a/meta-raspberrypi/conf/machine/include/rpi-default-versions.inc b/meta-raspberrypi/conf/machine/include/rpi-default-versions.inc
index 9983b61..e57c702 100644
--- a/meta-raspberrypi/conf/machine/include/rpi-default-versions.inc
+++ b/meta-raspberrypi/conf/machine/include/rpi-default-versions.inc
@@ -1,3 +1,3 @@
 # RaspberryPi BSP default versions
 
-PREFERRED_VERSION_linux-raspberrypi ??= "4.19.%"
+PREFERRED_VERSION_linux-raspberrypi ??= "5.4.%"
diff --git a/meta-raspberrypi/docs/extra-build-config.md b/meta-raspberrypi/docs/extra-build-config.md
index 641dc0a..b881322 100644
--- a/meta-raspberrypi/docs/extra-build-config.md
+++ b/meta-raspberrypi/docs/extra-build-config.md
@@ -172,6 +172,31 @@
   - `INITRAMFS_MAXSIZE = "315400"`
   - `IMAGE_FSTYPES_pn-${INITRAMFS_IMAGE} = "${INITRAMFS_FSTYPES}"`
 
+## Including additional files in the SD card image boot partition
+
+The SD card image class supports adding extra files into the boot
+partition, where the files are copied from either the image root
+partition or from the build image deploy directory.
+
+To copy files that are present in the root partition into boot,
+FATPAYLOAD is a simple space-separated list of files to be copied:
+
+    FATPAYLOAD = "/boot/example1 /boot/example2"
+
+To copy files from the image deploy directory, the files should be
+listed in the DEPLOYPAYLOAD as a space-separated list of entries.
+Each entry lists a file to be copied, and an optional destination
+filename can be specified by supplying it after a colon separator.
+
+    DEPLOYPAYLOAD = "example1-${MACHINE}:example1 example2"
+
+Files that are to be included from the deploy directory will be produced
+by tasks that image building task must depend upon, to ensure that the
+files are available when they are needed, so these component deploy
+tasks must be added to: RPI_SDIMG_EXTRA_DEPENDS.
+
+    RPI_SDIMG_EXTRA_DEPENDS_append = " example:do_deploy"
+
 ## Enable SPI bus
 
 When using device tree kernels, set this variable to enable the SPI bus:
@@ -252,21 +277,27 @@
 
 See: <https://openlabs.co/OSHW/Raspberry-Pi-802.15.4-radio>
 
-## Enable CAN with Pican2
+## Enable CAN
 
-In order to use Pican2 CAN module, set the following variables:
+In order to use CAN with an MCP2515-based module, set the following variables:
 
 	ENABLE_SPI_BUS = "1"
 	ENABLE_CAN = "1"
 
-See: <http://skpang.co.uk/catalog/pican2-canbus-board-for-raspberry-pi-23-p-1475.html>
+In case of dual CAN module (e.g. PiCAN2 Duo), set following variables instead:
 
-In order to use Pican2 Duo CAN module, set the following variables:
-
-	ENABLE_SPI_BUS = "1"
+    ENABLE_SPI_BUS = "1"
 	ENABLE_DUAL_CAN = "1"
 
-See: <http://skpang.co.uk/catalog/pican2-duo-canbus-board-for-raspberry-pi-23-p-1480.html>
+Some modules may require setting the frequency of the crystal oscillator used on the particular board. The frequency is usually marked on the package of the crystal. By default, it is set to 16 MHz. To change that to 8 MHz, the following variable also has to be set:
+
+    CAN_OSCILLATOR="8000000"
+
+Tested modules:
+
+* PiCAN2 (16 MHz crystal): <http://skpang.co.uk/catalog/pican2-canbus-board-for-raspberry-pi-23-p-1475.html>
+* WaveShare RS485 CAN HAT (8 MHz or 12 MHz crystal): <https://www.waveshare.com/rs485-can-hat.htm>
+* PiCAN2 Duo (16 MHz crystal): <http://skpang.co.uk/catalog/pican2-duo-canbus-board-for-raspberry-pi-23-p-1480.html>
 
 ## Enable infrared
 
diff --git a/meta-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bb b/meta-raspberrypi/recipes-bsp/bootfiles/bootfiles.bb
similarity index 90%
rename from meta-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bb
rename to meta-raspberrypi/recipes-bsp/bootfiles/bootfiles.bb
index d20312c..80e226d 100644
--- a/meta-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bb
+++ b/meta-raspberrypi/recipes-bsp/bootfiles/bootfiles.bb
@@ -1,4 +1,4 @@
-DESCRIPTION = "Closed source binary files to help boot the ARM on the BCM2835."
+DESCRIPTION = "Closed source binary files to help boot all raspberry pi devices."
 LICENSE = "Broadcom-RPi"
 
 LIC_FILES_CHKSUM = "file://LICENCE.broadcom;md5=c403841ff2837657b2ed8e5bb474ac8d"
diff --git a/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bb b/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bb
index afdbce6..9489951 100644
--- a/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bb
+++ b/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bb
@@ -28,211 +28,213 @@
 GPIO_IR ?= "18"
 GPIO_IR_TX ?= "17"
 
+CAN_OSCILLATOR ?= "16000000"
+
 inherit deploy nopackages
 
 do_deploy() {
-    install -d ${DEPLOYDIR}/bcm2835-bootfiles
+    install -d ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}
 
-    cp ${S}/config.txt ${DEPLOYDIR}/bcm2835-bootfiles/
+    cp ${S}/config.txt ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/
 
     if [ -n "${KEY_DECODE_MPG2}" ]; then
-        sed -i '/#decode_MPG2=/ c\decode_MPG2=${KEY_DECODE_MPG2}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        sed -i '/#decode_MPG2=/ c\decode_MPG2=${KEY_DECODE_MPG2}' ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
     if [ -n "${KEY_DECODE_WVC1}" ]; then
-        sed -i '/#decode_WVC1=/ c\decode_WVC1=${KEY_DECODE_WVC1}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        sed -i '/#decode_WVC1=/ c\decode_WVC1=${KEY_DECODE_WVC1}' ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
     if [ -n "${DISABLE_OVERSCAN}" ]; then
-        sed -i '/#disable_overscan=/ c\disable_overscan=${DISABLE_OVERSCAN}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        sed -i '/#disable_overscan=/ c\disable_overscan=${DISABLE_OVERSCAN}' ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
     if [ "${DISABLE_SPLASH}" = "1" ]; then
-        sed -i '/#disable_splash=/ c\disable_splash=${DISABLE_SPLASH}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        sed -i '/#disable_splash=/ c\disable_splash=${DISABLE_SPLASH}' ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
 
     # Set overclocking options
     if [ -n "${ARM_FREQ}" ]; then
-        sed -i '/#arm_freq=/ c\arm_freq=${ARM_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        sed -i '/#arm_freq=/ c\arm_freq=${ARM_FREQ}' ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
     if [ -n "${GPU_FREQ}" ]; then
-        sed -i '/#gpu_freq=/ c\gpu_freq=${GPU_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        sed -i '/#gpu_freq=/ c\gpu_freq=${GPU_FREQ}' ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
     if [ -n "${CORE_FREQ}" ]; then
-        sed -i '/#core_freq=/ c\core_freq=${CORE_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        sed -i '/#core_freq=/ c\core_freq=${CORE_FREQ}' ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
     if [ -n "${SDRAM_FREQ}" ]; then
-        sed -i '/#sdram_freq=/ c\sdram_freq=${SDRAM_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        sed -i '/#sdram_freq=/ c\sdram_freq=${SDRAM_FREQ}' ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
     if [ -n "${OVER_VOLTAGE}" ]; then
-        sed -i '/#over_voltage=/ c\over_voltage=${OVER_VOLTAGE}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        sed -i '/#over_voltage=/ c\over_voltage=${OVER_VOLTAGE}' ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
 
     # GPU memory
     if [ -n "${GPU_MEM}" ]; then
-        sed -i '/#gpu_mem=/ c\gpu_mem=${GPU_MEM}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        sed -i '/#gpu_mem=/ c\gpu_mem=${GPU_MEM}' ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
     if [ -n "${GPU_MEM_256}" ]; then
-        sed -i '/#gpu_mem_256=/ c\gpu_mem_256=${GPU_MEM_256}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        sed -i '/#gpu_mem_256=/ c\gpu_mem_256=${GPU_MEM_256}' ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
     if [ -n "${GPU_MEM_512}" ]; then
-        sed -i '/#gpu_mem_512=/ c\gpu_mem_512=${GPU_MEM_512}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        sed -i '/#gpu_mem_512=/ c\gpu_mem_512=${GPU_MEM_512}' ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
     if [ -n "${GPU_MEM_1024}" ]; then
-        sed -i '/#gpu_mem_1024=/ c\gpu_mem_1024=${GPU_MEM_1024}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        sed -i '/#gpu_mem_1024=/ c\gpu_mem_1024=${GPU_MEM_1024}' ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
 
     # Set boot delay
     if [ -n "${BOOT_DELAY}" ]; then
-        sed -i '/#boot_delay=/ c\boot_delay=${BOOT_DELAY}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        sed -i '/#boot_delay=/ c\boot_delay=${BOOT_DELAY}' ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
     if [ -n "${BOOT_DELAY_MS}" ]; then
-        sed -i '/#boot_delay_ms=/ c\boot_delay_ms=${BOOT_DELAY_MS}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        sed -i '/#boot_delay_ms=/ c\boot_delay_ms=${BOOT_DELAY_MS}' ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
 
     # Set HDMI and composite video options
     if [ -n "${HDMI_FORCE_HOTPLUG}" ]; then
-        sed -i '/#hdmi_force_hotplug=/ c\hdmi_force_hotplug=${HDMI_FORCE_HOTPLUG}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        sed -i '/#hdmi_force_hotplug=/ c\hdmi_force_hotplug=${HDMI_FORCE_HOTPLUG}' ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
     if [ -n "${HDMI_DRIVE}" ]; then
-        sed -i '/#hdmi_drive=/ c\hdmi_drive=${HDMI_DRIVE}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        sed -i '/#hdmi_drive=/ c\hdmi_drive=${HDMI_DRIVE}' ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
     if [ -n "${HDMI_GROUP}" ]; then
-        sed -i '/#hdmi_group=/ c\hdmi_group=${HDMI_GROUP}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        sed -i '/#hdmi_group=/ c\hdmi_group=${HDMI_GROUP}' ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
     if [ -n "${HDMI_MODE}" ]; then
-        sed -i '/#hdmi_mode=/ c\hdmi_mode=${HDMI_MODE}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        sed -i '/#hdmi_mode=/ c\hdmi_mode=${HDMI_MODE}' ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
     if [ -n "${CONFIG_HDMI_BOOST}" ]; then
-        sed -i '/#config_hdmi_boost=/ c\config_hdmi_boost=${CONFIG_HDMI_BOOST}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        sed -i '/#config_hdmi_boost=/ c\config_hdmi_boost=${CONFIG_HDMI_BOOST}' ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
     if [ -n "${SDTV_MODE}" ]; then
-        sed -i '/#sdtv_mode=/ c\sdtv_mode=${SDTV_MODE}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        sed -i '/#sdtv_mode=/ c\sdtv_mode=${SDTV_MODE}' ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
     if [ -n "${SDTV_ASPECT}" ]; then
-        sed -i '/#sdtv_aspect=/ c\sdtv_aspect=${SDTV_ASPECT}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        sed -i '/#sdtv_aspect=/ c\sdtv_aspect=${SDTV_ASPECT}' ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
     if [ -n "${DISPLAY_ROTATE}" ]; then
-        sed -i '/#display_rotate=/ c\display_rotate=${DISPLAY_ROTATE}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        sed -i '/#display_rotate=/ c\display_rotate=${DISPLAY_ROTATE}' ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
 
     # Video camera support
     if [ "${VIDEO_CAMERA}" = "1" ]; then
-        echo "# Enable video camera" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-        echo "start_x=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "# Enable video camera" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+        echo "start_x=1" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
 
     # Offline compositing support
     if [ "${DISPMANX_OFFLINE}" = "1" ]; then
-        echo "# Enable offline compositing" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-        echo "dispmanx_offline=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "# Enable offline compositing" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+        echo "dispmanx_offline=1" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
 
     # SPI bus support
     if [ "${ENABLE_SPI_BUS}" = "1" ] || [ "${PITFT}" = "1" ]; then
-        echo "# Enable SPI bus" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-        echo "dtparam=spi=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "# Enable SPI bus" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+        echo "dtparam=spi=on" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
 
     # I2C support
     if [ "${ENABLE_I2C}" = "1" ] || [ "${PITFT}" = "1" ]; then
-        echo "# Enable I2C" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-        echo "dtparam=i2c1=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-        echo "dtparam=i2c_arm=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "# Enable I2C" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+        echo "dtparam=i2c1=on" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+        echo "dtparam=i2c_arm=on" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
 
     # PiTFT22 display support
     if [ "${PITFT22}" = "1" ]; then
-        echo "# Enable PITFT22 display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-        echo "dtoverlay=pitft22,rotate=270,speed=32000000,txbuflen=32768" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "# Enable PITFT22 display" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+        echo "dtoverlay=pitft22,rotate=270,speed=32000000,txbuflen=32768" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
     if [ "${PITFT28r}" = "1" ]; then
-        echo "# Enable PITFT28r display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-        echo "dtoverlay=pitft28-resistive,rotate=90,speed=32000000,txbuflen=32768" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "# Enable PITFT28r display" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+        echo "dtoverlay=pitft28-resistive,rotate=90,speed=32000000,txbuflen=32768" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
     if [ "${PITFT28c}" = "1" ]; then
-        echo "# Enable PITFT28c display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-        echo "dtoverlay=pitft28-capacitive,rotate=90,speed=32000000,txbuflen=32768" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-        echo "dtoverlay=pitft28-capacitive,touch-swapxy,touch-invx" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "# Enable PITFT28c display" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+        echo "dtoverlay=pitft28-capacitive,rotate=90,speed=32000000,txbuflen=32768" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+        echo "dtoverlay=pitft28-capacitive,touch-swapxy,touch-invx" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
     if [ "${PITFT35r}" = "1" ]; then
-        echo "# Enable PITFT35r display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-        echo "dtoverlay=pitft35-resistive,rotate=90,speed=42000000,fps=20" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "# Enable PITFT35r display" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+        echo "dtoverlay=pitft35-resistive,rotate=90,speed=42000000,fps=20" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
 
     # UART support
     if [ "${ENABLE_UART}" = "1" ]; then
-        echo "# Enable UART" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-        echo "enable_uart=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "# Enable UART" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+        echo "enable_uart=1" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
 
     # Infrared support
     if [ "${ENABLE_IR}" = "1" ]; then
-        echo "# Enable infrared" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-        echo "dtoverlay=gpio-ir,gpio_pin=${GPIO_IR}" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-        echo "dtoverlay=gpio-ir-tx,gpio_pin=${GPIO_IR_TX}" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "# Enable infrared" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+        echo "dtoverlay=gpio-ir,gpio_pin=${GPIO_IR}" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+        echo "dtoverlay=gpio-ir-tx,gpio_pin=${GPIO_IR_TX}" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
 
     # VC4 Graphics support
     if [ "${VC4GRAPHICS}" = "1" ]; then
-        echo "# Enable VC4 Graphics" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-        echo "dtoverlay=${VC4DTBO}" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "# Enable VC4 Graphics" >> ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+        echo "dtoverlay=${VC4DTBO}" >> ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
 
     # Waveshare "C" 1024x600 7" Rev2.1 IPS capacitive touch (http://www.waveshare.com/7inch-HDMI-LCD-C.htm)
     if [ "${WAVESHARE_1024X600_C_2_1}" = "1" ]; then
-        echo "# Waveshare \"C\" 1024x600 7\" Rev2.1 IPS capacitive touch screen" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-        echo "max_usb_current=1" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-        echo "hdmi_group=2" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-        echo "hdmi_mode=87" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-        echo "hdmi_cvt 1024 600 60 6 0 0 0" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-        echo "hdmi_drive=1" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "# Waveshare \"C\" 1024x600 7\" Rev2.1 IPS capacitive touch screen" >> ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+        echo "max_usb_current=1" >> ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+        echo "hdmi_group=2" >> ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+        echo "hdmi_mode=87" >> ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+        echo "hdmi_cvt 1024 600 60 6 0 0 0" >> ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+        echo "hdmi_drive=1" >> ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
 
     # DWC2 USB peripheral support
     if [ "${ENABLE_DWC2_PERIPHERAL}" = "1" ]; then
-        echo "# Enable USB peripheral mode" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-        echo "dtoverlay=dwc2,dr_mode=peripheral" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "# Enable USB peripheral mode" >> ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+        echo "dtoverlay=dwc2,dr_mode=peripheral" >> ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
 
     # AT86RF23X support
     if [ "${ENABLE_AT86RF}" = "1" ]; then
-        echo "# Enable AT86RF23X" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-        echo "dtoverlay=at86rf233,speed=3000000" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "# Enable AT86RF23X" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+        echo "dtoverlay=at86rf233,speed=3000000" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
 
     # ENABLE DUAL CAN
     if [ "${ENABLE_DUAL_CAN}" = "1" ]; then
-        echo "# Enable DUAL CAN" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-        echo "dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-        echo "dtoverlay=mcp2515-can1,oscillator=16000000,interrupt=24" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "# Enable DUAL CAN" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+        echo "dtoverlay=mcp2515-can0,oscillator=${CAN_OSCILLATOR},interrupt=25" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+        echo "dtoverlay=mcp2515-can1,oscillator=${CAN_OSCILLATOR},interrupt=24" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     # ENABLE CAN
     elif [ "${ENABLE_CAN}" = "1" ]; then
-        echo "# Enable CAN" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-        echo "dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "# Enable CAN" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+        echo "dtoverlay=mcp2515-can0,oscillator=${CAN_OSCILLATOR},interrupt=25" >>${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
     fi
 
     # Append extra config if the user has provided any
-    printf "${RPI_EXTRA_CONFIG}\n" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+    printf "${RPI_EXTRA_CONFIG}\n" >> ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
 
     # Handle setup with armstub file
     if [ "${@bb.utils.contains("MACHINE_FEATURES", "armstub", "1", "0", d)}" = "1" ]; then
-        echo "\n# ARM stub configuration" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-        echo "armstub=${ARMSTUB}" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "\n# ARM stub configuration" >> ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+        echo "armstub=${ARMSTUB}" >> ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
         case "${ARMSTUB}" in
             *-gic.bin)
-                echo  "enable_gic=1" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+                echo  "enable_gic=1" >> ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
                 ;;
         esac
     fi
 }
 
 do_deploy_append_raspberrypi3-64() {
-    echo "# have a properly sized image" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-    echo "disable_overscan=1" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+    echo "# have a properly sized image" >> ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+    echo "disable_overscan=1" >> ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
 
-    echo "# Enable audio (loads snd_bcm2835)" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
-    echo "dtparam=audio=on" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+    echo "# Enable audio (loads snd_bcm2835)" >> ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
+    echo "dtparam=audio=on" >> ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt
 }
 
 addtask deploy before do_build after do_install
-do_deploy[dirs] += "${DEPLOYDIR}/bcm2835-bootfiles"
+do_deploy[dirs] += "${DEPLOYDIR}/${BOOTFILES_DIR_NAME}"
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/meta-raspberrypi/recipes-bsp/common/raspberrypi-firmware.inc b/meta-raspberrypi/recipes-bsp/common/raspberrypi-firmware.inc
index d4d2e3c..3919c9f 100644
--- a/meta-raspberrypi/recipes-bsp/common/raspberrypi-firmware.inc
+++ b/meta-raspberrypi/recipes-bsp/common/raspberrypi-firmware.inc
@@ -1,10 +1,10 @@
-RPIFW_DATE ?= "20200713"
-SRCREV ?= "7e74bcb4f9706f36f752d1c3d3164628ccf2aae5"
+RPIFW_DATE ?= "20200812"
+SRCREV ?= "18aa72c5e05677b8a8af835bd60409e3253817aa"
 RPIFW_SRC_URI ?= "https://github.com/raspberrypi/firmware/archive/${SRCREV}.tar.gz"
 RPIFW_S ?= "${WORKDIR}/firmware-${SRCREV}"
 
 SRC_URI = "${RPIFW_SRC_URI}"
-SRC_URI[md5sum] = "46a19d68b81f388443394492dd6a873c"
-SRC_URI[sha256sum] = "f987cafcbc72179493673191e3e4aa8c1f18eccf871546be5d26156abbf8eff1"
+SRC_URI[md5sum] = "285453979ec7730f9547445056d58e44"
+SRC_URI[sha256sum] = "9e946f96aff5791150703ea3510f26724e80048ba7c2985e28fbba6a2e1406d2"
 
 PV = "${RPIFW_DATE}"
diff --git a/meta-raspberrypi/recipes-bsp/u-boot/libubootenv_%.bbappend b/meta-raspberrypi/recipes-bsp/u-boot/libubootenv_%.bbappend
deleted file mode 100644
index 22d1bdc..0000000
--- a/meta-raspberrypi/recipes-bsp/u-boot/libubootenv_%.bbappend
+++ /dev/null
@@ -1,12 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-SRC_URI_append_rpi = " \
-    file://fw_env.config \
-"
-
-DEPENDS_append_rpi = " rpi-u-boot-scr"
-
-do_install_append_rpi () {
-    install -d ${D}${sysconfdir}
-    install -m 0644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config
-}
diff --git a/meta-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend b/meta-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend
index 9ce6425..7f38adb 100644
--- a/meta-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend
+++ b/meta-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend
@@ -1 +1,12 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+SRC_URI_append_rpi = " \
+    file://fw_env.config \
+"
+
 DEPENDS_append_rpi = " u-boot-default-script"
+
+do_install_append_rpi () {
+    install -d ${D}${sysconfdir}
+    install -m 0644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config
+}
diff --git a/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc b/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc
index 3c3a8e5..f7dee77 100644
--- a/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc
+++ b/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc
@@ -131,10 +131,10 @@
 
 do_deploy_append() {
     # Deploy cmdline.txt
-    install -d ${DEPLOYDIR}/bcm2835-bootfiles
+    install -d ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}
     PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}"
     if [ ${PITFT} = "1" ]; then
         PITFT_PARAMS="fbcon=map:10 fbcon=font:VGA8x8"
     fi
-    echo "${CMDLINE}${PITFT_PARAMS}" > ${DEPLOYDIR}/bcm2835-bootfiles/cmdline.txt
+    echo "${CMDLINE}${PITFT_PARAMS}" > ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/cmdline.txt
 }
diff --git a/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.4.bb b/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.4.bb
index e039c08..7fea9dd 100644
--- a/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.4.bb
+++ b/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.4.bb
@@ -1,7 +1,7 @@
-LINUX_VERSION ?= "5.4.51"
+LINUX_VERSION ?= "5.4.58"
 LINUX_RPI_BRANCH ?= "rpi-5.4.y"
 
-SRCREV = "95a969f451f6ed61029741411c1c9aa44023e465"
+SRCREV = "4592a094787fa6a2ac1e95e96abfe4d7124dbb3a"
 
 require linux-raspberrypi_5.4.inc