Changeset 229c4249 in rtems for c/src/lib/libbsp/sparc/leon3/console/printk_support.c
- Timestamp:
- 04/27/17 11:14:53 (6 years ago)
- Branches:
- 5, master
- Children:
- ad203e58
- Parents:
- 011efee8
- git-author:
- Martin Aberg <maberg@…> (04/27/17 11:14:53)
- git-committer:
- Daniel Hellstrom <daniel@…> (05/14/17 10:31:57)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/sparc/leon3/console/printk_support.c
r011efee8 r229c4249 26 26 #include <bsp/apbuart_termios.h> 27 27 28 int debug_uart_index __attribute__((weak)) = 0;29 struct apbuart_regs * dbg_uart = NULL;28 int leon3_debug_uart_index __attribute__((weak)) = 0; 29 struct apbuart_regs *leon3_debug_uart = NULL; 30 30 31 31 /* Before UART driver has registered (or when no UART is available), calls to … … 46 46 struct ambapp_apb_info *apb; 47 47 48 /* Update debug_uart_index to index used as debug console.49 * Let user select Debug console by setting debug_uart_index. If the50 * BSP is to provide the default UART (debug_uart_index==0):48 /* Update leon3_debug_uart_index to index used as debug console. Let user 49 * select Debug console by setting leon3_debug_uart_index. If the BSP is to 50 * provide the default UART (leon3_debug_uart_index==0): 51 51 * non-MP: APBUART[0] is debug console 52 52 * MP: LEON CPU index select UART 53 53 */ 54 if ( debug_uart_index == 0) {54 if (leon3_debug_uart_index == 0) { 55 55 #if defined(RTEMS_MULTIPROCESSING) 56 debug_uart_index = LEON3_Cpu_Index;56 leon3_debug_uart_index = LEON3_Cpu_Index; 57 57 #else 58 debug_uart_index = 0;58 leon3_debug_uart_index = 0; 59 59 #endif 60 60 } else { 61 debug_uart_index = debug_uart_index - 1; /* User selected dbg-console */61 leon3_debug_uart_index--; /* User selected dbg-console */ 62 62 } 63 63 64 64 /* Find APBUART core for System Debug Console */ 65 i = debug_uart_index;65 i = leon3_debug_uart_index; 66 66 adev = (void *)ambapp_for_each(&ambapp_plb, (OPTIONS_ALL|OPTIONS_APB_SLVS), 67 67 VENDOR_GAISLER, GAISLER_APBUART, … … 72 72 */ 73 73 apb = (struct ambapp_apb_info *)adev->devinfo; 74 dbg_uart = (struct apbuart_regs *)apb->start;75 dbg_uart->ctrl |= APBUART_CTRL_RE | APBUART_CTRL_TE;76 dbg_uart->status = 0;74 leon3_debug_uart = (struct apbuart_regs *)apb->start; 75 leon3_debug_uart->ctrl |= APBUART_CTRL_RE | APBUART_CTRL_TE; 76 leon3_debug_uart->status = 0; 77 77 } 78 78 } … … 87 87 static void bsp_out_char(char c) 88 88 { 89 if ( dbg_uart == NULL) {89 if (leon3_debug_uart == NULL) { 90 90 /* Local debug buffer when UART driver has not registered */ 91 91 pre_printk_dbgbuf[pre_printk_pos++] = c; … … 94 94 } 95 95 96 apbuart_outbyte_polled( dbg_uart, c, 1, 1);96 apbuart_outbyte_polled(leon3_debug_uart, c, 1, 1); 97 97 } 98 98 … … 109 109 int tmp; 110 110 111 if ( dbg_uart == NULL)111 if (leon3_debug_uart == NULL) 112 112 return EOF; 113 113 114 while ((tmp = apbuart_inbyte_nonblocking( dbg_uart)) < 0)114 while ((tmp = apbuart_inbyte_nonblocking(leon3_debug_uart)) < 0) 115 115 ; 116 116 return tmp;
Note: See TracChangeset
for help on using the changeset viewer.