FreeBSD on Quartz development kit

Quartz is a tiny module utilized Freescale VF6xx by Device Solutions.

Supported device drivers:

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=QUARTZ buildkernel
# make TARGET_ARCH=armv6 buildworld

3. Create USB image

# truncate -s 1024M quartz.img
# mdconfig -f quartz.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=quartz.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/YOUR_USERNAME/src/sys/QUARTZ/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

Ethernet

If needed, put the cable to second RJ45 port (near the USB)

Boot log

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

Quartz U-Boot > fatload mmc 0:1 0x80100000 kernel.bin
reading kernel.bin

4594248 bytes read
Quartz U-Boot > go 0x80100000
## 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 r264720: Mon Apr 21 13:36:26 MSK 2014
    root@intel.bsdpad.com:/usr/obj/arm.armv6/usr/home/br/dev/head-ssh/sys/QUARTZ 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  = 268435456 (256 MB)
avail memory = 255381504 (243 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 3 on miibus0
ukphy1:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
ffec0: Ethernet address: 62:73:64:78:5b:4e
tcon0: <Vybrid Family Timing Controller (TCON)> mem 0x4003d000-0x4003dfff on simplebus0
fb0: <Vybrid Family Display Control Unit (DCU4)> mem 0x40058000-0x4005efff irq 62 on simplebus0
fbd0 on fb0
vt_allocate: VT initialize with new VT driver.
Timecounters tick every 10.000 msec
usbus0: 480Mbps High Speed USB v2.0
usbus1: 480Mbps High Speed USB v2.0
ugen1.1: <Freescale> at usbus1
uhub0: <Freescale EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus1
ugen0.1: <Freescale> at usbus0
uhub1: <Freescale EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
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
Root mount waiting for: usbus1
Root mount waiting for: usbus1
ugen1.3: <UFD 2.0> at usbus1
umass0: <UFD 2.0 Silicon-Power8G, class 0/0, rev 2.00/1.00, addr 3> on usbus1
umass0:  SCSI over Bulk-Only; quirks = 0x4100
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: <UFD 2.0 Silicon-Power8G PMAP> Removable Direct Access SCSI-4 device 
da0: Serial Number 201212SP0130070C2C6084C25A95
da0: 40.000MB/s transfers
da0: 7385MB (15124992 512 byte sectors: 255H 63S/T 941C)
da0: quirks=0x2<NO_6_BYTE>
warning: no time-of-day clock registered, system time will not be set accurately
Setting hostuuid: a640698e-c94e-11e3-9215-c3db47a96406.
Setting hostid: 0x19bf3e28.
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, 180667 free (899 frags, 22471 blocks, 0.4% fragmentation)
Mounting local file systems:.
Writing entropy file:.
/etc/rc: WARNING: $hostname is not set -- see rc.conf(5).
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 
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
ffec0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=80008<VLAN_MTU,LINKSTffec0: link state changed to UP
ATE>
        ether 62:73:64:78:5b:4e
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
Starting devd.
Starting Network: ffec0.
ffec0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=80008<VLAN_MTU,LINKSTATE>
        ether 62:73:64:78:5b:4e
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
Starting pflogd: 
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
Creating and/or trimming log files.
Starting syslogd.
ELF ldconfig path: /lib /usr/lib /usr/lib/compat
Starting casperd.
Clearing /tmp (X related).
Updating motd:.
Mounting late file systems:.
Configuring syscons: blanktime.
Starting sendmail_submit.
Starting sendmail_msp_queue.
Starting cron.
Starting background file system checks in 60 seconds.

Mon Apr 21 12:20:32 UTC 2014

FreeBSD/arm (Amnesiac) (ttyu0)

login: root
Apr 21 12:20:35  login: ROOT LOGIN (root) ON ttyu0
Last login: Mon Apr 21 12:18:42 on ttyv0
FreeBSD 11.0-CURRENT (QUARTZ) #0 r264720: Mon Apr 21 13:36:26 MSK 2014

Welcome to FreeBSD!

Before seeking technical support, please use the following resources:

o  Security advisories and updated errata information for all releases are
   at http://www.FreeBSD.org/releases/ - always consult the ERRATA section
   for your release first as it's updated frequently.

o  The Handbook and FAQ documents are at http://www.FreeBSD.org/ and,
   along with the mailing lists, can be searched by going to
   http://www.FreeBSD.org/search/.  If the doc package has been installed
   (or fetched via pkg install lang-freebsd-doc, where lang is the
   2-letter language code, e.g. en), they are also available formatted
   in /usr/local/share/doc/freebsd.

If you still have a question or problem, please take the output of
`uname -a', along with any relevant error messages, and email it
as a question to the questions@FreeBSD.org mailing list.  If you are
unfamiliar with FreeBSD's directory layout, please refer to the hier(7)
manual page.  If you are not familiar with manual pages, type `man man'.

Edit /etc/motd to change this login announcement.

root@:~ # 
root@:~ # 
root@:~ # uname -a
FreeBSD  11.0-CURRENT FreeBSD 11.0-CURRENT #0 r264720: Mon Apr 21 13:36:26 MSK 2014     root@intel.bsdpad.com:/usr/obj/arm.armv6/usr/home/br/dev/head-ssh/sys/QUARTZ  arm
root@:~ # 
root@:~ # 
root@:~ # 
root@:~ # ifconfig ffec0 10.5.0.33/24
root@:~ # ping 10.5.0.1
PING 10.5.0.1 (10.5.0.1): 56 data bytes
64 bytes from 10.5.0.1: icmp_seq=0 ttl=64 time=0.995 ms
64 bytes from 10.5.0.1: icmp_seq=1 ttl=64 time=0.463 ms
64 bytes from 10.5.0.1: icmp_seq=2 ttl=64 time=0.461 ms
^C
--- 10.5.0.1 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.461/0.640/0.995/0.251 ms
root@:~ # 

arm/Quartz (last edited 2019-09-06T21:32:01+0000 by LorenzoSalvadore)