Giter VIP home page Giter VIP logo

linux-cwt-starfive-vf2's Introduction

Linux Kernel for StarFive VisionFive 2 Arch Linux Image

The PKGBUILD file in this repository is used to build the Linux kernel for the StarFive VisionFive 2 board running Arch Linux. The kernel source code is available at https://github.com/starfive-tech/linux/. The configuration is based on the previous version of cwt images.

Building the Kernel

The kernel can be built natively on the VisionFive 2 itself, just like any other Arch package. Follow these steps to build the kernel:

$ git clone https://github.com/cwt-vf2/linux-cwt-starfive-vf2.git
$ cd linux-cwt-starfive-vf2
$ makepkg

Alternatively, you can build the kernel on any x86_64 PC via Docker or Podman. Assuming your userid (id -u) is 1000, which is the default id for the first non-root user on many other Linux distros, follow these steps:

$ git clone https://github.com/cwt-vf2/linux-cwt-starfive-vf2.git
$ cd linux-cwt-starfive-vf2
$ podman build -t vf2-arch-build docker

After building the podman or docker image, you can start building the kernel using the following commands:

$ podman run --rm -it -v ./:/build/ --userns=keep-id --user=user vf2-arch-build sh -c "CROSS_COMPILE='riscv64-linux-gnu-' makepkg -s --config /build/docker/makepkg.conf"

linux-cwt-starfive-vf2's People

Contributors

andrewgigena avatar cwt avatar dodomorandi avatar leon332157 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

linux-cwt-starfive-vf2's Issues

Request new updates to be published in AUR

Now AUR has two packages about visionfive2(linux-515-starfive-visionfive2 and linux-515-starfive-visionfive2-headers), but they need to be compiled during installation.

Now updating the kernel requires manually downloading pkg.tar.zst and then pacman -U xxx.

If there is a bin package, upgrading will become very simple.

6.6.20-cwt-5.12.0-{1,2} generate kernel stack trace at boot

FYI, no idea if this is important, but the following stack trace is generated from the latest cwt kernel at boot.

[    2.516004] ------------[ cut here ]------------
[    2.516008] WARNING: CPU: 1 PID: 1 at drivers/reset/core.c:766 __reset_control_get_internal+0xd4/0x11c
[    2.516024] Modules linked in:
[    2.516030] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 6.6.20-cwt-5.12.0-1 #1
[    2.516036] Hardware name: StarFive VisionFive 2 v1.3B (DT)
[    2.516039] epc : __reset_control_get_internal+0xd4/0x11c
[    2.516044]  ra : __of_reset_control_get+0x10e/0x172
[    2.516049] epc : ffffffff805f50f0 ra : ffffffff805f5246 sp : ffffffc8000238f0
[    2.516053]  gp : ffffffff819293b0 tp : ffffffd8c0095940 t0 : 0000000000000000
[    2.516057]  t1 : 0000000000000000 t2 : 0000000000000006 s0 : ffffffc800023940
[    2.516061]  s1 : ffffffd8c4800080 a0 : ffffffd8c3fdc340 a1 : 0000000000000002
[    2.516064]  a2 : 0000000000000001 a3 : 0000000000000000 a4 : 0000000000000001
[    2.516067]  a5 : 0000000000000000 a6 : 000000000000000a a7 : 00000000000002e1
[    2.516071]  s2 : 0000000000000002 s3 : ffffffd8c3fdc360 s4 : ffffffd8c3fdc340
[    2.516074]  s5 : 0000000000000000 s6 : 0000000000000001 s7 : 0000000000000000
[    2.516077]  s8 : ffffffd8c0177810 s9 : fffffffffffff000 s10: 0000000000000000
[    2.516080]  s11: 0000000000000000 t3 : ffffffffffffffff t4 : ffffffffffffffff
[    2.516084]  t5 : 0000000000000001 t6 : 0000000000000040
[    2.516087] status: 0000000200000120 badaddr: 0000000000000000 cause: 0000000000000003
[    2.516091] [<ffffffff805f50f0>] __reset_control_get_internal+0xd4/0x11c
[    2.516097] [<ffffffff805f5246>] __of_reset_control_get+0x10e/0x172
[    2.516102] [<ffffffff805f52de>] __reset_control_get+0x34/0x18a
[    2.516107] [<ffffffff805f5b9a>] __reset_control_bulk_get+0x4a/0xdc
[    2.516113] [<ffffffff805f5c86>] __devm_reset_control_bulk_get+0x5a/0x9a
[    2.516118] [<ffffffff80b86e74>] stfcamss_probe+0x296/0xe92
[    2.516127] [<ffffffff8070c196>] platform_probe+0x52/0xb6
[    2.516137] [<ffffffff80709cb4>] really_probe+0x84/0x234
[    2.516144] [<ffffffff80709ec0>] __driver_probe_device+0x5c/0xdc
[    2.516150] [<ffffffff80709f6c>] driver_probe_device+0x2c/0xb2
[    2.516156] [<ffffffff8070a0ec>] __driver_attach+0x6c/0x11a
[    2.516163] [<ffffffff80707e98>] bus_for_each_dev+0x58/0xa6
[    2.516170] [<ffffffff80709706>] driver_attach+0x1a/0x22
[    2.516176] [<ffffffff80709072>] bus_add_driver+0xd0/0x1ba
[    2.516182] [<ffffffff8070ad96>] driver_register+0x40/0xda
[    2.516188] [<ffffffff8070bf3c>] __platform_driver_register+0x1e/0x26
[    2.516196] [<ffffffff80c2e4fc>] stfcamss_init+0x1a/0x22
[    2.516204] [<ffffffff800020ee>] do_one_initcall+0x36/0x1fa
[    2.516210] [<ffffffff80c014ba>] kernel_init_freeable+0x21e/0x286
[    2.516220] [<ffffffff80b8b8be>] kernel_init+0x26/0x11a
[    2.516225] [<ffffffff80b93f96>] ret_from_fork+0xe/0x1c
[    2.516232] ---[ end trace 0000000000000000 ]---
[    2.516259] [st_camss] error: Failed to get reset controls

