Jump to content

Armbian image and build support for RISC-V.


balbes150

Recommended Posts

Armbian & Khadas are rewarding contributors

@balbes150, thank you for your incredible work on these RISC-V builds.

 

I am using the nezha 20230630-current sid image on my Mango Pi MQ-Pro and it works well.

However there seems to be no vector extension (RVV) support. This makes sense because the vector support in the kernel is not yet included mainline (not even 6.4) as far as I can tell.

Although @msomeone previously reported RVV support in 6.1.0-rc3 and I am curious how that was accomplished.

In any case my `/proc/cpuinfo` does not report the V extension.

$ cat /proc/cpuinfo
processor       : 0
hart            : 0
isa             : rv64imafdc
mmu             : sv39
uarch           : thead,c906
mvendorid       : 0x5b7
marchid         : 0x0
mimpid          : 0x0

$ uname -a
Linux chiyu 6.1.0-rc3-d1 #23.06 Fri Jun 30 21:26:26 MSK 2023 riscv64 GNU/Linux

 

And attempting to run a test program (something like this) that contains a vector instruction will trap and halt the program.

Program received signal SIGILL, Illegal instruction.
add_data_vec_8 () at test.S:9
9           vsetvli t0, a3, e8,m1   # Vectors of 8b

 

I would like some more information about enabling RVV on these boards, if that is possible. I could rebuild my kernel from the master branch using the config in `/boot` (plus enabling the RVV kernel config params), but I don't know if that would get me anywhere.

Edited by wbn
Link to comment
Share on other sites

I went and recompiled the kernel from master using the existing configuration file, `make menuconfig` to turn on the RVV-related params, `make` and then `make bindeb-pkg` to generate dpkg archives.

 

But no luck - installing the packages prevented my Mango Pi from booting so I'm on my backup SD card. I'm not able to connect to uart0 either, so I'm rather in the dark on what is going wrong during the boot process. I'll leave my modified kernel config file here for anyone who's interested, and keep experimenting with kernel builds.

config-6.4.0+

Link to comment
Share on other sites

3 hours ago, Superkoning said:

@wba did you read & watch 

 

It seems like a big task. But what can I say: that youtube video was already too complicated for me.

 

Other posts https://www.reddit.com/r/RISCV/new/ seem to indicate it also involves the compiler and other tools

 

Thanks. No, I didn't see that before. Having watched a bit of it, now I understand that there is a difference between the vector ISA extension implemented by the T-head core inside the D1 (0.7.1-draft) and the vector ISA extension targeted by the mainline kernel (1.0.0).

 

I failed to catch this up until now. Well, it's not mentioned anywhere on the linux-sunxi wiki page for the D1, which is odd. But now looking through the comments on Reddit and Youtube and some kernel mailing list threads etc. I see that there has been an ongoing discussion about this for a while.

 

In any case, of course this means that just compiling a mainline kernel with RVV support flags enabled won't make vector work on my Mango Pi MQ-Pro. Also, it won't do to use any random test program for RVV to test the D1's vector instructions, since those are likely to target the 1.0.0 spec as well. It looks like there are some demo programs that target the spec implemented by T-head specifically (xuantie-vector-demos), so I will try with those instead. But I don't expect to make much progress in light of this...

Link to comment
Share on other sites

Version 20230930-current for Nezha and other models based on Allwinner D1.

U-boot has changed. Added support for direct system startup from USB. This will make it easy to run additional systems without changing the SD card, simply by connecting a USB flash drive with the new system. Launch from USB on Nezha and Mangope MQ Pro models has been tested. On theLicheRVr model, the USB flash drive has not been determined, perhaps another USB flash drive model is needed.

Link to comment
Share on other sites

Good afternoon, there was a problem when assembling the image for the Lichee RV Nezha board on the Ubuntu system 04.22.3 

error ] ERROR in function compile_uboot [ main.sh: 588 -> main.sh:481 -> compilation.sh:238 -> general.sh:0 ]

error ]U-boot compilation failed

Spoiler

[ o.k. ] Prepare config [ grub-riscv64-d1 ]rinting                       │ │  
[ o.k. ] Prepare config Ubuntu [ grub-riscv64-d1 ]esktop                 │ │  
[ o.k. ] Preparing [ host ]               Shells                         │ │  
[ o.k. ] Build host OS release [ jammy ]  System-info-tools              │ │  
[ .... ] Installing build dependencies    Terminals                      │ │  
[ o.k. ] Syncing clock [ host ]──────────────────────────────────100%────┘ │  
[ o.k. ] Checking for external GCC compilers ──────────────────────────────┤  
[ warn ] Low free space left [ 4 GiB ]     <Cancel>                        │  
Press <Ctrl-C> to abort compilation, <Enter> to ignore and continue────────┘  
    
