Thread (5 messages) flat view 5 messages, 3 authors, 2011-02-14
STALE5652d

Revision v4 of 17 in this series.

Revisions (17)
  1. v2 [diff vs current]
  2. v2 [diff vs current]
  3. v2 [diff vs current]
  4. v3 [diff vs current]
  5. v2 [diff vs current]
  6. v2 [diff vs current]
  7. v2 [diff vs current]
  8. v4 [diff vs current]
  9. v2 [diff vs current]
  10. v4 current
  11. v4 [diff vs current]
  12. v4 [diff vs current]
  13. v5 [diff vs current]
  14. v5 [diff vs current]
  15. v5 [diff vs current]
  16. v5 [diff vs current]
  17. v5 [diff vs current]

[PATCH v4 0/5] ARM: omap[34]: Thumb-2 compatibility fixes

From: Dave Martin <hidden>
Date: 2011-02-14 13:17:51
Also in: linux-omap
Subsystem: arm port, omap2+ support, the rest · Maintainers: Russell King, Aaro Koskinen, Andreas Kemnade, Kevin Hilman, Roger Quadros, Tony Lindgren, Linus Torvalds

Possibly related (same subject, not in this thread)

On Fri, Feb 11, 2011 at 03:31:20PM -0800, Kevin Hilman wrote:
Hi Dave,

Dave Martin [off-list ref] writes:
quoted
This set of patches, along with some other patches under
discussion on alkml, should enable omap3 and omap4 kernels to be
built with CONFIG_THUMB2_KERNEL.
OK, I tried some more testing with your 'dirty' branch merged with my PM
branch.

Compiled in ARM mode, everything worked as expected on my 3530/omap3evm,
including off-mode (in suspend and idle).  My 3630 (Zoom3) also can't do
CORE off due to i583, but MPU, PER etc. all can hit off.

To rebuild in Thumb-2 mode, I disabled OMAP2 support and added Thumb-2
mode:

   CONFIG_ARCH_OMAP2=n
   CONFIG_THUMB2_KERNEL=y

then tested on 3530/omap3evm.  Testing suspend/resume to retention
seemed to work fine.  However, enabling retention during idle[1] hung
someplace (didn't debug further.)

I also tried off-mode, and suspend/resume to off didn't even work.

I didn't have time to debug this any further, so this is just to report
raw test results.
Thanks, that's a useful step forward anyhow.

A possibility is that the Secure firmware can't cope with
interoperating with Thumb-2 code in the kernel, so that wakeup
entry points the SMC call sites may need to be ARM code.

If you get a moment, if would be interesting to see if this
patch makes a difference ... in the meantime, I'll see if
I can get my hands on an EVM from somewhere.

Cheers
---Dave
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
index a204c78..ee1edb1 100644
--- a/arch/arm/mach-omap2/sleep34xx.S
+++ b/arch/arm/mach-omap2/sleep34xx.S
@@ -32,6 +32,14 @@
 #include "sdrc.h"
 #include "control.h"
 
+#undef ARM
+#undef THUMB
+#undef BSYM
+#define ARM(x...) x
+#define THUMB(x...)
+#define BSYM(x) (x)
+	.arm
+
 /*
  * Registers access definitions
  */
@@ -289,8 +297,20 @@ clean_l2:
 	 *  - should be faster and will change with kernel
 	 *  - 'might' have to copy address, load and jump to it
 	 */
+#ifdef CONFIG_THUMB2_KERNEL
+	/* kernel is non-interworking : must do this from Thumb */
+	adr	r1, . + 1
+	bx	r1
+	.thumb
+#endif
 	ldr	r1, kernel_flush
 	blx	r1
+#ifdef CONFIG_THUMB2_KERNEL
+	.align
+	bx	pc
+	nop
+	.arm
+#endif
 
 omap3_do_wfi:
 	ldr	r4, sdrc_power		@ read the SDRC_POWER register
diff --git a/arch/arm/mach-omap2/sram34xx.S b/arch/arm/mach-omap2/sram34xx.S
index 829d235..64faab8 100644
--- a/arch/arm/mach-omap2/sram34xx.S
+++ b/arch/arm/mach-omap2/sram34xx.S
@@ -34,6 +34,14 @@
 #include "sdrc.h"
 #include "cm2xxx_3xxx.h"
 
+#undef ARM
+#undef THUMB
+#undef BSYM
+#define ARM(x...) x
+#define THUMB(x...)
+#define BSYM(x) (x)
+	.arm
+
 	.text
 
 /* r1 parameters */
-- 
1.7.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help