aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiko Stuebner <heiko@sntech.de>2013-05-28 16:13:52 -0400
committerHeiko Stuebner <heiko@sntech.de>2013-06-21 03:20:59 -0400
commit38bd6892abbf7d60b1e9ff7f1a2b8019b552eed3 (patch)
tree7b02099fe6c930f23bb76907f7d3281bb2bacfd9
parent8b57b004839b9bf5fc0614e9ef342c09adfa6fb7 (diff)
arm: add debug uarts for rockchip rk29xx and rk3xxx series
Uarts on all recent Rockchip SoCs are Synopsis DesignWare 8250 types. Only their addresses vary very much. This patch adds the necessary definitions to use any of the uart ports for early debug purposes. Signed-off-by: Heiko Stuebner <heiko@sntech.de>
-rw-r--r--arch/arm/Kconfig.debug34
-rw-r--r--arch/arm/include/debug/rockchip.S42
2 files changed, 76 insertions, 0 deletions
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 1d41908d5cda..5cd90bfdddfe 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -353,6 +353,13 @@ choice
353 their output to the standard serial port on the RealView 353 their output to the standard serial port on the RealView
354 PB1176 platform. 354 PB1176 platform.
355 355
356 config DEBUG_ROCKCHIP_UART
357 bool "Kernel low-level debugging messages via Rockchip UART"
358 depends on ARCH_ROCKCHIP
359 help
360 Say Y here if you want kernel low-level debugging support
361 on Rockchip based platforms.
362
356 config DEBUG_S3C_UART0 363 config DEBUG_S3C_UART0
357 depends on PLAT_SAMSUNG 364 depends on PLAT_SAMSUNG
358 select DEBUG_EXYNOS_UART if ARCH_EXYNOS 365 select DEBUG_EXYNOS_UART if ARCH_EXYNOS
@@ -589,6 +596,32 @@ endchoice
589 596
590choice 597choice
591 prompt "Low-level debug console UART" 598 prompt "Low-level debug console UART"
599 depends on DEBUG_ROCKCHIP_UART
600
601 config DEBUG_RK29_UART0
602 bool "RK29 UART0"
603
604 config DEBUG_RK29_UART1
605 bool "RK29 UART1"
606
607 config DEBUG_RK29_UART2
608 bool "RK29 UART2"
609
610 config DEBUG_RK3X_UART0
611 bool "RK3X UART0"
612
613 config DEBUG_RK3X_UART1
614 bool "RK3X UART1"
615
616 config DEBUG_RK3X_UART2
617 bool "RK3X UART2"
618
619 config DEBUG_RK3X_UART3
620 bool "RK3X UART3"
621endchoice
622
623choice
624 prompt "Low-level debug console UART"
592 depends on DEBUG_LL && DEBUG_TEGRA_UART 625 depends on DEBUG_LL && DEBUG_TEGRA_UART
593 626
594 config TEGRA_DEBUG_UART_AUTO_ODMDATA 627 config TEGRA_DEBUG_UART_AUTO_ODMDATA
@@ -639,6 +672,7 @@ config DEBUG_LL_INCLUDE
639 default "debug/picoxcell.S" if DEBUG_PICOXCELL_UART 672 default "debug/picoxcell.S" if DEBUG_PICOXCELL_UART
640 default "debug/pxa.S" if DEBUG_PXA_UART1 || DEBUG_MMP_UART2 || \ 673 default "debug/pxa.S" if DEBUG_PXA_UART1 || DEBUG_MMP_UART2 || \
641 DEBUG_MMP_UART3 674 DEBUG_MMP_UART3
675 default "debug/rockchip.S" if DEBUG_ROCKCHIP_UART
642 default "debug/sirf.S" if DEBUG_SIRFPRIMA2_UART1 || DEBUG_SIRFMARCO_UART1 676 default "debug/sirf.S" if DEBUG_SIRFPRIMA2_UART1 || DEBUG_SIRFMARCO_UART1
643 default "debug/socfpga.S" if DEBUG_SOCFPGA_UART 677 default "debug/socfpga.S" if DEBUG_SOCFPGA_UART
644 default "debug/sunxi.S" if DEBUG_SUNXI_UART0 || DEBUG_SUNXI_UART1 678 default "debug/sunxi.S" if DEBUG_SUNXI_UART0 || DEBUG_SUNXI_UART1
diff --git a/arch/arm/include/debug/rockchip.S b/arch/arm/include/debug/rockchip.S
new file mode 100644
index 000000000000..cfd883e69588
--- /dev/null
+++ b/arch/arm/include/debug/rockchip.S
@@ -0,0 +1,42 @@
1/*
2 * Early serial output macro for Rockchip SoCs
3 *
4 * Copyright (C) 2012 Maxime Ripard
5 *
6 * Maxime Ripard <maxime.ripard@free-electrons.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#if defined(CONFIG_DEBUG_RK29_UART0)
14#define ROCKCHIP_UART_DEBUG_PHYS_BASE 0x20060000
15#define ROCKCHIP_UART_DEBUG_VIRT_BASE 0xfed60000
16#elif defined(CONFIG_DEBUG_RK29_UART1)
17#define ROCKCHIP_UART_DEBUG_PHYS_BASE 0x20064000
18#define ROCKCHIP_UART_DEBUG_VIRT_BASE 0xfed64000
19#elif defined(CONFIG_DEBUG_RK29_UART2)
20#define ROCKCHIP_UART_DEBUG_PHYS_BASE 0x20068000
21#define ROCKCHIP_UART_DEBUG_VIRT_BASE 0xfed68000
22#elif defined(CONFIG_DEBUG_RK3X_UART0)
23#define ROCKCHIP_UART_DEBUG_PHYS_BASE 0x10124000
24#define ROCKCHIP_UART_DEBUG_VIRT_BASE 0xfeb24000
25#elif defined(CONFIG_DEBUG_RK3X_UART1)
26#define ROCKCHIP_UART_DEBUG_PHYS_BASE 0x10126000
27#define ROCKCHIP_UART_DEBUG_VIRT_BASE 0xfeb26000
28#elif defined(CONFIG_DEBUG_RK3X_UART2)
29#define ROCKCHIP_UART_DEBUG_PHYS_BASE 0x20064000
30#define ROCKCHIP_UART_DEBUG_VIRT_BASE 0xfed64000
31#elif defined(CONFIG_DEBUG_RK3X_UART3)
32#define ROCKCHIP_UART_DEBUG_PHYS_BASE 0x20068000
33#define ROCKCHIP_UART_DEBUG_VIRT_BASE 0xfed68000
34#endif
35
36 .macro addruart, rp, rv, tmp
37 ldr \rp, =ROCKCHIP_UART_DEBUG_PHYS_BASE
38 ldr \rv, =ROCKCHIP_UART_DEBUG_VIRT_BASE
39 .endm
40
41#define UART_SHIFT 2
42#include <asm/hardware/debug-8250.S>