From d2d47fb6b11de1d234bce2b578d2ef02e859123c Mon Sep 17 00:00:00 2001 From: Andy Whitcroft Date: Wed, 17 Jul 2013 17:52:25 +0100 Subject: [PATCH] UBUNTU: SAUCE: allow mem= banks to be reset on the command line Each mem=X option specified an _additional_ memory segment. This cummulative behaviour prevents us from using mem=X to limit ram in play during testing, especially where the bootloader is supplying the actual memory of the device unconditionally. Allow the memory map to be reset to empty via a '!' prefix. BugLink: http://bugs.launchpad.net/bugs/1206835 Signed-off-by: Andy Whitcroft --- arch/arm/kernel/setup.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index b012f0f4544..e0eaef115fe 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -564,6 +564,17 @@ static int __init early_mem(char *p) phys_addr_t start; char *endp; + /* + * Allow the user to reset any previous settings + * such as might be specified unconditionally by + * the bootloader. Adding ! as a prefix triggers + * this reset. + */ + if (p && p[0] == '!') { + p++; + usermem = 0; + } + /* * If the user specifies memory size, we * blow away any automatically generated