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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [c/] [src/] [lib/] [libbsp/] [sh/] [gensh2/] [console/] [config.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*
2
 * This file contains the TTY driver table. The implementation is
3
 * based on libchip/serial drivers, but it uses internal SHx SCI so
4
 * the implementation of the driver is placed in
5
 * lib/libcpu/sh/sh7045/sci instead of libchip/serial.
6
 *
7
 *  COPYRIGHT (c) 1989-2001.
8
 *  On-Line Applications Research Corporation (OAR).
9
 *
10
 *  The license and distribution terms for this file may be
11
 *  found in the file LICENSE in this distribution or at
12
 *  http://www.OARcorp.com/rtems/license.html.
13
 *
14
 * config.c,v 1.1 2001/08/16 21:49:11 joel Exp
15
 *
16
 */
17
 
18
#include <bsp.h>
19
#include <libchip/serial.h>
20
#include <libchip/sersupp.h>
21
#include <sh/sci_termios.h>
22
#include <rtems/score/sh_io.h>
23
#include <rtems/score/ispsh7045.h>
24
#include <rtems/score/iosh7045.h>
25
#include <rtems/termiostypes.h>
26
 
27
 
28
/*
29
 * Function set for interrupt enabled termios console
30
 */
31
console_fns sh_sci_fns =
32
{
33
    libchip_serial_default_probe, /* deviceProbe */
34
    sh_sci_first_open,            /* deviceFirstOpen */
35
    NULL,                         /* deviceLastClose */
36
    NULL,                         /* deviceRead */
37
    sh_sci_write_support_int,     /* deviceWrite */
38
    sh_sci_initialize_interrupts, /* deviceInitialize */
39
    sh_sci_write_polled,          /* deviceWritePolled */
40
    sh_sci_set_attributes,        /* deviceSetAttributes */
41
    TERMIOS_IRQ_DRIVEN           /* deviceOutputUsesInterrupts */
42
};
43
 
44
/*
45
 * Function set for polled termios console
46
 */
47
console_fns sh_sci_fns_polled =
48
{
49
    libchip_serial_default_probe, /* deviceProbe */
50
    sh_sci_first_open,            /* deviceFirstOpen */
51
    sh_sci_last_close,            /* deviceLastClose */
52
    sh_sci_inbyte_nonblocking_polled, /* deviceRead */
53
    sh_sci_write_support_polled,  /* deviceWrite */
54
    sh_sci_init,                  /* deviceInitialize */
55
    sh_sci_write_polled,          /* deviceWritePolled */
56
    sh_sci_set_attributes,        /* deviceSetAttributes */
57
    TERMIOS_POLLED                /* deviceOutputUsesInterrupts */
58
};
59
 
60
#if 1 /* (CONSOLE_USE_INTERRUPTS) */
61
#define SCI_FUNCTIONS &sh_sci_fns
62
#else
63
#define SCI_FUNCTIONS &sh_sci_fns_polled
64
#endif
65
 
66
static const struct termios term1 = {
67
    0,
68
    0,
69
    B9600 | CS8,
70
    0,
71
    0,
72
    { 0 }
73
};
74
 
75
 
76
static const struct termios term2 = {
77
    0,
78
    0,
79
    B115200 | CS8,
80
    0,
81
    0,
82
    { 0 }
83
};
84
 
85
 
86
console_tbl     Console_Port_Tbl[] = {
87
    {
88
        "/dev/sci0",            /* sDeviceName */
89
        SERIAL_CUSTOM,          /* deviceType */
90
        SCI_FUNCTIONS,          /* pDeviceFns */
91
        NULL,                   /* deviceProbe */
92
        NULL,                   /* pDeviceFlow */
93
        16,                     /* ulMargin */
94
        8,                      /* ulHysteresis */
95
        (void *)&term1,         /* baud rate */    /* pDeviceParams */
96
        SCI_SMR0,               /* ulCtrlPort1 */
97
        3,                      /* ulCtrlPort2 as IRQ priority level*/
98
        TXI0_ISP_V,             /* ulDataPort as TX end vector number*/
99
        NULL,                   /* unused */       /* getRegister */
100
        NULL,                   /* unused */       /* setRegister */
101
        NULL,                   /* unused */       /* getData */
102
        NULL,                   /* unused */       /* setData */
103
        0,                      /* ulClock */
104
        RXI0_ISP_V,             /* ulIntVector as RX end vector number*/
105
    },
106
    {
107
        "/dev/sci1",            /* sDeviceName */
108
        SERIAL_CUSTOM,          /* deviceType */
109
        SCI_FUNCTIONS,          /* pDeviceFns */
110
        NULL,                   /* deviceProbe */
111
        NULL,                   /* pDeviceFlow */
112
        16,                     /* ulMargin */
113
        8,                      /* ulHysteresis */
114
        (void *)&term2,         /* baud rate */    /* pDeviceParams */
115
        SCI_SMR1,               /* ulCtrlPort1 */
116
        3,                      /* ulCtrlPort2 as IRQ priority level*/
117
        TXI1_ISP_V,             /* ulDataPort as TX end vector number*/
118
        NULL,                   /* unused */       /* getRegister */
119
        NULL,                   /* unused */       /* setRegister */
120
        NULL,                   /* unused */       /* getData */
121
        NULL,                   /* unused */       /* setData */
122
        0,                      /* ulClock */
123
        RXI1_ISP_V,             /* ulIntVector as RX end vector number*/
124
    }
125
};
126
 
127
/*
128
 *  Declare some information used by the console driver
129
 */
130
 
131
#define NUM_CONSOLE_PORTS (sizeof(Console_Port_Tbl)/sizeof(console_tbl))
132
 
133
unsigned long  Console_Port_Count =  NUM_CONSOLE_PORTS;
134
 
135
console_data  Console_Port_Data[NUM_CONSOLE_PORTS];
136
 
137
rtems_device_minor_number  Console_Port_Minor;

powered by: WebSVN 2.1.0

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