diff options
author | Jong Kim <jongk@nvidia.com> | 2012-12-12 16:07:54 -0800 |
---|---|---|
committer | Winnie Hsu <whsu@nvidia.com> | 2012-12-17 12:29:52 -0800 |
commit | bf5e8d0816d9b92219813f303f882f2c07e7230a (patch) | |
tree | 35a5c5d449b8d86ec08cc93b3ba4a4117f039632 /arch | |
parent | af944493416445c329f8d496b31c4d98937d4735 (diff) |
arm: tegra: display: handle fbmem2 cmdline parameter
Parse and handle fbmem2 cmdline parameter.
bug 1175957
Change-Id: I0933825371bf13782e9f4364a4dba078929ae836
Signed-off-by: Jong Kim <jongk@nvidia.com>
Reviewed-on: http://git-master/r/170662
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Jon Mayo <jmayo@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/board.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-tegra/common.c | 52 |
2 files changed, 47 insertions, 7 deletions
diff --git a/arch/arm/mach-tegra/board.h b/arch/arm/mach-tegra/board.h index b02adb2cfc20..6aaba219c916 100644 --- a/arch/arm/mach-tegra/board.h +++ b/arch/arm/mach-tegra/board.h @@ -109,6 +109,8 @@ int arb_lost_recovery(int scl_gpio, int sda_gpio); extern unsigned long tegra_bootloader_fb_start; extern unsigned long tegra_bootloader_fb_size; +extern unsigned long tegra_bootloader_fb2_start; +extern unsigned long tegra_bootloader_fb2_size; extern unsigned long tegra_fb_start; extern unsigned long tegra_fb_size; extern unsigned long tegra_fb2_start; diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c index 4c5838b355f0..0d1407b6b668 100644 --- a/arch/arm/mach-tegra/common.c +++ b/arch/arm/mach-tegra/common.c @@ -85,6 +85,8 @@ unsigned long tegra_bootloader_fb_start; unsigned long tegra_bootloader_fb_size; +unsigned long tegra_bootloader_fb2_start; +unsigned long tegra_bootloader_fb2_size; unsigned long tegra_fb_start; unsigned long tegra_fb_size; unsigned long tegra_fb2_start; @@ -479,6 +481,21 @@ static int __init tegra_bootloader_fb_arg(char *options) } early_param("tegra_fbmem", tegra_bootloader_fb_arg); +static int __init tegra_bootloader_fb2_arg(char *options) +{ + char *p = options; + + tegra_bootloader_fb2_size = memparse(p, &p); + if (*p == '@') + tegra_bootloader_fb2_start = memparse(p+1, &p); + + pr_info("Found tegra_fbmem2: %08lx@%08lx\n", + tegra_bootloader_fb2_size, tegra_bootloader_fb2_start); + + return 0; +} +early_param("tegra_fbmem2", tegra_bootloader_fb2_arg); + static int __init tegra_sku_override(char *id) { char *p = id; @@ -938,19 +955,36 @@ void __init tegra_reserve(unsigned long carveout_size, unsigned long fb_size, } } + if (tegra_bootloader_fb2_size) { + tegra_bootloader_fb2_size = + PAGE_ALIGN(tegra_bootloader_fb2_size); + if (memblock_reserve(tegra_bootloader_fb2_start, + tegra_bootloader_fb2_size)) { + pr_err("Failed to reserve bootloader frame buffer2 " + "%08lx@%08lx\n", tegra_bootloader_fb2_size, + tegra_bootloader_fb2_start); + tegra_bootloader_fb2_start = 0; + tegra_bootloader_fb2_size = 0; + } + } + pr_info("Tegra reserved memory:\n" - "LP0: %08lx - %08lx\n" - "Bootloader framebuffer: %08lx - %08lx\n" - "Framebuffer: %08lx - %08lx\n" - "2nd Framebuffer: %08lx - %08lx\n" - "Carveout: %08lx - %08lx\n" - "Vpr: %08lx - %08lx\n", + "LP0: %08lx - %08lx\n" + "Bootloader framebuffer: %08lx - %08lx\n" + "Bootloader framebuffer2: %08lx - %08lx\n" + "Framebuffer: %08lx - %08lx\n" + "2nd Framebuffer: %08lx - %08lx\n" + "Carveout: %08lx - %08lx\n" + "Vpr: %08lx - %08lx\n", tegra_lp0_vec_start, tegra_lp0_vec_size ? tegra_lp0_vec_start + tegra_lp0_vec_size - 1 : 0, tegra_bootloader_fb_start, tegra_bootloader_fb_size ? - tegra_bootloader_fb_start + tegra_bootloader_fb_size - 1 : 0, + tegra_bootloader_fb_start + tegra_bootloader_fb_size - 1 : 0, + tegra_bootloader_fb2_start, + tegra_bootloader_fb2_size ? + tegra_bootloader_fb2_start + tegra_bootloader_fb2_size - 1 : 0, tegra_fb_start, tegra_fb_size ? tegra_fb_start + tegra_fb_size - 1 : 0, @@ -1017,6 +1051,10 @@ void __init tegra_release_bootloader_fb(void) if (memblock_free(tegra_bootloader_fb_start, tegra_bootloader_fb_size)) pr_err("Failed to free bootloader fb.\n"); + if (tegra_bootloader_fb2_size) + if (memblock_free(tegra_bootloader_fb2_start, + tegra_bootloader_fb2_size)) + pr_err("Failed to free bootloader fb2.\n"); } #ifdef CONFIG_TEGRA_CONVSERVATIVE_GOV_ON_EARLYSUPSEND |