From 12ae803e30e02d4b0026d9098c36a215ad20a723 Mon Sep 17 00:00:00 2001
From: =?utf8?q?=E9=BB=84=E6=B6=9B?= <huangtao@rock-chips.com>
Date: Wed, 9 Jan 2013 09:46:48 +0800
Subject: [PATCH] rk2928: add debug_uart.h

---
 arch/arm/mach-rk2928/common.c                 |  1 +
 arch/arm/mach-rk2928/devices.c                |  1 +
 .../arm/mach-rk2928/include/mach/debug_uart.h | 21 +++++++++++++++++++
 arch/arm/mach-rk2928/include/mach/io.h        | 11 ----------
 arch/arm/mach-rk2928/include/mach/irqs.h      |  3 ---
 arch/arm/mach-rk2928/pm.c                     |  1 +
 6 files changed, 24 insertions(+), 14 deletions(-)
 create mode 100644 arch/arm/mach-rk2928/include/mach/debug_uart.h

diff --git a/arch/arm/mach-rk2928/common.c b/arch/arm/mach-rk2928/common.c
index f0816c0dc061..a4d92cd1d49f 100755
--- a/arch/arm/mach-rk2928/common.c
+++ b/arch/arm/mach-rk2928/common.c
@@ -16,6 +16,7 @@
 #include <mach/loader.h>
 #include <mach/ddr.h>
 #include <mach/cpu.h>
+#include <mach/debug_uart.h>
 
 static void __init rk2928_cpu_axi_init(void)
 {
diff --git a/arch/arm/mach-rk2928/devices.c b/arch/arm/mach-rk2928/devices.c
index 8c6a9536d13c..5ea94602e3ba 100755
--- a/arch/arm/mach-rk2928/devices.c
+++ b/arch/arm/mach-rk2928/devices.c
@@ -28,6 +28,7 @@
 #include <mach/gpio.h>
 #include <mach/iomux.h>
 #include <mach/dvfs.h>
+#include <mach/debug_uart.h>
 #include <plat/rk_fiq_debugger.h>
 #include <linux/regulator/consumer.h>
 
diff --git a/arch/arm/mach-rk2928/include/mach/debug_uart.h b/arch/arm/mach-rk2928/include/mach/debug_uart.h
new file mode 100644
index 000000000000..5da6a1ce116e
--- /dev/null
+++ b/arch/arm/mach-rk2928/include/mach/debug_uart.h
@@ -0,0 +1,21 @@
+#ifndef __MACH_DEBUG_UART
+#define __MACH_DEBUG_UART
+
+#if CONFIG_RK_DEBUG_UART >= 0 && CONFIG_RK_DEBUG_UART < 3
+
+#if CONFIG_RK_DEBUG_UART == 0
+#define DEBUG_UART_PHYS         RK2928_UART0_PHYS
+#define DEBUG_UART_BASE         RK2928_UART0_BASE
+#elif CONFIG_RK_DEBUG_UART == 1
+#define DEBUG_UART_PHYS         RK2928_UART1_PHYS
+#define DEBUG_UART_BASE         RK2928_UART1_BASE
+#elif CONFIG_RK_DEBUG_UART == 2
+#define DEBUG_UART_PHYS         RK2928_UART2_PHYS
+#define DEBUG_UART_BASE         RK2928_UART2_BASE
+#endif
+
+#define IRQ_DEBUG_UART		(IRQ_UART0 + CONFIG_RK_DEBUG_UART)
+
+#endif
+
+#endif
diff --git a/arch/arm/mach-rk2928/include/mach/io.h b/arch/arm/mach-rk2928/include/mach/io.h
index 9924a0c4e6e7..b263dce07dfa 100755
--- a/arch/arm/mach-rk2928/include/mach/io.h
+++ b/arch/arm/mach-rk2928/include/mach/io.h
@@ -173,17 +173,6 @@
 #define RK2928_EFUSE_PHYS       0x20090000
 #define RK2928_EFUSE_SIZE       SZ_4K
 
-#if CONFIG_RK_DEBUG_UART == 0
-#define DEBUG_UART_PHYS         RK2928_UART0_PHYS
-#define DEBUG_UART_BASE         RK2928_UART0_BASE
-#elif CONFIG_RK_DEBUG_UART == 1
-#define DEBUG_UART_PHYS         RK2928_UART1_PHYS
-#define DEBUG_UART_BASE         RK2928_UART1_BASE
-#elif CONFIG_RK_DEBUG_UART == 2
-#define DEBUG_UART_PHYS         RK2928_UART2_PHYS
-#define DEBUG_UART_BASE         RK2928_UART2_BASE
-#endif
-
 #define GIC_DIST_BASE           RK2928_GICD_BASE
 #define GIC_CPU_BASE            RK2928_GICC_BASE
 
diff --git a/arch/arm/mach-rk2928/include/mach/irqs.h b/arch/arm/mach-rk2928/include/mach/irqs.h
index a2b4867adba7..c216d12a3a09 100644
--- a/arch/arm/mach-rk2928/include/mach/irqs.h
+++ b/arch/arm/mach-rk2928/include/mach/irqs.h
@@ -57,9 +57,6 @@
 
 //hhb@rock-chips.com this spi is used for fiq_debugger signal irq
 #define IRQ_UART_SIGNAL			127
-#if CONFIG_RK_DEBUG_UART >= 0 && CONFIG_RK_DEBUG_UART < 3
-#define IRQ_DEBUG_UART			(IRQ_UART0 + CONFIG_RK_DEBUG_UART)
-#endif
 
 #define NR_GIC_IRQS                     (4 * 32)
 #define NR_GPIO_IRQS                    (4 * 32)
diff --git a/arch/arm/mach-rk2928/pm.c b/arch/arm/mach-rk2928/pm.c
index eae40064af52..825a51e4d5e3 100644
--- a/arch/arm/mach-rk2928/pm.c
+++ b/arch/arm/mach-rk2928/pm.c
@@ -21,6 +21,7 @@
 #include <mach/gpio.h>
 #include <mach/iomux.h>
 #include <mach/cru.h>
+#include <mach/debug_uart.h>
 
 #define cru_readl(offset)	readl_relaxed(RK2928_CRU_BASE + offset)
 #define cru_writel(v, offset)	do { writel_relaxed(v, RK2928_CRU_BASE + offset); dsb(); } while (0)
-- 
2.34.1