Valid HTML 4.01 Transitional

Piki on Pine64

James F. Carter <jimc@jfcarter.net>, 2016-08-01

My friend Harold Wong gave me a Pine64 as a retirement present. My plans for this machine are:

What is a Pine64?

The Pine64 is a single board computer with these features:

There are newer variants with 1Gb or 2Gb RAM, gigabit Ethernet, and connectors for a camera and a display panel with touch.

Web resources:

Pine64 Company Page

The front page does something with dynamic content in the product hype, which takes a lot of CPU power for client-side scripting, so leave that page as quick as possible.

Pine64 FAQ

The FAQ appears to be for the original board. Later, two upgraded boards have come out which I don't see mentioned in the FAQ.

sunxi Linux for Pine64

This is a open source community site that supports Allwinner SoC based devices. These chips are designated sun4i, sun7i, etc., hence the name sunxi. The one in the Pine64 is the sun50i. This appears to be a Linux distro for ARM. They have what they call a near-mainline kernel port based on kernel 4.7 (not feature complete), and a lot of interesting information about the Pine64 hardware details.

Pine64: The Un-Review

by Brian Benchoff (2016-04-21) on Hackaday. He had a lot of trouble with his Pine64 and never got any of the available OS images to boot, hence the un-review title. There are a lot of comments; many people had no problem getting their boards to boot and run. Brian and another commenter complain that their motherboard was warped. Remember to attach your power button, which is needed to turn off the Android image. jimc says: The symptoms suggest a flaky wall wart (customer provided) that provides less than 2 amps. You see the same problem on Raspberry Pi.

Pine64 Quick Start Guide (with Gotchas)

By Ray Hightower (2016-04-04). Highlights of the blog post:

Benchmarking The Low-Cost PINE 64+ ARM Single Board Computer

By Michael Larabel (2016-03-26) on Phoronix. He's testing the Pine64+ with 1Gb RAM; mine is the non-plus with 0.5Gb RAM and less features. Here's what the Pine64+ has:

Open source drivers for the Mali 400-MP2 GPU are not available, which means that you get unaccelerated 2D graphics. In contrast the Broadcom VC4 GPU on the Raspberry Pi has reverse engineered drivers.

The kernel used in this test, from Arch Linux, is Kernel3.10.65-2-pine64-longsleep (aarch64). Michael had no problem booting this image.

Benchmark results of the Pine64 are similar to Raspberry Pi-3, maybe 10% faster or slower depending on which test.

OpenSuSE for Pine64

OpenSuSE has distro support for the Pine64. There are at present (2016-08-01) two variant images:

What's In the Box?

The motherboard only. You provide your own wall wart, SD card, keyboard, mouse and display. Harold nicely included a non-smart wall wart rated for 5V 2A, the kind used for a Raspberry Pi. Referring to the review above by Brian Benchoff, my motherboard is not warped at all. RoHS compliant. Board dimensions: 126 x 80mm (5.0 x 3.25in). The RJ45 and USB connector stick out a few mm more.

I'm planning to get a new SD card. Forum posters report good results with the Samsung EVO product line and problems with low-priced ersatz cards, so I'm going to go with the crowd on this. SBSF Amazon, prices are $10 for 32Gb, $20 for 64Gb, $40 for 128Gb. SanDisk, Toshiba and Transcend are also mentioned as reputable.

I also want an enclosure. Amazon has a nice-looking wood one for $15; also some plastic/metal cases. I'll tell you if I like it when I get it. Ordering the Eleduino PINE64/ 64 plus Acrylic Enclosure Case (Black), $13.49. Nicely made, fits perfectly, has cutouts for the expansion buses, which are important for connecting the serial cable.

Serial Console

For kernel hacking I would need a UART to USB adapter for the serial console. I'm not sure how much use I'm going to get out of this since everything is supposed to just work (yeah, sure), but If I do mess with the SuSE 4.5 kernel I'm going to need the serial console to see what it's doing. It's going to attach to pins on the Euler bus with flying leads (I guess). Gotcha: when you disconnect power for a hard reset, current leakage from the UART prevents a complete reset. Either disconnect the UART too, or add a reset button to the board.

elinux.org wiki for Pine64 serial console. They have a link to a product, a 1 meter cable with USB type A on one end, and 3 flea clips on the other. There is a Future Technology (FTDI) UART to USB chip hiding inside and it appears on the host as a USB TTY. Price $15 (USD) from Digikey. Several similar products are available on Amazon; look for TTL-232R-RPI and beware of cheap imitations.

Combining info from the datasheet for the TTL-232R-RPI on Allied Electronics and the linux-sunxi.org wiki page for Pine64 yields these connections for the serial console. Host to client means from your laptop to the Pine64, and vice versa. The EXP bus is labelled and is between the Euler bus and the SD card slot; pins 2, 9 and 10 are labelled. The wiki page's pin labels are from the client's point of view (TXD means Pine64 sends to laptop) whereas the datasheet labels them from the host's point of view (TXD means laptop sends to Pine64). The same UART is accessible on the Euler bus, but from the EXP bus there is a buffer so client RXD can't leak power into the Pine64 preventing a proper shutdown.

You end up with the black wire on the pin closest to the edge of the board and closest to the card slot; the yellow wire next to it; and the orange wire as the yellow wire's cross street neighbor. It works.

Color Host Client EXP bus Function
Black GND GND 9 Signal ground
Orange TXD RXD 8 Host to client
Yellow RXD TXD 7 Client to host

Data written to the serial console will appear on the Linux USB TTY. Use your favorite console emulator such as kermit to see what it displays and to send commands. The wiki page author recommends screen with this command line, modified by jimc for Linux. Execute as a user with write access to the TTY, e.g. root, and substitute the correct device name if you have several of them.

