Trying to restore the mv i.s.o. the delete/add: Step I -- does not compile
git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1542 b68d4a1b-bc3d-0410-92ed-d4ac073336b7master
parent
adf6ffa644
commit
3dd4f713ea
@ -1,68 +0,0 @@
|
||||
/*
|
||||
* $Id: bitmask.h 1521 2009-04-23 13:33:47Z rfhh $
|
||||
*
|
||||
* Common header file
|
||||
* Copyright (C) 2002 ETC s.r.o.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the ETC s.r.o. nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Written by Marcel Telka <marcel@telka.sk>, 2002.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef URJ_BITMASK_H
|
||||
#define URJ_BITMASK_H
|
||||
|
||||
#ifdef UNUSED /* RFHH */
|
||||
/* @@@@ RFHH remove? */
|
||||
#ifndef LANGUAGE
|
||||
# ifdef __ASSEMBLY__
|
||||
# define LANGUAGE ASM
|
||||
# else
|
||||
# define LANGUAGE C
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* @@@@ RFHH remove? */
|
||||
#ifndef ASM
|
||||
#define ASM 0
|
||||
#endif
|
||||
|
||||
/* @@@@ RFHH remove? */
|
||||
#ifndef C
|
||||
#define C 1
|
||||
#endif
|
||||
#endif /* def UNUSED */
|
||||
|
||||
#define URJ_MAX_BITS_ABS_VAL 1024
|
||||
#define URJ_BITS_ABS(a) (((((a) + URJ_MAX_BITS_ABS_VAL) / URJ_MAX_BITS_ABS_VAL) * 2 - 1) * (a))
|
||||
#define URJ_BITS_MIN(a,b) (((a) + (b) - URJ_BITS_ABS((a) - (b))) / 2)
|
||||
|
||||
#define URJ_BIT(b) (1 << (b))
|
||||
#define URJ_BITS(b1,b2) (((2 << URJ_BITS_ABS((b1) - (b2))) - 1) << URJ_BITS_MIN(b1,b2))
|
||||
#define URJ_BITS_VAL(b1,b2,v) (((v) << URJ_BITS_MIN(b1,b2)) & URJ_BITS (b1,b2))
|
||||
#define URJ_BITS_GET(b1,b2,v) (((v) & URJ_BITS (b1,b2)) >> URJ_BITS_MIN(b1,b2))
|
||||
|
||||
#endif /* URJ_BITMASK_H */
|
@ -1,81 +0,0 @@
|
||||
/*
|
||||
* $Id: bsbit.h 1521 2009-04-23 13:33:47Z rfhh $
|
||||
*
|
||||
* Copyright (C) 2002 ETC s.r.o.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Written by Marcel Telka <marcel@telka.sk>, 2002.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef URJ_BSBIT_BSBIT_H
|
||||
#define URJ_BSBIT_BSBIT_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#define URJ_BSBIT_INPUT 1
|
||||
#define URJ_BSBIT_OUTPUT 2
|
||||
#define URJ_BSBIT_CONTROL 3
|
||||
#define URJ_BSBIT_INTERNAL 4
|
||||
#define URJ_BSBIT_BIDIR 5
|
||||
|
||||
#define URJ_BSBIT_STATE_Z (-1)
|
||||
|
||||
struct urj_bsbit
|
||||
{
|
||||
int bit;
|
||||
char *name;
|
||||
int type;
|
||||
urj_part_signal_t *signal;
|
||||
int safe; /* safe value */
|
||||
int control; /* -1 for none */
|
||||
int control_value;
|
||||
int control_state;
|
||||
};
|
||||
|
||||
/**
|
||||
* Define new BSR (Boundary Scan Register) bit for signal <code>name</code>.
|
||||
*
|
||||
* @param chain
|
||||
* @param bit
|
||||
* @param name associated signal name
|
||||
* @param type URJ_BSBIT_{INPUT|OUTPUT|BIDIR|CONTROL|INTERNAL}
|
||||
* @param safe default (safe) value (0|1)
|
||||
*/
|
||||
urj_bsbit_t *urj_part_bsbit_alloc (urj_chain_t *chain, int bit,
|
||||
const char *name, int type, int safe);
|
||||
/**
|
||||
* Define new BSR (Boundary Scan Register) bit for signal <code>name</code>.
|
||||
* Additionally, define control bit.
|
||||
*
|
||||
* @param chain
|
||||
* @param bit
|
||||
* @param name associated signal name
|
||||
* @param type URJ_BSBIT_{INPUT|OUTPUT|BIDIR|CONTROL|INTERNAL}
|
||||
* @param safe default (safe) value (0|1)
|
||||
* @param ctrl_num control bit number
|
||||
* @param ctrl_val control value
|
||||
* @param ctrl_state control state; valid statis is only URJ_BSBIT_STATE_Z
|
||||
*/
|
||||
urj_bsbit_t *urj_part_bsbit_alloc_control (urj_chain_t *chain, int bit,
|
||||
const char *name, int type, int safe,
|
||||
int ctrl_num, int ctrl_val,
|
||||
int ctrl_state);
|
||||
|
||||
void urj_part_bsbit_free (urj_bsbit_t *b);
|
||||
|
||||
#endif /* URJ_BSBIT_BSBIT_H */
|
@ -1,48 +0,0 @@
|
||||
/*
|
||||
* $Id: bsdl.h 1519 2009-04-22 23:12:44Z rfhh $
|
||||
*
|
||||
* Copyright (C) 2007, Arnim Laeuger
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Written by Arnim Laeuger <arniml@users.sourceforge.net>, 2007.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef URJ_BSDL_BSDL_H
|
||||
#define URJ_BSDL_BSDL_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "bsdl_mode.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char **path_list;
|
||||
int debug;
|
||||
} urj_bsdl_globs_t;
|
||||
|
||||
#define URJ_BSDL_GLOBS_INIT(bsdl) \
|
||||
do { \
|
||||
bsdl.path_list = NULL; \
|
||||
bsdl.debug = 0; \
|
||||
} while (0)
|
||||
|
||||
int urj_bsdl_read_file (urj_chain_t *, const char *, int, const char *);
|
||||
void urj_bsdl_set_path (urj_chain_t *, const char *);
|
||||
int urj_bsdl_scan_files (urj_chain_t *, const char *, int);
|
||||
|
||||
#endif /* URJ_BSDL_BSDL_H */
|
@ -1,66 +0,0 @@
|
||||
/*
|
||||
* $Id: bsdl_mode.h 1520 2009-04-23 13:14:08Z rfhh $
|
||||
*
|
||||
* Copyright (C) 2008, Arnim Laeuger
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Written by Arnim Laeuger <arniml@users.sourceforge.net>, 2008.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef URJ_BSDL_MODE_H
|
||||
#define URJ_BSDL_MODE_H
|
||||
|
||||
#define URJ_BSDL_MODE_MSG_NOTE (1 << 0)
|
||||
#define URJ_BSDL_MODE_MSG_WARN (1 << 1)
|
||||
#define URJ_BSDL_MODE_MSG_ERR (1 << 2)
|
||||
#define URJ_BSDL_MODE_MSG_FATAL (1 << 3)
|
||||
|
||||
#define URJ_BSDL_MODE_MSG_ALL (URJ_BSDL_MODE_MSG_FATAL | \
|
||||
URJ_BSDL_MODE_MSG_ERR | \
|
||||
URJ_BSDL_MODE_MSG_WARN | \
|
||||
URJ_BSDL_MODE_MSG_NOTE)
|
||||
#define URJ_BSDL_MODE_MSG_ALWAYS URJ_BSDL_MODE_MSG_FATAL
|
||||
|
||||
#define URJ_BSDL_MODE_SYN_CHECK (1 << 4)
|
||||
#define URJ_BSDL_MODE_INSTR_PRINT (1 << 5)
|
||||
#define URJ_BSDL_MODE_INSTR_EXEC (1 << 6)
|
||||
#define URJ_BSDL_MODE_IDCODE_CHECK (1 << 7)
|
||||
#define URJ_BSDL_MODE_ACTION_ALL (URJ_BSDL_MODE_SYN_CHECK | \
|
||||
URJ_BSDL_MODE_INSTR_PRINT | \
|
||||
URJ_BSDL_MODE_INSTR_EXEC | \
|
||||
URJ_BSDL_MODE_IDCODE_CHECK)
|
||||
|
||||
#define URJ_BSDL_MODE_INCLUDE1 (URJ_BSDL_MODE_MSG_ALWAYS)
|
||||
#define URJ_BSDL_MODE_INCLUDE2 (URJ_BSDL_MODE_SYN_CHECK | \
|
||||
URJ_BSDL_MODE_INSTR_EXEC | \
|
||||
URJ_BSDL_MODE_MSG_WARN | \
|
||||
URJ_BSDL_MODE_MSG_ERR | \
|
||||
URJ_BSDL_MODE_MSG_FATAL)
|
||||
#define URJ_BSDL_MODE_DETECT (URJ_BSDL_MODE_SYN_CHECK | \
|
||||
URJ_BSDL_MODE_INSTR_EXEC | \
|
||||
URJ_BSDL_MODE_IDCODE_CHECK | \
|
||||
URJ_BSDL_MODE_MSG_ALWAYS)
|
||||
#define URJ_BSDL_MODE_TEST (URJ_BSDL_MODE_SYN_CHECK | \
|
||||
URJ_BSDL_MODE_MSG_ALL)
|
||||
#define URJ_BSDL_MODE_DUMP (URJ_BSDL_MODE_SYN_CHECK | \
|
||||
URJ_BSDL_MODE_INSTR_PRINT | \
|
||||
URJ_BSDL_MODE_MSG_WARN | \
|
||||
URJ_BSDL_MODE_MSG_ERR | \
|
||||
URJ_BSDL_MODE_MSG_FATAL)
|
||||
|
||||
#endif /* URJ_BSDL_MODE_H */
|
@ -1,78 +0,0 @@
|
||||
/*
|
||||
* $Id: bssignal.h 1521 2009-04-23 13:33:47Z rfhh $
|
||||
*
|
||||
* Copyright (C) 2002 ETC s.r.o.
|
||||
* Copyright (C) 2003 Marcel Telka
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Written by Marcel Telka <marcel@telka.sk>, 2002, 2003.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef URJ_BSSIGNAL_H
|
||||
#define URJ_BSSIGNAL_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
struct urj_part_signal
|
||||
{
|
||||
char *name;
|
||||
char *pin; /* djf hack pin number from bsdl */
|
||||
urj_part_signal_t *next;
|
||||
urj_bsbit_t *input;
|
||||
urj_bsbit_t *output;
|
||||
};
|
||||
|
||||
struct urj_part_salias
|
||||
{
|
||||
char *name;
|
||||
urj_part_salias_t *next;
|
||||
urj_part_signal_t *signal;
|
||||
};
|
||||
|
||||
urj_part_signal_t *urj_part_signal_alloc (const char *name);
|
||||
void urj_part_signal_free (urj_part_signal_t *s);
|
||||
|
||||
urj_part_salias_t *urj_part_salias_alloc (const char *name,
|
||||
const urj_part_signal_t *signal);
|
||||
void urj_part_salias_free (urj_part_salias_t *salias);
|
||||
|
||||
/**
|
||||
* Define a signal and its associated pin (name)
|
||||
*/
|
||||
urj_part_signal_t *urj_part_signal_define_pin (urj_chain_t *chain,
|
||||
const char *signal_name,
|
||||
const char *pin_name);
|
||||
/**
|
||||
* Define a signal without pin (name)
|
||||
*/
|
||||
urj_part_signal_t *urj_part_signal_define (urj_chain_t *chain,
|
||||
const char *signal_name);
|
||||
/**
|
||||
* Redefine the pin name for a signal
|
||||
*/
|
||||
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 */
|
@ -1,48 +0,0 @@
|
||||
/*
|
||||
* $Id: bus.h 1525 2009-04-23 15:56:49Z rfhh $
|
||||
*
|
||||
* Bus driver interface
|
||||
* Copyright (C) 2002 ETC s.r.o.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Written by Marcel Telka <marcel@telka.sk>, 2002.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef URJ_BUS_H
|
||||
#define URJ_BUS_H
|
||||
|
||||
/* @@@@ this had better be an internal include file RFHH */
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "bus_driver.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int len;
|
||||
urj_bus_t **buses;
|
||||
} urj_buses_t;
|
||||
|
||||
extern urj_buses_t urj_buses;
|
||||
extern const urj_bus_driver_t *urj_bus_drivers[];
|
||||
|
||||
void urj_bus_buses_free (void);
|
||||
void urj_bus_buses_add (urj_bus_t *abus);
|
||||
void urj_bus_buses_delete (urj_bus_t *abus);
|
||||
|
||||
#endif /* URJ_BUS_H */
|
@ -1,89 +0,0 @@
|
||||
/*
|
||||
* $Id: bus_driver.h 1524 2009-04-23 15:29:33Z rfhh $
|
||||
*
|
||||
* Bus driver interface
|
||||
* Copyright (C) 2002, 2003 ETC s.r.o.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the ETC s.r.o. nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Written by Marcel Telka <marcel@telka.sk>, 2002, 2003.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef URJ_BUS_DRIVER_BRUX_BUS_H
|
||||
#define URJ_BUS_DRIVER_BRUX_BUS_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "types.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const char *description;
|
||||
uint32_t start;
|
||||
uint64_t length;
|
||||
unsigned int width;
|
||||
} urj_bus_area_t;
|
||||
|
||||
struct urj_bus_driver
|
||||
{
|
||||
const char *name;
|
||||
const char *description;
|
||||
urj_bus_t *(*new_bus) (urj_chain_t *chain,
|
||||
const urj_bus_driver_t *driver,
|
||||
char *cmd_params[]);
|
||||
void (*free_bus) (urj_bus_t *bus);
|
||||
void (*printinfo) (urj_bus_t *bus);
|
||||
void (*prepare) (urj_bus_t *bus);
|
||||
int (*area) (urj_bus_t *bus, uint32_t adr, urj_bus_area_t *area);
|
||||
void (*read_start) (urj_bus_t *bus, uint32_t adr);
|
||||
uint32_t (*read_next) (urj_bus_t *bus, uint32_t adr);
|
||||
uint32_t (*read_end) (urj_bus_t *bus);
|
||||
uint32_t (*read) (urj_bus_t *bus, uint32_t adr);
|
||||
void (*write) (urj_bus_t *bus, uint32_t adr, uint32_t data);
|
||||
int (*init) (urj_bus_t *bus);
|
||||
};
|
||||
|
||||
struct urj_bus
|
||||
{
|
||||
urj_chain_t *chain;
|
||||
urj_part_t *part;
|
||||
void *params;
|
||||
int initialized;
|
||||
const urj_bus_driver_t *driver;
|
||||
};
|
||||
|
||||
#define URJ_BUS_PRINTINFO(bus) (bus)->driver->printinfo(bus)
|
||||
#define URJ_BUS_PREPARE(bus) (bus)->driver->prepare(bus)
|
||||
#define URJ_BUS_AREA(bus,adr,a) (bus)->driver->area(bus,adr,a)
|
||||
#define URJ_BUS_READ_START(bus,adr) (bus)->driver->read_start(bus,adr)
|
||||
#define URJ_BUS_READ_NEXT(bus,adr) (bus)->driver->read_next(bus,adr)
|
||||
#define URJ_BUS_READ_END(bus) (bus)->driver->read_end(bus)
|
||||
#define URJ_BUS_READ(bus,adr) (bus)->driver->read(bus,adr)
|
||||
#define URJ_BUS_WRITE(bus,adr,data) (bus)->driver->write(bus,adr,data)
|
||||
#define URJ_BUS_FREE(bus) (bus)->driver->free_bus(bus)
|
||||
#define URJ_BUS_INIT(bus) (bus)->driver->init(bus)
|
||||
|
||||
#endif /* URJ_BUS_DRIVER_BRUX_BUS_H */
|
@ -1,163 +0,0 @@
|
||||
/*
|
||||
* $Id: cable.h 1525 2009-04-23 15:56:49Z rfhh $
|
||||
*
|
||||
* Cable driver interface
|
||||
* Copyright (C) 2003 ETC s.r.o.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Written by Marcel Telka <marcel@telka.sk>, 2003.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef URJ_CABLE_H
|
||||
#define URJ_CABLE_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "pod.h"
|
||||
|
||||
typedef struct urj_cable_driver urj_cable_driver_t;
|
||||
|
||||
typedef enum urj_cable_flush_amount
|
||||
{
|
||||
URJ_TAP_CABLE_OPTIONALLY,
|
||||
URJ_TAP_CABLE_TO_OUTPUT,
|
||||
URJ_TAP_CABLE_COMPLETELY
|
||||
}
|
||||
urj_cable_flush_amount_t;
|
||||
|
||||
struct urj_cable_driver
|
||||
{
|
||||
const char *name;
|
||||
const char *description;
|
||||
int (*connect) (char *params[], urj_cable_t *cable);
|
||||
void (*disconnect) (urj_cable_t *cable);
|
||||
void (*cable_free) (urj_cable_t *cable);
|
||||
int (*init) (urj_cable_t *);
|
||||
void (*done) (urj_cable_t *);
|
||||
void (*set_frequency) (urj_cable_t *, uint32_t freq);
|
||||
void (*clock) (urj_cable_t *, int, int, int);
|
||||
int (*get_tdo) (urj_cable_t *);
|
||||
int (*transfer) (urj_cable_t *, int, char *, char *);
|
||||
int (*set_signal) (urj_cable_t *, int, int);
|
||||
int (*get_signal) (urj_cable_t *, urj_pod_sigsel_t);
|
||||
void (*flush) (urj_cable_t *, urj_cable_flush_amount_t);
|
||||
void (*help) (const char *);
|
||||
};
|
||||
|
||||
typedef struct urj_cable_queue urj_cable_queue_t;
|
||||
|
||||
struct urj_cable_queue
|
||||
{
|
||||
enum
|
||||
{
|
||||
URJ_TAP_CABLE_CLOCK,
|
||||
URJ_TAP_CABLE_GET_TDO,
|
||||
URJ_TAP_CABLE_TRANSFER,
|
||||
URJ_TAP_CABLE_SET_SIGNAL,
|
||||
URJ_TAP_CABLE_GET_SIGNAL
|
||||
} action;
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
int tms;
|
||||
int tdi;
|
||||
int n;
|
||||
} clock;
|
||||
struct
|
||||
{
|
||||
urj_pod_sigsel_t sig;
|
||||
int mask;
|
||||
int val;
|
||||
} value;
|
||||
struct
|
||||
{
|
||||
int len;
|
||||
char *in;
|
||||
char *out;
|
||||
} transfer;
|
||||
struct
|
||||
{
|
||||
int len;
|
||||
int res;
|
||||
char *out;
|
||||
} xferred;
|
||||
} arg;
|
||||
};
|
||||
|
||||
typedef struct urj_cable_queue_info urj_cable_queue_info_t;
|
||||
|
||||
struct urj_cable_queue_info
|
||||
{
|
||||
urj_cable_queue_t *data;
|
||||
int max_items;
|
||||
int num_items;
|
||||
int next_item;
|
||||
int next_free;
|
||||
};
|
||||
|
||||
struct urj_cable
|
||||
{
|
||||
urj_cable_driver_t *driver;
|
||||
union
|
||||
{
|
||||
urj_usbconn_t *usb;
|
||||
urj_parport_t *port;
|
||||
} link;
|
||||
void *params;
|
||||
urj_chain_t *chain;
|
||||
urj_cable_queue_info_t todo;
|
||||
urj_cable_queue_info_t done;
|
||||
uint32_t delay;
|
||||
uint32_t frequency;
|
||||
};
|
||||
|
||||
void urj_tap_cable_free (urj_cable_t *cable);
|
||||
int urj_tap_cable_init (urj_cable_t *cable);
|
||||
void urj_tap_cable_done (urj_cable_t *cable);
|
||||
void urj_tap_cable_flush (urj_cable_t *cable,
|
||||
urj_cable_flush_amount_t);
|
||||
void urj_tap_cable_clock (urj_cable_t *cable, int tms, int tdi, int n);
|
||||
int urj_tap_cable_defer_clock (urj_cable_t *cable, int tms, int tdi, int n);
|
||||
int urj_tap_cable_get_tdo (urj_cable_t *cable);
|
||||
int urj_tap_cable_get_tdo_late (urj_cable_t *cable);
|
||||
int urj_tap_cable_defer_get_tdo (urj_cable_t *cable);
|
||||
int urj_tap_cable_set_signal (urj_cable_t *cable, int mask, int val);
|
||||
int urj_tap_cable_defer_set_signal (urj_cable_t *cable, int mask, int val);
|
||||
int urj_tap_cable_get_signal (urj_cable_t *cable, urj_pod_sigsel_t sig);
|
||||
int urj_tap_cable_get_signal_late (urj_cable_t *cable, urj_pod_sigsel_t sig);
|
||||
int urj_tap_cable_defer_get_signal (urj_cable_t *cable, urj_pod_sigsel_t sig);
|
||||
int urj_tap_cable_transfer (urj_cable_t *cable, int len, char *in, char *out);
|
||||
int urj_tap_cable_transfer_late (urj_cable_t *cable, char *out);
|
||||
int urj_tap_cable_defer_transfer (urj_cable_t *cable, int len, char *in,
|
||||
char *out);
|
||||
|
||||
void urj_tap_cable_set_frequency (urj_cable_t *cable, uint32_t frequency);
|
||||
uint32_t urj_tap_cable_get_frequency (urj_cable_t *cable);
|
||||
void urj_tap_cable_wait (urj_cable_t *cable);
|
||||
void urj_tap_cable_purge_queue (urj_cable_queue_info_t *q, int io);
|
||||
int urj_tap_cable_add_queue_item (urj_cable_t *cable,
|
||||
urj_cable_queue_info_t *q);
|
||||
int urj_tap_cable_get_queue_item (urj_cable_t *cable,
|
||||
urj_cable_queue_info_t *q);
|
||||
|
||||
extern urj_cable_driver_t *urj_tap_cable_drivers[];
|
||||
|
||||
#endif /* URJ_CABLE_H */
|
@ -1,75 +0,0 @@
|
||||
/*
|
||||
* $Id: chain.h 1521 2009-04-23 13:33:47Z rfhh $
|
||||
*
|
||||
* Copyright (C) 2003 ETC s.r.o.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Written by Marcel Telka <marcel@telka.sk>, 2003.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef URJ_CHAIN_H
|
||||
#define URJ_CHAIN_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "pod.h"
|
||||
#include "bsdl.h"
|
||||
#include "error.h"
|
||||
|
||||
#define URJ_CHAIN_EXITMODE_SHIFT 0
|
||||
#define URJ_CHAIN_EXITMODE_IDLE 1
|
||||
#define URJ_CHAIN_EXITMODE_EXIT1 2
|
||||
#define URJ_CHAIN_EXITMODE_UPDATE 3
|
||||
|
||||
struct urj_chain
|
||||
{
|
||||
int state;
|
||||
urj_parts_t *parts;
|
||||
int total_instr_len;
|
||||
int active_part;
|
||||
urj_cable_t *cable;
|
||||
urj_bsdl_globs_t bsdl;
|
||||
};
|
||||
|
||||
urj_chain_t *urj_tap_chain_alloc (void);
|
||||
void urj_tap_chain_free (urj_chain_t *chain);
|
||||
void urj_tap_chain_disconnect (urj_chain_t *chain);
|
||||
void urj_tap_chain_clock (urj_chain_t *chain, int tms, int tdi, int n);
|
||||
void urj_tap_chain_defer_clock (urj_chain_t *chain, int tms, int tdi, int n);
|
||||
int urj_tap_chain_set_trst (urj_chain_t *chain, int trst);
|
||||
int urj_tap_chain_get_trst (urj_chain_t *chain);
|
||||
void urj_tap_chain_shift_instructions (urj_chain_t *chain);
|
||||
void urj_tap_chain_shift_instructions_mode (urj_chain_t *chain,
|
||||
int capture_output, int capture,
|
||||
int chain_exit);
|
||||
void urj_tap_chain_shift_data_registers (urj_chain_t *chain,
|
||||
int capture_output);
|
||||
void urj_tap_chain_shift_data_registers_mode (urj_chain_t *chain,
|
||||
int capture_output, int capture,
|
||||
int chain_exit);
|
||||
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);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
urj_chain_t **chains;
|
||||
int size; /* allocated chains array size */
|
||||
} urj_chains_t;
|
||||
|
||||
#endif /* URJ_CHAIN_H */
|
@ -1,54 +0,0 @@
|
||||
/*
|
||||
* $Id: cmd.h 1528 2009-04-24 12:34:24Z rfhh $
|
||||
*
|
||||
* Copyright (C) 2003 ETC s.r.o.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the ETC s.r.o. nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Written by Marcel Telka <marcel@telka.sk>, 2003.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef URJ_CMD_H
|
||||
#define URJ_CMD_H
|
||||
|
||||
#include "chain.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *name;
|
||||
char *desc;
|
||||
void (*help) (void);
|
||||
int (*run) (urj_chain_t *chain, char *params[]);
|
||||
} urj_cmd_t;
|
||||
|
||||
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_test_cable (urj_chain_t *chain);
|
||||
|
||||
#endif /* URJ_CMD_H */
|
@ -1,43 +0,0 @@
|
||||
/*
|
||||
* $Id: data_register.h 1528 2009-04-24 12:34:24Z rfhh $
|
||||
*
|
||||
* Copyright (C) 2002 ETC s.r.o.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Written by Marcel Telka <marcel@telka.sk>, 2002.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef URJ_DATA_REGISTER_H
|
||||
#define URJ_DATA_REGISTER_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#define URJ_DATA_REGISTER_MAXLEN 32
|
||||
|
||||
struct urj_data_register
|
||||
{
|
||||
char name[URJ_DATA_REGISTER_MAXLEN + 1]; /* (public) register name */
|
||||
urj_tap_register_t *in; /* (public) register value clocked in */
|
||||
urj_tap_register_t *out; /* (public) register value clocked out */
|
||||
urj_data_register_t *next;
|
||||
};
|
||||
|
||||
urj_data_register_t *urj_part_data_register_alloc (const char *name, int len);
|
||||
void urj_part_data_register_free (urj_data_register_t *dr);
|
||||
|
||||
#endif /* URJ_DATA_REGISTER_H */
|
@ -1,57 +0,0 @@
|
||||
/*
|
||||
* fclock.h
|
||||
*
|
||||
* Copyright (C) 2005 Hein Roehrig
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef URJ_FCLOCK_FCLOCK_H
|
||||
#define URJ_FCLOCK_FCLOCK_H
|
||||
|
||||
/* @@@@ this had better be an internal include file RFHH */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
|
||||
# ifndef CVOID
|
||||
# define CVOID
|
||||
# endif
|
||||
#else /* def __cplusplus */
|
||||
# ifndef CVOID
|
||||
# define CVOID void
|
||||
# endif
|
||||
#endif /* def __cplusplus */
|
||||
|
||||
|
||||
/* return real time in seconds starting at some arbitrary point in
|
||||
time*/
|
||||
long double urj_lib_frealtime (CVOID);
|
||||
|
||||
/* return the CPU time used by this process (seconds) */
|
||||
long double fcputime (CVOID);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
@ -1,105 +0,0 @@
|
||||
/*
|
||||
* $Id: flash.h 1537 2009-04-27 12:59:18Z rfhh $
|
||||
*
|
||||
* Copyright (C) 2003 ETC s.r.o.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the ETC s.r.o. nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Written by Marcel Telka <marcel@telka.sk>, 2003.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef URJ_FLASH_H
|
||||
#define URJ_FLASH_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#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
|
||||
{
|
||||
urj_bus_t *bus;
|
||||
uint32_t address;
|
||||
int bus_width; /* in cfi_chips, e.g. 4 for 32 bits */
|
||||
urj_flash_cfi_chip_t **cfi_chips;
|
||||
} urj_flash_cfi_array_t;
|
||||
|
||||
void urj_flash_cfi_array_free (urj_flash_cfi_array_t *urj_flash_cfi_array);
|
||||
int urj_flash_cfi_detect (urj_bus_t *bus, uint32_t adr,
|
||||
urj_flash_cfi_array_t **urj_flash_cfi_array);
|
||||
|
||||
/* End of brux/cfi.h */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int bus_width; /* 1 for 8 bits, 2 for 16 bits, 4 for 32 bits, etc. */
|
||||
const char *name;
|
||||
const char *description;
|
||||
int (*autodetect) (urj_flash_cfi_array_t *urj_flash_cfi_array);
|
||||
void (*print_info) (urj_flash_cfi_array_t *urj_flash_cfi_array);
|
||||
int (*erase_block) (urj_flash_cfi_array_t *urj_flash_cfi_array,
|
||||
uint32_t adr);
|
||||
int (*unlock_block) (urj_flash_cfi_array_t *urj_flash_cfi_array,
|
||||
uint32_t adr);
|
||||
int (*program) (urj_flash_cfi_array_t *urj_flash_cfi_array, uint32_t adr,
|
||||
uint32_t *buffer, int count);
|
||||
void (*readarray) (urj_flash_cfi_array_t *urj_flash_cfi_array);
|
||||
} urj_flash_driver_t;
|
||||
|
||||
#define URJ_FLASH_ERROR_NOERROR 0
|
||||
#define URJ_FLASH_ERROR_INVALID_COMMAND_SEQUENCE 1
|
||||
#define URJ_FLASH_ERROR_LOW_VPEN 2
|
||||
#define URJ_FLASH_ERROR_BLOCK_LOCKED 3
|
||||
#define URJ_FLASH_ERROR_UNKNOWN 99
|
||||
|
||||
extern urj_flash_cfi_array_t *urj_flash_cfi_array;
|
||||
|
||||
void urj_flash_detectflash (urj_bus_t *bus, uint32_t adr);
|
||||
|
||||
void urj_flashmem (urj_bus_t *bus, FILE * f, uint32_t addr, int);
|
||||
void urj_flashmsbin (urj_bus_t *bus, FILE * f, int);
|
||||
|
||||
void urj_flasherase (urj_bus_t *bus, uint32_t addr, int number);
|
||||
|
||||
/* end of original brux/flash.h */
|
||||
|
||||
extern urj_flash_driver_t *urj_flash_flash_drivers[];
|
||||
|
||||
#endif /* URJ_FLASH_H */
|
@ -1,69 +0,0 @@
|
||||
/* Convenience header for conditional use of GNU <libintl.h>.
|
||||
Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public License as published
|
||||
by the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
|
||||
#ifndef _LIBGETTEXT_H
|
||||
#define _LIBGETTEXT_H 1
|
||||
|
||||
/* NLS can be disabled through the configure --disable-nls option. */
|
||||
#if ENABLE_NLS
|
||||
|
||||
/* Get declarations of GNU message catalog functions. */
|
||||
# include <libintl.h>
|
||||
|
||||
#else
|
||||
|
||||
/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
|
||||
chokes if dcgettext is defined as a macro. So include it now, to make
|
||||
later inclusions of <locale.h> a NOP. We don't include <libintl.h>
|
||||
as well because people using "gettext.h" will not include <libintl.h>,
|
||||
and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
|
||||
is OK. */
|
||||
#if defined(__sun)
|
||||
# include <locale.h>
|
||||
#endif
|
||||
|
||||
/* Disabled NLS.
|
||||
The casts to 'const char *' serve the purpose of producing warnings
|
||||
for invalid uses of the value returned from these functions.
|
||||
On pre-ANSI systems without 'const', the config.h file is supposed to
|
||||
contain "#define const". */
|
||||
# define gettext(Msgid) ((const char *) (Msgid))
|
||||
# define dgettext(Domainname, Msgid) ((const char *) (Msgid))
|
||||
# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid))
|
||||
# define ngettext(Msgid1, Msgid2, N) \
|
||||
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
|
||||
# define dngettext(Domainname, Msgid1, Msgid2, N) \
|
||||
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
|
||||
# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
|
||||
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
|
||||
# define textdomain(Domainname) ((const char *) (Domainname))
|
||||
# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
|
||||
# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset))
|
||||
|
||||
#endif
|
||||
|
||||
/* A pseudo function call that serves as a marker for the automated
|
||||
extraction of messages, but does not call gettext(). The run-time
|
||||
translation is done at a different place in the code.
|
||||
The argument, String, should be a literal string. Concatenated strings
|
||||
and other string expressions won't work.
|
||||
The macro's expansion is not parenthesized, so that it is suitable as
|
||||
initializer for static 'char[]' or 'const char[]' variables. */
|
||||
#define gettext_noop(String) String
|
||||
|
||||
#endif /* _LIBGETTEXT_H */
|
@ -1,131 +0,0 @@
|
||||
/*
|
||||
* $Id: jim.h $
|
||||
*
|
||||
* Copyright (C) 2008 Kolja Waschk <kawk>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
* Documentation used while writing this code:
|
||||
*
|
||||
* http://www.inaccessnetworks.com/projects/ianjtag/jtag-intro/jtag-intro.html
|
||||
* "A Brief Introduction to the JTAG Boundary Scan Interface", Nick Patavalis
|
||||
*
|
||||
* http://www.xjtag.com/support-jtag/jtag-technical-guide.php
|
||||
* "JTAG - A technical overview", XJTAG Ltd.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef URJ_JIM_H
|
||||
#define URJ_JIM_H 1
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef enum jim_tap_state
|
||||
{
|
||||
URJ_JIM_RESET = 0,
|
||||
URJ_JIM_SELECT_DR = 0 + 1,
|
||||
URJ_JIM_CAPTURE_DR = 0 + 2,
|
||||
URJ_JIM_SHIFT_DR = 0 + 3,
|
||||
URJ_JIM_EXIT1_DR = 0 + 4,
|
||||
URJ_JIM_PAUSE_DR = 0 + 5,
|
||||
URJ_JIM_EXIT2_DR = 0 + 6,
|
||||
URJ_JIM_UPDATE_DR = 0 + 7,
|
||||
URJ_JIM_IDLE = 8,
|
||||
URJ_JIM_SELECT_IR = 8 + 1,
|
||||
URJ_JIM_CAPTURE_IR = 8 + 2,
|
||||
URJ_JIM_SHIFT_IR = 8 + 3,
|
||||
URJ_JIM_EXIT1_IR = 8 + 4,
|
||||
URJ_JIM_PAUSE_IR = 8 + 5,
|
||||
URJ_JIM_EXIT2_IR = 8 + 6,
|
||||
URJ_JIM_UPDATE_IR = 8 + 7,
|
||||
}
|
||||
urj_jim_tap_state_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t *reg;
|
||||
int len;
|
||||
} urj_jim_shift_reg_t;
|
||||
|
||||
typedef struct urj_jim_device
|
||||
{
|
||||
struct urj_jim_device *prev;
|
||||
|
||||
urj_jim_tap_state_t tap_state;
|
||||
void (*tck_rise) (struct urj_jim_device * dev, int tms, int tdi,
|
||||
uint8_t *shmem, size_t shmem_size);
|
||||
void (*tck_fall) (struct urj_jim_device * dev, uint8_t *shmem,
|
||||
size_t shmem_size);
|
||||
void (*dev_free) (struct urj_jim_device * dev);
|
||||
void *state;
|
||||
int num_sregs;
|
||||
int current_dr;
|
||||
urj_jim_shift_reg_t *sreg;
|
||||
int tdo;
|
||||
int tdo_buffer;
|
||||
}
|
||||
urj_jim_device_t;
|
||||
|
||||
typedef struct urj_jim_state
|
||||
{
|
||||
int trst;
|
||||
uint8_t *shmem;
|
||||
size_t shmem_size;
|
||||
urj_jim_device_t *last_device_in_chain;
|
||||
}
|
||||
urj_jim_state_t;
|
||||
|
||||
typedef struct urj_jim_bus_device
|
||||
{
|
||||
int width; /* bytes */
|
||||
int size; /* words (each <width> bytes) */
|
||||
void *state; /* device-dependent */
|
||||
void (*init) (struct urj_jim_bus_device * x);
|
||||
uint32_t (*capture) (struct urj_jim_bus_device * x,
|
||||
uint32_t address, uint32_t control,
|
||||
uint8_t *shmem, size_t shmem_size);
|
||||
void (*update) (struct urj_jim_bus_device * x,
|
||||
uint32_t address, uint32_t data, uint32_t control,
|
||||
uint8_t *shmem, size_t shmem_size);
|
||||
void (*free) (struct urj_jim_bus_device * x);
|
||||
}
|
||||
urj_jim_bus_device_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t offset;
|
||||
int adr_shift;
|
||||
int data_shift;
|
||||
urj_jim_bus_device_t *part;
|
||||
}
|
||||
urj_jim_attached_part_t;
|
||||
|
||||
void urj_jim_set_trst (urj_jim_state_t *s, int trst);
|
||||
int urj_jim_get_trst (urj_jim_state_t *s);
|
||||
int urj_jim_get_tdo (urj_jim_state_t *s);
|
||||
void urj_jim_tck_rise (urj_jim_state_t *s, int tms, int tdi);
|
||||
void urj_jim_tck_fall (urj_jim_state_t *s);
|
||||
urj_jim_device_t *urj_jim_alloc_device (int num_sregs, const int reg_size[]);
|
||||
urj_jim_state_t *urj_jim_init (void);
|
||||
void urj_jim_free (urj_jim_state_t *s);
|
||||
void urj_jim_print_sreg (urj_jim_shift_reg_t *r);
|
||||
void urj_jim_print_tap_state (char *rof, urj_jim_device_t *dev);
|
||||
|
||||
#endif
|
@ -1,57 +0,0 @@
|
||||
/*
|
||||
* $Id: jtag.h 1534 2009-04-25 15:17:16Z rfhh $
|
||||
*
|
||||
* Copyright (C) 2003 ETC s.r.o.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Written by Marcel Telka <marcel@telka.sk>, 2003.
|
||||
*
|
||||
*/
|
||||
|
||||
#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);
|
||||
|
||||
#endif /* URJ_JTAG_H */
|
@ -1,62 +0,0 @@
|
||||
/*
|
||||
* $Id: parport.h 1525 2009-04-23 15:56:49Z rfhh $
|
||||
*
|
||||
* Parallel Port Connection Driver Interface
|
||||
* Copyright (C) 2003 ETC s.r.o.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Written by Marcel Telka <marcel@telka.sk>, 2003.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef URJ_PARPORT_H
|
||||
#define URJ_PARPORT_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "types.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const char *type;
|
||||
urj_parport_t *(*connect) (const char **, int);
|
||||
void (*parport_free) (urj_parport_t *);
|
||||
int (*open) (urj_parport_t *);
|
||||
int (*close) (urj_parport_t *);
|
||||
int (*set_data) (urj_parport_t *, uint8_t);
|
||||
int (*get_data) (urj_parport_t *);
|
||||
int (*get_status) (urj_parport_t *);
|
||||
int (*set_control) (urj_parport_t *, uint8_t);
|
||||
} urj_parport_driver_t;
|
||||
|
||||
struct urj_parport
|
||||
{
|
||||
urj_parport_driver_t *driver;
|
||||
void *params;
|
||||
urj_cable_t *cable;
|
||||
};
|
||||
|
||||
int urj_tap_parport_open (urj_parport_t *port);
|
||||
int urj_tap_parport_close (urj_parport_t *port);
|
||||
int urj_tap_parport_set_data (urj_parport_t *port, uint8_t data);
|
||||
int urj_tap_parport_get_data (urj_parport_t *port);
|
||||
int urj_tap_parport_get_status (urj_parport_t *port);
|
||||
int urj_tap_parport_set_control (urj_parport_t *port, uint8_t data);
|
||||
|
||||
extern urj_parport_driver_t *urj_tap_parport_drivers[];
|
||||
|
||||
#endif /* URJ_PARPORT_H */
|
@ -1,98 +0,0 @@
|
||||
/*
|
||||
* $Id: part.h 1528 2009-04-24 12:34:24Z rfhh $
|
||||
*
|
||||
* Copyright (C) 2002 ETC s.r.o.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Written by Marcel Telka <marcel@telka.sk>, 2002.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef URJ_PART_H
|
||||
#define URJ_PART_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#define URJ_PART_MANUFACTURER_MAXLEN 25
|
||||
#define URJ_PART_PART_MAXLEN 20
|
||||
#define URJ_PART_STEPPING_MAXLEN 8
|
||||
|
||||
struct urj_part
|
||||
{
|
||||
urj_tap_register_t *id;
|
||||
char *alias; /* djf refdes */
|
||||
char manufacturer[URJ_PART_MANUFACTURER_MAXLEN + 1];
|
||||
char part[URJ_PART_PART_MAXLEN + 1];
|
||||
char stepping[URJ_PART_STEPPING_MAXLEN + 1];
|
||||
urj_part_signal_t *signals;
|
||||
urj_part_salias_t *saliases;
|
||||
int instruction_length;
|
||||
urj_part_instruction_t *instructions;
|
||||
urj_part_instruction_t *active_instruction;
|
||||
urj_data_register_t *data_registers;
|
||||
int boundary_length;
|
||||
urj_bsbit_t **bsbits;
|
||||
};
|
||||
|
||||
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_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,
|
||||
const char *drname);
|
||||
urj_part_signal_t *urj_part_find_signal (urj_part_t *p,
|
||||
const char *signalname);
|
||||
void urj_part_set_instruction (urj_part_t *p, const char *iname);
|
||||
void urj_part_set_signal (urj_part_t *p, urj_part_signal_t *s, int out,
|
||||
int val);
|
||||
int urj_part_get_signal (urj_part_t *p, urj_part_signal_t *s);
|
||||
void urj_part_print (urj_part_t *p);
|
||||
/**
|
||||
* Set the length of the instructions of a part
|
||||
*/
|
||||
int urj_part_instruction_length_set (urj_part_t *part, int length);
|
||||
/**
|
||||
* Create a new instruction for a part.
|
||||
* @param part
|
||||
* @param instruction name for the new instruction
|
||||
* @param code string that contains the bit pattern for the default instruction
|
||||
* @param data_register default data register for instruction (e.g. BR)
|
||||
*/
|
||||
urj_part_instruction_t *urj_part_instruction_define (urj_part_t *part,
|
||||
const char *instruction,
|
||||
const char *code,
|
||||
const char *data_register);
|
||||
/**
|
||||
* parts
|
||||
*/
|
||||
|
||||
struct urj_parts
|
||||
{
|
||||
int len;
|
||||
urj_part_t **parts;
|
||||
};
|
||||
|
||||
urj_parts_t *urj_part_parts_alloc (void);
|
||||
void urj_part_parts_free (urj_parts_t *ps);
|
||||
int urj_part_parts_add_part (urj_parts_t *ps, urj_part_t *p);
|
||||
void urj_part_parts_set_instruction (urj_parts_t *ps, const char *iname);
|
||||
void urj_part_parts_print (urj_parts_t *ps);
|
||||
|
||||
#endif /* URJ_PART_H */
|
@ -1,45 +0,0 @@
|
||||
/*
|
||||
* $Id: part_instruction.h 1529 2009-04-24 12:36:20Z rfhh $
|
||||
*
|
||||
* Copyright (C) 2002 ETC s.r.o.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Written by Marcel Telka <marcel@telka.sk>, 2002.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef URJ_PART_INSTRUCTION_H
|
||||
#define URJ_PART_INSTRUCTION_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#define URJ_INSTRUCTION_MAXLEN_INSTRUCTION 20
|
||||
|
||||
struct urj_part_instruction
|
||||
{
|
||||
char name[URJ_INSTRUCTION_MAXLEN_INSTRUCTION + 1];
|
||||
urj_tap_register_t *value;
|
||||
urj_tap_register_t *out;
|
||||
urj_data_register_t *data_register;
|
||||
urj_part_instruction_t *next;
|
||||
};
|
||||
|
||||
urj_part_instruction_t *urj_part_instruction_alloc (const char *name, int len,
|
||||
const char *val);
|
||||
void urj_part_instruction_free (urj_part_instruction_t *i);
|
||||
|
||||
#endif /* URJ_INSTRUCTION_H */
|
@ -1,41 +0,0 @@
|
||||
/*
|
||||
* $Id: pod.h 1522 2009-04-23 13:43:50Z rfhh $
|
||||
*
|
||||
* Pod signal names
|
||||
* Copyright (C) 2008 K. Waschk
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef URJ_POD_H
|
||||
#define URJ_POD_H
|
||||
|
||||
typedef enum urj_pod_sigsel
|
||||
{
|
||||
URJ_POD_CS_NONE = 0, // no/invalid signal
|
||||
URJ_POD_CS_TDI = (1 << 0), // out: JTAG/SPI data in
|
||||
URJ_POD_CS_TCK = (1 << 1), // out: JTAG/SPI clock
|
||||
URJ_POD_CS_TMS = (1 << 2), // out: JTAG test mode select/SPI slave select
|
||||
URJ_POD_CS_TRST = (1 << 3), // out: JTAG TAP reset
|
||||
URJ_POD_CS_RESET = (1 << 4), // out: system reset
|
||||
URJ_POD_CS_SCK = (1 << 5), // out: I2C clock (not yet used)
|
||||
URJ_POD_CS_SDA = (1 << 6), // inout: I2C data (not yet used)
|
||||
URJ_POD_CS_SS = (1 << 7), // out: SPI slave select (not yet used)
|
||||
}
|
||||
urj_pod_sigsel_t;
|
||||
|
||||
#endif /* URJ_POD_H */
|
@ -1,37 +0,0 @@
|
||||
/*
|
||||
* $Id: svf.h 1519 2009-04-22 23:12:44Z rfhh $
|
||||
*
|
||||
* Copyright (C) 2004, Arnim Laeuger
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Written by Arnim Laeuger <arniml@users.sourceforge.net>, 2004.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef URJ_SVF_H
|
||||
#define URJ_SVF_H
|
||||
|
||||
#include "sysdep.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "types.h"
|
||||
|
||||
void urj_svf_run (urj_chain_t *chain, FILE *, int, int, uint32_t);
|
||||
|
||||
#endif /* URJ_SVF_H */
|
@ -1,46 +0,0 @@
|
||||
/*
|
||||
* $Id: tap.h 1528 2009-04-24 12:34:24Z rfhh $
|
||||
*
|
||||
* Copyright (C) 2002 ETC s.r.o.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Written by Marcel Telka <marcel@telka.sk>, 2002.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef URJ_TAP_H
|
||||
#define URJ_TAP_H
|
||||
|
||||
#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);
|
||||
void urj_tap_capture_ir (urj_chain_t *chain);
|
||||
void urj_tap_defer_shift_register (urj_chain_t *chain,
|
||||
const urj_tap_register_t *in,
|
||||
urj_tap_register_t *out, int tap_exit);
|
||||
void urj_tap_shift_register_output (urj_chain_t *chain,
|
||||
const urj_tap_register_t *in,
|
||||
urj_tap_register_t *out, int tap_exit);
|
||||
void urj_tap_shift_register (urj_chain_t *chain,
|
||||
const urj_tap_register_t *in,
|
||||
urj_tap_register_t *out, int tap_exit);
|
||||
|
||||
#endif /* URJ_TAP_H */
|
@ -1,55 +0,0 @@
|
||||
/*
|
||||
* $Id: tap_register.h 1528 2009-04-24 12:34:24Z rfhh $
|
||||
*
|
||||
* Copyright (C) 2002, 2003 ETC s.r.o.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Written by Marcel Telka <marcel@telka.sk>, 2002, 2003.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef URJ_TAP_REGISTER_H
|
||||
#define URJ_TAP_REGISTER_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
struct urj_tap_register
|
||||
{
|
||||
char *data; /* (public, r/w) register data */
|
||||
int len; /* (public, r/o) register length */
|
||||
char *string; /* (private) string representation of register data */
|
||||
};
|
||||
|
||||
urj_tap_register_t *urj_tap_register_alloc (int len);
|
||||
urj_tap_register_t *urj_tap_register_duplicate (const urj_tap_register_t *tr);
|
||||
void urj_tap_register_free (urj_tap_register_t *tr);
|
||||
urj_tap_register_t *urj_tap_register_fill (urj_tap_register_t *tr, int val);
|
||||
const char *urj_tap_register_get_string (const urj_tap_register_t *tr);
|
||||
int urj_tap_register_all_bits_same_value (const urj_tap_register_t *tr);
|
||||
urj_tap_register_t *urj_tap_register_init (urj_tap_register_t *tr,
|
||||
const char *value);
|
||||
int urj_tap_register_compare (const urj_tap_register_t *tr,
|
||||
const urj_tap_register_t *tr2);
|
||||
int urj_tap_register_match (const urj_tap_register_t *tr, const char *expr);
|
||||
urj_tap_register_t *urj_tap_register_inc (urj_tap_register_t *tr);
|
||||
urj_tap_register_t *urj_tap_register_dec (urj_tap_register_t *tr);
|
||||
urj_tap_register_t *urj_tap_register_shift_right (urj_tap_register_t *tr,
|
||||
int shift);
|
||||
urj_tap_register_t *urj_tap_register_shift_left (urj_tap_register_t *tr,
|
||||
int shift);
|
||||
|
||||
#endif /* URJ_REGISTER_H */
|
@ -1,66 +0,0 @@
|
||||
/*
|
||||
* $Id: tap_state.h 1521 2009-04-23 13:33:47Z rfhh $
|
||||
*
|
||||
* Copyright (C) 2002 ETC s.r.o.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Written by Marcel Telka <marcel@telka.sk>, 2002.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef URJ_TAP_STATE_H
|
||||
#define URJ_TAP_STATE_H
|
||||
|
||||
#include "bitmask.h"
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#define URJ_TAP_STATE_DR URJ_BIT (0)
|
||||
#define URJ_TAP_STATE_IR URJ_BIT (1)
|
||||
#define URJ_TAP_STATE_SHIFT URJ_BIT (2) /* register shift with TMS = 0 */
|
||||
#define URJ_TAP_STATE_IDLE URJ_BIT (3) /* to Run-Test/Idle with TMS = 0 */
|
||||
#define URJ_TAP_STATE_CAPTURE URJ_BIT (4) /* Capture state */
|
||||
#define URJ_TAP_STATE_UPDATE URJ_BIT (5) /* to Update with TMS = 1 */
|
||||
#define URJ_TAP_STATE_PAUSE URJ_BIT (6) /* to Pause with TMS = 0 */
|
||||
#define URJ_TAP_STATE_RESET URJ_BIT (7) /* Test-Logic-Reset or unknown state */
|
||||
|
||||
#define URJ_TAP_STATE_UNKNOWN_STATE URJ_TAP_STATE_RESET
|
||||
#define URJ_TAP_STATE_TEST_LOGIC_RESET (URJ_TAP_STATE_RESET | URJ_TAP_STATE_IDLE)
|
||||
#define URJ_TAP_STATE_RUN_TEST_IDLE URJ_TAP_STATE_IDLE
|
||||
#define URJ_TAP_STATE_SELECT_DR_SCAN URJ_TAP_STATE_DR
|
||||
#define URJ_TAP_STATE_CAPTURE_DR (URJ_TAP_STATE_DR | URJ_TAP_STATE_SHIFT | URJ_TAP_STATE_CAPTURE)
|
||||
#define URJ_TAP_STATE_SHIFT_DR (URJ_TAP_STATE_DR | URJ_TAP_STATE_SHIFT)
|
||||
#define URJ_TAP_STATE_EXIT1_DR (URJ_TAP_STATE_DR | URJ_TAP_STATE_UPDATE | URJ_TAP_STATE_PAUSE)
|
||||
#define URJ_TAP_STATE_PAUSE_DR (URJ_TAP_STATE_DR | URJ_TAP_STATE_PAUSE)
|
||||
#define URJ_TAP_STATE_EXIT2_DR (URJ_TAP_STATE_DR | URJ_TAP_STATE_SHIFT | URJ_TAP_STATE_UPDATE)
|
||||
#define URJ_TAP_STATE_UPDATE_DR (URJ_TAP_STATE_DR | URJ_TAP_STATE_IDLE)
|
||||
#define URJ_TAP_STATE_SELECT_IR_SCAN URJ_TAP_STATE_IR
|
||||
#define URJ_TAP_STATE_CAPTURE_IR (URJ_TAP_STATE_IR | URJ_TAP_STATE_SHIFT | URJ_TAP_STATE_CAPTURE)
|
||||
#define URJ_TAP_STATE_SHIFT_IR (URJ_TAP_STATE_IR | URJ_TAP_STATE_SHIFT)
|
||||
#define URJ_TAP_STATE_EXIT1_IR (URJ_TAP_STATE_IR | URJ_TAP_STATE_UPDATE | URJ_TAP_STATE_PAUSE)
|
||||
#define URJ_TAP_STATE_PAUSE_IR (URJ_TAP_STATE_IR | URJ_TAP_STATE_PAUSE)
|
||||
#define URJ_TAP_STATE_EXIT2_IR (URJ_TAP_STATE_IR | URJ_TAP_STATE_SHIFT | URJ_TAP_STATE_UPDATE)
|
||||
#define URJ_TAP_STATE_UPDATE_IR (URJ_TAP_STATE_IR | URJ_TAP_STATE_IDLE)
|
||||
|
||||
int urj_tap_state (urj_chain_t *chain);
|
||||
int urj_tap_state_init (urj_chain_t *chain);
|
||||
int urj_tap_state_done (urj_chain_t *chain);
|
||||
int urj_tap_state_reset (urj_chain_t *chain);
|
||||
int urj_tap_state_set_trst (urj_chain_t *chain, int old_trst, int new_trst);
|
||||
int urj_tap_state_clock (urj_chain_t *chain, int tms);
|
||||
|
||||
#endif /* URJ_TAP_STATE_H */
|
@ -1,69 +0,0 @@
|
||||
/*
|
||||
* $Id: usbconn.h 1525 2009-04-23 15:56:49Z rfhh $
|
||||
*
|
||||
* USB Device Connection Driver Interface
|
||||
* Copyright (C) 2008 K. Waschk
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Written by Kolja Waschk <kawk>, 2008
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef URJ_USBCONN_H
|
||||
#define URJ_USBCONN_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "types.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *name;
|
||||
char *desc;
|
||||
char *driver;
|
||||
int32_t vid;
|
||||
int32_t pid;
|
||||
} urj_usbconn_cable_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const char *type;
|
||||
urj_usbconn_t *(*connect) (const char **, int, urj_usbconn_cable_t *);
|
||||
void (*free) (urj_usbconn_t *);
|
||||
int (*open) (urj_usbconn_t *);
|
||||
int (*close) (urj_usbconn_t *);
|
||||
int (*read) (urj_usbconn_t *, uint8_t *, int);
|
||||
int (*write) (urj_usbconn_t *, uint8_t *, int, int);
|
||||
} urj_usbconn_driver_t;
|
||||
|
||||
struct urj_usbconn
|
||||
{
|
||||
urj_usbconn_driver_t *driver;
|
||||
void *params;
|
||||
urj_cable_t *cable;
|
||||
};
|
||||
|
||||
urj_usbconn_t *usbconn_connect (const char **, int, urj_usbconn_cable_t *);
|
||||
int usbconn_free (urj_usbconn_t *conn);
|
||||
int urj_tap_usbconn_open (urj_usbconn_t *conn);
|
||||
int urj_tap_usbconn_close (urj_usbconn_t *conn);
|
||||
int urj_tap_usbconn_read (urj_usbconn_t *conn, uint8_t *buf, int len);
|
||||
int urj_tap_usbconn_write (urj_usbconn_t *conn, uint8_t *buf, int len,
|
||||
int recv);
|
||||
extern urj_usbconn_driver_t *urj_tap_usbconn_drivers[];
|
||||
|
||||
#endif /* URJ_USBCONN_H */
|
@ -1,49 +0,0 @@
|
||||
/*
|
||||
* $Id: xpcu.h 1519 2009-04-22 23:12:44Z rfhh $
|
||||
*
|
||||
* Xilinx Platform Cable USB functions
|
||||
* Copyright (C) 2008 K. Waschk
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Written by Kolja Waschk <kawk>, 2008
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef URJ_XPCU_H
|
||||
#define URJ_XPCU_H 1
|
||||
|
||||
#include <stdint.h>
|
||||
#include <usb.h>
|
||||
|
||||
#define URJ_XPCU_VID 0x03FD
|
||||
#define URJ_XPCU_PID 0x0008
|
||||
|
||||
struct usb_device *find_xpcu (void);
|
||||
int xpcu_init ();
|
||||
int xpcu_close (struct usb_dev_handle *xpcu);
|
||||
int xpcu_request_28 (struct usb_dev_handle *xpcu, int value);
|
||||
int xpcu_raise_ioa5 (struct usb_dev_handle *xpcu);
|
||||
int xpcu_write_gpio (struct usb_dev_handle *xpcu, uint8_t bits);
|
||||
int xpcu_read_gpio (struct usb_dev_handle *xpcu, uint8_t *bits);
|
||||
int xpcu_bitrev_test (struct usb_dev_handle *xpcu);
|
||||
int xpcu_select_gpio (struct usb_dev_handle *xpcu, int select);
|
||||
int xpcu_open (struct usb_dev_handle **xpcu);
|
||||
int xpcu_request_a6 (struct usb_dev_handle *xpcu, int nibbles, uint8_t *xmit,
|
||||
int inlen, uint8_t *recv);
|
||||
|
||||
|
||||
#endif /* URJ_XPCU_H */
|
Loading…
Reference in New Issue