1 | /* |
---|
2 | * This file contains the TTY driver table. |
---|
3 | * |
---|
4 | * COPYRIGHT (c) 1989-2000. |
---|
5 | * On-Line Applications Research Corporation (OAR). |
---|
6 | * |
---|
7 | * The license and distribution terms for this file may be |
---|
8 | * found in the file LICENSE in this distribution or at |
---|
9 | * http://www.OARcorp.com/rtems/license.html. |
---|
10 | * |
---|
11 | * $Id$ |
---|
12 | */ |
---|
13 | |
---|
14 | #include <bsp.h> |
---|
15 | |
---|
16 | #include <libchip/serial.h> |
---|
17 | #include <libchip/mc68681.h> |
---|
18 | |
---|
19 | /* |
---|
20 | * Fix these for the simulator |
---|
21 | */ |
---|
22 | |
---|
23 | #define MC68681_PORT_CONFIG MC68681_XBRG_IGNORED |
---|
24 | #define MC68681_PROBE libchip_serial_default_probe |
---|
25 | #define MC68681_VECTOR 0 |
---|
26 | #define MC68681_BASE_ADDRESS 0x71001 |
---|
27 | #define MC68681_DATA_ADDRESS 0x71007 |
---|
28 | |
---|
29 | /* |
---|
30 | * Based on BSP configuration information decide whether to do polling IO |
---|
31 | * or interrupt driven IO. |
---|
32 | */ |
---|
33 | |
---|
34 | #if (CONSOLE_USE_INTERRUPTS) |
---|
35 | #define MC68681_FUNCTIONS &mc68681_fns |
---|
36 | #else |
---|
37 | #define MC68681_FUNCTIONS &mc68681_fns_polled |
---|
38 | #endif |
---|
39 | |
---|
40 | |
---|
41 | |
---|
42 | console_tbl Console_Port_Tbl[] = { |
---|
43 | { |
---|
44 | "/dev/com0", /* sDeviceName */ |
---|
45 | SERIAL_MC68681, /* deviceType */ |
---|
46 | MC68681_FUNCTIONS, /* pDeviceFns */ |
---|
47 | NULL, /* deviceProbe */ |
---|
48 | NULL, /* pDeviceFlow */ |
---|
49 | 16, /* ulMargin */ |
---|
50 | 8, /* ulHysteresis */ |
---|
51 | (void *)9600, /* baud rate */ /* pDeviceParams */ |
---|
52 | MC68681_BASE_ADDRESS, /* ulCtrlPort1 */ |
---|
53 | MC68681_BASE_ADDRESS, /* ulCtrlPort2 */ |
---|
54 | MC68681_DATA_ADDRESS, /* ulDataPort */ |
---|
55 | mc68681_get_register_2, /* getRegister */ |
---|
56 | mc68681_set_register_2, /* setRegister */ |
---|
57 | NULL, /* unused */ /* getData */ |
---|
58 | NULL, /* unused */ /* setData */ |
---|
59 | mc68681_baud_rate_table, /* ulClock */ |
---|
60 | MC68681_VECTOR /* ulIntVector */ |
---|
61 | } |
---|
62 | }; |
---|
63 | |
---|
64 | /* |
---|
65 | * Declare some information used by the console driver |
---|
66 | */ |
---|
67 | |
---|
68 | #define NUM_CONSOLE_PORTS (sizeof(Console_Port_Tbl)/sizeof(console_tbl)) |
---|
69 | |
---|
70 | unsigned long Console_Port_Count = NUM_CONSOLE_PORTS; |
---|
71 | |
---|
72 | console_data Console_Port_Data[NUM_CONSOLE_PORTS]; |
---|
73 | |
---|
74 | rtems_device_minor_number Console_Port_Minor; |
---|