drivers/of: Import OnePlus Changes
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
This commit is contained in:
parent
ab4269f4ff
commit
381aa9042b
|
@ -33,6 +33,8 @@
|
|||
|
||||
#include "of_private.h"
|
||||
|
||||
void init_param_mem_base_size(phys_addr_t base, unsigned long size);
|
||||
|
||||
/*
|
||||
* of_fdt_limit_memory - limit the number of regions in the /memory node
|
||||
* @limit: maximum entries
|
||||
|
@ -685,6 +687,9 @@ static int __init __reserved_mem_reserve_reg(unsigned long node,
|
|||
pr_info("Reserved memory: failed to reserve memory for node '%s': base %pa, size %ld MiB\n",
|
||||
uname, &base, (unsigned long)size / SZ_1M);
|
||||
|
||||
if (!strncmp(uname, "param_mem", 9))
|
||||
init_param_mem_base_size(base, size);
|
||||
|
||||
len -= t_len;
|
||||
if (first) {
|
||||
fdt_reserved_mem_save_node(node, uname, base, size);
|
||||
|
|
|
@ -225,16 +225,6 @@ static int __init __rmem_cmp(const void *a, const void *b)
|
|||
if (ra->base > rb->base)
|
||||
return 1;
|
||||
|
||||
/*
|
||||
* Put the dynamic allocations (address == 0, size == 0) before static
|
||||
* allocations at address 0x0 so that overlap detection works
|
||||
* correctly.
|
||||
*/
|
||||
if (ra->size < rb->size)
|
||||
return -1;
|
||||
if (ra->size > rb->size)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -252,7 +242,8 @@ static void __init __rmem_check_for_overlap(void)
|
|||
|
||||
this = &reserved_mem[i];
|
||||
next = &reserved_mem[i + 1];
|
||||
|
||||
if (!(this->base && next->base))
|
||||
continue;
|
||||
if (this->base + this->size > next->base) {
|
||||
phys_addr_t this_end, next_end;
|
||||
|
||||
|
|
Loading…
Reference in New Issue