diff --git a/buildroot/buildroot-dev.patch b/buildroot/buildroot-dev.patch index 50c37e9d..cdf4aad0 100644 --- a/buildroot/buildroot-dev.patch +++ b/buildroot/buildroot-dev.patch @@ -130,3 +130,14 @@ diff -urb buildroot-dev/utils/scanpypi brdev-working/utils/scanpypi """ Utility for building Buildroot packages for existing PyPI packages +--- buildroot-dev/package/rpi-firmware/rpi-firmware.mk 2020-03-30 08:34:17.762664308 +0000 ++++ buildroot-dev/package/rpi-firmware/rpi-firmware.mk 2020-03-30 09:07:44.410958163 +0000 +@@ -4,7 +4,7 @@ + # + ################################################################################ + +-RPI_FIRMWARE_VERSION = 01ecfd2ba2b7cf3a2f4aa75ada895ee4a3e729f5 ++RPI_FIRMWARE_VERSION = 5574077183389cd4c65077ba18b59144ed6ccd6d + RPI_FIRMWARE_SITE = $(call github,raspberrypi,firmware,$(RPI_FIRMWARE_VERSION)) + RPI_FIRMWARE_LICENSE = BSD-3-Clause + RPI_FIRMWARE_LICENSE_FILES = boot/LICENCE.broadcom diff --git a/buildroot/package/configtxt/configtxt.mk b/buildroot/package/configtxt/configtxt.mk index 3af8cc6c..19b61496 100644 --- a/buildroot/package/configtxt/configtxt.mk +++ b/buildroot/package/configtxt/configtxt.mk @@ -8,6 +8,8 @@ define CONFIGTXT_INSTALL_TARGET_CMDS echo "# Enable I2C and SPI" >> $(BINARIES_DIR)/rpi-firmware/config.txt echo "dtparam=i2c=on" >> $(BINARIES_DIR)/rpi-firmware/config.txt echo "dtparam=spi=on" >> $(BINARIES_DIR)/rpi-firmware/config.txt + echo "# Workaround force_eeprom_read" >> $(BINARIES_DIR)/rpi-firmware/config.txt + echo "force_eeprom_read=0" >> $(BINARIES_DIR)/rpi-firmware/config.txt endef define CONFIGTXT_QUIET_INSTALL_TARGET_CMDS diff --git a/buildroot/package/hifiberry-tools/Config.in b/buildroot/package/hifiberry-tools/Config.in index cf81211a..d418a518 100644 --- a/buildroot/package/hifiberry-tools/Config.in +++ b/buildroot/package/hifiberry-tools/Config.in @@ -10,7 +10,8 @@ config BR2_PACKAGE_HIFIBERRY_TOOLS select BR2_PACKAGE_LINUX_TOOLS_PERF select BR2_PACKAGE_LINUX_TOOLS_PERF_TUI select BR2_PACKAGE_JQ - select BR2_PACKAGE_RNG_TOOL + select BR2_PACKAGE_RNG_TOOLS + select BR2_PACKAGE_ZIP config BR2_PACKAGE_HIFIBERRY_TOOLS_AUDIO_LITE bool "audio lite mode (for Pi 0)" diff --git a/buildroot/package/hifiberry-tools/detect-hifiberry b/buildroot/package/hifiberry-tools/detect-hifiberry index 07505418..40ac23a3 100755 --- a/buildroot/package/hifiberry-tools/detect-hifiberry +++ b/buildroot/package/hifiberry-tools/detect-hifiberry @@ -70,12 +70,21 @@ if [ "$FOUND" == "" ]; then echo "No HiFiBerry card configured, try to probe using I2C" >> /var/log/hifiberry.log echo "Mounting /boot" - mount /boot + mount -o remount,rw /boot if [ ! -f /boot/config.txt ]; then echo "couldn't mount FAT file system, aborting card detection" >> /var/log/hifiberry.log exit 1 fi + echo "Detecting force_eeprom_read" + FORCEEEPROM=`cat /boot/config.txt | grep force_eeprom_read` + if [ "$FORCEEEPROM" != "" ]; then + cat /boot/config.txt | grep -v force_eeprom_read > /tmp/config.txt + cp /boot/config.txt /boot/config.txt.bak + cp /tmp/config.txt /boot/config.txt + sync + fi + echo "Detecting using I2C" check_i2c card=$(detect_card) diff --git a/buildroot/package/hifiberry-tools/reconfigure-players b/buildroot/package/hifiberry-tools/reconfigure-players index 5e345b3b..ba9239ba 100755 --- a/buildroot/package/hifiberry-tools/reconfigure-players +++ b/buildroot/package/hifiberry-tools/reconfigure-players @@ -215,13 +215,13 @@ guess_card() { return fi - DIGIPRO=`aplay -l | grep Digi+ | grep Pro` + DIGIPRO=`aplay -l | grep Digi | grep Pro` if [ "$DIGIPRO" != "" ]; then CARD="Digi+ Pro" return fi - DIGI=`aplay -l | grep Digi+` + DIGI=`aplay -l | grep Digi` if [ "$DIGI" != "" ]; then CARD="Digi+" return diff --git a/buildroot/package/hifiberry-updater/Config.in b/buildroot/package/hifiberry-updater/Config.in index 19b36e0a..cfeaf0b3 100644 --- a/buildroot/package/hifiberry-updater/Config.in +++ b/buildroot/package/hifiberry-updater/Config.in @@ -2,6 +2,7 @@ config BR2_PACKAGE_HIFIBERRY_UPDATER bool "hifiberry-updater" help "Update tools for HiFiBerryOS" + depends on BR2_PACKAGE_RPI_FIRMWARE select BR2_PACKAGE_E2FSPROGS select BR2_PACKAGE_E2FSPROGS_RESIZE2FS select BR2_PACKAGE_LIBCURL diff --git a/buildroot/package/hifiberry-updater/hifiberry-updater.mk b/buildroot/package/hifiberry-updater/hifiberry-updater.mk index 6ef59578..9e0e1da2 100644 --- a/buildroot/package/hifiberry-updater/hifiberry-updater.mk +++ b/buildroot/package/hifiberry-updater/hifiberry-updater.mk @@ -11,8 +11,12 @@ define HIFIBERRY_UPDATER_INSTALL_TARGET_CMDS $(TARGET_DIR)/opt/hifiberry/bin $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_HIFIBERRY_PATH)/package/hifiberry-updater/extract-update \ $(TARGET_DIR)/opt/hifiberry/bin + $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_HIFIBERRY_PATH)/package/hifiberry-updater/update-firmware \ + $(TARGET_DIR)/opt/hifiberry/bin $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_HIFIBERRY_PATH)/package/hifiberry-updater/partitions \ $(TARGET_DIR)/opt/hifiberry/bin + $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_HIFIBERRY_PATH)/package/hifiberry-updater/reactivate-previous-release \ + $(TARGET_DIR)/opt/hifiberry/bin $(INSTALL) -D -m 0444 $(BR2_EXTERNAL_HIFIBERRY_PATH)/VERSION \ $(TARGET_DIR)/etc/hifiberry.version $(INSTALL) -D -m 0444 $(BR2_EXTERNAL_HIFIBERRY_PATH)/PIVERSION \ @@ -33,4 +37,33 @@ endef define HIFIBERRY_UPDATER_INSTALL_INIT_SYSTEMD endef +### +### Add more functions to RPI firmware +### +ifeq ($(BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4),y) +define RPI_INSTALL_FIRMWARE + echo "Pi 4" + $(INSTALL) -D -m 0644 $(@D)/boot/start4$(BR2_PACKAGE_RPI_FIRMWARE_BOOT).elf $(TARGET_DIR)/usr/lib/firmware/rpi/start4.elf + $(INSTALL) -D -m 0644 $(@D)/boot/fixup4$(BR2_PACKAGE_RPI_FIRMWARE_BOOT).dat $(TARGET_DIR)/usr/lib/firmware/rpi/fixup4.dat + +endef +else +define RPI_INSTALL_FIRMWARE + echo "Pi < 4" + $(INSTALL) -D -m 0644 $(@D)/boot/start$(BR2_PACKAGE_RPI_FIRMWARE_BOOT).elf $(TARGET_DIR)/usr/lib/firmware/rpi/start.elf + $(INSTALL) -D -m 0644 $(@D)/boot/fixup$(BR2_PACKAGE_RPI_FIRMWARE_BOOT).dat $(TARGET_DIR)/usr/lib/firmware/rpi/fixup.dat + +endef +endif + +define RPI_INSTALL_OVERLAYS + echo "Installing overlays" + for ovldtb in $(@D)/boot/overlays/*.dtbo; do \ + $(INSTALL) -D -m 0644 $${ovldtb} $(TARGET_DIR)/usr/lib/firmware/rpi/overlays/$${ovldtb##*/} || exit 1; \ + done +endef + +RPI_FIRMWARE_INSTALL_TARGET_CMDS += $(RPI_INSTALL_FIRMWARE) +RPI_FIRMWARE_INSTALL_TARGET_CMDS += $(RPI_INSTALL_OVERLAYS) + $(eval $(generic-package)) diff --git a/buildroot/package/hifiberry-updater/reactivate-previous-release b/buildroot/package/hifiberry-updater/reactivate-previous-release new file mode 100644 index 00000000..a4ffff1f --- /dev/null +++ b/buildroot/package/hifiberry-updater/reactivate-previous-release @@ -0,0 +1,35 @@ +#!/bin/bash +PART=`/opt/hifiberry/bin/partitions | awk '{print $2}'` +if [ ! -f /boot/zImage.bak ]; then + echo "No previous release found, aborting..." + exit 1 +fi +if [ "$PART" == "/dev/mmcblk0p3" ]; then + P=$PART +fi +if [ "$PART" == "/dev/mmcblk0p2" ]; then + P=$PART +fi + +if [ "$P" == "" ]; then + echo "Unknown backup partition $PART, aborting..." + exit 1 +fi + +mount -o remount,rw /boot +echo "activating $P" +echo "root=$P rootwait console=tty5 systemd.show_status=0 quiet splash" > /boot/cmdline.txt +mv /boot/zImage.bak /boot/zImage +umount /newroot 2>/dev/null +if [ ! -d /oldroot ]; then + mkdir /oldroot +fi +mount $P /oldroot +# Disable automatic updates +echo > /etc/updater.release +umount /oldroot + +sync +reboot + + diff --git a/buildroot/package/hifiberry-updater/update-firmware b/buildroot/package/hifiberry-updater/update-firmware new file mode 100644 index 00000000..14474532 --- /dev/null +++ b/buildroot/package/hifiberry-updater/update-firmware @@ -0,0 +1,5 @@ +#!/bin/bash +mount -o remount,rw /boot +cp -rv /usr/lib/firmware/rpi/* /boot +sync +reboot diff --git a/buildroot/package/raat/configure-raat b/buildroot/package/raat/configure-raat index 7b9fbd63..66894ecd 100644 --- a/buildroot/package/raat/configure-raat +++ b/buildroot/package/raat/configure-raat @@ -44,7 +44,7 @@ elif [ "$CARD" == "Digi+" ]; then if [ "$DIGIFIXED" == "1" ]; then VOLCTL="" else - VOLCTL='"volume": { "type": "alsa", "name": "softvol", "device": "default" },' + VOLCTL='"volume": { "type": "alsa", "optional": "false", "device":"default", "index":0, "name":"Softvol" },' fi # DOP not supported on HiFiBerryOS DSD="" diff --git a/configs/hifiberryos b/configs/hifiberryos index b0c02c06..1bc9eb30 100644 --- a/configs/hifiberryos +++ b/configs/hifiberryos @@ -42,10 +42,13 @@ BR2_arm=y # BR2_x86_64 is not set # BR2_xtensa is not set BR2_ARCH_HAS_TOOLCHAIN_BUILDROOT=y +BR2_ARCH_NEEDS_GCC_AT_LEAST_4_8=y +BR2_ARCH_NEEDS_GCC_AT_LEAST_4_9=y +BR2_ARCH_NEEDS_GCC_AT_LEAST_5=y BR2_ARCH="arm" BR2_ENDIAN="LITTLE" BR2_GCC_TARGET_ABI="aapcs-linux" -BR2_GCC_TARGET_CPU="cortex-a53" +BR2_GCC_TARGET_CPU="cortex-a72" BR2_GCC_TARGET_FPU="neon-vfpv4" BR2_GCC_TARGET_FLOAT_ABI="hard" BR2_GCC_TARGET_MODE="arm" @@ -112,10 +115,10 @@ BR2_ARM_CPU_ARMV8A=y # # BR2_cortex_a32 is not set # BR2_cortex_a35 is not set -BR2_cortex_a53=y +# BR2_cortex_a53 is not set # BR2_cortex_a57 is not set # BR2_cortex_a57_a53 is not set -# BR2_cortex_a72 is not set +BR2_cortex_a72=y # BR2_cortex_a72_a53 is not set # BR2_cortex_a73 is not set # BR2_cortex_a73_a35 is not set @@ -171,7 +174,7 @@ BR2_BZCAT="bzcat" BR2_XZCAT="xzcat" BR2_LZCAT="lzip -d -c" BR2_TAR_OPTIONS="" -BR2_DEFCONFIG="/home/matuschd/buildroot-2019.08-rc3/configs/raspberrypi3_defconfig" +BR2_DEFCONFIG="/home/matuschd/buildroot-2019.08-rc3/configs/raspberrypi4_defconfig" BR2_DL_DIR="$(TOPDIR)/dl" BR2_HOST_DIR="$(BASE_DIR)/host" @@ -479,9 +482,9 @@ BR2_TARGET_TZ_ZONELIST="default" BR2_TARGET_LOCALTIME="Etc/UTC" BR2_ROOTFS_USERS_TABLES="" BR2_ROOTFS_OVERLAY="../hifiberry-os/buildroot/board/raspberrypi3/overlay/" -BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi3/post-build.sh" +BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi4/post-build.sh" BR2_ROOTFS_POST_FAKEROOT_SCRIPT="" -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi3/post-image.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi4/post-image.sh" BR2_ROOTFS_POST_SCRIPT_ARGS="--add-miniuart-bt-overlay" # @@ -496,13 +499,13 @@ BR2_LINUX_KERNEL_CUSTOM_TARBALL=y # BR2_LINUX_KERNEL_CUSTOM_GIT is not set # BR2_LINUX_KERNEL_CUSTOM_HG is not set # BR2_LINUX_KERNEL_CUSTOM_SVN is not set -BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,64d0a9870ac14d5eb5253f67d984ae348eec1393)/linux-64d0a9870ac14d5eb5253f67d984ae348eec1393.tar.gz" +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,64d0a9870ac14d5eb5253f67d984ae348eec1393)/64d0a9870ac14d5eb5253f67d984ae348eec1393.tar.gz" BR2_LINUX_KERNEL_VERSION="custom" BR2_LINUX_KERNEL_PATCH="" BR2_LINUX_KERNEL_USE_DEFCONFIG=y # BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG is not set # BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG is not set -BR2_LINUX_KERNEL_DEFCONFIG="bcm2709" +BR2_LINUX_KERNEL_DEFCONFIG="bcm2711" BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="" BR2_LINUX_KERNEL_CUSTOM_LOGO_PATH="" # BR2_LINUX_KERNEL_UIMAGE is not set @@ -518,7 +521,7 @@ BR2_LINUX_KERNEL_GZIP=y # BR2_LINUX_KERNEL_XZ is not set BR2_LINUX_KERNEL_DTS_SUPPORT=y # BR2_LINUX_KERNEL_DTB_IS_SELF_BUILT is not set -BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2710-rpi-3-b bcm2710-rpi-3-b-plus bcm2710-rpi-cm3" +BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2711-rpi-4-b" BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="" # BR2_LINUX_KERNEL_DTB_OVERLAY_SUPPORT is not set # BR2_LINUX_KERNEL_INSTALL_TARGET is not set @@ -944,7 +947,7 @@ BR2_PACKAGE_BZIP2=y # BR2_PACKAGE_UNRAR is not set # BR2_PACKAGE_UNZIP is not set # BR2_PACKAGE_XZ is not set -# BR2_PACKAGE_ZIP is not set +BR2_PACKAGE_ZIP=y # BR2_PACKAGE_ZSTD is not set # @@ -1257,8 +1260,8 @@ BR2_PACKAGE_QT5_JSCORE_AVAILABLE=y # BR2_PACKAGE_MURATA_CYW_FW is not set BR2_PACKAGE_RPI_BT_FIRMWARE=y BR2_PACKAGE_RPI_FIRMWARE=y -BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI=y -# BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4 is not set +# BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI is not set +BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4=y BR2_PACKAGE_RPI_FIRMWARE_DEFAULT=y # BR2_PACKAGE_RPI_FIRMWARE_X is not set # BR2_PACKAGE_RPI_FIRMWARE_CD is not set @@ -1286,8 +1289,6 @@ BR2_PACKAGE_RPI_WIFI_FIRMWARE=y # BR2_PACKAGE_CBOOTIMAGE is not set # BR2_PACKAGE_CC_TOOL is not set # BR2_PACKAGE_CDRKIT is not set -BR2_PACKAGE_CPUBURN_ARM_ARCH_SUPPORTS=y -# BR2_PACKAGE_CPUBURN_ARM is not set # BR2_PACKAGE_CRYPTSETUP is not set # BR2_PACKAGE_CWIID is not set # BR2_PACKAGE_DAHDI_LINUX is not set @@ -1373,9 +1374,9 @@ BR2_PACKAGE_PARTED=y # BR2_PACKAGE_POWERTOP is not set # BR2_PACKAGE_PPS_TOOLS is not set # BR2_PACKAGE_PRU_SOFTWARE_SUPPORT is not set -# BR2_PACKAGE_RASPI_GPIO is not set +BR2_PACKAGE_RASPI_GPIO=y # BR2_PACKAGE_READ_EDID is not set -# BR2_PACKAGE_RNG_TOOLS is not set +BR2_PACKAGE_RNG_TOOLS=y # BR2_PACKAGE_RPI_USERLAND is not set # BR2_PACKAGE_RS485CONF is not set # BR2_PACKAGE_RTC_TOOLS is not set @@ -2024,7 +2025,7 @@ BR2_PACKAGE_LIBCONFIG=y # BR2_PACKAGE_LIBFUSE is not set BR2_PACKAGE_LIBLOCKFILE=y # BR2_PACKAGE_LIBNFS is not set -# BR2_PACKAGE_LIBSYSFS is not set +BR2_PACKAGE_LIBSYSFS=y # BR2_PACKAGE_LOCKDEV is not set # BR2_PACKAGE_PHYSFS is not set @@ -2199,7 +2200,7 @@ BR2_PACKAGE_GNU_EFI_ARCH_SUPPORTS=y # BR2_PACKAGE_GNU_EFI is not set # BR2_PACKAGE_HACKRF is not set # BR2_PACKAGE_HIDAPI is not set -# BR2_PACKAGE_JITTERENTROPY_LIBRARY is not set +BR2_PACKAGE_JITTERENTROPY_LIBRARY=y # BR2_PACKAGE_LCDAPI is not set # BR2_PACKAGE_LET_ME_CREATE is not set # BR2_PACKAGE_LIBAIO is not set @@ -4309,3 +4310,4 @@ HIFIBERRY_TEST_NONE=y # HIFIBERRY_TEST_DACADCPRO is not set # HIFIBERRY_TEST_DSPDACADC is not set # HIFIBERRY_TEST_USB is not set +# BR2_PACKAGE_CPUBURN_ARM is not set