* [PATCH 1/2] ARM: ux500: Allocate correct amount of memory for the u8540 in DT @ 2013-05-31 14:24 Lee Jones 2013-05-31 14:24 ` [PATCH 2/2] ARM: ux500: Enable HIGHMEM in the u8540 defconfig Lee Jones 0 siblings, 1 reply; 7+ messages in thread From: Lee Jones @ 2013-05-31 14:24 UTC (permalink / raw) To: linux-arm-kernel As it stands, the memory node in the u8540 Device Tree is ignored and memory is actually stipulated by the bootloader via ATAGS. ARM core architecture code then extracts the memory ATAG and inserts it into the Device Tree. In the u8540 the LittleKernel bootloader only stipulates 512MB of memory; however, the u8540 actually has 4GB. We're taking the responsibility to register the remainder from Device Tree here. Signed-off-by: Lee Jones <lee.jones@linaro.org> --- arch/arm/boot/dts/ccu8540.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/ccu8540.dts b/arch/arm/boot/dts/ccu8540.dts index 12f0bc2..199866b 100644 --- a/arch/arm/boot/dts/ccu8540.dts +++ b/arch/arm/boot/dts/ccu8540.dts @@ -16,8 +16,8 @@ model = "ST-Ericsson U8540 platform with Device Tree"; compatible = "st-ericsson,ccu8540", "st-ericsson,u8540"; - memory { - reg = <0x00000000 0x20000000>; + memory at 0 { + reg = <0x20000000 0x3f000000>, <0xc0000000 0x3f000000>; }; soc { -- 1.7.10.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] ARM: ux500: Enable HIGHMEM in the u8540 defconfig 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 2013-05-31 14:58 ` Lee Jones 2013-05-31 15:02 ` Arnd Bergmann 0 siblings, 2 replies; 7+ messages in thread From: Lee Jones @ 2013-05-31 14:24 UTC (permalink / raw) To: linux-arm-kernel 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, ®); size = dt_mem_next_cell(dt_root_size_cells, ®); - 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 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] ARM: ux500: Enable HIGHMEM in the u8540 defconfig 2013-05-31 14:24 ` [PATCH 2/2] ARM: ux500: Enable HIGHMEM in the u8540 defconfig Lee Jones @ 2013-05-31 14:58 ` Lee Jones 2013-05-31 15:02 ` Arnd Bergmann 1 sibling, 0 replies; 7+ messages in thread From: Lee Jones @ 2013-05-31 14:58 UTC (permalink / raw) To: linux-arm-kernel Ah, cack! One of the pitfalls of autonomously using the '-a' flag. I'll re-spin. -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/2] ARM: ux500: Enable HIGHMEM in the u8540 defconfig 2013-05-31 14:24 ` [PATCH 2/2] ARM: ux500: Enable HIGHMEM in the u8540 defconfig Lee Jones 2013-05-31 14:58 ` Lee Jones @ 2013-05-31 15:02 ` Arnd Bergmann 2013-05-31 15:18 ` Lee Jones 1 sibling, 1 reply; 7+ messages in thread From: Arnd Bergmann @ 2013-05-31 15:02 UTC (permalink / raw) To: linux-arm-kernel On Friday 31 May 2013 15:24:32 Lee Jones wrote: > 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> How much memory do those devices have? Enabling HIGHMEM is quite expensive. > 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 You should probably resend the patch without the second half that got in it by accident. ARnd ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/2] ARM: ux500: Enable HIGHMEM in the u8540 defconfig 2013-05-31 15:02 ` Arnd Bergmann @ 2013-05-31 15:18 ` Lee Jones 2013-05-31 15:36 ` Arnd Bergmann 0 siblings, 1 reply; 7+ messages in thread From: Lee Jones @ 2013-05-31 15:18 UTC (permalink / raw) To: linux-arm-kernel On Fri, 31 May 2013, Arnd Bergmann wrote: > On Friday 31 May 2013 15:24:32 Lee Jones wrote: > > 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> > > How much memory do those devices have? Enabling HIGHMEM is quite expensive. Another 1GB. > > 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 > > You should probably resend the patch without the second half that got > in it by accident. I did already, thanks. -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/2] ARM: ux500: Enable HIGHMEM in the u8540 defconfig 2013-05-31 15:18 ` Lee Jones @ 2013-05-31 15:36 ` Arnd Bergmann 2013-06-03 8:21 ` Lee Jones 0 siblings, 1 reply; 7+ messages in thread From: Arnd Bergmann @ 2013-05-31 15:36 UTC (permalink / raw) To: linux-arm-kernel On Friday 31 May 2013 16:18:50 Lee Jones wrote: > On Fri, 31 May 2013, Arnd Bergmann wrote: > > > On Friday 31 May 2013 15:24:32 Lee Jones wrote: > > > 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> > > > > How much memory do those devices have? Enabling HIGHMEM is quite expensive. > > Another 1GB. You mean you have 2GB total or 1.75GB? You could just use CONFIG_VMSPLIT_2G to an extra GB compared to the default, which is what vexpress, imx and s5p already do, but you still have to put the vmalloc area in the low 2GB then. Arnd ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/2] ARM: ux500: Enable HIGHMEM in the u8540 defconfig 2013-05-31 15:36 ` Arnd Bergmann @ 2013-06-03 8:21 ` Lee Jones 0 siblings, 0 replies; 7+ messages in thread From: Lee Jones @ 2013-06-03 8:21 UTC (permalink / raw) To: linux-arm-kernel On Fri, 31 May 2013, Arnd Bergmann wrote: > On Friday 31 May 2013 16:18:50 Lee Jones wrote: > > On Fri, 31 May 2013, Arnd Bergmann wrote: > > > > > On Friday 31 May 2013 15:24:32 Lee Jones wrote: > > > > 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> > > > > > > How much memory do those devices have? Enabling HIGHMEM is quite expensive. > > > > Another 1GB. > > You mean you have 2GB total or 1.75GB? You could just use We have 2GB in total. > CONFIG_VMSPLIT_2G to an extra GB compared to the default, which > is what vexpress, imx and s5p already do, but you still have to > put the vmalloc area in the low 2GB then. Isn't this for 4GB systems? -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-06-03 8:21 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 ` [PATCH 2/2] ARM: ux500: Enable HIGHMEM in the u8540 defconfig Lee Jones 2013-05-31 14:58 ` 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
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).