ARM64

FreeBSD/arm64 is the FreeBSD port to the 64-bit ARM architecture, also known as AArch64 or ARMv8. FreeBSD 11.0 includes out-of-the-box support for ARMv8, and over 20,000 packages are available in the 3rd party software collection. Cavium's ThunderX is the initial reference platform for the FreeBSD/arm64 port.

This page contains some details about the FreeBSD/arm64 development process. Now that arm64 is a release architecture this information is largely kept here for historical purposes.

See also the state of ports/packages on arm64.

Kyua tracking.

Source

The basic FreeBSD/arm64 support is available in FreeBSD-CURRENT.

Delivery into head:

Review

Commit

Description

D2005

r280259

kernel-toolchain

D2057

r280364

sys/ includes

D2132

r281197

libc/libstand

D2136

r280903

rtld-elf

D2137

r280862

libthr

D2148

r280711

remaining machine headers

D2160

r280853

libcompiler-rt

r280769

crunchide

D2173

r281221

libcompiler-rt multc3

D2174

r281223

libcompiler-rt float*

D2175

r280865

LLVM vs ld/gold reloc

D2183

r281014

rtld TLS

D2184

r280952

libthread_db

D2185

r280997

stub libkvm

D2186

r280951

CDDL defines

D2199

r281494

Initial kernel merge

r280993

libgcc_s infrastructure

D2249

r281493

devmap arm/arm64 sharing

r281466

psci driver

r281497

arm64 psci interface

D2288

r281526

loader.efi for arm64

D2357

r282655

busdma (IO coherent systems)

D2377

r282867

GICv3

D2378

r285213

ITS

D2701

r284196

Options for dmb() and dsb()

D2463

r284273

ACPI

D2532

r282909

fabs()

D2555

r283112

PMC

D2386

r284317

ECAM PCI driver

D1997

r284227

DTrace no-modules

D2738

r285009

DTrace

busdma caching

(Does not include hardware specific support and subsequent bug fixes. Does not include work from July 2015 on.)

head build status: https://ci.freebsd.org/job/FreeBSD-head-aarch64-build/

STABLE-11 build status: https://ci.freebsd.org/job/FreeBSD-stable-11-aarch64-build/

Building

Binutils

Arm64 needs an external copy of binutils for a few tools, e.g. ld and objcopy. This is available from the devel/aarch64-binutils port or package. The CROSS_BINUTILS_PREFIX is automatically set to use the external binutils if available.

This can be easily installed on the cross-build host by running:

pkg install aarch64-binutils

Build script

arm64_build.sh

World

The standard buildworld sequence works:

export MAKEOBJDIRPREFIX=<path-to-suitable-objdir>
make buildworld TARGET=arm64

Kernel

The build sequence for the kernel is a fairly standard one:

export MAKEOBJDIRPREFIX=<path-to-suitable-objdir>
make buildkernel TARGET=arm64

This results in an image called 'kernel' created in:

$MAKEOBJDIRPREFIX/arm64.aarch64/<svn-checkout-path**>/sys/GENERIC

** See the 'Source' section above for the svn-checkout-path.

Running

ARM Foundation Model

The ARMv8 Foundation Model is available from ARM. You must read and accept a click-through license to obtain it. The Foundation model may be run in a Linux virtual machine, or by using the experimental 64-bit Linux emulation support.

AndrewTurner has a GitHub repo set up to help run on the Foundation Model.

Cavium ThunderX

Cavium's ThunderX is the initial reference target platform for FreeBSD/arm64.

FreeBSD 11.0 supports the ThunderX EVB (evaluation board) and CRB (customer reference board) in SMP mode (48 CPU cores). SATA drives, PCIe expansion cards, and the on-chip network interface are fully supported.

Demo of SMP kernel on ThunderX

Gem5

Gem5 instructions

HiKey

The HiKey is a low cost (~$75 - $100 + shipping) ARMv8 board from Linaro.

Pine64

Pine64 is pretty well supported other than HDMI. jmcneill@ is poking at HDMI.

QEMU

QEMU now has aarch64 system mode emulation support. It is available by installing the qemu-devel package or emulators/qemu-devel port.

The Release Engineers build periodic snapshots, including for arm64 on QEMU. Instructions on where to find these are sent to the shapshots mailing list.

