User Tools

Site Tools


toh:pcengines:apu2

PC Engines APU 2

The APU2 is a small x86_64 single board computer. It will easily route/packet filter a one Gigabit WAN. IPsec/VPN may drop that number a wee bit, the CPU has AES-NI acceleration, use AES-GCM for performance. Tested wifi options include the PC Engines supplied WLE900VX, WLE600VX (both ath10k, 802.11ac/a/b/g/n) and full feature support via WLE200NX (ath9k, 802.11a/b/g/n) miniPCI express radio cards. There are also board versions optimized for the usage of 3G / LTE modems, see PC Engines APU 3.

APU system boards are designed and manufactured by PC Engines in Taiwan. Boards are based on AMD Embedded G series GX-412TC low (6 to 12W) power consumption CPUs. APU boards and associated accessories are readily available from resellers across Europe and North America.

There have been reports that “old” SD cards with the 18.06.1 squashfs image are not recognized as bootable, though the ext4 image on the same card boots.

2018-09 – https://forum.openwrt.org/t/sd-install-on-apu-2c2/21584

Supported Versions

Hardware

ModelCPUCoresMHzRAMGbit portsNICsUSB
APU2C0AMD GX-412TC41000204822 Intel i211AT2x 3.0
APU2C2AMD GX-412TC41000204833 Intel i211AT2x 3.0
APU2C4AMD GX-412TC41000409633 Intel i210AT2x 3.0
  • CPU: AMD Embedded G series GX-412TC, 1 GHz quad Jaguar core with 64 bit and AES-NI support, 32K data + 32K instruction cache per core, shared 2MB L2 cache
  • Currently (2018) one of the fastest performing SoCs running OpenWrt
  • AMD-V (AMD hardware virtualization technology)
  • DRAM: 2 or 4 GB DDR3-1333 DRAM
  • mSATA (SSD) mini-PCIe and SD card slot
  • Storage: Boot from m-SATA SSD, SD card (internal sdhci controller), or external USB. 1 SATA + power connector
  • Power: 12V DC, about 6 to 12 W depending on CPU load. Jack = 2.5 mm, center positive
  • I/O: DB9 serial port, 2 USB 3.0 external + 2 USB 2.0 (internal header), three front panel LEDs, pushbutton
  • 2-3 1GigE Intel Ethernet and mini-PCIe slots
  • A phone SIM slot and mini-PCIe 3G/LTE modem support
  • Expansion: 2 miniPCI express (one with SIM socket), LPC bus, 17 GPIO headers (3.3v), I2C bus
  • UART config: COM2 (3.3V RXD / TXD / RTS / DTR), COM3 and COM4 (3.3V DCD / DSR / RXD / RTS / TXD / CTS / DTR / GND) enabled via BIOS on the GPIO pins
  • Board size: 6 x 6“ (152.4 x 152.4 mm) - same as apu1d, alix2d13 and wrap1e
  • Firmware: Coreboot - source code, releases.
  • Cooling: An included 3 mm Aluminum heat spreader creates conductive cooling from the CPU to the enclosure and works quite well (50 C to 60 C). PC Engines tested the black enclosure to be a few degrees cooler

Schematics and datasheets

Ethernet assignation apu2

Since the board can be put in the same box as the PCEngines Alix 2d13-Board it might be useful to know that the ethernet device order has changed. The interfaces are now ordered as shown in the following image:

(Note: this is exactly the same order as in the APU1 boards)

eth0 is labelled LAN1 on the PCB silk screen, (eth1 is LAN2 and so on).

Kernel modules

The x86_64 images contain everything for basic operation and work out of the box on APU2 since release 17.01.2. Some modules for specific APU2 features are not included by default and can be installed using opkg, or by including them in a custom build.

Module(s) feature(s) menuconfig location
kmod-leds-apu2, kmod-leds-gpio APU2 front LED control Kernel modules/LED modules
kmod-crypto-hw-ccp AMD Cryptographic Coprocessor Kernel modules/Cryptographic API modules
kmod-gpio-nct5104d, kmod-gpio-button-hotplug GPIO pins or COM2/3/4 Kernel modules/Other modules
kmod-sp5100_tco Hardware watchdog Kernel modules/Other modules
kmod-usb-core, kmod-usb-ohci, kmod-usb2, kmod-usb3 USB v2 and v3.0 support Kernel modules/USB Support
kmod-sound-core, kmod-pcspkr Onboard PC speaker Kernel modules/Sound support

