linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] SA11x0 fixes
@ 2012-02-03 19:15 Russell King - ARM Linux
  2012-02-03 19:15 ` [PATCH 1/3] ARM: sa11x0: fix off-by-one resource sizes Russell King - ARM Linux
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Russell King - ARM Linux @ 2012-02-03 19:15 UTC (permalink / raw)
  To: linux-arm-kernel

This series of three patches fix a number of issues I've noticed while
looking at the SA11x0 code - they're all trivial in nature, so I don't
think too much additional explaination is required.

 arch/arm/common/sa1111.c          |    2 +-
 arch/arm/mach-sa1100/generic.c    |    4 ++--
 arch/arm/mach-sa1100/hackkit.c    |    2 +-
 arch/arm/mach-sa1100/jornada720.c |    8 ++++----
 arch/arm/mach-sa1100/sleep.S      |   37 ++++++++++++++++++++++---------------
 5 files changed, 30 insertions(+), 23 deletions(-)

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

* [PATCH 1/3] ARM: sa11x0: fix off-by-one resource sizes
  2012-02-03 19:15 [PATCH 0/3] SA11x0 fixes Russell King - ARM Linux
@ 2012-02-03 19:15 ` Russell King - ARM Linux
  2012-02-03 19:16 ` [PATCH 2/3] ARM: sa11x0: fix sleep entry Russell King - ARM Linux
  2012-02-03 19:16 ` [PATCH 3/3] ARM: sa11x0: fix section mismatch warnings Russell King - ARM Linux
  2 siblings, 0 replies; 4+ messages in thread
From: Russell King - ARM Linux @ 2012-02-03 19:15 UTC (permalink / raw)
  To: linux-arm-kernel

Hackkit defined its flash memory resource to be 32M + 1 byte.
Jornada defined the Epson video controller resources to be one byte
larger than they should be, and mis-mapped the SA-1111 companion
chip one byte smaller than it should be.

Fix these.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 arch/arm/mach-sa1100/hackkit.c    |    2 +-
 arch/arm/mach-sa1100/jornada720.c |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-sa1100/hackkit.c b/arch/arm/mach-sa1100/hackkit.c
