Hello.
Cyril Chemparathy wrote:
Simplified UART base address calculation for low-level debug macros. This
makes it much easier to add in support for other SOCs.
Signed-off-by: Cyril Chemparathy <[email protected]>
---
arch/arm/mach-davinci/include/mach/debug-macro.S | 28 +++++++++++++--------
arch/arm/mach-davinci/include/mach/hardware.h | 4 ++-
arch/arm/mach-davinci/include/mach/serial.h | 2 +
3 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/arch/arm/mach-davinci/include/mach/debug-macro.S
b/arch/arm/mach-davinci/include/mach/debug-macro.S
index 3cd93a8..b8b47a4 100644
--- a/arch/arm/mach-davinci/include/mach/debug-macro.S
+++ b/arch/arm/mach-davinci/include/mach/debug-macro.S
@@ -17,22 +17,28 @@
*/
#include <linux/serial_reg.h>
+#include <mach/serial.h>
+
+#if defined(CONFIG_ARCH_DAVINCI_DMx)
+#define UART_PHYS DAVINCI_UART0_BASE
+#define UART_VIRT IO_ADDRESS(UART_PHYS)
+#endif
+
+#if defined(CONFIG_ARCH_DAVINCI_DA8XX)
These UART addressed are machine-, not arch-specific.
+#ifdef UART_PHYS
+#error "CONFIG_DEBUG_LL is incompatible with multiple archs"
+#endif
+#define UART_PHYS DA8XX_UART2_BASE
+#define UART_VIRT IO_ADDRESS(UART_PHYS)
+#endif
+
#define UART_SHIFT 2
.macro addruart, rx, tmp
mrc p15, 0, \rx, c1, c0
tst \rx, #1 @ MMU enabled?
- moveq \rx, #0x01000000 @ physical base address
- movne \rx, #0xfe000000 @ virtual base
-#if defined(CONFIG_ARCH_DAVINCI_DA8XX) && defined(CONFIG_ARCH_DAVINCI_DMx)
-#error Cannot enable DaVinci and DA8XX platforms concurrently
-#elif defined(CONFIG_MACH_DAVINCI_DA830_EVM) || \
- defined(CONFIG_MACH_DAVINCI_DA850_EVM)
- orr \rx, \rx, #0x00d00000 @ physical base address
- orr \rx, \rx, #0x0000d000 @ of UART 2
-#else
- orr \rx, \rx, #0x00c20000 @ UART 0
-#endif
+ ldreq \rx, =UART_PHYS
+ ldrne \rx, =UART_VIRT
.endm
.macro senduart,rd,rx
WBR, Sergei
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source