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

Last change on this file since 63defa58 was 63defa58, checked in by Jennifer Averett <jennifer.averett@…>, on 04/04/12 at 13:39:46

PR 1993 - Convert MIPS to PIC IRQ model

  • Property mode set to 100644
File size: 3.4 KB
Line 
1/**
2 *  @file
3 * 
4 *  This file contains the libchip configuration information
5 *  to instantiate the libchip driver for the on-CPU DUART
6 *  and any other serial ports in the system.
7 */
8
9/*
10 *  COPYRIGHT (c) 1989-2012.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.com/license/LICENSE.
16 *
17 *  $Id$
18 */
19
20#include <unistd.h> /* write */
21
22#include <bsp.h>
23#include <bsp/irq.h>
24
25#include <libchip/serial.h>
26#include <libchip/mg5uart.h>
27
28/* #define CONSOLE_USE_INTERRUPTS */
29
30#ifdef CONSOLE_USE_INTERRUPTS
31#define MG5UART_FUNCTIONS &mg5uart_fns
32#else
33#define MG5UART_FUNCTIONS &mg5uart_fns_polled
34#endif
35
36console_tbl     Console_Configuration_Ports[] = {
37{
38  "/dev/com0",                             /* sDeviceName */
39   SERIAL_MG5UART,                         /* deviceType */
40   MG5UART_FUNCTIONS,                      /* pDeviceFns */
41   NULL,                                   /* deviceProbe, assume it is there */
42   NULL,                                   /* pDeviceFlow */
43   16,                                     /* ulMargin */
44   8,                                      /* ulHysteresis */
45   (void *) NULL,               /* NULL */ /* pDeviceParams */
46   MONGOOSEV_PERIPHERAL_COMMAND_REGISTER,  /* ulCtrlPort1 */
47   MONGOOSEV_UART0_BASE,                   /* ulCtrlPort2 */
48   MG5UART_UART0,                          /* ulDataPort */
49   NULL,                                   /* getRegister */
50   NULL,                                   /* setRegister */
51   NULL, /* unused */                      /* getData */
52   NULL, /* unused */                      /* setData */
53   CLOCK_RATE,                             /* ulClock */
54   MONGOOSEV_IRQ_UART0_RX_FRAME_ERROR      /* ulIntVector -- base for port */
55},
56{
57  "/dev/com1",                             /* sDeviceName */
58   SERIAL_MG5UART,                         /* deviceType */
59   MG5UART_FUNCTIONS,                      /* pDeviceFns */
60   NULL,                                   /* deviceProbe, assume it is there */
61   NULL,                                   /* pDeviceFlow */
62   16,                                     /* ulMargin */
63   8,                                      /* ulHysteresis */
64   (void *) NULL,               /* NULL */ /* pDeviceParams */
65   MONGOOSEV_PERIPHERAL_COMMAND_REGISTER,  /* ulCtrlPort1 */
66   MONGOOSEV_UART1_BASE,                   /* ulCtrlPort2 */
67   MG5UART_UART1,                          /* ulDataPort */
68   NULL,                                   /* getRegister */
69   NULL,                                   /* setRegister */
70   NULL, /* unused */                      /* getData */
71   NULL, /* unused */                      /* setData */
72   CLOCK_RATE,                             /* ulClock */
73   MONGOOSEV_IRQ_UART1_RX_FRAME_ERROR      /* ulIntVector -- base for port */
74},
75};
76
77/*
78 *  Declare some information used by the console driver
79 */
80
81#define NUM_CONSOLE_PORTS (sizeof(Console_Configuration_Ports)/sizeof(console_tbl))
82
83unsigned long  Console_Configuration_Count = NUM_CONSOLE_PORTS;
84
85/*
86 *  printk() support that simply routes printk to stderr
87 */
88
89#include <rtems/bspIo.h>
90
91void GENMG5_output_char(char c) { write( 2, &c, 1 ); }
92
93BSP_output_char_function_type           BSP_output_char = GENMG5_output_char;
94BSP_polling_getchar_function_type       BSP_poll_char = NULL;
Note: See TracBrowser for help on using the repository browser.