|
@@ -928,7 +928,11 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
|
|
void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size)
|
|
void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size)
|
|
{
|
|
{
|
|
const u64 phys_offset = __pa(PAGE_OFFSET);
|
|
const u64 phys_offset = __pa(PAGE_OFFSET);
|
|
- base &= PAGE_MASK;
|
|
|
|
|
|
+
|
|
|
|
+ if (!PAGE_ALIGNED(base)) {
|
|
|
|
+ size -= PAGE_SIZE - (base & ~PAGE_MASK);
|
|
|
|
+ base = PAGE_ALIGN(base);
|
|
|
|
+ }
|
|
size &= PAGE_MASK;
|
|
size &= PAGE_MASK;
|
|
|
|
|
|
if (base > MAX_PHYS_ADDR) {
|
|
if (base > MAX_PHYS_ADDR) {
|