summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiaxun Yang <jiaxun.yang@flygoat.com>2023-11-07 11:15:18 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-12-13 18:39:29 +0100
commit8d18a0158546b72094c98dfb2d1d987d1799e8ab (patch)
tree093e688796fe1862c3e60967b06b95ecf8e8b6b2
parent2b9b2d28a92a585b9c70bbe0737bc78999c7b876 (diff)
downloadlinux-starfive-8d18a0158546b72094c98dfb2d1d987d1799e8ab.tar.gz
linux-starfive-8d18a0158546b72094c98dfb2d1d987d1799e8ab.tar.bz2
linux-starfive-8d18a0158546b72094c98dfb2d1d987d1799e8ab.zip
MIPS: Loongson64: Reserve vgabios memory on boot
commit 8f7aa77a463f47c9e00592d02747a9fcf2271543 upstream. vgabios is passed from firmware to kernel on Loongson64 systems. Sane firmware will keep this pointer in reserved memory space passed from the firmware but insane firmware keeps it in low memory before kernel entry that is not reserved. Previously kernel won't try to allocate memory from low memory before kernel entry on boot, but after converting to memblock it will do that. Fix by resversing those memory on early boot. Cc: stable@vger.kernel.org Fixes: a94e4f24ec83 ("MIPS: init: Drop boot_mem_map") Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--arch/mips/loongson64/init.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/mips/loongson64/init.c b/arch/mips/loongson64/init.c
index ee8de1735b7c..d62262f93069 100644
--- a/arch/mips/loongson64/init.c
+++ b/arch/mips/loongson64/init.c
@@ -88,6 +88,11 @@ void __init szmem(unsigned int node)
break;
}
}
+
+ /* Reserve vgabios if it comes from firmware */
+ if (loongson_sysconf.vgabios_addr)
+ memblock_reserve(virt_to_phys((void *)loongson_sysconf.vgabios_addr),
+ SZ_256K);
}
#ifndef CONFIG_NUMA