summaryrefslogtreecommitdiff
path: root/target/linux/ar7/patches-4.9/200-free-mem-below-kernel-offset.patch
diff options
context:
space:
mode:
authorJonas Gorski <jonas.gorski@gmail.com>2017-10-12 10:50:08 +0200
committerJonas Gorski <jonas.gorski@gmail.com>2017-10-29 23:41:00 +0100
commitcf9e0a59aabd84a409a44fd39f6b03a064a82786 (patch)
treeb71834a2483db031f3c0a254ff551faf2beb9e67 /target/linux/ar7/patches-4.9/200-free-mem-below-kernel-offset.patch
parent1d30869cd2f589b27227428863ebd201099106ce (diff)
downloadmtk-20170518-cf9e0a59aabd84a409a44fd39f6b03a064a82786.zip
mtk-20170518-cf9e0a59aabd84a409a44fd39f6b03a064a82786.tar.gz
mtk-20170518-cf9e0a59aabd84a409a44fd39f6b03a064a82786.tar.bz2
ar7: add kernel 4.9 support
Compile and run tested on WAG354Gv1. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Diffstat (limited to 'target/linux/ar7/patches-4.9/200-free-mem-below-kernel-offset.patch')
-rw-r--r--target/linux/ar7/patches-4.9/200-free-mem-below-kernel-offset.patch15
1 files changed, 15 insertions, 0 deletions
diff --git a/target/linux/ar7/patches-4.9/200-free-mem-below-kernel-offset.patch b/target/linux/ar7/patches-4.9/200-free-mem-below-kernel-offset.patch
new file mode 100644
index 0000000..4011942
--- /dev/null
+++ b/target/linux/ar7/patches-4.9/200-free-mem-below-kernel-offset.patch
@@ -0,0 +1,15 @@
+--- a/arch/mips/ar7/memory.c
++++ b/arch/mips/ar7/memory.c
+@@ -66,5 +66,11 @@ void __init prom_meminit(void)
+
+ void __init prom_free_prom_memory(void)
+ {
+- /* Nothing to free */
++ /* adapted from arch/mips/txx9/generic/setup.c */
++ unsigned long saddr = PHYS_OFFSET + PAGE_SIZE;
++ unsigned long eaddr = __pa_symbol(&_text);
++
++ /* free memory between prom-record and kernel _text base */
++ if (saddr < eaddr)
++ free_init_pages("prom memory", saddr, eaddr);
+ }