summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/score603e/console/tbl85c30.c
blob: e354c53526dc37f5a7c92112e55e8d2909ca0909 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
 /*
 *  This file contains the table for the z85c30 port 
 *  used by the console driver.
 *
 *  COPYRIGHT (c) 1989-1997.
 *  On-Line Applications Research Corporation (OAR).
 *  Copyright assigned to U.S. Government, 1994.
 *
 *  The license and distribution terms for this file may be
 *  found in the file LICENSE in this distribution or at
 *  http://www.OARcorp.com/rtems/license.html.
 *
 *  $Id: 
 */

#include "consolebsp.h"
#include <bsp.h>

#define CONSOLE_DEFAULT_BAUD_RATE            9600
#define CONSOLE_DEFAULT_BAUD_CONSTANT        Score603e_Z8530_Chip0_Baud(9600)
                                             
#define CONSOLE_DEFAULT_STOP_BITS            CONSOLE_STOP_BITS_1    
#define CONSOLE_DEFAULT_PARITY               CONSOLE_PARITY_NONE          
#define CONSOLE_DEFAULT_READ_CHARACTER_BITS  CONSOLE_CHARACTER_BITS_8
#define CONSOLE_DEFAULT_WRITE_CHARACTER_BITS CONSOLE_CHARACTER_BITS_8
#define CONSOLE_DEFAULT_CONSOLE_CLOCK        CONSOLE_x16_CLOCK


#define DEFAULT_PROTOCOL  { CONSOLE_DEFAULT_BAUD_RATE,              \
                            CONSOLE_DEFAULT_STOP_BITS,              \
                            CONSOLE_DEFAULT_PARITY,                 \
                            CONSOLE_DEFAULT_READ_CHARACTER_BITS,    \
                            CONSOLE_DEFAULT_WRITE_CHARACTER_BITS }

/*
 * Tables of information necessary to use the console 85c30 routines.
 */
Console_Protocol Protocols_85c30 [ NUM_Z85C30_PORTS ] = 
{
  DEFAULT_PROTOCOL,
  DEFAULT_PROTOCOL,
  DEFAULT_PROTOCOL,
  DEFAULT_PROTOCOL,

#if (HAS_PMC_PSC8)
  DEFAULT_PROTOCOL,
  DEFAULT_PROTOCOL,
  DEFAULT_PROTOCOL,
  DEFAULT_PROTOCOL,
  DEFAULT_PROTOCOL,
  DEFAULT_PROTOCOL,
  DEFAULT_PROTOCOL,
  DEFAULT_PROTOCOL,
#endif
};

/*
 * Table of chip unique information for each chip.
 * See consolebsp.h for the Chip_85C30_info structure defination.
 */
Chip_85C30_info Chips_85C30 [ NUM_Z85C30_CHIPS ] =
{
  {
    SCORE603E_85C30_0_IRQ,
    SCORE603E_85C30_0_CLOCK,
    SCORE603E_85C30_0_CLOCK_X,
    CONSOLE_DEFAULT_CONSOLE_CLOCK
  }, 
  { 
    SCORE603E_85C30_1_IRQ,
    SCORE603E_85C30_1_CLOCK,
    SCORE603E_85C30_1_CLOCK_X,
    CONSOLE_DEFAULT_CONSOLE_CLOCK
  },

#if (HAS_PMC_PSC8)
  { 
    SCORE603E_85C30_2_IRQ,
    SCORE603E_85C30_2_CLOCK,
    SCORE603E_85C30_2_CLOCK_X,
    CONSOLE_DEFAULT_CONSOLE_CLOCK
  },
  { 
    SCORE603E_85C30_3_IRQ,
    SCORE603E_85C30_3_CLOCK,
    SCORE603E_85C30_3_CLOCK_X,
    CONSOLE_DEFAULT_CONSOLE_CLOCK
  },
  { 
    SCORE603E_85C30_4_IRQ,
    SCORE603E_85C30_4_CLOCK,
    SCORE603E_85C30_4_CLOCK_X,
    CONSOLE_DEFAULT_CONSOLE_CLOCK
  },
  { 
    SCORE603E_85C30_5_IRQ,
    SCORE603E_85C30_5_CLOCK,
    SCORE603E_85C30_5_CLOCK_X,
    CONSOLE_DEFAULT_CONSOLE_CLOCK
  },
#endif

};