The system runs OK.

GPU firmware is missing

The command in the hook file ( /usr/share/libalpm/hooks/90-linux.hook) will rebuild the initrd image ( /boot/initramfs-linux.img), but it won’t include the GPU firmware files.

Slow performance on Ethernet and Gigabit

On 1.2A I see around 30 MBit/s on both ports.
Latest Firmware, latest image.

Linux pilotlight 5.15.2-cwt-5.10.3-1 #1 SMP PREEMPT Sat Dec 30 19:58:40 +07 2023 riscv64 GNU/Linux

Ethernet (left port):

-----------------------------------------------------------
Server listening on 5201 (test #1)
-----------------------------------------------------------
Accepted connection from 10.5.50.185, port 48576
[  5] local 10.5.200.234 port 5201 connected to 10.5.50.185 port 48582
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  4.25 MBytes  35.6 Mbits/sec                  
[  5]   1.00-2.00   sec  4.25 MBytes  35.7 Mbits/sec                  
[  5]   2.00-3.00   sec  4.38 MBytes  36.7 Mbits/sec                  
[  5]   3.00-4.00   sec  4.38 MBytes  36.7 Mbits/sec                  
[  5]   4.00-5.00   sec  4.38 MBytes  36.7 Mbits/sec                  
[  5]   5.00-6.00   sec  4.25 MBytes  35.7 Mbits/sec                  
[  5]   6.00-7.00   sec  4.38 MBytes  36.7 Mbits/sec                  
[  5]   7.00-8.00   sec  4.38 MBytes  36.7 Mbits/sec                  
[  5]   8.00-9.00   sec  4.38 MBytes  36.7 Mbits/sec                  
[  5]   9.00-10.00  sec  3.25 MBytes  27.3 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.01  sec  42.2 MBytes  35.4 Mbits/sec                  receiver
-----------------------------------------------------------
Server listening on 5201 (test #2)
-----------------------------------------------------------

Gigabit (right port):

-----------------------------------------------------------
Server listening on 5201 (test #1)
-----------------------------------------------------------
Accepted connection from 10.5.50.185, port 44348
[  5] local 10.5.200.233 port 5201 connected to 10.5.50.185 port 58910
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  3.62 MBytes  30.4 Mbits/sec                  
[  5]   1.00-2.00   sec  3.88 MBytes  32.5 Mbits/sec                  
[  5]   2.00-3.00   sec  3.88 MBytes  32.5 Mbits/sec                  
[  5]   3.00-4.00   sec  3.75 MBytes  31.5 Mbits/sec                  
[  5]   4.00-5.00   sec  2.62 MBytes  22.0 Mbits/sec                  
[  5]   5.00-6.00   sec  2.62 MBytes  22.0 Mbits/sec                  
[  5]   6.00-7.00   sec  3.75 MBytes  31.4 Mbits/sec                  
[  5]   7.00-8.00   sec  3.75 MBytes  31.5 Mbits/sec                  
[  5]   8.00-9.00   sec  3.88 MBytes  32.5 Mbits/sec                  
[  5]   9.00-10.00  sec  2.75 MBytes  23.1 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.01  sec  34.5 MBytes  28.9 Mbits/sec                  receiver
-----------------------------------------------------------
Server listening on 5201 (test #2)
-----------------------------------------------------------

Headers is missing the VDSO

When try to build an external kernel module, I got this error:

==> Starting build()...
make -C /usr/lib/modules/5.15.2-cwt-3.6.1-2/build M=/home/cwt/Projects/Arch/cryptodev-linux/src/cryptodev-linux-cryptodev-linux-1.13 modules
scripts/Makefile.build:44: arch/riscv/kernel/vdso/Makefile: No such file or directory
make[2]: *** No rule to make target 'arch/riscv/kernel/vdso/Makefile'.  Stop.
make[1]: *** [arch/riscv/Makefile:124: vdso_prepare] Error 2
make: *** [Makefile:30: build] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

unrecognized command-line option ‘-Qunused-arguments’

Thank you very much for your efforts.

I encountered a problem when compiling the kernel module.

make -C /lib/modules/5.15.2-cwt-3.7.5-1/build M=/root/hackernel/core/kernel-space modules
gcc: error: unrecognized command-line option ‘-Qunused-arguments’
make[2]: *** [scripts/Makefile.build:392: arch/riscv/kernel/vdso/vdso.lds] Error 1
make[1]: *** [arch/riscv/Makefile:124: vdso_prepare] Error 2
make: *** [Makefile:22: release] Error 2

It seems that it may also be related to #2.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.