[RFC PATCH 1/5] riscv: Define ioremap_cache for RISC-V

Ruidong Tian posted 5 patches 3 weeks, 1 day ago
[RFC PATCH 1/5] riscv: Define ioremap_cache for RISC-V
Posted by Ruidong Tian 3 weeks, 1 day ago
From: Himanshu Chauhan <hchauhan@ventanamicro.com>

bert and einj drivers use ioremap_cache for mapping entries
but ioremap_cache is not defined for RISC-V.

Signed-off-by: Himanshu Chauhan <hchauhan@ventanamicro.com>
---
 arch/riscv/include/asm/io.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/riscv/include/asm/io.h b/arch/riscv/include/asm/io.h
index a0e51840b9db..56eca6b3031f 100644
--- a/arch/riscv/include/asm/io.h
+++ b/arch/riscv/include/asm/io.h
@@ -30,6 +30,9 @@
 #define PCI_IOBASE		((void __iomem *)PCI_IO_START)
 #endif /* CONFIG_MMU */
 
+#define ioremap_cache(addr, size)					\
+	((__force void *)ioremap_prot((addr), (size), __pgprot(_PAGE_KERNEL)))
+
 /*
  * Emulation routines for the port-mapped IO space used by some PCI drivers.
  * These are defined as being "fully synchronous", but also "not guaranteed to
-- 
2.43.7
Re: [RFC PATCH 1/5] riscv: Define ioremap_cache for RISC-V
Posted by Paul Walmsley 2 weeks, 1 day ago
On Wed, 10 Sep 2025, Ruidong Tian wrote:

> From: Himanshu Chauhan <hchauhan@ventanamicro.com>
> 
> bert and einj drivers use ioremap_cache for mapping entries
> but ioremap_cache is not defined for RISC-V.
> 
> Signed-off-by: Himanshu Chauhan <hchauhan@ventanamicro.com>

Looks like nothing should be using ioremap_cache() at all:

  https://lore.kernel.org/linux-riscv/YzQ6pqykLhJVeD2p@infradead.org/#t

Probably best just to fix the ACPI drivers?


- Paul