Skip to content

Commit

Permalink
arm: sunxi: coped sun4i's early-printk support to sun3i and sun5i
Browse files Browse the repository at this point in the history
  • Loading branch information
amery committed May 27, 2012
1 parent 6e8f69b commit 0a258e1
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 0 deletions.
8 changes: 8 additions & 0 deletions arch/arm/mach-sun3i/Kconfig
Expand Up @@ -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
21 changes: 21 additions & 0 deletions 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 <mach/platform.h>

.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 <asm/hardware/debug-8250.S>
9 changes: 9 additions & 0 deletions arch/arm/mach-sun5i/Kconfig
Expand Up @@ -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
21 changes: 21 additions & 0 deletions 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 <mach/platform.h>

.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 <asm/hardware/debug-8250.S>

0 comments on commit 0a258e1

Please sign in to comment.