Re: [PATCH 4/4] ARM: OMAP: Map SRAM later on with ioremap_exec()

2011-10-07 Thread Santosh Shilimkar
On Thursday 06 October 2011 03:43 AM, Tony Lindgren wrote:
 * Nicolas Pitre n...@fluxnic.net [111004 17:34]:
 On Tue, 4 Oct 2011, Tony Lindgren wrote:

 This allows us to remove omap hacks for map_io.

 Signed-off-by: Tony Lindgren t...@atomide.com

 Nice cleanup.

 Acked-by: Nicolas Pitre nicolas.pi...@linaro.org
 
 This one needed minor changes for the omap1 omap_sram_init
 call. Updated patch below, still assuming I have your ack
 for this one too.
 
 Tony
 
 
 From: Tony Lindgren t...@atomide.com
 Date: Tue, 4 Oct 2011 13:52:57 -0700
 Subject: [PATCH] ARM: OMAP: Map SRAM later on with ioremap_exec()
 
 This allows us to remove omap hacks for map_io.
 
 Acked-by: Nicolas Pitre nicolas.pi...@linaro.org
 Signed-off-by: Tony Lindgren t...@atomide.com
 

Are you considering this change for 3.2?
OMAP4 errata WA would have a conflict with the
change is sram code and hence the question ?

O.w patch looks fine to me.

Reviewed-by: Santosh Shilimkar santosh.shilim...@ti.com
Tested-by: Santosh Shilimkar santosh.shilim...@ti.com 
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/4] ARM: OMAP: Map SRAM later on with ioremap_exec()

2011-10-07 Thread Tony Lindgren
* Santosh Shilimkar santosh.shilim...@ti.com [111006 23:18]:
 
 Are you considering this change for 3.2?

I think we should as this is blocking development for
generic map_io and genalloc changes for SRAM code.

 OMAP4 errata WA would have a conflict with the
 change is sram code and hence the question ?

Right, let's see if we can fix that with a static mapping.

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/4] ARM: OMAP: Map SRAM later on with ioremap_exec()

2011-10-05 Thread Tony Lindgren
* Nicolas Pitre n...@fluxnic.net [111004 17:34]:
 On Tue, 4 Oct 2011, Tony Lindgren wrote:
 
  This allows us to remove omap hacks for map_io.
  
  Signed-off-by: Tony Lindgren t...@atomide.com
 
 Nice cleanup.
 
 Acked-by: Nicolas Pitre nicolas.pi...@linaro.org

This one needed minor changes for the omap1 omap_sram_init
call. Updated patch below, still assuming I have your ack
for this one too.

Tony


From: Tony Lindgren t...@atomide.com
Date: Tue, 4 Oct 2011 13:52:57 -0700
Subject: [PATCH] ARM: OMAP: Map SRAM later on with ioremap_exec()

This allows us to remove omap hacks for map_io.

Acked-by: Nicolas Pitre nicolas.pi...@linaro.org
Signed-off-by: Tony Lindgren t...@atomide.com

diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index 36f26c3..38e1142 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -21,6 +21,7 @@
 #include mach/hardware.h
 #include asm/mach/map.h
 
+#include plat/common.h
 #include plat/tc.h
 #include plat/board.h
 #include plat/mux.h
@@ -291,6 +292,8 @@ static int __init omap1_init_devices(void)
if (!cpu_class_is_omap1())
return -ENODEV;
 
+   omap_sram_init();
+
/* please keep these calls, and their implementations above,
 * in alphabetical order so they're easier to sort through.
 */
diff --git a/arch/arm/mach-omap1/io.c b/arch/arm/mach-omap1/io.c
index a16aab7..8140a4e 100644
--- a/arch/arm/mach-omap1/io.c
+++ b/arch/arm/mach-omap1/io.c
@@ -21,7 +21,6 @@
 #include clock.h
 
 extern void omap_check_revision(void);
-extern void omap_sram_init(void);
 
 /*
  * The machine specific code may provide the extra mapping besides the
@@ -133,7 +132,6 @@ void omap1_init_early(void)
 */
omap1_clk_init();
omap1_mux_init();
-   omap_sram_init();
 }
 
 /*
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 31c5f4d..fec50d8 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -35,8 +35,8 @@
 #include clock2xxx.h
 #include clock3xxx.h
 #include clock44xx.h
-#include io.h
 
+#include plat/common.h
 #include plat/omap-pm.h
 #include voltage.h
 #include powerdomain.h
@@ -240,22 +240,11 @@ static struct map_desc omap44xx_io_desc[] __initdata = {
 };
 #endif
 
-static void __init _omap2_map_common_io(void)
-{
-   /* Normally devicemaps_init() would flush caches and tlb after
-* mdesc-map_io(), but we must also do it here because of the CPU
-* revision check below.
-*/
-   local_flush_tlb_all();
-   flush_cache_all();
-}
-
 #ifdef CONFIG_SOC_OMAP2420
 void __init omap242x_map_common_io(void)
 {
iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
iotable_init(omap242x_io_desc, ARRAY_SIZE(omap242x_io_desc));
-   _omap2_map_common_io();
 }
 #endif
 
