Finally bringing FreeBSD to Parallella

Thomas Skibo thomasskibo at yahoo.com
Fri Jan 6 04:09:19 UTC 2017


> On Jan 4, 2017, at 10:57 PM, Michal Meloun <melounmichal at gmail.com> wrote:
> 
> 
> With LINUX_BOOT_ABI option in kernel config file you can boot kernel
> directly from uImage and pass right DTB to kernel directly from u-boot.
> 
> The following example is what I using for Jetson TK1 board (and it uses
> mkubootimage stolen from netbsd).
> 
> mkubootimage -A arm -C none -O linux -T kernel -a 0x80200000 -e
> 0x80200100 -n jetson-tk1 <obj path>/tegra/sys/JETSON-TK1/kernel <obj
> path>/tegra/sys/JETSON-TK1/uImage
> 
> and from u-boot:
> 
> bootp 0x80200000 <IP addr>:/tegra/sys/JETSON-TK1/uImage
> bootp 0x80100000 <IP
> addr>:/tegra/sys/JETSON-TK1/tegra124-jetson-tk1-fbsd.dtb
> setenv bootargs
> FreeBSD:boot_single=1,boot_verbose=0,vfs.root.mountfrom=ufs:/dev/ada0s1afdt
> addr 0x80100000
> fdt boardsetup
> fdt chosen
> bootm 0x80200000 - 0x80100000
> 
> 
> Michal

Thanks!  I think that’s the ticket. I managed to get this to work on a Zedboard.

I built a Zedboard kernel with LINUX_BOOT_ABI and packaged it in a uImage using similar options to yours (see below).  I put a Zedboard .DTB file in the boot partition and booted FreeBSD using the exact u-boot commands that are built in to Parallella.  It should be just a matter of using this same uImage but a .DTB for Parallella (and I think the example I posted earlier would work).

Who wants to test it?  It’s a matter of downloading the Zedboard SD image and replacing the files in the boot partition.

My mkimage options:

	mkimage -A arm -O linux -T kernel -C none -a 0x100000 -e 0x100100 -n parallella-freebsd -d kernel uImage

—Thomas

U-Boot 2016.01 (Aug 02 2016 - 13:37:53 -0700)

Model: Zynq Zed Development Board
Board: Xilinx Zynq
DRAM:  ECC disabled 512 MiB
MMC:   sdhci at e0100000: 0
SF: Detected S25FL256S_64K with page size 256 Bytes, erase size 64 KiB, total 32 MiB
In:    serial at e0001000
Out:   serial at e0001000
Err:   serial at e0001000
Model: Zynq Zed Development Board
Board: Xilinx Zynq
Net:   ZYNQ GEM: e000b000, phyaddr 0, interface rgmii-id
eth0: ethernet at e000b000
Hit any key to stop autoboot:  0 
Zynq> fatload mmc 0 0x3000000 uImage
reading uImage
8170816 bytes read in 727 ms (10.7 MiB/s)
Zynq> fatload mmc 0 0x2a00000 devicetree.dtb
reading devicetree.dtb
3431 bytes read in 14 ms (239.3 KiB/s)
Zynq> bootm 0x3000000 - 0x2a00000
## Booting kernel from Legacy Image at 03000000 ...
   Image Name:   parallella-freebsd
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    8170752 Bytes = 7.8 MiB
   Load Address: 00100000
   Entry Point:  00100100
   Verifying Checksum ... OK
## Flattened Device Tree blob at 02a00000
   Booting using the fdt blob at 0x2a00000
   Loading Kernel Image ... OK
   Loading Device Tree to 1f312000, end 1f315d66 ... OK

Starting kernel ...

Copyright (c) 1992-2016 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-RELEASE-p1 #0 r306420M: Thu Jan  5 19:29:24 PST 2017
    skibo at ashbury:/usr/obj/arm.armv6/usr/src/sys/PARALLELLA arm
