xref: /freebsd/release/arm64/RPI.conf (revision 6137b5f7b8c183ee8806d79b3f1d8e5e3ddb3df3)
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"
20CONFIG_POWERD_ENABLE=1
21
22arm_install_uboot() {
23	UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi-arm64"
24	UBOOT_FILES="README u-boot.bin"
25	DTB_FILES="armstub8.bin armstub8-gic.bin bootcode.bin fixup_cd.dat \
26		fixup_db.dat fixup_x.dat fixup.dat LICENCE.broadcom \
27		start_cd.elf start_db.elf start_x.elf start.elf \
28		fixup4.dat fixup4cd.dat fixup4db.dat fixup4x.dat start4.elf \
29		start4cd.elf start4db.elf start4x.elf ${DTB}"
30	FATMOUNT="${DESTDIR%${KERNEL}}fat"
31	chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}"
32	chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT}
33	for _UF in ${UBOOT_FILES}; do
34		chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/${_UF} \
35			${FATMOUNT}/${_UF}
36	done
37	for _DF in ${DTB_FILES}; do
38		chroot ${CHROOTDIR} cp -p ${DTB_DIR}/${_DF} \
39			${FATMOUNT}/${_DF}
40	done
41	chroot ${CHROOTDIR} cp -p ${DTB_DIR}/config_arm64.txt \
42			${FATMOUNT}/config.txt
43	chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/overlays
44	for _OL in ${OVERLAYS}; do
45		chroot ${CHROOTDIR} cp -p ${OL_DIR}/${_OL} \
46			${FATMOUNT}/overlays/${_OL}
47	done
48
49	sync
50	umount_loop ${CHROOTDIR}/${FATMOUNT}
51	chroot ${CHROOTDIR} rmdir ${FATMOUNT}
52
53	return 0
54}
55