All of lore.kernel.org
 help / color / mirror / Atom feed
From: 21cnbao@gmail.com (Barry Song)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/4] ARM: sirf: add two debug ports for CSRatlas7 SoC
Date: Thu, 25 Dec 2014 16:34:17 +0800	[thread overview]
Message-ID: <1419496460-4929-2-git-send-email-21cnbao@gmail.com> (raw)
In-Reply-To: <1419496460-4929-1-git-send-email-21cnbao@gmail.com>

From: Guo Zeng <Guo.Zeng@csr.com>

this patch adds UART0 and UART1 as LLUART port, as the new atlas7
registers layout are different, it also refines some names of old
hard-coded MARCOs.

Signed-off-by: Guo Zeng <Guo.Zeng@csr.com>
Signed-off-by: Zhiwu Song <Zhiwu.Song@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
---
 arch/arm/Kconfig.debug        | 21 ++++++++++++++++++++-
 arch/arm/include/debug/sirf.S | 37 ++++++++++++++++++++++++-------------
 arch/arm/mach-prima2/lluart.c | 21 ++++++++++++---------
 3 files changed, 56 insertions(+), 23 deletions(-)

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 5ddd490..25d4f6b 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -927,6 +927,22 @@ choice
 		  Say Y here if you want the debug print routines to direct
 		  their output to the uart1 port on SiRFmarco devices.
 
+        config DEBUG_SIRFATLAS7_UART0
+                bool "Kernel low-level debugging messages via SiRFatlas7 UART0"
+                depends on ARCH_ATLAS7
+                help
+                  Say Y here if you want the debug print routines to direct
+                  their output to the uart0 port on SiRFATLAS7 devices.The uart0
+                  is used on SiRFATLAS7 as a extra debug port.sometimes an extra
+                  debug port can be very useful.
+
+        config DEBUG_SIRFATLAS7_UART1
+                bool "Kernel low-level debugging messages via SiRFatlas7 UART1"
+                depends on ARCH_ATLAS7
+                help
+                  Say Y here if you want the debug print routines to direct
+                  their output to the uart1 port on SiRFATLAS7 devices.
+
 	config STIH41X_DEBUG_ASC2
 		bool "Use StiH415/416 ASC2 UART for low-level debug"
 		depends on ARCH_STI
@@ -1195,7 +1211,10 @@ config DEBUG_LL_INCLUDE
 	default "debug/renesas-scif.S" if DEBUG_RMOBILE_SCIFA4
 	default "debug/s3c24xx.S" if DEBUG_S3C24XX_UART
 	default "debug/s5pv210.S" if DEBUG_S5PV210_UART
-	default "debug/sirf.S" if DEBUG_SIRFPRIMA2_UART1 || DEBUG_SIRFMARCO_UART1
+	default "debug/sirf.S" if DEBUG_SIRFPRIMA2_UART1 || \
+				  DEBUG_SIRFMARCO_UART1 || \
+				  DEBUG_SIRFATLAS7_UART0 || \
+				  DEBUG_SIRFATLAS7_UART1
 	default "debug/sti.S" if DEBUG_STI_UART
 	default "debug/tegra.S" if DEBUG_TEGRA_UART
 	default "debug/ux500.S" if DEBUG_UX500_UART
diff --git a/arch/arm/include/debug/sirf.S b/arch/arm/include/debug/sirf.S
index dbf250c..38327fa 100644
--- a/arch/arm/include/debug/sirf.S
+++ b/arch/arm/include/debug/sirf.S
@@ -7,36 +7,47 @@
  */
 
 #if defined(CONFIG_DEBUG_SIRFPRIMA2_UART1)
-#define SIRFSOC_UART1_PA_BASE          0xb0060000
+#define SIRF_LLUART_PA_BASE          0xb0060000
 #elif defined(CONFIG_DEBUG_SIRFMARCO_UART1)
-#define SIRFSOC_UART1_PA_BASE          0xcc060000
+#define SIRF_LLUART_PA_BASE          0xcc060000
+#elif defined(CONFIG_DEBUG_SIRFATLAS7_UART1)
+#define SIRF_LLUART_PA_BASE          0x18020000
+#elif defined(CONFIG_DEBUG_SIRFATLAS7_UART0)
+#define SIRF_LLUART_PA_BASE          0x18010000
 #else
-#define SIRFSOC_UART1_PA_BASE          0
+#define SIRF_LLUART_PA_BASE          0
 #endif
 
-#define SIRFSOC_UART1_VA_BASE		0xFEC60000
+#define SIRF_LLUART_VA_BASE	(0xFEC00000 \
+			| (SIRF_LLUART_PA_BASE & 0x000FFFFF))
 
-#define SIRFSOC_UART_TXFIFO_STATUS	0x0114
-#define SIRFSOC_UART_TXFIFO_DATA	0x0118
+#define SIRF_LLUART_TXFIFO_STATUS	0x0114
+#define SIRF_LLUART_TXFIFO_DATA	0x0118
+
+#define SIRF_LLUART_TXFIFO_FULL                       (1 << 5)
+
+#ifdef CONFIG_DEBUG_SIRFATLAS7_UART0
+#define SIRF_LLUART_TXFIFO_EMPTY			(1 << 8)
+#else
+#define SIRF_LLUART_TXFIFO_EMPTY			(1 << 6)
+#endif
 
