summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mxs/include/mach/debug_ll.h
blob: ac7a0e759da1528c7f55ac2de792dcb472a7721b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* SPDX-License-Identifier: GPL-2.0-only */

#ifndef __MACH_DEBUG_LL_H__
#define __MACH_DEBUG_LL_H__

#include <io.h>
#include <mach/imx-regs.h>

#define UARTDBGDR 0x00
#define UARTDBGFR 0x18
# define TXFE (1 << 7)
# define TXFF (1 << 5)

static inline void PUTC_LL(int c)
{
	void __iomem *base = (void *)IMX_DBGUART_BASE;

	/* Wait for room in TX FIFO */
	while (!(readl(base + UARTDBGFR) & TXFE));

	writel(c, base + UARTDBGDR);
}

#endif /* __MACH_DEBUG_LL_H__ */