Other software packages may also be added to use certain APU2 featues:

Package(s) feature(s) menuconfig location
amd64-microcode AMD CPU microcode Firmware
flashrom Tool to update APU BIOS Utilities
irqbalance IRQ usage balancing for multi-core systems Utilities
fstrim discard unused blocks on SSDs Utilities/Filesystem

Cryptographic hardware

The AMD GX-412TC supports the AES-NI instruction set, which works without any kernel module or specific configuration.

The SoC also contains a cryptographic co-processor (AMD CCP), which requires kmod-crypto-hw-ccp to be installed. The CCP can be utilized to speed up various cryptographic algorithms in kernel space, like IPSec hashing for example. See Cryptographic Hardware Accelerators on how to enable /dev/crypto and configure userspace libraries like OpenSSL to take advantage of it. AES-GCM is currently the best security vs performance trade off. The APU2 is vulnerable to the recent AMD and Intel CPU security exploits.

Bootloader

APU boards use coreboot. The PC Engines BIOS firmware releases can be downloaded from https://pcengines.github.io/, flashing instructions are located at the PCEngines HowTo section. Example flashrom -w apu2_v4.6.8.rom -p internal There is also a documentation repository on github with information how to build and modify coreboot for APU boards.

Windows: Use PC Engine's Windows installer to write Tinycore linux to a USB pen drive.

OpenWrt support

Installation

Generic image

Images for x86 are provided with ext4 or squashfs. It's recommended to use squashfs. For more details read this mailinglist thread and Filesystems. See, however, warning at top of page on squashfs images not booting from “old” SD cards.

If you wish to write data to the same disk as OpenWrt is installed on, an ext4 filesystem with write persistence is useful. If using an SD card (as opposed to using an mSATA SSD or USB-attached SSD), the writable JFFS2 filesystem has journaling and wear leveling may prolong SD card life. However, it will have to be built as OpenWrt does not auto-generate JFFS2 images. See https://downloads.openwrt.org/releases/17.01.4/targets/x86/64/

To install OpenWrt, download a *combined-squashfs.img[.gz] and write it to a SD-card or USB-stick. Run lsblk to choose the correct device to write to.

sudo dd status=progress bs=8M if=lede-17.01.4-x86-64-combined-squashfs.img of=/dev/sdX

or

gzip -dc openwrt-x86-64-combined-squashfs.img.gz | sudo dd status=progress bs=8M of=/dev/sdX

Boot the APU from the written stick/card.

Custom OpenWrt image

When building a custom image, choose target system x86, subtarget x86_64 and include desired APU-specific kernel modules. It's possible to further optimize the produced binaries by generating instructions for AMD family 16h cores (march=btver2). Set CONFIG_TARGET_OPTIMIZATION=”-Os -pipe -march=btver2“

In menuconfig this option can be found at: Advanced configuration options (for developers) → Target Options → Target Optimizations

If you don't want to build from source, you can use the image builder

Configuration

With the generic image, only the first port (eth0, the one close to the serial port) is active. You should configure the other ports as appropriate.

Sysupgrade

sysupgrade on x86 works with the same images as used for installation. Upload a *combined-squashfs.img.gz via LUCI or run

sysupgrade openwrt-x86-64-combined-squashfs.img.gz

Benchmark

Teklager.se did a Benchmark of two Compex wireless cards on pfSense and OpenWrt on an APU2C4. Quote from the article: OpenWRT is just much better at wireless. It outperforms pfSense by almost 2x.

Troubleshooting

See the PCEngines BIOS release page for known issues in different BIOS versions.

LEDs not working

The SMBIOS board name entries differed in some releases of the coreboot 4.6.x cycle, the releases since v4.6.7 changed back to the old naming scheme. Since commit 7e42cba both naming schemes are supported. If LEDs aren't working, upgrade coreboot to at least v4.6.7 and/or install a current version of leds-apu2 which includes the mentioned commit.

Other Info

Tags

toh/pcengines/apu2.txt · Last modified: 2018/09/20 17:05 by jeff