linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] ARM: ux500: Enable HIGHMEM in the u8540 defconfig
Date: Fri, 31 May 2013 15:24:32 +0100	[thread overview]
Message-ID: <1370010272-25520-2-git-send-email-lee.jones@linaro.org> (raw)
In-Reply-To: <1370010272-25520-1-git-send-email-lee.jones@linaro.org>

In order to utilise all of the memory located on ux500 based devices
we have to enable HIGHMEM. Without it the kernel truncates memory down
to what's left after the PAGE_OFFSET has been applied, which doesn't
leave an awful lot, especially if we're running large rootfs' such
as full Linux desktop distributions or Android.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/configs/u8500_defconfig |    1 +
 drivers/of/fdt.c                 |   52 +++++++-------------------------------
 2 files changed, 10 insertions(+), 43 deletions(-)

diff --git a/arch/arm/configs/u8500_defconfig b/arch/arm/configs/u8500_defconfig
index 2d322d2..38d633a 100644
--- a/arch/arm/configs/u8500_defconfig
+++ b/arch/arm/configs/u8500_defconfig
@@ -1,3 +1,4 @@
+CONFIG_HIGHMEM=y
 # CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
 CONFIG_NO_HZ=y
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 5439925..808be06 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -43,7 +43,7 @@ void *of_fdt_get_property(struct boot_param_header *blob,
 
 	do {
 		u32 tag = be32_to_cpup((__be32 *)p);
-		u32 sz, noff, i;
+		u32 sz, noff;
 		const char *nstr;
 
 		p += 4;
@@ -66,10 +66,6 @@ void *of_fdt_get_property(struct boot_param_header *blob,
 		if (strcmp(name, nstr) == 0) {
 			if (size)
 				*size = sz;
-
-	print_hex_dump(KERN_ERR, "node: ", DUMP_PREFIX_ADDRESS,
-		       16, 1, (__be32 *)node, p - node, true);
-
 			return (void *)p;
 		}
 		p += sz;
@@ -624,68 +620,38 @@ int __init early_init_dt_scan_memory(unsigned long node, const char *uname,
 	__be32 *reg, *endp;
 	unsigned long l;
 
-	printk("LEE: ******************************************* \n");
-	printk("LEE: ******************************************* \n");
-	printk("LEE: ******************************************* \n");
-	printk("LEE: ******************************************* \n");
-	printk("LEE: ******************************************* \n");
-	printk("LEE: ******************************************* \n");
-	printk("LEE: ******************************************* \n");
-
 	/* We are scanning "memory" nodes only */
 	if (type == NULL) {
-		printk("LEE: 1\n");
 		/*
 		 * The longtrail doesn't have a device_type on the
 		 * /memory node, so look for the node called /memory at 0.
 		 */
-		if (depth != 1 || strcmp(uname, "memory at 0") != 0) {
-			printk("LEE: 2\n");
+		if (depth != 1 || strcmp(uname, "memory at 0") != 0)
 			return 0;
-		}
-	} else if (strcmp(type, "memory") != 0) {
-		printk("LEE: 3\n");
+	} else if (strcmp(type, "memory") != 0)
 		return 0;
-	}
 
 	reg = of_get_flat_dt_prop(node, "linux,usable-memory", &l);
-	if (reg == NULL) {
+	if (reg == NULL)
 		reg = of_get_flat_dt_prop(node, "reg", &l);
-		printk("LEE: This is correct \n");
-	}
-	if (reg == NULL) {
-		printk("LEE: 4\n");
-       		return 0;
-	}
-
-	printk("LEE: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! \n");
-	printk("LEE: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! \n");
-	printk("LEE: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! \n");
-	printk("LEE: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! \n");
-	printk("LEE: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! \n");
-	printk("LEE: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! \n");
-	printk("LEE: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! \n");
+	if (reg == NULL)
+		return 0;
 
 	endp = reg + (l / sizeof(__be32));
 
-	printk("LEE: reg: 0x%p\n", reg);
-
-	printk("memory scan node %s, reg size %ld, data: %x %x %x %x,\n",
+	pr_debug("memory scan node %s, reg size %ld, data: %x %x %x %x,\n",
 	    uname, l, reg[0], reg[1], reg[2], reg[3]);
 
-	printk("extras: %x %x %x %x,\n", reg[4], reg[5], reg[6], reg[7]);
-
 	while ((endp - reg) >= (dt_root_addr_cells + dt_root_size_cells)) {
 		u64 base, size;
 
 		base = dt_mem_next_cell(dt_root_addr_cells, &reg);
 		size = dt_mem_next_cell(dt_root_size_cells, &reg);
 
-		printk(" - %llx ,  %llx\n", (unsigned long long)base,
-		    (unsigned long long)size);
-
 		if (size == 0)
 			continue;
+		pr_debug(" - %llx ,  %llx\n", (unsigned long long)base,
+		    (unsigned long long)size);
 
 		early_init_dt_add_memory_arch(base, size);
 	}
-- 
1.7.10.4

  reply	other threads:[~2013-05-31 14:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-31 14:24 [PATCH 1/2] ARM: ux500: Allocate correct amount of memory for the u8540 in DT Lee Jones
2013-05-31 14:24 ` Lee Jones [this message]
2013-05-31 14:58   ` [PATCH 2/2] ARM: ux500: Enable HIGHMEM in the u8540 defconfig Lee Jones
2013-05-31 15:02   ` Arnd Bergmann
2013-05-31 15:18     ` Lee Jones
2013-05-31 15:36       ` Arnd Bergmann
2013-06-03  8:21         ` Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1370010272-25520-2-git-send-email-lee.jones@linaro.org \
    --to=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).