All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] arm: omap: sram: fix OMAP4 errata handling
@ 2012-08-29 15:24 Aaro Koskinen
  2012-08-29 15:24 ` [PATCH 2/2] arm: omap: sram: skip the first 16K on OMAP3 HS Aaro Koskinen
  2012-08-29 15:27 ` [PATCH 1/2] arm: omap: sram: fix OMAP4 errata handling Shilimkar, Santosh
  0 siblings, 2 replies; 6+ messages in thread
From: Aaro Koskinen @ 2012-08-29 15:24 UTC (permalink / raw)
  To: linux-omap, tony, santosh.shilimkar

OMAP4-specific code should be executed only if we are running on
OMAP4. Otherwise it may break multi-OMAP kernels. Found by reading
the code.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 arch/arm/plat-omap/sram.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index 766181c..85c23db 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -175,8 +175,10 @@ static void __init omap_map_sram(void)
 		return;
 
 #ifdef CONFIG_OMAP4_ERRATA_I688
+	if (cpu_is_omap44xx()) {
 		omap_sram_start += PAGE_SIZE;
 		omap_sram_size -= SZ_16K;
+	}
 #endif
 	if (cpu_is_omap34xx()) {
 		/*
-- 
1.7.2.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] arm: omap: sram: skip the first 16K on OMAP3 HS
  2012-08-29 15:24 [PATCH 1/2] arm: omap: sram: fix OMAP4 errata handling Aaro Koskinen
@ 2012-08-29 15:24 ` Aaro Koskinen
  2012-08-29 15:29   ` Shilimkar, Santosh
  2012-08-29 15:27 ` [PATCH 1/2] arm: omap: sram: fix OMAP4 errata handling Shilimkar, Santosh
  1 sibling, 1 reply; 6+ messages in thread
From: Aaro Koskinen @ 2012-08-29 15:24 UTC (permalink / raw)
  To: linux-omap, tony, santosh.shilimkar

In some OMAP3 HS devices (at least Nokia N9 and N950), the public SRAM
seems to conflict with secure portition of SRAM. When booting the 3.6-rc3
kernel (and also earlier) on these devices, the kernel gets tainted with
tons of the following warnings:

	[    6.894348] In-band Error seen by MPU  at address 0
	[...]
	[    6.894378] WARNING: at arch/arm/mach-omap2/omap_l3_smx.c:162

Fix this by skipping the first 16K of the public SRAM. (Note that the
mapping could not be changed, as it resulted in secure monitor call
failure in save_secure_sram().)

This will leave 12K SRAM available that should be still sufficient. The
patch has been boot tested with vanilla 3.6-rc3 on N900, N950 and N9.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 arch/arm/plat-omap/sram.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index 85c23db..024f3b0 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -68,6 +68,7 @@
 
 static unsigned long omap_sram_start;
 static void __iomem *omap_sram_base;
+static unsigned long omap_sram_skip;
 static unsigned long omap_sram_size;
 static void __iomem *omap_sram_ceil;
 
@@ -106,6 +107,7 @@ static int is_sram_locked(void)
  */
 static void __init omap_detect_sram(void)
 {
+	omap_sram_skip = SRAM_BOOTLOADER_SZ;
 	if (cpu_class_is_omap2()) {
 		if (is_sram_locked()) {
 			if (cpu_is_omap34xx()) {
@@ -113,6 +115,7 @@ static void __init omap_detect_sram(void)
 				if ((omap_type() == OMAP2_DEVICE_TYPE_EMU) ||
 				    (omap_type() == OMAP2_DEVICE_TYPE_SEC)) {
 					omap_sram_size = 0x7000; /* 28K */
+					omap_sram_skip += SZ_16K;
 				} else {
 					omap_sram_size = 0x8000; /* 32K */
 				}
@@ -205,8 +208,8 @@ static void __init omap_map_sram(void)
 	 * Looks like we need to preserve some bootloader code at the
 	 * beginning of SRAM for jumping to flash for reboot to work...
 	 */
-	memset_io(omap_sram_base + SRAM_BOOTLOADER_SZ, 0,
-		  omap_sram_size - SRAM_BOOTLOADER_SZ);
+	memset_io(omap_sram_base + omap_sram_skip, 0,
+		  omap_sram_size - omap_sram_skip);
 }
 
 /*
@@ -220,7 +223,7 @@ void *omap_sram_push_address(unsigned long size)
 {
 	unsigned long available, new_ceil = (unsigned long)omap_sram_ceil;
 
-	available = omap_sram_ceil - (omap_sram_base + SRAM_BOOTLOADER_SZ);
+	available = omap_sram_ceil - (omap_sram_base + omap_sram_skip);
 
 	if (size > available) {
 		pr_err("Not enough space in SRAM\n");
-- 
1.7.2.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] arm: omap: sram: fix OMAP4 errata handling
  2012-08-29 15:24 [PATCH 1/2] arm: omap: sram: fix OMAP4 errata handling Aaro Koskinen
  2012-08-29 15:24 ` [PATCH 2/2] arm: omap: sram: skip the first 16K on OMAP3 HS Aaro Koskinen
@ 2012-08-29 15:27 ` Shilimkar, Santosh
  1 sibling, 0 replies; 6+ messages in thread
From: Shilimkar, Santosh @ 2012-08-29 15:27 UTC (permalink / raw)
  To: Aaro Koskinen; +Cc: linux-omap, tony

On Wed, Aug 29, 2012 at 8:24 AM, Aaro Koskinen <aaro.koskinen@iki.fi> wrote:
> OMAP4-specific code should be executed only if we are running on
> OMAP4. Otherwise it may break multi-OMAP kernels. Found by reading
> the code.
>
> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> ---
Looks good.

Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] arm: omap: sram: skip the first 16K on OMAP3 HS
  2012-08-29 15:24 ` [PATCH 2/2] arm: omap: sram: skip the first 16K on OMAP3 HS Aaro Koskinen
@ 2012-08-29 15:29   ` Shilimkar, Santosh
  2012-08-30 20:40     ` Tony Lindgren
  0 siblings, 1 reply; 6+ messages in thread
From: Shilimkar, Santosh @ 2012-08-29 15:29 UTC (permalink / raw)
  To: Aaro Koskinen; +Cc: linux-omap, tony

On Wed, Aug 29, 2012 at 8:24 AM, Aaro Koskinen <aaro.koskinen@iki.fi> wrote:
> In some OMAP3 HS devices (at least Nokia N9 and N950), the public SRAM
> seems to conflict with secure portition of SRAM. When booting the 3.6-rc3
> kernel (and also earlier) on these devices, the kernel gets tainted with
> tons of the following warnings:
>
>         [    6.894348] In-band Error seen by MPU  at address 0
>         [...]
>         [    6.894378] WARNING: at arch/arm/mach-omap2/omap_l3_smx.c:162
>
> Fix this by skipping the first 16K of the public SRAM. (Note that the
> mapping could not be changed, as it resulted in secure monitor call
> failure in save_secure_sram().)
>
> This will leave 12K SRAM available that should be still sufficient. The
> patch has been boot tested with vanilla 3.6-rc3 on N900, N950 and N9.
>
> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> ---
>  arch/arm/plat-omap/sram.c |    9 ++++++---
>  1 files changed, 6 insertions(+), 3 deletions(-)
>
Looks good.

Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] arm: omap: sram: skip the first 16K on OMAP3 HS
  2012-08-29 15:29   ` Shilimkar, Santosh
@ 2012-08-30 20:40     ` Tony Lindgren
  2012-09-26 13:01       ` Jarkko Nikula
  0 siblings, 1 reply; 6+ messages in thread
From: Tony Lindgren @ 2012-08-30 20:40 UTC (permalink / raw)
  To: Shilimkar, Santosh; +Cc: Aaro Koskinen, linux-omap

* Shilimkar, Santosh <santosh.shilimkar@ti.com> [120829 08:30]:
> On Wed, Aug 29, 2012 at 8:24 AM, Aaro Koskinen <aaro.koskinen@iki.fi> wrote:
> > In some OMAP3 HS devices (at least Nokia N9 and N950), the public SRAM
> > seems to conflict with secure portition of SRAM. When booting the 3.6-rc3
> > kernel (and also earlier) on these devices, the kernel gets tainted with
> > tons of the following warnings:
> >
> >         [    6.894348] In-band Error seen by MPU  at address 0
> >         [...]
> >         [    6.894378] WARNING: at arch/arm/mach-omap2/omap_l3_smx.c:162
> >
> > Fix this by skipping the first 16K of the public SRAM. (Note that the
> > mapping could not be changed, as it resulted in secure monitor call
> > failure in save_secure_sram().)
> >
> > This will leave 12K SRAM available that should be still sufficient. The
> > patch has been boot tested with vanilla 3.6-rc3 on N900, N950 and N9.
> >
> > Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> > ---
> >  arch/arm/plat-omap/sram.c |    9 ++++++---
> >  1 files changed, 6 insertions(+), 3 deletions(-)
> >
> Looks good.
> 
> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>

Thanks applying both into fixes. Aaro, note that now that we're merging
patches via the arm soc tree, let's use "ARM: OMAP: " for the subject so
I don't need to fix it up ;)

Tony

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] arm: omap: sram: skip the first 16K on OMAP3 HS
  2012-08-30 20:40     ` Tony Lindgren
@ 2012-09-26 13:01       ` Jarkko Nikula
  0 siblings, 0 replies; 6+ messages in thread
From: Jarkko Nikula @ 2012-09-26 13:01 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Shilimkar, Santosh, Aaro Koskinen, linux-omap

Hi Aaro

On Thu, 30 Aug 2012 13:40:30 -0700
Tony Lindgren <tony@atomide.com> wrote:

> * Shilimkar, Santosh <santosh.shilimkar@ti.com> [120829 08:30]:
> > On Wed, Aug 29, 2012 at 8:24 AM, Aaro Koskinen <aaro.koskinen@iki.fi> wrote:
> > > In some OMAP3 HS devices (at least Nokia N9 and N950), the public SRAM
> > > seems to conflict with secure portition of SRAM. When booting the 3.6-rc3
> > > kernel (and also earlier) on these devices, the kernel gets tainted with
> > > tons of the following warnings:
> > >
> > >         [    6.894348] In-band Error seen by MPU  at address 0
> > >         [...]
> > >         [    6.894378] WARNING: at arch/arm/mach-omap2/omap_l3_smx.c:162
> > >
> > > Fix this by skipping the first 16K of the public SRAM. (Note that the
> > > mapping could not be changed, as it resulted in secure monitor call
> > > failure in save_secure_sram().)
> > >
> > > This will leave 12K SRAM available that should be still sufficient. The
> > > patch has been boot tested with vanilla 3.6-rc3 on N900, N950 and N9.
> > >
> > > Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> > > ---
> > >  arch/arm/plat-omap/sram.c |    9 ++++++---
> > >  1 files changed, 6 insertions(+), 3 deletions(-)
> > >
> > Looks good.
> > 
> > Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> 
> Thanks applying both into fixes. Aaro, note that now that we're merging
> patches via the arm soc tree, let's use "ARM: OMAP: " for the subject so
> I don't need to fix it up ;)
> 
This issue appears to be in 3.5 too (I didn't check others). Should you commit id of this patch and affected kernel versions to stable?

-- 
Jarkko

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-09-26 13:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-29 15:24 [PATCH 1/2] arm: omap: sram: fix OMAP4 errata handling Aaro Koskinen
2012-08-29 15:24 ` [PATCH 2/2] arm: omap: sram: skip the first 16K on OMAP3 HS Aaro Koskinen
2012-08-29 15:29   ` Shilimkar, Santosh
2012-08-30 20:40     ` Tony Lindgren
2012-09-26 13:01       ` Jarkko Nikula
2012-08-29 15:27 ` [PATCH 1/2] arm: omap: sram: fix OMAP4 errata handling Shilimkar, Santosh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.