Skip to content
This repository
  • Unwatch
  • Fork

public /crochet-freebsd Octocat-spinner-32

branch: master
file 98 lines (84 sloc) 2.807 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
KERNCONF=IMX6
TARGET_ARCH=armv6
IMAGE_SIZE=$((1024 * 1000 * 1000))
WANDBOARD_UBOOT_SRC=${TOPDIR}/u-boot-2013.10

#
# 3 partitions, a reserve one for uboot, a FAT one for the boot loader and a UFS one
#
# the kernel config (WANDBOARD.common) specifies:
# U-Boot stuff lives on slice 1, FreeBSD on slice 2.
# options ROOTDEVNAME=\"ufs:mmcsd0s2a\"
#
wandboard_partition_image ( ) {
    disk_partition_mbr
    wandboard_uboot_install
    disk_fat_create 50m 32 16384
    disk_ufs_create
}
strategy_add $PHASE_PARTITION_LWW wandboard_partition_image

#
# Wandboard uses U-Boot.
#
wandboard_check_uboot ( ) {
# Crochet needs to build U-Boot.

     uboot_set_patch_version ${WANDBOARD_UBOOT_SRC} ${WANDBOARD_UBOOT_PATCH_VERSION}

        uboot_test \
            WANDBOARD_UBOOT_SRC \
            "$WANDBOARD_UBOOT_SRC/board/wandboard/Makefile"
        strategy_add $PHASE_BUILD_OTHER uboot_patch ${WANDBOARD_UBOOT_SRC} `uboot_patch_files`
        strategy_add $PHASE_BUILD_OTHER uboot_configure $WANDBOARD_UBOOT_SRC wandboard_quad_config
        strategy_add $PHASE_BUILD_OTHER uboot_build $WANDBOARD_UBOOT_SRC
}
strategy_add $PHASE_CHECK wandboard_check_uboot

#
# install uboot
#
wandboard_uboot_install ( ) {
        echo Installing U-Boot to /dev/${DISK_MD}
        dd if=${WANDBOARD_UBOOT_SRC}/u-boot.imx of=/dev/${DISK_MD} bs=512 seek=2
}

#
# ubldr
#
strategy_add $PHASE_BUILD_OTHER freebsd_ubldr_build UBLDR_LOADADDR=0x88000000
strategy_add $PHASE_BOOT_INSTALL freebsd_ubldr_copy_ubldr ubldr

#
# uEnv
#
wandboard_install_uenvtxt(){
    echo "Installing uEnv.txt"
    cp ${BOARDDIR}/files/uEnv.txt .
}
#strategy_add $PHASE_BOOT_INSTALL wandboard_install_uenvtxt

#
# DTS to FAT file system
#
wandboard_install_dts_fat(){
    echo "Installing DTS to FAT"
    freebsd_install_fdt wandboard-quad.dts wandboard-quad.dts
    freebsd_install_fdt wandboard-quad.dts wandboard-quad.dtb
}
#strategy_add $PHASE_BOOT_INSTALL wandboard_install_dts_fat

#
# DTS to UFS file system. This is in PHASE_FREEBSD_BOARD_POST_INSTALL b/c it needs to happen *after* the kernel install
#
wandboard_install_dts_ufs(){
    echo "Installing DTS to UFS"
    freebsd_install_fdt wandboard-quad.dts boot/kernel/wandboard-quad.dts
    freebsd_install_fdt wandboard-quad.dts boot/kernel/wandboard-quad.dtb
}
strategy_add $PHASE_FREEBSD_BOARD_POST_INSTALL wandboard_install_dts_ufs

#
# kernel
#
strategy_add $PHASE_FREEBSD_BOARD_INSTALL board_default_installkernel .
strategy_add $PHASE_FREEBSD_BOARD_INSTALL freebsd_ubldr_copy_ubldr_help boot

#
# Make a /boot/msdos directory so the running image
# can mount the FAT partition. (See overlay/etc/fstab.)
#
strategy_add $PHASE_FREEBSD_BOARD_INSTALL mkdir boot/msdos

#
# build the u-boot scr file
#
strategy_add $PHASE_BOOT_INSTALL uboot_mkimage "files/boot.txt" "boot.scr"

span class="mega-octicon octicon-screen-normal">
Something went wrong with that request. Please try again.