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

Subversion Repositories adv_debug_sys

[/] [adv_debug_sys/] [trunk/] [Software/] [adv_jtag_bridge/] [adv_dbg_commands.h] - Blame information for rev 42

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 14 nyawn
 
2
#ifndef _ADV_DBG_COMMANDS_H_
3
#define _ADV_DBG_COMMANDS_H_
4
 
5
 
6
// Definitions for the top-level debug unit.  This really just consists
7
// of a single register, used to select the active debug module ("chain").
8
#define DBG_MODULE_SELECT_REG_SIZE 2
9
#define DBG_MAX_MODULES 4  // used to size an array
10
 
11
#define DC_WISHBONE 0
12
#define DC_CPU0     1
13
#define DC_CPU1     2
14 42 nyawn
#define DC_JSP      3
15 14 nyawn
 
16
// Polynomial for the CRC calculation
17
// Yes, it's backwards.  Yes, this is on purpose.
18
// The hardware is designed this way to save on logic and routing,
19
// and it's really all the same to us here.
20
#define ADBG_CRC_POLY 0xedb88320
21
 
22
// These are for the internal registers in the Wishbone module
23
// The first is the length of the index register,
24
// the indexes of the various registers are defined after that
25
#define DBG_WB_REG_SEL_LEN 1
26
#define DBG_WB_REG_ERROR 0
27
 
28
// Opcode definitions for the Wishbone module
29
#define DBG_WB_OPCODE_LEN   4
30
#define DBG_WB_CMD_NOP      0x0
31
#define DBG_WB_CMD_BWRITE8  0x1
32
#define DBG_WB_CMD_BWRITE16 0x2
33
#define DBG_WB_CMD_BWRITE32 0x3
34
#define DBG_WB_CMD_BREAD8   0x5
35
#define DBG_WB_CMD_BREAD16  0x6
36
#define DBG_WB_CMD_BREAD32  0x7
37
#define DBG_WB_CMD_IREG_WR  0x9  // This is both a select and a write
38
#define DBG_WB_CMD_IREG_SEL 0xd  // There is no 'read', the current register is always read.  Use a NOP to read.
39
 
40
 
41
// Internal register definitions for the CPU0 module
42
#define DBG_CPU0_REG_SEL_LEN 1
43
#define DBG_CPU0_REG_STATUS 0
44
 
45
// Opcode definitions for the first CPU module
46
#define DBG_CPU0_OPCODE_LEN   4
47
#define DBG_CPU0_CMD_NOP      0x0
48
#define DBG_CPU0_CMD_BWRITE32 0x3
49
#define DBG_CPU0_CMD_BREAD32  0x7
50
#define DBG_CPU0_CMD_IREG_WR  0x9  // This is both a select and a write
51
#define DBG_CPU0_CMD_IREG_SEL 0xd  // There is no 'read', the current register is always read.  Use a NOP to read.
52
 
53
// Internal register definitions for the CPU1 module
54
#define DBG_CPU1_REG_SEL_LEN 1
55
#define DBG_CPU1_REG_STATUS 0
56
 
57
// Opcode definitions for the second CPU module
58
#define DBG_CPU1_OPCODE_LEN   4
59
#define DBG_CPU1_CMD_NOP      0x0
60
#define DBG_CPU1_CMD_BWRITE32 0x3
61
#define DBG_CPU1_CMD_BREAD32  0x7
62
#define DBG_CPU1_CMD_IREG_WR  0x9  // This is both a select and a write
63
#define DBG_CPU1_CMD_IREG_SEL 0xd  // There is no 'read', the current register is always read.  Use a NOP to read.
64
 
65
// API to do transactions on the advanced debug interface
66
int adbg_select_module(int chain);
67
int adbg_select_ctrl_reg(unsigned long regidx);
68
int adbg_ctrl_write(unsigned long regidx, uint32_t *cmd_data, int length_bits);
69
int adbg_ctrl_read(unsigned long regidx, uint32_t *data, int databits);
70
int adbg_burst_command(unsigned int opcode, unsigned long address, int length_words);
71
int adbg_wb_burst_read(int word_size_bytes, int word_count, unsigned long start_address, void *data);
72
int adbg_wb_burst_write(void *data, int word_size_bytes, int word_count, unsigned long start_address);
73 42 nyawn
int adbg_jsp_transact(unsigned int *bytes_to_send, const char *data_to_send, unsigned int *bytes_received, char *data_received);
74 14 nyawn
 
75
#endif

powered by: WebSVN 2.1.0

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