screen /dev/ttyUSB0 115200

Initial Attempt

I got the SD card, the serial cable, and the case. These were my initial steps to check out the Pine64 board.

Preparation for Checking the SD Card

Check the SD Card

Assemble the Case

Preparations for Board Testing

Power It On -- Debian

Trying the OpenSuSE-3.10 Image

Reverting to the Debian Image

Trying the Updated OpenSuSE Image (3.10.101)

Trying the OpenSuSE Image (4.5.0)

The Way Forward

Now I need to make a strategy decision: how to get the most use out of the Pine64 with the least work. So far the only bootable images (that I've tried) have been debian-jessie-pine64.zip (by Lenny Raposo) and openSUSE-pine64-08-05-16.img.xz, the recently updated one from Terra854 with MBR booting and the 3.10.101 kernel. Unless something awesome happens, all my experiments will have to start with the latter image. I'm looking at these branches:

Better Restore Procedure

Here's a likely better procedure:

Test Graphics

I should expand the installed distro, and particularly, I should install the X-Windows server, a Mali driver for it (from where?), an appropriate greeter (probably lightdm, warts and all), and a minimal desktop environment, perhaps LXDE, or XFCE which I use on all my other systems.

Results of starting display-manager with xorg-x11-drv-armsoc :

Before trying to compile the sunxi driver I'm going to try to find one among the already download images. Trying these images:

Brainwave! For the tests above, for connecting my display to the Pine64 I was using a HDMI to DVI adapter, a DVI to VGA adapter, and a VGA cable. Suppose the GPU does not drive the VGA (analog) signal lines? I stole a DVI cable from another machine.

This is turning into a time sink. I think I'm not motivated enough to make a real contribution to bringing to life the display on the Pine64. It's not promising that when I booted the Debian image it did not activate the display despite being configured to do so and having a supposedly working, though back-version, driver.

Test Kernel 4.5

I should reinstall kernel 4.5.0, and in the unlikely case that it boots, I should test which hardware actually works, since the last report on that kernel is from 2016-04-xx, 4 months ago. It has the same UEFI configuration that openSUSE-3.10-pine64.raw.xz has, and does not boot.

CouchNet Configuration

I should see how much of my standard configuration I can install on the Pine64 -- probably quite a lot, but not all.

Enterprise Mirror

I'm reluctant to put work into setting up an enterprise mirror if the Pine64 is going to end up useless, but if it's promising then I'm going to be a whole lot happier with the packages on my own machine. But in a rolling distro, how do you keep packages up to date?

Conclusion

From struggling with the Pine64 I have learned a number of points.

Hardware Support Style on ARM

I've seen a number of forum posts, although I concentrated on those specifically relevant to the Pine64. Although ARM CPUs typically reside as a component of a SOC, there are hundreds of designers of such devices, and they combine the CPU with a variety of other subsystems, particularly the graphics processor. Open source graphics drivers are rarely available; one exception is the Broadcom Videocore (VC4) GPU on the Raspberry Pi. The Pine64 uses a Mali 400-MP2 GPU with a proprietary driver.

SOC vendors compete intensely, and are terrified that competitors will steal their software work, and GPU providers have a similar issue at a higher level. Thus closed source is the rule for ARM.

A major disappointment is that I have not been able to put together the desired combination of the operating system (OpenSuSE) and a graphics driver that works. If I continue with the Pine64, or if I get an ARM-based other kind of machine such as a mini-laptop, I will need to stick with the kernel and graphics software (X-Windows) provided by the vendor. For the Pine64 this is seriously back version. As of this writing, the latest Linux kernel is 4.7.1 and the one in OpenSuSE Leap 42.1 (the distro used on most machines on my home net) is 4.1.27, whereas the Allwinner kernel is 3.10.101; the 3.10 series began in 2013-06-xx (3 years ago) and 4.1.x came out in 2015-06-xx (1 year ago). The proprietary GPU driver is also back-version, two X-Windows ABI major versions back.

I'm afraid that it's not acceptable to be stuck in a time warp like that, without security fixes and general bug fixes. Particularly for the proposed mini-laptop.

Quality of the Distro

I looked at OpenSuSE's ARM support, and 90% of the packages in the main distro are also available for ARM. (This excludes non-open source packages and i586 packages.) That's 26351 packages for ARM. This is a pretty good collection. However, there is a problem with the provided images for Pine64: they don't boot. They are organized for UEFI booting, and the Allwinner A64 SOC cannot handle UEFI at all. Weren't they tested? Did nobody report a bug?

UEFI has its pros and cons, which are off topic for this document, but it doesn't look like rocket science to make UEFI work for ARM: use uboot (which is an accessory produced in the kernel build) to load Grub2's stage1 in the EFI partition. Compare with how SuSE does it on Intel boxes: the UEFI BIOS gets control, loads the shim module (which has a signature from Microsoft's key, if Secure Boot is turned on), and the shim then loads Grub2's stage1.

I'm not exactly happy that this relatively simple and important feature of the distro, being able to boot, slipped through the cracks. Bug report here, bug 994496 on SuSE's bugzilla.

The image that I did get to work, from Terra854, is community modified and is hosted on the Pine64 website, not SuSE's site.

Hardware Support

The goal for this project was to use the Pine64 as an audio playback node, with reasonably normal integration into my network. But the sound card doesn't work, which kind of puts a damper on that goal. And I've never seen anything on the display, which prevents a role as a general purpose desktop machine; I also have a low priority need for one of those.

What Do I Do Next?

Unfortunately I have to declare that the Pine64 project has failed, and I have to stop putting effort into a project that's not going to have a result.