@@ -936,7 +936,26 @@ void __init sanity_check_meminfo(void)
if (bank->start > ULONG_MAX)
highmem = 1;
+ if (bank->start < __pa(PAGE_OFFSET) &&
+ __pa(PAGE_OFFSET) <= (bank->start + bank->size - 1)) {
+ int offset = __pa(PAGE_OFFSET) - bank->start;
+ bank->start += offset;
+ bank->size -= offset;
+ pr_crit("Change memory bank to %.8llx-%.8llx\n",
+ (unsigned long long)bank->start,
+ (unsigned long long)bank->start +
+ bank->size - 1);
+ }
+
Case 2:
In two bank solution with the kernel starting address at 0x10008000
will be the first bank ignored
which ensure that HIGHMEM will work and kernel will boot
reg = <0x0 0x10000000 0x10000000 0x30000000>;
Kernel bootlog will contain: "Ignoring RAM at 00000000-0fffffff
(CONFIG_HIGHMEM)."
@@ -948,6 +948,14 @@ void __init sanity_check_meminfo(void)
}
#ifdef CONFIG_HIGHMEM
+ if (__va(bank->start + bank->size - 1) < (void *)PAGE_OFFSET) {
+ pr_notice("Ignoring RAM at %.8llx-%.8llx "
+ "(CONFIG_HIGHMEM).\n",
+ (unsigned long long)bank->start,
+ (unsigned long long)bank->start +
bank->size - 1);
+ continue;
+ }
+
if (__va(bank->start) >= vmalloc_min ||
__va(bank->start) < (void *)PAGE_OFFSET)