[ o.k. ] Downloading sources 
[ o.k. ] Checking git sources [ u-boot d1-wip ]
[ .... ] Up to date 
[ o.k. ] Checking git sources [ linux-riscv riscv/d1-wip ]
[ .... ] Up to date 
[ o.k. ] Cleaning /home/arti/Desktop/sipeed/build/output/debs for [ nezha current ]
[ o.k. ] Cleaning [ u-boot/d1-wip ]
[ o.k. ] Compiling u-boot [ 2024.01-rc1 ]
[ o.k. ] Compiler version [ riscv64-linux-gnu-gcc 11 ]
[ .... ] Checking out to clean sources 
[ o.k. ] Cleaning [ u-boot/d1-wip ]
[ o.k. ] Started patching process for [ u-boot d1-nezha-current ]
[ o.k. ] Looking for user patches in [ userpatches/u-boot/u-boot-nezha ]
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  YACC    scripts/kconfig/zconf.tab.c
  LEX     scripts/kconfig/zconf.lex.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
scripts/kconfig/conf  --syncconfig Kconfig
  UPD     include/config.h
  CFG     u-boot.cfg
  GEN     include/autoconf.mk.dep
  CFG     spl/u-boot.cfg
  GEN     include/autoconf.mk
  GEN     spl/include/autoconf.mk
  ENVC    include/generated/env.txt
  UPD     include/generated/timestamp_autogenerated.h
  ENVP    include/generated/env.in
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  PYMOD   rebuild
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  LEX     scripts/dtc/dtc-lexer.lex.c
  YACC    scripts/dtc/dtc-parser.tab.h
  YACC    scripts/dtc/dtc-parser.tab.c
  ENVT    include/generated/environment.h
  CC      lib/asm-offsets.s
  CC      arch/riscv/lib/asm-offsets.s
[ error ] ERROR in function compile_uboot [ main.sh:588 -> main.sh:481 -> compilation.sh:238 -> general.sh:0 ]
[ error ] U-boot compilation failed 
[ o.k. ] Process terminated

 

Link to comment
Share on other sites

I would like to master embedded linux and learn how to collect images, specifically in version 20230930 I can’t enable uart through the dts file and I decided that it would be more correct to add the image in the assembly, but the image is not assembled without changes. (I apologize for my English, I'm using a translator)

 

Link to comment
Share on other sites

Hi there,

 

just to clarify; all of you having wlan0 up and running, are you using an USB adapter or the RVdock built in wifi chip

 

I'min the same situation as noticed here:

 

 

I'm using 23_09_sid_edge_6.6.0, and gotsame problem with current 6.1

 

 

-------------EDIT----------------

 

Got it working finally.

 

For any unknow reason, the arbiam setup script at first boot didn't finished totaly.

I have burned a new SD card with 23_09_sid_edge_6.6.0

and everything (at least Wifi) is fine.

 

Thank you @balbes150 great job

Edited by le51
Link to comment
Share on other sites

Attempting to build this image gives me the following error:

 

[🐳|🔨]   Image 'itb' is missing external blobs and is non-functional: opensbi
[🐳|🔨]
[🐳|🔨]   /binman/itb/fit/images/opensbi/opensbi (fw_dynamic.bin):
[🐳|🔨]      See the documentation for your board. The OpenSBI git repo is at
[🐳|🔨]      https://github.com/riscv/opensbi.git
[🐳|🔨]      You may need to build fw_dynamic.bin first and re-build u-boot with
[🐳|🔨]      OPENSBI=/path/to/fw_dynamic.bin
[🐳|🔨]
[🐳|🔨]   Some images are invalid
[🐳|🔨]   make: *** [Makefile:1124: .binman_stamp] Error 103

 

Any help would be appreciated.

Link to comment
Share on other sites

Posted (edited)

balbes150,

There is something wrong with performance. I am trying "Armbian_23.09_Nezha_sid_current_6.1.0_xfce_desktop.img.xz"

Doing my simplest performance test:

dd if=/dev/zero bs=1M count=256 | md5sum

The result is 21 MB/sec.

Moving windows in Xfce is really sluggish, even after disabling compositor, leaves trail on screen and lags behind mouse movement.

 

Compared to "licheerv-debian-clean-hdmi.zst" from https://linux-sunxi.org/Sipeed_Lichee_RV#Pre-made_images (last in the list).

Using kernel 5.18.

The same benchmark returns 51 MB/sec. Moving windows is very responsive.

Edited by rm_
Link to comment
Share on other sites

Tried "Armbian_22.08.0-trunk_Nezha_sid_current_5.19.0_xfce_desktop.img.xz", the result there is much better, 49 MB/sec.

But the WiFi onboard of LicheeRV Dock is not detected.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines