xref: /freebsd/release/arm64/RPI.conf (revision 22cf89c938886d14f5796fc49f9f020c23ea8eaf)
1#!/bin/sh
2#
3#
4
5DTB_DIR="/usr/local/share/rpi-firmware"
6DTB="bcm2710-rpi-2-b.dtb bcm2710-rpi-3-b.dtb bcm2710-rpi-3-b-plus.dtb bcm2710-rpi-cm3.dtb bcm2711-rpi-4-b.dtb"
7EMBEDDED_TARGET_ARCH="aarch64"
8EMBEDDED_TARGET="arm64"
9EMBEDDEDBUILD=1
10EMBEDDEDPORTS="sysutils/u-boot-rpi-arm64 sysutils/rpi-firmware"
11FAT_SIZE="50m -b 1m"
12FAT_TYPE="16"
13IMAGE_SIZE="5120M"
14KERNEL="GENERIC"
15MD_ARGS="-x 63 -y 255"
16OL_DIR="${DTB_DIR}/overlays"
17OVERLAYS="mmc.dtbo pwm.dtbo disable-bt.dtbo"
18PART_SCHEME="MBR"
19export BOARDNAME="RPI"
20
21arm_install_uboot() {
22	UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi-arm64"
23	UBOOT_FILES="README u-boot.bin"
24	DTB_FILES="armstub8.bin armstub8-gic.bin bootcode.bin fixup_cd.dat \
25		fixup_db.dat fixup_x.dat fixup.dat LICENCE.broadcom \
26		start_cd.elf start_db.elf start_x.elf start.elf \
27		fixup4.dat fixup4cd.dat fixup4db.dat fixup4x.dat start4.elf \
28		start4cd.elf start4db.elf start4x.elf ${DTB}"
29	FATMOUNT="${DESTDIR%${KERNEL}}fat"
30	chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}"
31	chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT}
32	for _UF in ${UBOOT_FILES}; do
33		chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/${_UF} \
34			${FATMOUNT}/${_UF}
35	done
36	for _DF in ${DTB_FILES}; do
37		chroot ${CHROOTDIR} cp -p ${DTB_DIR}/${_DF} \
38			${FATMOUNT}/${_DF}
39	done
40	chroot ${CHROOTDIR} cp -p ${DTB_DIR}/config_arm64.txt \
41			${FATMOUNT}/config.txt
42	chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/overlays
43	for _OL in ${OVERLAYS}; do
44		chroot ${CHROOTDIR} cp -p ${OL_DIR}/${_OL} \
45			${FATMOUNT}/overlays/${_OL}
46	done
47
48	sync
49	umount_loop ${CHROOTDIR}/${FATMOUNT}
50	chroot ${CHROOTDIR} rmdir ${FATMOUNT}
51
52	return 0
53}
54