drivers/of: Import OnePlus Changes

Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
This commit is contained in:
Cyber Knight 2021-09-26 01:46:56 +08:00
parent ab4269f4ff
commit 381aa9042b
No known key found for this signature in database
GPG Key ID: 23BD4CCD326E9D64
2 changed files with 7 additions and 11 deletions

View File

@ -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);

View File

@ -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;