OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [c/] [src/] [lib/] [libbsp/] [mips/] [genmongoosev/] [console/] [conscfg.c] - Blame information for rev 1026

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*
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
 *  conscfg.c,v 1.5 2002/01/04 17:40:46 joel Exp
14
 */
15
 
16
#include <bsp.h> 
17
 
18
#include <libchip/serial.h>
19
#include <libchip/mg5uart.h>
20
 
21
/* #define CONSOLE_USE_INTERRUPTS */
22
 
23
#ifdef CONSOLE_USE_INTERRUPTS
24
#define MG5UART_FUNCTIONS &mg5uart_fns
25
#else
26
#define MG5UART_FUNCTIONS &mg5uart_fns_polled
27
#endif
28
 
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
  "/dev/com1",                             /* sDeviceName */
52
   SERIAL_MG5UART,                         /* deviceType */
53
   MG5UART_FUNCTIONS,                      /* pDeviceFns */
54
   NULL,                                   /* deviceProbe, assume it is there */
55
   NULL,                                   /* pDeviceFlow */
56
   16,                                     /* ulMargin */
57
   8,                                      /* ulHysteresis */
58
   (void *) NULL,               /* NULL */ /* pDeviceParams */
59
   MONGOOSEV_PERIPHERAL_COMMAND_REGISTER,  /* ulCtrlPort1 */
60
   MONGOOSEV_UART1_BASE,                   /* ulCtrlPort2 */
61
   MG5UART_UART1,                          /* ulDataPort */
62
   NULL,                                   /* getRegister */
63
   NULL,                                   /* setRegister */
64
   NULL, /* unused */                      /* getData */
65
   NULL, /* unused */                      /* setData */
66
   CLOCK_RATE,                             /* ulClock */
67
   MONGOOSEV_IRQ_UART1_RX_FRAME_ERROR      /* ulIntVector -- base for port */
68
},
69
};
70
 
71
/*
72
 *  Declare some information used by the console driver
73
 */
74
 
75
#define NUM_CONSOLE_PORTS (sizeof(Console_Port_Tbl)/sizeof(console_tbl))
76
 
77
unsigned long  Console_Port_Count = NUM_CONSOLE_PORTS;
78
 
79
console_data  Console_Port_Data[NUM_CONSOLE_PORTS];
80
 
81
rtems_device_minor_number  Console_Port_Minor;
82
 
83
 
84
/*
85
 *  printk() support that simply routes printk to stderr
86
 */
87
 
88
#include <rtems/bspIo.h>
89
 
90
void GENMG5_output_char(char c) { write( 2, &c, 1 ); }
91
 
92
BSP_output_char_function_type           BSP_output_char = GENMG5_output_char;
93
BSP_polling_getchar_function_type       BSP_poll_char = NULL;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.