Source-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: src/sys/arch/riscv
Module Name: src
Committed By: thorpej
Date: Sun Oct 12 04:08:26 UTC 2025
Modified Files:
src/sys/arch/riscv/include: pmap.h pte.h sysreg.h
src/sys/arch/riscv/riscv: bus_space.c cpu.c genassym.cf locore.S
pmap_machdep.c riscv_machdep.c
Log Message:
Deal with the non-standard XTheadMae (Memory Attribute Extensions)
present on some T-Head CPU cores, notably the one found in the
Allwinner D1 SoC.
This extension allows memory attributes (cacheable, bufferable,
strongly-ordered, etc.) to be specified on a per-mapping basis.
Alas, it has two unfortunate properties:
- It uses the same bits as the standard Svpbmt (Page Based Memory Types)
extension, and the bits are completely incompatible.
- Unlike Svpbmt, which if none of its extension bits are set in the
PTE, results in rational behavior, if you don't set the XTheadMae
attibutes in the PTE correctly, the system will blow up in your face
in interesting and unpredictable ways.
So, we have to probe for XTheadMae early, when we're setting up the
initial MMU tables so that the kernel is mapped correctly when the
MMU is enabled, and then we probe for it again to set some globals
that are used when creating PTEs for new kernel and user mappings
going forward. Luckily, there are combinations of XTheadMae attributes
that map reasonably well to the Svpbmt types, so Svpbmt is used as
the abstraction.
With this, my D1 Nezha board boots to the root device prompt. \o/
To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/riscv/include/pmap.h
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/riscv/include/pte.h
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/riscv/include/sysreg.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/riscv/riscv/bus_space.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/riscv/riscv/cpu.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/riscv/riscv/genassym.cf
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/riscv/riscv/locore.S
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/riscv/riscv/pmap_machdep.c
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/riscv/riscv/riscv_machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Home |
Main Index |
Thread Index |
Old Index