1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * Copyright (C) STMicroelectronics SA 2017 - 4 * Author: Gerald Baeza <gerald.baeza@st.com> 5 */ 6 7 #ifdef CONFIG_STM32F4_DEBUG_UART 8 #define STM32_USART_SR_OFF 0x00 9 #define STM32_USART_TDR_OFF 0x04 10 #endif 11 12 #if defined(CONFIG_STM32F7_DEBUG_UART) || defi 13 defined(CONFIG_STM32MP1_DEBUG_UART) 14 #define STM32_USART_SR_OFF 0x1C 15 #define STM32_USART_TDR_OFF 0x28 16 #endif 17 18 #define STM32_USART_TC (1 << 19 #define STM32_USART_TXE (1 << 20 21 .macro addruart, rp, rv, tmp 22 ldr \rp, =CONFIG_DEBUG_UART_PHYS @ 23 ldr \rv, =CONFIG_DEBUG_UART_VIRT @ 24 .endm 25 26 .macro senduart,rd,rx 27 strb \rd, [\rx, #STM32_USART_TDR_OF 28 .endm 29 30 .macro waituartcts,rd,rx 31 .endm 32 33 .macro waituarttxrdy,rd,rx 34 1001: ldr \rd, [\rx, #(STM32_USART_SR_OF 35 tst \rd, #STM32_USART_TXE 36 beq 1001b 37 .endm 38 39 .macro busyuart,rd,rx 40 1001: ldr \rd, [\rx, #(STM32_USART_SR_OF 41 tst \rd, #STM32_USART_TC 42 beq 1001b 43 .endm
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.