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

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!