Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: 7863/1: Let arm_add_memory() always use 64-bit arguments

The DTB and/or the kernel command line may pass
64-bit addresses regardless of kernel configuration,
so update arm_add_memory() to take 64-bit arguments
independently of the phys_addr_t size.

This allows non-wrapping handling of high memory
banks such as the second memory bank of APE6EVM
(at 0x2_0000_0000) in case of 32-bit phys_addr_t.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Magnus Damm and committed by
Russell King
6a5014aa 1436c1aa

+4 -4
+1 -1
arch/arm/include/asm/setup.h
··· 49 49 #define bank_phys_end(bank) ((bank)->start + (bank)->size) 50 50 #define bank_phys_size(bank) (bank)->size 51 51 52 - extern int arm_add_memory(phys_addr_t start, phys_addr_t size); 52 + extern int arm_add_memory(u64 start, u64 size); 53 53 extern void early_print(const char *str, ...); 54 54 extern void dump_machine_table(void); 55 55
+3 -3
arch/arm/kernel/setup.c
··· 621 621 /* can't use cpu_relax() here as it may require MMU setup */; 622 622 } 623 623 624 - int __init arm_add_memory(phys_addr_t start, phys_addr_t size) 624 + int __init arm_add_memory(u64 start, u64 size) 625 625 { 626 626 struct membank *bank = &meminfo.bank[meminfo.nr_banks]; 627 627 ··· 671 671 static int __init early_mem(char *p) 672 672 { 673 673 static int usermem __initdata = 0; 674 - phys_addr_t size; 675 - phys_addr_t start; 674 + u64 size; 675 + u64 start; 676 676 char *endp; 677 677 678 678 /*