-#define SIRFSOC_UART1_TXFIFO_FULL                       (1 << 5)
-#define SIRFSOC_UART1_TXFIFO_EMPTY			(1 << 6)
 
 	.macro	addruart, rp, rv, tmp
-	ldr	\rp, =SIRFSOC_UART1_PA_BASE		@ physical
-	ldr	\rv, =SIRFSOC_UART1_VA_BASE		@ virtual
+	ldr	\rp, =SIRF_LLUART_PA_BASE		@ physical
+	ldr	\rv, =SIRF_LLUART_VA_BASE		@ virtual
 	.endm
 
 	.macro	senduart,rd,rx
-	str	\rd, [\rx, #SIRFSOC_UART_TXFIFO_DATA]
+	str	\rd, [\rx, #SIRF_LLUART_TXFIFO_DATA]
 	.endm
 
 	.macro	busyuart,rd,rx
 	.endm
 
 	.macro	waituart,rd,rx
-1001:	ldr	\rd, [\rx, #SIRFSOC_UART_TXFIFO_STATUS]
-	tst	\rd, #SIRFSOC_UART1_TXFIFO_EMPTY
+1001:	ldr	\rd, [\rx, #SIRF_LLUART_TXFIFO_STATUS]
+	tst	\rd, #SIRF_LLUART_TXFIFO_EMPTY
 	beq	1001b
 	.endm
 
diff --git a/arch/arm/mach-prima2/lluart.c b/arch/arm/mach-prima2/lluart.c
index 99c0c92..c42d69b 100644
--- a/arch/arm/mach-prima2/lluart.c
+++ b/arch/arm/mach-prima2/lluart.c
@@ -12,24 +12,27 @@
 #include "common.h"
 
 #if defined(CONFIG_DEBUG_SIRFPRIMA2_UART1)
-#define SIRFSOC_UART1_PA_BASE          0xb0060000
+#define SIRF_LLUART_PA_BASE	0xb0060000
 #elif defined(CONFIG_DEBUG_SIRFMARCO_UART1)
-#define SIRFSOC_UART1_PA_BASE          0xcc060000
+#define SIRF_LLUART_PA_BASE	0xcc060000
+#elif defined(CONFIG_DEBUG_SIRFATLAS7_UART1)
+#define SIRF_LLUART_PA_BASE	0x18020000
+#elif defined(CONFIG_DEBUG_SIRFATLAS7_UART0)
+#define SIRF_LLUART_PA_BASE	0x18010000
 #else
-#define SIRFSOC_UART1_PA_BASE          0
+#define SIRF_LLUART_PA_BASE	0
 #endif
 
-#define SIRFSOC_UART1_VA_BASE          SIRFSOC_VA(0x060000)
-#define SIRFSOC_UART1_SIZE		SZ_4K
+#define SIRF_LLUART_VA_BASE	SIRFSOC_VA(SIRF_LLUART_PA_BASE & 0x000FFFFF)
+#define SIRF_LLUART_SIZE		SZ_4K
 
 void __init sirfsoc_map_lluart(void)
 {
 	struct map_desc sirfsoc_lluart_map = {
-		.virtual        = SIRFSOC_UART1_VA_BASE,
-		.pfn            = __phys_to_pfn(SIRFSOC_UART1_PA_BASE),
-		.length         = SIRFSOC_UART1_SIZE,
+		.virtual        = SIRF_LLUART_VA_BASE,
+		.pfn            = __phys_to_pfn(SIRF_LLUART_PA_BASE),
+		.length         = SIRF_LLUART_SIZE,
 		.type           = MT_DEVICE,
 	};
-
 	iotable_init(&sirfsoc_lluart_map, 1);
 }
-- 
2.2.0

  reply	other threads:[~2014-12-25  8:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-25  8:34 [PATCH 0/4] ARM: add basic CSR atlas7 Auto SoC support Barry Song
2014-12-25  8:34 ` Barry Song [this message]
2014-12-30 22:35   ` [PATCH 1/4] ARM: sirf: add two debug ports for CSRatlas7 SoC Arnd Bergmann
2014-12-31 15:05     ` Barry Song
2014-12-31 15:31       ` Arnd Bergmann
2015-01-02  7:51         ` Barry Song
2015-01-02  8:59           ` Arnd Bergmann
2014-12-25  8:34 ` [PATCH 2/4] ARM: sirf: add atlas7 machine support Barry Song
2014-12-30 22:34   ` Arnd Bergmann
2014-12-31 14:50     ` Barry Song
2015-01-02  9:00       ` Arnd Bergmann
2015-01-04  7:23     ` Barry Song
2014-12-25  8:34 ` [PATCH 3/4] ARM: dts: add init dts file for CSR atlas7 SoC Barry Song
2014-12-25  8:34 ` [PATCH 4/4] ARM: sirf: bring up SMP in " Barry Song
2014-12-30 22:38   ` Arnd Bergmann
2014-12-31 14:52     ` Barry Song

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=1419496460-4929-2-git-send-email-21cnbao@gmail.com \
    --to=21cnbao@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 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.