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" 15NODOC=1 16BBB_UBOOT_DIR="/usr/local/share/u-boot/u-boot-beaglebone" 17RPI_UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi2" 18RPI_FIRMWARE_DIR="/usr/local/share/rpi-firmware" 19RPI_OL_DIR="${RPI_FIRMWARE_DIR}/overlays" 20OVERLAYS="mmc.dtbo" 21PART_SCHEME="MBR" 22export BOARDNAME="GENERICSD" 23 24arm_install_uboot_rpi2() { 25 UBOOT_FILES="u-boot.bin" 26 RPI_FIRMWARE_FILES="bootcode.bin config.txt \ 27 fixup.dat fixup_cd.dat fixup_db.dat fixup_x.dat \ 28 start.elf start_cd.elf start_db.elf start_x.elf \ 29 bcm2709-rpi-2-b.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 ${RPI_UBOOT_DIR}/${_UF} \ 35 ${FATMOUNT}/${_UF} 36 done 37 for _UF in ${RPI_FIRMWARE_FILES}; do 38 chroot ${CHROOTDIR} cp -p ${RPI_FIRMWARE_DIR}/${_UF} \ 39 ${FATMOUNT}/${_UF} 40 done 41 chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/overlays 42 for _OL in ${OVERLAYS}; do 43 chroot ${CHROOTDIR} cp -p ${RPI_OL_DIR}/${_OL} \ 44 ${FATMOUNT}/overlays/${_OL} 45 done 46 sync 47 umount_loop ${CHROOTDIR}/${FATMOUNT} 48 chroot ${CHROOTDIR} rmdir ${FATMOUNT} 49 50 return 0 51} 52 53arm_install_uboot_bbb() { 54 FATMOUNT="${DESTDIR%${KERNEL}}/fat" 55 chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" 56 chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} 57 chroot ${CHROOTDIR} cp -p ${BBB_UBOOT_DIR}/MLO ${FATMOUNT}/MLO 58 chroot ${CHROOTDIR} cp -p ${BBB_UBOOT_DIR}/u-boot.img ${FATMOUNT}/u-boot.img 59 sync 60 umount_loop ${CHROOTDIR}/${FATMOUNT} 61 chroot ${CHROOTDIR} rmdir ${FATMOUNT} 62 63 return 0 64} 65 66arm_install_uboot() { 67 arm_install_uboot_bbb 68 arm_install_uboot_rpi2 69} 70