diff options
author | Rob Herring <robh@kernel.org> | 2014-04-01 23:46:48 -0400 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2014-04-30 01:59:17 -0400 |
commit | d1552ce449eb0a8d2f0bd6599da3a8a3d7f77a84 (patch) | |
tree | 10e5d7505664ee5270eb8e0b895099decea030de /drivers/of | |
parent | b0a6fb36a49f720c93c3da0b3f040e49e42435ad (diff) |
of/fdt: move memreserve and dtb memory reservations into core
Move the /memreserve/ processing and dtb memory reservations into
early_init_fdt_scan_reserved_mem. This converts arm, arm64, and powerpc
as they are the only users of early_init_fdt_scan_reserved_mem.
memblock_reserve is safe to call on the same region twice, so the
reservation check for the dtb in powerpc 32-bit reservations is safe to
remove.
Signed-off-by: Rob Herring <robh@kernel.org>
Tested-by: Michal Simek <michal.simek@xilinx.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Tested-by: Grant Likely <grant.likely@linaro.org>
Tested-by: Stephen Chivers <schivers@csc.com>
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/fdt.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 4129f7442244..051be4ca25b9 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c | |||
@@ -492,9 +492,25 @@ static int __init __fdt_scan_reserved_mem(unsigned long node, const char *uname, | |||
492 | */ | 492 | */ |
493 | void __init early_init_fdt_scan_reserved_mem(void) | 493 | void __init early_init_fdt_scan_reserved_mem(void) |
494 | { | 494 | { |
495 | int n; | ||
496 | u64 base, size; | ||
497 | |||
495 | if (!initial_boot_params) | 498 | if (!initial_boot_params) |
496 | return; | 499 | return; |
497 | 500 | ||
501 | /* Reserve the dtb region */ | ||
502 | early_init_dt_reserve_memory_arch(__pa(initial_boot_params), | ||
503 | fdt_totalsize(initial_boot_params), | ||
504 | 0); | ||
505 | |||
506 | /* Process header /memreserve/ fields */ | ||
507 | for (n = 0; ; n++) { | ||
508 | fdt_get_mem_rsv(initial_boot_params, n, &base, &size); | ||
509 | if (!size) | ||
510 | break; | ||
511 | early_init_dt_reserve_memory_arch(base, size, 0); | ||
512 | } | ||
513 | |||
498 | of_scan_flat_dt(__fdt_scan_reserved_mem, NULL); | 514 | of_scan_flat_dt(__fdt_scan_reserved_mem, NULL); |
499 | fdt_init_reserved_mem(); | 515 | fdt_init_reserved_mem(); |
500 | } | 516 | } |