@@ -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)
+#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
@@ -11,6 +11,8 @@
#ifndef __ASM_ARCH_HARDWARE_H
#define __ASM_ARCH_HARDWARE_H
+#include <linux/const.h>
+
/*
* Before you add anything to ths file:
*
@@ -27,7 +29,7 @@
/*
* I/O mapping
*/
-#define IO_PHYS 0x01c00000UL
+#define IO_PHYS _AC(0x01c00000, UL)
#define IO_OFFSET 0xfd000000 /* Virtual IO = 0xfec00000 */
#define IO_SIZE 0x00400000
#define IO_VIRT (IO_PHYS + IO_OFFSET)
@@ -31,11 +31,13 @@
#define UART_DM646X_SCR 0x10
#define UART_DM646X_SCR_TX_WATERMARK 0x08
+#ifndef __ASSEMBLY__
struct davinci_uart_config {
/* Bit field of UARTs present; bit 0 --> UART1 */
unsigned int enabled_uarts;
};
extern int davinci_serial_init(struct davinci_uart_config *);
+#endif
#endif /* __ASM_ARCH_SERIAL_H */