🛠 Le C906 sous le capot : errata T-Head, OPP 408/1008 MHz, thermique et vector

Sipeed Lichee RV Dock (Allwinner D1 / T-Head XuanTie C906) · avance · Schéma : IMG-sipeed-lichee-rv-dock-avance-3-licheerv-c906-errata-perf.svg — coupe conceptuelle du SoC Allwinner D1 : cœur T-Head XuanTie C906 RV64 avec extension vectorielle xtheadvector, correctifs d'errata du noyau (CMO, PMU, MAE, GHOSTWRITE), deux points OPP 408 MHz et 1008 MHz à 0,9 V, capteur thermique avec seuils 85 °C passif et 100 °C critique

Objectives

The D1 is a T-Head XuanTie C906 core: RV64IMAFDC + vendor vector extension xtheadvector (pre-RVV 1.0, vlenb=16), sv39 MMU, 32 KB I/D caches, PLIC thead,c900. This core has specificities that the mainline kernel fixes via arch/riscv/errata/thead/errata.c: CPU IDs returned as 0, absence of standard CMO instructions (the kernel uses vendor ops th.dcache.*), PMU erratum, MAE addressing mode, and the speculative GHOSTWRITE vulnerability related to xtheadvector. This advanced tutorial: observe all this from the system, tune the OPPs (408 MHz / 1008 MHz @ 0.9 V), monitor the thermal threshold (85 °C passive, 100 °C critical) and measure the impact of compilation choices on this atypical core.

Hardware

Complete code

# 1) Identité CPU — le C906 ment sur ses registres d'identification :
dmesg | grep -iE 'errata|thead|c9'
cat /proc/cpuinfo            # uarch « thead,c906 » ; mvendorid/marchid à 0 (errata)

# 2) Fréquence : deux OPP seulement (408 MHz et 1008 MHz @ 0,9 V)
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
echo performance | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq   # ~1008000 kHz en pleine charge

# 3) Thermique : seuils mainline 85 °C (passif/throttle) et 100 °C (critique)
watch -n2 'cat /sys/class/thermal/thermal_zone*/temp'   # milli-°C
stress-ng --cpu 1 --timeout 300 &     # la fréquence doit baisser près de 85 °C

# 4) Vectoriel : le C906 expose xtheadvector (0.7.1), PAS rvv-1.0 :
#    un binaire compilé avec -march=rv64gcv (RVV standard) refusera la
#    partie vectorielle ; les toolchains T-Head (XTheadVector) ciblent le 0.7.1.
cat /proc/sys/abi/* 2>/dev/null | head -3
gcc -Q --help=target | grep -i march   # ce que le gcc natif accepte

# 5) Benchmark mono-cœur honnête (1 cœur, 512 MB : comparer vos flags)
gcc -O2 -march=rv64imafdc -o bench bench.c && ./bench
gcc -O3 -march=rv64gc -o bench2 bench.c && ./bench2   # éviter -march=rv64gcv ici

Expected verification

dmesg displays lines for applied T-Head errata (CMO/PMU/MAE/GHOSTWRITE depending on the kernel) — proof that the kernel recognizes the C906 despite its IDs being 0. scaling_available_frequencies lists exactly 408 MHz and 1008 MHz; under full load the CPU holds 1008 MHz then drops when the 85 °C passive threshold is reached (visible in the thermal log). A standard -march=...v binary raises an illegal instruction or ignores vector operations: the C906 does not speak RVV 1.0. RAM caps at ~460-500 MB usable (512 MB DDR3 in-package).

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials