FreeBSD on Toradex Colibri VF50/60

Toradex is a Switzerland company produces ARM hardware and software.

This manual describes procedures how to run FreeBSD on Colibri VF50 Development Kit.

Build

1. Under FreeBSD, checkout latest source

# svnlite co http://svn.freebsd.org/base/head ~/src

2. Compile FreeBSD

# cd ~/src
# make TARGET_ARCH=armv6 kernel-toolchain
# make TARGET_ARCH=armv6 KERNCONF=COLIBRI-VF50 buildkernel
# make TARGET_ARCH=armv6 buildworld

3. Create USB image

# truncate -s 1024M colibri.img
# mdconfig -f colibri.img -u0
# newfs /dev/md0
# mount /dev/md0 /mnt
# cd ~/src && make TARGET_ARCH=armv6 DESTDIR=/mnt installworld distribution
# echo "/dev/da0 / ufs rw,noatime 1 1" > /mnt/etc/fstab
# vi /mnt/etc/ttys #(enable ttyv0 for display or/and ttyu0 for console)
# umount /mnt
# mdconfig -d -u0

4. Write USB image (replace /dev/da0 with your USB stick device). USB stick is used for booting FreeBSD world.

# sysctl kern.geom.debugflags=16
# dd if=colibri.img of=/dev/da0 bs=4096k 

5. Create SD card image (replace /dev/da4 with your SD device). SD card is used for booting kernel.

# dd if=/dev/zero of=/dev/da4 bs=4096k count=10
# gpart create -s MBR da4
# gpart add -b 8m -s 32m -t '\!14' da4
# newfs_msdos /dev/da4s1
# mount_msdosfs /dev/da4s1 /mnt
# cp /usr/obj/arm.armv6/usr/home/$USER/src/sys/COLIBRI-VF50/kernel.bin /mnt/
# umount /mnt

Boot

1. Connect to serial console on speed 115200

# cu -l /dev/ttyu0 -s 115200

2. Power on the board and boot

# fatload mmc 0:1 0x80100000 kernel.bin
# go 0x80100000

Log booting over Ethernet

0 intel:/home/br %sudo cu -l /dev/ttyU0 -s 115200
Connected

U-Boot 2011.12-gac13ca9 (Oct 07 2013 - 10:52:43)

CPU:   Freescale VyBrid 600 family rev1.1 at 0 MHz
Board: Colibri VF50
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  128 MiB
MMC:   FSL_SDHC: 0
Bad block table found at page 65472, version 0x01
Bad block table found at page 65408, version 0x01
In:    serial
Out:   serial
Err:   serial
Net:   FEC1
Hit any key to stop autoboot:  0 
Colibri VF50 # setenv serverip 10.5.0.1; setenv ipaddr 10.5.0.3; tftp 0x80100000 prayer/kernel.bin; go 0x80100000
Using FEC1 device
TFTP from server 10.5.0.1; our IP address is 10.5.0.3
Filename 'prayer/kernel.bin'.
Load address: 0x80100000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         ######################################################
done
Bytes transferred = 4595848 (462088 hex)
## Starting application at 0x80100000 ...
KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2014 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 11.0-CURRENT #0 r265233M: Fri May  2 23:28:05 MSK 2014
    root@intel.bsdpad.com:/usr/obj/arm.armv6/usr/home/br/dev/head-ssh/sys/COLIBRI-VF50 arm
FreeBSD clang version 3.4 (tags/RELEASE_34/final 197956) 20140216
CPU: Cortex A5 rev 1 (Cortex-A core)
 Supported features: ARM_ISA THUMB2 JAZELLE THUMBEE ARMv4 Security_Ext
 WB disabled EABT branch prediction enabled
LoUU:2 LoC:1 LoUIS:2 
Cache level 1: 
 32KB/32B 4-way data cache WB Read-Alloc Write-Alloc
 32KB/32B 2-way instruction cache Read-Alloc