index c01bb36..9092b3a 100644
--- a/arch/arm/mach-sa1100/hackkit.c
+++ b/arch/arm/mach-sa1100/hackkit.c
@@ -181,7 +181,7 @@ static struct flash_platform_data hackkit_flash_data = {
 
 static struct resource hackkit_flash_resource = {
 	.start		= SA1100_CS0_PHYS,
-	.end		= SA1100_CS0_PHYS + SZ_32M,
+	.end		= SA1100_CS0_PHYS + SZ_32M - 1,
 	.flags		= IORESOURCE_MEM,
 };
 
diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c
index ee121d6..5393b06 100644
--- a/arch/arm/mach-sa1100/jornada720.c
+++ b/arch/arm/mach-sa1100/jornada720.c
@@ -46,7 +46,7 @@
 
 /* memory space (line 52 of HP's doc) */
 #define SA1111REGSTART	0x40000000
-#define SA1111REGLEN	0x00001fff
+#define SA1111REGLEN	0x00002000
 #define EPSONREGSTART	0x48000000
 #define EPSONREGLEN	0x00100000
 #define EPSONFBSTART	0x48200000
@@ -176,12 +176,12 @@ static struct s1d13xxxfb_pdata s1d13xxxfb_data = {
 static struct resource s1d13xxxfb_resources[] = {
 	[0] = {
 		.start	= EPSONFBSTART,
-		.end	= EPSONFBSTART + EPSONFBLEN,
+		.end	= EPSONFBSTART + EPSONFBLEN - 1,
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {
 		.start	= EPSONREGSTART,
-		.end	= EPSONREGSTART + EPSONREGLEN,
+		.end	= EPSONREGSTART + EPSONREGLEN - 1,
 		.flags	= IORESOURCE_MEM,
 	}
 };
@@ -199,7 +199,7 @@ static struct platform_device s1d13xxxfb_device = {
 static struct resource sa1111_resources[] = {
 	[0] = {
 		.start		= SA1111REGSTART,
-		.end		= SA1111REGSTART + SA1111REGLEN,
+		.end		= SA1111REGSTART + SA1111REGLEN - 1,
 		.flags		= IORESOURCE_MEM,
 	},
 	[1] = {
-- 
1.7.4.4

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

* [PATCH 2/3] ARM: sa11x0: fix sleep entry
  2012-02-03 19:15 [PATCH 0/3] SA11x0 fixes Russell King - ARM Linux
  2012-02-03 19:15 ` [PATCH 1/3] ARM: sa11x0: fix off-by-one resource sizes Russell King - ARM Linux
@ 2012-02-03 19:16 ` Russell King - ARM Linux
  2012-02-03 19:16 ` [PATCH 3/3] ARM: sa11x0: fix section mismatch warnings Russell King - ARM Linux
  2 siblings, 0 replies; 4+ messages in thread
From: Russell King - ARM Linux @ 2012-02-03 19:16 UTC (permalink / raw)
  To: linux-arm-kernel

Sometimes, we get stuck while trying to enter sleep.  This seems
to occur if we do not have udelay() in the instruction cache. Avoid
this by requesting a short delay prior to modifying the SDRAM timings.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 arch/arm/mach-sa1100/sleep.S |   37 ++++++++++++++++++++++---------------
 1 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-sa1100/sleep.S b/arch/arm/mach-sa1100/sleep.S
index e822331..30cc672 100644
--- a/arch/arm/mach-sa1100/sleep.S
+++ b/arch/arm/mach-sa1100/sleep.S
@@ -26,27 +26,36 @@
  *
  * Causes sa11x0 to enter sleep state
  *
+ * Must be aligned to a cacheline.
  */
-
+	.balign	32
 ENTRY(sa1100_finish_suspend)
 	@ disable clock switching
 	mcr	p15, 0, r1, c15, c2, 2
 
-        @ Adjust memory timing before lowering CPU clock
-	@ Clock speed adjustment without changing memory timing makes
-	@ CPU hang in some cases
-        ldr     r0, =MDREFR
-        ldr     r1, [r0]
-        orr     r1, r1, #MDREFR_K1DB2
-        str     r1, [r0]
+	ldr	r6, =MDREFR
+	ldr	r4, [r6]
+	orr     r4, r4, #MDREFR_K1DB2
+	ldr	r5, =PPCR
+
+	@ Pre-load __udelay into the I-cache
+	mov	r0, #1
+	bl	__udelay
+	mov	r0, r0
+
+	@ The following must all exist in a single cache line to
+	@ avoid accessing memory until this sequence is complete,
+	@ otherwise we occasionally hang.
+
+	@ Adjust memory timing before lowering CPU clock
+	str     r4, [r6]
 
 	@ delay 90us and set CPU PLL to lowest speed
 	@ fixes resume problem on high speed SA1110
 	mov	r0, #90
 	bl	__udelay
-	ldr	r0, =PPCR
 	mov	r1, #0
-	str	r1, [r0]
+	str	r1, [r5]
 	mov	r0, #90
 	bl	__udelay
 
@@ -85,12 +94,10 @@ ENTRY(sa1100_finish_suspend)
 	bic	r5, r5, #FMsk(MSC_RT)
 	bic	r5, r5, #FMsk(MSC_RT)<<16
 
-	ldr	r6, =MDREFR
-
 	ldr	r7, [r6]
-bic	r7, r7, #0x0000FF00
-bic	r7, r7, #0x000000F0
-orr	r8, r7, #MDREFR_SLFRSH
+	bic	r7, r7, #0x0000FF00
+	bic	r7, r7, #0x000000F0
+	orr	r8, r7, #MDREFR_SLFRSH
 
 	ldr	r9, =MDCNFG
 	ldr	r10, [r9]
-- 
1.7.4.4

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

* [PATCH 3/3] ARM: sa11x0: fix section mismatch warnings
  2012-02-03 19:15 [PATCH 0/3] SA11x0 fixes Russell King - ARM Linux
  2012-02-03 19:15 ` [PATCH 1/3] ARM: sa11x0: fix off-by-one resource sizes Russell King - ARM Linux
  2012-02-03 19:16 ` [PATCH 2/3] ARM: sa11x0: fix sleep entry Russell King - ARM Linux
@ 2012-02-03 19:16 ` Russell King - ARM Linux
  2 siblings, 0 replies; 4+ messages in thread
From: Russell King - ARM Linux @ 2012-02-03 19:16 UTC (permalink / raw)
  To: linux-arm-kernel

Neponset calls sa1110_mb_disable() from __devinit code, but
sa1110_mb_disable() is marked __init, and so causes a section
mismatch warning.

As sa1110_mb_enable() and sa1110_mb_disable() need to be callable
from suspend/resume paths as well, they must not be marked __init
or __devinit.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 arch/arm/common/sa1111.c       |    2 +-
 arch/arm/mach-sa1100/generic.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index 61691cd..bf508a7 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -87,7 +87,7 @@
 #define IRQ_S0_BVD1_STSCHG	(53)
 #define IRQ_S1_BVD1_STSCHG	(54)
 
-extern void __init sa1110_mb_enable(void);
+extern void sa1110_mb_enable(void);
 
 /*
  * We keep the following data for the overall SA1111.  Note that the
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
index bb10ee2..0e356bb 100644
--- a/arch/arm/mach-sa1100/generic.c
+++ b/arch/arm/mach-sa1100/generic.c
@@ -428,7 +428,7 @@ void __init sa1100_map_io(void)
  * the MBGNT signal false to ensure the SA1111 doesn't own the
  * SDRAM bus.
  */
-void __init sa1110_mb_disable(void)
+void sa1110_mb_disable(void)
 {
 	unsigned long flags;
 
@@ -447,7 +447,7 @@ void __init sa1110_mb_disable(void)
  * If the system is going to use the SA-1111 DMA engines, set up
  * the memory bus request/grant pins.
  */
-void __devinit sa1110_mb_enable(void)
+void sa1110_mb_enable(void)
 {
 	unsigned long flags;
 
-- 
1.7.4.4

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

end of thread, other threads:[~2012-02-03 19:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-03 19:15 [PATCH 0/3] SA11x0 fixes Russell King - ARM Linux
2012-02-03 19:15 ` [PATCH 1/3] ARM: sa11x0: fix off-by-one resource sizes Russell King - ARM Linux
2012-02-03 19:16 ` [PATCH 2/3] ARM: sa11x0: fix sleep entry Russell King - ARM Linux
2012-02-03 19:16 ` [PATCH 3/3] ARM: sa11x0: fix section mismatch warnings Russell King - ARM Linux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).