diff options
author | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2013-03-03 00:51:24 +0100 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2013-03-03 00:51:24 +0100 |
commit | d6fa4ec20db6bd0b403d2d99fd9423e6c0f3f845 (patch) | |
tree | e9ddb16309d2b546a400593afc07846ce9ed6746 /arch/arm/mach-tegra/common.c | |
parent | dc1cfc34b2a07c5441d68ca21ae4296822ee4df6 (diff) | |
parent | 1ff6b9489fbc737e3e2bc7660b92cebbfaea5247 (diff) |
Conflicts:
arch/arm/mach-tegra/common.c
drivers/ata/ahci-tegra.c
Diffstat (limited to 'arch/arm/mach-tegra/common.c')
-rw-r--r-- | arch/arm/mach-tegra/common.c | 76 |
1 files changed, 69 insertions, 7 deletions
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c index a34d37f2f250..d5acd8bdea76 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; @@ -497,6 +499,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); + /* To specify NVIDIA carveout memory */ static int __init parse_nvmem(char *p) { @@ -877,6 +894,30 @@ out: iounmap(to_io); } +void tegra_clear_framebuffer(unsigned long to, unsigned long size) +{ + void __iomem *to_io; + unsigned long i; + + BUG_ON(PAGE_ALIGN((unsigned long)to) != (unsigned long)to); + BUG_ON(PAGE_ALIGN(size) != size); + + to_io = ioremap(to, size); + if (!to_io) { + pr_err("%s: Failed to map target framebuffer\n", __func__); + return; + } + + if (pfn_valid(page_to_pfn(phys_to_page(to)))) { + for (i = 0 ; i < size; i += PAGE_SIZE) + memset(to_io + i, 0, PAGE_SIZE); + } else { + for (i = 0; i < size; i += 4) + writel(0, to_io + i); + } + iounmap(to_io); +} + void __init tegra_reserve(unsigned long carveout_size, unsigned long fb_size, unsigned long fb2_size) { @@ -961,19 +1002,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, @@ -1040,6 +1098,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 |