]> git.sur5r.net Git - u-boot/blobdiff - drivers/serial/arm_dcc.c
Merge branch 'master' of git://git.denx.de/u-boot-net
[u-boot] / drivers / serial / arm_dcc.c
index e77773740fb02d46a1c2067ef86b5f07db62c770..4624666e8a2c776d2eb56933d7968407f03962f8 100644 (file)
@@ -2,18 +2,7 @@
  * Copyright (C) 2004-2007 ARM Limited.
  * Copyright (C) 2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
  *
- * 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.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * SPDX-License-Identifier:    GPL-2.0
  *
  * As a special exception, if other files instantiate templates or use macros
  * or inline functions from this file, or you compile this file and link it
 #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)