/*
 * Table of port unique information for each port.
 * See consolebsp.h for the Port_85C30_info structure defination.
 */
const Port_85C30_info Ports_85C30 [ NUM_Z85C30_PORTS ] = {
  { 
    (volatile unsigned char *) SCORE603E_85C30_CTRL_0,  
    (volatile unsigned char *) SCORE603E_85C30_DATA_0,
    0x00,
    &Protocols_85c30[0],
    &Chips_85C30[0], 
  },
  {  
    (volatile unsigned char *) SCORE603E_85C30_CTRL_1,  
    (volatile unsigned char *) SCORE603E_85C30_DATA_1, 
    0x01,
    &Protocols_85c30[1],
    &Chips_85C30[0], 
  },
  {  
    (volatile unsigned char *) SCORE603E_85C30_CTRL_2,  
    (volatile unsigned char *) SCORE603E_85C30_DATA_2,
    0x02,
    &Protocols_85c30[2],
    &Chips_85C30[1], 
  },
  {  
    (volatile unsigned char *) SCORE603E_85C30_CTRL_3, 
    (volatile unsigned char *) SCORE603E_85C30_DATA_3,
    0x03,
    &Protocols_85c30[3],
    &Chips_85C30[1], 
 },

#if (HAS_PMC_PSC8)
  {  
    (volatile unsigned char *) SCORE603E_85C30_CTRL_4, 
    (volatile unsigned char *) SCORE603E_85C30_DATA_4,
    0x04,
    &Protocols_85c30[4],
    &Chips_85C30[2], 
 },
 {  
    (volatile unsigned char *) SCORE603E_85C30_CTRL_5, 
    (volatile unsigned char *) SCORE603E_85C30_DATA_5,
    0x05,
    &Protocols_85c30[5],
    &Chips_85C30[2], 
 },
 {  
    (volatile unsigned char *) SCORE603E_85C30_CTRL_6, 
    (volatile unsigned char *) SCORE603E_85C30_DATA_6,
    0x06,
    &Protocols_85c30[6],
    &Chips_85C30[3], 
 },
 {  
    (volatile unsigned char *) SCORE603E_85C30_CTRL_7, 
    (volatile unsigned char *) SCORE603E_85C30_DATA_7,
    0x07,
    &Protocols_85c30[7],
    &Chips_85C30[3], 
 },
 {  
    (volatile unsigned char *) SCORE603E_85C30_CTRL_8, 
    (volatile unsigned char *) SCORE603E_85C30_DATA_8,
    0x08,
    &Protocols_85c30[8],
    &Chips_85C30[4], 
 },
 {  
    (volatile unsigned char *) SCORE603E_85C30_CTRL_9, 
    (volatile unsigned char *) SCORE603E_85C30_DATA_9,
    0x09,
    &Protocols_85c30[9],
    &Chips_85C30[4], 
 },
 {  
    (volatile unsigned char *) SCORE603E_85C30_CTRL_10, 
    (volatile unsigned char *) SCORE603E_85C30_DATA_10,
    0x0a,
    &Protocols_85c30[10],
    &Chips_85C30[5], 
 },
 {  
    (volatile unsigned char *) SCORE603E_85C30_CTRL_11, 
    (volatile unsigned char *) SCORE603E_85C30_DATA_11,
    0x0b,
    &Protocols_85c30[11],
    &Chips_85C30[5], 
 },
#endif
};