[PATCH] ARM: OMAP2+: Add static SRAM mapping for save_secure_ram_context

From: Tony Lindgren
Date: Thu Nov 09 2017 - 20:05:34 EST


With the CMA changes from Joonsoo Kim <iamjoonsoo.kim@xxxxxxx>, it
was noticed that n900 stopped booting. After investigating it turned
out that n900 save_secure_ram_context does some whacky virtual to
physical address translation for the SRAM data address.

Let's fix this for CMA changes by adding a static mapping for SRAM
on omap3. Then we can follow up with a patch to clean up the address
translation in save_secure_ram_context later on.

Debugged-by: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx>
Signed-off-by: Tony Lindgren <tony@xxxxxxxxxxx>
---
arch/arm/mach-omap2/io.c | 6 ++++++
arch/arm/mach-omap2/iomap.h | 4 ++++
2 files changed, 10 insertions(+)

diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -139,6 +139,12 @@ static struct map_desc omap243x_io_desc[] __initdata = {

#ifdef CONFIG_ARCH_OMAP3
static struct map_desc omap34xx_io_desc[] __initdata = {
+ {
+ .virtual = OMAP34XX_SRAM_VIRT,
+ .pfn = __phys_to_pfn(OMAP34XX_SRAM_PHYS),
+ .length = OMAP34XX_SRAM_SIZE,
+ .type = MT_DEVICE
+ },
{
.virtual = L3_34XX_VIRT,
.pfn = __phys_to_pfn(L3_34XX_PHYS),
diff --git a/arch/arm/mach-omap2/iomap.h b/arch/arm/mach-omap2/iomap.h
--- a/arch/arm/mach-omap2/iomap.h
+++ b/arch/arm/mach-omap2/iomap.h
@@ -123,6 +123,10 @@
* VPOM3430 was not working for Int controller
*/

+#define OMAP34XX_SRAM_PHYS 0x40200000
+#define OMAP34XX_SRAM_VIRT 0xd0010000
+#define OMAP34XX_SRAM_SIZE 0x10000
+
#define L4_PER_34XX_PHYS L4_PER_34XX_BASE
/* 0x49000000 --> 0xfb000000 */
#define L4_PER_34XX_VIRT (L4_PER_34XX_PHYS + OMAP2_L4_IO_OFFSET)
--
2.15.0