diff --git a/lib/boards/bcm2712 b/lib/boards/bcm2712 new file mode 100644 index 00000000..1b5fccc5 --- /dev/null +++ b/lib/boards/bcm2712 @@ -0,0 +1,37 @@ +#!/bin/bash + +# architecture +ARCH="arm64" +ARCH_EXT="arm64" +DEBARCH="" +CROSS_COMPILE="aarch64-linux-gnu-" +ROOTFS_ARCH="rootfs-${ARCH_EXT}" +STATIC="qemu-aarch64-static" + +# menu +PRETTY_BOARD="Raspberry Pi 5 BCM2712 / ARM64" + +# misc +FAMILY="broadcom" +FAMILY_EXT="" + +# default config +LINUX_DEFCONFIG="bcm2712_defconfig" + +# partitions +OFFSET="8192" +P_VALUE="p2" + +# output +BOARD="bcm2712" +BOARD_EXT="rpi-5" +OUTPUT="output/${BOARD}" +IMG_EXP="${BOARD_EXT}-*.img*" + +# cmdline +CONSOLE="console=serial0,115200 console=tty1" +EXTRA="loglevel=5 net.ifnames=0 firmware_class.path=/lib/firmware/updates/brcm" + +# packaging +KERNEL_IMG="kernel_2712.img" +SERIES="bcm2712-${BOARD_EXT}" diff --git a/lib/function/patching b/lib/function/patching index b4ab2d7d..ee4c3f1d 100644 --- a/lib/function/patching +++ b/lib/function/patching @@ -11,7 +11,7 @@ echo -en "Firmware" echo -en " ${PNK}[${FIN}${WHT}downloading${FIN}${PNK}]${FIN}" aria2c -q ${BINURL}LICENCE.broadcom aria2c -q ${BINURL}COPYING.linux -if [[ "$BOARD_EXT" == "rpi-4" ]]; then +if [[ "$BOARD_EXT" == "rpi-4" || "$BOARD_EXT" == "rpi-5" ]]; then aria2c -q ${BINURL}fixup4.dat aria2c -q ${BINURL}fixup4cd.dat aria2c -q ${BINURL}fixup4db.dat diff --git a/lib/function/universal b/lib/function/universal index 6e1b39e4..d9c7f478 100644 --- a/lib/function/universal +++ b/lib/function/universal @@ -59,7 +59,7 @@ EEPROM_VERSION=$(curl --silent -L ${CHANGELOG} | awk '{if (NR==10) {print substr if [[ `wget -S --spider ${ERURL}rpi-eeprom_${EEPROM_VERSION}.orig.tar.gz 2>&1 | grep 'HTTP/1.1 200 OK'` ]]; then download_eeprom else - EEPROM_VERSION="13.12" + EEPROM_VERSION="16.1" download_eeprom fi } @@ -69,7 +69,7 @@ wget -cq --show-progress ${ERURL}rpi-eeprom_${EEPROM_VERSION}-1.debian.tar.xz wget -cq --show-progress ${ERURL}rpi-eeprom_${EEPROM_VERSION}.orig.tar.gz } -bcm2711_eeprom(){ +eeprom_support(){ ERURL="https://archive.raspberrypi.org/debian/pool/main/r/rpi-eeprom/" CHANGELOG="https://raw.githubusercontent.com/raspberrypi/rpi-eeprom/debian/bullseye/debian/changelog" echo "" diff --git a/packaging/builddeb b/packaging/builddeb index c211d6dc..139184cb 100755 --- a/packaging/builddeb +++ b/packaging/builddeb @@ -170,7 +170,7 @@ fi # Install dtbs if [ -d $tmpdir/$boot_path ]; then :; else mkdir -p "$tmpdir/$boot_path"; fi -if [ "$board_series" = "rpi-4" ]; then +if [ "$board_series" = "rpi-4" ] || [ "$board_series" = "rpi-5" ]; then # path 1 if [ -f $tmpdir/usr/lib/$linux_packagename/bcm2711-rpi-4-b.dtb ]; then cp -r "$tmpdir/usr/lib/$linux_packagename/bcm2711-rpi-4-b.dtb" "$tmpdir/$boot_path/bcm2711-rpi-4-b.dtb" @@ -184,6 +184,9 @@ if [ "$board_series" = "rpi-4" ]; then if [ -f $tmpdir/usr/lib/$linux_packagename/bcm2711-rpi-cm4s.dtb ]; then cp -r "$tmpdir/usr/lib/$linux_packagename/bcm2711-rpi-cm4s.dtb" "$tmpdir/$boot_path/bcm2711-rpi-cm4s.dtb" fi + if [ -f $tmpdir/usr/lib/$linux_packagename/bcm2712-rpi-5-b.dtb ]; then + cp -r "$tmpdir/usr/lib/$linux_packagename/bcm2712-rpi-5-b.dtb" "$tmpdir/$boot_path/bcm2712-rpi-5-b.dtb" + fi # path 2 if [ -f $tmpdir/usr/lib/$linux_packagename/broadcom/bcm2711-rpi-4-b.dtb ]; then cp -r "$tmpdir/usr/lib/$linux_packagename/broadcom/bcm2711-rpi-4-b.dtb" "$tmpdir/$boot_path/bcm2711-rpi-4-b.dtb" @@ -197,6 +200,9 @@ if [ "$board_series" = "rpi-4" ]; then if [ -f $tmpdir/usr/lib/$linux_packagename/broadcom/bcm2711-rpi-cm4s.dtb ]; then cp -r "$tmpdir/usr/lib/$linux_packagename/broadcom/bcm2711-rpi-cm4s.dtb" "$tmpdir/$boot_path/bcm2711-rpi-cm4s.dtb" fi + if [ -f $tmpdir/usr/lib/$linux_packagename/broadcom/bcm2712-rpi-5-b.dtb ]; then + cp -r "$tmpdir/usr/lib/$linux_packagename/broadcom/bcm2712-rpi-5-b.dtb" "$tmpdir/$boot_path/bcm2712-rpi-5-b.dtb" + fi fi if [ "$board_series" = "rpi-3" ] || [ "$board_series" = "rpi-2+3" ]; then # path 1 diff --git a/scripts/stage1 b/scripts/stage1 index ceb48cf0..c79418f5 100755 --- a/scripts/stage1 +++ b/scripts/stage1 @@ -87,7 +87,7 @@ else exit 0 fi # config dot txt -if [[ "$BOARD_EXT" == "rpi-4" ]]; then +if [[ "$BOARD_EXT" == "rpi-4" || "$BOARD_EXT" == "rpi-5" ]]; then bcm2711_config > /dev/null 2>&1 else ${BOARD}_config > /dev/null 2>&1 diff --git a/scripts/stage2 b/scripts/stage2 index faf1caed..03a7e89c 100755 --- a/scripts/stage2 +++ b/scripts/stage2 @@ -197,7 +197,7 @@ echo "Moving scripts ..." cd ~ mkdir -p /usr/local/bin mkdir -p /usr/local/sbin -if [[ "$BOARD_EXT" == "rpi-4" ]]; then +if [[ "$BOARD_EXT" == "rpi-4" || "$BOARD_EXT" == "rpi-5" ]]; then wget -cq --show-progress ${URL}deb-eeprom mv -f deb-eeprom /usr/local/bin/ fi @@ -331,8 +331,8 @@ rm -fdR pi-bluetooth* rpi_userland # eeprom -if [[ "$BOARD_EXT" == "rpi-4" ]]; then - bcm2711_eeprom +if [[ "$BOARD_EXT" == "rpi-4" || "$BOARD_EXT" == "rpi-5" ]]; then + eeprom_support fi # remove zstd compression (not supported by older kernels)