Skip to content

Commit

Permalink
add rpi-firmware
Browse files Browse the repository at this point in the history
  • Loading branch information
laffer1 committed Nov 9, 2024
1 parent dab230c commit e03cd37
Show file tree
Hide file tree
Showing 12 changed files with 440 additions and 0 deletions.
1 change: 1 addition & 0 deletions sysutils/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ SUBDIR += qt5-qtdiag
SUBDIR += qt5-qtpaths
SUBDIR += qt5-qtplugininfo
SUBDIR += restic
SUBDIR += rpi-firmware
SUBDIR += rubygem-bundler
SUBDIR += rubygem-fluentd
SUBDIR += scan_ffs
Expand Down
51 changes: 51 additions & 0 deletions sysutils/rpi-firmware/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
PORTNAME= rpi-firmware
PORTVERSION= 1.20230405.g20230405
CATEGORIES= sysutils

MAINTAINER= [email protected]
COMMENT= Firmware for RaspberryPi Single Board Computer
WWW= https://github.com/raspberrypi/firmware

LICENSE= BROADCOM
LICENSE_NAME= Broadcom Corporation
LICENSE_FILE= ${WRKSRC}/boot/LICENCE.broadcom
LICENSE_PERMS= dist-mirror no-dist-sell pkg-mirror no-pkg-sell auto-accept

BUILD_DEPENDS= aarch64-none-elf-gcc:devel/aarch64-none-elf-gcc

USE_GITHUB= yes

GH_ACCOUNT= raspberrypi freebsd:pscimon
GH_PROJECT= firmware rpi3-psci-monitor:pscimon
FW_TAG= 055e044
PSCI_TAG= 558620c
GH_TAGNAME= ${FW_TAG} ${PSCI_TAG}:pscimon

BUILD_WRKSRC= ${WRKSRC_pscimon}
INSTALL_DIR= ${PREFIX}/share/${PORTNAME}

CONFIG_TXT_FILES= config.txt \
config_rpi_0_w.txt \
config_rpi3.txt \
config_rpi3_edk2.txt \
config_rpi4.txt \
config_arm64.txt

do-patch:
.for i in ${CONFIG_TXT_FILES}
${CP} ${FILESDIR}/${i} ${WRKSRC}/boot/
.endfor

post-patch:
${RM} ${WRKSRC}/boot/kernel.img
${RM} ${WRKSRC}/boot/kernel7.img
${RM} ${WRKSRC}/boot/kernel7l.img
${RM} ${WRKSRC}/boot/kernel8.img

do-install:
${MKDIR} ${STAGEDIR}/${INSTALL_DIR}
cd ${WRKSRC}/boot && ${COPYTREE_SHARE} . ${STAGEDIR}/${INSTALL_DIR}/
${INSTALL_DATA} ${WRKSRC_pscimon}/armstub8.bin \
${WRKSRC_pscimon}/armstub8-gic.bin ${STAGEDIR}/${INSTALL_DIR}/

.include <bsd.port.mk>
5 changes: 5 additions & 0 deletions sysutils/rpi-firmware/distinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
TIMESTAMP = 1691574416
SHA256 (raspberrypi-firmware-1.20230405.g20230405-055e044_GH0.tar.gz) = a45b7c6e726f14007399ca7b76560bf434734f29b0c1867d5842ef6ecfe200fd
SIZE (raspberrypi-firmware-1.20230405.g20230405-055e044_GH0.tar.gz) = 187673952
SHA256 (freebsd-rpi3-psci-monitor-558620c_GH0.tar.gz) = 7621db7933eedaa17a03c282ef8a50be597bd14366149dfa93172d1b3985dbb7
SIZE (freebsd-rpi3-psci-monitor-558620c_GH0.tar.gz) = 5614
5 changes: 5 additions & 0 deletions sysutils/rpi-firmware/files/config.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
init_uart_clock=3000000
enable_uart=1
kernel=u-boot.bin
kernel7=u-boot.bin
dtoverlay=mmc
11 changes: 11 additions & 0 deletions sysutils/rpi-firmware/files/config_arm64.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[all]
arm_64bit=1
dtparam=audio=on,i2c_arm=on,spi=on
dtoverlay=mmc
dtoverlay=disable-bt
device_tree_address=0x4000
kernel=u-boot.bin

[pi4]
hdmi_safe=1
armstub=armstub8-gic.bin
7 changes: 7 additions & 0 deletions sysutils/rpi-firmware/files/config_rpi3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
arm_64bit=1
dtparam=audio=on,i2c_arm=on,spi=on
dtoverlay=mmc
dtoverlay=pwm
dtoverlay=disable-bt
device_tree_address=0x4000
kernel=u-boot.bin
8 changes: 8 additions & 0 deletions sysutils/rpi-firmware/files/config_rpi3_edk2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
arm_64bit=1
disable_commandline_tags=2
disable_overscan=1
enable_uart=1
uart_2ndstage=1
armstub=RPI_EFI.fd
device_tree_address=0x1f0000
device_tree_end=0x200000
7 changes: 7 additions & 0 deletions sysutils/rpi-firmware/files/config_rpi4.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
arm_64bit=1
dtoverlay=disable-bt
dtoverlay=mmc
device_tree_address=0x4000
kernel=u-boot.bin
armstub=armstub8-gic.bin
hdmi_safe=1
6 changes: 6 additions & 0 deletions sysutils/rpi-firmware/files/config_rpi_0_w.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
init_uart_clock=3000000
enable_uart=1
kernel=u-boot.bin
kernel7=u-boot.bin
dtoverlay=mmc
dtoverlay=disable-bt
1 change: 1 addition & 0 deletions sysutils/rpi-firmware/pkg-descr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Firmware files for RaspberryPi Single Board Computer
15 changes: 15 additions & 0 deletions sysutils/rpi-firmware/pkg-message
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[
{ type: install
message: <<EOM
The rpi-firmware package installs files to /usr/local/share/rpi-firmware/.
To update the firmware used to boot, copy these files to /boot/msdos,
and then copy the appropriate config_<type>.txt file to
/boot/msdos/config.txt.

For example, on a Raspberry Pi 4 Model B,

cp -pr /usr/local/share/rpi-firmware/* /boot/msdos/
cp /boot/msdos/config_rpi4.txt /boot/msdos/config.txt
EOM
}
]
Loading

0 comments on commit e03cd37

Please sign in to comment.