linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 01/12] ARM: move debug macros to common location
Date: Thu,  6 Sep 2012 15:12:44 -0500	[thread overview]
Message-ID: <1346962375-26163-2-git-send-email-robherring2@gmail.com> (raw)
In-Reply-To: <1346962375-26163-1-git-send-email-robherring2@gmail.com>

From: Rob Herring <rob.herring@calxeda.com>

Based on suggestion by Russell King, create a common location for debug
macros and select the included debug macro file using config option.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Russell King <linux@arm.linux.org.uk>
---
 arch/arm/Kconfig.debug          |    5 +++
 arch/arm/include/debug/icedcc.S |   90 +++++++++++++++++++++++++++++++++++++++
 arch/arm/kernel/debug.S         |   87 ++-----------------------------------
 arch/arm/kernel/head.S          |    4 +-
 4 files changed, 100 insertions(+), 86 deletions(-)
 create mode 100644 arch/arm/include/debug/icedcc.S

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index f15f82b..4f9760b 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -373,6 +373,11 @@ choice
 
 endchoice
 
+config DEBUG_LL_INCLUDE
+	string
+	default "debug/icedcc.S" if DEBUG_ICEDCC
+	default "mach/debug-macro.S"
+
 config EARLY_PRINTK
 	bool "Early printk"
 	depends on DEBUG_LL
diff --git a/arch/arm/include/debug/icedcc.S b/arch/arm/include/debug/icedcc.S
new file mode 100644
index 0000000..43afcb0
--- /dev/null
+++ b/arch/arm/include/debug/icedcc.S
@@ -0,0 +1,90 @@
+/*
+ *  arch/arm/include/debug/icedcc.S
+ *
+ *  Copyright (C) 1994-1999 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+		@@ debug using ARM EmbeddedICE DCC channel
+
+		.macro	addruart, rp, rv, tmp
+		.endm
+
+#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) || defined(CONFIG_CPU_V7)
+
+		.macro	senduart, rd, rx
+		mcr	p14, 0, \rd, c0, c5, 0
+		.endm
+
+		.macro	busyuart, rd, rx
+1001:
+		mrc	p14, 0, \rx, c0, c1, 0
+		tst	\rx, #0x20000000
+		beq	1001b
+		.endm
+
+		.macro	waituart, rd, rx
+		mov	\rd, #0x2000000
+1001:
+		subs	\rd, \rd, #1
+		bmi	1002f
+		mrc	p14, 0, \rx, c0, c1, 0
+		tst	\rx, #0x20000000
+		bne	1001b
+1002:
+		.endm
+
+#elif defined(CONFIG_CPU_XSCALE)
+
+		.macro	senduart, rd, rx
+		mcr	p14, 0, \rd, c8, c0, 0
+		.endm
+
+		.macro	busyuart, rd, rx
+1001:
+		mrc	p14, 0, \rx, c14, c0, 0
+		tst	\rx, #0x10000000
+		beq	1001b
+		.endm
+
+		.macro	waituart, rd, rx
+		mov	\rd, #0x10000000
+1001:
+		subs	\rd, \rd, #1
+		bmi	1002f
+		mrc	p14, 0, \rx, c14, c0, 0
+		tst	\rx, #0x10000000
+		bne	1001b
+1002:
+		.endm
+
+#else
+
+		.macro	senduart, rd, rx
+		mcr	p14, 0, \rd, c1, c0, 0
+		.endm
+
+		.macro	busyuart, rd, rx
+1001:
+		mrc	p14, 0, \rx, c0, c0, 0
+		tst	\rx, #2
+		beq	1001b
+
+		.endm
+
+		.macro	waituart, rd, rx
+		mov	\rd, #0x2000000
+1001:
+		subs	\rd, \rd, #1
+		bmi	1002f
+		mrc	p14, 0, \rx, c0, c0, 0
+		tst	\rx, #2
+		bne	1001b
+1002:
+		.endm
+
+#endif	/* CONFIG_CPU_V6 */
diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S
index c45522c..66f711b 100644
--- a/arch/arm/kernel/debug.S
+++ b/arch/arm/kernel/debug.S
@@ -20,90 +20,9 @@
  * references to these in a production kernel!
  */
 
