initial push
This commit is contained in:
7
m68k/test/.cvsignore
Normal file
7
m68k/test/.cvsignore
Normal file
@@ -0,0 +1,7 @@
|
||||
.deps
|
||||
Makefile
|
||||
Makefile.in
|
||||
bdm-chk
|
||||
bdm-chk.exe
|
||||
bdm-cpu32-chk
|
||||
bdm-cpu32-chk.exe
|
||||
54
m68k/test/ChangeLog
Normal file
54
m68k/test/ChangeLog
Normal file
@@ -0,0 +1,54 @@
|
||||
2001-10-19 Chris Johns <cjohns@cybertec.com.au>
|
||||
|
||||
* Makefile: Fixed the OS file extension plus other cleanups.
|
||||
|
||||
* README.cpu32-check: Checked in updates.
|
||||
|
||||
2001-04-15 Chris Johns <cjohns@cybertec.com.au>
|
||||
|
||||
* chk.c: Do not test the CPU interface using the ICD CPU32.
|
||||
|
||||
2001-02-03 Keith Outwater <vac4050@cae597.rsc.raytheon.com>
|
||||
|
||||
* Makefile: Added cpu32_check target
|
||||
|
||||
* README.cpu32_check: Added id to file
|
||||
|
||||
* README.cpu32_check: Misc updates
|
||||
|
||||
* cpu32_memtest.list,
|
||||
cpu32_check.c,
|
||||
README.cpu32_check:
|
||||
New file.
|
||||
|
||||
2000-09-02 Chris Johns <cjohns@cybertec.com.au>
|
||||
|
||||
* chk.c: Added the ICD interface message to the test.
|
||||
|
||||
2000-09-02 Chris Johns <cjohns@acm.org>
|
||||
|
||||
* chk.c: Added the ICD interface message to the test.
|
||||
|
||||
22000-08-31 Chris Johns <ccj@acm.org>
|
||||
|
||||
* Makefile: Remove the unwanted libs.
|
||||
|
||||
22000-06-25 Chris Johns <ccj@acm.org>
|
||||
|
||||
* chk.c: Added an alignment test.
|
||||
Print the BDM hardware version number of the Coldfire.
|
||||
|
||||
* coldfire-trace: Show the alignment test of a 5307 processor.
|
||||
|
||||
22000-05-31 Chris Johns <ccj@acm.org>
|
||||
|
||||
* chk.c: Support for IDC interface added.
|
||||
|
||||
22000-05-27 Chris Johns <ccj@acm.org>
|
||||
|
||||
* Makefile: Clean the Win9x exe.
|
||||
|
||||
2000-05-18 Chris Johns <ccj@acm.org>
|
||||
|
||||
* README, coldfire-trace, sram-test.S, Makefile, chk.c: New file.
|
||||
|
||||
41
m68k/test/Makefile.am
Normal file
41
m68k/test/Makefile.am
Normal file
@@ -0,0 +1,41 @@
|
||||
##
|
||||
## $Id: Makefile.am,v 1.4 2008/03/06 10:35:40 cjohns Exp $
|
||||
##
|
||||
## This file is part of a free BDM package
|
||||
##
|
||||
## 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.
|
||||
##
|
||||
|
||||
AM_CPPFLAGS = -I$(srcdir)/../driver -I$(srcdir)/../lib
|
||||
|
||||
##
|
||||
## Only way I know of anding in automake.
|
||||
##
|
||||
|
||||
if WIN32
|
||||
if BDM_REMOTE
|
||||
LIBS += -l wsock32
|
||||
endif
|
||||
endif
|
||||
|
||||
if TBLCF_USB
|
||||
TBLCF_USB_LIB = $(top_builddir)/tblcf/libtblcf.a
|
||||
endif
|
||||
|
||||
if LIBUSB_PATH
|
||||
AM_CPPFLAGS += -I@LIBUSB_INCLUDE_DIR@
|
||||
AM_LDFLAGS = -L@LIBUSB_LIB_DIR@
|
||||
endif
|
||||
|
||||
bin_PROGRAMS = bdm-chk bdm-cpu32-chk
|
||||
|
||||
bdm_chk_SOURCES = \
|
||||
chk.c
|
||||
bdm_chk_LDADD = ../lib/libBDM.a $(TBLCF_USB_LIB)
|
||||
|
||||
bdm_cpu32_chk_SOURCES = \
|
||||
cpu32-check.c
|
||||
bdm_cpu32_chk_LDADD = ../lib/libBDM.a $(TBLCF_USB_LIB)
|
||||
455
m68k/test/Makefile.in
Normal file
455
m68k/test/Makefile.in
Normal file
@@ -0,0 +1,455 @@
|
||||
# Makefile.in generated by automake 1.10 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006 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@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@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@
|
||||
target_triplet = @target@
|
||||
@BDM_REMOTE_TRUE@@WIN32_TRUE@am__append_1 = -l wsock32
|
||||
@LIBUSB_PATH_TRUE@am__append_2 = -I@LIBUSB_INCLUDE_DIR@
|
||||
bin_PROGRAMS = bdm-chk$(EXEEXT) bdm-cpu32-chk$(EXEEXT)
|
||||
subdir = test
|
||||
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
ChangeLog
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
am__installdirs = "$(DESTDIR)$(bindir)"
|
||||
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
|
||||
PROGRAMS = $(bin_PROGRAMS)
|
||||
am_bdm_chk_OBJECTS = chk.$(OBJEXT)
|
||||
bdm_chk_OBJECTS = $(am_bdm_chk_OBJECTS)
|
||||
bdm_chk_DEPENDENCIES = ../lib/libBDM.a $(TBLCF_USB_LIB)
|
||||
am_bdm_cpu32_chk_OBJECTS = cpu32-check.$(OBJEXT)
|
||||
bdm_cpu32_chk_OBJECTS = $(am_bdm_cpu32_chk_OBJECTS)
|
||||
bdm_cpu32_chk_DEPENDENCIES = ../lib/libBDM.a $(TBLCF_USB_LIB)
|
||||
DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
|
||||
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
SOURCES = $(bdm_chk_SOURCES) $(bdm_cpu32_chk_SOURCES)
|
||||
DIST_SOURCES = $(bdm_chk_SOURCES) $(bdm_cpu32_chk_SOURCES)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BDM_SUBDIRS = @BDM_SUBDIRS@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FLASH_PLUGIN_GCC = @FLASH_PLUGIN_GCC@
|
||||
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@
|
||||
LEX = @LEX@
|
||||
LEXLIB = @LEXLIB@
|
||||
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@ $(am__append_1)
|
||||
LIBUSB_INCLUDE_DIR = @LIBUSB_INCLUDE_DIR@
|
||||
LIBUSB_LIB_DIR = @LIBUSB_LIB_DIR@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
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_CC = @ac_ct_CC@
|
||||
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@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
flash_plugin_cc = @flash_plugin_cc@
|
||||
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 = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
AM_CPPFLAGS = -I$(srcdir)/../driver -I$(srcdir)/../lib $(am__append_2)
|
||||
@TBLCF_USB_TRUE@TBLCF_USB_LIB = $(top_builddir)/tblcf/libtblcf.a
|
||||
@LIBUSB_PATH_TRUE@AM_LDFLAGS = -L@LIBUSB_LIB_DIR@
|
||||
bdm_chk_SOURCES = \
|
||||
chk.c
|
||||
|
||||
bdm_chk_LDADD = ../lib/libBDM.a $(TBLCF_USB_LIB)
|
||||
bdm_cpu32_chk_SOURCES = \
|
||||
cpu32-check.c
|
||||
|
||||
bdm_cpu32_chk_LDADD = ../lib/libBDM.a $(TBLCF_USB_LIB)
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign test/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_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
|
||||
if test -f $$p \
|
||||
; then \
|
||||
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
|
||||
$(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-binPROGRAMS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(bindir)/$$f"; \
|
||||
done
|
||||
|
||||
clean-binPROGRAMS:
|
||||
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
|
||||
bdm-chk$(EXEEXT): $(bdm_chk_OBJECTS) $(bdm_chk_DEPENDENCIES)
|
||||
@rm -f bdm-chk$(EXEEXT)
|
||||
$(LINK) $(bdm_chk_OBJECTS) $(bdm_chk_LDADD) $(LIBS)
|
||||
bdm-cpu32-chk$(EXEEXT): $(bdm_cpu32_chk_OBJECTS) $(bdm_cpu32_chk_DEPENDENCIES)
|
||||
@rm -f bdm-cpu32-chk$(EXEEXT)
|
||||
$(LINK) $(bdm_cpu32_chk_OBJECTS) $(bdm_cpu32_chk_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chk.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu32-check.Po@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
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 $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$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 $(PROGRAMS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(bindir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
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:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-binPROGRAMS clean-generic 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
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-exec-am: install-binPROGRAMS
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-ps: 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
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-binPROGRAMS
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
|
||||
clean-generic ctags distclean distclean-compile \
|
||||
distclean-generic distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-binPROGRAMS \
|
||||
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 pdf pdf-am ps ps-am tags uninstall \
|
||||
uninstall-am uninstall-binPROGRAMS
|
||||
|
||||
# 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:
|
||||
162
m68k/test/README
Normal file
162
m68k/test/README
Normal file
@@ -0,0 +1,162 @@
|
||||
Checker of chk.
|
||||
|
||||
This is a simple program designed to test the BDM driver and BDM
|
||||
hardware.
|
||||
|
||||
To make the test program do :
|
||||
|
||||
$ make
|
||||
|
||||
To clean the directory do :
|
||||
|
||||
$ make clean
|
||||
|
||||
Running the program without any command line options displays the options
|
||||
which you can use :
|
||||
|
||||
$ ./chk
|
||||
chk -d -p [pc] -r [loops] -s [loops] -C -Q -R [device]
|
||||
where :
|
||||
-d [level] : enable driver debug output
|
||||
-p [pc] : address to run to for the CPU32 target
|
||||
-r [loops] : number or register check loops
|
||||
-s [loops] : number or SRAM check loops on the Coldfire
|
||||
-D [delay] : delay count for the clock generation
|
||||
-C : continue on an error
|
||||
-Q : be quite on errors
|
||||
-R : reset on a register check fail
|
||||
[device] : the bdm device, eg /dev/bdmcf0
|
||||
|
||||
The `-r', `-s', `-R' are specific to the Coldfire processor.
|
||||
|
||||
The basic test requires nothing more than the device path :
|
||||
|
||||
$ ./chk kea:/dev/bdmcf1
|
||||
Driver Ver : 2.4
|
||||
Processor : Coldfire
|
||||
Interface : P&E Coldfire
|
||||
CSR break set, target stopped.
|
||||
Target status: 0x2 -- NOT RESET, HALTED, NOT STOPPED, POWER ON, CONNECTED.
|
||||
Register test, 1 of 1 :
|
||||
D00 : ........................................
|
||||
D01 : ........................................
|
||||
D02 : ........................................
|
||||
D03 : ........................................
|
||||
D04 : ........................................
|
||||
D05 : ........................................
|
||||
D06 : ........................................
|
||||
D07 : ........................................
|
||||
A08 : ........................................
|
||||
A09 : ........................................
|
||||
A10 : ........................................
|
||||
A11 : ........................................
|
||||
A12 : ........................................
|
||||
A13 : ........................................
|
||||
A14 : ........................................
|
||||
A15 : ........................................
|
||||
Read/Write SRAM Test, 1 loops
|
||||
1 : ........................................
|
||||
Coldfire execution test, loading code to SRAM.
|
||||
Stepping code.
|
||||
Stepping, pc is 0x20000000, csr = 0x01100000
|
||||
Stepping, pc is 0x20000004, csr = 0x01100030
|
||||
Stepping, pc is 0x2000000a, csr = 0x01100030
|
||||
Stepping, pc is 0x20000010, csr = 0x01100030
|
||||
Stepping, pc is 0x20000016, csr = 0x01100030
|
||||
Stepping, pc is 0x2000001c, csr = 0x01100030
|
||||
Stepping, pc is 0x20000022, csr = 0x01100030
|
||||
Stepping, pc is 0x20000028, csr = 0x01100030
|
||||
Stepping, pc is 0x2000002e, csr = 0x01100030
|
||||
Stepping, pc is 0x20000034, csr = 0x01100030
|
||||
Stepping, pc is 0x2000003a, csr = 0x01100030
|
||||
Stepping, pc is 0x20000040, csr = 0x01100030
|
||||
Stepping, pc is 0x20000046, csr = 0x01100030
|
||||
Stepping, pc is 0x2000004c, csr = 0x01100030
|
||||
Stepping, pc is 0x20000052, csr = 0x01100030
|
||||
Stepping, pc is 0x20000058, csr = 0x01100030
|
||||
Stepping, pc is 0x2000005e, csr = 0x01100030
|
||||
Stepping, pc is 0x20000064, csr = 0x01100030
|
||||
A0: A0A0A0A0 D0: D0D0D0D0
|
||||
A1: A1A1A1A1 D1: D1D1D1D1
|
||||
A2: A2A2A2A2 D2: D2D2D2D2
|
||||
A3: A3A3A3A3 D3: D3D3D3D3
|
||||
A4: A4A4A4A4 D4: D4D4D4D4
|
||||
A5: A5A5A5A5 D5: D5D5D5D5
|
||||
A6: A6A6A6A6 D6: D6D6D6D6
|
||||
A7: A7A7A7A7 D7: D7D7D7D7
|
||||
RPC:2000006A
|
||||
SR:00002708
|
||||
VBR:000002F8
|
||||
CACR:00000000
|
||||
ACR0:00004000
|
||||
ACR1:FF004000
|
||||
RAMBAR:20000001
|
||||
MBAR:10000000
|
||||
CSR:01100030
|
||||
AATR:00000005
|
||||
TDR:00000000
|
||||
PBR:00000000
|
||||
PBMR:00000000
|
||||
ABHR:00000000
|
||||
ABLR:00000000
|
||||
DBR:00000000
|
||||
DBMR:00000000
|
||||
CSR halt set, target halted.
|
||||
Target status: 0x2 -- NOT RESET, HALTED, NOT STOPPED, POWER ON, CONNECTED.
|
||||
A0: A0A0A0A0 D0: D0D0D0D0
|
||||
A1: A1A1A1A1 D1: D1D1D1D1
|
||||
A2: A2A2A2A2 D2: D2D2D2D2
|
||||
A3: A3A3A3A3 D3: D3D3D3D3
|
||||
A4: A4A4A4A4 D4: D4D4D4D4
|
||||
A5: A5A5A5A5 D5: D5D5D5D5
|
||||
A6: A6A6A6A6 D6: D6D6D6D6
|
||||
A7: A7A7A7A7 D7: D7D7D7D7
|
||||
RPC:20000088
|
||||
SR:00002708
|
||||
VBR:000002F8
|
||||
CACR:00000000
|
||||
ACR0:00004000
|
||||
ACR1:FF004000
|
||||
RAMBAR:20000001
|
||||
MBAR:10000000
|
||||
CSR:02100000
|
||||
AATR:00000005
|
||||
TDR:00000000
|
||||
PBR:00000000
|
||||
PBMR:00000000
|
||||
ABHR:00000000
|
||||
ABLR:00000000
|
||||
DBR:00000000
|
||||
DBMR:00000000
|
||||
0FC00000: 00009D74
|
||||
01000000: 00009D74
|
||||
01001000: 00000000
|
||||
01001050: FFE0156C
|
||||
01001054: FFE01580
|
||||
|
||||
The checker first tests if it can halt the processor.
|
||||
|
||||
Next is a register test. Here each register on the processor is sent a
|
||||
range of bit patterns. You can, using the `-r' command line option,
|
||||
specify the number times this test is run. If you select 0 the test
|
||||
will not be run. A `W' or `R' will be displayed instead of a `.' if an
|
||||
error occurs.
|
||||
|
||||
The third test is an SRAM test. A bit pattern is written and read from
|
||||
the SRAM which is internal to the Coldfire. The write then read is a
|
||||
block write then read. This is a special operation which typically
|
||||
only results in two calls to the driver. If a mismatch occurs the
|
||||
address is displayed and the test stops unless the continue option is
|
||||
provided. The conintue option is useful when probing an interface
|
||||
which is not working. The `-s' option controls the number of times the
|
||||
test is run.
|
||||
|
||||
The next test is a code execution test. A small section of code is
|
||||
downloaded to the SRAM of the Coldfire. The program counter is set to
|
||||
point to the SRAM and a serial of single step operations
|
||||
occur. Finally a go occurs. The processor should execute some
|
||||
instructions until a HALT. The code can be found in the file
|
||||
`sram-test.S'. It loads each register witch its register label.
|
||||
|
||||
Finally, all the registers are printed, and some memory locations are
|
||||
read and written to.
|
||||
67
m68k/test/README.cpu32-check
Normal file
67
m68k/test/README.cpu32-check
Normal file
@@ -0,0 +1,67 @@
|
||||
$Id: README.cpu32-check,v 1.1 2003/06/02 15:15:56 codewiz Exp $
|
||||
|
||||
cpu32-check - a program to exercise the gdb-bdm driver and your CPU32
|
||||
(mc68360) based target system.
|
||||
|
||||
DESCRIPTION:
|
||||
cpu32-check is a derivative of the program 'chk' written by Chris Johns to
|
||||
test both CPU32 and Coldfire targets. cpu32-check provides tests that can
|
||||
help verify that both the BDM driver and the target are working properly.
|
||||
|
||||
BACKGROUND:
|
||||
I found myself in a situation in which I had both an unknown/untested BDM
|
||||
driver and an untested custom CPU32 (mc68360) based target system.
|
||||
|
||||
I wrote cpu32-check to help. I considered augmenting 'chk' to more fully
|
||||
support the CPU32, but I was in a hurry and did not really have the time to
|
||||
do a proper job of integrating the CPU32 target stuff I needed into 'chk'.
|
||||
cpu32-check is the result.
|
||||
|
||||
STATUS:
|
||||
cpu32-check is very much a work in progress. I stopped working on it when
|
||||
my target started to work with the P&E BDM driver. It's a little rough around
|
||||
the edges, but the program was very useful to for performing hardware
|
||||
verification test on my target system and for confirming that the BDM driver
|
||||
was functioning properly.
|
||||
|
||||
At this point, the only things that don't seem to work are the functions that
|
||||
deal with the mc68360's internal memory: the internal memory test and executing
|
||||
a program from internal memory. The fixes are probably pretty simple.
|
||||
|
||||
The functions that deal with external memory seem to work fine.
|
||||
|
||||
I hope that someone can take a look at the program and make improvements and
|
||||
additions, or merge some of the functionality provided in 'cpu32-check' into
|
||||
the 'chk' program.
|
||||
|
||||
TO DO:
|
||||
1. Look at merging useful functions into 'chk'
|
||||
2. Fix code execution from internal RAM
|
||||
3. Fix internal RAM test
|
||||
4. Look at pulling target-specific initializations out of the main program.
|
||||
Perhaps some kind of external configuration file (or command language?)
|
||||
5. Make it easier to use cpu32-check to do 'punishment tests' i.e. run
|
||||
the driver and target in a loop for several hours and either stop on
|
||||
errors or otherwise record them.
|
||||
|
||||
The portions of this cpu32-chk that I wrote may be freely used for any purpose.
|
||||
I ask only that any improvements, enhancements, fixes, etc... be submitted for
|
||||
inclusion in the distribution so that others may benefit from them and that
|
||||
the author information in the sources be left intact.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
02/02/2001
|
||||
|
||||
Keith Outwater
|
||||
(vac4050@cae597.rsc.raytheon.com) or
|
||||
(keitho@qwest.net)
|
||||
955
m68k/test/chk.c
Normal file
955
m68k/test/chk.c
Normal file
@@ -0,0 +1,955 @@
|
||||
/*
|
||||
* Check for the BDM driver. Tests parts of the driver.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <BDMlib.h>
|
||||
|
||||
#if defined (__WIN32__)
|
||||
#define sleep(_s) Sleep((_s) * 1000000)
|
||||
#endif
|
||||
|
||||
static const char *const sysreg_name[BDM_MAX_SYSREG] = {
|
||||
"RPC", "PCC", "SR", "USP",
|
||||
"SSP", "SFC", "DFC", "ATEMP",
|
||||
"FAR", "VBR", "CACR", "ACR0",
|
||||
"ACR1", "RAMBAR", "MBAR", "CSR",
|
||||
"AATR", "TDR", "PBR", "PBMR",
|
||||
"ABHR", "ABLR", "DBR", "DBMR",
|
||||
};
|
||||
|
||||
static int stop_on_error = 1;
|
||||
static int stop_quite = 0;
|
||||
static int force_reset_on_fail = 0;
|
||||
|
||||
const unsigned long test_pattern[10 * 4] = {
|
||||
0x00000000, 0xffffffff, 0xaaaaaaaa, 0x55555555,
|
||||
0x12345678, 0x87654321, 0x12344321, 0x43211234,
|
||||
0x00000001, 0x00000002, 0x00000004, 0x00000008,
|
||||
0x00000010, 0x00000020, 0x00000040, 0x00000080,
|
||||
0x00000100, 0x00000200, 0x00000400, 0x00000800,
|
||||
0x00001000, 0x00002000, 0x00004000, 0x00008000,
|
||||
0x00010000, 0x00020000, 0x00040000, 0x00080000,
|
||||
0x00100000, 0x00200000, 0x00400000, 0x00800000,
|
||||
0x01000000, 0x02000000, 0x04000000, 0x08000000,
|
||||
0x10000000, 0x20000000, 0x40000000, 0x80000000
|
||||
};
|
||||
|
||||
#define SRAMBAR 0x20000000
|
||||
|
||||
void
|
||||
cleanExit (int exit_code)
|
||||
{
|
||||
if (bdmIsOpen ()) {
|
||||
bdmSetDriverDebugFlag (0);
|
||||
bdmClose ();
|
||||
}
|
||||
exit (exit_code);
|
||||
}
|
||||
|
||||
void
|
||||
showError (char *msg)
|
||||
{
|
||||
if (!stop_quite)
|
||||
printf ("%s failed: %s\n", msg, bdmErrorString ());
|
||||
if (stop_on_error)
|
||||
cleanExit (1);
|
||||
}
|
||||
|
||||
void
|
||||
showLong (unsigned long address)
|
||||
{
|
||||
unsigned long l;
|
||||
|
||||
printf ("%.8lX: ", address);
|
||||
if (bdmReadLongWord (address, &l) < 0)
|
||||
showError ("Read long");
|
||||
printf ("%.8lX\n", l);
|
||||
}
|
||||
|
||||
void
|
||||
showRegs (int cpu)
|
||||
{
|
||||
unsigned long a, d, r;
|
||||
int i, s;
|
||||
|
||||
for (i = 0 ; i < 8 ; i++) {
|
||||
if ((bdmReadRegister (i, &d) < 0) || (bdmReadRegister (i+8, &a) < 0))
|
||||
showError ("Read register");
|
||||
|
||||
printf ("A%d: %.8lX D%d: %.8lX\n", i, a, i, d);
|
||||
}
|
||||
|
||||
for (i = 0 ; i < BDM_MAX_SYSREG; i++) {
|
||||
if (cpu == BDM_CPU32) {
|
||||
switch (i) {
|
||||
default:
|
||||
s = i;
|
||||
break;
|
||||
|
||||
case BDM_REG_CACR:
|
||||
case BDM_REG_ACR0:
|
||||
case BDM_REG_ACR1:
|
||||
case BDM_REG_RAMBAR:
|
||||
case BDM_REG_CSR:
|
||||
case BDM_REG_AATR:
|
||||
case BDM_REG_TDR:
|
||||
case BDM_REG_PBR:
|
||||
case BDM_REG_PBMR:
|
||||
case BDM_REG_ABHR:
|
||||
case BDM_REG_ABLR:
|
||||
case BDM_REG_DBR:
|
||||
case BDM_REG_DBMR:
|
||||
s = BDM_MAX_SYSREG;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
switch (i) {
|
||||
default:
|
||||
s = i;
|
||||
break;
|
||||
|
||||
case BDM_REG_PCC:
|
||||
case BDM_REG_USP:
|
||||
case BDM_REG_SSP:
|
||||
case BDM_REG_SFC:
|
||||
case BDM_REG_DFC:
|
||||
case BDM_REG_ATEMP:
|
||||
case BDM_REG_FAR:
|
||||
s = BDM_MAX_SYSREG;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (s < BDM_MAX_SYSREG) {
|
||||
if (bdmReadSystemRegister (s, &r) < 0)
|
||||
showError ("Read system register");
|
||||
printf (" %8s:%.8lX\n", sysreg_name[i], r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
cpu32Execute (unsigned long chkpc)
|
||||
{
|
||||
unsigned long pc;
|
||||
|
||||
printf ("Run to %#8lx\n", chkpc);
|
||||
|
||||
if ((bdmWriteSystemRegister (BDM_REG_SFC, 5) < 0) ||
|
||||
(bdmWriteSystemRegister (BDM_REG_DFC, 5) < 0))
|
||||
showError ("Write SFC/DFC");
|
||||
|
||||
for (;;) {
|
||||
if (bdmReadSystemRegister (BDM_REG_RPC, &pc) < 0)
|
||||
showError ("Read PC");
|
||||
if (pc == chkpc)
|
||||
break;
|
||||
if (bdmStep () < 0)
|
||||
showError ("Step");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
do_reset (int cpu)
|
||||
{
|
||||
unsigned long csr;
|
||||
|
||||
/*
|
||||
* Reset the target
|
||||
*/
|
||||
if (bdmReset () < 0)
|
||||
showError ("Reset");
|
||||
|
||||
/*
|
||||
* Get the target status
|
||||
*/
|
||||
if (cpu == BDM_COLDFIRE) {
|
||||
if (bdmReadSystemRegister (BDM_REG_CSR, &csr) < 0)
|
||||
showError ("Reading CSR");
|
||||
|
||||
if ((csr & 0x01000000) == 0) {
|
||||
printf ("CSR break not set, target failed to break, CSR = 0x%08lx\n", csr);
|
||||
cleanExit (1);
|
||||
}
|
||||
printf ("CSR break set, target stopped.\n");
|
||||
printf ("Debug module version is %d, (%s)\n",
|
||||
(unsigned char) (csr >> 20) & 0x0f,
|
||||
((csr >> 20) & 0x0f) == 0 ? "5206(e)" : "5307");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
coldfireExecute ()
|
||||
{
|
||||
unsigned char wbuf[512];
|
||||
unsigned char rbuf[512];
|
||||
unsigned long csr, pc;
|
||||
int status;
|
||||
int code_len;
|
||||
int i, b;
|
||||
|
||||
const char *code =
|
||||
"46fc 2700"
|
||||
"2e7c 2000 0000"
|
||||
"207c a0a0 a0a0"
|
||||
"227c a1a1 a1a1"
|
||||
"247c a2a2 a2a2"
|
||||
"267c a3a3 a3a3"
|
||||
"287c a4a4 a4a4"
|
||||
"2a7c a5a5 a5a5"
|
||||
"2c7c a6a6 a6a6"
|
||||
"2e7c a7a7 a7a7"
|
||||
"203c d0d0 d0d0"
|
||||
"223c d1d1 d1d1"
|
||||
"243c d2d2 d2d2"
|
||||
"263c d3d3 d3d3"
|
||||
"283c d4d4 d4d4"
|
||||
"2a3c d5d5 d5d5"
|
||||
"2c3c d6d6 d6d6"
|
||||
"2e3c d7d7 d7d7"
|
||||
"4e71"
|
||||
"4e71"
|
||||
"4e71"
|
||||
"4e71"
|
||||
"4e71"
|
||||
"4e71"
|
||||
"4e71"
|
||||
"4e71"
|
||||
"4e71"
|
||||
"4e71"
|
||||
"4e71"
|
||||
"4e71"
|
||||
"4e71"
|
||||
"4e71"
|
||||
"4ac8";
|
||||
|
||||
printf ("Coldfire execution test, loading code to SRAM.\n");
|
||||
|
||||
/*
|
||||
* Convert the code to binary to load. The code is
|
||||
* like this as it is easy to cut and paste in.
|
||||
*/
|
||||
|
||||
code_len = strlen (code);
|
||||
|
||||
if (code_len >= 512) {
|
||||
printf("Too much code for the buffer.\n");
|
||||
cleanExit (1);
|
||||
}
|
||||
|
||||
b = 0;
|
||||
|
||||
for (i = 0; i < code_len; i++) {
|
||||
if (code[i] > ' ') {
|
||||
if (code[i] >= '0' && code[i] <= '9')
|
||||
wbuf[b] = code[i] - '0';
|
||||
else if (code[i] >= 'a' && code[i] <= 'f')
|
||||
wbuf[b] = code[i] - 'a' + 10;
|
||||
|
||||
i++;
|
||||
|
||||
if (code[i] >= '0' && code[i] <= '9')
|
||||
wbuf[b] = (wbuf[b] << 4) | (code[i] - '0');
|
||||
else if (code[i] >= 'a' && code[i] <= 'f')
|
||||
wbuf[b] = (wbuf[b] << 4) | (code[i] - 'a' + 10);
|
||||
|
||||
b++;
|
||||
}
|
||||
}
|
||||
|
||||
if (bdmWriteSystemRegister (BDM_REG_RAMBAR, SRAMBAR | 1) < 0)
|
||||
showError ("Writing RAMBAR");
|
||||
|
||||
if (bdmWriteMemory (SRAMBAR, wbuf, b) < 0)
|
||||
showError ("Writing SRAM buffer");
|
||||
|
||||
if (bdmReadMemory (SRAMBAR, rbuf, b) < 0)
|
||||
showError ("Reading SRAM buffer");
|
||||
|
||||
if (bdmWriteSystemRegister (BDM_REG_RPC, SRAMBAR) < 0)
|
||||
showError ("Writing PC");
|
||||
|
||||
printf ("Stepping code.\n");
|
||||
|
||||
for (i = 0; i < 18; i++) {
|
||||
if (bdmReadSystemRegister (BDM_REG_CSR, &csr) < 0)
|
||||
showError ("Reading CSR");
|
||||
if (bdmReadSystemRegister (BDM_REG_RPC, &pc) < 0)
|
||||
showError ("Reading PC");
|
||||
|
||||
printf ("Stepping, pc is 0x%08lx, csr = 0x%08lx\n", pc, csr);
|
||||
|
||||
if ((pc & 0xfffff000) != SRAMBAR)
|
||||
{
|
||||
printf ("WARNING: PC is not in the SRAM, something is wrong.\n");
|
||||
}
|
||||
|
||||
if (bdmStep () < 0)
|
||||
showError ("Step");
|
||||
}
|
||||
|
||||
showRegs (BDM_COLDFIRE);
|
||||
|
||||
if (bdmGo () < 0)
|
||||
showError ("Go");
|
||||
|
||||
sleep (1);
|
||||
|
||||
if (bdmReadSystemRegister (BDM_REG_CSR, &csr) < 0)
|
||||
showError ("Reading CSR");
|
||||
|
||||
if ((csr & 0x02000000) == 0) {
|
||||
printf ("CSR halt not set, target failed to halt, CSR = 0x%08lx\n", csr);
|
||||
cleanExit (1);
|
||||
}
|
||||
|
||||
printf ("CSR halt set, target halted.\n");
|
||||
|
||||
/*
|
||||
* For the Coldfire the target must be halted. This tests the csr caching.
|
||||
*/
|
||||
status = bdmStatus ();
|
||||
printf ("Target status: 0x%x -- %s, %s, %s, %s, %s.\n", status,
|
||||
status & BDM_TARGETRESET ? "RESET" : "NOT RESET",
|
||||
status & BDM_TARGETHALT ? "HALTED" : "NOT HALTED",
|
||||
status & BDM_TARGETSTOPPED ? "STOPPED" : "NOT STOPPED",
|
||||
status & BDM_TARGETPOWER ? "POWER OFF" : "POWER ON",
|
||||
status & BDM_TARGETNC ? "NOT CONNECTED" : "CONNECTED");
|
||||
}
|
||||
|
||||
void
|
||||
coldfireSramVerify (int loops)
|
||||
{
|
||||
#define SRAM_BYTE_SIZE (1024) /* (1024 * 2) change for 5206e */
|
||||
#define SRAM_BUF_SIZE (SRAM_BYTE_SIZE / sizeof(unsigned long))
|
||||
|
||||
unsigned long buf[SRAM_BUF_SIZE];
|
||||
unsigned int test;
|
||||
unsigned int i;
|
||||
int sram_ok;
|
||||
int loop = 0;
|
||||
|
||||
printf ("Read/Write SRAM Test, %d loops\n", loops);
|
||||
|
||||
if (bdmWriteSystemRegister (BDM_REG_RAMBAR, SRAMBAR | 1) < 0)
|
||||
showError ("Writing RAMBAR");
|
||||
|
||||
while (loop < loops) {
|
||||
loop++;
|
||||
printf (" %5i : ", loop);
|
||||
for (test = 0; test < sizeof(test_pattern) / sizeof (test_pattern[0]); test++) {
|
||||
for (i = 0; i < SRAM_BUF_SIZE; i++) {
|
||||
buf[i] = test_pattern[test];
|
||||
}
|
||||
|
||||
sram_ok = 1;
|
||||
|
||||
if (bdmWriteMemory (SRAMBAR, (unsigned char*) buf, SRAM_BYTE_SIZE) < 0) {
|
||||
if (stop_quite)
|
||||
printf ("W");
|
||||
else
|
||||
showError ("Writing SRAM buffer");
|
||||
}
|
||||
|
||||
if (bdmReadMemory (SRAMBAR, (unsigned char*) buf, SRAM_BYTE_SIZE) < 0) {
|
||||
if (stop_quite)
|
||||
printf ("R");
|
||||
else
|
||||
showError ("Reading SRAM buffer");
|
||||
}
|
||||
|
||||
for (i = 0; i < SRAM_BUF_SIZE; i++) {
|
||||
if (buf[i] != test_pattern[test]) {
|
||||
sram_ok = 0;
|
||||
if (stop_quite)
|
||||
printf ("R");
|
||||
else {
|
||||
printf (" addr=%08x, write/read %08lx %08lx\n",
|
||||
SRAMBAR + (i * sizeof(unsigned long)), test_pattern[test], buf[i]);
|
||||
showError ("Verifing SRAM");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (sram_ok)
|
||||
printf (".");
|
||||
|
||||
fflush(stdout);
|
||||
}
|
||||
printf ("\n");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
checkRegisters (int cpu, int loops)
|
||||
{
|
||||
int reg;
|
||||
unsigned long reg_value;
|
||||
unsigned int i;
|
||||
int reg_chk_loop_failed = 0;
|
||||
int reg_chk_failed = 0;
|
||||
int loop = 0;
|
||||
|
||||
while (loop < loops) {
|
||||
loop++;
|
||||
if (reg_chk_loop_failed && force_reset_on_fail)
|
||||
do_reset (cpu);
|
||||
reg_chk_loop_failed = 0;
|
||||
printf ("Register test, %4d of %4d : \n", loop, loops);
|
||||
for (reg = BDM_REG_D0; reg <= BDM_REG_A7; reg++) {
|
||||
printf (" %c%02d : ",
|
||||
reg < BDM_REG_A0 ? 'D' : 'A',
|
||||
reg < BDM_REG_A0 ? reg : reg-BDM_REG_A0);
|
||||
for (i = 0; i < sizeof(test_pattern) / sizeof (test_pattern[0]); i++) {
|
||||
if (bdmWriteRegister (reg, test_pattern[i]) < 0) {
|
||||
reg_chk_failed = reg_chk_loop_failed = 1;
|
||||
if (stop_quite)
|
||||
printf ("W");
|
||||
else {
|
||||
printf ("\n");
|
||||
showError ("Write Register");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (bdmReadRegister (reg, ®_value) < 0) {
|
||||
reg_chk_failed = reg_chk_loop_failed = 1;
|
||||
if (stop_quite)
|
||||
printf ("R");
|
||||
else {
|
||||
printf ("\n");
|
||||
showError ("Read Register");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (reg_value != test_pattern[i]) {
|
||||
reg_chk_failed = reg_chk_loop_failed = 1;
|
||||
if (stop_quite)
|
||||
printf ("X");
|
||||
else {
|
||||
printf ("Write 0x%08lx, read 0x%08lx\n", test_pattern[i], reg_value);
|
||||
showError ("Verify register");
|
||||
}
|
||||
}
|
||||
else
|
||||
printf (".");
|
||||
}
|
||||
printf ("\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (reg_chk_failed) {
|
||||
stop_on_error = 1;
|
||||
stop_quite = 0;
|
||||
showError("Reg Check Failed");
|
||||
}
|
||||
}
|
||||
|
||||
#define ALIGN_MEM_SIZE (256)
|
||||
|
||||
int
|
||||
verifyAlignment (int cpu)
|
||||
{
|
||||
unsigned long addr;
|
||||
unsigned char byte;
|
||||
unsigned short word;
|
||||
unsigned long lword;
|
||||
|
||||
/*
|
||||
* Check the values using a byte read.
|
||||
*/
|
||||
printf (" reading bytes :");
|
||||
for (addr = 0; addr < ALIGN_MEM_SIZE; addr += sizeof (byte)) {
|
||||
if (bdmReadByte (addr + SRAMBAR, &byte) < 0) {
|
||||
if (stop_quite)
|
||||
printf ("W");
|
||||
else {
|
||||
printf ("\n");
|
||||
printf ("Read byte at 0x%08lx\n", addr + SRAMBAR);
|
||||
showError ("Reading with bytes");
|
||||
}
|
||||
return -1;
|
||||
} else if (byte != addr) {
|
||||
if (stop_quite)
|
||||
printf ("b");
|
||||
else {
|
||||
printf ("\n");
|
||||
printf ("Read byte match addr=0x%08lx, read=0x%02x, wanted=0x%02x\n",
|
||||
addr + SRAMBAR, byte, (unsigned char) addr);
|
||||
showError ("Bytes read does not match");
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
if ((addr % 32) == 0)
|
||||
printf ("\n");
|
||||
printf (".");
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Check the values using a word read.
|
||||
*/
|
||||
printf ("\n reading words :");
|
||||
for (addr = 0; addr < ALIGN_MEM_SIZE; addr += sizeof (word) ) {
|
||||
if (bdmReadWord (addr + SRAMBAR, &word) < 0) {
|
||||
if (stop_quite)
|
||||
printf ("w");
|
||||
else {
|
||||
printf ("\n");
|
||||
printf ("Read words (16bits) at 0x%08lx\n", addr + SRAMBAR);
|
||||
showError ("Reading with words");
|
||||
}
|
||||
return -1;
|
||||
} else if (word != ((addr << 8) | (addr + 1))) {
|
||||
if (stop_quite)
|
||||
printf ("l");
|
||||
else {
|
||||
printf ("\n");
|
||||
printf ("Read word (16bits) match addr=0x%08lx, read=0x%04x, wanted=0x%04x\n",
|
||||
addr + SRAMBAR, word, (unsigned short) ((addr << 8) | (addr + 1)));
|
||||
showError ("Words (16bits) does not match");
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
if ((addr % 32) == 0)
|
||||
printf ("\n");
|
||||
printf (".");
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Check the values using a long read.
|
||||
*/
|
||||
printf ("\n reading long words :");
|
||||
for (addr = 0; addr < ALIGN_MEM_SIZE; addr += sizeof (lword) ) {
|
||||
if (bdmReadLongWord (addr + SRAMBAR, &lword) < 0) {
|
||||
if (stop_quite)
|
||||
printf ("W");
|
||||
else {
|
||||
printf ("\n");
|
||||
printf ("Read long words (32bits) at 0x%08lx\n", addr + SRAMBAR);
|
||||
showError ("Reading with long words");
|
||||
}
|
||||
return -1;
|
||||
} else if(lword !=
|
||||
((addr << 24) | ((addr + 1) << 16) | ((addr + 2) << 8) | (addr + 3))) {
|
||||
if (stop_quite)
|
||||
printf ("W");
|
||||
else {
|
||||
printf ("\n");
|
||||
printf ("Read long word (32bits) match addr=0x%08lx"
|
||||
", read=0x%08lx, wanted=0x%08lx\n",
|
||||
addr + SRAMBAR, lword,
|
||||
((addr << 24) | ((addr + 1) << 16) | ((addr + 2) << 8) | (addr + 3)));
|
||||
showError ("Long Words (32bits) does not match");
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
if ((addr % 32) == 0)
|
||||
printf ("\n");
|
||||
printf (".");
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
checkAlignment (int cpu, int loops)
|
||||
{
|
||||
unsigned long addr;
|
||||
int loop_failed = 0;
|
||||
int failed = 0;
|
||||
int loop = 0;
|
||||
unsigned char buf[ALIGN_MEM_SIZE];
|
||||
|
||||
printf ("Alignment SRAM Test, %d loops\n", loops);
|
||||
|
||||
if (bdmWriteSystemRegister (BDM_REG_RAMBAR, SRAMBAR | 1) < 0)
|
||||
showError ("Writing RAMBAR");
|
||||
|
||||
for (addr = 0; addr < 256; addr++)
|
||||
buf[addr] = addr;
|
||||
|
||||
while (loop < loops) {
|
||||
loop++;
|
||||
if (loop_failed && force_reset_on_fail) {
|
||||
do_reset (cpu);
|
||||
if (bdmWriteSystemRegister (BDM_REG_RAMBAR, SRAMBAR | 1) < 0)
|
||||
showError ("Writing RAMBAR");
|
||||
}
|
||||
loop_failed = 0;
|
||||
/*
|
||||
* Fill the memory with a byte count.
|
||||
*/
|
||||
printf ("Byte Write alignment write, %4d of %4d : ", loop, loops);
|
||||
for (addr = 0; addr < 256; addr++) {
|
||||
if (bdmWriteByte (addr + SRAMBAR, addr) < 0) {
|
||||
failed = loop_failed = 1;
|
||||
if (stop_quite)
|
||||
printf ("B");
|
||||
else {
|
||||
printf ("\n");
|
||||
printf ("Write byte 0x%02x to 0x%08lx\n", (unsigned char) addr, addr + SRAMBAR);
|
||||
showError ("Write byte pattern");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
if ((addr % 32) == 0)
|
||||
printf ("\n");
|
||||
printf (".");
|
||||
}
|
||||
}
|
||||
printf ("\n");
|
||||
if (verifyAlignment (cpu) < 0) {
|
||||
failed = loop_failed = 1;
|
||||
if (!stop_quite) {
|
||||
printf ("\n");
|
||||
showError ("Verify byte write");
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Fill the memory with a byte count.
|
||||
*/
|
||||
printf ("\nWord (16bits) Write alignment verify, %4d of %4d : ", loop, loops);
|
||||
for (addr = 0; addr < 256; addr += 2) {
|
||||
if (bdmWriteWord (addr + SRAMBAR, (addr << 8) | (addr + 1)) < 0) {
|
||||
failed = loop_failed = 1;
|
||||
if (stop_quite)
|
||||
printf ("W");
|
||||
else {
|
||||
printf ("\n");
|
||||
printf ("Write word (16bits) 0x%04x to 0x%08lx\n",
|
||||
(unsigned short) addr, addr + SRAMBAR);
|
||||
showError ("Write word (16bits) pattern");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
if ((addr % 32) == 0)
|
||||
printf ("\n");
|
||||
printf (".");
|
||||
}
|
||||
}
|
||||
printf ("\n");
|
||||
if (verifyAlignment (cpu) < 0) {
|
||||
failed = loop_failed = 1;
|
||||
if (!stop_quite) {
|
||||
printf ("\n");
|
||||
showError ("Verify word (16bits) write");
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Fill the memory with a byte count.
|
||||
*/
|
||||
printf ("\nLong Word (32bits) Write alignment verify, %4d of %4d : ", loop, loops);
|
||||
for (addr = 0; addr < 256; addr += 4) {
|
||||
if (bdmWriteLongWord (addr + SRAMBAR,
|
||||
((addr << 24) | ((addr + 1) << 16) |
|
||||
((addr + 2) << 8) | (addr + 3)))) {
|
||||
failed = loop_failed = 1;
|
||||
if (stop_quite)
|
||||
printf ("L");
|
||||
else {
|
||||
printf ("\n");
|
||||
printf ("Write long word (32bits) 0x%08lx to 0x%08lx\n", addr, addr + SRAMBAR);
|
||||
showError ("Write long word (32bits) pattern");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
if ((addr % 32) == 0)
|
||||
printf ("\n");
|
||||
printf (".");
|
||||
}
|
||||
}
|
||||
printf ("\n");
|
||||
if (verifyAlignment (cpu) < 0) {
|
||||
failed = loop_failed = 1;
|
||||
if (!stop_quite) {
|
||||
printf ("\n");
|
||||
showError ("Verify long word (32bits) write");
|
||||
}
|
||||
}
|
||||
printf ("\nBlock Write alignment verify, %4d of %4d : \n", loop, loops);
|
||||
if (bdmWriteMemory (SRAMBAR, (unsigned char*) buf, ALIGN_MEM_SIZE) < 0) {
|
||||
if (stop_quite)
|
||||
printf ("K");
|
||||
else
|
||||
showError ("Writing block buffer");
|
||||
}
|
||||
if (verifyAlignment (cpu) < 0) {
|
||||
failed = loop_failed = 1;
|
||||
if (!stop_quite) {
|
||||
printf ("\n");
|
||||
showError ("Verify long word (32bits) write");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (failed) {
|
||||
stop_on_error = 1;
|
||||
stop_quite = 0;
|
||||
showError("Alignment Check Failed");
|
||||
}
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
void
|
||||
Usage()
|
||||
{
|
||||
printf("chk -d [level] -p [pc] -r [loops] -s [loops] -C -Q -R [device]\n"
|
||||
" where :\n"
|
||||
" -d [level] : enable driver debug output\n"
|
||||
" -p [pc] : address to run to for the CPU32 target\n"
|
||||
" -r [loops] : number or register check loops\n"
|
||||
" -s [loops] : number or SRAM check loops on the Coldfire\n"
|
||||
" -a [loops] : number or alignment check loops\n"
|
||||
" -D [delay] : delay count for the clock generation\n"
|
||||
" -C : continue on an error\n"
|
||||
" -Q : be quiet on errors\n"
|
||||
" -R : reset on a register check fail\n"
|
||||
" [device] : the bdm device, eg /dev/bdmcf0\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
char *dev = NULL;
|
||||
int arg;
|
||||
int status;
|
||||
int verbose = 0;
|
||||
int delay_counter = 0;
|
||||
int options_stop_on_error = 1;
|
||||
int options_stop_quite = 0;
|
||||
unsigned int ver;
|
||||
int cpu;
|
||||
int iface;
|
||||
unsigned long chkpc = 0;
|
||||
int reg_chk_loops = 1;
|
||||
int sram_chk_loops = 1;
|
||||
int align_chk_loops = 1;
|
||||
|
||||
if (argc <= 1) {
|
||||
Usage();
|
||||
}
|
||||
|
||||
printf ("BDM Check for Coldfire processors.\n");
|
||||
|
||||
for (arg = 1; arg < argc; arg++) {
|
||||
if (argv[arg][0] != '-') {
|
||||
if (dev) {
|
||||
printf(" device name specified more then once");
|
||||
exit(1);
|
||||
}
|
||||
dev = argv[arg];
|
||||
}
|
||||
else {
|
||||
switch (argv[arg][1]) {
|
||||
case 'd':
|
||||
arg++;
|
||||
if (arg == argc) {
|
||||
printf (" -d option requires a parameter");
|
||||
exit(0);
|
||||
}
|
||||
verbose = strtoul (argv[arg], NULL, 0);
|
||||
break;
|
||||
|
||||
case 'D':
|
||||
arg++;
|
||||
if (arg == argc) {
|
||||
printf (" -D option requires a parameter");
|
||||
exit(0);
|
||||
}
|
||||
delay_counter = strtoul (argv[arg], NULL, 0);
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
arg++;
|
||||
if (arg == argc) {
|
||||
printf (" -p option requires a parameter");
|
||||
exit(0);
|
||||
}
|
||||
chkpc = strtoul (argv[arg], NULL, 0);
|
||||
break;
|
||||
|
||||
case 'r':
|
||||
arg++;
|
||||
if (arg == argc) {
|
||||
printf (" -r option requires a parameter");
|
||||
exit(0);
|
||||
}
|
||||
reg_chk_loops = strtoul (argv[arg], NULL, 0);
|
||||
break;
|
||||
|
||||
case 's':
|
||||
arg++;
|
||||
if (arg == argc) {
|
||||
printf (" -s option requires a parameter");
|
||||
exit(0);
|
||||
}
|
||||
sram_chk_loops = strtoul (argv[arg], NULL, 0);
|
||||
break;
|
||||
|
||||
case 'a':
|
||||
arg++;
|
||||
if (arg == argc) {
|
||||
printf (" -a option requires a parameter");
|
||||
exit(0);
|
||||
}
|
||||
align_chk_loops = strtoul (argv[arg], NULL, 0);
|
||||
break;
|
||||
|
||||
case 'C':
|
||||
options_stop_on_error = 0;
|
||||
break;
|
||||
|
||||
case 'Q':
|
||||
options_stop_quite = 1;
|
||||
break;
|
||||
|
||||
case 'R':
|
||||
force_reset_on_fail = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
printf(" unknown option!");
|
||||
|
||||
case '?':
|
||||
case 'h':
|
||||
Usage();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!dev)
|
||||
{
|
||||
printf(" ERROR: no device set, check your options as some require parameters.\n");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
printf ("Device: %s\n", dev);
|
||||
|
||||
/*
|
||||
* Open the BDM interface driver
|
||||
*/
|
||||
if (bdmOpen (dev) < 0)
|
||||
showError ("Open");
|
||||
|
||||
if (verbose)
|
||||
bdmSetDriverDebugFlag (verbose);
|
||||
|
||||
if (delay_counter)
|
||||
bdmSetDelay (delay_counter);
|
||||
|
||||
/*
|
||||
* Get the driver version
|
||||
*/
|
||||
if (bdmGetDrvVersion (&ver) < 0)
|
||||
showError ("GetDrvVersion");
|
||||
|
||||
printf ("Driver Ver : %i.%i\n", ver >> 8, ver & 0xff);
|
||||
|
||||
/*
|
||||
* Get the processor
|
||||
*/
|
||||
if (bdmGetProcessor (&cpu) < 0)
|
||||
showError ("GetProcessor");
|
||||
|
||||
switch (cpu) {
|
||||
case BDM_CPU32:
|
||||
printf ("Processor : CPU32\n");
|
||||
break;
|
||||
case BDM_COLDFIRE:
|
||||
printf ("Processor : Coldfire\n");
|
||||
break;
|
||||
default:
|
||||
printf ("unknown processor type!\n");
|
||||
cleanExit (1);
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the interface
|
||||
*/
|
||||
if (bdmGetInterface (&iface) < 0)
|
||||
showError ("GetInterface");
|
||||
|
||||
switch (iface) {
|
||||
case BDM_CPU32_ERIC:
|
||||
printf ("Interface : Eric's CPU32\n");
|
||||
break;
|
||||
case BDM_COLDFIRE_TBLCF:
|
||||
printf ("Interface: TBLCF USB Coldfire\n");
|
||||
break;
|
||||
case BDM_COLDFIRE:
|
||||
printf ("Interface : P&E Coldfire\n");
|
||||
break;
|
||||
case BDM_CPU32_ICD:
|
||||
printf ("Interface : ICD (P&E) CPU32\n");
|
||||
printf (" use the cpu32_check program for this interface.\n");
|
||||
cleanExit (1);
|
||||
break;
|
||||
default:
|
||||
printf ("unknown interface type!\n");
|
||||
cleanExit (1);
|
||||
break;
|
||||
}
|
||||
|
||||
do_reset (cpu);
|
||||
|
||||
stop_on_error = options_stop_on_error;
|
||||
stop_quite = options_stop_quite;
|
||||
|
||||
/*
|
||||
* For the Coldfire the target must be stopped. This tests the csr caching.
|
||||
*/
|
||||
status = bdmStatus ();
|
||||
printf ("Target status: 0x%x -- %s, %s, %s, %s, %s.\n", status,
|
||||
status & BDM_TARGETRESET ? "RESET" : "NOT RESET",
|
||||
status & BDM_TARGETHALT ? "HALTED" : "NOT HALTED",
|
||||
status & BDM_TARGETSTOPPED ? "STOPPED" : "NOT STOPPED",
|
||||
status & BDM_TARGETPOWER ? "POWER OFF" : "POWER ON",
|
||||
status & BDM_TARGETNC ? "NOT CONNECTED" : "CONNECTED");
|
||||
|
||||
if (reg_chk_loops)
|
||||
checkRegisters (cpu, reg_chk_loops);
|
||||
|
||||
if ((cpu == BDM_COLDFIRE) && sram_chk_loops)
|
||||
coldfireSramVerify (sram_chk_loops);
|
||||
|
||||
|
||||
if (align_chk_loops)
|
||||
checkAlignment (cpu, align_chk_loops);
|
||||
|
||||
/*
|
||||
* Verify that target register can be written and read
|
||||
*/
|
||||
if (cpu == BDM_CPU32) {
|
||||
cpu32Execute (chkpc);
|
||||
}
|
||||
else {
|
||||
coldfireExecute ();
|
||||
}
|
||||
|
||||
showRegs (cpu);
|
||||
showLong (0x0FC00000);
|
||||
showLong (0x01000000);
|
||||
showLong (0x01001000);
|
||||
showLong (0x01001050);
|
||||
showLong (0x01001054);
|
||||
if (bdmGo () < 0)
|
||||
showError ("Go");
|
||||
|
||||
cleanExit (0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
239
m68k/test/coldfire-trace
Normal file
239
m68k/test/coldfire-trace
Normal file
@@ -0,0 +1,239 @@
|
||||
Driver Ver : 2.6
|
||||
Processor : Coldfire
|
||||
Interface : P&E Coldfire
|
||||
CSR break set, target stopped.
|
||||
Debug module version is 1, (5307)
|
||||
Target status: 0x2 -- NOT RESET, HALTED, NOT STOPPED, POWER ON, CONNECTED.
|
||||
Register test, 1 of 1 :
|
||||
D00 : ........................................
|
||||
D01 : ........................................
|
||||
D02 : ........................................
|
||||
D03 : ........................................
|
||||
D04 : ........................................
|
||||
D05 : ........................................
|
||||
D06 : ........................................
|
||||
D07 : ........................................
|
||||
A08 : ........................................
|
||||
A09 : ........................................
|
||||
A10 : ........................................
|
||||
A11 : ........................................
|
||||
A12 : ........................................
|
||||
A13 : ........................................
|
||||
A14 : ........................................
|
||||
A15 : ........................................
|
||||
Read/Write SRAM Test, 1 loops
|
||||
1 : ........................................
|
||||
Alignment SRAM Test, 1 loops
|
||||
Byte Write alignment write, 1 of 1 :
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
reading bytes :
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
reading words :
|
||||
................
|
||||
................
|
||||
................
|
||||
................
|
||||
................
|
||||
................
|
||||
................
|
||||
................
|
||||
reading long words :
|
||||
........
|
||||
........
|
||||
........
|
||||
........
|
||||
........
|
||||
........
|
||||
........
|
||||
........
|
||||
Word (16bits) Write alignment verify, 1 of 1 :
|
||||
................
|
||||
................
|
||||
................
|
||||
................
|
||||
................
|
||||
................
|
||||
................
|
||||
................
|
||||
reading bytes :
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
reading words :
|
||||
................
|
||||
................
|
||||
................
|
||||
................
|
||||
................
|
||||
................
|
||||
................
|
||||
................
|
||||
reading long words :
|
||||
........
|
||||
........
|
||||
........
|
||||
........
|
||||
........
|
||||
........
|
||||
........
|
||||
........
|
||||
Long Word (32bits) Write alignment verify, 1 of 1 :
|
||||
........
|
||||
........
|
||||
........
|
||||
........
|
||||
........
|
||||
........
|
||||
........
|
||||
........
|
||||
reading bytes :
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
reading words :
|
||||
................
|
||||
................
|
||||
................
|
||||
................
|
||||
................
|
||||
................
|
||||
................
|
||||
................
|
||||
reading long words :
|
||||
........
|
||||
........
|
||||
........
|
||||
........
|
||||
........
|
||||
........
|
||||
........
|
||||
........
|
||||
Block Write alignment verify, 1 of 1 :
|
||||
reading bytes :
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
reading words :
|
||||
................
|
||||
................
|
||||
................
|
||||
................
|
||||
................
|
||||
................
|
||||
................
|
||||
................
|
||||
reading long words :
|
||||
........
|
||||
........
|
||||
........
|
||||
........
|
||||
........
|
||||
........
|
||||
........
|
||||
........
|
||||
Coldfire execution test, loading code to SRAM.
|
||||
Stepping code.
|
||||
Stepping, pc is 0x20000000, csr = 0x01100000
|
||||
Stepping, pc is 0x20000004, csr = 0x01100030
|
||||
Stepping, pc is 0x2000000a, csr = 0x01100030
|
||||
Stepping, pc is 0x20000010, csr = 0x01100030
|
||||
Stepping, pc is 0x20000016, csr = 0x01100030
|
||||
Stepping, pc is 0x2000001c, csr = 0x01100030
|
||||
Stepping, pc is 0x20000022, csr = 0x01100030
|
||||
Stepping, pc is 0x20000028, csr = 0x01100030
|
||||
Stepping, pc is 0x2000002e, csr = 0x01100030
|
||||
Stepping, pc is 0x20000034, csr = 0x01100030
|
||||
Stepping, pc is 0x2000003a, csr = 0x01100030
|
||||
Stepping, pc is 0x20000040, csr = 0x01100030
|
||||
Stepping, pc is 0x20000046, csr = 0x01100030
|
||||
Stepping, pc is 0x2000004c, csr = 0x01100030
|
||||
Stepping, pc is 0x20000052, csr = 0x01100030
|
||||
Stepping, pc is 0x20000058, csr = 0x01100030
|
||||
Stepping, pc is 0x2000005e, csr = 0x01100030
|
||||
Stepping, pc is 0x20000064, csr = 0x01100030
|
||||
A0: A0A0A0A0 D0: D0D0D0D0
|
||||
A1: A1A1A1A1 D1: D1D1D1D1
|
||||
A2: A2A2A2A2 D2: D2D2D2D2
|
||||
A3: A3A3A3A3 D3: D3D3D3D3
|
||||
A4: A4A4A4A4 D4: D4D4D4D4
|
||||
A5: A5A5A5A5 D5: D5D5D5D5
|
||||
A6: A6A6A6A6 D6: D6D6D6D6
|
||||
A7: A7A7A7A7 D7: D7D7D7D7
|
||||
RPC:2000006A
|
||||
SR:00002708
|
||||
VBR:000002F8
|
||||
CACR:00000000
|
||||
ACR0:00004000
|
||||
ACR1:FF004000
|
||||
RAMBAR:20000001
|
||||
MBAR:10000000
|
||||
CSR:01100030
|
||||
AATR:00000005
|
||||
TDR:00000000
|
||||
PBR:00000000
|
||||
PBMR:00000000
|
||||
ABHR:00000000
|
||||
ABLR:00000000
|
||||
DBR:00000000
|
||||
DBMR:00000000
|
||||
CSR halt set, target halted.
|
||||
Target status: 0x2 -- NOT RESET, HALTED, NOT STOPPED, POWER ON, CONNECTED.
|
||||
A0: A0A0A0A0 D0: D0D0D0D0
|
||||
A1: A1A1A1A1 D1: D1D1D1D1
|
||||
A2: A2A2A2A2 D2: D2D2D2D2
|
||||
A3: A3A3A3A3 D3: D3D3D3D3
|
||||
A4: A4A4A4A4 D4: D4D4D4D4
|
||||
A5: A5A5A5A5 D5: D5D5D5D5
|
||||
A6: A6A6A6A6 D6: D6D6D6D6
|
||||
A7: A7A7A7A7 D7: D7D7D7D7
|
||||
RPC:20000088
|
||||
SR:00002708
|
||||
VBR:000002F8
|
||||
CACR:00000000
|
||||
ACR0:00004000
|
||||
ACR1:FF004000
|
||||
RAMBAR:20000001
|
||||
MBAR:10000000
|
||||
CSR:02100000
|
||||
AATR:00000005
|
||||
TDR:00000000
|
||||
PBR:00000000
|
||||
PBMR:00000000
|
||||
ABHR:00000000
|
||||
ABLR:00000000
|
||||
DBR:00000000
|
||||
DBMR:00000000
|
||||
0FC00000: 00009D74
|
||||
01000000: 00009D74
|
||||
01001000: 00000000
|
||||
01001050: FFE0156C
|
||||
01001054: FFE01580
|
||||
1335
m68k/test/cpu32-check.c
Normal file
1335
m68k/test/cpu32-check.c
Normal file
File diff suppressed because it is too large
Load Diff
51
m68k/test/cpu32-memtest.list
Normal file
51
m68k/test/cpu32-memtest.list
Normal file
@@ -0,0 +1,51 @@
|
||||
68K GAS memtest.S page 1
|
||||
|
||||
|
||||
1 /*
|
||||
2 * A small piece of code to give the 68360 something to run
|
||||
3 */
|
||||
4 0000 46FC 2700 move.w #0x2700,%sr
|
||||
5 0004 2E7C 0E00 move.l #0x0e000000,%sp
|
||||
5 0000
|
||||
6 000a 207C A0A0 movea.l #0xa0a0a0a0,%a0
|
||||
6 A0A0
|
||||
7 0010 227C A1A1 movea.l #0xa1a1a1a1,%a1
|
||||
7 A1A1
|
||||
8 0016 247C A2A2 movea.l #0xa2a2a2a2,%a2
|
||||
8 A2A2
|
||||
9 001c 267C A3A3 movea.l #0xa3a3a3a3,%a3
|
||||
9 A3A3
|
||||
10 0022 287C A4A4 movea.l #0xa4a4a4a4,%a4
|
||||
10 A4A4
|
||||
11 0028 2A7C A5A5 movea.l #0xa5a5a5a5,%a5
|
||||
11 A5A5
|
||||
12 002e 2C7C A6A6 movea.l #0xa6a6a6a6,%a6
|
||||
12 A6A6
|
||||
13 0034 2E7C A7A7 movea.l #0xa7a7a7a7,%a7
|
||||
13 A7A7
|
||||
14 003a 203C D0D0 move.l #0xd0d0d0d0,%d0
|
||||
14 D0D0
|
||||
15 0040 223C D1D1 move.l #0xd1d1d1d1,%d1
|
||||
15 D1D1
|
||||
16 0046 243C D2D2 move.l #0xd2d2d2d2,%d2
|
||||
16 D2D2
|
||||
17 004c 263C D3D3 move.l #0xd3d3d3d3,%d3
|
||||
17 D3D3
|
||||
18 0052 283C D4D4 move.l #0xd4d4d4d4,%d4
|
||||
18 D4D4
|
||||
19 0058 2A3C D5D5 move.l #0xd5d5d5d5,%d5
|
||||
19 D5D5
|
||||
20 005e 2C3C D6D6 move.l #0xd6d6d6d6,%d6
|
||||
20 D6D6
|
||||
21 0064 2E3C D7D7 move.l #0xd7d7d7d7,%d7
|
||||
21 D7D7
|
||||
22 006a 4E71 loop: nop
|
||||
23 006c 6000 FFFC br loop
|
||||
24
|
||||
68K GAS memtest.S page 2
|
||||
|
||||
|
||||
DEFINED SYMBOLS
|
||||
memtest.S:22 .text:0000006a loop
|
||||
|
||||
NO UNDEFINED SYMBOLS
|
||||
71
m68k/test/sram-test.S
Normal file
71
m68k/test/sram-test.S
Normal file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
*
|
||||
* This file contains the entry point for the application.
|
||||
* The name of this entry point is compiler dependent.
|
||||
* It jumps to the BSP which is responsible for performing
|
||||
* all initialization.
|
||||
*
|
||||
* Author:
|
||||
* David Fiddes, D.J.Fiddes@hw.ac.uk
|
||||
* http://www.calm.hw.ac.uk/davidf/coldfire/
|
||||
*
|
||||
* Chris Johns, ccj@acm.org
|
||||
* home web page, arrh you could then see me ...
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1998.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* Copyright assigned to U.S. Government, 1994.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
*
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* This is a hack up to get some code to be able to download
|
||||
* to the SRAM of a coldfire to test single step, go and
|
||||
* hitting a break.
|
||||
*
|
||||
*/
|
||||
|
||||
#define SRAMBAR 0x20000000
|
||||
|
||||
.sect code
|
||||
|
||||
entry:
|
||||
|
||||
move.w #0x2700,%sr | First turn off all interrupts!
|
||||
move.l #SRAMBAR,%sp | Put the stack in SRAM
|
||||
movea.l #0xa0a0a0a0,%a0
|
||||
movea.l #0xa1a1a1a1,%a1
|
||||
movea.l #0xa2a2a2a2,%a2
|
||||
movea.l #0xa3a3a3a3,%a3
|
||||
movea.l #0xa4a4a4a4,%a4
|
||||
movea.l #0xa5a5a5a5,%a5
|
||||
movea.l #0xa6a6a6a6,%a6
|
||||
movea.l #0xa7a7a7a7,%a7
|
||||
move.l #0xd0d0d0d0,%d0
|
||||
move.l #0xd1d1d1d1,%d1
|
||||
move.l #0xd2d2d2d2,%d2
|
||||
move.l #0xd3d3d3d3,%d3
|
||||
move.l #0xd4d4d4d4,%d4
|
||||
move.l #0xd5d5d5d5,%d5
|
||||
move.l #0xd6d6d6d6,%d6
|
||||
move.l #0xd7d7d7d7,%d7
|
||||
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
halt
|
||||
|
||||
Reference in New Issue
Block a user