From 0a258e169eff26d733da71326944df40d2238852 Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Sun, 27 May 2012 09:35:01 +0200 Subject: [PATCH] arm: sunxi: coped sun4i's early-printk support to sun3i and sun5i --- arch/arm/mach-sun3i/Kconfig | 8 +++++++ .../arm/mach-sun3i/include/mach/debug-macro.S | 21 +++++++++++++++++++ arch/arm/mach-sun5i/Kconfig | 9 ++++++++ .../arm/mach-sun5i/include/mach/debug-macro.S | 21 +++++++++++++++++++ 4 files changed, 59 insertions(+) create mode 100644 arch/arm/mach-sun3i/include/mach/debug-macro.S create mode 100644 arch/arm/mach-sun5i/include/mach/debug-macro.S diff --git a/arch/arm/mach-sun3i/Kconfig b/arch/arm/mach-sun3i/Kconfig index e000d7e4b8b9b1..ae565ee03b99b1 100644 --- a/arch/arm/mach-sun3i/Kconfig +++ b/arch/arm/mach-sun3i/Kconfig @@ -29,5 +29,13 @@ config SW_PIN_TEST ---help--- "Test code for PIN module" +config SW_DEBUG_UART + int "UART to use for low-level debug" + depends on DEBUG_LL + default 0 + help + Choose the UART on which kernel low-level debug messages should be + output. + endmenu endif diff --git a/arch/arm/mach-sun3i/include/mach/debug-macro.S b/arch/arm/mach-sun3i/include/mach/debug-macro.S new file mode 100644 index 00000000000000..bcf1382096affa --- /dev/null +++ b/arch/arm/mach-sun3i/include/mach/debug-macro.S @@ -0,0 +1,21 @@ +/* + * arch/arm/mach-sun3i/include/mach/debug-macro.S + * + * 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. +*/ + +#include + + .macro addruart, rp, rv + ldr \rp, =SW_PA_UART0_IO_BASE + ldr \rv, =SW_VA_UART0_IO_BASE +#if CONFIG_SW_DEBUG_UART != 0 + add \rp, \rp, #(0x400 * CONFIG_SW_DEBUG_UART) + add \rv, \rv, #(0x400 * CONFIG_SW_DEBUG_UART) +#endif + .endm + +#define UART_SHIFT 2 +#include diff --git a/arch/arm/mach-sun5i/Kconfig b/arch/arm/mach-sun5i/Kconfig index 33f2c01d998ab0..d0c947f9c89e32 100644 --- a/arch/arm/mach-sun5i/Kconfig +++ b/arch/arm/mach-sun5i/Kconfig @@ -4,4 +4,13 @@ config SUN5I_FPGA bool "FPGA Board Support" help Only for FPGA board. + +config SW_DEBUG_UART + int "UART to use for low-level debug" + depends on DEBUG_LL + default 0 + help + Choose the UART on which kernel low-level debug messages should be + output. + endif diff --git a/arch/arm/mach-sun5i/include/mach/debug-macro.S b/arch/arm/mach-sun5i/include/mach/debug-macro.S new file mode 100644 index 00000000000000..c3c03056b82faa --- /dev/null +++ b/arch/arm/mach-sun5i/include/mach/debug-macro.S @@ -0,0 +1,21 @@ +/* + * arch/arm/mach-sun5i/include/mach/debug-macro.S + * + * 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. +*/ + +#include + + .macro addruart, rp, rv + ldr \rp, =SW_PA_UART0_IO_BASE + ldr \rv, =SW_VA_UART0_IO_BASE +#if CONFIG_SW_DEBUG_UART != 0 + add \rp, \rp, #(0x400 * CONFIG_SW_DEBUG_UART) + add \rv, \rv, #(0x400 * CONFIG_SW_DEBUG_UART) +#endif + .endm + +#define UART_SHIFT 2 +#include