MycroftOS: Build, install and use the dtbo files from the kernel sources.

Instead of the pre-compiled version from the rpi-firmware repository
this to make sute everything is using the same version.
This commit is contained in:
j1nx 2020-08-04 18:59:41 +02:00
parent 4be50966fa
commit 390e3efde6
5 changed files with 81 additions and 2 deletions

View File

@ -9,7 +9,7 @@ image boot.vfat {
"rpi-firmware/config.txt",
"rpi-firmware/fixup.dat",
"rpi-firmware/start.elf",
"rpi-firmware/overlays",
"overlays",
"Image"
}
}

View File

@ -6,7 +6,7 @@ image boot.vfat {
"rpi-firmware/config.txt",
"rpi-firmware/fixup.dat",
"rpi-firmware/start.elf",
"rpi-firmware/overlays",
"overlays",
"Image"
}
}

View File

@ -35,6 +35,8 @@ BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/raspberrypi/linux/a
BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi3"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="broadcom/bcm2710-rpi-3-b broadcom/bcm2710-rpi-3-b-plus broadcom/bcm2837-rpi-3-b"
BR2_LINUX_KERNEL_DTB_OVERLAY_SUPPORT=y
BR2_LINUX_KERNEL_DTS_OVERLAYS_SUPPORT=y
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF=y
BR2_PACKAGE_LINUX_TOOLS_GPIO=y

View File

@ -39,6 +39,8 @@ BR2_LINUX_KERNEL_DEFCONFIG="bcm2711"
BR2_LINUX_KERNEL_LZ4=y
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="broadcom/bcm2711-rpi-4-b broadcom/bcm2711-rpi-400 broadcom/bcm2711-rpi-cm4"
BR2_LINUX_KERNEL_DTB_OVERLAY_SUPPORT=y
BR2_LINUX_KERNEL_DTS_OVERLAYS_SUPPORT=y
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF=y
BR2_PACKAGE_LINUX_TOOLS_GPIO=y

View File

@ -0,0 +1,75 @@
From c69b94f5a260dea78f913c70741c034618c5c981 Mon Sep 17 00:00:00 2001
From: j1nx <p.steenbergen@j1nx.nl>
Date: Tue, 4 Aug 2020 15:49:45 +0200
Subject: [PATCH 1/1] Compiling Raspberry Pi Overlays from kernel sources.
---
linux/Config.in | 7 +++++++
linux/linux.mk | 7 +++++++
package/rpi-firmware/Config.in | 7 +++----
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/linux/Config.in b/linux/Config.in
index c19ccb70a8..743b9290aa 100644
--- a/linux/Config.in
+++ b/linux/Config.in
@@ -417,6 +417,13 @@ config BR2_LINUX_KERNEL_DTB_OVERLAY_SUPPORT
endif
+config BR2_LINUX_KERNEL_DTS_OVERLAYS_SUPPORT
+ bool "Build Device Tree Overlays"
+ depends on BR2_LINUX_KERNEL_DTS_SUPPORT
+ help
+ Build in-tree device tree overlays.
+ Currently supports Raspberry Pi kernels.
+
config BR2_LINUX_KERNEL_INSTALL_TARGET
bool "Install kernel image to /boot in target"
depends on !BR2_TARGET_ROOTFS_INITRAMFS
diff --git a/linux/linux.mk b/linux/linux.mk
index ae1edbeb55..7acd1d9998 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -430,6 +430,12 @@ define LINUX_INSTALL_DTB
endef
endif # BR2_LINUX_KERNEL_APPENDED_DTB
endif # BR2_LINUX_KERNEL_DTB_IS_SELF_BUILT
+ifeq ($(BR2_LINUX_KERNEL_DTS_OVERLAYS_SUPPORT),y)
+define LINUX_INSTALL_DTB_OVERLAYS
+ mkdir -p $(1)
+ cp $(LINUX_ARCH_PATH)/boot/dts/overlays/*.dtbo $(1)
+endef
+endif # BR2_LINUX_KERNEL_DTS_OVERLAYS
endif # BR2_LINUX_KERNEL_DTS_SUPPORT
ifeq ($(BR2_LINUX_KERNEL_APPENDED_DTB),y)
@@ -510,6 +516,7 @@ endef
define LINUX_INSTALL_IMAGES_CMDS
$(call LINUX_INSTALL_IMAGE,$(BINARIES_DIR))
$(call LINUX_INSTALL_DTB,$(BINARIES_DIR))
+ $(call LINUX_INSTALL_DTB_OVERLAYS,$(BINARIES_DIR)/overlays)
endef
ifeq ($(BR2_STRIP_strip),y)
diff --git a/package/rpi-firmware/Config.in b/package/rpi-firmware/Config.in
index f5a25c5680..066d32168d 100644
--- a/package/rpi-firmware/Config.in
+++ b/package/rpi-firmware/Config.in
@@ -84,10 +84,9 @@ config BR2_PACKAGE_RPI_FIRMWARE_INSTALL_DTBS
config BR2_PACKAGE_RPI_FIRMWARE_INSTALL_DTB_OVERLAYS
bool "Install DTB overlays"
default y
- depends on BR2_PACKAGE_RPI_FIRMWARE_INSTALL_DTBS \
- || BR2_LINUX_KERNEL_DTS_SUPPORT
- select BR2_LINUX_KERNEL_DTB_OVERLAY_SUPPORT \
- if BR2_LINUX_KERNEL_DTS_SUPPORT
+ depends on (BR2_PACKAGE_RPI_FIRMWARE_INSTALL_DTBS \
+ || BR2_LINUX_KERNEL_DTS_SUPPORT) && \
+ !BR2_LINUX_KERNEL_DTS_OVERLAYS_SUPPORT
help
Say 'y' here if you need to load one or more of the DTB
overlays, to support HATs (Hardware Attached on Top, add-on
--
2.20.1