OpenOCD
lattice.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 /***************************************************************************
4  * Copyright (C) 2022 by Daniel Anselmi *
5  * danselmi@gmx.ch *
6  ***************************************************************************/
7 
8 #ifndef OPENOCD_PLD_LATTICE_H
9 #define OPENOCD_PLD_LATTICE_H
10 
11 #include <jtag/jtag.h>
12 #include "pld.h"
13 #include "lattice_bit.h"
14 
15 #define BYPASS 0xFF
16 
18  struct jtag_tap *tap;
21 };
22 
23 int lattice_set_instr(struct jtag_tap *tap, uint8_t new_instr, tap_state_t endstate);
24 int lattice_read_u32_register(struct jtag_tap *tap, uint8_t cmd, uint32_t *in_val,
25  uint32_t out_val, bool do_idle);
26 int lattice_read_u64_register(struct jtag_tap *tap, uint8_t cmd, uint64_t *in_val,
27  uint64_t out_val);
28 int lattice_verify_usercode(struct lattice_pld_device *lattice_device, uint32_t out,
29  uint32_t expected, uint32_t mask);
30 int lattice_verify_status_register_u32(struct lattice_pld_device *lattice_device, uint32_t out,
31  uint32_t expected, uint32_t mask, bool do_idle);
32 int lattice_verify_status_register_u64(struct lattice_pld_device *lattice_device, uint64_t out,
33  uint64_t expected, uint64_t mask);
34 int lattice_preload(struct lattice_pld_device *lattice_device);
35 
36 #endif /* OPENOCD_PLD_LATTICE_H */
int mask
Definition: esirisc.c:1741
The JTAG interface can be implemented with a software or hardware fifo.
enum tap_state tap_state_t
Defines JTAG Test Access Port states.
int lattice_verify_status_register_u32(struct lattice_pld_device *lattice_device, uint32_t out, uint32_t expected, uint32_t mask, bool do_idle)
Definition: lattice.c:241
int lattice_set_instr(struct jtag_tap *tap, uint8_t new_instr, tap_state_t endstate)
Definition: lattice.c:62
int lattice_preload(struct lattice_pld_device *lattice_device)
Definition: lattice.c:147
int lattice_read_u64_register(struct jtag_tap *tap, uint8_t cmd, uint64_t *in_val, uint64_t out_val)
Definition: lattice.c:126
int lattice_read_u32_register(struct jtag_tap *tap, uint8_t cmd, uint32_t *in_val, uint32_t out_val, bool do_idle)
Definition: lattice.c:100
int lattice_verify_usercode(struct lattice_pld_device *lattice_device, uint32_t out, uint32_t expected, uint32_t mask)
Definition: lattice.c:187
int lattice_verify_status_register_u64(struct lattice_pld_device *lattice_device, uint64_t out, uint64_t expected, uint64_t mask)
Definition: lattice.c:257
lattice_family_e
Definition: lattice_bit.h:23
Definition: jtag.h:101
uint8_t * expected
Capture-IR expected value.
Definition: jtag.h:112
struct jtag_tap * tap
Definition: lattice.h:18
enum lattice_family_e family
Definition: lattice.h:20
size_t preload_length
Definition: lattice.h:19
uint8_t cmd
Definition: vdebug.c:1