Sanitize urjtag/jtag.h; move data_dir.c from cmd/ to global/; fix indent in flash/*c; check for c99 in configure.ac

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1548 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Rutger Hofman 16 years ago
parent 095f6085ce
commit 2a9d4a9e3b

@ -1,4 +1,10 @@
2009-05-02 Rutger Hofman <rfhh>
Refactor the autoconf stuff a bit so make install actually creates
include/urjtag/*.h
2009-05-01 Rutger Hofman <rfhh>
Global variables for liburjtag should not reside in the shell app
* src/jtag.c: split into src/global/urjtag.c and src/apps/jtag/jtag.c

@ -88,6 +88,7 @@ AM_GNU_GETTEXT_VERSION(0.14.1)
AC_PROG_CC
AC_PROG_YACC
AC_PROG_LIBTOOL
AC_PROG_CC_C99
AC_SEARCH_LIBS([ioperm], [ioperm])

@ -68,11 +68,4 @@ urj_part_signal_t *urj_part_signal_define (urj_chain_t *chain,
int urj_part_signal_redefine_pin (urj_chain_t *chain, urj_part_signal_t *s,
const char *pin_name);
/**
* Check whether a chain has an active part
*
* @return if error, NULL, and sets urj_error.
*/
urj_part_t *urj_part_active_part(urj_chain_t *chain);
#endif /* URJ_BSSIGNAL_H */

