blob: af873b5266778be070b0fde8cf3cbfd34debdad1 [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Russell Kinga09e64f2008-08-05 16:14:15 +01002/* arch/arm/mach-s3c2410/include/mach/debug-macro.S
3 *
4 * Debugging macro include header
5 *
6 * Copyright (C) 1994-1999 Russell King
7 * Copyright (C) 2005 Simtec Electronics
8 *
9 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
Russell Kinga09e64f2008-08-05 16:14:15 +010010*/
11
Tushar Behera334a1c72014-02-14 10:32:45 +090012#include <linux/serial_s3c.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010013
14#define S3C2410_UART1_OFF (0x4000)
Russell Kinga09e64f2008-08-05 16:14:15 +010015
Nicolas Pitre639da5e2011-08-31 22:55:46 -040016 .macro addruart, rp, rv, tmp
Heiko Stuebner1899de22014-05-16 06:59:18 +090017 ldr \rp, = CONFIG_DEBUG_UART_PHYS
18 ldr \rv, = CONFIG_DEBUG_UART_VIRT
Russell Kinga09e64f2008-08-05 16:14:15 +010019 .endm
20
Russell Kinga09e64f2008-08-05 16:14:15 +010021 .macro fifo_full_s3c2410 rd, rx
Arnd Bergmann28157742013-01-08 21:58:31 +000022 ldr \rd, [\rx, # S3C2410_UFSTAT]
Russell Kinga09e64f2008-08-05 16:14:15 +010023 tst \rd, #S3C2410_UFSTAT_TXFULL
24 .endm
25
Russell Kinga09e64f2008-08-05 16:14:15 +010026 .macro fifo_level_s3c2410 rd, rx
Arnd Bergmann28157742013-01-08 21:58:31 +000027 ldr \rd, [\rx, # S3C2410_UFSTAT]
Russell Kinga09e64f2008-08-05 16:14:15 +010028 and \rd, \rd, #S3C2410_UFSTAT_TXMASK
29 .endm
30
31/* Select the correct implementation depending on the configuration. The
32 * S3C2440 will get selected by default, as these are the most widely
33 * used variants of these
34*/
35
Heiko Stuebnerdaf67df2014-05-16 06:59:18 +090036#if defined(CONFIG_DEBUG_S3C2410_UART)
Russell Kinga09e64f2008-08-05 16:14:15 +010037#define fifo_full fifo_full_s3c2410
38#define fifo_level fifo_level_s3c2410
Russell Kinga09e64f2008-08-05 16:14:15 +010039#endif
40
41/* include the reset of the code which will do the work */
42
Arnd Bergmanna2e40712013-03-04 18:03:10 +010043#include <debug/samsung.S>