summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2017-05-22 16:56:32 -0700
committerOleksandr Suvorov <oleksandr.suvorov@toradex.com>2021-01-27 11:03:29 +0200
commitd7ad2bd4bda2f4893763f1deb81d35a0af7e4348 (patch)
tree3897373b406af3250b23e2ed70d3c24ed626d6fa /arch/arm/mach-imx
parent4f6047ea90eaac6780a06590bc0585e969a95fdb (diff)
ARM: imx: spare the first 16KiB of OCRAM_S for Cortex-M4
The Cortex-M4 boot vector table is located in the OCRAM_S. When building a firmware with a complete vector table at 0x00000000 Linux overwrites the vector table with suspend information. Use the higher 16KiB for suspend related information so that we can use the lower 16KiB for the Cortex-M4 core. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit a8e0d437843393309b6db46c0e19f9da0b5d213b) (cherry picked from commit 00a4494d5be2134b620b6f006f41a0b31c543b9c)
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r--arch/arm/mach-imx/pm-imx7.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/pm-imx7.c b/arch/arm/mach-imx/pm-imx7.c
index e59cbee6dfc2..c0eba02e280f 100644
--- a/arch/arm/mach-imx/pm-imx7.c
+++ b/arch/arm/mach-imx/pm-imx7.c
@@ -44,6 +44,7 @@
#include "hardware.h"
#include "cpuidle.h"
+#define MX7_SUSPEND_OCRAM_OFFSET 0x4000
#define MX7_SUSPEND_OCRAM_SIZE 0x1000
#define MX7_MAX_DDRC_NUM 32
#define MX7_MAX_DDRC_PHY_NUM 16
@@ -892,7 +893,8 @@ static int __init imx7_dt_find_lpsram(unsigned long node, const char *uname,
if (!prop)
return -EINVAL;
- lpram_addr = be32_to_cpup(prop);
+ /* Add offset so we can use a full vector table for M4 */
+ lpram_addr = be32_to_cpup(prop) + MX7_SUSPEND_OCRAM_OFFSET;
/* We need to create a 1M page table entry. */
iram_tlb_io_desc.virtual = IMX_IO_P2V(lpram_addr & 0xFFF00000);