xref: /OK3568_Linux_fs/kernel/arch/arm/include/debug/s3c24xx.S (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun/* SPDX-License-Identifier: GPL-2.0-only */
2*4882a593Smuzhiyun/* arch/arm/mach-s3c2410/include/mach/debug-macro.S
3*4882a593Smuzhiyun *
4*4882a593Smuzhiyun * Debugging macro include header
5*4882a593Smuzhiyun *
6*4882a593Smuzhiyun *  Copyright (C) 1994-1999 Russell King
7*4882a593Smuzhiyun *  Copyright (C) 2005 Simtec Electronics
8*4882a593Smuzhiyun *
9*4882a593Smuzhiyun *  Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
10*4882a593Smuzhiyun*/
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun#include <linux/serial_s3c.h>
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun#define S3C2410_UART1_OFF (0x4000)
15*4882a593Smuzhiyun
16*4882a593Smuzhiyun	.macro addruart, rp, rv, tmp
17*4882a593Smuzhiyun		ldr	\rp, = CONFIG_DEBUG_UART_PHYS
18*4882a593Smuzhiyun		ldr	\rv, = CONFIG_DEBUG_UART_VIRT
19*4882a593Smuzhiyun	.endm
20*4882a593Smuzhiyun
21*4882a593Smuzhiyun	.macro  fifo_full_s3c2410 rd, rx
22*4882a593Smuzhiyun		ldr	\rd, [\rx, # S3C2410_UFSTAT]
23*4882a593Smuzhiyun		tst	\rd, #S3C2410_UFSTAT_TXFULL
24*4882a593Smuzhiyun	.endm
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun	.macro fifo_level_s3c2410 rd, rx
27*4882a593Smuzhiyun		ldr	\rd, [\rx, # S3C2410_UFSTAT]
28*4882a593Smuzhiyun		and	\rd, \rd, #S3C2410_UFSTAT_TXMASK
29*4882a593Smuzhiyun	.endm
30*4882a593Smuzhiyun
31*4882a593Smuzhiyun/* Select the correct implementation depending on the configuration. The
32*4882a593Smuzhiyun * S3C2440 will get selected by default, as these are the most widely
33*4882a593Smuzhiyun * used variants of these
34*4882a593Smuzhiyun*/
35*4882a593Smuzhiyun
36*4882a593Smuzhiyun#if defined(CONFIG_DEBUG_S3C2410_UART)
37*4882a593Smuzhiyun#define fifo_full  fifo_full_s3c2410
38*4882a593Smuzhiyun#define fifo_level fifo_level_s3c2410
39*4882a593Smuzhiyun#endif
40*4882a593Smuzhiyun
41*4882a593Smuzhiyun/* include the reset of the code which will do the work */
42*4882a593Smuzhiyun
43*4882a593Smuzhiyun#include <debug/samsung.S>
44