OpenOCD
ecp2_3.c File Reference
Include dependency graph for ecp2_3.c:

Go to the source code of this file.

Macros

#define ISC_DISABLE   0x1E
 
#define ISC_ENABLE   0x15
 
#define ISC_ERASE   0x03
 
#define ISC_PROGRAM_USERCODE   0x1A
 
#define LSCC_BITSTREAM_BURST   0x02
 
#define LSCC_READ_STATUS   0x53
 
#define LSCC_REFRESH   0x23
 
#define LSCC_RESET_ADDRESS   0x21
 
#define PROGRAM_SPI   0x3A
 
#define READ_USERCODE   0x17
 
#define REGISTER_ALL_BITS_0   0x00000000
 
#define REGISTER_ALL_BITS_1   0xffffffff
 
#define STATUS_DONE_BIT   0x00020000
 
#define STATUS_ERROR_BITS_ECP2   0x00040003
 
#define STATUS_ERROR_BITS_ECP3   0x00040007
 

Functions

int lattice_ecp2_3_connect_spi_to_jtag (struct lattice_pld_device *pld_device_info)
 
int lattice_ecp2_3_disconnect_spi_from_jtag (struct lattice_pld_device *pld_device_info)
 
static int lattice_ecp2_3_erase_device (struct lattice_pld_device *lattice_device)
 
static int lattice_ecp2_3_exit_programming_mode (struct lattice_pld_device *lattice_device)
 
int lattice_ecp2_3_get_facing_read_bits (struct lattice_pld_device *pld_device_info, unsigned int *facing_read_bits)
 
static int lattice_ecp2_3_program_config_map (struct lattice_pld_device *lattice_device, struct lattice_bit_file *bit_file)
 
int lattice_ecp2_3_read_status (struct jtag_tap *tap, uint32_t *status, uint32_t out, bool do_idle)
 
int lattice_ecp2_3_read_usercode (struct jtag_tap *tap, uint32_t *usercode, uint32_t out)
 
int lattice_ecp2_3_refresh (struct lattice_pld_device *lattice_device)
 
int lattice_ecp2_3_write_usercode (struct lattice_pld_device *lattice_device, uint32_t usercode)
 
int lattice_ecp2_load (struct lattice_pld_device *lattice_device, struct lattice_bit_file *bit_file)
 
int lattice_ecp3_load (struct lattice_pld_device *lattice_device, struct lattice_bit_file *bit_file)
 

Macro Definition Documentation

◆ ISC_DISABLE

#define ISC_DISABLE   0x1E

Definition at line 21 of file ecp2_3.c.

◆ ISC_ENABLE

#define ISC_ENABLE   0x15

Definition at line 16 of file ecp2_3.c.

◆ ISC_ERASE

#define ISC_ERASE   0x03

Definition at line 19 of file ecp2_3.c.

◆ ISC_PROGRAM_USERCODE

#define ISC_PROGRAM_USERCODE   0x1A

Definition at line 18 of file ecp2_3.c.

◆ LSCC_BITSTREAM_BURST

#define LSCC_BITSTREAM_BURST   0x02

Definition at line 23 of file ecp2_3.c.

◆ LSCC_READ_STATUS

#define LSCC_READ_STATUS   0x53

Definition at line 22 of file ecp2_3.c.

◆ LSCC_REFRESH

#define LSCC_REFRESH   0x23

Definition at line 15 of file ecp2_3.c.

◆ LSCC_RESET_ADDRESS

#define LSCC_RESET_ADDRESS   0x21

Definition at line 17 of file ecp2_3.c.

◆ PROGRAM_SPI

#define PROGRAM_SPI   0x3A

Definition at line 24 of file ecp2_3.c.

◆ READ_USERCODE

#define READ_USERCODE   0x17

Definition at line 20 of file ecp2_3.c.

◆ REGISTER_ALL_BITS_0

#define REGISTER_ALL_BITS_0   0x00000000

Definition at line 30 of file ecp2_3.c.

◆ REGISTER_ALL_BITS_1

#define REGISTER_ALL_BITS_1   0xffffffff

Definition at line 29 of file ecp2_3.c.

◆ STATUS_DONE_BIT

#define STATUS_DONE_BIT   0x00020000

Definition at line 26 of file ecp2_3.c.

◆ STATUS_ERROR_BITS_ECP2

#define STATUS_ERROR_BITS_ECP2   0x00040003

Definition at line 27 of file ecp2_3.c.

◆ STATUS_ERROR_BITS_ECP3

#define STATUS_ERROR_BITS_ECP3   0x00040007

Definition at line 28 of file ecp2_3.c.

Function Documentation

◆ lattice_ecp2_3_connect_spi_to_jtag()

int lattice_ecp2_3_connect_spi_to_jtag ( struct lattice_pld_device pld_device_info)

◆ lattice_ecp2_3_disconnect_spi_from_jtag()

int lattice_ecp2_3_disconnect_spi_from_jtag ( struct lattice_pld_device pld_device_info)

◆ lattice_ecp2_3_erase_device()

◆ lattice_ecp2_3_exit_programming_mode()

static int lattice_ecp2_3_exit_programming_mode ( struct lattice_pld_device lattice_device)
static

◆ lattice_ecp2_3_get_facing_read_bits()

int lattice_ecp2_3_get_facing_read_bits ( struct lattice_pld_device pld_device_info,
unsigned int *  facing_read_bits 
)

Definition at line 298 of file ecp2_3.c.

References ERROR_FAIL, and ERROR_OK.

Referenced by lattice_get_stuff_bits().

◆ lattice_ecp2_3_program_config_map()

◆ lattice_ecp2_3_read_status()

int lattice_ecp2_3_read_status ( struct jtag_tap tap,
uint32_t *  status,
uint32_t  out,
bool  do_idle 
)

Definition at line 32 of file ecp2_3.c.

References lattice_read_u32_register(), LSCC_READ_STATUS, and status.

Referenced by lattice_read_status_u32().

◆ lattice_ecp2_3_read_usercode()

int lattice_ecp2_3_read_usercode ( struct jtag_tap tap,
uint32_t *  usercode,
uint32_t  out 
)

Definition at line 37 of file ecp2_3.c.

References lattice_read_u32_register(), and READ_USERCODE.

Referenced by lattice_read_usercode().

◆ lattice_ecp2_3_refresh()

int lattice_ecp2_3_refresh ( struct lattice_pld_device lattice_device)

◆ lattice_ecp2_3_write_usercode()

◆ lattice_ecp2_load()

◆ lattice_ecp3_load()