real memory  = 134217728 (128 MB)
avail memory = 124141568 (118 MB)
random device not loaded; using insecure entropy
kbd0 at kbdmux0
random: <Software, Yarrow> initialized
ofwbus0: <Open Firmware Device Tree>
simplebus0: <Flattened device tree simple bus> on ofwbus0
src0: <Vybrid Family System Reset Controller> mem 0x4006e000-0x4006e0ff on simplebus0
mscm0: <Vybrid Family Miscellaneous System Control Module> mem 0x40001000-0x40001fff on simplebus0
gic0: <ARM Generic Interrupt Controller> mem 0x40003000-0x40003fff,0x40002100-0x400021ff on simplebus0
gic0: pn 0x390, arch 0x1, rev 0x1, implementer 0x43b sc->nirqs 160
anadig0: <Vybrid Family ANADIG Unit> mem 0x40050000-0x400502ff on simplebus0
ccm0: <Vybrid Family CCM Unit> mem 0x4006b000-0x4006bfff on simplebus0
mp_tmr0: <ARM MPCore Timers> mem 0x40002200-0x400022ff,0x40002600-0x400026ff irq 27,29 on simplebus0
Timecounter "MPCore" frequency 133000000 Hz quality 800
Event timer "MPCore" frequency 133000000 Hz quality 1000
dmamux0: <Vybrid Family Direct Memory Access Multiplexer> mem 0x40024000-0x400240ff,0x40025000-0x400250ff,0x400a1000-0x400a10ff,0x400a2000-0x400a20ff on simplebus0
edma0: <Vybrid Family eDMA Controller> mem 0x40098000-0x40098fff,0x40099000-0x40099fff irq 42,43 on simplebus0
iomuxc0: <Vybrid Family IOMUXC Unit> mem 0x40048000-0x40048fff on simplebus0
port0: <Vybrid Family Port control and interrupts> mem 0x40049000-0x4004dfff irq 139,140,141,142,143 on simplebus0
gpio0: <Vybrid Family GPIO Unit> mem 0x400ff000-0x400ff1ff on simplebus0
gpioc0: <GPIO controller> on gpio0
gpiobus0: <GPIO bus> on gpio0
uart0: <Vybrid Family UART> mem 0x40027000-0x40027fff irq 93 on simplebus0
uart0: console (115200,n,8,1)
ehci0: <Vybrid Family integrated USB controller> mem 0x40034000-0x40034fff,0x40035000-0x40035fff,0x40050800-0x400508ff irq 107 on simplebus0
usbus0: EHCI version 1.0
usbus0: set host controller mode
usbus0 on ehci0
ehci1: <Vybrid Family integrated USB controller> mem 0x400b4000-0x400b4fff,0x400b5000-0x400b5fff,0x40050c00-0x40050cff irq 108 on simplebus0
usbus1: EHCI version 1.0
usbus1: set host controller mode
usbus1 on ehci1
ffec0: <Freescale Fast Ethernet Controller> mem 0x400d1000-0x400d1fff irq 111 on simplebus0
miibus0: <MII bus> on ffec0
ukphy0: <Generic IEEE 802.3u media interface> PHY 0 on miibus0
ukphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
ukphy1: <Generic IEEE 802.3u media interface> PHY 1 on miibus0
ukphy1:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
ffec0: Ethernet address: 62:73:64:78:5b:4e
pcm0: <Vybrid Family Synchronous Audio Interface> mem 0x40032000-0x40032fff irq 119 on simplebus0
i2c0: <Vybrid Family Inter-Integrated Circuit (I2C)> mem 0x40066000-0x40066fff irq 103 on simplebus0
iicbus0: <Philips I2C bus> on i2c0
iic0: <I2C generic I/O> on iicbus0
Timecounters tick every 10.000 msec
usbus0: 480Mbps High Speed USB v2.0
usbus1: 480Mbps High Speed USB v2.0
ugen0.1: <Freescale> at usbus0
uhub0: <Freescale EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
ugen1.1: <Freescale> at usbus1
uhub1: <Freescale EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus1
random: unblocking device.
Root mount waiting for: usbus1 usbus0
uhub1: 1 port with 1 removable, self powered
uhub0: 1 port with 1 removable, self powered
Root mount waiting for: usbus1
ugen1.2: <vendor 0x0424> at usbus1
uhub2: <vendor 0x0424 product 0x2514, class 9/0, rev 2.00/b.b3, addr 2> on usbus1
uhub2: MTT enabled
uhub2: 4 ports with 4 removable, self powered
Root mount waiting for: usbus1
Root mount waiting for: usbus1
ugen1.3: <SanDisk> at usbus1
umass0: <SanDisk Cruzer Blade, class 0/0, rev 2.00/2.01, addr 3> on usbus1
umass0:  SCSI over Bulk-Only; quirks = 0x0100
umass0:0:0: Attached to scbus0
Trying to mount root from ufs:/dev/da0 []...
mountroot: waiting for device /dev/da0 ...
da0 at umass-sim0 bus 0 scbus0 target 0 lun 0
da0: <SanDisk Cruzer Blade 2.01> Fixed Direct Access SCSI-6 device 
da0: Serial Number 4C532000000916118202
da0: 40.000MB/s transfers
da0: 7633MB (15633408 512 byte sectors: 255H 63S/T 973C)
da0: quirks=0x2<NO_6_BYTE>
warning: no time-of-day clock registered, system time will not be set accurately
Setting hostuuid: f243fa85-6bf7-11e3-83ef-c7a6602c0aec.
Setting hostid: 0x872aac17.
No suitable dump device was found.
Entropy harvesting: interrupts ethernet point_to_point swi.
Starting file system checks:
/dev/da0: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/da0: clean, 1519676 free (956 frags, 189840 blocks, 0.1% fragmentation)
Mounting local file systems:.
Writing entropy file:.
/etc/rc: WARNING: $hostname is not set -- see rc.conf(5).
ifconfig: must specify a parent device (wlandev) when creating a wlan device
ffec0: link state changed to DOWN
ffec0: link state changed to UP
Starting Network: lo0 ffec0.
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128 
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 
        inet 127.0.0.1 netmask 0xff000000 vhid 165 
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
ffec0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=80008<VLAN_MTU,LINKSTATE>
        ether 62:73:64:78:5b:4e
        inet 10.5.0.2 netmask 0xffffff00 broadcast 10.5.0.255 
        inet6 fe80::6073:64ff:fe78:5b4e%ffec0 prefixlen 64 scopeid 0x1 vhid 3 
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
add net default: gateway 10.5.0.1
add net fe80::: gateway ::1
add net ff02::: gateway ::1
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
Mounting NFS file systems:.
Creating and/or trimming log files.
ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib
Clearing /tmp (X related).
Updating motd: /etc/motd is not writable, update failed.
Mounting late file systems:.
Performing sanity check on sshd configuration.
Starting sshd.
Starting background file system checks in 60 seconds.

Mon Apr  7 22:11:10 UTC 2014

FreeBSD/arm (Amnesiac) (ttyu0)

login:

FreeBSD/arm/Toradex_Colibri_VF50 (last edited 2014-05-02 20:29:13 by RuslanBukin)