@@ -264,7 +253,6 @@ void __init omap243x_map_common_io(void)
 {
iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
iotable_init(omap243x_io_desc, ARRAY_SIZE(omap243x_io_desc));
-   _omap2_map_common_io();
 }
 #endif
 
@@ -272,7 +260,6 @@ void __init omap243x_map_common_io(void)
 void __init omap34xx_map_common_io(void)
 {
iotable_init(omap34xx_io_desc, ARRAY_SIZE(omap34xx_io_desc));
-   _omap2_map_common_io();
 }
 #endif
 
@@ -280,7 +267,6 @@ void __init omap34xx_map_common_io(void)
 void __init omapti816x_map_common_io(void)
 {
iotable_init(omapti816x_io_desc, ARRAY_SIZE(omapti816x_io_desc));
-   _omap2_map_common_io();
 }
 #endif
 
@@ -288,7 +274,6 @@ void __init omapti816x_map_common_io(void)
 void __init omap44xx_map_common_io(void)
 {
iotable_init(omap44xx_io_desc, ARRAY_SIZE(omap44xx_io_desc));
-   _omap2_map_common_io();
 }
 #endif
 
@@ -337,7 +322,6 @@ void __iomem *omap_irq_base;
 static void __init omap_common_init_early(void)
 {
omap2_check_revision();
-   omap_sram_init();
omap2xxx_voltagedomains_init();
omap2xxx_voltagedomains_init();
omap3xxx_voltagedomains_init();
@@ -453,11 +437,12 @@ void __init omap4430_init_early(void)
 void __init omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
  struct omap_sdrc_params *sdrc_cs1)
 {
+   omap_sram_init();
+
if (cpu_is_omap24xx() || omap3_has_sdrc()) {
omap2_sdrc_init(sdrc_cs0, sdrc_cs1);
_omap2_init_reprogram_sdrc();
}
-
 }
 
 /*
diff --git a/arch/arm/mach-omap2/io.h b/arch/arm/mach-omap2/io.h
index fd230c6..e69de29 100644
--- a/arch/arm/mach-omap2/io.h
+++ b/arch/arm/mach-omap2/io.h
@@ -1,7 +0,0 @@
-
-#ifndef __MACH_OMAP2_IO_H__
-#define __MACH_OMAP2_IO_H__
-
-extern int __init omap_sram_init(void);
-
-#endif /*  __MACH_OMAP2_IO_H__ */
diff --git a/arch/arm/plat-omap/include/plat/common.h 
b/arch/arm/plat-omap/include/plat/common.h
index 5eac355..ed85720 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ 

Re: [PATCH 4/4] ARM: OMAP: Map SRAM later on with ioremap_exec()

2011-10-04 Thread Nicolas Pitre
On Tue, 4 Oct 2011, Tony Lindgren wrote:

 This allows us to remove omap hacks for map_io.
 
 Signed-off-by: Tony Lindgren t...@atomide.com

Nice cleanup.

