4
0
luojia65 e36ce84563 Version 0.1.0 4 жил өмнө
..
.cargo c62c38b4f5 K210 support 4 жил өмнө
src fc77821ca6 Save readme for K210 4 жил өмнө
.gitignore 1412cd4088 Small fix 4 жил өмнө
Cargo.toml e36ce84563 Version 0.1.0 4 жил өмнө
README.md fc77821ca6 Save readme for K210 4 жил өмнө
build.rs c62c38b4f5 K210 support 4 жил өмнө
justfile 3f5041485a Boot on k210 4 жил өмнө
kendryte-k210.dtsi af787c9249 K210 device tree configuration 4 жил өмнө
link-k210.ld 267729b1ad multiboot on k210 4 жил өмнө

README.md

K210 support module

Kendryte K210 is a dual-core RISC-V RV64GC chip with hardware accelerated AI peripheral. According to its manual, K210 is taped out in TSMC 7nm and can speed up to 400MHz.

The K210 SoC implements version 1.9.1 of RISC-V's privileged specification. This version differents from latest version (by current version 1.11) in the following aspects:

  1. Register sstatus.sum (in 1.11) or sstatus.pum (in 1.9) bits;
  2. Instruction sfence.vma (1.11) or sfence.vm (1.9), register satp (1.11) or sptbr (1.9);
  3. There's no S-level external interrupt in 1.9, but there is in 1.11;
  4. Independent page fault exceptions does not exist in 1.9, but they exist in 1.11.

To prolong lifecycle of K210 chip we uses RustSBI as a compatible layer. We emulate sfence.vma using sfence.vm to solve issue 2. We modify regster values to solve issue 4. For issue 3, we introduce an SBI call local to RustSBI to register S-level interrupt handler by the supervisor itself. The issue 1 should left to be concerned by supervisors above SBI implementations.

Machine external handler and timer set calls is modified to meet the requirement of custom S-level interrupt handlers.

If there are mistakes or missing features in current support module, we welcome further contributions!