From: 黄涛 Date: Wed, 9 Jan 2013 02:05:57 +0000 (+0800) Subject: rk30: add debug_uart.h X-Git-Tag: firefly_0821_release~7974 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=83ff0af39d5439225833a1170a8e18e5a058573b;p=firefly-linux-kernel-4.4.55.git rk30: add debug_uart.h --- diff --git a/arch/arm/mach-rk30/devices.c b/arch/arm/mach-rk30/devices.c index c5e6aee6b981..42c85604129b 100755 --- a/arch/arm/mach-rk30/devices.c +++ b/arch/arm/mach-rk30/devices.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #ifdef CONFIG_ADC_RK30 diff --git a/arch/arm/mach-rk30/include/mach/debug_uart.h b/arch/arm/mach-rk30/include/mach/debug_uart.h new file mode 100644 index 000000000000..8295cfe8fb57 --- /dev/null +++ b/arch/arm/mach-rk30/include/mach/debug_uart.h @@ -0,0 +1,24 @@ +#ifndef __MACH_DEBUG_UART +#define __MACH_DEBUG_UART + +#if CONFIG_RK_DEBUG_UART >= 0 && CONFIG_RK_DEBUG_UART < 4 + +#if CONFIG_RK_DEBUG_UART == 0 +#define DEBUG_UART_PHYS RK30_UART0_PHYS +#define DEBUG_UART_BASE RK30_UART0_BASE +#elif CONFIG_RK_DEBUG_UART == 1 +#define DEBUG_UART_PHYS RK30_UART1_PHYS +#define DEBUG_UART_BASE RK30_UART1_BASE +#elif CONFIG_RK_DEBUG_UART == 2 +#define DEBUG_UART_PHYS RK30_UART2_PHYS +#define DEBUG_UART_BASE RK30_UART2_BASE +#elif CONFIG_RK_DEBUG_UART == 3 +#define DEBUG_UART_PHYS RK30_UART3_PHYS +#define DEBUG_UART_BASE RK30_UART3_BASE +#endif + +#define IRQ_DEBUG_UART (IRQ_UART0 + CONFIG_RK_DEBUG_UART) + +#endif + +#endif diff --git a/arch/arm/mach-rk30/include/mach/io.h b/arch/arm/mach-rk30/include/mach/io.h index ae5dcca95bcc..dee6fe9e199f 100755 --- a/arch/arm/mach-rk30/include/mach/io.h +++ b/arch/arm/mach-rk30/include/mach/io.h @@ -229,20 +229,6 @@ #define RK30_HSIC_PHYS 0x10240000 #define RK30_HSIC_SIZE SZ_256K -#if CONFIG_RK_DEBUG_UART == 0 -#define DEBUG_UART_PHYS RK30_UART0_PHYS -#define DEBUG_UART_BASE RK30_UART0_BASE -#elif CONFIG_RK_DEBUG_UART == 1 -#define DEBUG_UART_PHYS RK30_UART1_PHYS -#define DEBUG_UART_BASE RK30_UART1_BASE -#elif CONFIG_RK_DEBUG_UART == 2 -#define DEBUG_UART_PHYS RK30_UART2_PHYS -#define DEBUG_UART_BASE RK30_UART2_BASE -#elif CONFIG_RK_DEBUG_UART == 3 -#define DEBUG_UART_PHYS RK30_UART3_PHYS -#define DEBUG_UART_BASE RK30_UART3_BASE -#endif - #define GIC_DIST_BASE RK30_GICD_BASE #define GIC_CPU_BASE RK30_GICC_BASE diff --git a/arch/arm/mach-rk30/include/mach/irqs.h b/arch/arm/mach-rk30/include/mach/irqs.h index 73f6f10f5f80..0d5369e5a8e1 100644 --- a/arch/arm/mach-rk30/include/mach/irqs.h +++ b/arch/arm/mach-rk30/include/mach/irqs.h @@ -88,9 +88,6 @@ //hhb@rock-chips.com this spi is used for fiq_debugger signal irq #define IRQ_UART_SIGNAL RK30XX_IRQ(80) -#if CONFIG_RK_DEBUG_UART >= 0 && CONFIG_RK_DEBUG_UART < 4 -#define IRQ_DEBUG_UART (IRQ_UART0 + CONFIG_RK_DEBUG_UART) -#endif #define IRQ_ARM_PMU RK30XX_IRQ(103) diff --git a/arch/arm/mach-rk30/pm.c b/arch/arm/mach-rk30/pm.c index 9ab51da4b473..218f1af8dd1a 100755 --- a/arch/arm/mach-rk30/pm.c +++ b/arch/arm/mach-rk30/pm.c @@ -22,6 +22,7 @@ #include #include #include +#include #define cru_readl(offset) readl_relaxed(RK30_CRU_BASE + offset) #define cru_writel(v, offset) do { writel_relaxed(v, RK30_CRU_BASE + offset); dsb(); } while (0)