Changeset 1d5d6de in rtems
- Timestamp:
- 11/26/13 08:11:57 (10 years ago)
- Branches:
- 4.11, 5, master
- Children:
- a54179d2
- Parents:
- 6fe6d017
- git-author:
- Sebastian Huber <sebastian.huber@…> (11/26/13 08:11:57)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (02/04/14 13:54:27)
- Location:
- c/src/lib/libbsp/sparc/leon3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/sparc/leon3/console/console.c
r6fe6d017 r1d5d6de 32 32 #include <assert.h> 33 33 #include <rtems/bspIo.h> 34 #include < amba.h>34 #include <leon.h> 35 35 #include <rtems/termiostypes.h> 36 36 37 /* Let user override which on-chip APBUART will be debug UART38 * 0 = Default APBUART. On MP system CPU0=APBUART0, CPU1=APBUART1...39 * 1 = APBUART[0]40 * 2 = APBUART[1]41 * 3 = APBUART[2]42 * ...43 */44 37 int syscon_uart_index __attribute__((weak)) = 0; 45 46 /*47 * apbuart_outbyte_polled48 *49 * This routine transmits a character using polling.50 */51 52 extern void apbuart_outbyte_polled(53 struct apbuart_regs *regs,54 unsigned char ch,55 int do_cr_on_newline,56 int wait_sent57 );58 59 60 /* body is in printk_support.c */61 62 /*63 * apbuart_inbyte_nonblocking64 *65 * This routine polls for a character.66 */67 68 extern int apbuart_inbyte_nonblocking(struct apbuart_regs *regs);69 38 70 39 /* body is in debugputs.c */ … … 155 124 156 125 /* 157 * Prototypes to avoid warnings158 */159 ssize_t console_write_polled(int minor, const char *buf, size_t len);160 int console_pollRead(int minor);161 162 /*163 126 * Console Termios Support Entry Points 164 127 */ 165 ssize_t console_write_polled(int minor, const char *buf, size_t len) 128 static ssize_t leon3_console_write_polled( 129 int minor, 130 const char *buf, 131 size_t len 132 ) 166 133 { 167 134 struct apbuart_priv *uart = leon3_console_get_uart(minor); … … 175 142 } 176 143 177 intconsole_pollRead(int minor)144 static int leon3_console_pollRead(int minor) 178 145 { 179 146 struct apbuart_priv *uart = leon3_console_get_uart(minor); … … 184 151 #endif 185 152 186 /* 187 * Prototypes to avoid warnings 188 */ 189 int console_set_attributes(int minor, const struct termios *t); 190 int find_matching_apbuart(struct ambapp_dev *dev, int index, void *arg); 191 int console_scan_uarts(void); 192 193 194 int console_set_attributes(int minor, const struct termios *t) 153 static int leon3_console_set_attributes(int minor, const struct termios *t) 195 154 { 196 155 struct apbuart_priv *uart = leon3_console_get_uart(minor); … … 260 219 261 220 /* AMBA PP find routine. Extract AMBA PnP information into data structure. */ 262 int find_matching_apbuart(struct ambapp_dev *dev, int index, void *arg)221 static int find_matching_apbuart(struct ambapp_dev *dev, int index, void *arg) 263 222 { 264 223 struct ambapp_apb_info *apb = (struct ambapp_apb_info *)dev->devinfo; … … 282 241 283 242 /* Find all UARTs */ 284 intconsole_scan_uarts(void)243 static void leon3_console_scan_uarts(void) 285 244 { 286 245 memset(apbuarts, 0, sizeof(apbuarts)); … … 289 248 ambapp_for_each(&ambapp_plb, (OPTIONS_ALL|OPTIONS_APB_SLVS), VENDOR_GAISLER, 290 249 GAISLER_APBUART, find_matching_apbuart, NULL); 291 292 return uarts;293 250 } 294 251 … … 311 268 312 269 /* Find UARTs */ 313 console_scan_uarts();270 leon3_console_scan_uarts(); 314 271 315 272 /* Update syscon_uart_index to index used as /dev/console … … 430 387 NULL, /* pollRead */ 431 388 leon3_console_write_support, /* write */ 432 console_set_attributes,/* setAttributes */389 leon3_console_set_attributes,/* setAttributes */ 433 390 NULL, /* stopRemoteTx */ 434 391 NULL, /* startRemoteTx */ … … 440 397 leon3_console_first_open, /* firstOpen */ 441 398 NULL, /* lastClose */ 442 console_pollRead,/* pollRead */443 console_write_polled,/* write */444 console_set_attributes,/* setAttributes */399 leon3_console_pollRead, /* pollRead */ 400 leon3_console_write_polled, /* write */ 401 leon3_console_set_attributes,/* setAttributes */ 445 402 NULL, /* stopRemoteTx */ 446 403 NULL, /* startRemoteTx */ -
c/src/lib/libbsp/sparc/leon3/console/printk_support.c
r6fe6d017 r1d5d6de 17 17 18 18 #include <bsp.h> 19 #include <leon.h> 19 20 #include <rtems/libio.h> 20 21 #include <stdlib.h> … … 22 23 #include <stdio.h> 23 24 24 /* Let user override which on-chip APBUART will be debug UART25 * 0 = Default APBUART. On MP system CPU0=APBUART0, CPU1=APBUART1...26 * 1 = APBUART[0]27 * 2 = APBUART[1]28 * 3 = APBUART[2]29 * ...30 */31 25 int debug_uart_index __attribute__((weak)) = 0; 32 st ruct apbuart_regs *dbg_uart = NULL;26 static struct apbuart_regs *dbg_uart = NULL; 33 27 34 28 /* Before UART driver has registered (or when no UART is available), calls to … … 37 31 * early BSP boot.. At least the last printk() will be caught. 38 32 */ 39 char pre_printk_dbgbuf[32] = {0};40 int pre_printk_pos = 0;33 static char pre_printk_dbgbuf[32] = {0}; 34 static int pre_printk_pos = 0; 41 35 42 36 /* Initialize the BSP system debug console layer. It will scan AMBA Plu&Play -
c/src/lib/libbsp/sparc/leon3/include/leon.h
r6fe6d017 r1d5d6de 274 274 } 275 275 276 /* Let user override which on-chip APBUART will be debug UART 277 * 0 = Default APBUART. On MP system CPU0=APBUART0, CPU1=APBUART1... 278 * 1 = APBUART[0] 279 * 2 = APBUART[1] 280 * 3 = APBUART[2] 281 * ... 282 */ 283 extern int syscon_uart_index; 284 285 /* Let user override which on-chip APBUART will be debug UART 286 * 0 = Default APBUART. On MP system CPU0=APBUART0, CPU1=APBUART1... 287 * 1 = APBUART[0] 288 * 2 = APBUART[1] 289 * 3 = APBUART[2] 290 * ... 291 */ 292 extern int debug_uart_index; 293 294 /* 295 * apbuart_outbyte_polled 296 * 297 * This routine transmits a character using polling. 298 */ 299 void apbuart_outbyte_polled( 300 struct apbuart_regs *regs, 301 unsigned char ch, 302 int do_cr_on_newline, 303 int wait_sent 304 ); 305 306 /* 307 * apbuart_inbyte_nonblocking 308 * 309 * This routine polls for a character. 310 */ 311 int apbuart_inbyte_nonblocking(struct apbuart_regs *regs); 312 276 313 #endif /* !ASM */ 277 314
Note: See TracChangeset
for help on using the changeset viewer.