@ -26,12 +26,18 @@
#ifndef URJ_BUS_H
#define URJ_BUS_H
/* @@@@ this had better be an internal include file RFHH */
#include <stdint.h>
#include <stdio.h>
#include "bus_driver.h"
extern urj_bus_t *urj_bus;
void urj_bus_readmem (urj_bus_t *bus, FILE * f, uint32_t addr, uint32_t len);
void urj_bus_writemem (urj_bus_t *bus, FILE * f, uint32_t addr, uint32_t len);
/* @@@@ this had better be in an internal include file RFHH */
typedef struct
{
int len;

@ -65,6 +65,12 @@ void urj_tap_chain_shift_data_registers_mode (urj_chain_t *chain,
void urj_tap_chain_flush (urj_chain_t *chain);
int urj_tap_chain_set_pod_signal (urj_chain_t *chain, int mask, int val);
int urj_tap_chain_get_pod_signal (urj_chain_t *chain, urj_pod_sigsel_t sig);
/**
* Check whether a chain has an active part
*
* @return NULL on error, and sets urj_error.
*/
urj_part_t *urj_tap_chain_active_part(urj_chain_t *chain);
typedef struct
{

@ -34,7 +34,7 @@
#ifndef URJ_CMD_H
#define URJ_CMD_H
#include "chain.h"
#include "types.h"
typedef struct
{
@ -48,7 +48,7 @@ extern const urj_cmd_t *urj_cmds[];
int urj_cmd_run (urj_chain_t *chain, char *params[]);
int urj_cmd_params (char *params[]);
int urj_cmd_get_number (char *s, unsigned int *i);
int urj_cmd_get_number (const char *s, unsigned int *i);
int urj_cmd_test_cable (urj_chain_t *chain);
#endif /* URJ_CMD_H */

@ -35,6 +35,7 @@ typedef enum urj_error {
URJ_ERROR_NO_ACTIVE_PART,
URJ_ERROR_INVALID,
URJ_ERROR_NOTFOUND,
URJ_ERROR_IO, /**< I/O error from OS */
} urj_error_t;
/** Max length of message string that can be recorded. */
@ -68,7 +69,8 @@ extern urj_error_state_t urj_error_state;
urj_error_state.file = __FILE__; \
urj_error_state.function = __func__; \
urj_error_state.line = __LINE__; \
snprintf(urj_error_state.msg, sizeof urj_error_state.msg, __VA_ARGS__); \
snprintf (urj_error_state.msg, sizeof urj_error_state.msg, \
__VA_ARGS__); \
} while (0)
/**

@ -39,18 +39,6 @@
#include "types.h"
#if 0
/* Following moved here from brux/cfi.h */
#include <flash/cfi.h>
typedef struct
{
int width; /* 1 for 8 bits, 2 for 16 bits, 4 for 32 bits, etc. */
urj_flash_cfi_query_structure_t cfi;
} urj_flash_cfi_chip_t;
#endif
typedef struct urj_flash_cfi_chip urj_flash_cfi_chip_t;
typedef struct

@ -25,7 +25,7 @@
#ifndef URJ_JIM_SOME_CPU_H
#define URJ_JIM_SOME_CPU_H
#include <jim.h>
#include <urjtag/jim.h>
void urj_jim_some_cpu_tck_rise (urj_jim_device_t *dev);
urj_jim_device_t *urj_jim_some_cpu (void);

@ -25,33 +25,15 @@
#ifndef URJ_JTAG_H
#define URJ_JTAG_H
#include <stdio.h>
#include <stdint.h>
#include "types.h"
extern urj_bus_t *urj_bus;
extern int urj_big_endian;
extern int urj_debug_mode;
/** Register the application name with cmd_jtag.
* @param argv0 is remembered as a pointer, it is not strdup()'ed.
*/
void urj_cmd_jtag_set_argv0(const char *argv0);
const char *urj_cmd_jtag_get_data_dir (void);
int urj_cmd_jtag_parse_file (urj_chain_t *chain, const char *filename);
int urj_cmd_jtag_parse_line (urj_chain_t *chain, char *line);
int urj_cmd_jtag_parse_stream (urj_chain_t *chain, FILE * f);
/* @@@@ RFHH shouldn't these be in their module's .h file? */
int urj_tap_detect_parts (urj_chain_t *chain, const char *db_path);
int urj_tap_manual_add (urj_chain_t *chain, int instr_len);
int urj_tap_detect_register_size (urj_chain_t *chain);
void urj_tap_discovery (urj_chain_t *chain);
void urj_tap_urj_tap_idcode (urj_chain_t *chain, unsigned int bytes);
void urj_bus_readmem (urj_bus_t *bus, FILE * f, uint32_t addr, uint32_t len);
void urj_bus_writemem (urj_bus_t *bus, FILE * f, uint32_t addr, uint32_t len);
void urj_set_argv0(const char *argv0);
const char *urj_get_data_dir (void);
#endif /* URJ_JTAG_H */

@ -52,7 +52,7 @@ struct urj_part
urj_part_t *urj_part_alloc (const urj_tap_register_t *id);
void urj_part_free (urj_part_t *p);
urj_part_t *read_part (FILE * f, urj_tap_register_t *idr);
urj_part_t *read_part (FILE *f, urj_tap_register_t *idr);
urj_part_instruction_t *urj_part_find_instruction (urj_part_t *p,
const char *iname);
urj_data_register_t *urj_part_find_data_register (urj_part_t *p,
@ -79,6 +79,8 @@ urj_part_instruction_t *urj_part_instruction_define (urj_part_t *part,
const char *instruction,
const char *code,
const char *data_register);
/**
* parts
*/

@ -27,8 +27,6 @@
#include "types.h"
#include "tap_register.h"
void urj_tap_reset (urj_chain_t *chain);
void urj_tap_reset_bypass (urj_chain_t *chain);
void urj_tap_capture_dr (urj_chain_t *chain);
@ -43,4 +41,11 @@ void urj_tap_shift_register (urj_chain_t *chain,
const urj_tap_register_t *in,
urj_tap_register_t *out, int tap_exit);
/** API functions */
int urj_tap_detect_parts (urj_chain_t *chain, const char *db_path);
int urj_tap_manual_add (urj_chain_t *chain, int instr_len);
int urj_tap_detect_register_size (urj_chain_t *chain);
void urj_tap_discovery (urj_chain_t *chain);
void urj_tap_idcode (urj_chain_t *chain, unsigned int bytes);
#endif /* URJ_TAP_H */

@ -49,8 +49,9 @@
#include <urjtag/chain.h>
#include <urjtag/bus.h>
#include <urjtag/cmd.h>
#include <urjtag/jtag.h>
#include <urjtag/flash.h>
#include <urjtag/parse.h>
#include <urjtag/jtag.h>
#ifndef HAVE_GETLINE
ssize_t urj_lib_getline (char **lineptr, size_t *n, FILE * stream);
@ -204,7 +205,7 @@ jtag_readline_multiple_commands_support (urj_chain_t *chain, char *line)
++line;
}
r = urj_cmd_jtag_parse_line (chain, line);
r = urj_parse_line (chain, line);
urj_tap_chain_flush (chain);
@ -298,7 +299,7 @@ jtag_parse_rc (urj_chain_t *chain)
strcat (file, "/");
strcat (file, RCFILE);
go = urj_cmd_jtag_parse_file (chain, file);
go = urj_parse_file (chain, file);
free (file);
@ -332,7 +333,7 @@ main (int argc, char *const argv[])
int quiet = 0;
urj_chain_t *chain = NULL;
urj_cmd_jtag_set_argv0(argv[0]);
urj_set_argv0(argv[0]);
if (geteuid () == 0 && getuid () != 0)
{
@ -453,7 +454,7 @@ main (int argc, char *const argv[])
return -1;
}
go = urj_cmd_jtag_parse_file (chain, argv[i]);
go = urj_parse_file (chain, argv[i]);
cleanup (chain);
if (go < 0)
{
@ -475,7 +476,7 @@ main (int argc, char *const argv[])
printf (_("Out of memory\n"));
return -1;
}
urj_cmd_jtag_parse_stream (chain, stdin);
urj_parse_stream (chain, stdin);
cleanup (chain);

@ -35,7 +35,6 @@
#include <urjtag/chain.h>
#include <urjtag/part.h>
#include <urjtag/jtag.h>
#include <urjtag/cmd.h>
//#include "bsdl_local.h"

@ -29,8 +29,8 @@
#include <stdio.h>
#include <string.h>
#include <urjtag/jtag.h>
#include <urjtag/cmd.h>
#include <urjtag/part.h>
#include "bsdl_sysdep.h"

@ -25,7 +25,7 @@
#ifndef URJ_BSDL_TYPES_H
#define URJ_BSDL_TYPES_H
#include <urjtag/jtag.h>
#include <urjtag/types.h>
#include <urjtag/bsdl_mode.h>
/* private data of the flex scanner

@ -127,6 +127,8 @@ LEGAL NOTICES:
#include <stdlib.h>
#include <ctype.h>
#include <urjtag/jtag.h>
#include "bsdl_sysdep.h"
#include "bsdl_msg.h"
@ -495,7 +497,7 @@ void urj_vhdl_flex_switch_file( yyscan_t scanner, char *filename )
f = fopen( filename, "r" );
if (!f)
{
const char *db_path = urj_cmd_jtag_get_data_dir();
const char *db_path = urj_get_data_dir();
char *db_file;
if ((db_file = malloc( strlen( db_path ) +

@ -37,7 +37,6 @@
#include <urjtag/bus.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include "buses.h"
#include "generic_bus.h"

@ -36,9 +36,9 @@
#include <urjtag/bus.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include <urjtag/data_register.h>
#include <urjtag/tap.h>
#include <urjtag/tap_register.h>
#include "buses.h"
#include "generic_bus.h"

@ -33,7 +33,6 @@
#include <urjtag/bus.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include "buses.h"
#include "generic_bus.h"

@ -33,7 +33,6 @@
#include <urjtag/bus.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include "buses.h"
#include "generic_bus.h"

@ -33,7 +33,6 @@
#include <urjtag/bus.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include "buses.h"
#include "generic_bus.h"

@ -33,7 +33,6 @@
#include <urjtag/bus.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include "buses.h"
#include "generic_bus.h"

@ -32,7 +32,6 @@
#include <urjtag/bus.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include "buses.h"
#include "generic_bus.h"

@ -33,7 +33,6 @@
#include <urjtag/bus.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include "buses.h"
#include "generic_bus.h"

@ -34,7 +34,6 @@
#include <urjtag/bus.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include <urjtag/tap_state.h>
#include "buses.h"

@ -37,7 +37,6 @@
#include <urjtag/bus.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include <urjtag/tap_state.h>
#include <urjtag/tap_register.h>
#include <urjtag/data_register.h>

@ -44,7 +44,6 @@
#include <urjtag/bus.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include <urjtag/tap_state.h>
#include <urjtag/tap_register.h>
#include <urjtag/data_register.h>

@ -31,10 +31,10 @@
#include <urjtag/part.h>
#include <urjtag/bus.h>
#include <urjtag/chain.h>
#include <urjtag/jtag.h>
#include <urjtag/cmd.h>
#include <urjtag/tap.h>
#include <urjtag/data_register.h>
#include <urjtag/tap_register.h>
#include <urjtag/part_instruction.h>
#include "buses.h"

@ -28,7 +28,6 @@
#include <urjtag/part.h>
#include <urjtag/chain.h>
#include <urjtag/jtag.h>
#include "generic_bus.h"

@ -33,7 +33,6 @@
#include <urjtag/bus.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include "buses.h"
#include "generic_bus.h"

@ -33,7 +33,6 @@
#include <urjtag/bus.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include "buses.h"
#include "generic_bus.h"

@ -64,7 +64,6 @@
#include <urjtag/bus.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include <urjtag/tap_state.h>
#include "buses.h"

@ -42,7 +42,6 @@
#include <urjtag/bus.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include "buses.h"
#include "generic_bus.h"

@ -37,7 +37,6 @@
#include <urjtag/part.h>
#include <urjtag/bus.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include "buses.h"
#include "generic_bus.h"

@ -37,7 +37,6 @@
#include <urjtag/chain.h>
#include <urjtag/bus.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include "buses.h"
#include "generic_bus.h"

@ -30,7 +30,6 @@
#include <urjtag/bus.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include "buses.h"
#include "generic_bus.h"

@ -29,7 +29,6 @@
#include <urjtag/bus.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include "buses.h"
#include "generic_bus.h"

@ -33,7 +33,6 @@
#include <urjtag/bus.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include "buses.h"
#include "generic_bus.h"

@ -40,7 +40,6 @@
#include <urjtag/part.h>
#include <urjtag/bus.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include <urjtag/tap_state.h>
#include "buses.h"

@ -62,7 +62,6 @@
#include <urjtag/bus.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include <urjtag/tap_state.h>
#include "buses.h"

@ -36,7 +36,6 @@
#include <urjtag/bus.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include "buses.h"
#include "generic_bus.h"

@ -33,7 +33,6 @@
#include <urjtag/bus.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include "buses.h"
#include "generic_bus.h"

@ -33,7 +33,6 @@
#include <urjtag/bus.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include "buses.h"
#include "generic_bus.h"

@ -33,7 +33,6 @@
#include <urjtag/bus.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include "buses.h"
#include "generic_bus.h"

@ -37,7 +37,6 @@
#include <urjtag/part.h>
#include <urjtag/bus.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include "buses.h"
#include "generic_bus.h"

@ -36,7 +36,6 @@
#include <urjtag/part.h>
#include <urjtag/bus.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include "buses.h"
#include "generic_bus.h"

@ -34,7 +34,6 @@
#include <urjtag/bus.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include "buses.h"
#include "generic_bus.h"

@ -64,7 +64,6 @@
#include <urjtag/bus.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include <urjtag/tap_state.h>
#include "buses.h"

@ -53,7 +53,6 @@ libcmd_la_SOURCES = \
cmd_shell.c \
cmd_set.c \
cmd_endian.c \
cmd_parse.c \
cmd_peekpoke.c \
cmd_pod.c \
cmd_readmem.c \
@ -63,8 +62,7 @@ libcmd_la_SOURCES = \
cmd_include.c \
cmd_addpart.c \
cmd_cmd.c \
cmd_usleep.c \
cmd_jtag_data_dir.c
cmd_usleep.c
if ENABLE_SVF
libcmd_la_SOURCES += cmd_svf.c
@ -73,5 +71,3 @@ endif
if ENABLE_BSDL
libcmd_la_SOURCES += cmd_bsdl.c
endif
AM_CPPFLAGS = -DJTAG_BIN_DIR=\"$(bindir)\" -DJTAG_DATA_DIR=\"$(pkgdatadir)\"

@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <urjtag/jtag.h>
#include <urjtag/tap.h>
#include <urjtag/chain.h>
#include <urjtag/part.h>

@ -29,7 +29,6 @@
#include <string.h>
#include <urjtag/bsbit.h>
#include <urjtag/jtag.h>
#include <urjtag/cmd.h>

@ -27,8 +27,8 @@
#include <stdio.h>
#include <string.h>
#include <urjtag/chain.h>
#include <urjtag/bus.h>
#include <urjtag/jtag.h>
#include <urjtag/cmd.h>

@ -32,7 +32,6 @@
#include <urjtag/tap.h>
#include <urjtag/cable.h>
#include <urjtag/chain.h>
#include <urjtag/jtag.h>
#include <urjtag/bus.h>
#include <urjtag/cmd.h>

@ -27,7 +27,7 @@
#include <stdio.h>
#include <string.h>
#include <urjtag/jtag.h>
#include <urjtag/chain.h>
#include <urjtag/cmd.h>
@ -199,7 +199,7 @@ urj_cmd_params (char *params[])
}
int
urj_cmd_get_number (char *s, unsigned int *i)
urj_cmd_get_number (const char *s, unsigned int *i)
{
int n;
int r;

@ -27,9 +27,7 @@
#include <stdio.h>
#include <string.h>
//#include <stdlib.h>
//#include "part.h"
//#include "bssignal.h"
#include <urjtag/jtag.h>
#include <urjtag/cmd.h>

@ -27,10 +27,11 @@
#include <stdio.h>
#include <string.h>
#include <urjtag/jtag.h>
#include <urjtag/chain.h>
#include <urjtag/tap.h>
#include <urjtag/part.h>
#include <urjtag/bus.h>
#include <urjtag/jtag.h>
#include <urjtag/cmd.h>
@ -49,7 +50,7 @@ cmd_detect_run (urj_chain_t *chain, char *params[])
urj_bus_buses_free ();
urj_part_parts_free (chain->parts);
chain->parts = NULL;
urj_tap_detect_parts (chain, urj_cmd_jtag_get_data_dir ());
urj_tap_detect_parts (chain, urj_get_data_dir ());
if (!chain->parts)
return 1;
if (!chain->parts->len)

@ -26,7 +26,7 @@
#include <stdio.h>
#include <urjtag/jtag.h>
#include <urjtag/bus.h>
#include <urjtag/flash.h>
#include <urjtag/cmd.h>

@ -26,7 +26,7 @@
#include <stdio.h>
#include <urjtag/jtag.h>
#include <urjtag/tap.h>
#include <urjtag/cmd.h>

@ -32,7 +32,6 @@
#include <urjtag/part_instruction.h>
#include <urjtag/data_register.h>
#include <urjtag/tap_register.h>
#include <urjtag/jtag.h>
#include <urjtag/cmd.h>
@ -40,7 +39,10 @@ static int
cmd_dr_run (urj_chain_t *chain, char *params[])
{
int dir = 1;
urj_part_t *part;
urj_tap_register_t *r;
urj_data_register_t *dr;
urj_part_instruction_t *active_ir;
if (urj_cmd_params (params) < 1 || urj_cmd_params (params) > 2)
return -1;
@ -48,25 +50,18 @@ cmd_dr_run (urj_chain_t *chain, char *params[])
if (!urj_cmd_test_cable (chain))
return 1;
if (!chain->parts)
{
printf (_("Run \"detect\" first.\n"));
return 1;
}
if (chain->active_part >= chain->parts->len)
{
printf (_("%s: no active part\n"), "dr");
part = urj_tap_chain_active_part (chain);
if (part == NULL)
return 1;
}
if (chain->parts->parts[chain->active_part]->active_instruction == NULL)
active_ir = part->active_instruction;
if (active_ir == NULL)
{
printf (_("%s: part without active instruction\n"), "dr");
return 1;
}
if (chain->parts->parts[chain->active_part]->active_instruction->
data_register == NULL)
dr = active_ir->data_register;
if (dr == NULL)
{
printf (_("%s: part without active data register\n"), "dr");
return 1;
@ -86,8 +81,7 @@ cmd_dr_run (urj_chain_t *chain, char *params[])
return -1;
}
r = chain->parts->parts[chain->active_part]->active_instruction->
data_register->in;
r = dr->in;
if (r->len != strlen (params[1]))
{
printf (_("%s: register length mismatch\n"), "dr");
@ -103,11 +97,9 @@ cmd_dr_run (urj_chain_t *chain, char *params[])
}
if (dir)
r = chain->parts->parts[chain->active_part]->active_instruction->
data_register->out;
r = dr->out;
else
r = chain->parts->parts[chain->active_part]->active_instruction->
data_register->in;
r = dr->in;
printf (_("%s\n"), urj_tap_register_get_string (r));
return 1;

@ -46,7 +46,6 @@ cmd_endian_run (urj_chain_t *chain, char *params[])
return 1;
}
if (strcasecmp (params[1], "little") == 0)
{
urj_big_endian = 0;

@ -28,7 +28,7 @@
#include <stdint.h>
#include <string.h>
#include <urjtag/jtag.h>
#include <urjtag/bus.h>
#include <urjtag/flash.h>
#include <urjtag/cmd.h>

@ -28,7 +28,7 @@
#include <stdint.h>
#include <string.h>
#include <urjtag/jtag.h>
#include <urjtag/bus.h>
#include <urjtag/flash.h>
#include <urjtag/cmd.h>

@ -26,8 +26,8 @@
#include <stdio.h>
#include <urjtag/chain.h>
#include <urjtag/cable.h>
#include <urjtag/jtag.h>
#include <urjtag/cmd.h>

@ -28,8 +28,8 @@
#include <string.h>
#include <urjtag/part.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include <urjtag/cmd.h>
@ -38,6 +38,7 @@ cmd_get_run (urj_chain_t *chain, char *params[])
{
int data;
urj_part_signal_t *s;
urj_part_t *part;
if (urj_cmd_params (params) != 3)
return -1;
@ -48,26 +49,17 @@ cmd_get_run (urj_chain_t *chain, char *params[])
if (!urj_cmd_test_cable (chain))
return 1;
if (!chain->parts)
{
printf (_("Run \"detect\" first.\n"));
return 1;
}
if (chain->active_part >= chain->parts->len)
{
printf (_("%s: no active part\n"), "get");
part = urj_tap_chain_active_part (chain);
if (part == NULL)
return 1;
}
s = urj_part_find_signal (chain->parts->parts[chain->active_part],
params[2]);
s = urj_part_find_signal (part, params[2]);
if (!s)
{
printf (_("signal '%s' not found\n"), params[2]);
return 1;
}
data = urj_part_get_signal (chain->parts->parts[chain->active_part], s);
data = urj_part_get_signal (part, s);
if (data != -1)
printf (_("%s = %d\n"), params[2], data);

@ -25,7 +25,7 @@
#include <stdio.h>
#include <urjtag/jtag.h>
#include <urjtag/tap.h>
#include <urjtag/cmd.h>
@ -49,7 +49,7 @@ cmd_idcode_run (urj_chain_t *chain, char *params[])
return 1;
printf (_("Reading %d bytes if idcode\n"), bytes);
urj_tap_urj_tap_idcode (chain, bytes);
urj_tap_idcode (chain, bytes);
return 1;
}

@ -29,6 +29,7 @@
#include <stdlib.h>
#include <string.h>
#include <urjtag/parse.h>
#include <urjtag/jtag.h>
#include <urjtag/cmd.h>
@ -65,7 +66,7 @@ cmd_include_or_script_run (urj_chain_t *chain, int is_include, char *params[])
}
else
{
const char *jtag_data_dir = urj_cmd_jtag_get_data_dir ();
const char *jtag_data_dir = urj_get_data_dir ();
path = malloc (len = strlen (jtag_data_dir) + strlen (params[1]) + 2);
if (path != NULL)
{
@ -97,7 +98,7 @@ cmd_include_or_script_run (urj_chain_t *chain, int is_include, char *params[])
for (i = 0; i < j; i++)
{
go = urj_cmd_jtag_parse_file (chain, path);
go = urj_parse_file (chain, path);
if (go < 0)
{

@ -32,7 +32,6 @@
#include <urjtag/part.h>
#include <urjtag/bus.h>
#include <urjtag/cmd.h>
#include <urjtag/jtag.h>
static int
cmd_initbus_run (urj_chain_t *chain, char *params[])
@ -45,17 +44,8 @@ cmd_initbus_run (urj_chain_t *chain, char *params[])
if (!urj_cmd_test_cable (chain))
return 1;
if (!chain->parts)
{
printf (_("Run \"detect\" first.\n"));
return 1;
}
if (chain->active_part >= chain->parts->len || chain->active_part < 0)
{
printf (_("%s: no active part\n"), "initbus");
if (urj_tap_chain_active_part (chain) == NULL)
return 1;
}
for (i = 0; urj_bus_drivers[i] != NULL; i++)
{

@ -28,7 +28,7 @@
#include <string.h>
#include <urjtag/part.h>
#include <urjtag/jtag.h>
#include <urjtag/chain.h>
#include <urjtag/cmd.h>
@ -40,19 +40,9 @@ cmd_instruction_run (urj_chain_t *chain, char *params[])
if (!urj_cmd_test_cable (chain))
return 1;
if (!chain->parts)
{
printf (_("Run \"detect\" first.\n"));
part = urj_tap_chain_active_part (chain);
if (part == NULL)
return 1;
}
if (chain->active_part >= chain->parts->len)
{
printf (_("%s: no active part\n"), "instruction");
return 1;
}
part = chain->parts->parts[chain->active_part];
if (urj_cmd_params (params) == 2)
{

@ -30,7 +30,6 @@
#include <urjtag/chain.h>
#include <urjtag/part.h>
#include <urjtag/jtag.h>
#include <urjtag/cmd.h>
@ -44,10 +43,19 @@ cmd_part_run (urj_chain_t *chain, char *params[])
{
if (strcasecmp (params[1], "alias") == 0)
{
urj_part_t *part;
part = chain->parts->parts[chain->active_part];
/* @@@@ ToDo RFHH check malloc result */
urj_part_t *part = urj_tap_chain_active_part (chain);
if (part == NULL)
return 1;
part->alias = malloc (strlen (params[2]) + 1);
if (part->alias == NULL)
{
urj_error_set(URJ_ERROR_OUT_OF_MEMORY, "malloc(%zd) fails",
strlen (params[2]) + 1);
return -1;
}
strcpy (part->alias, params[2]);
return 1;
}

@ -28,7 +28,6 @@
#include <stdint.h>
#include <urjtag/bus.h>
#include <urjtag/jtag.h>
#include <urjtag/cmd.h>

@ -30,8 +30,8 @@
#include <stdlib.h>
#include <string.h>
#include <urjtag/jtag.h>
#include <urjtag/cable.h>
#include <urjtag/chain.h>
#include <urjtag/pod.h>
#include <urjtag/cmd.h>

@ -27,7 +27,7 @@
#include <stdio.h>
#include <stdint.h>
#include <urjtag/jtag.h>
#include <urjtag/bus.h>
#include <urjtag/cmd.h>

@ -32,7 +32,6 @@
#include <urjtag/part.h>
#include <urjtag/data_register.h>
#include <urjtag/tap_register.h>
#include <urjtag/jtag.h>
#include <urjtag/cmd.h>
@ -46,27 +45,16 @@ cmd_register_run (urj_chain_t *chain, char *params[])
if (urj_cmd_params (params) != 3)
return -1;
if (!urj_cmd_test_cable (chain))
return 1;
if (!chain->parts)
{
printf (_("Run \"detect\" first.\n"));
return 1;
}
if (chain->active_part >= chain->parts->len)
{
printf (_("%s: no active part\n"), "register");
part = urj_tap_chain_active_part (chain);
if (part == NULL)
return 1;
}
if (urj_cmd_get_number (params[2], &len))
return -1;
part = chain->parts->parts[chain->active_part];
if (urj_part_find_data_register (part, params[1]) != NULL)
{
printf (_("Data register '%s' already defined\n"), params[1]);

@ -27,7 +27,6 @@
#include <stdio.h>
#include <string.h>
#include <urjtag/jtag.h>
#include <urjtag/tap.h>
#include <urjtag/cmd.h>

@ -31,7 +31,6 @@
#include "urjtag/chain.h"
#include "urjtag/part.h"
#include "urjtag/bssignal.h"
#include "urjtag/jtag.h"
#include "urjtag/cmd.h"
@ -48,19 +47,10 @@ cmd_salias_run (urj_chain_t *chain, char *params[])
if (!urj_cmd_test_cable (chain))
return 1;
if (!chain->parts)
{
printf (_("Run \"detect\" first.\n"));
return 1;
}
if (chain->active_part >= chain->parts->len)
{
printf (_("%s: no active part\n"), "signal");
part = urj_tap_chain_active_part (chain);
if (part == NULL)
return 1;
}
part = chain->parts->parts[chain->active_part];
if (urj_part_find_signal (part, params[1]) != NULL)
{
printf (_("Signal '%s' already defined\n"), params[1]);

@ -34,7 +34,6 @@
#include <urjtag/data_register.h>
#include <urjtag/bssignal.h>
#include <urjtag/bsbit.h>
#include <urjtag/jtag.h>
#include <urjtag/cmd.h>
@ -52,19 +51,9 @@ cmd_scan_run (urj_chain_t *chain, char *params[])
if (!urj_cmd_test_cable (chain))
return 1;
if (!chain->parts)
{
printf (_("Run \"detect\" first.\n"));
part = urj_tap_chain_active_part (chain);
if (part == NULL)
return 1;
}
if (chain->active_part >= chain->parts->len)
{
printf (_("%s: no active part\n"), "scan");
return 1;
}
part = chain->parts->parts[chain->active_part];
/* search for Boundary Scan Register */
bsr = urj_part_find_data_register (part, "BSR");

@ -28,8 +28,8 @@
#include <string.h>
#include <urjtag/part.h>
#include <urjtag/chain.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include <urjtag/cmd.h>
@ -39,6 +39,7 @@ cmd_set_run (urj_chain_t *chain, char *params[])
int dir;
unsigned int data = 0;
urj_part_signal_t *s;
urj_part_t *part;
if (urj_cmd_params (params) < 4 || urj_cmd_params (params) > 5)
return -1;
@ -49,17 +50,9 @@ cmd_set_run (urj_chain_t *chain, char *params[])
if (!urj_cmd_test_cable (chain))
return 1;
if (!chain->parts)
{
printf (_("Run \"detect\" first.\n"));
return 1;
}
if (chain->active_part >= chain->parts->len)
{
printf (_("%s: no active part\n"), "set");
part = urj_tap_chain_active_part (chain);
if (part == NULL)
return 1;
}
/* direction */
if (strcasecmp (params[3], "in") != 0
@ -76,15 +69,13 @@ cmd_set_run (urj_chain_t *chain, char *params[])
return -1;
}
s = urj_part_find_signal (chain->parts->parts[chain->active_part],
params[2]);
s = urj_part_find_signal (part, params[2]);
if (!s)
{
printf (_("signal '%s' not found\n"), params[2]);
return 1;
}
urj_part_set_signal (chain->parts->parts[chain->active_part], s, dir,
data);
urj_part_set_signal (part, s, dir, data);
return 1;
}

@ -30,9 +30,6 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
//#include <urjtag/part.h>
//#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include <urjtag/cmd.h>

@ -28,7 +28,6 @@
#include <string.h>
#include <urjtag/chain.h>
#include <urjtag/jtag.h>
#include <urjtag/cmd.h>

@ -28,9 +28,9 @@
#include <stdlib.h>
#include <string.h>
#include <urjtag/chain.h>
#include <urjtag/part.h>
#include <urjtag/bssignal.h>
#include <urjtag/jtag.h>
#include <urjtag/cmd.h>
@ -47,11 +47,9 @@ cmd_signal_run (urj_chain_t *chain, char *params[])
if (!urj_cmd_test_cable (chain))
return 1;
part = urj_part_active_part (chain);
part = urj_tap_chain_active_part (chain);
if (part == NULL)
{
return 1;
}
if ((s = urj_part_find_signal (part, params[1])) != NULL)
{

@ -28,11 +28,12 @@
#include <stdio.h>
#include <string.h>
//#include <stdlib.h>
#include "urjtag/part.h"
#include "urjtag/bssignal.h"
#include "urjtag/jtag.h"
#include "urjtag/cmd.h"
#include <urjtag/chain.h>
#include <urjtag/part.h>
#include <urjtag/bssignal.h>
#include <urjtag/cmd.h>
static int
cmd_test_run (urj_chain_t *chain, char *params[])
@ -40,6 +41,7 @@ cmd_test_run (urj_chain_t *chain, char *params[])
int data;
unsigned int i;
urj_part_signal_t *s;
urj_part_t *part;
if (urj_cmd_params (params) != 4)
return -1;
@ -50,20 +52,11 @@ cmd_test_run (urj_chain_t *chain, char *params[])
if (!urj_cmd_test_cable (chain))
return 1;
if (!chain->parts)
{
printf (_("Run \"detect\" first.\n"));
part = urj_tap_chain_active_part (chain);
if (part == NULL)
return 1;
}
if (chain->active_part >= chain->parts->len)
{
printf (_("%s: no active part\n"), "get");
return 1;
}
s = urj_part_find_signal (chain->parts->parts[chain->active_part],
params[2]);
s = urj_part_find_signal (part, params[2]);
if (!s)
{
printf (_("signal '%s' not found\n"), params[2]);
@ -76,7 +69,7 @@ cmd_test_run (urj_chain_t *chain, char *params[])
if (urj_cmd_get_number (params[3], &i))
return 1;
data = urj_part_get_signal (chain->parts->parts[chain->active_part], s);
data = urj_part_get_signal (part, s);
if (data != -1)
{
if (data != i)

@ -29,7 +29,6 @@
#include <stdio.h>
#include <string.h>
#include <urjtag/jtag.h>
#include <urjtag/cmd.h>
static int

@ -25,7 +25,7 @@
#include <stdio.h>
#include <stdint.h>
#include <urjtag/jtag.h>
#include <urjtag/bus.h>
#include <urjtag/cmd.h>

@ -34,7 +34,6 @@
#include <stdio.h>
#include <unistd.h>
#include <urjtag/jtag.h>
#include <urjtag/flash.h>
#include <urjtag/bus.h>

@ -33,7 +33,6 @@
#include <stdint.h>
#include <stdlib.h>
#include <urjtag/jtag.h>
#include <urjtag/flash.h>
#include <urjtag/bus.h>

@ -43,9 +43,10 @@
#include "intel.h"
#include <urjtag/bus.h>
#include <urjtag/flash.h>
#include <urjtag/jtag.h>
#include <urjtag/flash.h>
/* @@@@ RFHH Put these into a local .h file, so the implementation can check */
extern urj_flash_driver_t urj_flash_amd_32_flash_driver;
extern urj_flash_driver_t urj_flash_amd_16_flash_driver;
extern urj_flash_driver_t urj_flash_amd_8_flash_driver;
@ -124,24 +125,16 @@ urj_flashmsbin (urj_bus_t *bus, FILE * f, int noverify)
uint32_t start;
uint32_t len;
int first, last;
uint32_t block_size =
cfi->device_geometry.erase_block_regions[0].erase_block_size;
fread (&start, sizeof start, 1, f);
fread (&len, sizeof len, 1, f);
first =
start /
(cfi->device_geometry.erase_block_regions[0].erase_block_size *
2);
last =
(start + len -
1) /
(cfi->device_geometry.erase_block_regions[0].erase_block_size *
2);
first = start / (block_size * 2);
last = (start + len - 1) / (block_size * 2);
for (; first <= last; first++)
{
adr =
first *
cfi->device_geometry.erase_block_regions[0].erase_block_size *
2;
adr = first * block_size * 2;
flash_driver->unlock_block (urj_flash_cfi_array, adr);
printf (_("block %d unlocked\n"), first);
printf (_("erasing block %d: %d\n"), first,
@ -260,8 +253,7 @@ find_block (urj_flash_cfi_query_structure_t *cfi, int adr, int bus_width,
for (i = 0; i < cfi->device_geometry.number_of_erase_regions; i++)
{
const int region_blocks =
cfi->device_geometry.erase_block_regions[i].
number_of_erase_blocks;
cfi->device_geometry.erase_block_regions[i].number_of_erase_blocks;
const int flash_block_size =
cfi->device_geometry.erase_block_regions[i].erase_block_size;
const int region_block_size =
@ -271,8 +263,7 @@ find_block (urj_flash_cfi_query_structure_t *cfi, int adr, int bus_width,
if (adr < (bb + region_size))
{
int bir = (adr - bb) / region_block_size;
*bytes_until_next_block =
bb + (bir + 1) * region_block_size - adr;
*bytes_until_next_block = bb + (bir + 1) * region_block_size - adr;
return b + bir;
}
b += region_blocks;
@ -282,7 +273,7 @@ find_block (urj_flash_cfi_query_structure_t *cfi, int adr, int bus_width,
}
void
urj_flashmem (urj_bus_t *bus, FILE * f, uint32_t addr, int noverify)
urj_flashmem (urj_bus_t *bus, FILE *f, uint32_t addr, int noverify)
{
uint32_t adr;
urj_flash_cfi_query_structure_t *cfi;
@ -310,8 +301,7 @@ urj_flashmem (urj_bus_t *bus, FILE * f, uint32_t addr, int noverify)
for (i = 0, neb = 0; i < cfi->device_geometry.number_of_erase_regions;
i++)
neb +=
cfi->device_geometry.erase_block_regions[i].
number_of_erase_blocks;
cfi->device_geometry.erase_block_regions[i].number_of_erase_blocks;
erased = malloc (neb * sizeof *erased);
if (!erased)
@ -329,10 +319,8 @@ urj_flashmem (urj_bus_t *bus, FILE * f, uint32_t addr, int noverify)
uint32_t data;
uint8_t b[BSIZE];
int bc = 0, bn = 0, btr = BSIZE;
int block_no =
find_block (cfi, adr - urj_flash_cfi_array->address, bus_width,
chip_width,
&btr);
int block_no = find_block (cfi, adr - urj_flash_cfi_array->address,
bus_width, chip_width, &btr);
write_buffer_count = 0;
write_buffer_adr = adr;
@ -374,9 +362,8 @@ urj_flashmem (urj_bus_t *bus, FILE * f, uint32_t addr, int noverify)
}
if (write_buffer_count > 0)
if (flash_driver->
program (urj_flash_cfi_array, write_buffer_adr, write_buffer,
write_buffer_count))
if (flash_driver->program (urj_flash_cfi_array, write_buffer_adr,
write_buffer, write_buffer_count))
{
printf (_("\nflash error\n"));
return;
@ -464,10 +451,8 @@ urj_flasherase (urj_bus_t *bus, uint32_t addr, int number)
for (i = 1; i <= number; i++)
{
int btr = 0;
int block_no =
find_block (cfi, addr - urj_flash_cfi_array->address, bus_width,
chip_width,
&btr);
int block_no = find_block (cfi, addr - urj_flash_cfi_array->address,
bus_width, chip_width, &btr);
if (block_no < 0)
{

@ -41,7 +41,6 @@
#include <stdlib.h>
#include <string.h>
#include <urjtag/jtag.h>
#include <urjtag/flash.h>
#include <urjtag/bus.h>
@ -49,26 +48,6 @@
#include "intel.h"
#include "mic.h"
static int intel_flash_erase_block (urj_flash_cfi_array_t *cfi_array,
uint32_t adr);
static int intel_flash_unlock_block (urj_flash_cfi_array_t *cfi_array,
uint32_t adr);
static int intel_flash_program_single (urj_flash_cfi_array_t *cfi_array,
uint32_t adr, uint32_t data);
static int intel_flash_program_buffer (urj_flash_cfi_array_t *cfi_array,
uint32_t adr, uint32_t *buffer,
int count);
static int intel_flash_program (urj_flash_cfi_array_t *cfi_array,
uint32_t adr, uint32_t *buffer, int count);
static int intel_flash_erase_block32 (urj_flash_cfi_array_t *cfi_array,
uint32_t adr);
static int intel_flash_unlock_block32 (urj_flash_cfi_array_t *cfi_array,
uint32_t adr);
static int intel_flash_program32_single (urj_flash_cfi_array_t *cfi_array,
uint32_t adr, uint32_t data);
static int intel_flash_program32 (urj_flash_cfi_array_t *cfi_array,
uint32_t adr, uint32_t *buffer, int count);
/* autodetect, we can handle this chip */
static int
intel_flash_autodetect32 (urj_flash_cfi_array_t *cfi_array)
@ -79,14 +58,15 @@ intel_flash_autodetect32 (urj_flash_cfi_array_t *cfi_array)
&area) != URJ_STATUS_OK)
return 0;
return ((cfi_array->cfi_chips[0]->cfi.identification_string.
pri_id_code == CFI_VENDOR_MITSUBISHI_SCS)
|| (cfi_array->cfi_chips[0]->cfi.identification_string.
pri_id_code == CFI_VENDOR_MITSUBISHI_ECS)
|| (cfi_array->cfi_chips[0]->cfi.identification_string.
pri_id_code == CFI_VENDOR_INTEL_ECS)
|| (cfi_array->cfi_chips[0]->cfi.identification_string.
pri_id_code == CFI_VENDOR_INTEL_SCS)) && (area.width == 32);
return ((cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code
== CFI_VENDOR_MITSUBISHI_SCS)
|| (cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code
== CFI_VENDOR_MITSUBISHI_ECS)
|| (cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code
== CFI_VENDOR_INTEL_ECS)
|| (cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code
== CFI_VENDOR_INTEL_SCS))
&& (area.width == 32);
}
static int
@ -98,14 +78,15 @@ intel_flash_autodetect (urj_flash_cfi_array_t *cfi_array)
&area) != URJ_STATUS_OK)
return 0;
return ((cfi_array->cfi_chips[0]->cfi.identification_string.
pri_id_code == CFI_VENDOR_MITSUBISHI_SCS)
|| (cfi_array->cfi_chips[0]->cfi.identification_string.
pri_id_code == CFI_VENDOR_MITSUBISHI_ECS)
|| (cfi_array->cfi_chips[0]->cfi.identification_string.
pri_id_code == CFI_VENDOR_INTEL_ECS)
|| (cfi_array->cfi_chips[0]->cfi.identification_string.
pri_id_code == CFI_VENDOR_INTEL_SCS)) && (area.width == 16);
return ((cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code
== CFI_VENDOR_MITSUBISHI_SCS)
|| (cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code
== CFI_VENDOR_MITSUBISHI_ECS)
|| (cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code
== CFI_VENDOR_INTEL_ECS)
|| (cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code
== CFI_VENDOR_INTEL_SCS))
&& (area.width == 16);
}
static int
@ -117,14 +98,15 @@ intel_flash_autodetect8 (urj_flash_cfi_array_t *cfi_array)
&area) != URJ_STATUS_OK)
return 0;
return ((cfi_array->cfi_chips[0]->cfi.identification_string.
pri_id_code == CFI_VENDOR_MITSUBISHI_SCS)
|| (cfi_array->cfi_chips[0]->cfi.identification_string.
pri_id_code == CFI_VENDOR_MITSUBISHI_ECS)
|| (cfi_array->cfi_chips[0]->cfi.identification_string.
pri_id_code == CFI_VENDOR_INTEL_ECS)
|| (cfi_array->cfi_chips[0]->cfi.identification_string.
pri_id_code == CFI_VENDOR_INTEL_SCS)) && (area.width == 8);
return ((cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code
== CFI_VENDOR_MITSUBISHI_SCS)
|| (cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code
== CFI_VENDOR_MITSUBISHI_ECS)
|| (cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code
== CFI_VENDOR_INTEL_ECS)
|| (cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code
== CFI_VENDOR_INTEL_SCS))
&& (area.width == 8);
}
static void
@ -133,9 +115,7 @@ _intel_flash_print_info (urj_flash_cfi_array_t *cfi_array, int o)
uint32_t mid, cid;
urj_bus_t *bus = cfi_array->bus;
mid =
(URJ_BUS_READ (bus, cfi_array->address + (0x00 << o)) &
0xFF);
mid = (URJ_BUS_READ (bus, cfi_array->address + (0x00 << o)) & 0xFF);
switch (mid)
{
case STD_MIC_INTEL:
@ -153,9 +133,7 @@ _intel_flash_print_info (urj_flash_cfi_array_t *cfi_array, int o)
}
printf (_("Chip: "));
cid =
(URJ_BUS_READ (bus, cfi_array->address + (0x01 << o)) &
0xFFFF);
cid = (URJ_BUS_READ (bus, cfi_array->address + (0x01 << o)) & 0xFFFF);
switch (cid)
{
case 0x0016:

@ -28,7 +28,6 @@
#include <stdio.h>
#include <unistd.h>
#include <urjtag/jtag.h>
#include <urjtag/flash.h>
#include <urjtag/bus.h>
@ -107,604 +106,291 @@ struct amd_flash_info
static const struct amd_flash_info table[] = {
{
.mfr_id = MANUFACTURER_AMD,
.dev_id = AM29LV160DT,
.name = "AMD AM29LV160DT",
.size = 0x00200000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{.offset = 0x000000,.erasesize = 0x10000,.numblocks = 31},
{.offset = 0x1F0000,.erasesize = 0x08000,.numblocks = 1},
{.offset = 0x1F8000,.erasesize = 0x02000,.numblocks = 2},
{.offset = 0x1FC000,.erasesize = 0x04000,.numblocks = 1}
}
}, {
.mfr_id = MANUFACTURER_AMD,
.dev_id = AM29LV160DB,
.name = "AMD AM29LV160DB",
.size = 0x00200000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{.offset = 0x000000,.erasesize = 0x04000,.numblocks = 1},
{.offset = 0x004000,.erasesize = 0x02000,.numblocks = 2},
{.offset = 0x008000,.erasesize = 0x08000,.numblocks = 1},
{.offset = 0x010000,.erasesize = 0x10000,.numblocks = 31}
}
}, {
.mfr_id = MANUFACTURER_TOSHIBA,
.dev_id = TC58FVT160,
.name = "Toshiba TC58FVT160",
.size = 0x00200000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{.offset = 0x000000,.erasesize = 0x10000,.numblocks =
31},
{.offset = 0x1F0000,.erasesize = 0x08000,.numblocks =
1},
{.offset = 0x1F8000,.erasesize = 0x02000,.numblocks =
2},
{.offset = 0x1FC000,.erasesize = 0x04000,.numblocks =
1}
}
}, {
.mfr_id = MANUFACTURER_FUJITSU,
.dev_id = MBM29LV160TE,
.name = "Fujitsu MBM29LV160TE",
.size = 0x00200000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{.offset = 0x000000,.erasesize =
0x10000,.numblocks = 31},
{.offset = 0x1F0000,.erasesize =
0x08000,.numblocks = 1},
{.offset = 0x1F8000,.erasesize =
0x02000,.numblocks = 2},
{.offset = 0x1FC000,.erasesize =
0x04000,.numblocks = 1}
}
}, {
.mfr_id = MANUFACTURER_TOSHIBA,
.dev_id = TC58FVB160,
.name = "Toshiba TC58FVB160",
.size = 0x00200000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{.offset = 0x000000,.erasesize =
0x04000,.numblocks = 1},
{.offset = 0x004000,.erasesize =
0x02000,.numblocks = 2},
{.offset = 0x008000,.erasesize =
0x08000,.numblocks = 1},
{.offset = 0x010000,.erasesize =
0x10000,.numblocks = 31}
}
}, {
.mfr_id = MANUFACTURER_FUJITSU,
.dev_id = MBM29LV160BE,
.name = "Fujitsu MBM29LV160BE",
.size = 0x00200000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{.offset = 0x000000,.erasesize =
0x04000,.numblocks = 1},
{.offset = 0x004000,.erasesize =
0x02000,.numblocks = 2},
{.offset = 0x008000,.erasesize =
0x08000,.numblocks = 1},
{.offset = 0x010000,.erasesize =
0x10000,.numblocks = 31}
}
}, {
.mfr_id = MANUFACTURER_AMD,
.dev_id = AM29LV800BB,
.name = "AMD AM29LV800BB",
.size = 0x00100000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{.offset = 0x000000,.erasesize =
0x04000,.numblocks = 1},
{.offset = 0x004000,.erasesize =
0x02000,.numblocks = 2},
{.offset = 0x008000,.erasesize =
0x08000,.numblocks = 1},
{.offset = 0x010000,.erasesize =
0x10000,.numblocks = 15}
}
}, {
.mfr_id = MANUFACTURER_AMD,
.dev_id = AM29F800BB,
.name = "AMD AM29F800BB",
.size = 0x00100000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{.offset = 0x000000,.erasesize =
0x04000,.numblocks = 1},
{.offset = 0x004000,.erasesize =
0x02000,.numblocks = 2},
{.offset = 0x008000,.erasesize =
0x08000,.numblocks = 1},
{.offset = 0x010000,.erasesize =
0x10000,.numblocks = 15}
}
}, {
.mfr_id = MANUFACTURER_AMD,
.dev_id = AM29LV800BT,
.name = "AMD AM29LV800BT",
.size = 0x00100000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{.offset =
0x000000,.erasesize =
0x10000,.numblocks = 15},
{.offset =
0x0F0000,.erasesize =
0x08000,.numblocks = 1},
{.offset =
0x0F8000,.erasesize =
0x02000,.numblocks = 2},
{.offset =
0x0FC000,.erasesize =
0x04000,.numblocks = 1}
}
}, {
.mfr_id = MANUFACTURER_AMD,
.dev_id = AM29F800BT,
.name = "AMD AM29F800BT",
.size = 0x00100000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{.offset =
0x000000,.erasesize =
0x10000,.numblocks =
15},
{.offset =
0x0F0000,.erasesize =
0x08000,.numblocks = 1},
{.offset =
0x0F8000,.erasesize =
0x02000,.numblocks = 2},
{.offset =
0x0FC000,.erasesize =
0x04000,.numblocks = 1}
}
}, {
.mfr_id = MANUFACTURER_AMD,
.dev_id = AM29LV800BB,
.name = "AMD AM29LV800BB",
.size = 0x00100000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{.offset =
0x000000,.
erasesize =
0x10000,.numblocks =
15},
{.offset =
0x0F0000,.
erasesize =
0x08000,.numblocks =
1},
{.offset =
0x0F8000,.
erasesize =
0x02000,.numblocks =
2},
{.offset =
0x0FC000,.
erasesize =
0x04000,.numblocks =
1}
}
}, {
.mfr_id =
MANUFACTURER_FUJITSU,
.dev_id = MBM29LV800BB,
.name =
"Fujitsu MBM29LV800BB",
.size = 0x00100000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{.offset =
0x000000,.
erasesize =
0x04000,.
numblocks = 1},
{.offset =
0x004000,.
erasesize =
0x02000,.
numblocks = 2},
{.offset =
0x008000,.
erasesize =
0x08000,.
numblocks = 1},
{.offset =
0x010000,.
erasesize =
0x10000,.
numblocks = 15}
}
}, {
.mfr_id =
MANUFACTURER_ST,
.dev_id = M29W800T,
.name = "ST M29W800T",
.size = 0x00100000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method =
AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{.offset =
0x000000,.
erasesize =
0x10000,.
numblocks =
15},
{.offset =
0x0F0000,.
erasesize =
0x08000,.
numblocks =
1},
{.offset =
0x0F8000,.
erasesize =
0x02000,.
numblocks =
2},
{.offset =
0x0FC000,.
erasesize =
0x04000,.
numblocks =
1}
}
}, {
.mfr_id =
MANUFACTURER_ST,
.dev_id = M29W160DT,
.name =
"ST M29W160DT",
.size = 0x00200000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method =
AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{.
offset =
0x000000,.
erasesize
=
0x10000,.
numblocks
= 31},
{.
offset =
0x1F0000,.
erasesize
=
0x08000,.
numblocks
= 1},
{.
offset =
0x1F8000,.
erasesize
=
0x02000,.
numblocks
= 2},
{.
offset =
0x1FC000,.
erasesize
=
0x04000,.
numblocks
= 1}
}
}, {
.mfr_id =
MANUFACTURER_ST,
.dev_id =
M29W160DB,
.name =
"ST M29W160DB",
.size =
0x00200000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method =
AUTOSELECT_M1,
.
numeraseregions =
4,
.regions = {
{.
offset
=
0x000000,.
erasesize
=
0x04000,.
numblocks
=
1},
{.
offset
=
0x004000,.
erasesize
=
0x02000,.
numblocks
=
2},
{.
offset
=
0x008000,.
erasesize
=
0x08000,.
numblocks
=
1},
{.
offset
=
0x010000,.
erasesize
=
0x10000,.
numblocks
=
31}
}
}, {
.mfr_id =
MANUFACTURER_AMD,
.dev_id =
AM29BDS323D,
.name =
"AMD AM29BDS323D",
.size =
0x00400000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method =
AUTOSELECT_M1,
.
numeraseregions
= 3,
.regions = {
{.offset = 0x000000,.erasesize = 0x10000,.numblocks = 48},
{.offset = 0x300000,.erasesize = 0x10000,.numblocks = 15},
{.offset = 0x3f0000,.erasesize = 0x02000,.numblocks = 8},
}
}, {
.mfr_id =
MANUFACTURER_AMD,
.dev_id =
AM29BDS643D,
.name =
"AMD AM29BDS643D",
.size =
0x00800000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.
as_method
=
AUTOSELECT_M1,
.
numeraseregions
= 3,
.
regions =
{
{.
offset
=
0x000000,.
erasesize
=
0x10000,.
numblocks
= 96},
{.
offset
=
0x600000,.
erasesize
=
0x10000,.
numblocks
= 31},
{.
offset
=
0x7f0000,.
erasesize
=
0x02000,.
numblocks
= 8},
}
}, {
.
mfr_id
=
MANUFACTURER_ATMEL,
.
dev_id
=
AT49xV16x,
.
name
=
"Atmel AT49xV16x",
.
size
=
0x00200000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.
as_method
=
AUTOSELECT_M1,
.
numeraseregions
= 2,
.
regions
= {
{.
offset
=
0x000000,.
erasesize
=
0x02000,.
numblocks
=
8},
{.
offset
=
0x010000,.
erasesize
=
0x10000,.
numblocks
=
31}
}
}, {
.
mfr_id
=
MANUFACTURER_ATMEL,
.
dev_id
=
AT49xV16xT,
.
name
=
"Atmel AT49xV16xT",
.
size
=
0x00200000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.
as_method
=
AUTOSELECT_M1,
.
numeraseregions
=
2,
.
regions
=
{
{.offset = 0x000000,.erasesize = 0x10000,.numblocks = 31},
{.offset = 0x1F0000,.erasesize = 0x02000,.numblocks = 8}
}
}, {
.
mfr_id
=
MANUFACTURER_MX,
.
dev_id
=
MX29LV400T,
.
name
=
"MX 29LV400T",
.
size
=
0x0080000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.
as_method
=
AUTOSELECT_M1,
.
numeraseregions
=
4,
.
regions
=
{
{.offset = 0x000000,.erasesize = 0x10000,.numblocks = 7},
{.offset = 0x070000,.erasesize = 0x08000,.numblocks = 1},
{.offset = 0x078000,.erasesize = 0x02000,.numblocks = 2},
{.offset = 0x07c000,.erasesize = 0x04000,.numblocks = 1},
}
}, {
.
mfr_id
=
MANUFACTURER_AMD,
.
dev_id
=
AM29LV040B,
.
name
=
"AMD AM29LV040B",
.
size
=
0x0080000,
.interface_width = CFI_INTERFACE_X8, /* checked, ok */
.
as_method
=
AUTOSELECT_M2,
.
numeraseregions
=
1,
.
regions
=
{
{.offset = 0x000000,.erasesize = 0x10000,.numblocks = 8},
}
}
.mfr_id = MANUFACTURER_AMD,
.dev_id = AM29LV160DT,
.name = "AMD AM29LV160DT",
.size = 0x00200000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{ .offset = 0x000000, .erasesize = 0x10000, .numblocks = 31 },
{ .offset = 0x1F0000, .erasesize = 0x08000, .numblocks = 1 },
{ .offset = 0x1F8000, .erasesize = 0x02000, .numblocks = 2 },
{ .offset = 0x1FC000, .erasesize = 0x04000, .numblocks = 1 }
}
}, {
.mfr_id = MANUFACTURER_AMD,
.dev_id = AM29LV160DB,
.name = "AMD AM29LV160DB",
.size = 0x00200000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{ .offset = 0x000000, .erasesize = 0x04000, .numblocks = 1 },
{ .offset = 0x004000, .erasesize = 0x02000, .numblocks = 2 },
{ .offset = 0x008000, .erasesize = 0x08000, .numblocks = 1 },
{ .offset = 0x010000, .erasesize = 0x10000, .numblocks = 31 }
}
}, {
.mfr_id = MANUFACTURER_TOSHIBA,
.dev_id = TC58FVT160,
.name = "Toshiba TC58FVT160",
.size = 0x00200000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{ .offset = 0x000000, .erasesize = 0x10000, .numblocks = 31 },
{ .offset = 0x1F0000, .erasesize = 0x08000, .numblocks = 1 },
{ .offset = 0x1F8000, .erasesize = 0x02000, .numblocks = 2 },
{ .offset = 0x1FC000, .erasesize = 0x04000, .numblocks = 1 }
}
}, {
.mfr_id = MANUFACTURER_FUJITSU,
.dev_id = MBM29LV160TE,
.name = "Fujitsu MBM29LV160TE",
.size = 0x00200000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{ .offset = 0x000000, .erasesize = 0x10000, .numblocks = 31 },
{ .offset = 0x1F0000, .erasesize = 0x08000, .numblocks = 1 },
{ .offset = 0x1F8000, .erasesize = 0x02000, .numblocks = 2 },
{ .offset = 0x1FC000, .erasesize = 0x04000, .numblocks = 1 }
}
}, {
.mfr_id = MANUFACTURER_TOSHIBA,
.dev_id = TC58FVB160,
.name = "Toshiba TC58FVB160",
.size = 0x00200000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{ .offset = 0x000000, .erasesize = 0x04000, .numblocks = 1 },
{ .offset = 0x004000, .erasesize = 0x02000, .numblocks = 2 },
{ .offset = 0x008000, .erasesize = 0x08000, .numblocks = 1 },
{ .offset = 0x010000, .erasesize = 0x10000, .numblocks = 31 }
}
}, {
.mfr_id = MANUFACTURER_FUJITSU,
.dev_id = MBM29LV160BE,
.name = "Fujitsu MBM29LV160BE",
.size = 0x00200000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{ .offset = 0x000000, .erasesize = 0x04000, .numblocks = 1 },
{ .offset = 0x004000, .erasesize = 0x02000, .numblocks = 2 },
{ .offset = 0x008000, .erasesize = 0x08000, .numblocks = 1 },
{ .offset = 0x010000, .erasesize = 0x10000, .numblocks = 31 }
}
}, {
.mfr_id = MANUFACTURER_AMD,
.dev_id = AM29LV800BB,
.name = "AMD AM29LV800BB",
.size = 0x00100000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{ .offset = 0x000000, .erasesize = 0x04000, .numblocks = 1 },
{ .offset = 0x004000, .erasesize = 0x02000, .numblocks = 2 },
{ .offset = 0x008000, .erasesize = 0x08000, .numblocks = 1 },
{ .offset = 0x010000, .erasesize = 0x10000, .numblocks = 15 }
}
}, {
.mfr_id = MANUFACTURER_AMD,
.dev_id = AM29F800BB,
.name = "AMD AM29F800BB",
.size = 0x00100000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{ .offset = 0x000000, .erasesize = 0x04000, .numblocks = 1 },
{ .offset = 0x004000, .erasesize = 0x02000, .numblocks = 2 },
{ .offset = 0x008000, .erasesize = 0x08000, .numblocks = 1 },
{ .offset = 0x010000, .erasesize = 0x10000, .numblocks = 15 }
}
}, {
.mfr_id = MANUFACTURER_AMD,
.dev_id = AM29LV800BT,
.name = "AMD AM29LV800BT",
.size = 0x00100000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{ .offset = 0x000000, .erasesize = 0x10000, .numblocks = 15 },
{ .offset = 0x0F0000, .erasesize = 0x08000, .numblocks = 1 },
{ .offset = 0x0F8000, .erasesize = 0x02000, .numblocks = 2 },
{ .offset = 0x0FC000, .erasesize = 0x04000, .numblocks = 1 }
}
}, {
.mfr_id = MANUFACTURER_AMD,
.dev_id = AM29F800BT,
.name = "AMD AM29F800BT",
.size = 0x00100000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{ .offset = 0x000000, .erasesize = 0x10000, .numblocks = 15 },
{ .offset = 0x0F0000, .erasesize = 0x08000, .numblocks = 1 },
{ .offset = 0x0F8000, .erasesize = 0x02000, .numblocks = 2 },
{ .offset = 0x0FC000, .erasesize = 0x04000, .numblocks = 1 }
}
}, {
.mfr_id = MANUFACTURER_AMD,
.dev_id = AM29LV800BB,
.name = "AMD AM29LV800BB",
.size = 0x00100000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{ .offset = 0x000000, .erasesize = 0x10000, .numblocks = 15 },
{ .offset = 0x0F0000, .erasesize = 0x08000, .numblocks = 1 },
{ .offset = 0x0F8000, .erasesize = 0x02000, .numblocks = 2 },
{ .offset = 0x0FC000, .erasesize = 0x04000, .numblocks = 1 }
}
}, {
.mfr_id = MANUFACTURER_FUJITSU,
.dev_id = MBM29LV800BB,
.name = "Fujitsu MBM29LV800BB",
.size = 0x00100000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{ .offset = 0x000000, .erasesize = 0x04000, .numblocks = 1 },
{ .offset = 0x004000, .erasesize = 0x02000, .numblocks = 2 },
{ .offset = 0x008000, .erasesize = 0x08000, .numblocks = 1 },
{ .offset = 0x010000, .erasesize = 0x10000, .numblocks = 15 }
}
}, {
.mfr_id = MANUFACTURER_ST,
.dev_id = M29W800T,
.name = "ST M29W800T",
.size = 0x00100000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{ .offset = 0x000000, .erasesize = 0x10000, .numblocks = 15 },
{ .offset = 0x0F0000, .erasesize = 0x08000, .numblocks = 1 },
{ .offset = 0x0F8000, .erasesize = 0x02000, .numblocks = 2 },
{ .offset = 0x0FC000, .erasesize = 0x04000, .numblocks = 1 }
}
}, {
.mfr_id = MANUFACTURER_ST,
.dev_id = M29W160DT,
.name = "ST M29W160DT",
.size = 0x00200000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{ .offset = 0x000000, .erasesize = 0x10000, .numblocks = 31 },
{ .offset = 0x1F0000, .erasesize = 0x08000, .numblocks = 1 },
{ .offset = 0x1F8000, .erasesize = 0x02000, .numblocks = 2 },
{ .offset = 0x1FC000, .erasesize = 0x04000, .numblocks = 1 }
}
}, {
.mfr_id = MANUFACTURER_ST,
.dev_id = M29W160DB,
.name = "ST M29W160DB",
.size = 0x00200000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{ .offset = 0x000000, .erasesize = 0x04000, .numblocks = 1 },
{ .offset = 0x004000, .erasesize = 0x02000, .numblocks = 2 },
{ .offset = 0x008000, .erasesize = 0x08000, .numblocks = 1 },
{ .offset = 0x010000, .erasesize = 0x10000, .numblocks = 31 }
}
}, {
.mfr_id = MANUFACTURER_AMD,
.dev_id = AM29BDS323D,
.name = "AMD AM29BDS323D",
.size = 0x00400000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 3,
.regions = {
{ .offset = 0x000000, .erasesize = 0x10000, .numblocks = 48 },
{ .offset = 0x300000, .erasesize = 0x10000, .numblocks = 15 },
{ .offset = 0x3f0000, .erasesize = 0x02000, .numblocks = 8 },
}
}, {
.mfr_id = MANUFACTURER_AMD,
.dev_id = AM29BDS643D,
.name = "AMD AM29BDS643D",
.size = 0x00800000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 3,
.regions = {
{ .offset = 0x000000, .erasesize = 0x10000, .numblocks = 96 },
{ .offset = 0x600000, .erasesize = 0x10000, .numblocks = 31 },
{ .offset = 0x7f0000, .erasesize = 0x02000, .numblocks = 8 },
}
}, {
.mfr_id = MANUFACTURER_ATMEL,
.dev_id = AT49xV16x,
.name = "Atmel AT49xV16x",
.size = 0x00200000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 2,
.regions = {
{ .offset = 0x000000, .erasesize = 0x02000, .numblocks = 8 },
{ .offset = 0x010000, .erasesize = 0x10000, .numblocks = 31 }
}
}, {
.mfr_id = MANUFACTURER_ATMEL,
.dev_id = AT49xV16xT,
.name = "Atmel AT49xV16xT",
.size = 0x00200000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 2,
.regions = {
{ .offset = 0x000000, .erasesize = 0x10000, .numblocks = 31 },
{ .offset = 0x1F0000, .erasesize = 0x02000, .numblocks = 8 }
}
}, {
.mfr_id = MANUFACTURER_MX,
.dev_id = MX29LV400T,
.name = "MX 29LV400T",
.size = 0x0080000,
.interface_width = CFI_INTERFACE_X16, /* correct default? */
.as_method = AUTOSELECT_M1,
.numeraseregions = 4,
.regions = {
{ .offset = 0x000000, .erasesize = 0x10000, .numblocks = 7 },
{ .offset = 0x070000, .erasesize = 0x08000, .numblocks = 1 },
{ .offset = 0x078000, .erasesize = 0x02000, .numblocks = 2 },
{ .offset = 0x07c000, .erasesize = 0x04000, .numblocks = 1 },
}
}, {
.mfr_id = MANUFACTURER_AMD,
.dev_id = AM29LV040B,
.name = "AMD AM29LV040B",
.size = 0x0080000,
.interface_width = CFI_INTERFACE_X8, /* checked, ok */
.as_method = AUTOSELECT_M2,
.numeraseregions = 1,
.regions = {
{ .offset = 0x000000, .erasesize = 0x10000, .numblocks = 8 },
}
}
};
int

