diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 2c70b7477516b..eee59ebdf3274 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -353,6 +353,7 @@ config ARCH_RV64ILP32 depends on NONPORTABLE select ARCH_SUPPORTS_INT128 if !$(cc-option,$(m64-flag) -D__SIZEOF_INT128__=0) select 32BIT + select PHYS_ADDR_T_64BIT if !MMU_SV32 select MMU select VDSO64ILP32 select ARCH_HAS_64ILP32_KERNEL diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h index 991a2a6d9a949..3f98d260b2fe6 100644 --- a/arch/riscv/include/asm/pgtable.h +++ b/arch/riscv/include/asm/pgtable.h @@ -115,6 +115,10 @@ #define XIP_OFFSET 0 #endif +#ifndef CONFIG_MMU_SV32 +#define MAX_POSSIBLE_PHYSMEM_BITS 43 +#endif + #ifndef __ASSEMBLY__ #include @@ -261,7 +265,7 @@ static inline void pmd_clear(pmd_t *pmdp) set_pmd(pmdp, __pmd(0)); } -static inline pgd_t pfn_pgd(unsigned long pfn, pgprot_t prot) +static inline pgd_t pfn_pgd(phys_addr_t pfn, pgprot_t prot) { ptval_t prot_val = pgprot_val(prot); @@ -341,7 +345,7 @@ static inline unsigned long pte_pfn(pte_t pte) #define pte_page(x) pfn_to_page(pte_pfn(x)) /* Constructs a page table entry */ -static inline pte_t pfn_pte(unsigned long pfn, pgprot_t prot) +static inline pte_t pfn_pte(phys_addr_t pfn, pgprot_t prot) { ptval_t prot_val = pgprot_val(prot);