1
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
3
File: oct6100_rpc_protocol.h
5
Copyright (c) 2001-2007 Octasic Inc.
9
File containing all defines and prototypes related to the OCT6100 RPC
10
protocol for exchanging debug commands.
12
This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is
13
free software; you can redistribute it and/or modify it under the terms of
14
the GNU General Public License as published by the Free Software Foundation;
15
either version 2 of the License, or (at your option) any later version.
17
The OCT6100 GPL API is distributed in the hope that it will be useful, but
18
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22
You should have received a copy of the GNU General Public License
23
along with the OCT6100 GPL API; if not, write to the Free Software
24
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
26
$Octasic_Release: OCT612xAPI-01.00-PR49 $
28
$Octasic_Revision: 6 $
30
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
32
#ifndef __OCT6100_RPC_PROTOCOL_H__
33
#define __OCT6100_RPC_PROTOCOL_H__
35
/***************************** DEFINES *************************************/
37
#define cOCTRPC_INTERFACE_VERSION 0x00010002
39
/* Octasic commands. */
40
#define cOCT6100_RPC_CHIP_LIST 0xFF000000
41
#define cOCT6100_RPC_CHIP_CHOICE 0xFF000001
42
#define cOCT6100_RPC_ENV_DISCONNECT 0xFF000002
46
#define cOCT6100_RPC_READ_WORD 0x00000000
47
#define cOCT6100_RPC_READ_BURST 0x00000001
48
#define cOCT6100_RPC_READ_DEBUG 0x00000002
49
#define cOCT6100_RPC_READ_ARRAY 0x00000003
50
#define cOCT6100_RPC_API_DISCONNECT 0x00000004
53
#define cOCT6100_RPC_WRITE_WORD 0x00000010
54
#define cOCT6100_RPC_WRITE_BURST 0x00000011
55
#define cOCT6100_RPC_WRITE_SMEAR 0x00000012
56
#define cOCT6100_RPC_WRITE_INC 0x00000013
59
#define cOCT6100_RPC_SET_HOT_CHANNEL 0x00000014
60
#define cOCT6100_RPC_GET_DEBUG_CHAN_INDEX 0x00000015
62
#define cOCTRPC_UNKNOWN_COMMAND_NUM 0xFFFFFFFF
65
#define cOCT6100_RPCERR_OK 0x00000000
66
#define cOCT6100_RPCERR_INVALID_COMMAND_NUMBER 0x00000001
67
#define cOCT6100_RPCERR_INVALID_COMMAND_PAYLOAD 0x00000002
68
#define cOCT6100_RPCERR_INVALID_COMMAND_LENGTH 0x00000003
71
/***************************** TYPES ***************************************/
73
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
75
Structure: OCT6100_RPC_READ_WORD
77
Description: Command structure for the read of one word.
79
-------------------------------------------------------------------------------
80
| Member | Description
81
-------------------------------------------------------------------------------
82
IN ulAddress Address at which to read.
83
OUT ulReadData The word read, returned.
85
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
86
typedef struct _OCT6100_RPC_READ_WORD_
89
UINT32 OUT ulReadData;
91
} tOCT6100_RPC_READ_WORD, *tPOCT6100_RPC_READ_WORD;
94
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
96
Structure: OCT6100_RPC_READ_BURST
98
Description: Command structure for a read burst. The burst starts at the
99
given address and reads the specified number of consecutive
102
Whereas every command structure uses a complete dword for every
103
member, irrespective of the size of data unit needed, this
104
structure does not do so for the read data. To save bandwidth
105
the read data words are returned two per dword.
107
Example packet: 31 16 15 0
108
-------------------------------------------
109
| ulAddress = 0x100 |
110
-------------------------------------------
111
| ulBurstLength = 0x3 |
112
-------------------------------------------
113
aulReadData -> | D0 | D1 |
114
-------------------------------------------
116
-------------------------------------------
118
Dy is the read data at ulAddress + 2 * y.
120
-------------------------------------------------------------------------------
121
| Member | Description
122
-------------------------------------------------------------------------------
123
IN ulAddress Address at which to read.
124
IN ulBurstLength The number of consecutive words to be read.
125
OUT aulReadData The read data returned. The dwords of the structure
126
starting at this address are arranged as indicated in
127
the example packet above.
129
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
130
typedef struct _OCT6100_RPC_READ_BURST_
133
UINT32 IN ulBurstLength;
134
UINT32 OUT aulReadData[ 1 ];
136
} tOCT6100_RPC_READ_BURST, *tPOCT6100_RPC_READ_BURST;
140
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
142
Structure: OCT6100_RPC_READ_ARRAY
144
Description: Command structure for a variable number of reads. The reads do
145
not have to be at contiguous addresses.
147
Whereas every command structure uses a complete dword for every
148
member, irrespective of the size of data unit needed, this
149
structure does not do so for the read data. To save bandwidth
150
the read data words are returned two per dword, and the
151
parity bits are returned 16 per dword (two parity bits per read
154
Example packet: 31 16 15 0
155
-------------------------------------------
156
| ulArrayLength = 0x3 |
157
-------------------------------------------
158
aulArrayData ->| A0 |
159
-------------------------------------------
161
-------------------------------------------
163
-------------------------------------------
165
-------------------------------------------
167
-------------------------------------------
169
Ay is the address for access y.
170
Dy is the read data at Ay.
172
-------------------------------------------------------------------------------
173
| Member | Description
174
-------------------------------------------------------------------------------
175
IN ulArrayLength Number of reads to do.
176
IN OUT aulArrayData The addresses at which to read (IN) and the read data
177
returned (OUT). The dwords of the command structure
178
starting at this address are arranged as indicated in
179
the example packet above.
181
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
182
typedef struct _OCT6100_RPC_READ_ARRAY
184
UINT32 IN ulArrayLength;
185
UINT32 IN OUT aulArrayData[ 1 ];
187
} tOCT6100_RPC_READ_ARRAY, *tPOCT6100_RPC_READ_ARRAY;
190
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
192
Structure: OCT6100_RPC_WRITE_WORD
194
Description: Command structure for the write of one word.
196
-------------------------------------------------------------------------------
197
| Member | Description
198
-------------------------------------------------------------------------------
199
IN ulAddress Address at which to write.
200
IN ulWriteData The word to write.
202
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
203
typedef struct _OCT6100_RPC_WRITE_WORD_
207
UINT32 IN ulWriteData;
209
} tOCT6100_RPC_WRITE_WORD, *tPOCT6100_RPC_WRITE_WORD;
212
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
214
Structure: OCT6100_RPC_WRITE_SMEAR
216
Description: Command structure for the write of one word at one or many
217
consecutive addresses.
219
-------------------------------------------------------------------------------
220
| Member | Description
221
-------------------------------------------------------------------------------
222
IN ulAddress Address of first write.
223
IN ulSmearLength Number of consecutive addresses to write.
224
IN ulWriteData The word to write at each address.
226
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
227
typedef struct _OCT6100_RPC_WRITE_SMEAR_
230
UINT32 IN ulSmearLength;
232
UINT32 IN ulWriteData;
234
} tOCT6100_RPC_WRITE_SMEAR, *tPOCT6100_RPC_WRITE_SMEAR;
237
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
239
Structure: OCT6100_RPC_WRITE_INC
241
Description: Command structure for the write of an incremental pattern at
242
one or many consecutive addresses.
244
-------------------------------------------------------------------------------
245
| Member | Description
246
-------------------------------------------------------------------------------
247
IN ulAddress Address of first write.
248
IN ulIncLength Number of consecutive addresses to write.
249
IN ulWriteData The first word of the incremental pattern. For each
250
consecutive write the word will be incremented by 1.
252
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
253
typedef struct _OCT6100_RPC_WRITE_INC_
256
UINT32 IN ulIncLength;
258
UINT32 IN ulWriteData;
260
} tOCT6100_RPC_WRITE_INC, *tPOCT6100_RPC_WRITE_INC;
263
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
265
Structure: OCT6100_RPC_WRITE_BURST
267
Description: Command structure for a write burst. The burst starts at the
268
given address and writes a given word for each address.
270
Whereas every command structure uses a complete dword for every
271
member, irrespective of the size of data unit needed, this
272
structure does not do so for the write data. To save bandwidth
273
the write data words are sent two per dword.
275
Example packet: 31 16 15 0
276
-------------------------------------------
277
| ulAddress = 0x100 |
278
-------------------------------------------
279
| ulBurstLength = 0x3 |
280
-------------------------------------------
281
aulWriteData ->| D0 | D1 |
282
-------------------------------------------
284
-------------------------------------------
286
Dy is the write data for ulAddress + 2 * y.
288
-------------------------------------------------------------------------------
289
| Member | Description
290
-------------------------------------------------------------------------------
291
IN ulAddress First address at which to write.
292
IN ulBurstLength The number of consecutive addresses to be write.
293
IN aulWriteData The write data words. The dwords of the structure
294
starting at this address are arranged as indicated in
295
the example packet above.
297
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
298
typedef struct _OCT6100_RPC_WRITE_BURST_
301
UINT32 IN ulBurstLength;
303
UINT32 IN aulWriteData[ 1 ];
305
} tOCT6100_RPC_WRITE_BURST, *tPOCT6100_RPC_WRITE_BURST;
309
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
311
Structure: OCT6100_RPC_SET_HOT_CHANNEL
313
Description: Command structure to set the hot channel.
315
-------------------------------------------------------------------------------
316
| Member | Description
317
-------------------------------------------------------------------------------
318
IN ulDebugChannel Index of the channel to debug.
320
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
321
typedef struct _OCT6100_RPC_SET_HOT_CHANNEL_
323
UINT32 IN ulHotChannel;
326
} tOCT6100_RPC_SET_HOT_CHANNEL, *tPOCT6100_RPC_SET_HOT_CHANNEL;
330
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
332
Structure: OCT6100_RPC_GET_DEBUG_CHAN_INDEX
334
Description: Command structure to get the debug channel index used by the API.
336
-------------------------------------------------------------------------------
337
| Member | Description
338
-------------------------------------------------------------------------------
339
IN ulDebugChannel Index of the channel to debug.
341
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
342
typedef struct _OCT6100_RPC_GET_DEBUG_CHAN_INDEX_
344
UINT32 OUT ulDebugChanIndex;
346
} tOCT6100_RPC_GET_DEBUG_CHAN_INDEX, *tPOCT6100_RPC_GET_DEBUG_CHAN_INDEX;
348
#endif /* __OCT6100_RPC_PROTOCOL_H__ */