source: rtems/c/src/lib/libbsp/mips/genmongoosev/console/conscfg.c @ b93ca7c

4.104.115
Last change on this file since b93ca7c was b93ca7c, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/14/10 at 08:59:02

Include <unistd.h>.

  • Property mode set to 100644
File size: 3.4 KB
RevLine 
[f849f3e]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
[e00bf285]11 *  http://www.rtems.com/license/LICENSE.
[f849f3e]12 *
13 *  $Id$
14 */
15
[b93ca7c]16#include <unistd.h> /* write */
17
[6128a4a]18#include <bsp.h>
19
[f849f3e]20#include <libchip/serial.h>
21#include <libchip/mg5uart.h>
22
[a355e3ea]23/* #define CONSOLE_USE_INTERRUPTS */
24
25#ifdef CONSOLE_USE_INTERRUPTS
[f849f3e]26#define MG5UART_FUNCTIONS &mg5uart_fns
27#else
28#define MG5UART_FUNCTIONS &mg5uart_fns_polled
29#endif
30
31console_tbl     Console_Port_Tbl[] = {
32{
[a9d8649]33  "/dev/com0",                             /* sDeviceName */
[f849f3e]34   SERIAL_MG5UART,                         /* deviceType */
35   MG5UART_FUNCTIONS,                      /* pDeviceFns */
36   NULL,                                   /* deviceProbe, assume it is there */
37   NULL,                                   /* pDeviceFlow */
38   16,                                     /* ulMargin */
39   8,                                      /* ulHysteresis */
40   (void *) NULL,               /* NULL */ /* pDeviceParams */
41   MONGOOSEV_PERIPHERAL_COMMAND_REGISTER,  /* ulCtrlPort1 */
42   MONGOOSEV_UART0_BASE,                   /* ulCtrlPort2 */
43   MG5UART_UART0,                          /* ulDataPort */
44   NULL,                                   /* getRegister */
45   NULL,                                   /* setRegister */
46   NULL, /* unused */                      /* getData */
47   NULL, /* unused */                      /* setData */
48   CLOCK_RATE,                             /* ulClock */
49   MONGOOSEV_IRQ_UART0_RX_FRAME_ERROR      /* ulIntVector -- base for port */
[a9d8649]50},
51{
52  "/dev/com1",                             /* sDeviceName */
53   SERIAL_MG5UART,                         /* deviceType */
54   MG5UART_FUNCTIONS,                      /* pDeviceFns */
55   NULL,                                   /* deviceProbe, assume it is there */
56   NULL,                                   /* pDeviceFlow */
57   16,                                     /* ulMargin */
58   8,                                      /* ulHysteresis */
59   (void *) NULL,               /* NULL */ /* pDeviceParams */
60   MONGOOSEV_PERIPHERAL_COMMAND_REGISTER,  /* ulCtrlPort1 */
61   MONGOOSEV_UART1_BASE,                   /* ulCtrlPort2 */
62   MG5UART_UART1,                          /* ulDataPort */
63   NULL,                                   /* getRegister */
64   NULL,                                   /* setRegister */
65   NULL, /* unused */                      /* getData */
66   NULL, /* unused */                      /* setData */
67   CLOCK_RATE,                             /* ulClock */
68   MONGOOSEV_IRQ_UART1_RX_FRAME_ERROR      /* ulIntVector -- base for port */
69},
[f849f3e]70};
71
72/*
73 *  Declare some information used by the console driver
74 */
75
76#define NUM_CONSOLE_PORTS (sizeof(Console_Port_Tbl)/sizeof(console_tbl))
77
78unsigned long  Console_Port_Count = NUM_CONSOLE_PORTS;
79
80console_data  Console_Port_Data[NUM_CONSOLE_PORTS];
81
82rtems_device_minor_number  Console_Port_Minor;
83
84/*
85 *  printk() support that simply routes printk to stderr
86 */
87
[eb24fb1]88#include <rtems/bspIo.h>
[f849f3e]89
90void GENMG5_output_char(char c) { write( 2, &c, 1 ); }
[6128a4a]91
[f849f3e]92BSP_output_char_function_type           BSP_output_char = GENMG5_output_char;
93BSP_polling_getchar_function_type       BSP_poll_char = NULL;
Note: See TracBrowser for help on using the repository browser.