Arch Linux on RockPro64
#1
Hello,

I have been tinkering with my RockPro64 in the last few days, and as I have Arch Linux running on almost every computer in my home (unfortunately I could not find a port for my router), I was also looking into the possibility to bring a preferably vanilla Arch Linux to the RockPro64. I especially like this as this gives me the opportunity to use the precompiled packages from the Arch Linux ARM community and thus have a nice and up-to-date package source.

This also promised to be a good opportunity for me to learn how images for such embedded boards can be created, as I have never done such a thing before.

What I tried:
There is an official Arch Linux image for the Rock64 on the Arch Linux ARM webpage, on top of that there is a somewhat ambiguous description in a forum on how Arch Linux can be ported to Rock64: https://me.m01.eu/blog/2017/12/rock64-arch-linux/
This basically combines the projects of Ayufan to compile u-boot and the arm-trusted-firmware packages, creates an image with guestfish in the format required by RockChip and extracts the stock ARMv8 Arch Linux ARM image into the /root partition.


My idea was that this project could nicely be used as the starting point for my idea, as I hoped to be able to just replace every occurence of Rock64 with RockPro64 in the configuration files. Unfortunately this turned out to be harder than expected (what doesn't if you are compiling your own images?). I fought quite a lot with the strange curiosity that aarch64-linux-gnu- threw all kinds of errors when compiling u-boot under my arch build machine, but compiled nicely when under a debian host... Opposite was the behavior of guestfish, that only wanted to work under arch linux. Nevertheless, this failed as the created image simply refused to boot for some reason. I have to admit though that I still did not really understand, what the build scripts do and where it all pulls files from Ayufans compiled results. I also had problems to understand what Ayufan did in the configuration of u-boot for example (I also could not figure out yet where the compiled files from arm-trusted-firmware are ever used) but that can well have its reason in my inexperience. His images work, so he must have done some awesome magic.

So, after some frustration I had a dirty backup plan:
I just burned Ayufans latest Debian Stretch image to my SD card and then deleted everything on / except /boot. After that I extracted everything but the boot folder from the Arch Linux ARM file onto / on the SD card.

I don't have to say, my surprise was huge as this image suddenly booted on my RockPro64. After doing an initialisation of pacman and a first package update, I noticed that Arch Linux suggested to update my kernel from 4.4 to 4.17. I thought this will happen as Ayufans Stretch images incorporate the rockchip custom 4.4 kernel. Anyways I hit the update. To my fortune the stock Arch Linux kernel is called "Image" with "initramfs-linux.img" as the init system, so instead of overwriting Ayufans kernel it just packed the stock one next to it. Then I only had to add an other entry to /boot/extlinux/extlinux.conf before the entries of Ayufan to use the stock kernel and now my RockPro64 is running vanilla Arch Linux ARM!

However, this is only a first test and proof-of-concept, so there are some drawbacks:
u-boot will never be upgraded in this constellation as arch linux simply does not know that there is u-boot installed on the system and there is also no package in the sources that it could use for an upgrade. Also, I did not get my HDMI monitor to work yet (but as I plan to use my RockPro as a headless server I don't care about that very much). I will also have to look to get PCIe working form my SATA card.

But still, I have a vanilla Arch Linux running on my machine.  I know, it was a very dirty way of getting it to run, but I will need to read more in the rockchip wiki on compiling linux and creating images to finally get this to work the traditional way... Is there anyone with interest to port Arch Linux to the RockPro with a little experience in linux and u-boot and image creation?

Greetings

Update after some minutes of testing:

As Arch Linux uses a bleeding edge kernel, the PCIe does not seem to work, at least there is no output to the lspci command. Switching back to the 4.4 kernel at least shows my sata controller. As I just realised, the HDMI also works with this kernel, so at least I can see that there is some error displayed when I connect a HDD, so I will need to look into that.
#2
(07-29-2018, 03:31 PM)mmatyas Wrote: ..........
Also, I did not get my HDMI monitor to work yet (but as I plan to use my RockPro as a headless server I don't care about that very much).
..........

Even if you had a Rock64 and followed the Arch Linux ARM for Rock64 installation instructions here : https://archlinuxarm.org/platforms/armv8...hip/rock64, HDMI would not have worked without putting in some work of your own.
https://archlinuxarm.org/platforms/armv8...hip/rock64 Wrote:HDMI video is not yet supported in the mainline kernel.
#3
To be clear, HDMI support is not working? Your method, dirty or not, was smart and you should be able to employ the same basic approach to getting HDMI support up and running using Ayufan's 4.4.132 kernel. 

Make sure you aren't just transplanting the kernel without also replacing the dtb.


Attached Files Thumbnail(s)
   
#4
(08-06-2018, 03:40 PM)hiccupstix Wrote: To be clear, HDMI support is not working?

In the mainline Linux kernel, there is no HDMI port defined in the device tree of the Rock64.
In the mainline Linux kernel, there is no device tree for the RockPro64 (yet).
See here : https://github.com/torvalds/linux/tree/9...s/rockchip

In the Rockchip Linux kernel (non-mainline) there is : https://github.com/rockchip-linux/kernel...s/rockchip

@mmatyas :
It should be possible to copy the relevant DTS files (or just the relevant DTS entries) from the Rockchip repo to the Arch source, and then (cross) compile Arch with HDMI support.

The following, only if you don't know about device trees. Else skip.

*.dts files contain board level definitions.
*.dtsi files are include(d) files (included from *.dts) and contain SoC level difinitions (SoC === RK3399 for RockPro64, RK3328 for Rock64).
If you need some grounding about device trees, this is pretty accessible : https://bootlin.com/pub/conferences/2013...ummies.pdf



After setting up a (generic) DTS, you might have to tweak the HDMI resolution and signal with U-boot's fbpanel.
Starting point : https://boundarydevices.com/display-conf...on-u-boot/
Or "screen resolution kernel boot parameters" like "vga=" and "video=" : https://github.com/torvalds/linux/blob/m...meters.txt
#5
I was linked to this thread in the IRC, so I overlooked the title. Didn't realize you were working on a Pro. I assumed we were discussing a regular Rock64. There's a RockPro64 en route to me now, and I'll be working on this issue in the weeks to come. My apologies for the oversight.

Sent from my Pixel 2 XL using Tapatalk
#6
Thank you!

This was exactly what I was looking for, I want to understand as much as possible about creating custom images and porting Linux. Now I have plenty of material to read into. In the branch of the rockchip-linux kernel there is also a DTS for the RockPro64, I will look into how much it resembles Ayufans DTS.

(08-07-2018, 03:02 AM)Tigger Wrote:
(08-06-2018, 03:40 PM)hiccupstix Wrote: To be clear, HDMI support is not working?

In the mainline Linux kernel, there is no HDMI port defined in the device tree of the Rock64.
In the mainline Linux kernel, there is no device tree for the RockPro64 (yet).
See here : https://github.com/torvalds/linux/tree/9...s/rockchip

In the Rockchip Linux kernel (non-mainline) there is : https://github.com/rockchip-linux/kernel...s/rockchip

@mmatyas :
It should be possible to copy the relevant DTS files (or just the relevant DTS entries) from the Rockchip repo to the Arch source, and then (cross) compile Arch with HDMI support.

The following, only if you don't know about device trees. Else skip.

*.dts files contain board level definitions.
*.dtsi files are include(d) files (included from *.dts) and contain SoC level difinitions (SoC === RK3399 for RockPro64, RK3328 for Rock64).
If you need some grounding about device trees, this is pretty accessible : https://bootlin.com/pub/conferences/2013...ummies.pdf



After setting up a (generic) DTS, you might have to tweak the HDMI resolution and signal with U-boot's fbpanel.
Starting point : https://boundarydevices.com/display-conf...on-u-boot/
Or "screen resolution kernel boot parameters" like "vga=" and "video=" : https://github.com/torvalds/linux/blob/m...meters.txt
#7
@mmatyas
If you want to see what's going (wr)on(g) during preboot and boot : https://www.pine64.org/?product=padi-serial-console
#8
Hey, I did the same and installed Arch by modifying one of the Ubuntu images. It doesn't seem too far off to have a straight up Arch port, I think the only bit that's actually left over from the Ubuntu image now is u-boot.

It runs nicely with the default 4.4 ayufan kernel that came with Ubuntu. Surprisingly the 4.18.5 arch mainline kernel came up and even had ethernet, but a bunch of other hardware didn't work, I guess partially due to the missing dtb, partially due to patches not yet in mainline.

Right now I'm running the ayufan 4.18.0-rc8, compiled via https://github.com/ah-/PKGBUILDs (https://github.com/ah-/PKGBUILDs/commit/...bb9839edd0), see core/linux-rockpro64 and just run makepkg in there. After installing the packages you'll need to add the kernel to extlinux.conf:

label arch
kernel /boot/Image
initrd /boot/initramfs-linux.img
devicetreedir /boot/dtbs
append rw panic=10 init=/sbin/init coherent_pool=1M ethaddr=${ethaddr} eth1addr=${eth1addr} serial=${serial#} cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1 root=LABEL=linux-root rootwait rootfstype=ext4

With that it runs really nicely as a server, it's fast and all the hardware I'm using works, including pcie sata.

The HDMI port works somewhat, I get an image but the UI is really slow, I don't get full resolution and the image is quite noisy. I suspect this might be due to me not having any userland installed for the GPU, does anyone know what the Mali GPU needs and how t get it onto Arch?
#9
(08-28-2018, 03:14 PM)ah- Wrote: The HDMI port works somewhat, I get an image but the UI is really slow, I don't get full resolution and the image is quite noisy. I suspect this might be due to me not having any userland installed for the GPU, does anyone know what the Mali GPU needs and how t get it onto Arch?

Code:
libmali-rk-midgard-t86x-r14p0-gbm

?
  • ROCKPro64 v2.1 2GB, 16Gb eMMC for rootfs, SX8200Pro 512GB NVMe for /home, HDMI video & sound, Bluetooth keyboard & mouse. Arch (6.2 kernel, Openbox desktop) for general purpose daily PC.
  • PinePhone Pro Explorer Edition, daily driver, rk2aw & U-boot on SPI, Arch/SXMO & Arch/phosh on eMMC
  • PinePhone BraveHeart now v1.2b 3/32Gb, Tow-boot with Arch/SXMO on eMMC
#10
(08-29-2018, 03:37 AM)dukla2000 Wrote:
Code:
libmali-rk-midgard-t86x-r14p0-gbm

?

Just gave that a go, via https://github.com/apokalypzx/gru-libgl but getting
Code:
[11:55:33.702] Failed to load module: /usr/lib/libweston-5/drm-backend.so: undefined symbol: gbm_bo_get_offset

when trying to start Weston. Searching hasn't really yielded anything yet, but haven't looked for long.

Does anyone know where to get up to date userspace binaries? r14 is about half a year old, and the kernel pieces at https://developer.arm.com/products/softw...ard-kernel are now at r26. However, I can't find r26 binaries anywhere.


Possibly Related Threads…
Thread Author Replies Views Last Post
  yocto for RockPro64 Fide 1 631 01-16-2024, 10:01 AM
Last Post: Fide
  RockPro64 irradium (based on crux linux) riscv64, aarch64 mara 0 306 12-05-2023, 06:35 AM
Last Post: mara
  Installing Ubuntu Server on RockPro64 deutschlmao 2 2,487 10-29-2023, 04:43 PM
Last Post: brotherj4mes
Exclamation Ethernet regression on Linux Kernel 6.5.4? Deathcrow 3 717 09-22-2023, 04:27 AM
Last Post: diederik
  Vanilla mainline Debian 11 (Bullseye) on the RockPro64 Pete Tandy 22 16,715 08-16-2023, 01:34 AM
Last Post: varac
  slarm64 (unofficial slackware) ROCKPro64 RK3399 (aarch64) mara 54 81,801 08-11-2023, 11:13 AM
Last Post: mara
  Installing CH431SER on Ayufan 0.9.14: gitlab-ci-linux-build-159 Thisone 4 1,148 07-14-2023, 04:22 AM
Last Post: hunderteins
  How to enable CoreSight ETM trace on RockPro64 shpark 0 526 05-21-2023, 11:34 PM
Last Post: shpark
  Linux laptop does not detect the board when plugged in via USB soupy 1 3,905 04-13-2023, 03:01 AM
Last Post: Reynold Grady
  Rockpro64 Dead on arrival? quixoticgeek 1 862 03-12-2023, 06:55 PM
Last Post: quixoticgeek

Forum Jump:


Users browsing this thread: 3 Guest(s)