-#if defined(CONFIG_DEBUG_ICEDCC)
-		@@ debug using ARM EmbeddedICE DCC channel
-
-		.macro	addruart, rp, rv, tmp
-		.endm
-
-#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) || defined(CONFIG_CPU_V7)
-
-		.macro	senduart, rd, rx
-		mcr	p14, 0, \rd, c0, c5, 0
-		.endm
-
-		.macro	busyuart, rd, rx
-1001:
-		mrc	p14, 0, \rx, c0, c1, 0
-		tst	\rx, #0x20000000
-		beq	1001b
-		.endm
-
-		.macro	waituart, rd, rx
-		mov	\rd, #0x2000000
-1001:
-		subs	\rd, \rd, #1
-		bmi	1002f
-		mrc	p14, 0, \rx, c0, c1, 0
-		tst	\rx, #0x20000000
-		bne	1001b
-1002:
-		.endm
-
-#elif defined(CONFIG_CPU_XSCALE)
-
-		.macro	senduart, rd, rx
-		mcr	p14, 0, \rd, c8, c0, 0
-		.endm
-
-		.macro	busyuart, rd, rx
-1001:
-		mrc	p14, 0, \rx, c14, c0, 0
-		tst	\rx, #0x10000000
-		beq	1001b
-		.endm
-
-		.macro	waituart, rd, rx
-		mov	\rd, #0x10000000
-1001:
-		subs	\rd, \rd, #1
-		bmi	1002f
-		mrc	p14, 0, \rx, c14, c0, 0
-		tst	\rx, #0x10000000
-		bne	1001b
-1002:
-		.endm
-
-#else
-
-		.macro	senduart, rd, rx
-		mcr	p14, 0, \rd, c1, c0, 0
-		.endm
-
-		.macro	busyuart, rd, rx
-1001:
-		mrc	p14, 0, \rx, c0, c0, 0
-		tst	\rx, #2
-		beq	1001b
-
-		.endm
-
-		.macro	waituart, rd, rx
-		mov	\rd, #0x2000000
-1001:
-		subs	\rd, \rd, #1
-		bmi	1002f
-		mrc	p14, 0, \rx, c0, c0, 0
-		tst	\rx, #2
-		bne	1001b
-1002:
-		.endm
-
-#endif	/* CONFIG_CPU_V6 */
-
-#elif !defined(CONFIG_DEBUG_SEMIHOSTING)
-#include <mach/debug-macro.S>
-#endif	/* CONFIG_DEBUG_ICEDCC */
+#if !defined(CONFIG_DEBUG_SEMIHOSTING)
+#include CONFIG_DEBUG_LL_INCLUDE
+#endif
 
 #ifdef CONFIG_MMU
 		.macro	addruart_current, rx, tmp1, tmp2
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 3db960e..9874d07 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -23,8 +23,8 @@
 #include <asm/thread_info.h>
 #include <asm/pgtable.h>
 
-#ifdef CONFIG_DEBUG_LL
-#include <mach/debug-macro.S>
+#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_SEMIHOSTING)
+#include CONFIG_DEBUG_LL_INCLUDE
 #endif
 
 /*
-- 
1.7.9.5

  reply	other threads:[~2012-09-06 20:12 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-06 20:12 [PATCH v3 00/12] Initial multi-platform support Rob Herring
2012-09-06 20:12 ` Rob Herring [this message]
2012-09-06 20:12 ` [PATCH 02/12] ARM: highbank: move debug macros to include/debug Rob Herring
2012-09-06 20:12 ` [PATCH 03/12] ARM: vexpress: " Rob Herring
2012-09-06 20:12 ` [PATCH 04/12] ARM: mvebu: " Rob Herring
2012-09-07 15:08   ` Jason Cooper
2012-09-06 20:12 ` [PATCH 05/12] ARM: socfpga: " Rob Herring
2012-09-06 22:33   ` Dinh Nguyen
2012-09-06 23:35   ` Dinh Nguyen
2012-09-06 20:12 ` [PATCH 06/12] ARM: picoxcell: " Rob Herring
2012-09-13 14:16   ` Shawn Guo
2012-09-13 15:14     ` Rob Herring
2012-09-06 20:12 ` [PATCH 07/12] ARM: move all dtb targets out of Makefile.boot Rob Herring
2012-09-07  2:27   ` Shawn Guo
2012-09-07  2:36     ` Stephen Warren
2012-09-07  2:39       ` Shawn Guo
2012-09-11 12:02         ` Rob Herring
2012-09-11 12:06           ` Shawn Guo
2012-09-07  5:19       ` Andrew Lunn
2012-09-07 12:51         ` Rob Herring
2012-09-07 13:25           ` Arnd Bergmann
2012-09-07 13:46             ` Rob Herring
2012-09-10 15:52   ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-10 17:51     ` Rob Herring
2012-09-11  4:49       ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-11  5:41         ` Stephen Warren
2012-09-11 13:25           ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-11 16:04             ` Rob Herring
2012-09-11 18:51             ` Nicolas Pitre
2012-09-11 18:08   ` [PATCH v2] " Rob Herring
2012-09-11 18:43     ` Stephen Warren
2012-09-06 20:12 ` [PATCH 08/12] ARM: picoxcell: remove dependency on mach/* headers Rob Herring
2012-09-06 20:12 ` [PATCH 09/12] ARM: vexpress: " Rob Herring
2012-09-06 20:12 ` [PATCH 10/12] ARM: mvebu: move armada-370-xp.h in mach dir Rob Herring
2012-09-07 15:11   ` Jason Cooper
2012-09-06 20:12 ` [PATCH 11/12] ARM: initial multiplatform support Rob Herring
2012-09-12 19:49   ` Arnd Bergmann
2012-09-12 20:20     ` Rob Herring
2012-09-12 20:27       ` Arnd Bergmann
2012-09-13 14:12   ` Shawn Guo
2012-09-06 20:12 ` [PATCH 12/12] ARM: vexpress: convert to multi-platform Rob Herring
2012-09-10 19:07 ` [PATCH v3 00/12] Initial multi-platform support Jamie Iles
2012-09-14  0:58   ` Shawn Guo
2012-09-14 13:00     ` Rob Herring

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=1346962375-26163-2-git-send-email-robherring2@gmail.com \
    --to=robherring2@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).