Skip to content

Commit

Permalink
Update to new RaspberryPi firware
Browse files Browse the repository at this point in the history
commit 0c01dbefba45a08c47f8538d5a071a0fba6b7e83
Author: popcornmix <[email protected]>
Date:   Wed Dec 11 15:30:08 2019 +0000

and include firmware for RPI4

Firmware has bee updated to support mainline linux kernels as described in
raspberrypi/linux#3237
  • Loading branch information
skrll committed Dec 16, 2019
1 parent 398be80 commit bc5e019
Show file tree
Hide file tree
Showing 18 changed files with 33 additions and 101 deletions.
12 changes: 4 additions & 8 deletions distrib/evbarm/instkernel/instkernel/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.32 2019/08/12 08:04:28 martin Exp $
# $NetBSD: Makefile,v 1.33 2019/12/16 11:00:30 skrll Exp $

.include <bsd.own.mk>
.include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
Expand All @@ -14,21 +14,17 @@ MDSETTARGETS=
.for i in ${BUILD_KERNELS:M*_INSTALL}
.if ${i} == "RPI_INSTALL"
MDSETTARGETS+= ${i} ${SSHRAMDISK} netbsd-${i}
MDSET_SUFFIXES.netbsd-${i}= bin create-bin img create-img
MDSET_.RPI_INSTALL.netbsd-RPI_INSTALL.img.deps= netbsd-RPI_INSTALL.bin
MDSET_SUFFIXES.netbsd-${i}= img create-img
.else
MDSETTARGETS+= ${i} ${RAMDISK} -
.endif
.endfor

MDSET_RELEASEDIR= installation/instkernel

MDSET_SUFFIXES.-= srec create-srec bin create-bin
MDSET_SUFFIXES.-= srec create-srec img create-img
create-srec= ${OBJCOPY} -O srec ${.TARGET:R} ${.TARGET}
create-bin= ${OBJCOPY} -O binary ${.TARGET:R} ${.TARGET}
create-img= \
${HOST_SH} ${NETBSDSRCDIR}/sys/arch/evbarm/compile/rpi-mkknlimg.sh \
${.TARGET:R}.bin ${.TARGET}
create-img= ${OBJCOPY} -O binary ${.TARGET:R} ${.TARGET}

.include "${DISTRIBDIR}/common/Makefile.mdset"

