xref: /openbmc/linux/arch/arm/include/asm/dcc.h (revision 0d3b051a)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* Copyright (c) 2010, 2014 The Linux Foundation. All rights reserved.
3  */
4 
5 #include <asm/barrier.h>
6 
7 static inline u32 __dcc_getstatus(void)
8 {
9 	u32 __ret;
10 	asm volatile("mrc p14, 0, %0, c0, c1, 0	@ read comms ctrl reg"
11 		: "=r" (__ret) : : "cc");
12 
13 	return __ret;
14 }
15 
16 static inline char __dcc_getchar(void)
17 {
18 	char __c;
19 
20 	asm volatile("mrc p14, 0, %0, c0, c5, 0	@ read comms data reg"
21 		: "=r" (__c));
22 	isb();
23 
24 	return __c;
25 }
26 
27 static inline void __dcc_putchar(char c)
28 {
29 	asm volatile("mcr p14, 0, %0, c0, c5, 0	@ write a char"
30 		: /* no output register */
31 		: "r" (c));
32 	isb();
33 }
34