===== FreeBSD on Arndale Board =====
Arndale Board (''%%http://www.arndaleboard.org%%'') is the evaluation board built by [[http://www.insignal.co.kr/|Insignal]] - the partner company to Samsung.
The board is based on [[http://www.samsung.com/global/business/semiconductor/minisite/Exynos/products5dual.html|Samsung Exynos5250 Cortex A15 processor]].
==== Build U-Boot ====
1. Install gsed and some cross-compiler
$ cd /usr/ports/textproc/gsed/
$ sudo make install
$ cd /usr/ports/devel/cross-gcc
$ sudo make TGTARCH=arm TGTABI=none-eabi install
2. Get and patch u-boot
$ git clone git://git.linaro.org/boot/u-boot-linaro-stable.git
$ cd u-boot-linaro-stable
$ vi helper.mk
(replace sed with gsed)
3. Compile u-boot
$ gmake CROSS_COMPILE=arm-none-eabi- arndale5250_config
$ gmake CROSS_COMPILE=arm-none-eabi-
==== Build FreeBSD ====
1. Get %%FreeBSD%% head
2. Compile kernel and world. Install world to USB Flash (replace da0 with your usb storage device)
$ truncate -s 1024M arndale.img
$ sudo mdconfig -f arndale.img -u0
$ sudo newfs /dev/md0
$ sudo mount /dev/md0 /mnt
$ sudo make TARGET_ARCH=armv6 kernel-toolchain
$ sudo make TARGET_ARCH=armv6 KERNCONF=ARNDALE buildkernel
$ sudo make TARGET_ARCH=armv6 buildworld
$ sudo make TARGET_ARCH=armv6 DESTDIR=/mnt installworld distribution
# echo "/dev/da0 / ufs rw,noatime 1 1" > /mnt/etc/fstab
# vi /mnt/etc/ttys (set "vt100 on" to ttyu2)
$ sudo umount /mnt
$ sudo mdconfig -d -u0
$ sudo sysctl kern.geom.debugflags=16
$ sudo dd if=arndale.img of=/dev/da0 bs=4096k
==== Prepare SD card ====
1. Get BL1 binary from ''%%http://releases.linaro.org/12.12/components/kernel/arndale-bl1/arndale-bl1.bin%%'' (broken)
2. Write binaries (replace da4 with your device)
$ sudo dd if=/dev/zero of=/dev/da4 bs=4096k
$ sudo gpart create -s MBR da4
$ sudo gpart add -b 8m -s 32m -t '\!14' da4
$ sudo newfs_msdos /dev/da4s1
$ sudo mount_msdosfs /dev/da4s1 /mnt
$ sudo cp kernel.bin /mnt
$ sudo umount /mnt
$ sudo dd if=arndale-bl1.bin of=/dev/da4 bs=512 seek=1
$ sudo dd if=spl/smdk5250-spl.bin of=/dev/da4 bs=512 seek=17
$ sudo dd if=u-boot.bin of=/dev/da4 bs=512 seek=49 conv=sync
==== Boot ====
1. Set %%SoC%% jumpers to "up up up down up up" to boot from SD card
2. Connect by using serial console cable and speed 115200
$ sudo cu -l /dev/ttyu0 -s 115200
3. Power ON your board and set boot command
ARNDALE5250 # setenv bootcmd "fatload mmc 0:1 0x40f00000 kernel.bin; go 0x40f00000"
ARNDALE5250 # saveenv
ARNDALE5250 # boot