aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorMarkos Chandras <markos.chandras@imgtec.com>2015-02-27 02:51:32 -0500
committerRalf Baechle <ralf@linux-mips.org>2015-04-10 09:41:49 -0400
commitf7f8aea4b97c4d48e42f02cb37026bee445f239f (patch)
treed88a133fc167d19d009df239922146fb05120a69 /arch/mips
parent9eaffa84a8a46adab065c983401fc9d5949c958f (diff)
MIPS: Malta: Detect and fix bad memsize values
memsize denotes the amount of RAM we can access from kseg{0,1} and that should be up to 256M. In case the bootloader reports a value higher than that (perhaps reporting all the available RAM) it's best if we fix it ourselves and just warn the user about that. This is usually a problem with the bootloader and/or its environment. [ralf@linux-mips.org: Remove useless parens as suggested bei Sergei. Reformat long pr_warn statement to fit into 80 column limit.] Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Cc: <stable@vger.kernel.org> # v3.15+ Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/9362/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/mti-malta/malta-memory.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/mips/mti-malta/malta-memory.c b/arch/mips/mti-malta/malta-memory.c
index 8fddd2cdbff7..efe366d618b1 100644
--- a/arch/mips/mti-malta/malta-memory.c
+++ b/arch/mips/mti-malta/malta-memory.c
@@ -53,6 +53,12 @@ fw_memblock_t * __init fw_getmdesc(int eva)
53 pr_warn("memsize not set in YAMON, set to default (32Mb)\n"); 53 pr_warn("memsize not set in YAMON, set to default (32Mb)\n");
54 physical_memsize = 0x02000000; 54 physical_memsize = 0x02000000;
55 } else { 55 } else {
56 if (memsize > (256 << 20)) { /* memsize should be capped to 256M */
57 pr_warn("Unsupported memsize value (0x%lx) detected! "
58 "Using 0x10000000 (256M) instead\n",
59 memsize);
60 memsize = 256 << 20;
61 }
56 /* If ememsize is set, then set physical_memsize to that */ 62 /* If ememsize is set, then set physical_memsize to that */
57 physical_memsize = ememsize ? : memsize; 63 physical_memsize = ememsize ? : memsize;
58 } 64 }