[Buildroot] Interested in board support for BeagleV-Ahead
Kilian Zinnecker
kilian.zinnecker at mail.de
Thu Aug 10 15:25:00 UTC 2023
Hello Thomas,
[--SNIP--]
> I still have some other problem with the build at the moment, where I have
> to look into (might be my very own fault - the errors about unknown vector
> instructions are back for some reason). But as soon as I have questions or
> news, I will send an update to the ML.
It actually was not my own fault regarding the errors about unknown vector
instructions. It seems that the core of the TH1520 SoC - the Xuantie C910 -
implements a now obsolete version of the RiscV vector extension, namely
version 0.7.1 (see [1]). However, only past gcc version seem to have supported
this vector extension version. Recent gcc versions seem to not support it.
Regarding the Xuantie C906 core, I found out that there now exists some -
mcpu=thead-c906 option (see [2]). However, I was not able to successfully
compile a dummy example with one of the v0.7.1 vector instructions myself,
using that option.
Then I also found a RiscV toolchain, which has some "rvv-0.7.1" branch
(https://github.com/brucehoult/riscv-gnu-toolchain). However, I was not able
to build it (may be my own fault). But anyway the branch seems very old and I
am afraid, if I try to use it, I may run into other issues.
So I decided to accept that I currently have a gcc which does not support the
old 0.7.1 version of the vector extension. Therefore, I disabled vector
extension support in the kernel config. This is part of my current
beaglev_ahead_defconfig:
BR2_GCC_VERSION_13_X=y
BR2_GLOBAL_PATCH_DIR="board/beaglev-ahead/patches"
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/beaglev-ahead/linux.fragment"
The linux.fragment file overwrites the vector extension settings:
CONFIG_VECTOR=n
CONFIG_VECTOR_0_7=n
Now, there was one more error in the custom kernel code: One function's
prototype and its implementation did not match, causing a -Werror=enum-int-
mismatch:
https://git.beagleboard.org/beaglev-ahead/beaglev-ahead-linux/-/blob/beaglev-v5.10.113-1.1.2/drivers/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h#L338
https://git.beagleboard.org/beaglev-ahead/beaglev-ahead-linux/-/blob/beaglev-v5.10.113-1.1.2/drivers/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c#L6144
I changed the prototype accordingly and put a patch for this in my board/
beaglev-ahead/patches/linux directory. After all this, it continued building
till the end.
Now I don't know, whether the compiled uboot, kernel and rootfs would
function. I would have to test this. But to do so, I guess I would have to
figure out how to assemble these parts into an image and how to flash it into
the eMMC of the board.
Best regards,
Kilian
[1] https://ftp.libre-soc.org/466100a052.pdf
[2] https://gcc.gnu.org/onlinedocs/gcc-13.2.0/gcc/RISC-V-Options.html
More information about the buildroot
mailing list