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