2 * arch/arm/include/debug/sti.S
4 * Debugging macro include header
5 * Copyright (C) 2013 STMicroelectronics (R&D) Limited.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
12 #define STIH41X_COMMS_BASE 0xfed00000
13 #define STIH41X_ASC2_BASE (STIH41X_COMMS_BASE+0x32000)
15 #define STIH41X_SBC_LPM_BASE 0xfe400000
16 #define STIH41X_SBC_COMMS_BASE (STIH41X_SBC_LPM_BASE + 0x100000)
17 #define STIH41X_SBC_ASC1_BASE (STIH41X_SBC_COMMS_BASE + 0x31000)
20 #define VIRT_ADDRESS(x) (x - 0x1000000)
22 #if IS_ENABLED(CONFIG_STIH41X_DEBUG_ASC2)
23 #define DEBUG_LL_UART_BASE STIH41X_ASC2_BASE
26 #if IS_ENABLED(CONFIG_STIH41X_DEBUG_SBC_ASC1)
27 #define DEBUG_LL_UART_BASE STIH41X_SBC_ASC1_BASE
30 #ifndef DEBUG_LL_UART_BASE
31 #error "DEBUG UART is not Configured"
34 #define ASC_TX_BUF_OFF 0x04
35 #define ASC_CTRL_OFF 0x0c
36 #define ASC_STA_OFF 0x14
38 #define ASC_STA_TX_FULL (1<<9)
39 #define ASC_STA_TX_EMPTY (1<<1)
42 .macro addruart, rp, rv, tmp
43 ldr \rp, =DEBUG_LL_UART_BASE @ physical base
44 ldr \rv, =VIRT_ADDRESS(DEBUG_LL_UART_BASE) @ virt base
48 strb \rd, [\rx, #ASC_TX_BUF_OFF]
52 1001: ldr \rd, [\rx, #ASC_STA_OFF]
53 tst \rd, #ASC_STA_TX_FULL
58 1001: ldr \rd, [\rx, #ASC_STA_OFF]
59 tst \rd, #ASC_STA_TX_EMPTY