Port Linux Mainline On Khadas VIM

Port linux mainline on Khadas VIM

This tutorial is about how to port linux mainline on Khadas VIM.

Preperations:

Before starting

Create the working directories:

$ install -d ~/project/khadas/ubuntu/{linux,rootfs,archives/{ubuntu-base,debs,hwpacks},images,scripts}
$ cd ~/project/khadas/ubuntu/

Clone the utils repository to fetch the tools for development:

$ git clone https://github.com/khadas/utils.git

Build U-Boot:

Download the U-Boot source tree, take a notice of the branch ubuntu as the option when you run git clone:

$ git clone https://github.com/khadas/u-boot -b ubuntu

You should modify bootargs to support linux mainline:

diff --git a/board/khadas/configs/kvim.h b/board/khadas/configs/kvim.h
index 540b09c..3e9dda2 100644
--- a/board/khadas/configs/kvim.h
+++ b/board/khadas/configs/kvim.h
@@ -88,7 +88,7 @@
     "fb_height=1080\0" \
     "bootdisk=ramdisk\0" \
        "bootargs=" \
-            "root=LABEL=ROOTFS rootflags=data=writeback rw logo=osd1,loaded,0x3d800000,1080p60hz vout=1080p60hz,enable hdmimode=1080p60hz console=ttyS0,115200n8 console=tty0 no_consol
+            "root=/dev/mmcblk0p1 rootflags=data=writeback rw rootwait console=ttyAML0,115200 console=tty0  earlyprintk=aml-uart,0xc81004c0 fsck.repair=yes governor=ondemand no_console_suspend elevator=noop\0" \
     "\0" \
 
 /* boot partition name for dual boot

Build for Khadas VIM:

$ cd u-boot/
$ make kvim_defconfig
$ make -j8 CROSS_COMPILE=aarch64-linux-gnu-

Generated files:

  • fip/u-boot.bin: bootloader blob for eMMC
  • fip/u-boot.bin.sd.bin: bootloader blob for SD card
  • fip/u-boot.bin.usb.tpl: third program loader for USB burning
  • fip/u-boot.bin.usb.bl2: bootloader blob for USB disk(ā€œFIXMEā€)

Build linux mainline:

Fetch the linux mainline repository from Linus Torvaldsā€™s GitHub repository:

$ cd ~/project/khadas/ubuntu/linux
$ git remote add torvalds https://github.com/torvalds/linux.git
$ git fetch torvalds master
$ git checkout remotes/torvalds/master

Configure Ethernet:

$ make ARCH=arm64 defconfig
$ make ARCH=arm64 menuconfig

Configure the following:

CONFIG_NET_VENDOR_STMICRO=y
CONFIG_STMMAC_ETH=y
CONFIG_STMMAC_PLATFORM=y
CONFIG_DWMAC_GENERIC=y
CONFIG_DWMAC_IPQ806X=y
CONFIG_DWMAC_MESON=y

Configure HDMI, add HDMI DTS node:

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts
index 5df1dbc..9083de5 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts
@@ -55,6 +55,29 @@
                        linux,default-trigger = "default-on";
                };
        };
+
+       hdmi-connector {
+               compatible = "hdmi-connector";
+               type = "a";
+
+               port {
+                       hdmi_connector_in: endpoint {
+                               remote-endpoint = <&hdmi_tx_tmds_out>;
+                       };
+               };
+       };
+};
+
+&hdmi_tx {
+       status = "okay";
+       pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
+       pinctrl-names = "default";
+};
+
+&hdmi_tx_tmds_port {
+       hdmi_tx_tmds_out: endpoint {
+               remote-endpoint = <&hdmi_connector_in>;
+       };
 };
 

Disable scpi clock:

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts
index 72c5a9f..ee70893 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts
@@ -135,3 +135,7 @@
        pinctrl-0 = <&uart_ao_b_pins>;
        pinctrl-names = "default";
 };
+
+&scpi_clocks {
+        status = "disabled";
+};

Bulid:

$ cd ~/project/khadas/ubuntu/linux
$ touch .scmversion
$ make -j8 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image amlogic/meson-gxl-s905x-khadas-vim.dtb modules

Build rootfs

Create an SD card with one partition in ext4 format

$ sudo umount /dev/sdb1
$ sudo mkfs.ext4 /dev/sdb1

Mount SD card on /mnt

$ sudo mount /dev/sdb1 /mnt/
$ cd /mnt
$ sudo rm -rf * lost+found/

Download the Ubuntu-base tarball from official Ubuntu website:

$ sudo wget  http://cdimage.ubuntu.com/ubuntu-base/releases/16.04.2/release/ubuntu-base-16.04.2-base-arm64.tar.gz

Extract the ubuntu-base tarball into the mounted folder:

$ sudo tar -xzf ubuntu-base-16.04.2-base-arm64.tar.gz
$ sudo rm -rf ubuntu-base-16.04.2-base-arm64.tar.gz

And now you have already completed the basic rootfs, check it:

$ ls /mnt
bin  boot  dev  etc  home  lib  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var

Install the qemu so you can run chroot to arm64:

$ sudo apt-get install qemu qemu-user-static binfmt-support debootstrap

It would be better for you to understand the qemu on ARM64 first.

Install linux kernel modules

$ cd ~/project/khadas/ubuntu/linux
$ sudo make -j8 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- modules_install INSTALL_MOD_PATH=/mnt

Check it:

$ ls /mnt/lib/modules
4.12.0-rc5
$ ls /mnt/lib/modules/4.12.0-rc5/
build   modules.alias      modules.builtin      modules.dep      modules.devname  modules.softdep  modules.symbols.bin
kernel  modules.alias.bin  modules.builtin.bin  modules.dep.bin  modules.order    modules.symbols  source
$ 

Chroot and setup

Setup the Chroot environment:

$ sudo cp -a /usr/bin/qemu-aarch64-static /mnt/usr/bin/
$ sudo mount -o bind /proc /mnt/proc
$ sudo mount -o bind /sys /mnt/sys
$ sudo mount -o bind /dev /mnt/dev
$ sudo mount -o bind /dev/pts /mnt/dev/pts

Tips:

  • /usr/bin/qemu-arm-static is for 32-bit armhf architecture
  • /usr/bin/qemu-aarch64-static is for 64-bit arm64 architecture

Enter the arm64 Chroot:

$ sudo chroot /mnt/

Note: Now you are in the target emulator.

The first thing must be setup a password for the root user:

# echo root:khadas | chpasswd

Follow the prompts to complete the setup.

You might also want to create an administrator user with ā€˜sudoā€™ permission:

# useradd -G sudo -m -s /bin/bash khadas
# echo khadas:khadas | chpasswd

Tips: The format input line of chpasswd is: ā€˜user_name:passwordā€™. Run man chpasswd for further info.

Setup a hostname for your target device:

# echo Khadas > /etc/hostname
# echo "127.0.0.1    localhost.localdomain localhost" > /etc/hosts
# echo "127.0.0.1    Khadas" >> /etc/hosts

Setup DNS resolver:

# echo "nameserver 127.0.1.1" > /etc/resolv.conf

Fetch the latest package lists from server:

# apt-get update

Upgrade:

# apt-get upgrade

Install the network packages:

# apt-get install ifupdown net-tools

Install udev device manager:

# apt-get install udev

Install packages to suit your taste:

# apt-get install vim sudo ssh

Install initramfs-tools package:

# apt-get install initramfs-tools

Build the ramdisk:

# mkinitramfs -o /boot/initrd.img 4.12.0-rc5

Install fbset package:

# apt-get install fbset

When everything you want to setup has been done, exit the Chroot:

# exit

Generate ramdisk.img

$ sudo cp /mnt/boot/initrd.img /mnt/initrd.img
$ cd ~/project/khadas/ubuntu
$ sudo ./utils/mkbootimg --kernel linux/arch/arm64/boot/Image --ramdisk /mnt/initrd.img -o /mnt/ramdisk.img

Copy dtb to SD card:

$ cd ~/project/khadas/ubuntu
$ sudo cp linux/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dtb /mnt

Umount

Remember to synchronize cached writes to persistent storage first:

$ sudo sync

Umount:

$ sudo umount /mnt/dev/pts
$ sudo umount /mnt/dev
$ sudo umount /mnt/proc
$ sudo umount /mnt/sys
$ sudo umount /mnt

Reference:

Installation

Install U-boot on SD card:

$ umount /dev/sdb1
$ cd ~/project/khadas/ubuntu/u-boot
$ sudo dd if=./fip/u-boot.bin.sd.bin of=/dev/sdb conv=fsync,notrunc bs=1 count=444
$ sudo dd if=./fip/u-boot.bin.sd.bin of=/dev/sdb conv=fsync,notrunc bs=512 skip=1 seek=1
$ sudo eject /dev/sdb

Check it:

Ensure that you have done the right setup of Serial to USB module.

In order to check the bootable SD card, you might also need to make sure that all the data stored in the onboard eMMC has been wipe out.

Reference:

Test

Insert the SD card to VIM board, hit Enter and power on, then you will enter uboot command line.

Setup uboot environment:

kvim# setenv bootcmd "ext4load mmc 0 1080000 ramdisk.img;ext4load mmc 0 5080000 meson-gxl-s905x-khadas-vim.dtb;bootm 1080000 - 5080000"
kvim# save
kvim# reset
9 Likes

hello and thank you,
do you confirm that all this is for building a bootable SD card w/ kernel 4.12.0-rc5 or whatever version you find in mainline at https://github.com/torvalds/linux.git ? (today, it is plain 4.12 )
and add on top ubuntu base 16.04-2 from http://cdimage.ubuntu.com/ubuntu-base/releases or the future versions which will appear there ?

Hi numbqq,

thank you for sharing. I have some remarks/questions.

  • Why do you need to disable scpi_clocks? This will cut off cpu frequency scaling.
  • Iā€™ve tried to run a mainline kernel on the Khadas VIM for a couple of months, I still havenā€™t found a workaround for this tedious network issue.
  • Iā€™ve automated the setup procedure for a number of ARM boards. If there is some interest, I can add (basic, i.e. no GUI) support for other distributions then Ubuntu like Debian 9, Devuan 8, CentOS7 and Fedora 25 for the Khadas VIM.

Will there be a mainline Ubuntu image soon?

Hi ravelo,

I just test 4.12-rc5 and rc6, and I think the newer version is OK, too. But note that when you build ramdisk you
should replace the kernel version number.

# mkinitramfs -o /boot/initrd.img 'kernel-version-number'

Yes, Ubuntu 17.04/10 will coming soon.

Hi umiddelb,
Because I got a kernel panic randomly with scpi_clocks enabled, so disable it before I found why. Does you ever meet this?

[    1.406205] scpi_clocks scpi:clocks: failed to register clock 'vcpu'
omain-0 init dvfs: 4
[    1.415667] Unable to handle kernel NULL pointer dereference at virtual address 000000b8
[    1.418124] pgd = ffff000008fad000
[    1.421507] [000000b8] *pgd=000000006c3fe003, *pud=000000006c3fd003, *pmd=0000000000000000
[    1.429697] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[    1.435200] Modules linked in:
[    1.438223] CPU: 0 PID: 91 Comm: kworker/0:1 Not tainted 4.12.0-rc5 #1
[    1.444687] Hardware name: Khadas VIM (DT)
[    1.448752] Workqueue: events deferred_probe_work_func
[    1.453831] task: ffff80006942db00 task.stack: ffff8000695ec000
[    1.459701] PC is at __clk_create_clk+0x78/0xd0
[    1.464182] LR is at __clk_create_clk+0x70/0xd0
[    1.468666] pc : [<ffff00000848b7c8>] lr : [<ffff00000848b7c0>] pstate: 60000045
[    1.475996] sp : ffff8000695ef160
[    1.479274] x29: ffff8000695ef160 x28: ffff80006c3724e0 
[    1.484535] x27: ffff000008f9b000 x26: 0000000000000000 
[    1.489796] x25: ffff80006967ec80 x24: ffff80006967ec80 
[    1.495057] x23: 0000000000000000 x22: 0000000000000000 
[    1.500319] x21: ffff80006967ec80 x20: ffff80006924a8a0 
[    1.505580] x19: ffff80006924ae80 x18: 0000000000000007 
[    1.510841] x17: 000000000000000e x16: 0000000000000001 
[    1.516102] x15: 0000000000000019 x14: 0000000000000033 
[    1.521363] x13: 000000000000004c x12: 0000000000000020 
[    1.526625] x11: 0000000000000030 x10: 0101010101010101 
[    1.531886] x9 : 0000000000000000 x8 : ffff80006924af00 
[    1.537147] x7 : 0000000000000000 x6 : 000000000000003f 
[    1.542408] x5 : 0000000000000000 x4 : ffff80006942db00 
[    1.547669] x3 : 0000000000000000 x2 : ffff80006942db00 
[    1.552931] x1 : ffff80006924aea8 x0 : 0000000000000000 
[    1.558193] Process kworker/0:1 (pid: 91, stack limit = 0xffff8000695ec000)
[    1.565094] Stack: (0xffff8000695ef160 to 0xffff8000695f0000)
[    1.570788] f160: ffff8000695ef190 ffff00000848c1f4 ffff000008e9b3e8 ffff8000695ef220
[    1.578550] f180: ffff000008e9b000 ffff80006924a400 ffff8000695ef1d0 ffff0000084881ac
[    1.586312] f1a0: 0000000000000000 ffff80006c3d4090 ffff000008c23060 0000000000000000
[    1.594075] f1c0: ffff000008c23050 0000000000000000 ffff8000695ef270 ffff00000848821c
[    1.601837] f1e0: ffff80006967ec80 0000000000000000 ffff000008f99000 ffff000008efd6c8
[    1.609600] f200: ffff80006924ad00 ffff8000695c6e00 00000000000003e8 ffff8000695ef258
[    1.617362] f220: ffff80006c3d6c48 0000000000000001 ffff8000695c7200 ffff80006c3d4090
[    1.625125] f240: ffff80006c3724e0 ffff000008efd6c8 ffff000008f9b000 ffff8000695c7200
[    1.632887] f260: ffff8000695ef290 ffff00000855ebec ffff8000695ef290 ffff00000855ebfc
[    1.640650] f280: ffff000008efd000 ffff8000695c7200 ffff8000695ef2c0 ffff00000855f3e0
[    1.648412] f2a0: ffff80006c3724e0 0000000000000000 000000006924ad00 ffff80006c3724e0
[    1.656175] f2c0: ffff8000695ef2f0 ffff000008777660 ffff80006924ad80 0000000000000000
[    1.663937] f2e0: 0000000005f5e100 00000000000de2b0 ffff8000695ef340 ffff000008776c7c
[    1.671699] f300: 0000000000000000 ffff8000695c6e00 ffff000008f9bdb0 ffff80006c3724e0
[    1.679462] f320: ffff000008f9b000 ffff8000695c6e00 ffff000008f9bdc0 ffff000008775a18
[    1.687225] f340: ffff8000695ef390 ffff00000877718c ffff000008f4ac88 ffff8000695c6e00
[    1.694987] f360: ffff000008e29340 ffff000008e39f40 ffff000008f9bdf0 ffff000008e39000
[    1.702750] f380: ffff000008f9b000 0000000000000000 ffff8000695ef3f0 ffff000008775658
[    1.710512] f3a0: ffff8000695c6e00 0000000000000008 0000000000000000 ffff000008e29000
[    1.718275] f3c0: ffff000008f9bdb0 ffff000008e39000 ffff000008f9b000 ffff8000695c6f18
[    1.726037] f3e0: ffff000008f1a000 00000000ffffffff ffff8000695ef460 ffff000008775c5c
[    1.733800] f400: ffff000008f1ae48 ffff000008efca18 ffff000008f9b000 ffff000008f1a000
[    1.741562] f420: ffff000008f1b400 0000000000000002 0000000000000000 0000000000000000
[    1.749325] f440: ffff800068cae400 00000000ffffffff ffff000008f1b400 0000000108393de8
[    1.757087] f460: ffff8000695ef480 ffff00000854b3e8 ffff000008f1ae48 0000000008efca18
[    1.764850] f480: ffff8000695ef4c0 ffff000008774ad8 ffff000008f1b320 ffff000008f1ad98
[    1.772612] f4a0: ffff8000695ef4c0 ffff800069f47aa0 ffff80006968e268 0000000000000000
[    1.780375] f4c0: ffff8000695ef4f0 ffff000008777278 ffff000008f9bdb0 ffff000008f1b488
[    1.788137] f4e0: ffff000008f9be08 ffff000008c93ce8 ffff8000695ef520 ffff000008777740
[    1.795899] f500: ffff000008f1b400 ffff800068cae810 ffff000008f1b3d8 0000000000000000
[    1.803662] f520: ffff8000695ef530 ffff00000854ec3c ffff8000695ef560 ffff00000854cf3c
[    1.811425] f540: ffff800068cae810 ffff000008f99000 0000000000000000 ffff000008f99000
[    1.819187] f560: ffff8000695ef5a0 ffff00000854d15c ffff000008f1b400 ffff8000695ef640
[    1.826950] f580: ffff800068cae810 0000000000000001 ffff000008efb000 ffff000008f99000
[    1.834712] f5a0: ffff8000695ef5d0 ffff00000854b0b8 0000000000000000 ffff8000695ef640
[    1.842475] f5c0: ffff00000854d0c4 ffff8000695ef640 ffff8000695ef610 ffff00000854cc0c
[    1.850237] f5e0: ffff800068cae810 ffff800068cae870 ffff800068cae810 ffff000008e69f60
[    1.858000] f600: ffff800069f478c8 ffff800068ca6668 ffff8000695ef650 ffff00000854d19c
[    1.865762] f620: ffff800068cae820 ffff000008efc900 ffff800068cae810 ffff000008efc608
[    1.873525] f640: ffff800068cae810 0000000000000001 ffff8000695ef660 ffff00000854c1c0
[    1.881287] f660: ffff8000695ef690 ffff00000854a200 ffff800068cae820 ffff800068cae810
[    1.889050] f680: 0000000000000000 ffff00000854a1f8 ffff8000695ef700 ffff00000854e910
[    1.896812] f6a0: 0000000000000000 ffff800068cae800 ffff800068cae800 ffff800068cae810
[    1.904575] f6c0: ffff000008efc000 ffff000008e4c000 ffff000008e4c000 ffff000008c34890
[    1.912337] f6e0: ffff000008559480 ffff800068cae968 00000000fffedc67 0000000000000000
[    1.920100] f700: ffff8000695ef750 ffff00000854f534 ffff8000695ef7e0 ffff800068cae800
[    1.927862] f720: 0000000000000000 ffff800068cae410 ffff80006c3d6ab8 ffff0000089d80e0
[    1.935625] f740: ffff0000089d7fa0 ffff800068cae800 ffff8000695ef780 ffff000008490d3c
[    1.943387] f760: ffff80006c3d6c48 ffff0000089d80e0 0000000000000000 0000000000000000
[    1.951150] f780: ffff8000695ef830 ffff00000854ec3c ffff000008e9ba40 ffff800068cae410
[    1.958912] f7a0: ffff000008e9ba18 0000000000000000 ffff000008e9ba40 0000000000000001
[    1.966675] f7c0: 0000000000000000 0000000000000000 ffff800068cae3b0 ffff8000695c7168
[    1.974437] f7e0: 0000000000000000 0000000000000000 ffff000008c34890 00000000ffffffff
[    1.982199] f800: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    1.989962] f820: 0000000000000000 0000000000000000 ffff8000695ef860 ffff00000854cf3c
[    1.997725] f840: ffff800068cae410 ffff000008f99000 0000000000000000 ffff000008f99000
[    2.005487] f860: ffff8000695ef8a0 ffff00000854d15c ffff000008e9ba40 ffff8000695ef940
[    2.013250] f880: ffff800068cae410 0000000000000001 ffff000008efb000 ffff000008f99000
[    2.021012] f8a0: ffff8000695ef8d0 ffff00000854b0b8 0000000000000000 ffff8000695ef940
[    2.028775] f8c0: ffff00000854d0c4 ffff8000695ef940 ffff8000695ef910 ffff00000854cc0c
[    2.036537] f8e0: ffff800068cae410 ffff800068cae470 ffff800068cae410 ffff000008e69f60
[    2.044300] f900: ffff800069f478c8 ffff8000691f5c68 ffff8000695ef950 ffff00000854d19c
[    2.052062] f920: ffff800068cae420 ffff000008efc900 ffff800068cae410 ffff800069585c10
[    2.059825] f940: ffff800068cae410 0000000000000001 ffff8000695ef960 ffff00000854c1c0
[    2.067587] f960: ffff8000695ef990 ffff00000854a200 ffff800068cae420 ffff800068cae410
[    2.075350] f980: 0000000000000000 ffff00000854a1f8 ffff8000695efa00 ffff0000087cbf10
[    2.083112] f9a0: ffff800068cae400 ffff800068cae410 ffff800069585c10 ffff80006c3d6b50
[    2.090874] f9c0: 0000000000000000 0000000000000000 ffff800069585c10 0000000000000002
[    2.098637] f9e0: ffff800068cae400 ffff800068cae410 ffff8000695efa20 ffff0000087cc47c
[    2.106400] fa00: ffff8000695efa20 ffff0000087cc4d4 ffff800068cae400 0000000000000000
[    2.114162] fa20: ffff8000695efa60 ffff0000087cc640 0000000000000000 ffff80006c3d6ab8
[    2.121925] fa40: 0000000000000000 0000000000000001 0000000000000000 ffff000008ca0ba0
[    2.129687] fa60: ffff8000695efaf0 ffff0000087cc978 ffff80006c3d6ab8 ffff800069516c18
[    2.137450] fa80: ffff80006c3d6860 0000000000000000 0000000000000000 ffff800069585c10
[    2.145212] faa0: ffff8000695c71b8 0000000000000002 ffff8000695efac0 ffff0000087c902c
[    2.152975] fac0: ffff8000695efaf0 ffff0000087cc98c 00000000ffffffa1 ffff800069516c18
[    2.160737] fae0: ffff80006c3d6860 ffff8000695c7168 ffff8000695efb30 ffff0000087b1800
[    2.168500] fb00: 00000000ffffffa1 ffff800069516c18 ffff000008f1e000 ffff000008a6e3f8
[    2.176262] fb20: 0000000000000002 ffff800069585c10 ffff8000695efc20 ffff00000854ec3c
[    2.184025] fb40: ffff000008f1e150 ffff800069585c10 ffff000008f1e128 0000000000000000
[    2.191787] fb60: ffff000008f1e150 0000000000000001 ffff0000080d7e7c 00000000000001c8
[    2.199550] fb80: ffff80006942db00 ffff8000694d0000 ffff000008f1e150 ffff8000695c7018
[    2.207312] fba0: ffff800069585c00 ffff0000087b1380 ffff0000087b1208 ffff80006c3d6860
[    2.215075] fbc0: 5f6c6d6100000000 006c616d72656874 0000000000000000 ffff00000000038e
[    2.222837] fbe0: 00000000c8013400 00000000c80137ff ffff80006c3dbec0 0000000000000200
[    2.230599] fc00: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    2.238362] fc20: ffff8000695efc50 ffff00000854cf3c ffff800069585c10 ffff000008f99000
[    2.246125] fc40: 0000000000000000 ffff000008f99000 ffff8000695efc90 ffff00000854d15c
[    2.253887] fc60: ffff000008f1e150 ffff8000695efd30 ffff800069585c10 0000000000000001
[    2.261650] fc80: 0000000000000000 0000000000000000 ffff8000695efcc0 ffff00000854b0b8
[    2.269412] fca0: 0000000000000000 ffff8000695efd30 ffff00000854d0c4 ffff8000695efd30
[    2.277175] fcc0: ffff8000695efd00 ffff00000854cc0c ffff800069585c10 ffff800069585c70
[    2.284937] fce0: ffff800069585c10 ffff00000890fbcc ffff800069f478c8 ffff80006961f068
[    2.292700] fd00: ffff8000695efd40 ffff00000854d19c ffff800069585c10 ffff000008efc900
[    2.300462] fd20: ffff800069585c10 ffff000008efc000 ffff800069585c10 0000000000000001
[    2.308225] fd40: ffff8000695efd50 ffff00000854c1c0 ffff8000695efd80 ffff00000854c62c
[    2.315987] fd60: ffff800069585c10 ffff000008efc538 ffff000008efc558 ffff00000854c624
[    2.323750] fd80: ffff8000695efdb0 ffff0000080d7d0c ffff8000694d0000 ffff000008efc568
[    2.331512] fda0: ffff80006c37ac00 ffff80006c37ea00 ffff8000695efdf0 ffff0000080d8064
[    2.339275] fdc0: ffff80006c37ac00 ffff8000694cdb80 ffff8000694d0030 ffff80006942db00
[    2.347037] fde0: ffff80006c37ac20 ffff000008e37000 ffff8000695efe60 ffff0000080ddbf8
[    2.354800] fe00: ffff800069505d80 ffff8000694cdb80 ffff000008f4ef00 ffff80006942db00
[    2.362562] fe20: ffff000008beebf0 ffff8000694d0000 ffff0000080d7e7c ffff800069505db8
[    2.370325] fe40: ffff800069f6bd10 0000000000000000 ffff000008f4ef00 ffff80006942db00
[    2.378087] fe60: 0000000000000000 ffff000008082ec0 ffff0000080ddaf8 ffff8000694cdb80
[    2.385849] fe80: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    2.393611] fea0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    2.401374] fec0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    2.409137] fee0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    2.416899] ff00: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    2.424662] ff20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    2.432424] ff40: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    2.440187] ff60: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    2.447949] ff80: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    2.455712] ffa0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    2.463474] ffc0: 0000000000000000 0000000000000005 0000000000000000 0000000000000000
[    2.471237] ffe0: 0000000000000000 0000000000000000 6f622f8200000000 0000000000000000
[    2.478998] Call trace:
[    2.481415] Exception stack(0xffff8000695eef90 to 0xffff8000695ef0c0)
[    2.487796] ef80:                                   ffff80006924ae80 0001000000000000
[    2.495560] efa0: ffff8000695ef160 ffff00000848b7c8 ffff80006942db80 ffff80006c37b400
[    2.503322] efc0: ffff80006942db00 ffff8000695ef078 ffff8000695eefe0 ffff0000080e33f0
[    2.511085] efe0: ffff8000695ef020 ffff00000890fc84 ffff000008e42b80 ffff80006c37b400
[    2.518847] f000: ffff8000695ef050 ffff000008120130 ffff8000695ef100 ffff8000695ef100
[    2.526610] f020: ffff8000695ef100 ffff80006c374d00 0000000000000000 ffff80006924aea8
[    2.534372] f040: ffff80006942db00 0000000000000000 ffff80006942db00 0000000000000000
[    2.542134] f060: 000000000000003f 0000000000000000 ffff80006924af00 0000000000000000
[    2.549897] f080: 0101010101010101 0000000000000030 0000000000000020 000000000000004c
[    2.557659] f0a0: 0000000000000033 0000000000000019 0000000000000001 000000000000000e
[    2.565425] [<ffff00000848b7c8>] __clk_create_clk+0x78/0xd0
[    2.570944] [<ffff00000848c1f4>] __of_clk_get_from_provider+0xf0/0x12c
[    2.577412] [<ffff0000084881ac>] __of_clk_get_by_name+0xfc/0x114
[    2.583362] [<ffff00000848821c>] clk_get+0x2c/0x70
[    2.588109] [<ffff00000855ebfc>] dev_pm_opp_get_opp_table+0xac/0x11c
[    2.594402] [<ffff00000855f3e0>] dev_pm_opp_add+0x1c/0x64
[    2.599752] [<ffff000008777660>] scpi_init_opp_table+0xb4/0x16c
[    2.605615] [<ffff000008776c7c>] _get_cluster_clk_and_freq_table+0x78/0x174
[    2.612515] [<ffff00000877718c>] bL_cpufreq_init+0x414/0x48c
[    2.618121] [<ffff000008775658>] cpufreq_online+0xbc/0x640
[    2.623555] [<ffff000008775c5c>] cpufreq_add_dev+0x68/0x78
[    2.628989] [<ffff00000854b3e8>] subsys_interface_register+0x84/0xc0
[    2.635285] [<ffff000008774ad8>] cpufreq_register_driver+0x120/0x1bc
[    2.641581] [<ffff000008777278>] bL_cpufreq_register+0x74/0x118
[    2.647446] [<ffff000008777740>] scpi_cpufreq_probe+0x28/0x38
[    2.653140] [<ffff00000854ec3c>] platform_drv_probe+0x50/0xbc
[    2.658831] [<ffff00000854cf3c>] driver_probe_device+0x21c/0x2d0
[    2.664782] [<ffff00000854d15c>] __device_attach_driver+0x98/0xc8
[    2.670820] [<ffff00000854b0b8>] bus_for_each_drv+0x54/0x94
[    2.676340] [<ffff00000854cc0c>] __device_attach+0xc4/0x12c
[    2.681860] [<ffff00000854d19c>] device_initial_probe+0x10/0x18
[    2.687725] [<ffff00000854c1c0>] bus_probe_device+0x90/0x98
[    2.693245] [<ffff00000854a200>] device_add+0x400/0x57c
[    2.698420] [<ffff00000854e910>] platform_device_add+0xb8/0x21c
[    2.704284] [<ffff00000854f534>] platform_device_register_full+0xe8/0x108
[    2.711013] [<ffff000008490d3c>] scpi_clocks_probe+0xd0/0x140
[    2.716705] [<ffff00000854ec3c>] platform_drv_probe+0x50/0xbc
[    2.722397] [<ffff00000854cf3c>] driver_probe_device+0x21c/0x2d0
[    2.728349] [<ffff00000854d15c>] __device_attach_driver+0x98/0xc8
[    2.734386] [<ffff00000854b0b8>] bus_for_each_drv+0x54/0x94
[    2.739906] [<ffff00000854cc0c>] __device_attach+0xc4/0x12c
[    2.745426] [<ffff00000854d19c>] device_initial_probe+0x10/0x18
[    2.751291] [<ffff00000854c1c0>] bus_probe_device+0x90/0x98
[    2.756811] [<ffff00000854a200>] device_add+0x400/0x57c
[    2.761989] [<ffff0000087cbf10>] of_device_add+0x44/0x5c
[    2.767248] [<ffff0000087cc4d4>] of_platform_device_create_pdata+0x80/0xd0
[    2.774061] [<ffff0000087cc640>] of_platform_bus_create+0xe0/0x2fc
[    2.780185] [<ffff0000087cc978>] of_platform_populate+0x48/0xac
[    2.786051] [<ffff0000087b1800>] scpi_probe+0x3a0/0x468
[    2.791225] [<ffff00000854ec3c>] platform_drv_probe+0x50/0xbc
[    2.796917] [<ffff00000854cf3c>] driver_probe_device+0x21c/0x2d0
[    2.802869] [<ffff00000854d15c>] __device_attach_driver+0x98/0xc8
[    2.808906] [<ffff00000854b0b8>] bus_for_each_drv+0x54/0x94
[    2.814426] [<ffff00000854cc0c>] __device_attach+0xc4/0x12c
[    2.819946] [<ffff00000854d19c>] device_initial_probe+0x10/0x18
[    2.825811] [<ffff00000854c1c0>] bus_probe_device+0x90/0x98
[    2.831331] [<ffff00000854c62c>] deferred_probe_work_func+0x78/0xac
[    2.837542] [<ffff0000080d7d0c>] process_one_work+0x124/0x294
[    2.843233] [<ffff0000080d8064>] worker_thread+0x1e8/0x3c8
[    2.848668] [<ffff0000080ddbf8>] kthread+0x100/0x12c
[    2.853585] [<ffff000008082ec0>] ret_from_fork+0x10/0x50
[    2.858846] Code: f9001260 97fff521 f9400280 9100a261 (f9405c02) 
[    2.864999] ---[ end trace 7a19ac7fb82f1325 ]---

Hi umiddelb,
Yes, we have the same issue.

Thanks for your work, just do it, that will be helpfull.

Hi Tommy21,

There is a ubuntu mainline pre-alpha version.

Thanks.

Yes I have. The workaround is performing a hard power cycle instead of a reboot. Have you tried to start a mainline kernel with a mainline u-boot.

@numbqq well you should at try to fix it yourself or at least report to mainline kernel support so the devs who implement it could fix that issue.

I also used myself mainline kernel 4.12-rc7 and did not have such random crash, how do they occur?

This is all covered here.

Which defconfig and which dtb are you using?

I am using ArchLinuxArm packages, this package contains PKGBUILD and other files needed to build kernel under ArchLinuxArm, there you find the config file. The dtb file I also use from that packages, the ā€˜meson-gxl-s905x-khadas-vim.dtbā€™ one.

How to extract that pkg.tar.xz you can find in this how-to

Hi umiddelb,

I have not try mainline uboot yet.

Thanks.

Hi vrabac,

I will try the latest version in next few days to confirm whether this issue is exist or not.

Thanks.

Iā€™ve merged the Archlinux aarch64 defaults into gx_defconfig.

This issue has gone with 4.12.

Yes, i thought about Ubuntu desktop image, not server, i was busy while i was writing this post so i totally forgot about this alpha version.

As i remember usb doesnā€™t work on this version, can this somehow be patched manually using 4.12 or do we have to wait for 4.13 release?

Do Mali drivers work for 4.12, do we get proper hardware acceleration, or we still need to wait for it?

What about changing screen resolution in Ubuntu, will it be possible in the near future?

as you wrote they are defaults, and many stuff will be build which may not be needed by Khadas VIM Pro but until Khadas Stuff donā€™t release they kvim_defconfig it could be a good start.

If you get any crash please report them to linux-amlogic mailing list

Hi umiddelb,

Thanks for your try.