Port Linux Mainline On Khadas VIM

It’s all there, feedback welcome.

1 Like

Do you use mainline u-boot? Does it work without issue on Khadas VIM Pro (also enabling multiboot)?

Hi umiddelb,

Thanks a lot, I’ll have a try.

I haven’t tried mainline u-boot so far (I don’t even know how to build it for the Khadas VIM).

Hi,
Can someone else also test this patch it is only dts change on Khadas VIM? I am currently not able to test.

Edit:
Forget to wrote that this patch should fix Ethernet problem with downloading large files or doing git clone linux repository!

Hi vrabac,

I just apply this patch to Vim_Ubuntu-server-16.04_Linux-Mainline-4.12-rc6_V170624_Pre-alpha.7z,

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
index f85898d..527baf9 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
@@ -549,6 +549,7 @@
                                compatible = "ethernet-phy-id0181.4400", "ethernet-phy-ieee802.3-c22";
                                reg = <8>;
                                max-speed = <100>;
+                               eee-broken-100tx;
                        };
                };

and use scp to download a file about 30 times, it is all ok.

root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  16.1MB/s   00:02    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  16.1MB/s   00:02    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# 

Without this patch,just stalled in the 5th time:

root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .      
nick@192.168.1.253's password: 
test-file                                     100%   32MB  16.1MB/s   00:02    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                      11% 3648KB   1.0MB/s - stalled -^Croot@Khadas:~# 
root@Khadas:~# 

Thanks.

OK, I tried more times with this patch, and got stalled, too.Maybe more patches needed?

root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  16.1MB/s   00:02    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                     100%   32MB  10.7MB/s   00:03    
root@Khadas:~# scp nick@192.168.1.253:/home/nick/test-file .
nick@192.168.1.253's password: 
test-file                                      37%   12MB   2.6MB/s - stalled -^Croot@Khadas:~# ^C
root@Khadas:~# 

The Issue is still there … (The fix for the GXBB is somehow more complex).

Hi,

This is a great howto !

I made a 4.12 patchset to add the WiP Audio and CEC support:


The git tree is also available at:

A LibreELEC port is also coming !

I officially added HDMI support to Khadas VIM for 4.13, one patch less to have !!

If someone can have a try !!

6 Likes

@umiddelb
To fix large file stall I changed 4.12.0 drivers/net/phy/realtek.c RTL8211F code to equal the 3.14.29 amlogic/ethernet/phy/am_realtek.c code and now the networking works without TCP stalls.

Of course some of the 4.12.0 drivers/net/phy/realtek.c code must have had a good reason of being.

In fact, 30 min later I do get crashes using ext4 NBD network drive.

Do you still get these randomly kernel panic with scpi_clocks enabled? If you do please post it to mailing list to try solve the issue don’t just disable it.

@Khadas Stuff please work on mainline kernel fix the stuff in mainline, don’t just patch out of three source, is only way to go…

Well maybe GXBB is just more complex then GXL. One of the Dev did test that patch above and he did not get any networt stalle problems.
I would need to find another mSD card to do some tests with ArchLinuxArm.

The GXL on the Khadas does not use the realtek PHY and the driver either, it uses a custom internal PHY.

The code upstream is mainly similar, the only tweaks Amlogic added is some fixes to always report the correct PHY Link status, no special code is added on GXL for stabilty issues.

1 Like

You have specified changes for branch morty-next. In the user specified branch morty. Perhaps the instructions should be changed to morty-next ?

git clone https://github.com/superna9999/meta-meson.git meta-meson -b morty

Also setting tx-delay 4 in meson-gxbb-p200.dts fixes my minimx-g realtek network stall problem.
Thanks to xdarklight #linux-amlogic IRC.

That don’t help the Khadas VIM user. But good to know.

Namrstrong wrote it already above…
The GXL on the Khadas does not use the realtek PHY and the driver either, it uses a custom internal PHY.

hi,
does it make sense to imagine to flash it to emmc instead of SD ?
if so, how to do that ?
tks

as of today, patching of meson-gxl-s905x-khadas-vim.dts as said in…

Configure HDMI, add HDMI DTS node:

is no more required as the linus source code (commit >= 954e6e0) already include them!

1 Like

hello @Gouwa @numbqq and all,

I managed to build an image with linux kernel 4.12.0 (mainline) and ubuntu 16.04.2 following this present tutorial up to some point, and then using the fenix intructions for generating the image for EMMC.

Alas, in USB_Burning_tool on windows, I get an error
[0x30402004] uboot/partition ramdisk/initialize partition Error

the fact is, I had to build a 1300MB rootfs instead of the 500MB the fenix tuto is expecting,
so configuration for EMMC burning probably need some adjustment ?

can someone please confirm that and tell me how to succeed in burning this bigger image to EMMC of a vim pro ?

thanks you,
good day.

1 Like

1GB+ is normal size for ubuntu desktop rootfs, what our official release also comes with more than 1GB, not the 500MB you said.

But currently, fenix scripts is just for server, not for desktop built, as the chroot will get issues when install some deb package of desktop (seems to depending on some features).

So I’m not quite sure did you correctly run the fenix scripts to build ubuntu desktop? Following are steps for us to build desktop:

  1. build server image first
  2. burn into VIM device
  3. boot VIM and install desktop deb packages locally
  4. backup and tarball the rootfs with desktop environment
  5. copy the rootfs image to host PC, and replace the rootfs image of server build created in step 1
  6. tarball the new desktop update image again

Back to your issues, it should be other issues about ramdisk image, can you kindly post the printing log when you burned the image?