@ -28,7 +28,6 @@
#include <stdio.h>
#include <unistd.h>
#include <urjtag/jtag.h>
#include <urjtag/flash.h>
#include <urjtag/bus.h>
#include <urjtag/bitmask.h>

@ -26,4 +26,8 @@ include $(top_srcdir)/Makefile.rules
noinst_LTLIBRARIES = libglobal.la
libglobal_la_SOURCES = \
urjtag.c
parse.c \
urjtag.c \
data_dir.c
AM_CPPFLAGS = -DJTAG_BIN_DIR=\"$(bindir)\" -DJTAG_DATA_DIR=\"$(pkgdatadir)\"

@ -11,7 +11,7 @@
static const char *jtag_argv0;
void
urj_cmd_jtag_set_argv0(const char *argv0)
urj_set_argv0(const char *argv0)
{
jtag_argv0 = argv0;
}
@ -28,7 +28,7 @@ extern char *make_relative_prefix (const char *progname,
static char *jtag_data_dir = NULL;
const char *
urj_cmd_jtag_get_data_dir (void)
urj_get_data_dir (void)
{
if (jtag_data_dir)
return jtag_data_dir;
@ -44,7 +44,7 @@ urj_cmd_jtag_get_data_dir (void)
#else
const char *
urj_cmd_jtag_get_data_dir (void)
urj_get_data_dir (void)
{
return JTAG_DATA_DIR;
}

@ -30,8 +30,10 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <urjtag/chain.h>
#include <urjtag/parse.h>
#include <urjtag/cmd.h>
#include <urjtag/jtag.h>
@ -40,7 +42,7 @@
int
urj_cmd_jtag_parse_line (urj_chain_t *chain, char *line)
urj_parse_line (urj_chain_t *chain, char *line)
{
int l, i, r, tcnt;
char **a;
@ -111,7 +113,7 @@ urj_cmd_jtag_parse_line (urj_chain_t *chain, char *line)
r = urj_cmd_run (chain, a);
if (urj_debug_mode & 1)
printf ("Return in urj_cmd_jtag_parse_line r=%d\n", r);
printf ("Return in urj_parse_line r=%d\n", r);
free (a);
free (sline);
return r;
@ -119,7 +121,7 @@ urj_cmd_jtag_parse_line (urj_chain_t *chain, char *line)
int
urj_cmd_jtag_parse_stream (urj_chain_t *chain, FILE * f)
urj_parse_stream (urj_chain_t *chain, FILE * f)
{
char inputline[MAXINPUTLINE + 1];
int go = 1, i, c, lnr, clip, found_comment;
@ -151,7 +153,7 @@ urj_cmd_jtag_parse_stream (urj_chain_t *chain, FILE * f)
fprintf (stdout,
"Warning: line %d exceeds %d characters, clipped\n", lnr,
(int) sizeof (inputline) - 1);
go = urj_cmd_jtag_parse_line (chain, inputline);
go = urj_parse_line (chain, inputline);
urj_tap_chain_flush (chain);
}
while (go && c != EOF);
@ -160,16 +162,20 @@ urj_cmd_jtag_parse_stream (urj_chain_t *chain, FILE * f)
}
int
urj_cmd_jtag_parse_file (urj_chain_t *chain, const char *filename)
urj_parse_file (urj_chain_t *chain, const char *filename)
{
FILE *f;
int go;
f = fopen (filename, "r");
if (!f)
{
urj_error_set(URJ_ERROR_IO, "Cannot open file '%s' to parse: %s", filename, strerror(errno));
errno = 0;
return -1;
}
go = urj_cmd_jtag_parse_stream (chain, f);
go = urj_parse_stream (chain, f);
fclose (f);
if (urj_debug_mode & 1)

@ -98,25 +98,6 @@ urj_part_salias_free (urj_part_salias_t *salias)
free (salias);
}
urj_part_t *
urj_part_active_part(urj_chain_t *chain)
{
if (!chain->parts)
{
urj_error_set (URJ_ERROR_NO_ACTIVE_PART,
_("Run \"detect\" first.\n"));
return NULL;
}
if (chain->active_part >= chain->parts->len)
{
urj_error_set (URJ_ERROR_NO_ACTIVE_PART,
_("%s: no active part\n"), "signal");
return NULL;
}
return chain->parts->parts[chain->active_part];
}
urj_part_signal_t *
urj_part_signal_define_pin (urj_chain_t *chain, const char *signal_name,
const char *pin_name)
@ -124,7 +105,7 @@ urj_part_signal_define_pin (urj_chain_t *chain, const char *signal_name,
urj_part_t *part;
urj_part_signal_t *s;
part = urj_part_active_part (chain);
part = urj_tap_chain_active_part (chain);
if (urj_part_find_signal (part, signal_name) != NULL)
{

@ -40,11 +40,10 @@
#define SA_ONESHOT SA_RESETHAND
#endif
#include <urjtag/jtag.h>
#include <urjtag/cable.h>
#include <urjtag/part.h>
#include <urjtag/tap.h>
#include <urjtag/tap_state.h>
#include <urjtag/tap_register.h>
#include <urjtag/part_instruction.h>
#include <urjtag/data_register.h>
@ -848,9 +847,8 @@ urj_svf_sxr (urj_chain_t *chain, urj_svf_parser_priv_t *priv,
urj_svf_sxr_t *sxr_params;
int len, result = 1;
sxr_params =
ir_dr ==
URJ_SVF_generic_ir ? &(priv->sir_params) : &(priv->sdr_params);
sxr_params = (ir_dr == URJ_SVF_generic_ir) ?
&(priv->sir_params) : &(priv->sdr_params);
/* remember parameters */
urj_svf_remember_param (&sxr_params->params.tdi, params->tdi);

@ -28,13 +28,13 @@
#include <urjtag/sysdep.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <stdint.h>
#include <string.h>
#include <urjtag/jtag.h>
#include <urjtag/cable.h>
#undef VERBOSE

@ -43,7 +43,6 @@
#include <urjtag/cable.h>
#include <urjtag/chain.h>
#include <urjtag/jtag.h>
#include <usb.h>
#include <string.h>

@ -282,3 +282,22 @@ urj_tap_chain_flush (urj_chain_t *chain)
if (chain->cable != NULL)
urj_tap_cable_flush (chain->cable, URJ_TAP_CABLE_COMPLETELY);
}
urj_part_t *
urj_tap_chain_active_part (urj_chain_t *chain)
{
if (!chain->parts)
{
urj_error_set (URJ_ERROR_NO_ACTIVE_PART,
_("Run \"detect\" first.\n"));
return NULL;
}
if (chain->active_part >= chain->parts->len)
{
urj_error_set (URJ_ERROR_NO_ACTIVE_PART,
_("%s: no active part\n"), "signal");
return NULL;
}
return chain->parts->parts[chain->active_part];
}

@ -40,7 +40,6 @@
#include <urjtag/part.h>
#include <urjtag/chain.h>
#include <urjtag/jtag.h>
struct id_record
{

@ -27,11 +27,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <urjtag/cable.h>
#include <urjtag/tap.h>
#include <urjtag/tap_register.h>
#include <urjtag/chain.h>
#include <urjtag/jtag.h>
#define DETECT_PATTERN_SIZE 8
#define MAX_REGISTER_LENGTH 1024

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save