[Feb 26] Recalbox beta v3.1- Rock64 |[Feb 26] Recalbox 190222- RockPro64 / Minimal Debian by mrfixit2001 - 190222 - RockPro64 |[Feb 26] Q4OS 2.7-r2 - Pinebook 1080P / Pinebook |[Feb 22] Batocera Linux 5.20-20190121- RockPro64 | [Feb 19] Manjaro KDE 19.02 / Manjaro LXQT 19.02 - Pinebook1080P / Pinebook | [Feb 19] Slackware Aarch64 Miniroot and XFCE 20190201 - RockPro | [Feb 19] Slackware Aarch64 Miniroot and XFCE 20190201 - Rock64

Project Inspiration | Get Started | IRC Logs | Forum Rules/Policy


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.
Reply
#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.
Reply
#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)
   
Reply
#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
Reply
#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
Reply
#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
Reply
#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
Reply
#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?
Reply
#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, SM961 128GB NVMe for rootfs, HDMI video & sound, Bluetooth keyboard & mouse
Started Bionic minimal - now Cosmic, Openbox desktop for general purpose daily PC.
Reply
#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.
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  slarm64 (unofficial slackware) ROCKPro64 RK3399 (aarch64) mara 20 2,206 03-23-2019, 05:03 PM
Last Post: mara
Big Grin RETRO GAMING: UPDATED RECALBOX FOR THE RK3399 ROCKPRO64 Mrfixit2001 12 668 03-21-2019, 05:02 AM
Last Post: Mrfixit2001
  How to configure optee_os to build for rockpro64 yakman2020 1 100 03-06-2019, 03:49 PM
Last Post: tllim
Star 0.7.9 Linux release from ayufan Luke 48 12,766 02-25-2019, 02:55 PM
Last Post: Luke
  RETRO-GAMING: ANNOUNCING BETA RELEASE OF RECALBOX FOR THE ROCKPRO64 Mrfixit2001 28 1,925 02-22-2019, 04:03 PM
Last Post: Luke
Thumbs Up Batocera for RockPro64 Luke 1 747 02-22-2019, 12:59 AM
Last Post: pineadmin
  IMX214 Linux driver development anykey 0 127 01-26-2019, 07:37 AM
Last Post: anykey
  Linux Server OS Eldin 3 240 01-22-2019, 10:02 PM
Last Post: evilbunny
  Centos 7 for RockPro64 Luke 0 415 01-17-2019, 04:07 AM
Last Post: Luke
Big Grin ANNOUNCING RECALBOX FOR THE ROCKPRO64 - ALPHA RELEASE Mrfixit2001 20 3,363 01-10-2019, 11:42 AM
Last Post: Luke

Forum Jump:


Users browsing this thread: 1 Guest(s)