1 | /* |
---|
2 | * This file contains the libchip configuration information |
---|
3 | * to instantiate the libchip driver for the on-CPU DUART |
---|
4 | * and any other serial ports in the system. |
---|
5 | * |
---|
6 | * COPYRIGHT (c) 1989-2001. |
---|
7 | * On-Line Applications Research Corporation (OAR). |
---|
8 | * |
---|
9 | * The license and distribution terms for this file may be |
---|
10 | * found in the file LICENSE in this distribution or at |
---|
11 | * http://www.OARcorp.com/rtems/license.html. |
---|
12 | * |
---|
13 | * $Id$ |
---|
14 | */ |
---|
15 | |
---|
16 | #include <bsp.h> |
---|
17 | |
---|
18 | #include <libchip/serial.h> |
---|
19 | #include <libchip/mg5uart.h> |
---|
20 | |
---|
21 | #if (CONSOLE_USE_INTERRUPTS) |
---|
22 | #define MG5UART_FUNCTIONS &mg5uart_fns |
---|
23 | #else |
---|
24 | #define MG5UART_FUNCTIONS &mg5uart_fns_polled |
---|
25 | #endif |
---|
26 | |
---|
27 | extern int ClockRate; |
---|
28 | #define CLOCK_RATE (unsigned32) &ClockRate |
---|
29 | |
---|
30 | console_tbl Console_Port_Tbl[] = { |
---|
31 | { |
---|
32 | "/dev/com0", /* sDeviceName */ |
---|
33 | SERIAL_MG5UART, /* deviceType */ |
---|
34 | MG5UART_FUNCTIONS, /* pDeviceFns */ |
---|
35 | NULL, /* deviceProbe, assume it is there */ |
---|
36 | NULL, /* pDeviceFlow */ |
---|
37 | 16, /* ulMargin */ |
---|
38 | 8, /* ulHysteresis */ |
---|
39 | (void *) NULL, /* NULL */ /* pDeviceParams */ |
---|
40 | MONGOOSEV_PERIPHERAL_COMMAND_REGISTER, /* ulCtrlPort1 */ |
---|
41 | MONGOOSEV_UART0_BASE, /* ulCtrlPort2 */ |
---|
42 | MG5UART_UART0, /* ulDataPort */ |
---|
43 | NULL, /* getRegister */ |
---|
44 | NULL, /* setRegister */ |
---|
45 | NULL, /* unused */ /* getData */ |
---|
46 | NULL, /* unused */ /* setData */ |
---|
47 | CLOCK_RATE, /* ulClock */ |
---|
48 | MONGOOSEV_IRQ_UART0_RX_FRAME_ERROR /* ulIntVector -- base for port */ |
---|
49 | } |
---|
50 | }; |
---|
51 | |
---|
52 | /* |
---|
53 | * Declare some information used by the console driver |
---|
54 | */ |
---|
55 | |
---|
56 | #define NUM_CONSOLE_PORTS (sizeof(Console_Port_Tbl)/sizeof(console_tbl)) |
---|
57 | |
---|
58 | unsigned long Console_Port_Count = NUM_CONSOLE_PORTS; |
---|
59 | |
---|
60 | console_data Console_Port_Data[NUM_CONSOLE_PORTS]; |
---|
61 | |
---|
62 | rtems_device_minor_number Console_Port_Minor; |
---|
63 | |
---|
64 | |
---|
65 | /* |
---|
66 | * printk() support that simply routes printk to stderr |
---|
67 | */ |
---|
68 | |
---|
69 | #include <bspIo.h> |
---|
70 | |
---|
71 | void GENMG5_output_char(char c) { write( 2, &c, 1 ); } |
---|
72 | |
---|
73 | BSP_output_char_function_type BSP_output_char = GENMG5_output_char; |
---|
74 | BSP_polling_getchar_function_type BSP_poll_char = NULL; |
---|
75 | |
---|
76 | |
---|