Skip to content

Commit

Permalink
board: bcm2712: bcm2712-rpi-5-b
Browse files Browse the repository at this point in the history
Added board rpi-5-b (preliminary)
NOTE: I don't have the unit for testing.

Signed-off-by: Patrick Yavitz <pyavitz@xxxxx.com>
  • Loading branch information
Patrick Yavitz committed Oct 2, 2023
1 parent ae9e53e commit add4f9f
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 8 deletions.
37 changes: 37 additions & 0 deletions 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}"
2 changes: 1 addition & 1 deletion lib/function/patching
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/function/universal
Expand Up @@ -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
}
Expand All @@ -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 ""
Expand Down
8 changes: 7 additions & 1 deletion packaging/builddeb
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/stage1
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions scripts/stage2
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit add4f9f

Please sign in to comment.