Since gcc 12, the default RISC-V ISA spec version was bump to 20191213 [1].
This bump introduces a major compatibility issue: support for the csr read/write
(csrr*/csrw*) instructions and fence.i instruction has been separated
from the "I" extension, becoming two standalone extensions: Zicsr and
Zifencei. gcc now has specific -march suffixes to enable those
extensions (_zicsr and _zifencei). If they are not used and code that
uses these instructions is built, one would get errors such as
unrecognized opcode "csrr" (or "fence.i").
For example, without Zifencei we can't build the opensbi
bootloader[2]:
opensbi-1.0/lib/sbi/sbi_tlb.c: Assembler messages:
opensbi-1.0/lib/sbi/sbi_tlb.c:190: Error: unrecognized opcode `fence.i', extension `zifencei' required
As a workaround, the opensbi build system has been patched [3] to use
-march=rv64imafdc_zicsr_zifencei when needed. This workaround doesn't
work in Buildroot due to the local patch
0001-Makefile-Don-t-specify-mabi-or-march.patch which removes -march
from CFLAGS.
In the context of Buildroot, we have decided for now to assume that
all RISC-V cores that are Linux capable will implement the Zicsr and
Zifencei extensions: it is in fact the case today ase these extensions
were part of the I extension, that all cores support. OpenSBI and
Linux are making the same assumption (see [5]).
Therefore, when gcc >= 12, the -march value gets appended with
_zicsr_zifencei.
[1] https://gcc.gnu.org/gcc-12/changes.html
[2] https://github.com/riscv-software-src/opensbi/blob/v0.9/lib/sbi/sbi_tlb.c#L173
[3] https://github.com/riscv-software-src/opensbi/commit/5d53b55aa77ffeefd4012445dfa6ad3535e1ff2c
[4] https://groups.google.com/a/groups.riscv.org/g/sw-dev/c/aE1ZeHHCYf4
[5] http://lists.busybox.net/pipermail/buildroot/2022-July/646698.html
Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Mark Corbin <mark@dibsco.co.uk>
[Thomas: add comment in .mk file, rework commit log]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Port the linux kernel memcpy function for optimizing
the 128 byte align case, this will improve the
performance of large block memcpy.
Here we combine the memcpy of glibc and kernel.
Signed-off-by: Mason Huo <mason.huo@starfivetech.com>
Check if the swap partition ("hibernation") exist or not
before swapon command.
Since the partlabel appears late, change the script
excution sequence to 99.
Signed-off-by: Mason Huo <mason.huo@starfivetech.com>
Port the memcpy & memset implementation from
Linux kerenl to glibc to improve performance of
memory operations in user space.
Signed-off-by: Mason Huo <mason.huo@starfivetech.com>
disable pdump for v1.17
PDUMP was enabled by default. This causes some performance
issues on GPU. Hence, we would need to disable PDUMP in
kernel space and userspace.
Signed-off-by: Andy Hu <andy.hu@starfivetech.com>
For visionfive2, there are two network interface
Add dual network dhcp for the 2nd interface
Signed-off-by: Jianlong Huang <jianlong.huang@starfivetech.com>
install the vdec.ko, venc.ko, jpu.ko to /lib/modules/5.15.0/extra/
and remove the loading script, support insmod,modprobe,rmmod
Signed-off-by: Andy Hu <andy.hu@starfivetech.com>
In ramdisk case, dev/shm and devpts not mounted in ramdisk rootfs,
for the mount commands are not executed in ramdisk rootfs,
this will cause adb shell can't work.
move these commands before execute sbin/init.
Signed-off-by: minda.chen <minda.chen@starfivetech.com>