1 From: Tobias Wolf <dev-NTEO@vplace.de>
2 Subject: [v2] MIPS: Fix memory reservation in bootmem_init for certain non-usermem setups
4 Commit 67a3ba25aa95 ("MIPS: Fix incorrect mem=X@Y handling") introduced a new
5 issue for rt288x where "PHYS_OFFSET" is 0x0 but the calculated "ramstart" is
6 not. As the prerequisite of custom memory map has been removed, this results
7 in the full memory range of 0x0 - 0x8000000 to be marked as reserved for this
10 v2: Correctly compare that usermem is not null.
12 This patch adds the originally intended prerequisite again.
14 Signed-off-by: Tobias Wolf <dev-NTEO@vplace.de>
17 --- a/arch/mips/kernel/setup.c
18 +++ b/arch/mips/kernel/setup.c
19 @@ -377,6 +377,8 @@ static unsigned long __init bootmap_byte
20 return ALIGN(bytes, sizeof(long));
23 +static int usermem __initdata;
25 static void __init bootmem_init(void)
27 unsigned long reserved_end;
28 @@ -456,7 +458,7 @@ static void __init bootmem_init(void)
30 * Reserve any memory between the start of RAM and PHYS_OFFSET
32 - if (ramstart > PHYS_OFFSET)
33 + if (usermem && ramstart > PHYS_OFFSET)
34 add_memory_region(PHYS_OFFSET, ramstart - PHYS_OFFSET,
37 @@ -665,8 +667,6 @@ static void __init bootmem_init(void)
38 * initialization hook for anything else was introduced.
41 -static int usermem __initdata;
43 static int __init early_parse_mem(char *p)
45 phys_addr_t start, size;