Thomas Gleixner | d2912cb | 2019-06-04 10:11:33 +0200 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 2 | /* 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 King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 10 | */ |
| 11 | |
Tushar Behera | 334a1c7 | 2014-02-14 10:32:45 +0900 | [diff] [blame] | 12 | #include <linux/serial_s3c.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 13 | |
| 14 | #define S3C2410_UART1_OFF (0x4000) |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 15 | |
Nicolas Pitre | 639da5e | 2011-08-31 22:55:46 -0400 | [diff] [blame] | 16 | .macro addruart, rp, rv, tmp |
Heiko Stuebner | 1899de2 | 2014-05-16 06:59:18 +0900 | [diff] [blame] | 17 | ldr \rp, = CONFIG_DEBUG_UART_PHYS |
| 18 | ldr \rv, = CONFIG_DEBUG_UART_VIRT |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 19 | .endm |
| 20 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 21 | .macro fifo_full_s3c2410 rd, rx |
Arnd Bergmann | 2815774 | 2013-01-08 21:58:31 +0000 | [diff] [blame] | 22 | ldr \rd, [\rx, # S3C2410_UFSTAT] |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 23 | tst \rd, #S3C2410_UFSTAT_TXFULL |
| 24 | .endm |
| 25 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 26 | .macro fifo_level_s3c2410 rd, rx |
Arnd Bergmann | 2815774 | 2013-01-08 21:58:31 +0000 | [diff] [blame] | 27 | ldr \rd, [\rx, # S3C2410_UFSTAT] |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 28 | 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 Stuebner | daf67df | 2014-05-16 06:59:18 +0900 | [diff] [blame] | 36 | #if defined(CONFIG_DEBUG_S3C2410_UART) |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 37 | #define fifo_full fifo_full_s3c2410 |
| 38 | #define fifo_level fifo_level_s3c2410 |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 39 | #endif |
| 40 | |
| 41 | /* include the reset of the code which will do the work */ |
| 42 | |
Arnd Bergmann | a2e4071 | 2013-03-04 18:03:10 +0100 | [diff] [blame] | 43 | #include <debug/samsung.S> |