summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorPrashant Gaikwad <pgaikwad@nvidia.com>2011-07-28 15:55:10 +0530
committerManish Tuteja <mtuteja@nvidia.com>2011-08-01 23:44:51 -0700
commit1753408edc65ebfc0d4d203f2be960d49ca747a8 (patch)
tree5abafbce5eeccc161be750d6c6d03eef56e3068e /arch
parent7c2bc862291a450f652ad3df2505830222b194cd (diff)
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 Change-Id: Ic602f0f2495756213face30681018529128e57b9 Reviewed-on: http://git-master/r/43685 Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com> Tested-by: Prashant Gaikwad <pgaikwad@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-by: Scott Williams <scwilliams@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-tegra/board.h1
-rwxr-xr-xarch/arm/mach-tegra/common.c13
-rw-r--r--arch/arm/mach-tegra/suspend.c3
3 files changed, 16 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/board.h b/arch/arm/mach-tegra/board.h
index a42ea6582f30..8d19c17585c9 100644
--- a/arch/arm/mach-tegra/board.h
+++ b/arch/arm/mach-tegra/board.h
@@ -45,6 +45,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 b3cf6feb1fca..5c3ad20d95a5 100755
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
@@ -83,6 +83,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;
static bool is_tegra_debug_uart_hsport;
@@ -473,6 +474,18 @@ void __init tegra_reserve(unsigned long carveout_size, unsigned long fb_size,
if (tegra_carveout_size && tegra_carveout_start < tegra_grhost_aperture)
tegra_grhost_aperture = tegra_carveout_start;
+ 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;
+
/*
* TODO: We should 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 6920d87c8982..d260507a6b20 100644
--- a/arch/arm/mach-tegra/suspend.c
+++ b/arch/arm/mach-tegra/suspend.c
@@ -851,7 +851,8 @@ void __init tegra_init_suspend(struct tegra_suspend_platform_data *plat)
(void)reg;
(void)mode;
- 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;