public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: linux-omap@vger.kernel.org
Cc: Tony Lindgren <tony@atomide.com>
Subject: [PATCH 1/14] ARM: OMAP: Fix debug-macro for multi_omap
Date: Tue, 27 May 2008 21:20:05 -0700	[thread overview]
Message-ID: <1211948418-16455-2-git-send-email-tony@atomide.com> (raw)
In-Reply-To: <1211948418-16455-1-git-send-email-tony@atomide.com>

Use ARM revision register to set debug serial port base.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 include/asm-arm/arch-omap/debug-macro.S |   40 ++++++++++++++++++++++--------
 1 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/include/asm-arm/arch-omap/debug-macro.S b/include/asm-arm/arch-omap/debug-macro.S
index 3866e04..a7ca8c8 100644
--- a/include/asm-arm/arch-omap/debug-macro.S
+++ b/include/asm-arm/arch-omap/debug-macro.S
@@ -12,34 +12,51 @@
 */
 
 		.macro	addruart,rx
-		mrc	p15, 0, \rx, c1, c0
+
+		/* Detect omap */
+		mrc	p15, 0, \rx, c0, c0, 0	@ get processor revision
+		and	\rx, \rx, #0x000f0000	@ only check architecture
+		cmp	\rx, #0x00060000	@ is v6?
+		beq	1000f			@ found 925 or 926 (omap1)
+		cmp	\rx, #0x00070000	@ is v7?
+		beq	2000f			@ found arm11 (omap2)
+		cmp	\rx, #0x000f0000	@ is cortex?
+		beq	3000f			@ found cortex (omap3)
+
+1000:		/* Found omap1 */
+		mrc	p15, 0, \rx, c1, c0	@ get control register
 		tst	\rx, #1			@ MMU enabled?
-#ifdef CONFIG_ARCH_OMAP1
 		moveq	\rx, #0xff000000	@ physical base address
 		movne	\rx, #0xfe000000	@ virtual base
-		orr	\rx, \rx, #0x00fb0000
-#ifdef CONFIG_OMAP_LL_DEBUG_UART3
-		orr	\rx, \rx, #0x00009000	@ UART 3
-#endif
+		orr	\rx, \rx, #0x00fb0000	@ UART 1
 #if defined(CONFIG_OMAP_LL_DEBUG_UART2) || defined(CONFIG_OMAP_LL_DEBUG_UART3)
 		orr	\rx, \rx, #0x00000800	@ UART 2 & 3
 #endif
+#ifdef CONFIG_OMAP_LL_DEBUG_UART3
+		orr	\rx, \rx, #0x00009000	@ UART 3
+#endif
+		b	9999f			@ goto out
 
-#elif  CONFIG_ARCH_OMAP2
+2000:		/* Found omap2 */
+		mrc	p15, 0, \rx, c1, c0	@ get control register
+		tst	\rx, #1			@ MMU enabled?
 		moveq	\rx, #0x48000000	@ physical base address
 		movne	\rx, #0xd8000000	@ virtual base
-		orr	\rx, \rx, #0x0006a000
+		orr	\rx, \rx, #0x0006a000	@ UART 1
 #ifdef CONFIG_OMAP_LL_DEBUG_UART2
 		add	\rx, \rx, #0x00002000	@ UART 2
 #endif
 #ifdef CONFIG_OMAP_LL_DEBUG_UART3
 		add	\rx, \rx, #0x00004000	@ UART 3
 #endif
+		b	9999f			@ goto out
 
-#elif	CONFIG_ARCH_OMAP3
+3000:		/* Found omap3 */
+		mrc	p15, 0, \rx, c1, c0	@ get control register
+		tst	\rx, #1			@ MMU enabled?
 		moveq	\rx, #0x48000000	@ physical base address
 		movne	\rx, #0xd8000000	@ virtual base
-		orr	\rx, \rx, #0x0006a000
+		orr	\rx, \rx, #0x0006a000	@ UART 1
 #ifdef CONFIG_OMAP_LL_DEBUG_UART2
 		add	\rx, \rx, #0x00002000	@ UART 2
 #endif
@@ -47,7 +64,8 @@
 		add	\rx, \rx, #0x00fb0000	@ UART 3
 		add	\rx, \rx, #0x00006000
 #endif
-#endif
+
+9999:
 		.endm
 
 		.macro	senduart,rd,rx
-- 
1.5.3.6


  reply	other threads:[~2008-05-28  4:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-28  4:20 [PATCH 0/14] Big clean-up for multi-omap Tony Lindgren
2008-05-28  4:20 ` Tony Lindgren [this message]
2008-05-28  4:20   ` [PATCH 2/14] CF: Change omap_cf.c to use omap_readw/writew instead of __REG " Tony Lindgren
2008-05-28  4:20     ` [PATCH 3/14] USB: Change omap USB code to use omap_read/write " Tony Lindgren
2008-05-28  4:20       ` [PATCH 4/14] ARM: OMAP: Change __REG access to omap/read write for traffic controller Tony Lindgren
2008-05-28  4:20         ` [PATCH 5/14] musb_hdrc: Change __REG access to omap_read/write for multi-boot Tony Lindgren
2008-05-28  4:20           ` [PATCH 6/14] ARM: OMAP: Remove __REG access for multi-omap Tony Lindgren
2008-05-28  4:20             ` [PATCH 7/14] ARM: OMAP: Split sleep24xx.S into sleep242x.S and sleep243x.S Tony Lindgren
2008-05-28  4:20               ` [PATCH 8/14] ARM: OMAP: Split sram24xx.S into sram242x.S and sram243x.S Tony Lindgren
2008-05-28  4:20                 ` [PATCH 9/14] ARM: OMAP: Remove omap_sram_patch_va Tony Lindgren
2008-05-28  4:20                   ` [PATCH 10/14] ARM: OMAP: Introduce omap_globals and prcm access functions for multi-omap Tony Lindgren
2008-05-28  4:20                     ` [PATCH 11/14] ARM: OMAP: Remove OMAP_PRM_REGADDR Tony Lindgren
2008-05-28  4:20                       ` [PATCH 12/14] ARM: OMAP: Remove OMAP_CM_REGADDR for multi-boot Tony Lindgren
2008-05-28  4:20                         ` [PATCH 13/14] ARM: OMAP: Change to use CM offsets for clocks for multi-omap Tony Lindgren
2008-05-28  4:20                           ` [PATCH 14/14] ARM: OMAP: Use omap_globals for CPU detection " Tony Lindgren
2008-05-30 21:41 ` [PATCH 0/14] Big clean-up " Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1211948418-16455-2-git-send-email-tony@atomide.com \
    --to=tony@atomide.com \
    --cc=linux-omap@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox