debuggers: import openocd-0.7.0
Initial check-in of openocd-0.7.0 as it can be downloaded from http://sourceforge.net/projects/openocd/files/openocd/0.7.0/ Any modifications will follow. Change-Id: I6949beaefd589e046395ea0cb80f4e1ab1654d55
This commit is contained in:
8
debuggers/openocd/src/pld/Makefile.am
Normal file
8
debuggers/openocd/src/pld/Makefile.am
Normal file
@ -0,0 +1,8 @@
|
||||
include $(top_srcdir)/common.mk
|
||||
|
||||
METASOURCES = AUTO
|
||||
noinst_LTLIBRARIES = libpld.la
|
||||
noinst_HEADERS = pld.h xilinx_bit.h virtex2.h
|
||||
libpld_la_SOURCES = pld.c xilinx_bit.c virtex2.c
|
||||
|
||||
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
|
||||
564
debuggers/openocd/src/pld/Makefile.in
Normal file
564
debuggers/openocd/src/pld/Makefile.in
Normal file
@ -0,0 +1,564 @@
|
||||
# Makefile.in generated by automake 1.13.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__make_dryrun = \
|
||||
{ \
|
||||
am__dry=no; \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||
*) \
|
||||
for am__flg in $$MAKEFLAGS; do \
|
||||
case $$am__flg in \
|
||||
*=*|--*) ;; \
|
||||
*n*) am__dry=yes; break;; \
|
||||
esac; \
|
||||
done;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
DIST_COMMON = $(top_srcdir)/common.mk $(srcdir)/Makefile.in \
|
||||
$(srcdir)/Makefile.am $(top_srcdir)/depcomp $(noinst_HEADERS)
|
||||
@INTERNAL_JIMTCL_TRUE@am__append_1 = -I$(top_srcdir)/jimtcl \
|
||||
@INTERNAL_JIMTCL_TRUE@ -I$(top_builddir)/jimtcl
|
||||
|
||||
subdir = src/pld
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/config_subdir.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
LTLIBRARIES = $(noinst_LTLIBRARIES)
|
||||
libpld_la_LIBADD =
|
||||
am_libpld_la_OBJECTS = pld.lo xilinx_bit.lo virtex2.lo
|
||||
libpld_la_OBJECTS = $(am_libpld_la_OBJECTS)
|
||||
AM_V_lt = $(am__v_lt_@AM_V@)
|
||||
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
|
||||
am__v_lt_0 = --silent
|
||||
am__v_lt_1 =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
am__mv = mv -f
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
AM_V_CC = $(am__v_CC_@AM_V@)
|
||||
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
|
||||
am__v_CC_0 = @echo " CC " $@;
|
||||
am__v_CC_1 =
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
|
||||
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
|
||||
am__v_CCLD_0 = @echo " CCLD " $@;
|
||||
am__v_CCLD_1 =
|
||||
SOURCES = $(libpld_la_SOURCES)
|
||||
DIST_SOURCES = $(libpld_la_SOURCES)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
HEADERS = $(noinst_HEADERS)
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
# *not* preserved.
|
||||
am__uniquify_input = $(AWK) '\
|
||||
BEGIN { nonempty = 0; } \
|
||||
{ items[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in items) print i; }; } \
|
||||
'
|
||||
# Make sure the list of sources is unique. This is necessary because,
|
||||
# e.g., the same source file might be shared among _SOURCES variables
|
||||
# for different programs/libraries.
|
||||
am__define_uniq_tagged_files = \
|
||||
list='$(am__tagged_files)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CC_FOR_BUILD = @CC_FOR_BUILD@
|
||||
CFLAGS = @CFLAGS@
|
||||
CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
|
||||
FGREP = @FGREP@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
doxygen_as_html = @doxygen_as_html@
|
||||
doxygen_as_pdf = @doxygen_as_pdf@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
subdirs = @subdirs@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
|
||||
# common flags used in openocd build
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src \
|
||||
-I$(top_srcdir)/src/helper -DPKGDATADIR=\"$(pkgdatadir)\" \
|
||||
-DPKGLIBDIR=\"$(pkglibdir)\" $(am__append_1)
|
||||
METASOURCES = AUTO
|
||||
noinst_LTLIBRARIES = libpld.la
|
||||
noinst_HEADERS = pld.h xilinx_bit.h virtex2.h
|
||||
libpld_la_SOURCES = pld.c xilinx_bit.c virtex2.c
|
||||
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/pld/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu src/pld/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
$(top_srcdir)/common.mk:
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
clean-noinstLTLIBRARIES:
|
||||
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
|
||||
@list='$(noinst_LTLIBRARIES)'; \
|
||||
locs=`for p in $$list; do echo $$p; done | \
|
||||
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
|
||||
sort -u`; \
|
||||
test -z "$$locs" || { \
|
||||
echo rm -f $${locs}; \
|
||||
rm -f $${locs}; \
|
||||
}
|
||||
libpld.la: $(libpld_la_OBJECTS) $(libpld_la_DEPENDENCIES) $(EXTRA_libpld_la_DEPENDENCIES)
|
||||
$(AM_V_CCLD)$(LINK) $(libpld_la_OBJECTS) $(libpld_la_LIBADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pld.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virtex2.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xilinx_bit.Plo@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-am
|
||||
TAGS: tags
|
||||
|
||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
$(am__define_uniq_tagged_files); \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: ctags-am
|
||||
|
||||
CTAGS: ctags
|
||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
cscopelist: cscopelist-am
|
||||
|
||||
cscopelist-am: $(am__tagged_files)
|
||||
list='$(am__tagged_files)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
|
||||
ctags-am distclean distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags tags-am uninstall uninstall-am
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
241
debuggers/openocd/src/pld/pld.c
Normal file
241
debuggers/openocd/src/pld/pld.c
Normal file
@ -0,0 +1,241 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006 by Dominic Rath *
|
||||
* Dominic.Rath@gmx.de *
|
||||
* *
|
||||
* 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. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "pld.h"
|
||||
#include <helper/log.h>
|
||||
#include <helper/time_support.h>
|
||||
|
||||
|
||||
/* pld drivers
|
||||
*/
|
||||
extern struct pld_driver virtex2_pld;
|
||||
|
||||
static struct pld_driver *pld_drivers[] = {
|
||||
&virtex2_pld,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static struct pld_device *pld_devices;
|
||||
|
||||
struct pld_device *get_pld_device_by_num(int num)
|
||||
{
|
||||
struct pld_device *p;
|
||||
int i = 0;
|
||||
|
||||
for (p = pld_devices; p; p = p->next) {
|
||||
if (i++ == num)
|
||||
return p;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* pld device <driver> [driver_options ...]
|
||||
*/
|
||||
COMMAND_HANDLER(handle_pld_device_command)
|
||||
{
|
||||
int i;
|
||||
int found = 0;
|
||||
|
||||
if (CMD_ARGC < 1)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
|
||||
for (i = 0; pld_drivers[i]; i++) {
|
||||
if (strcmp(CMD_ARGV[0], pld_drivers[i]->name) == 0) {
|
||||
struct pld_device *p, *c;
|
||||
|
||||
/* register pld specific commands */
|
||||
int retval;
|
||||
if (pld_drivers[i]->commands) {
|
||||
retval = register_commands(CMD_CTX, NULL,
|
||||
pld_drivers[i]->commands);
|
||||
if (ERROR_OK != retval) {
|
||||
LOG_ERROR("couldn't register '%s' commands", CMD_ARGV[0]);
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
c = malloc(sizeof(struct pld_device));
|
||||
c->driver = pld_drivers[i];
|
||||
c->next = NULL;
|
||||
|
||||
retval = CALL_COMMAND_HANDLER(
|
||||
pld_drivers[i]->pld_device_command, c);
|
||||
if (ERROR_OK != retval) {
|
||||
LOG_ERROR("'%s' driver rejected pld device",
|
||||
CMD_ARGV[0]);
|
||||
free(c);
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
/* put pld device in linked list */
|
||||
if (pld_devices) {
|
||||
/* find last pld device */
|
||||
for (p = pld_devices; p && p->next; p = p->next)
|
||||
;
|
||||
if (p)
|
||||
p->next = c;
|
||||
} else
|
||||
pld_devices = c;
|
||||
|
||||
found = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* no matching pld driver found */
|
||||
if (!found) {
|
||||
LOG_ERROR("pld driver '%s' not found", CMD_ARGV[0]);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
COMMAND_HANDLER(handle_pld_devices_command)
|
||||
{
|
||||
struct pld_device *p;
|
||||
int i = 0;
|
||||
|
||||
if (!pld_devices) {
|
||||
command_print(CMD_CTX, "no pld devices configured");
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
for (p = pld_devices; p; p = p->next)
|
||||
command_print(CMD_CTX, "#%i: %s", i++, p->driver->name);
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
COMMAND_HANDLER(handle_pld_load_command)
|
||||
{
|
||||
int retval;
|
||||
struct timeval start, end, duration;
|
||||
struct pld_device *p;
|
||||
|
||||
gettimeofday(&start, NULL);
|
||||
|
||||
if (CMD_ARGC < 2)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
|
||||
unsigned dev_id;
|
||||
COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], dev_id);
|
||||
p = get_pld_device_by_num(dev_id);
|
||||
if (!p) {
|
||||
command_print(CMD_CTX, "pld device '#%s' is out of bounds", CMD_ARGV[0]);
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
retval = p->driver->load(p, CMD_ARGV[1]);
|
||||
if (retval != ERROR_OK) {
|
||||
command_print(CMD_CTX, "failed loading file %s to pld device %u",
|
||||
CMD_ARGV[1], dev_id);
|
||||
switch (retval) {
|
||||
}
|
||||
return retval;
|
||||
} else {
|
||||
gettimeofday(&end, NULL);
|
||||
timeval_subtract(&duration, &end, &start);
|
||||
|
||||
command_print(CMD_CTX, "loaded file %s to pld device %u in %jis %jius",
|
||||
CMD_ARGV[1], dev_id,
|
||||
(intmax_t)duration.tv_sec, (intmax_t)duration.tv_usec);
|
||||
}
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static const struct command_registration pld_exec_command_handlers[] = {
|
||||
{
|
||||
.name = "devices",
|
||||
.handler = handle_pld_devices_command,
|
||||
.mode = COMMAND_EXEC,
|
||||
.help = "list configured pld devices",
|
||||
},
|
||||
{
|
||||
.name = "load",
|
||||
.handler = handle_pld_load_command,
|
||||
.mode = COMMAND_EXEC,
|
||||
.help = "load configuration file into PLD",
|
||||
.usage = "pld_num filename",
|
||||
},
|
||||
COMMAND_REGISTRATION_DONE
|
||||
};
|
||||
|
||||
static int pld_init(struct command_context *cmd_ctx)
|
||||
{
|
||||
if (!pld_devices)
|
||||
return ERROR_OK;
|
||||
|
||||
struct command *parent = command_find_in_context(cmd_ctx, "pld");
|
||||
return register_commands(cmd_ctx, parent, pld_exec_command_handlers);
|
||||
}
|
||||
|
||||
COMMAND_HANDLER(handle_pld_init_command)
|
||||
{
|
||||
if (CMD_ARGC != 0)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
|
||||
static bool pld_initialized;
|
||||
if (pld_initialized) {
|
||||
LOG_INFO("'pld init' has already been called");
|
||||
return ERROR_OK;
|
||||
}
|
||||
pld_initialized = true;
|
||||
|
||||
LOG_DEBUG("Initializing PLDs...");
|
||||
return pld_init(CMD_CTX);
|
||||
}
|
||||
|
||||
static const struct command_registration pld_config_command_handlers[] = {
|
||||
{
|
||||
.name = "device",
|
||||
.mode = COMMAND_CONFIG,
|
||||
.handler = handle_pld_device_command,
|
||||
.help = "configure a PLD device",
|
||||
.usage = "driver_name [driver_args ... ]",
|
||||
},
|
||||
{
|
||||
.name = "init",
|
||||
.mode = COMMAND_CONFIG,
|
||||
.handler = handle_pld_init_command,
|
||||
.help = "initialize PLD devices",
|
||||
.usage = ""
|
||||
},
|
||||
COMMAND_REGISTRATION_DONE
|
||||
};
|
||||
static const struct command_registration pld_command_handler[] = {
|
||||
{
|
||||
.name = "pld",
|
||||
.mode = COMMAND_ANY,
|
||||
.help = "programmable logic device commands",
|
||||
.usage = "",
|
||||
.chain = pld_config_command_handlers,
|
||||
},
|
||||
COMMAND_REGISTRATION_DONE
|
||||
};
|
||||
int pld_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
return register_commands(cmd_ctx, NULL, pld_command_handler);
|
||||
}
|
||||
54
debuggers/openocd/src/pld/pld.h
Normal file
54
debuggers/openocd/src/pld/pld.h
Normal file
@ -0,0 +1,54 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006 by Dominic Rath *
|
||||
* Dominic.Rath@gmx.de *
|
||||
* *
|
||||
* 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 PLD_H
|
||||
#define PLD_H
|
||||
|
||||
#include <helper/command.h>
|
||||
|
||||
struct pld_device;
|
||||
|
||||
#define __PLD_DEVICE_COMMAND(name) \
|
||||
COMMAND_HELPER(name, struct pld_device *pld)
|
||||
|
||||
struct pld_driver {
|
||||
const char *name;
|
||||
__PLD_DEVICE_COMMAND((*pld_device_command));
|
||||
const struct command_registration *commands;
|
||||
int (*load)(struct pld_device *pld_device, const char *filename);
|
||||
};
|
||||
|
||||
#define PLD_DEVICE_COMMAND_HANDLER(name) \
|
||||
static __PLD_DEVICE_COMMAND(name)
|
||||
|
||||
struct pld_device {
|
||||
struct pld_driver *driver;
|
||||
void *driver_priv;
|
||||
struct pld_device *next;
|
||||
};
|
||||
|
||||
int pld_register_commands(struct command_context *cmd_ctx);
|
||||
|
||||
struct pld_device *get_pld_device_by_num(int num);
|
||||
|
||||
#define ERROR_PLD_DEVICE_INVALID (-1000)
|
||||
#define ERROR_PLD_FILE_LOAD_FAILED (-1001)
|
||||
|
||||
#endif /* PLD_H */
|
||||
246
debuggers/openocd/src/pld/virtex2.c
Normal file
246
debuggers/openocd/src/pld/virtex2.c
Normal file
@ -0,0 +1,246 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006 by Dominic Rath *
|
||||
* Dominic.Rath@gmx.de *
|
||||
* *
|
||||
* 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. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "virtex2.h"
|
||||
#include "xilinx_bit.h"
|
||||
#include "pld.h"
|
||||
|
||||
static int virtex2_set_instr(struct jtag_tap *tap, uint32_t new_instr)
|
||||
{
|
||||
if (tap == NULL)
|
||||
return ERROR_FAIL;
|
||||
|
||||
if (buf_get_u32(tap->cur_instr, 0, tap->ir_length) != new_instr) {
|
||||
struct scan_field field;
|
||||
|
||||
field.num_bits = tap->ir_length;
|
||||
void *t = calloc(DIV_ROUND_UP(field.num_bits, 8), 1);
|
||||
field.out_value = t;
|
||||
buf_set_u32(t, 0, field.num_bits, new_instr);
|
||||
field.in_value = NULL;
|
||||
|
||||
jtag_add_ir_scan(tap, &field, TAP_IDLE);
|
||||
|
||||
free(t);
|
||||
}
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int virtex2_send_32(struct pld_device *pld_device,
|
||||
int num_words, uint32_t *words)
|
||||
{
|
||||
struct virtex2_pld_device *virtex2_info = pld_device->driver_priv;
|
||||
struct scan_field scan_field;
|
||||
uint8_t *values;
|
||||
int i;
|
||||
|
||||
values = malloc(num_words * 4);
|
||||
|
||||
scan_field.num_bits = num_words * 32;
|
||||
scan_field.out_value = values;
|
||||
scan_field.in_value = NULL;
|
||||
|
||||
for (i = 0; i < num_words; i++)
|
||||
buf_set_u32(values + 4 * i, 0, 32, flip_u32(*words++, 32));
|
||||
|
||||
virtex2_set_instr(virtex2_info->tap, 0x5); /* CFG_IN */
|
||||
|
||||
jtag_add_dr_scan(virtex2_info->tap, 1, &scan_field, TAP_DRPAUSE);
|
||||
|
||||
free(values);
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static inline void virtexflip32(jtag_callback_data_t arg)
|
||||
{
|
||||
uint8_t *in = (uint8_t *)arg;
|
||||
*((uint32_t *)arg) = flip_u32(le_to_h_u32(in), 32);
|
||||
}
|
||||
|
||||
static int virtex2_receive_32(struct pld_device *pld_device,
|
||||
int num_words, uint32_t *words)
|
||||
{
|
||||
struct virtex2_pld_device *virtex2_info = pld_device->driver_priv;
|
||||
struct scan_field scan_field;
|
||||
|
||||
scan_field.num_bits = 32;
|
||||
scan_field.out_value = NULL;
|
||||
scan_field.in_value = NULL;
|
||||
|
||||
virtex2_set_instr(virtex2_info->tap, 0x4); /* CFG_OUT */
|
||||
|
||||
while (num_words--) {
|
||||
scan_field.in_value = (uint8_t *)words;
|
||||
|
||||
jtag_add_dr_scan(virtex2_info->tap, 1, &scan_field, TAP_DRPAUSE);
|
||||
|
||||
jtag_add_callback(virtexflip32, (jtag_callback_data_t)words);
|
||||
|
||||
words++;
|
||||
}
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int virtex2_read_stat(struct pld_device *pld_device, uint32_t *status)
|
||||
{
|
||||
uint32_t data[5];
|
||||
|
||||
jtag_add_tlr();
|
||||
|
||||
data[0] = 0xaa995566; /* synch word */
|
||||
data[1] = 0x2800E001; /* Type 1, read, address 7, 1 word */
|
||||
data[2] = 0x20000000; /* NOOP (Type 1, read, address 0, 0 words */
|
||||
data[3] = 0x20000000; /* NOOP */
|
||||
data[4] = 0x20000000; /* NOOP */
|
||||
virtex2_send_32(pld_device, 5, data);
|
||||
|
||||
virtex2_receive_32(pld_device, 1, status);
|
||||
|
||||
jtag_execute_queue();
|
||||
|
||||
LOG_DEBUG("status: 0x%8.8" PRIx32 "", *status);
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int virtex2_load(struct pld_device *pld_device, const char *filename)
|
||||
{
|
||||
struct virtex2_pld_device *virtex2_info = pld_device->driver_priv;
|
||||
struct xilinx_bit_file bit_file;
|
||||
int retval;
|
||||
unsigned int i;
|
||||
struct scan_field field;
|
||||
|
||||
field.in_value = NULL;
|
||||
|
||||
retval = xilinx_read_bit_file(&bit_file, filename);
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
|
||||
virtex2_set_instr(virtex2_info->tap, 0xb); /* JPROG_B */
|
||||
jtag_execute_queue();
|
||||
jtag_add_sleep(1000);
|
||||
|
||||
virtex2_set_instr(virtex2_info->tap, 0x5); /* CFG_IN */
|
||||
jtag_execute_queue();
|
||||
|
||||
for (i = 0; i < bit_file.length; i++)
|
||||
bit_file.data[i] = flip_u32(bit_file.data[i], 8);
|
||||
|
||||
field.num_bits = bit_file.length * 8;
|
||||
field.out_value = bit_file.data;
|
||||
|
||||
jtag_add_dr_scan(virtex2_info->tap, 1, &field, TAP_DRPAUSE);
|
||||
jtag_execute_queue();
|
||||
|
||||
jtag_add_tlr();
|
||||
|
||||
virtex2_set_instr(virtex2_info->tap, 0xc); /* JSTART */
|
||||
jtag_add_runtest(13, TAP_IDLE);
|
||||
virtex2_set_instr(virtex2_info->tap, 0x3f); /* BYPASS */
|
||||
virtex2_set_instr(virtex2_info->tap, 0x3f); /* BYPASS */
|
||||
virtex2_set_instr(virtex2_info->tap, 0xc); /* JSTART */
|
||||
jtag_add_runtest(13, TAP_IDLE);
|
||||
virtex2_set_instr(virtex2_info->tap, 0x3f); /* BYPASS */
|
||||
jtag_execute_queue();
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
COMMAND_HANDLER(virtex2_handle_read_stat_command)
|
||||
{
|
||||
struct pld_device *device;
|
||||
uint32_t status;
|
||||
|
||||
if (CMD_ARGC < 1)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
|
||||
unsigned dev_id;
|
||||
COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], dev_id);
|
||||
device = get_pld_device_by_num(dev_id);
|
||||
if (!device) {
|
||||
command_print(CMD_CTX, "pld device '#%s' is out of bounds", CMD_ARGV[0]);
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
virtex2_read_stat(device, &status);
|
||||
|
||||
command_print(CMD_CTX, "virtex2 status register: 0x%8.8" PRIx32 "", status);
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
PLD_DEVICE_COMMAND_HANDLER(virtex2_pld_device_command)
|
||||
{
|
||||
struct jtag_tap *tap;
|
||||
|
||||
struct virtex2_pld_device *virtex2_info;
|
||||
|
||||
if (CMD_ARGC < 2)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
|
||||
tap = jtag_tap_by_string(CMD_ARGV[1]);
|
||||
if (tap == NULL) {
|
||||
command_print(CMD_CTX, "Tap: %s does not exist", CMD_ARGV[1]);
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
virtex2_info = malloc(sizeof(struct virtex2_pld_device));
|
||||
virtex2_info->tap = tap;
|
||||
|
||||
pld->driver_priv = virtex2_info;
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static const struct command_registration virtex2_exec_command_handlers[] = {
|
||||
{
|
||||
.name = "read_stat",
|
||||
.mode = COMMAND_EXEC,
|
||||
.handler = virtex2_handle_read_stat_command,
|
||||
.help = "read status register",
|
||||
.usage = "pld_num",
|
||||
},
|
||||
COMMAND_REGISTRATION_DONE
|
||||
};
|
||||
static const struct command_registration virtex2_command_handler[] = {
|
||||
{
|
||||
.name = "virtex2",
|
||||
.mode = COMMAND_ANY,
|
||||
.help = "Virtex-II specific commands",
|
||||
.usage = "",
|
||||
.chain = virtex2_exec_command_handlers,
|
||||
},
|
||||
COMMAND_REGISTRATION_DONE
|
||||
};
|
||||
|
||||
struct pld_driver virtex2_pld = {
|
||||
.name = "virtex2",
|
||||
.commands = virtex2_command_handler,
|
||||
.pld_device_command = &virtex2_pld_device_command,
|
||||
.load = &virtex2_load,
|
||||
};
|
||||
30
debuggers/openocd/src/pld/virtex2.h
Normal file
30
debuggers/openocd/src/pld/virtex2.h
Normal file
@ -0,0 +1,30 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006 by Dominic Rath *
|
||||
* Dominic.Rath@gmx.de *
|
||||
* *
|
||||
* 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 VIRTEX2_H
|
||||
#define VIRTEX2_H
|
||||
|
||||
#include <jtag/jtag.h>
|
||||
|
||||
struct virtex2_pld_device {
|
||||
struct jtag_tap *tap;
|
||||
};
|
||||
|
||||
#endif /* VIRTEX2_H */
|
||||
130
debuggers/openocd/src/pld/xilinx_bit.c
Normal file
130
debuggers/openocd/src/pld/xilinx_bit.c
Normal file
@ -0,0 +1,130 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006 by Dominic Rath *
|
||||
* Dominic.Rath@gmx.de *
|
||||
* *
|
||||
* 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. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "xilinx_bit.h"
|
||||
#include "pld.h"
|
||||
#include <helper/log.h>
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
|
||||
static int read_section(FILE *input_file, int length_size, char section,
|
||||
uint32_t *buffer_length, uint8_t **buffer)
|
||||
{
|
||||
uint8_t length_buffer[4];
|
||||
int length;
|
||||
char section_char;
|
||||
int read_count;
|
||||
|
||||
if ((length_size != 2) && (length_size != 4)) {
|
||||
LOG_ERROR("BUG: length_size neither 2 nor 4");
|
||||
return ERROR_PLD_FILE_LOAD_FAILED;
|
||||
}
|
||||
|
||||
read_count = fread(§ion_char, 1, 1, input_file);
|
||||
if (read_count != 1)
|
||||
return ERROR_PLD_FILE_LOAD_FAILED;
|
||||
|
||||
if (section_char != section)
|
||||
return ERROR_PLD_FILE_LOAD_FAILED;
|
||||
|
||||
read_count = fread(length_buffer, 1, length_size, input_file);
|
||||
if (read_count != length_size)
|
||||
return ERROR_PLD_FILE_LOAD_FAILED;
|
||||
|
||||
if (length_size == 4)
|
||||
length = be_to_h_u32(length_buffer);
|
||||
else /* (length_size == 2) */
|
||||
length = be_to_h_u16(length_buffer);
|
||||
|
||||
if (buffer_length)
|
||||
*buffer_length = length;
|
||||
|
||||
*buffer = malloc(length);
|
||||
|
||||
read_count = fread(*buffer, 1, length, input_file);
|
||||
if (read_count != length)
|
||||
return ERROR_PLD_FILE_LOAD_FAILED;
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int xilinx_read_bit_file(struct xilinx_bit_file *bit_file, const char *filename)
|
||||
{
|
||||
FILE *input_file;
|
||||
struct stat input_stat;
|
||||
int read_count;
|
||||
|
||||
if (!filename || !bit_file)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
|
||||
if (stat(filename, &input_stat) == -1) {
|
||||
LOG_ERROR("couldn't stat() %s: %s", filename, strerror(errno));
|
||||
return ERROR_PLD_FILE_LOAD_FAILED;
|
||||
}
|
||||
|
||||
if (S_ISDIR(input_stat.st_mode)) {
|
||||
LOG_ERROR("%s is a directory", filename);
|
||||
return ERROR_PLD_FILE_LOAD_FAILED;
|
||||
}
|
||||
|
||||
if (input_stat.st_size == 0) {
|
||||
LOG_ERROR("Empty file %s", filename);
|
||||
return ERROR_PLD_FILE_LOAD_FAILED;
|
||||
}
|
||||
|
||||
input_file = fopen(filename, "rb");
|
||||
if (input_file == NULL) {
|
||||
LOG_ERROR("couldn't open %s: %s", filename, strerror(errno));
|
||||
return ERROR_PLD_FILE_LOAD_FAILED;
|
||||
}
|
||||
|
||||
read_count = fread(bit_file->unknown_header, 1, 13, input_file);
|
||||
if (read_count != 13) {
|
||||
LOG_ERROR("couldn't read unknown_header from file '%s'", filename);
|
||||
return ERROR_PLD_FILE_LOAD_FAILED;
|
||||
}
|
||||
|
||||
if (read_section(input_file, 2, 'a', NULL, &bit_file->source_file) != ERROR_OK)
|
||||
return ERROR_PLD_FILE_LOAD_FAILED;
|
||||
|
||||
if (read_section(input_file, 2, 'b', NULL, &bit_file->part_name) != ERROR_OK)
|
||||
return ERROR_PLD_FILE_LOAD_FAILED;
|
||||
|
||||
if (read_section(input_file, 2, 'c', NULL, &bit_file->date) != ERROR_OK)
|
||||
return ERROR_PLD_FILE_LOAD_FAILED;
|
||||
|
||||
if (read_section(input_file, 2, 'd', NULL, &bit_file->time) != ERROR_OK)
|
||||
return ERROR_PLD_FILE_LOAD_FAILED;
|
||||
|
||||
if (read_section(input_file, 4, 'e', &bit_file->length, &bit_file->data) != ERROR_OK)
|
||||
return ERROR_PLD_FILE_LOAD_FAILED;
|
||||
|
||||
LOG_DEBUG("bit_file: %s %s %s,%s %" PRIi32 "", bit_file->source_file, bit_file->part_name,
|
||||
bit_file->date, bit_file->time, bit_file->length);
|
||||
|
||||
fclose(input_file);
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
36
debuggers/openocd/src/pld/xilinx_bit.h
Normal file
36
debuggers/openocd/src/pld/xilinx_bit.h
Normal file
@ -0,0 +1,36 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006 by Dominic Rath *
|
||||
* Dominic.Rath@gmx.de *
|
||||
* *
|
||||
* 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 XILINX_BIT_H
|
||||
#define XILINX_BIT_H
|
||||
|
||||
struct xilinx_bit_file {
|
||||
uint8_t unknown_header[13];
|
||||
uint8_t *source_file;
|
||||
uint8_t *part_name;
|
||||
uint8_t *date;
|
||||
uint8_t *time;
|
||||
uint32_t length;
|
||||
uint8_t *data;
|
||||
};
|
||||
|
||||
int xilinx_read_bit_file(struct xilinx_bit_file *bit_file, const char *filename);
|
||||
|
||||
#endif /* XILINX_BIT_H */
|
||||
Reference in New Issue
Block a user