ARM: OMAP: AM33XX: Add an API for obtaining the virt EMIF addr
authorVaibhav Bedia <vaibhav.bedia@ti.com>
Tue, 17 Jan 2012 06:44:34 +0000 (12:14 +0530)
committerVaibhav Hiremath <hvaibhav@ti.com>
Mon, 23 Jan 2012 19:14:56 +0000 (00:44 +0530)
The low level code for suspend needs the virtual address
of EMIF so that the SDRAM can be put in self-refresh.
Since the emif is ioremapped very early on, add an API
which returns the virtual address of the EMIF address space

Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>
arch/arm/mach-omap2/board-am335xevm.c
arch/arm/plat-omap/include/plat/emif.h

index 81d9b84afde2aac2eecc16d04940b16b85f06fcd..31dc5d7725fc2e31e1e67dba34b0dae48f6c5dd7 100644 (file)
@@ -52,6 +52,7 @@
 #include <plat/lcdc.h>
 #include <plat/usb.h>
 #include <plat/mmc.h>
 #include <plat/lcdc.h>
 #include <plat/usb.h>
 #include <plat/mmc.h>
+#include <plat/emif.h>
 
 #include "board-flash.h"
 #include "cpuidle33xx.h"
 
 #include "board-flash.h"
 #include "cpuidle33xx.h"
@@ -1913,9 +1914,10 @@ static void __init clkout2_enable(void)
        setup_pin_mux(clkout2_pin_mux);
 }
 
        setup_pin_mux(clkout2_pin_mux);
 }
 
+void __iomem *am33xx_emif_base;
+
 void __iomem * __init am33xx_get_mem_ctlr(void)
 {
 void __iomem * __init am33xx_get_mem_ctlr(void)
 {
-       void __iomem *am33xx_emif_base;
 
        am33xx_emif_base = ioremap(AM33XX_EMIF0_BASE, SZ_32K);
 
 
        am33xx_emif_base = ioremap(AM33XX_EMIF0_BASE, SZ_32K);
 
@@ -1925,6 +1927,11 @@ void __iomem * __init am33xx_get_mem_ctlr(void)
        return am33xx_emif_base;
 }
 
        return am33xx_emif_base;
 }
 
+void __iomem *am33xx_get_ram_base(void)
+{
+       return am33xx_emif_base;
+}
+
 static struct resource am33xx_cpuidle_resources[] = {
        {
                .start          = AM33XX_EMIF0_BASE,
 static struct resource am33xx_cpuidle_resources[] = {
        {
                .start          = AM33XX_EMIF0_BASE,
index 314c1264a493db5c7fa6ba7e6f99a21d742d1216..e1b39d6078dc862dbb588b92d47752b7c3c3566f 100644 (file)
 #ifndef __EMIF_H
 #define __EMIF_H
 
 #ifndef __EMIF_H
 #define __EMIF_H
 
+#ifndef __ASSEMBLER__
+extern void __iomem *am33xx_get_ram_base(void);
+#endif /* ASSEMBLER */
+
 #define EMIF_MOD_ID_REV                        (0x0)
 #define EMIF4_0_SDRAM_STATUS            (0x04)
 #define EMIF4_0_SDRAM_CONFIG            (0x08)
 #define EMIF_MOD_ID_REV                        (0x0)
 #define EMIF4_0_SDRAM_STATUS            (0x04)
 #define EMIF4_0_SDRAM_CONFIG            (0x08)