Expand Down
7 changes: 5 additions & 2 deletions distrib/utils/embedded/conf/arm64.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: arm64.conf,v 1.7 2019/12/16 08:01:20 skrll Exp $
# $NetBSD: arm64.conf,v 1.8 2019/12/16 11:00:30 skrll Exp $
# ARM64 customization script used by mkimage
#
board=arm64
Expand Down Expand Up @@ -67,13 +67,16 @@ populate_rockchip() {

populate_rpi() {
firmwaredir="${src}/external/broadcom/rpi-firmware/dist"
firmwarefiles="LICENCE.broadcom bootcode.bin fixup.dat fixup_cd.dat start.elf start_cd.elf"
firmwarefiles="LICENCE.broadcom bootcode.bin fixup4cd.dat fixup4.dat fixup_cd.dat fixup.dat start4cd.elf start4.elf start_cd.elf start.elf"

cat > "${mnt}/boot/cmdline.txt" << EOF
root=ld0a console=${console}
EOF

cat > "${mnt}/boot/config.txt" << EOF
#
upstream_kernel=1
#
arm_64bit=1
kernel=netbsd.img
kernel_address=0x200000
Expand Down
4 changes: 3 additions & 1 deletion distrib/utils/embedded/conf/armv7.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: armv7.conf,v 1.39 2019/10/30 21:43:42 jmcneill Exp $
# $NetBSD: armv7.conf,v 1.40 2019/12/16 11:00:30 skrll Exp $
# ARMv7 customization script used by mkimage
#
board=armv7
Expand Down Expand Up @@ -63,6 +63,8 @@ root=ld0a console=${console}
EOF

cat > ${mnt}/boot/config.txt << EOF
#
upstream_kernel=1
# Boot options, see https://www.raspberrypi.org/documentation/configuration/config-txt/boot.md
kernel_address=0x01000040
# UART settings, see https://www.raspberrypi.org/documentation/configuration/uart.md
Expand Down
8 changes: 5 additions & 3 deletions distrib/utils/embedded/conf/rpi.conf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# $NetBSD: rpi.conf,v 1.34 2017/12/12 21:00:28 jmcneill Exp $
# $NetBSD: rpi.conf,v 1.35 2019/12/16 11:00:30 skrll Exp $
# Raspberry Pi customization script used by mkimage
#

board=rpi
kerneldir=$src/sys/arch/evbarm/compile/RPI/
kernel=$kerneldir/netbsd-RPI.img
kernel=$kerneldir/netbsd-RPI.bin
kernels_rpi="RPI RPI2"
resize=true

Expand Down Expand Up @@ -47,7 +47,7 @@ EOF
}

populate() {
rpi2_kernel="$(echo $kernel | sed 's/RPI/RPI2/g')"
rpi2_kernel="$(echo $kernel | sed -e 's/RPI/RPI2/g')"

cat > ${mnt}/boot/cmdline.txt << EOF
root=ld0a console=fb
Expand All @@ -56,6 +56,8 @@ root=ld0a console=fb
EOF

cat > ${mnt}/boot/config.txt << EOF
#
upstream_kernel=1
# UART settings, see https://www.raspberrypi.org/documentation/configuration/uart.md
enable_uart=1
force_turbo=0
Expand Down
4 changes: 3 additions & 1 deletion distrib/utils/embedded/conf/rpi_inst.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: rpi_inst.conf,v 1.11 2017/12/14 06:29:15 skrll Exp $
# $NetBSD: rpi_inst.conf,v 1.12 2019/12/16 11:00:30 skrll Exp $
# Raspberry Pi customization script used by mkimage
#

Expand Down Expand Up @@ -99,9 +99,11 @@ EOF
echo "${bar} installing kernel ${bar}"
case ${kernel} in
*.gz)
echo " ${kernel} uncompressed to kernel.img"
${GZIP_CMD} -dc ${kernel} > ${mnt}/boot/kernel.img
;;
*)
echo " ${kernel} copied"
cp ${kernel} ${mnt}/boot/kernel.img
;;
esac || fail "copy of ${kernel} to ${mnt}/boot/kernel.img failed"
Expand Down
Binary file modified external/broadcom/rpi-firmware/dist/bootcode.bin
Binary file not shown.
Binary file modified external/broadcom/rpi-firmware/dist/fixup.dat
Binary file not shown.
Binary file added external/broadcom/rpi-firmware/dist/fixup4.dat
Binary file not shown.
Binary file added external/broadcom/rpi-firmware/dist/fixup4cd.dat
Binary file not shown.
Binary file modified external/broadcom/rpi-firmware/dist/fixup_cd.dat
Binary file not shown.
Binary file modified external/broadcom/rpi-firmware/dist/start.elf
Binary file not shown.
Binary file added external/broadcom/rpi-firmware/dist/start4.elf
Binary file not shown.
Binary file added external/broadcom/rpi-firmware/dist/start4cd.elf
Binary file not shown.
Binary file modified external/broadcom/rpi-firmware/dist/start_cd.elf
Binary file not shown.
61 changes: 0 additions & 61 deletions sys/arch/evbarm/compile/rpi-mkknlimg.sh

This file was deleted.

19 changes: 7 additions & 12 deletions sys/arch/evbarm/conf/mk.generic
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: mk.generic,v 1.8 2019/04/14 07:57:51 skrll Exp $
# $NetBSD: mk.generic,v 1.9 2019/12/16 11:00:30 skrll Exp $

