summaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2023-05-22 07:28:26 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2023-05-23 09:26:07 +0200
commitf0042d462f3df4d106d08ca138d340e123b10946 (patch)
treebe1834023e70e8da8bdafb1598a55f9b744ba017 /arch/powerpc
parent9845563450b88c77710c8b7e19d98b140cb542c4 (diff)
downloadbarebox-f0042d462f3df4d106d08ca138d340e123b10946.tar.gz
barebox-f0042d462f3df4d106d08ca138d340e123b10946.tar.xz
mmu: add physical address parameter to arch_remap_range
ARM32 has map_io_sections for non-1:1 remapping, but it's limited to 1M sections. arch_remap_range has newly gained support for 4K granularity remapping, but supports only changing attributes and no non-1:1 remapping yet. In preparation for adding this missing feature, adjust the prototype. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230522052835.1039143-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/cpu-85xx/mmu.c7
-rw-r--r--arch/powerpc/include/asm/mmu.h2
2 files changed, 6 insertions, 3 deletions
diff --git a/arch/powerpc/cpu-85xx/mmu.c b/arch/powerpc/cpu-85xx/mmu.c
index 6b93c3e8db..b484acbf80 100644
--- a/arch/powerpc/cpu-85xx/mmu.c
+++ b/arch/powerpc/cpu-85xx/mmu.c
@@ -17,13 +17,16 @@
#include <mmu.h>
#include <mach/mmu.h>
-int arch_remap_range(void *_start, size_t size, unsigned flags)
+int arch_remap_range(void *virt_addr, phys_addr_t phys_addr, size_t size, unsigned flags)
{
uint32_t ptr, start, tsize, valid, wimge, pte_flags;
unsigned long epn;
phys_addr_t rpn = 0;
int esel = 0;
+ if (phys_addr != virt_to_phys(virt_addr))
+ return -ENOSYS;
+
switch (flags) {
case MAP_UNCACHED:
pte_flags = MAS2_I;
@@ -35,7 +38,7 @@ int arch_remap_range(void *_start, size_t size, unsigned flags)
return -EINVAL;
}
- ptr = start = (uint32_t)_start;
+ ptr = start = (uint32_t)virt_addr;
wimge = pte_flags | MAS2_M;
while (ptr < (start + size)) {
diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h
index 81a5d7d55f..10b15a47b9 100644
--- a/arch/powerpc/include/asm/mmu.h
+++ b/arch/powerpc/include/asm/mmu.h
@@ -563,7 +563,7 @@ extern int write_bat(ppc_bat_t bat, unsigned long upper, unsigned long lower);
#ifdef CONFIG_MMU
#define ARCH_HAS_REMAP
-int arch_remap_range(void *_start, size_t size, unsigned flags);
+int arch_remap_range(void *virt_addr, phys_addr_t phys_addr, size_t size, unsigned flags);
#endif
#endif