Skip to content
Permalink
Browse files
riscv: xtpbmt: Fixup T-HEAD CPU _PAGE_KERNEL quirks
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
  • Loading branch information
guoren83 committed Feb 10, 2022
1 parent 9b2ce1a commit 54acb36c958fc990cc59889f79c8ddca7386c295
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
@@ -65,6 +65,7 @@ typedef struct {
* 10 - IO Non-cacheable, non-idempotent, strongly-ordered I/O memory
* 11 - Rsvd Reserved for future standard use
*/
#define _PAGE_PMA_SVPBMT (0UL)
#define _PAGE_NOCACHE_SVPBMT (1UL << 61)
#define _PAGE_IO_SVPBMT (1UL << 62)
#define _PAGE_MTMASK_SVPBMT (_PAGE_NOCACHE_SVPBMT | _PAGE_IO_SVPBMT)
@@ -89,6 +90,14 @@ static inline u64 riscv_page_mtmask(void)
return val;
}

static inline u64 riscv_page_pma(void)
{
u64 val;

ALT_SVPBMT(val, _PAGE_PMA);
return val;
}

static inline u64 riscv_page_nocache(void)
{
u64 val;
@@ -105,6 +114,7 @@ static inline u64 riscv_page_io(void)
return val;
}

#define _PAGE_PMA riscv_page_pma()
#define _PAGE_NOCACHE riscv_page_nocache()
#define _PAGE_IO riscv_page_io()
#define _PAGE_MTMASK riscv_page_mtmask()
@@ -164,6 +164,7 @@ extern struct pt_alloc_ops pt_ops __initdata;
| _PAGE_PRESENT \
| _PAGE_ACCESSED \
| _PAGE_DIRTY \
| _PAGE_PMA \
| _PAGE_GLOBAL)

#define PAGE_KERNEL __pgprot(_PAGE_KERNEL)
@@ -267,6 +267,10 @@ void __init setup_arch(char **cmdline_p)

*cmdline_p = boot_command_line;

printk("%s: _PAGE_KERNEL: 0x%lx\n", __func__, pgprot_val(PAGE_KERNEL));
printk("%s: _PAGE_IO: 0x%llx\n", __func__, _PAGE_IO);
printk("%s: _PAGE_NOCACHE: 0x%llx\n", __func__, _PAGE_NOCACHE);

early_ioremap_setup();
jump_label_init();
parse_early_param();

0 comments on commit 54acb36

Please sign in to comment.