FreeBSD clang version 3.8.0 (tags/RELEASE_380/final 262564) (based on LLVM 3.8.0)
CPU: Cortex A9-r3 rev 0 (Cortex-A core)
 Supported features: ARM_ISA THUMB2 JAZELLE THUMBEE ARMv4 Security_Ext
 WB enabled LABT branch prediction disabled
LoUU:2 LoC:2 LoUIS:2 
Cache level 1: 
 32KB/32B 4-way data cache WB Read-Alloc Write-Alloc
 32KB/32B 4-way instruction cache Read-Alloc
real memory  = 536866816 (511 MB)
avail memory = 516050944 (492 MB)
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
random: entropy device external interface
ofwbus0: <Open Firmware Device Tree>
simplebus0: <Flattened device tree simple bus> on ofwbus0
simplebus1: <Flattened device tree simple bus> on ofwbus0
l2cache0: <PL310 L2 cache controller> mem 0xf02000-0xf02fff on simplebus0
l2cache0: cannot allocate IRQ, not using interrupt
l2cache0: Part number: 0x3, release: 0x8
l2cache0: L2 Cache enabled: 512KB/32B 8 ways
gic0: <ARM Generic Interrupt Controller> mem 0xf01000-0xf01fff,0xf00100-0xf001ff on simplebus0
gic0: pn 0x390, arch 0x1, rev 0x2, implementer 0x43b irqs 96
mp_tmr0: <ARM MPCore Timers> mem 0xf00200-0xf002ff,0xf00600-0xf0061f on simplebus0
Timecounter "MPCore" frequency 333333333 Hz quality 800
Event timer "MPCore" frequency 333333333 Hz quality 1000
zy7_slcr0: <Zynq-7000 slcr block> mem 0-0xfff on simplebus0
zy7_devcfg0: <Zynq devcfg block> mem 0x7000-0x7fff on simplebus0
uart0: <Cadence UART> mem 0x1000-0x1fff on simplebus1
uart0: console (-1,n,8,1)
ehci0: <Zynq-7000 EHCI USB 2.0 controller> mem 0x2000-0x2fff on simplebus1
usbus0: EHCI version 1.0
usbus0: stop timeout
usbus0 on ehci0
gpio0: <Zynq-7000 GPIO driver> mem 0xa000-0xafff on simplebus1
gpiobus0: <GPIO bus> on gpio0
gpioc0: <GPIO controller> on gpio0
cgem0: <Cadence CGEM Gigabit Ethernet Interface> mem 0xb000-0xbfff on simplebus1
miibus0: <MII bus> on cgem0
ukphy0: <Generic IEEE 802.3u media interface> PHY 0 on miibus0
ukphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto
cgem0: Ethernet address: 00:01:0a:11:22:33
sdhci_fdt0: <Zynq-7000 generic fdt SDHCI controller> mem 0x100000-0x100fff on simplebus1
sdhci_fdt0: 1 slot(s) allocated
mmc0: <MMC/SD bus> on sdhci_fdt0
cryptosoft0: <software crypto>
Timecounters tick every 10.000 msec
usbus0: 480Mbps High Speed USB v2.0
ugen0.1: <Xilinx> at usbus0
uhub0: <Xilinx EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
mmcsd0: 16GB <SDHC SU16G 8.0 SN 0B77EC17 MFG 01/2014 by 3 SD> at mmc0 48.0MHz/4bit/65535-block
Release APs
Trying to mount root from ufs:mmcsd0s2a []...
warning: no time-of-day clock registered, system time will not be set accurately
uhub0: 1 port with 1 removable, self powered
Setting hostuuid: a2af1500-d132-11e6-a27a-00010a112233.
Setting hostid: 0xb3d7db19.
No suitable dump device was found.
Starting file system checks:
/dev/mmcsd0s2a: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/mmcsd0s2a: clean, 60742 free (38 frags, 7588 blocks, 0.0% fragmentation)
Mounting local filesystems:

…




More information about the freebsd-arm mailing list