summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>2012-07-20 17:18:01 +0200
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2012-07-20 17:18:01 +0200
commitf88d59b097d643ff6b7bfe9c96cb2ddd22eb89ae (patch)
tree314789512d8e334513e47b3d49b79c88d4f4886f
parent5abbbc19bd30c5d5dbe087b86e895323fe55fe5c (diff)
tegra: carveout and framebuffer memory sizing
Support fbmem in addition to tegra_fbmem kernel argument for backwards compatibility reason. Support nvmem kernel argument for carveout definition to be backward compatible. Add special handling in case of already reserved fbmem/nvmem.
-rw-r--r--arch/arm/mach-tegra/common.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
index 200604694508..2117b3de64e0 100644
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
@@ -465,6 +465,21 @@ static int __init tegra_lp0_vec_arg(char *options)
}
early_param("lp0_vec", tegra_lp0_vec_arg);
+static int __init tegra_bootloader_fb_arg0(char *options)
+{
+ char *p = options;
+
+ tegra_bootloader_fb_size = memparse(p, &p);
+ if (*p == '@')
+ tegra_bootloader_fb_start = memparse(p+1, &p);
+
+ pr_info("Found fbmem: %08lx@%08lx\n",
+ tegra_bootloader_fb_size, tegra_bootloader_fb_start);
+
+ return 0;
+}
+early_param("fbmem", tegra_bootloader_fb_arg0);
+
static int __init tegra_bootloader_fb_arg(char *options)
{
char *p = options;
@@ -480,6 +495,27 @@ static int __init tegra_bootloader_fb_arg(char *options)
}
early_param("tegra_fbmem", tegra_bootloader_fb_arg);
+/* To specify NVIDIA carveout memory */
+static int __init parse_nvmem(char *p)
+{
+ unsigned long size, start;
+ char *endp;
+
+ size = memparse(p, &endp);
+ if (*endp == '@') {
+ start = memparse(endp + 1, NULL);
+ if (start && size) {
+ pr_info("Found nvmem: %08lx@%08lx\n", size, start);
+ tegra_carveout_start = start;
+ tegra_carveout_size = size;
+ return 0;
+ }
+ }
+
+ return -EINVAL;
+}
+early_param("nvmem", parse_nvmem);
+
static int __init tegra_sku_override(char *id)
{
char *p = id;
@@ -809,6 +845,9 @@ void __init tegra_reserve(unsigned long carveout_size, unsigned long fb_size,
tegra_carveout_size = 0;
} else
tegra_carveout_size = carveout_size;
+ } else {
+ /* special handling due to already reserved fbmem/nvmem */
+ fb2_size -= tegra_bootloader_fb_size;
}
if (fb2_size) {
@@ -823,6 +862,11 @@ void __init tegra_reserve(unsigned long carveout_size, unsigned long fb_size,
tegra_fb2_size = fb2_size;
}
+ if (!carveout_size) {
+ /* special handling due to already reserved fbmem/nvmem */
+ tegra_fb2_size += tegra_bootloader_fb_size;
+ }
+
if (fb_size) {
tegra_fb_start = memblock_end_of_DRAM() - fb_size;
if (memblock_remove(tegra_fb_start, fb_size)) {