Acked-by: Nicolas Pitre nicolas.pi...@linaro.org


 ---
  arch/arm/mach-omap2/io.c  |   19 +---
  arch/arm/plat-omap/sram.c |   69 
 +
  2 files changed, 22 insertions(+), 66 deletions(-)
 
 diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
 index 82230e1..8069ca8 100644
 --- a/arch/arm/mach-omap2/io.c
 +++ b/arch/arm/mach-omap2/io.c
 @@ -239,22 +239,11 @@ static struct map_desc omap44xx_io_desc[] __initdata = {
  };
  #endif
  
 -static void __init _omap2_map_common_io(void)
 -{
 - /* Normally devicemaps_init() would flush caches and tlb after
 -  * mdesc-map_io(), but we must also do it here because of the CPU
 -  * revision check below.
 -  */
 - local_flush_tlb_all();
 - flush_cache_all();
 -}
 -
  #ifdef CONFIG_SOC_OMAP2420
  void __init omap242x_map_common_io(void)
  {
   iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
   iotable_init(omap242x_io_desc, ARRAY_SIZE(omap242x_io_desc));
 - _omap2_map_common_io();
  }
  #endif
  
 @@ -263,7 +252,6 @@ void __init omap243x_map_common_io(void)
  {
   iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
   iotable_init(omap243x_io_desc, ARRAY_SIZE(omap243x_io_desc));
 - _omap2_map_common_io();
  }
  #endif
  
 @@ -271,7 +259,6 @@ void __init omap243x_map_common_io(void)
  void __init omap34xx_map_common_io(void)
  {
   iotable_init(omap34xx_io_desc, ARRAY_SIZE(omap34xx_io_desc));
 - _omap2_map_common_io();
  }
  #endif
  
 @@ -279,7 +266,6 @@ void __init omap34xx_map_common_io(void)
  void __init omapti816x_map_common_io(void)
  {
   iotable_init(omapti816x_io_desc, ARRAY_SIZE(omapti816x_io_desc));
 - _omap2_map_common_io();
  }
  #endif
  
 @@ -287,7 +273,6 @@ void __init omapti816x_map_common_io(void)
  void __init omap44xx_map_common_io(void)
  {
   iotable_init(omap44xx_io_desc, ARRAY_SIZE(omap44xx_io_desc));
 - _omap2_map_common_io();
  }
  #endif
  
 @@ -336,7 +321,6 @@ void __iomem *omap_irq_base;
  static void __init omap_common_init_early(void)
  {
   omap2_check_revision();
 - omap_sram_init();
  }
  
  static void __init omap_hwmod_init_postsetup(void)
 @@ -448,11 +432,12 @@ void __init omap4430_init_early(void)
  void __init omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
 struct omap_sdrc_params *sdrc_cs1)
  {
 + omap_sram_init();
 +
   if (cpu_is_omap24xx() || omap3_has_sdrc()) {
   omap2_sdrc_init(sdrc_cs0, sdrc_cs1);
   _omap2_init_reprogram_sdrc();
   }
 -
  }
  
  /*
 diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
 index 3c8aa44..8b28664 100644
 --- a/arch/arm/plat-omap/sram.c
 +++ b/arch/arm/plat-omap/sram.c
 @@ -38,16 +38,9 @@
  #endif
  
  #define OMAP1_SRAM_PA0x2000
 -#define OMAP1_SRAM_VAVMALLOC_END
  #define OMAP2_SRAM_PUB_PA(OMAP2_SRAM_PA + 0xf800)
 -#define OMAP2_SRAM_VA0xfe40
 -#define OMAP2_SRAM_PUB_VA(OMAP2_SRAM_VA + 0x800)
 -#define OMAP3_SRAM_VA   0xfe40
  #define OMAP3_SRAM_PUB_PA   (OMAP3_SRAM_PA + 0x8000)
 -#define OMAP3_SRAM_PUB_VA   (OMAP3_SRAM_VA + 0x8000)
 -#define OMAP4_SRAM_VA0xfe40
  #define OMAP4_SRAM_PUB_PA(OMAP4_SRAM_PA + 0x4000)
 -#define OMAP4_SRAM_PUB_VA(OMAP4_SRAM_VA + 0x4000)
  
  #if defined(CONFIG_ARCH_OMAP2PLUS)
  #define SRAM_BOOTLOADER_SZ   0x00
 @@ -70,9 +63,9 @@
  #define ROUND_DOWN(value,boundary)   ((value)  (~((boundary)-1)))
  
  static unsigned long omap_sram_start;
 -static unsigned long omap_sram_base;
 +static void __iomem *omap_sram_base;
  static unsigned long omap_sram_size;
 -static unsigned long omap_sram_ceil;
 +static void __iomem *omap_sram_ceil;
  
  /*
   * Depending on the target RAMFS firewall setup, the public usable amount of
 @@ -112,7 +105,6 @@ static void __init omap_detect_sram(void)
   if (cpu_class_is_omap2()) {
   if (is_sram_locked()) {
   if (cpu_is_omap34xx()) {
 - omap_sram_base = OMAP3_SRAM_PUB_VA;
   omap_sram_start = OMAP3_SRAM_PUB_PA;
   if ((omap_type() == OMAP2_DEVICE_TYPE_EMU) ||
   (omap_type() == OMAP2_DEVICE_TYPE_SEC)) {
 @@ -121,25 +113,20 @@ static void __init omap_detect_sram(void)
   omap_sram_size = 0x8000; /* 32K */
   }
   } else if (cpu_is_omap44xx()) {
 - omap_sram_base = OMAP4_SRAM_PUB_VA;
   omap_sram_start = OMAP4_SRAM_PUB_PA;
   omap_sram_size = 0xa000; /* 40K */
   } else {
 -