Commit 6f112a08 authored by Alexandre Belloni's avatar Alexandre Belloni Committed by Nicolas Ferre

ARM: at91: debug: use DEBUG_UART_PHYS

Instead of having to add a new configuration option each time support for
new SoC is added, use CONFIG_DEBUG_UART_PHYS. For now,
CONFIG_DEBUG_UART_VIRT is automatically computed.
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
parent d6157e4f
...@@ -123,29 +123,23 @@ choice ...@@ -123,29 +123,23 @@ choice
0x80020000 | 0xf0020000 | UART8 0x80020000 | 0xf0020000 | UART8
0x80024000 | 0xf0024000 | UART9 0x80024000 | 0xf0024000 | UART9
config AT91_DEBUG_LL_DBGU0 config DEBUG_AT91_UART
bool "Kernel low-level debugging on rm9200, 9260/9g20, 9261/9g10, 9rl, 9x5, 9n12" bool "Kernel low-level debugging on Atmel SoCs"
select DEBUG_AT91_UART
depends on ARCH_AT91 depends on ARCH_AT91
depends on SOC_AT91RM9200 || SOC_AT91SAM9 help
Say Y here if you want the debug print routines to direct
their output to the serial port on atmel devices.
config AT91_DEBUG_LL_DBGU1 SOC DEBUG_UART_PHYS DEBUG_UART_VIRT PORT
bool "Kernel low-level debugging on 9263, 9g45 and sama5d3" rm9200, 9260/9g20, 0xfffff200 0xfefff200 DBGU
select DEBUG_AT91_UART 9261/9g10, 9rl
depends on ARCH_AT91 9263, 9g45, sama5d3 0xffffee00 0xfeffee00 DBGU
depends on SOC_AT91SAM9 || SOC_SAMA5 sama5d4 0xfc00c000 0xfb00c000 USART3
sama5d4 0xfc069000 0xfb069000 DBGU
sama5d2 0xf8020000 0xf7020000 UART1
config AT91_DEBUG_LL_DBGU2 Please adjust DEBUG_UART_PHYS configuration options based on
bool "Kernel low-level debugging on sama5d4" your needs.
select DEBUG_AT91_UART
depends on ARCH_AT91
depends on SOC_SAMA5
config AT91_DEBUG_LL_DBGU3
bool "Kernel low-level debugging on sama5d2"
select DEBUG_AT91_UART
depends on ARCH_AT91
depends on SOC_SAMA5
config DEBUG_BCM2835 config DEBUG_BCM2835
bool "Kernel low-level debugging on BCM2835 PL011 UART" bool "Kernel low-level debugging on BCM2835 PL011 UART"
...@@ -1249,10 +1243,6 @@ choice ...@@ -1249,10 +1243,6 @@ choice
endchoice endchoice
config DEBUG_AT91_UART
bool
depends on ARCH_AT91
config DEBUG_EXYNOS_UART config DEBUG_EXYNOS_UART
bool bool
...@@ -1485,7 +1475,8 @@ config DEBUG_UART_PHYS ...@@ -1485,7 +1475,8 @@ config DEBUG_UART_PHYS
DEBUG_RMOBILE_SCIFA0 || DEBUG_RMOBILE_SCIFA1 || \ DEBUG_RMOBILE_SCIFA0 || DEBUG_RMOBILE_SCIFA1 || \
DEBUG_RMOBILE_SCIFA4 || DEBUG_S3C24XX_UART || \ DEBUG_RMOBILE_SCIFA4 || DEBUG_S3C24XX_UART || \
DEBUG_UART_BCM63XX || DEBUG_ASM9260_UART || \ DEBUG_UART_BCM63XX || DEBUG_ASM9260_UART || \
DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0 DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0 || \
DEBUG_AT91_UART
config DEBUG_UART_VIRT config DEBUG_UART_VIRT
hex "Virtual base address of debug UART" hex "Virtual base address of debug UART"
......
...@@ -9,32 +9,22 @@ ...@@ -9,32 +9,22 @@
* *
*/ */
#if defined(CONFIG_AT91_DEBUG_LL_DBGU0)
#define AT91_DBGU 0xfffff200 /* AT91_BASE_DBGU0 */
#elif defined(CONFIG_AT91_DEBUG_LL_DBGU1)
#define AT91_DBGU 0xffffee00 /* AT91_BASE_DBGU1 */
#elif defined(CONFIG_AT91_DEBUG_LL_DBGU2)
/* On sama5d4, use USART3 as low level serial console */
#define AT91_DBGU 0xfc00c000 /* SAMA5D4_BASE_USART3 */
#else
/* On sama5d2, use UART1 as low level serial console */
#define AT91_DBGU 0xf8020000
#endif
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
#define AT91_IO_P2V(x) ((x) - 0x01000000) #define AT91_IO_P2V(x) ((x) - 0x01000000)
#else #else
#define AT91_IO_P2V(x) (x) #define AT91_IO_P2V(x) (x)
#endif #endif
#define CONFIG_DEBUG_UART_VIRT AT91_IO_P2V(CONFIG_DEBUG_UART_PHYS)
#define AT91_DBGU_SR (0x14) /* Status Register */ #define AT91_DBGU_SR (0x14) /* Status Register */
#define AT91_DBGU_THR (0x1c) /* Transmitter Holding Register */ #define AT91_DBGU_THR (0x1c) /* Transmitter Holding Register */
#define AT91_DBGU_TXRDY (1 << 1) /* Transmitter Ready */ #define AT91_DBGU_TXRDY (1 << 1) /* Transmitter Ready */
#define AT91_DBGU_TXEMPTY (1 << 9) /* Transmitter Empty */ #define AT91_DBGU_TXEMPTY (1 << 9) /* Transmitter Empty */
.macro addruart, rp, rv, tmp .macro addruart, rp, rv, tmp
ldr \rp, =AT91_DBGU @ System peripherals (phys address) ldr \rp, =CONFIG_DEBUG_UART_PHYS @ System peripherals (phys address)
ldr \rv, =AT91_IO_P2V(AT91_DBGU) @ System peripherals (virt address) ldr \rv, =CONFIG_DEBUG_UART_VIRT @ System peripherals (virt address)
.endm .endm
.macro senduart,rd,rx .macro senduart,rd,rx
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment