Skip to content

Commit 6179d4a

Browse files
cmuellnerpalmer-dabbelt
authored andcommitted
riscv: thead: Rename T-Head PBMT to MAE
T-Head's vendor extension to set page attributes has the name MAE (memory attribute extension). Let's rename it, so it is clear what this referes to. Link: https://github.com/T-head-Semi/thead-extension-spec/blob/master/xtheadmae.adoc Reviewed-by: Conor Dooley <[email protected]> Signed-off-by: Christoph Müllner <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 6613476 commit 6179d4a

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

arch/riscv/Kconfig.errata

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,14 @@ config ERRATA_THEAD
8282

8383
Otherwise, please say "N" here to avoid unnecessary overhead.
8484

85-
config ERRATA_THEAD_PBMT
86-
bool "Apply T-Head memory type errata"
85+
config ERRATA_THEAD_MAE
86+
bool "Apply T-Head's memory attribute extension (XTheadMae) errata"
8787
depends on ERRATA_THEAD && 64BIT && MMU
8888
select RISCV_ALTERNATIVE_EARLY
8989
default y
9090
help
91-
This will apply the memory type errata to handle the non-standard
92-
memory type bits in page-table-entries on T-Head SoCs.
91+
This will apply the memory attribute extension errata to handle the
92+
non-standard PTE utilization on T-Head SoCs (XTheadMae).
9393

9494
If you don't know what to do here, say "Y".
9595

arch/riscv/errata/thead/errata.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
#include <asm/patch.h>
2020
#include <asm/vendorid_list.h>
2121

22-
static bool errata_probe_pbmt(unsigned int stage,
23-
unsigned long arch_id, unsigned long impid)
22+
static bool errata_probe_mae(unsigned int stage,
23+
unsigned long arch_id, unsigned long impid)
2424
{
25-
if (!IS_ENABLED(CONFIG_ERRATA_THEAD_PBMT))
25+
if (!IS_ENABLED(CONFIG_ERRATA_THEAD_MAE))
2626
return false;
2727

2828
if (arch_id != 0 || impid != 0)
@@ -140,8 +140,8 @@ static u32 thead_errata_probe(unsigned int stage,
140140
{
141141
u32 cpu_req_errata = 0;
142142

143-
if (errata_probe_pbmt(stage, archid, impid))
144-
cpu_req_errata |= BIT(ERRATA_THEAD_PBMT);
143+
if (errata_probe_mae(stage, archid, impid))
144+
cpu_req_errata |= BIT(ERRATA_THEAD_MAE);
145145

146146
errata_probe_cmo(stage, archid, impid);
147147

arch/riscv/include/asm/errata_list.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#endif
2424

2525
#ifdef CONFIG_ERRATA_THEAD
26-
#define ERRATA_THEAD_PBMT 0
26+
#define ERRATA_THEAD_MAE 0
2727
#define ERRATA_THEAD_PMU 1
2828
#define ERRATA_THEAD_NUMBER 2
2929
#endif
@@ -53,20 +53,20 @@ asm(ALTERNATIVE("sfence.vma %0", "sfence.vma", SIFIVE_VENDOR_ID, \
5353
* in the default case.
5454
*/
5555
#define ALT_SVPBMT_SHIFT 61
56-
#define ALT_THEAD_PBMT_SHIFT 59
56+
#define ALT_THEAD_MAE_SHIFT 59
5757
#define ALT_SVPBMT(_val, prot) \
5858
asm(ALTERNATIVE_2("li %0, 0\t\nnop", \
5959
"li %0, %1\t\nslli %0,%0,%3", 0, \
6060
RISCV_ISA_EXT_SVPBMT, CONFIG_RISCV_ISA_SVPBMT, \
6161
"li %0, %2\t\nslli %0,%0,%4", THEAD_VENDOR_ID, \
62-
ERRATA_THEAD_PBMT, CONFIG_ERRATA_THEAD_PBMT) \
62+
ERRATA_THEAD_MAE, CONFIG_ERRATA_THEAD_MAE) \
6363
: "=r"(_val) \
6464
: "I"(prot##_SVPBMT >> ALT_SVPBMT_SHIFT), \
65-
"I"(prot##_THEAD >> ALT_THEAD_PBMT_SHIFT), \
65+
"I"(prot##_THEAD >> ALT_THEAD_MAE_SHIFT), \
6666
"I"(ALT_SVPBMT_SHIFT), \
67-
"I"(ALT_THEAD_PBMT_SHIFT))
67+
"I"(ALT_THEAD_MAE_SHIFT))
6868

69-
#ifdef CONFIG_ERRATA_THEAD_PBMT
69+
#ifdef CONFIG_ERRATA_THEAD_MAE
7070
/*
7171
* IO/NOCACHE memory types are handled together with svpbmt,
7272
* so on T-Head chips, check if no other memory type is set,
@@ -83,11 +83,11 @@ asm volatile(ALTERNATIVE( \
8383
"slli t3, t3, %3\n\t" \
8484
"or %0, %0, t3\n\t" \
8585
"2:", THEAD_VENDOR_ID, \
86-
ERRATA_THEAD_PBMT, CONFIG_ERRATA_THEAD_PBMT) \
86+
ERRATA_THEAD_MAE, CONFIG_ERRATA_THEAD_MAE) \
8787
: "+r"(_val) \
88-
: "I"(_PAGE_MTMASK_THEAD >> ALT_THEAD_PBMT_SHIFT), \
89-
"I"(_PAGE_PMA_THEAD >> ALT_THEAD_PBMT_SHIFT), \
90-
"I"(ALT_THEAD_PBMT_SHIFT) \
88+
: "I"(_PAGE_MTMASK_THEAD >> ALT_THEAD_MAE_SHIFT), \
89+
"I"(_PAGE_PMA_THEAD >> ALT_THEAD_MAE_SHIFT), \
90+
"I"(ALT_THEAD_MAE_SHIFT) \
9191
: "t3")
9292
#else
9393
#define ALT_THEAD_PMA(_val)

0 commit comments

Comments
 (0)