From 0f2b29cd0d513e091a2cdfc8724f409fd1fdb61a Mon Sep 17 00:00:00 2001 From: Prashant Gaikwad Date: Wed, 3 Aug 2011 14:49:20 +0530 Subject: ARM: tegra: pm: Do not use ioremap for sys mem ARMv6+ architecture does not allow ioremap on system memory. lp0 is relocated using ioremap on DRAM. If lp0 vector start address is in system memory then use memblock_reserve and do not relocate. Else if it is overlapping with carveout/fb then first remove the carveout/fb using memblock_remove and then use ioremap. Bug 827199 Reviewed-on: http://git-master/r/43685 (cherry picked from commit 1753408edc65ebfc0d4d203f2be960d49ca747a8) Change-Id: Ic4abfbc98b43aafb2756cb3e69d0ee178204ec7d Reviewed-on: http://git-master/r/44717 Reviewed-by: Varun Colbert Tested-by: Varun Colbert --- arch/arm/mach-tegra/board.h | 1 + arch/arm/mach-tegra/common.c | 13 +++++++++++++ arch/arm/mach-tegra/suspend.c | 4 +++- 3 files changed, 17 insertions(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/arm/mach-tegra/board.h b/arch/arm/mach-tegra/board.h index a15834f8e7ee..a58e0ba569a9 100644 --- a/arch/arm/mach-tegra/board.h +++ b/arch/arm/mach-tegra/board.h @@ -49,6 +49,7 @@ extern unsigned long tegra_carveout_start; extern unsigned long tegra_carveout_size; extern unsigned long tegra_lp0_vec_start; extern unsigned long tegra_lp0_vec_size; +extern bool tegra_lp0_vec_relocate; extern unsigned long tegra_grhost_aperture; extern struct sys_timer tegra_timer; diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c index bc43477ee1b2..a4aa23710cc3 100644 --- a/arch/arm/mach-tegra/common.c +++ b/arch/arm/mach-tegra/common.c @@ -86,6 +86,7 @@ unsigned long tegra_carveout_start; unsigned long tegra_carveout_size; unsigned long tegra_lp0_vec_start; unsigned long tegra_lp0_vec_size; +bool tegra_lp0_vec_relocate; unsigned long tegra_grhost_aperture = ~0ul; static bool is_tegra_debug_uart_hsport; static struct board_info pmu_board_info; @@ -716,6 +717,18 @@ void __init tegra_reserve(unsigned long carveout_size, unsigned long fb_size, } #endif + if (tegra_lp0_vec_size && + (tegra_lp0_vec_start < memblock_end_of_DRAM())) { + if (memblock_reserve(tegra_lp0_vec_start, tegra_lp0_vec_size)) { + pr_err("Failed to reserve lp0_vec %08lx@%08lx\n", + tegra_lp0_vec_size, tegra_lp0_vec_start); + tegra_lp0_vec_start = 0; + tegra_lp0_vec_size = 0; + } + tegra_lp0_vec_relocate = false; + } else + tegra_lp0_vec_relocate = true; + /* * We copy the bootloader's framebuffer to the framebuffer allocated * above, and then free this one. diff --git a/arch/arm/mach-tegra/suspend.c b/arch/arm/mach-tegra/suspend.c index 0604dab04a1b..280b5d4ddf35 100644 --- a/arch/arm/mach-tegra/suspend.c +++ b/arch/arm/mach-tegra/suspend.c @@ -1182,7 +1182,9 @@ void __init tegra_init_suspend(struct tegra_suspend_platform_data *plat) pr_warning("Disabling LP0\n"); plat->suspend_mode = TEGRA_SUSPEND_LP1; } - if (plat->suspend_mode == TEGRA_SUSPEND_LP0 && tegra_lp0_vec_size) { + + if (plat->suspend_mode == TEGRA_SUSPEND_LP0 && tegra_lp0_vec_size && + tegra_lp0_vec_relocate) { unsigned char *reloc_lp0; unsigned long tmp; void __iomem *orig; -- cgit v1.2.3