path: root/arch/arm/include/asm/memory.h
diff options
authorArd Biesheuvel <ardb@kernel.org>2020-10-28 14:20:55 +0100
committerRussell King <rmk+kernel@armlinux.org.uk>2020-10-28 14:59:30 +0000
commitfc2933c133744305236793025b00c2f7d258b687 (patch)
tree7139823ebf8fcdc3b3e969bddc1262a6d2116bd2 /arch/arm/include/asm/memory.h
parentARM: 9017/2: Enable KASan for ARM (diff)
ARM: 9020/1: mm: use correct section size macro to describe the FDT virtual address
Commit 149a3ffe62b9dbc3 ("9012/1: move device tree mapping out of linear region") created a permanent, read-only section mapping of the device tree blob provided by the firmware, and added a set of macros to get the base and size of the virtually mapped FDT based on the physical address. However, while the mapping code uses the SECTION_SIZE macro correctly, the macros use PMD_SIZE instead, which means something entirely different on ARM when using short descriptors, and is therefore not the right quantity to use here. So replace PMD_SIZE with SECTION_SIZE. While at it, change the names of the macro and its parameter to clarify that it returns the virtual address of the start of the FDT, based on the physical address in memory. Tested-by: Joel Stanley <joel@jms.id.au> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'arch/arm/include/asm/memory.h')
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index 598dbdca2017..38a163f50130 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -73,8 +73,8 @@
#define XIP_VIRT_ADDR(physaddr) (MODULES_VADDR + ((physaddr) & 0x000fffff))
#define FDT_FIXED_BASE UL(0xff800000)
-#define FDT_FIXED_SIZE (2 * PMD_SIZE)
-#define FDT_VIRT_ADDR(physaddr) ((void *)(FDT_FIXED_BASE | (physaddr) % PMD_SIZE))
+#define FDT_VIRT_BASE(physbase) ((void *)(FDT_FIXED_BASE | (physbase) % SECTION_SIZE))
#if !defined(CONFIG_SMP) && !defined(CONFIG_ARM_LPAE)
@@ -116,7 +116,7 @@ extern unsigned long vectors_base;
#define XIP_VIRT_ADDR(physaddr) (physaddr)
-#define FDT_VIRT_ADDR(physaddr) ((void *)(physaddr))
+#define FDT_VIRT_BASE(physbase) ((void *)(physbase))
#endif /* !CONFIG_MMU */