Skip to content

Commit dbfbda3

Browse files
xhackerustcpalmer-dabbelt
authored andcommitted
riscv: mm: update T-Head memory type definitions
Update T-Head memory type definitions according to C910 doc [1] For NC and IO, SH property isn't configurable, hardcoded as SH, so set SH for NOCACHE and IO. And also set bit[61](Bufferable) for NOCACHE according to the table 6.1 in the doc [1]. Link: https://github.com/T-head-Semi/openc910 [1] Signed-off-by: Jisheng Zhang <[email protected]> Reviewed-by: Guo Ren <[email protected]> Tested-by: Drew Fustini <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 7f00a97 commit dbfbda3

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

arch/riscv/include/asm/pgtable-64.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,18 @@ enum napot_cont_order {
126126

127127
/*
128128
* [63:59] T-Head Memory Type definitions:
129-
*
130-
* 00000 - NC Weakly-ordered, Non-cacheable, Non-bufferable, Non-shareable, Non-trustable
129+
* bit[63] SO - Strong Order
130+
* bit[62] C - Cacheable
131+
* bit[61] B - Bufferable
132+
* bit[60] SH - Shareable
133+
* bit[59] Sec - Trustable
134+
* 00110 - NC Weakly-ordered, Non-cacheable, Bufferable, Shareable, Non-trustable
131135
* 01110 - PMA Weakly-ordered, Cacheable, Bufferable, Shareable, Non-trustable
132-
* 10000 - IO Strongly-ordered, Non-cacheable, Non-bufferable, Non-shareable, Non-trustable
136+
* 10010 - IO Strongly-ordered, Non-cacheable, Non-bufferable, Shareable, Non-trustable
133137
*/
134138
#define _PAGE_PMA_THEAD ((1UL << 62) | (1UL << 61) | (1UL << 60))
135-
#define _PAGE_NOCACHE_THEAD 0UL
136-
#define _PAGE_IO_THEAD (1UL << 63)
139+
#define _PAGE_NOCACHE_THEAD ((1UL < 61) | (1UL << 60))
140+
#define _PAGE_IO_THEAD ((1UL << 63) | (1UL << 60))
137141
#define _PAGE_MTMASK_THEAD (_PAGE_PMA_THEAD | _PAGE_IO_THEAD | (1UL << 59))
138142

139143
static inline u64 riscv_page_mtmask(void)

0 commit comments

Comments
 (0)