OpenOCD
or1k_du.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 /***************************************************************************
4  * Copyright (C) 2013 Franck Jullien *
5  * elec4fun@gmail.com *
6  ***************************************************************************/
7 
8 #ifndef OPENOCD_TARGET_OPENRISC_OR1K_DU_H
9 #define OPENOCD_TARGET_OPENRISC_OR1K_DU_H
10 
11 #ifdef HAVE_CONFIG_H
12 #include "config.h"
13 #endif
14 
15 #define CPU_STALL 0
16 #define CPU_UNSTALL 1
17 
18 #define CPU_RESET 0
19 #define CPU_NOT_RESET 1
20 
21 int or1k_du_adv_register(void);
22 
23 /* Linear list over all available or1k debug unit */
24 extern struct list_head du_list;
25 
26 struct or1k_du {
27  const char *name;
28  struct list_head list;
29  int options;
30 
31  int (*or1k_jtag_init)(struct or1k_jtag *jtag_info);
32 
33  int (*or1k_is_cpu_running)(struct or1k_jtag *jtag_info, int *running);
34 
35  int (*or1k_cpu_stall)(struct or1k_jtag *jtag_info, int action);
36 
37  int (*or1k_cpu_reset)(struct or1k_jtag *jtag_info, int action);
38 
39  int (*or1k_jtag_read_cpu)(struct or1k_jtag *jtag_info,
40  uint32_t addr, int count, uint32_t *value);
41 
42  int (*or1k_jtag_write_cpu)(struct or1k_jtag *jtag_info,
43  uint32_t addr, int count, const uint32_t *value);
44 
45  int (*or1k_jtag_read_memory)(struct or1k_jtag *jtag_info, uint32_t addr, uint32_t size,
46  int count, uint8_t *buffer);
47 
48  int (*or1k_jtag_write_memory)(struct or1k_jtag *jtag_info, uint32_t addr, uint32_t size,
49  int count, const uint8_t *buffer);
50 };
51 
52 static inline struct or1k_du *or1k_jtag_to_du(struct or1k_jtag *jtag_info)
53 {
54  return (struct or1k_du *)jtag_info->du_core;
55 }
56 
57 static inline struct or1k_du *or1k_to_du(struct or1k_common *or1k)
58 {
59  struct or1k_jtag *jtag = &or1k->jtag;
60  return (struct or1k_du *)jtag->du_core;
61 }
62 
63 int or1k_adv_jtag_jsp_xfer(struct or1k_jtag *jtag_info,
64  int *out_len, unsigned char *out_buffer,
65  int *in_len, unsigned char *in_buffer);
66 
67 #endif /* OPENOCD_TARGET_OPENRISC_OR1K_DU_H */
uint32_t addr
Definition: nuttx.c:65
static struct or1k_du * or1k_jtag_to_du(struct or1k_jtag *jtag_info)
Definition: or1k_du.h:52
int or1k_du_adv_register(void)
Definition: or1k_du_adv.c:1083
int or1k_adv_jtag_jsp_xfer(struct or1k_jtag *jtag_info, int *out_len, unsigned char *out_buffer, int *in_len, unsigned char *in_buffer)
Definition: or1k_du_adv.c:983
struct list_head du_list
static struct or1k_du * or1k_to_du(struct or1k_common *or1k)
Definition: or1k_du.h:57
size_t size
Size of the control block search area.
Definition: rtt/rtt.c:30
Definition: list.h:26
struct or1k_jtag jtag
Definition: or1k.h:88
int(* or1k_jtag_write_cpu)(struct or1k_jtag *jtag_info, uint32_t addr, int count, const uint32_t *value)
Definition: or1k_du.h:42
const char * name
Definition: or1k_du.h:27
struct list_head list
Definition: or1k_du.h:28
int options
Definition: or1k_du.h:29
int(* or1k_jtag_init)(struct or1k_jtag *jtag_info)
Definition: or1k_du.h:31
int(* or1k_jtag_read_memory)(struct or1k_jtag *jtag_info, uint32_t addr, uint32_t size, int count, uint8_t *buffer)
Definition: or1k_du.h:45
int(* or1k_is_cpu_running)(struct or1k_jtag *jtag_info, int *running)
Definition: or1k_du.h:33
int(* or1k_jtag_write_memory)(struct or1k_jtag *jtag_info, uint32_t addr, uint32_t size, int count, const uint8_t *buffer)
Definition: or1k_du.h:48
int(* or1k_cpu_stall)(struct or1k_jtag *jtag_info, int action)
Definition: or1k_du.h:35
int(* or1k_jtag_read_cpu)(struct or1k_jtag *jtag_info, uint32_t addr, int count, uint32_t *value)
Definition: or1k_du.h:39
int(* or1k_cpu_reset)(struct or1k_jtag *jtag_info, int action)
Definition: or1k_du.h:37
Definition: or1k.h:77
struct or1k_du * du_core
Definition: or1k.h:83
uint8_t count[4]
Definition: vdebug.c:22