xref: /freebsd/release/arm64/RPI.conf (revision ebacd8013fe5f7fdf9f6a5b286f6680dd2891036)
1#!/bin/sh
2#
3# $FreeBSD$
4#
5
6DTB_DIR="/usr/local/share/rpi-firmware"
7DTB="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"
8EMBEDDED_TARGET_ARCH="aarch64"
9EMBEDDED_TARGET="arm64"
10EMBEDDEDBUILD=1
11EMBEDDEDPORTS="sysutils/u-boot-rpi-arm64 sysutils/rpi-firmware"
12FAT_SIZE="50m -b 1m"
13FAT_TYPE="16"
14IMAGE_SIZE="5120M"
15KERNEL="GENERIC"
16MD_ARGS="-x 63 -y 255"
17OL_DIR="${DTB_DIR}/overlays"
18OVERLAYS="mmc.dtbo pwm.dtbo disable-bt.dtbo"
19PART_SCHEME="MBR"
20export BOARDNAME="RPI"
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