]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/serial/arm_dcc.c
ddr: altera: sequencer: Zap bogus redefinition of RW_MGR_MEM_NUMBER_OF_RANKS
[karo-tx-uboot.git] / drivers / serial / arm_dcc.c
index 29d929571df653199d61182b7f93ab9fb42b4524..df7eb05e82460e998be15e56734e8ff8ff83f5e3 100644 (file)
@@ -29,9 +29,9 @@
 #include <common.h>
 #include <serial.h>
 
-#if defined(CONFIG_CPU_V6)
+#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V7)
 /*
- * ARMV6
+ * ARMV6 & ARMV7
  */
 #define DCC_RBIT       (1 << 30)
 #define DCC_WBIT       (1 << 29)
 #define status_dcc(x)  \
                __asm__ volatile ("mrc p14, 0, %0, c14, c0, 0\n" : "=r" (x))
 
+#elif defined(CONFIG_CPU_ARMV8)
+/*
+ * ARMV8
+ */
+#define DCC_RBIT       (1 << 30)
+#define DCC_WBIT       (1 << 29)
+
+#define write_dcc(x)   \
+               __asm__ volatile ("msr dbgdtrtx_el0, %0\n" : : "r" (x))
+
+#define read_dcc(x)    \
+               __asm__ volatile ("mrs %0, dbgdtrrx_el0\n" : "=r" (x))
+
+#define status_dcc(x)  \
+               __asm__ volatile ("mrs %0, mdccsr_el0\n" : "=r" (x))
+
 #else
 #define DCC_RBIT       (1 << 0)
 #define DCC_WBIT       (1 << 1)
@@ -123,12 +139,6 @@ static void arm_dcc_putc(char ch)
                write_dcc(ch);
 }
 
-static void arm_dcc_puts(const char *s)
-{
-       while (*s)
-               arm_dcc_putc(*s++);
-}
-
 static int arm_dcc_tstc(void)
 {
        register unsigned int reg;
@@ -148,7 +158,7 @@ static struct serial_device arm_dcc_drv = {
        .stop   = NULL,
        .setbrg = arm_dcc_setbrg,
        .putc   = arm_dcc_putc,
-       .puts   = arm_dcc_puts,
+       .puts   = default_serial_puts,
        .getc   = arm_dcc_getc,
        .tstc   = arm_dcc_tstc,
 };