xref: /freebsd/release/arm/GENERICSD.conf (revision d7d962ead0b6e5e8a39202d0590022082bf5bfb6)
1#!/bin/sh
2#
3# $FreeBSD$
4#
5
6EMBEDDED_TARGET_ARCH="armv7"
7EMBEDDED_TARGET="arm"
8EMBEDDEDBUILD=1
9EMBEDDEDPORTS="sysutils/u-boot-beaglebone sysutils/u-boot-rpi2 sysutils/rpi-firmware"
10FAT_SIZE="50m -b 1m"
11FAT_TYPE="16"
12IMAGE_SIZE="3072M"
13KERNEL="GENERIC"
14MD_ARGS="-x 63 -y 255"
15BBB_UBOOT_DIR="/usr/local/share/u-boot/u-boot-beaglebone"
16RPI_UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi2"
17RPI_FIRMWARE_DIR="/usr/local/share/rpi-firmware"
18RPI_OL_DIR="${RPI_FIRMWARE_DIR}/overlays"
19OVERLAYS="mmc.dtbo"
20PART_SCHEME="MBR"
21export BOARDNAME="GENERICSD"
22
23arm_install_uboot_rpi2() {
24	UBOOT_FILES="u-boot.bin"
25	RPI_FIRMWARE_FILES="bootcode.bin config.txt \
26		fixup.dat fixup_cd.dat fixup_db.dat fixup_x.dat \
27		start.elf start_cd.elf start_db.elf start_x.elf \
28		bcm2709-rpi-2-b.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 ${RPI_UBOOT_DIR}/${_UF} \
34			${FATMOUNT}/${_UF}
35	done
36	for _UF in ${RPI_FIRMWARE_FILES}; do
37		chroot ${CHROOTDIR} cp -p ${RPI_FIRMWARE_DIR}/${_UF} \
38			${FATMOUNT}/${_UF}
39	done
40	chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/overlays
41	for _OL in ${OVERLAYS}; do
42		chroot ${CHROOTDIR} cp -p ${RPI_OL_DIR}/${_OL} \
43			${FATMOUNT}/overlays/${_OL}
44	done
45	sync
46	umount_loop ${CHROOTDIR}/${FATMOUNT}
47	chroot ${CHROOTDIR} rmdir ${FATMOUNT}
48
49	return 0
50}
51
52arm_install_uboot_bbb() {
53	FATMOUNT="${DESTDIR%${KERNEL}}/fat"
54	chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}"
55	chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT}
56	chroot ${CHROOTDIR} cp -p ${BBB_UBOOT_DIR}/MLO ${FATMOUNT}/MLO
57	chroot ${CHROOTDIR} cp -p ${BBB_UBOOT_DIR}/u-boot.img ${FATMOUNT}/u-boot.img
58	sync
59	umount_loop ${CHROOTDIR}/${FATMOUNT}
60	chroot ${CHROOTDIR} rmdir ${FATMOUNT}
61
62	return 0
63}
64
65arm_install_uboot() {
66	arm_install_uboot_bbb
67	arm_install_uboot_rpi2
68}
69