.include "$S/arch/arm/nvidia/tegra_xusb-fw.mk"

Expand All @@ -17,16 +17,11 @@ MKUBOOTIMAGEARGS= -A arm -T kernel_noload -O linux -C none
MKUBOOTIMAGEARGS+= -e 0
MKUBOOTIMAGEARGS+= -n "NetBSD/${BOARDTYPE:U${MACHINE_ARCH}} ${_OSRELEASE}"

MKKNLIMG= ${THISARM}/compile/rpi-mkknlimg.sh

SYSTEM_LD_TAIL_EXTRA+=; \
echo ${OBJCOPY} -S -O binary $@ [email protected]; \
${OBJCOPY} -S -O binary $@ [email protected]; \
echo ${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS} [email protected] [email protected]; \
${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS} [email protected] [email protected]; \
echo ${MKKNLIMG} [email protected] [email protected]; \
${HOST_SH} ${MKKNLIMG} [email protected] [email protected];

EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.bin@}
EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.ub@}
echo ${OBJCOPY} -S -O binary $@ [email protected]; \
${OBJCOPY} -S -O binary $@ [email protected]; \
echo ${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS} [email protected] [email protected]; \
${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS} [email protected] [email protected]

EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.img@}
EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.ub@}
9 changes: 3 additions & 6 deletions sys/arch/evbarm/conf/mk.generic64
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: mk.generic64,v 1.4 2019/12/04 11:25:04 jmcneill Exp $
# $NetBSD: mk.generic64,v 1.5 2019/12/16 11:00:30 skrll Exp $

SYSTEM_FIRST_OBJ= start.o
SYSTEM_FIRST_SFILE= ${ARM}/aarch64/start.S
Expand All @@ -8,14 +8,11 @@ _OSRELEASE!= ${HOST_SH} $S/conf/osrelease.sh
BOARDTYPE= evbarm64

MKUBOOTIMAGEARGS= -f arm64 -u -a 0x200000
MKKNLIMG= ${THISARM}/compile/rpi-mkknlimg.sh

SYSTEM_LD_TAIL_EXTRA+= && \
echo ${OBJCOPY} -S -O binary $@ [email protected] && \
${OBJCOPY} -S -O binary $@ [email protected] && \
echo ${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS} [email protected] [email protected] && \
${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS} [email protected] [email protected] && \
echo ${MKKNLIMG} [email protected] [email protected] && \
${HOST_SH} ${MKKNLIMG} [email protected] [email protected]
echo ${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS} [email protected] [email protected] && \
${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS} [email protected] [email protected]

EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.img@}
10 changes: 3 additions & 7 deletions sys/arch/evbarm/conf/mk.rpi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: mk.rpi,v 1.6 2018/10/18 09:01:54 skrll Exp $
# $NetBSD: mk.rpi,v 1.7 2019/12/16 11:00:30 skrll Exp $

SYSTEM_FIRST_OBJ= armv6_start.o
SYSTEM_FIRST_SFILE= ${ARM}/arm/armv6_start.S
Expand All @@ -8,12 +8,8 @@ _OSRELEASE!= ${HOST_SH} $S/conf/osrelease.sh
KERNEL_BASE_PHYS=0x00008000
KERNEL_BASE_VIRT=0x80008000

MKKNLIMG= ${THISARM}/compile/rpi-mkknlimg.sh

SYSTEM_LD_TAIL_EXTRA+=; \
echo ${OBJCOPY} -S -O binary $@ [email protected]; \
${OBJCOPY} -S -O binary $@ [email protected]; \
echo ${MKKNLIMG} [email protected] [email protected]; \
${HOST_SH} ${MKKNLIMG} [email protected] [email protected];
${OBJCOPY} -S -O binary $@ [email protected];

EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.img@}
EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.bin@}

0 comments on commit bc5e019

Please sign in to comment.