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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [jtag/] [gdb.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 435 simons
/* config.h -- Simulator configuration header file
2
   Copyright (C) 2001 Chris Ziomkowski, chris@asics.ws
3
 
4
   This file is part of OpenRISC 1000 Architectural Simulator.
5
 
6
   This program is free software; you can redistribute it and/or modify
7
   it under the terms of the GNU General Public License as published by
8
   the Free Software Foundation; either version 2 of the License, or
9
   (at your option) any later version.
10
 
11
   This program is distributed in the hope that it will be useful,
12
   but WITHOUT ANY WARRANTY; without even the implied warranty of
13
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
   GNU General Public License for more details.
15
 
16
   You should have received a copy of the GNU General Public License
17
   along with this program; if not, write to the Free Software
18
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
19
 
20
#ifndef GDB_H
21
#define GDB_H
22
 
23
#include <sys/types.h>
24
#include <inttypes.h>
25
 
26
/* Possible errors are listed here.  */
27
enum enum_errors  /* modified <chris@asics.ws> CZ 24/05/01 */
28
{
29
  /* Codes > 0 are for system errors */
30
 
31
  ERR_NONE = 0,
32
  ERR_CRC = -1,
33
  ERR_MEM = -2,
34
  JTAG_PROXY_INVALID_COMMAND = -3,
35
  JTAG_PROXY_SERVER_TERMINATED = -4,
36
  JTAG_PROXY_NO_CONNECTION = -5,
37
  JTAG_PROXY_PROTOCOL_ERROR = -6,
38
  JTAG_PROXY_COMMAND_NOT_IMPLEMENTED = -7,
39
  JTAG_PROXY_INVALID_CHAIN = -8,
40
  JTAG_PROXY_INVALID_ADDRESS = -9,
41
  JTAG_PROXY_ACCESS_EXCEPTION = -10, /* Write to ROM */
42
  JTAG_PROXY_INVALID_LENGTH = -11,
43
  JTAG_PROXY_OUT_OF_MEMORY = -12,
44
};
45
 
46
/* All JTAG chains.  */
47
enum jtag_chains
48
  {
49
    SC_GLOBAL,      /* 0 Global BS Chain */
50
    SC_RISC_DEBUG,  /* 1 RISC Debug Interface chain */
51
    SC_RISC_TEST,   /* 2 RISC Test Chain */
52
    SC_TRACE,       /* 3 Trace Chain */
53
    SC_REGISTER,    /* Register Chain */
54
    SC_WISHBONE,    /* 5 Memory chain */
55
    SC_BLOCK,       /* Block Chains */
56
  };
57
 
58
/* See JTAG documentation about these.  */
59
#define JI_SIZE (4)
60
enum jtag_instr
61
  {
62
    JI_EXTEST,
63
    JI_SAMPLE_PRELOAD,
64
    JI_IDCODE,
65
    JI_CHAIN_SELECT,
66
    JI_INTEST,
67
    JI_CLAMP,
68
    JI_CLAMPZ,
69
    JI_HIGHZ,
70
    JI_DEBUG,
71
    JI_BYPASS = 0xF
72
  };
73
 
74
/* JTAG registers.  */
75
#define JTAG_MODER  (0x0)
76
#define JTAG_TSEL   (0x1)
77
#define JTAG_QSEL   (0x2)
78
#define JTAG_SSEL   (0x3)
79
#define JTAG_RISCOP (0x4)
80
#define JTAG_RECWP0 (0x10)
81
#define JTAG_RECBP0 (0x1b)
82
 
83
/* This is repeated from gdb tm-or1k.h There needs to be
84
   a better mechanism for tracking this, but I don't see
85
   an easy way to share files between modules. */
86
 
87
typedef enum {
88
  JTAG_COMMAND_READ = 1,
89
  JTAG_COMMAND_WRITE = 2,
90
  JTAG_COMMAND_BLOCK_READ = 3,
91
  JTAG_COMMAND_BLOCK_WRITE = 4,
92
  JTAG_COMMAND_CHAIN = 5,
93
} JTAG_proxy_protocol_commands;
94
 
95
/* Each transmit structure must begin with an integer
96
   which specifies the type of command. Information
97
   after this is variable. Make sure to have all information
98
   aligned properly. If we stick with 32 bit integers, it
99
   should be portable onto every platform. These structures
100
   will be transmitted across the network in network byte
101
   order.
102
*/
103
 
104
typedef struct {
105
  uint32_t command;
106
  uint32_t length;
107
  uint32_t address;
108
  uint32_t data_H;
109
  uint32_t data_L;
110
} JTAGProxyWriteMessage;
111
 
112
typedef struct {
113
  uint32_t command;
114
  uint32_t length;
115
  uint32_t address;
116
} JTAGProxyReadMessage;
117
 
118
typedef struct {
119
  uint32_t command;
120
  uint32_t length;
121
  uint32_t address;
122
  int32_t  nRegisters;
123
  uint32_t data[1];
124
} JTAGProxyBlockWriteMessage;
125
 
126
typedef struct {
127
  uint32_t command;
128
  uint32_t length;
129
  uint32_t address;
130
  int32_t  nRegisters;
131
} JTAGProxyBlockReadMessage;
132
 
133
typedef struct {
134
  uint32_t command;
135
  uint32_t length;
136
  uint32_t chain;
137
} JTAGProxyChainMessage;
138
 
139
/* The responses are messages specific, however convention
140
   states the first word should be an error code. Again,
141
   sticking with 32 bit integers should provide maximum
142
   portability. */
143
 
144
typedef struct {
145
  int32_t status;
146
} JTAGProxyWriteResponse;
147
 
148
typedef struct {
149
  int32_t status;
150
  uint32_t data_H;
151
  uint32_t data_L;
152
} JTAGProxyReadResponse;
153
 
154
typedef struct {
155
  int32_t status;
156
} JTAGProxyBlockWriteResponse;
157
 
158
typedef struct {
159
  int32_t status;
160
  int32_t nRegisters;
161
  uint32_t data[1];
162
  /* uint32_t data[nRegisters-1] still unread */
163
} JTAGProxyBlockReadResponse;
164
 
165
typedef struct {
166
  int32_t status;
167
} JTAGProxyChainResponse;
168
 
169
#endif /* GDB_H */

powered by: WebSVN 2.1.0

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