See arm64/QEMU for further details on booting FreeBSD/arm64 in QEMU, including links to AArch64 EFI firmware files that are not included with the QEMU port.

Raspberry Pi 3 (RPI3)

This section has moved to this page.

SoftIron Overdrive 3000

FreeBSD mostly works, other than the internal dual 10G networking, however support for this is being worked on. In the interim PCIe NICs work.

Screenshot

arm64_userland.png

dmesg

From 18 November 2014 with a kernel filesystem:

The default boot selection will start in   3 seconds
[1] FreeBSD loader from SemiHosting
        - VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/loader.efi
        - LoaderType: EFI Application
-----------------------
Global FDT Config
        - VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/foundation-v8.dtb
-----------------------
[a] Boot Manager
[b] Shell
[c] Reboot
[d] Shutdown
Start: 
Invalid input, please choose a menu option from the list above
Start: 1
Consoles: EFI console  
Image base: 0x9b189000
EFI version: 2.40
EFI Firmware: ARM Foundation Model EFI Feb 23 2014 22:56:26 (rev 0.00)

FreeBSD/arm64 EFI loader, Revision 1.0
(andrew@bender, Thu Nov 13 17:21:08 GMT 2014)
/kernel data=0x93e770+0x52008 syms=[0x8+0x981a8+0x8+0x9db5c]
Hit [Enter] to boot immediately, or any other key for command prompt.
Booting [/kernel]...               
EFI did not provide DTB, falling back to use /foundation.dtb
/foundation.dtb size=0xbcc
dtbfp = ffffff8000ac6490
In initarm on arm64
dtbp = ffffff8000ac6490
0 - 0
80000000 - 9b1d7000
9b1e0000 - a0000000
a0300000 - ffab8000
ffafe000 - ffb01000
ffb02000 - ffb19000
ffb1a000 - 100000000
Total = 7fcaf000
pmap_bootstrap ffffff8000004000 99000000 ac9000
ffffff8000004000

End initarm
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 #65 af5e5a6(userland): Tue Nov 18 11:32:33 GMT 2014
    andrew@bender:/usr/obj/arm64.arm64/usr/home/andrew/freebsd/repo/arm64-github/sys/GENERIC arm64
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
random device not loaded/active; using insecure pseudo-random number generator
random: entropy device infrastructure driver
random: selecting highest priority adaptor <Dummy>
random: SOFT: yarrow init()
random: selecting highest priority adaptor <Yarrow>
ofwbus0: <Open Firmware Device Tree>
gic0: <ARM Generic Interrupt Controller> mem 0x2c001000-0x2c001fff,0x2c002000-0x2c0020ff on ofwbus0
gic0: pn 0x390, arch 0x2, rev 0x0, implementer 0x43b sc->nirqs 96
generic_timer0: <ARMv8 Generic Timer> irq 29,30,27,26 on ofwbus0
Timecounter "ARM MPCore Timecounter" frequency 100000000 Hz quality 1000
Event timer "ARM MPCore Eventtimer" frequency 100000000 Hz quality 1000
simplebus0: <Flattened device tree simple bus> on ofwbus0
simplebus1: <Flattened device tree simple bus> on simplebus0
uart0: <PrimeCell UART (PL011)> mem 0x90000-0x90fff irq 37 on simplebus1
uart0: console (115200,n,8,1)
uart1: <PrimeCell UART (PL011)> mem 0xa0000-0xa0fff irq 38 on simplebus1
uart2: <PrimeCell UART (PL011)> mem 0xb0000-0xb0fff irq 39 on simplebus1
uart3: <PrimeCell UART (PL011)> mem 0xc0000-0xc0fff irq 40 on simplebus1
Timecounters tick every 1.000 msec
random: unblocking device.
Trying to mount root from ufs:/dev/md0 []...
Mounting from ufs:/dev/md0 failed with error 2.
Trying to mount root from ufs:md0 []...
warning: no time-of-day clock registered, system time will not be set accurately
Enter full pathname of shell or RETURN for /bin/sh: 
Cannot read termcap database;
using dumb terminal settings.
# echo *
bin dev sbin
# ls
bin     dev     sbin

Known Limitations

Bugs

Search for open PRs with Hardware = arm64.

arm64 (last edited 2017-02-27 13:04:48 by LiWenHsu)