Merge tag 'sched-urgent-2020-12-27' of git://git.kernel.org/pub/scm/linux/kernel...
[linux/fpc-iii.git] / arch / arm / include / debug / efm32.S
blobb0083d6e31e80aac07529f8584ac3ae55f3dae7b
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Copyright (C) 2013 Pengutronix
4  * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
5  */
7 #define UARTn_CMD               0x000c
8 #define UARTn_CMD_TXEN                  0x0004
10 #define UARTn_STATUS            0x0010
11 #define UARTn_STATUS_TXC                0x0020
12 #define UARTn_STATUS_TXBL               0x0040
14 #define UARTn_TXDATA            0x0034
16                 .macro  addruart, rx, tmp, tmp2
17                 ldr     \rx, =(CONFIG_DEBUG_UART_PHYS)
19                 /*
20                  * enable TX. The driver might disable it to save energy. We
21                  * don't care about disabling at the end as during debug power
22                  * consumption isn't that important.
23                  */
24                 ldr     \tmp, =(UARTn_CMD_TXEN)
25                 str     \tmp, [\rx, #UARTn_CMD]
26                 .endm
28                 .macro  senduart,rd,rx
29                 strb    \rd, [\rx, #UARTn_TXDATA]
30                 .endm
32                 .macro  waituartcts,rd,rx
33                 .endm
35                 .macro  waituarttxrdy,rd,rx
36 1001:           ldr     \rd, [\rx, #UARTn_STATUS]
37                 tst     \rd, #UARTn_STATUS_TXBL
38                 beq     1001b
39                 .endm
41                 .macro  busyuart,rd,rx
42 1001:           ldr     \rd, [\rx, UARTn_STATUS]
43                 tst     \rd, #UARTn_STATUS_TXC
44                 bne     1001b
45                 .endm