initial push
This commit is contained in:
23
README
Normal file
23
README
Normal file
@@ -0,0 +1,23 @@
|
||||
The subdirectories contain:
|
||||
|
||||
m68k/
|
||||
The ColdFire/CPU32 BDM driver and tools originally developed by
|
||||
W. Eric Norum and later enhanced by Chris Johns.
|
||||
|
||||
m683xx/
|
||||
The CPU32 BDM driver enhanced by Pavel Pisa. This version
|
||||
offers better CPU32 support and some features not available
|
||||
in the m68k driver.
|
||||
|
||||
gdb/patches/
|
||||
Patches to add BDM support to GDB.
|
||||
|
||||
gdb/scripts/
|
||||
Example GDB command scripts that show how to initialize and run
|
||||
a Motorola 68360 system using standard GDB commands.
|
||||
|
||||
doc/
|
||||
GDB BDM documentation.
|
||||
|
||||
schematics/
|
||||
Sample schematics for building ColdFire/CPU32 BDM pods.
|
||||
11
doc/Makefile
Normal file
11
doc/Makefile
Normal file
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# $Id: Makefile,v 1.1 2003/06/02 15:13:33 codewiz Exp $
|
||||
#
|
||||
|
||||
all: gdb-bdm.info gdb-bdm.html
|
||||
|
||||
gdb-bdm.info: gdb-bdm.texinfo
|
||||
makeinfo gdb-bdm.texinfo
|
||||
|
||||
gdb-bdm.html: gdb-bdm.texinfo gdb-bdm.init
|
||||
texi2html -init_file gdb-bdm.init gdb-bdm.texinfo
|
||||
1
doc/README
Normal file
1
doc/README
Normal file
@@ -0,0 +1 @@
|
||||
This is a work in progress.
|
||||
464
doc/gdb-bdm.texinfo
Normal file
464
doc/gdb-bdm.texinfo
Normal file
@@ -0,0 +1,464 @@
|
||||
\input texinfo
|
||||
@setfilename gdb-bdm.info
|
||||
@syncodeindex ky cp
|
||||
|
||||
@c
|
||||
@c $Id: gdb-bdm.texinfo,v 1.1 2003/06/02 15:13:33 codewiz Exp $
|
||||
@c
|
||||
@c GDB BDM Manual
|
||||
@c
|
||||
|
||||
@c Parts taken from the Ld, the GNU Linker info page.
|
||||
@c This is Copyright (C) Free Software Foundation, Inc.
|
||||
|
||||
@ifinfo
|
||||
@format
|
||||
START-INFO-DIR-ENTRY
|
||||
* @sc{gdb-bdm}: GDB m68k Background Debug Mode (BDM).
|
||||
END-INFO-DIR-ENTRY
|
||||
@end format
|
||||
@end ifinfo
|
||||
|
||||
@ifinfo
|
||||
This file documents the Background Debug support for GDB, the GNU debugger.
|
||||
|
||||
Copyright @copyright{} Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
are preserved on all copies.
|
||||
|
||||
Permission is granted to copy and distribute modified versions of this
|
||||
manual under the conditions for verbatim copying, provided also that
|
||||
the entire resulting derived work is distributed under the terms of a
|
||||
permission notice identical to this one.
|
||||
|
||||
Permission is granted to copy and distribute translations of this manual
|
||||
into another language, under the above conditions for modified versions.
|
||||
|
||||
@ignore
|
||||
Permission is granted to process this file through Tex and print the
|
||||
results, provided the printed document carries copying permission
|
||||
notice identical to this one except for the removal of this paragraph
|
||||
(this paragraph not being relevant to the printed manual).
|
||||
@end ignore
|
||||
@end ifinfo
|
||||
|
||||
@iftex
|
||||
@finalout
|
||||
@setchapternewpage odd
|
||||
@settitle GDB Background Debug Mode Support
|
||||
@titlepage
|
||||
@title GDB BDM
|
||||
@subtitle GDB Background Debug Mode
|
||||
@sp 1
|
||||
@subtitle @code{MRB} version 1
|
||||
@subtitle December 1999
|
||||
@author Chris Johns (ccj@@acm.org)
|
||||
@author Objective Design Systems Pty Ltd
|
||||
@page
|
||||
|
||||
@tex
|
||||
{\parskip=0pt
|
||||
\hfill Objective Design Systems Pty Ltd\par
|
||||
\hfill ccj\@acm.org, cjohns\@cybertec.com.au\par
|
||||
\hfill {\it Using m68k BDM with GDB, the GNU debugger}\par
|
||||
\hfill Edited by Chris Johns (ccj@@acm.org)\par
|
||||
}
|
||||
\global\parindent=0pt % Steve likes it this way.
|
||||
@end tex
|
||||
|
||||
@vskip 0pt plus 1filll
|
||||
Copyright @copyright{} Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
are preserved on all copies.
|
||||
|
||||
Permission is granted to copy and distribute modified versions of this
|
||||
manual under the conditions for verbatim copying, provided also that
|
||||
the entire resulting derived work is distributed under the terms of a
|
||||
permission notice identical to this one.
|
||||
|
||||
Permission is granted to copy and distribute translations of this manual
|
||||
into another language, under the above conditions for modified versions.
|
||||
@end titlepage
|
||||
@end iftex
|
||||
|
||||
@ifinfo
|
||||
@node Top, , ,
|
||||
@top GDB BDM
|
||||
|
||||
This file documents GDB support for BDM for CPU32 and Coldfire processors.
|
||||
|
||||
@menu
|
||||
* Overview:: Overview
|
||||
* Hardware:: POD, Pins, Power
|
||||
* Driver:: The Driver
|
||||
* Library:: A Library for Applications
|
||||
|
||||
* Testing:: Is BDM working
|
||||
|
||||
* GDB:: Building and using GDB
|
||||
|
||||
* Server:: BDM Server
|
||||
|
||||
@c Following blank line required for remaining bug in makeinfo conds/menus
|
||||
|
||||
* Reporting Bugs:: Reporting Bugs
|
||||
* Index:: Index
|
||||
@end menu
|
||||
@end ifinfo
|
||||
|
||||
@c ---------------------------------------
|
||||
@node Overview, Build System, Top, Top
|
||||
@chapter Overview
|
||||
|
||||
@cindex what is this?
|
||||
|
||||
Welcome to Background Debug Mode (BDM) support for GDB. BDM is emulator
|
||||
or debugger support in a range of Motorola processors. This package
|
||||
deals with the CPU32, and Coldfire family of processors. PowerPC
|
||||
processors are not supported by this package.
|
||||
|
||||
CPU32 processors were the first processors to appear with BDM
|
||||
support. The Coldfire family's BDM module is similar to the CPU32 family
|
||||
of processors. The CPU32 has the BDM module integrated into the
|
||||
processor core. The Coldfire is more modular. The debug module is
|
||||
separate to the core.
|
||||
|
||||
BDM is not JTAG debugging although a serial bug is used. JTAG is a
|
||||
standard and operates differently to BDM. BDM uses high level commands
|
||||
to control the device. You do not need to clock in and out a loop of
|
||||
registers.
|
||||
|
||||
BDM is accessed on the procesor via a three wire serial bus. The signals
|
||||
are a clock, data in and data out. Various other support signals
|
||||
exists. This are used to place the processor into BDM, break the
|
||||
prcessor, or monitor the status of a running processor.
|
||||
|
||||
The CPU32 standard BDM connector is not the same as the Coldfire
|
||||
connector. You need separate plug on modules for each processor
|
||||
family. Check the POD you use matches the processors voltage and clock
|
||||
speed. This is import for Coldfire users.
|
||||
|
||||
Coldfire BDM has support for realtime trace. This package does not
|
||||
support realtime trace.
|
||||
|
||||
Coldfire BDM can operate in a limited manner while the processor is
|
||||
running. The BDM module being separate from the procesor core allows
|
||||
this feature.
|
||||
|
||||
History
|
||||
|
||||
Gunta Magna contributes here is a bit of history of how GDB and BDM
|
||||
came to light due to mutual support.
|
||||
|
||||
Somewhere in 1994/1995 Gunta Magna wrote (with the help of Michael
|
||||
Schraut, at that time a student at lpr.e-technik.tu-muenchen) a first
|
||||
version of the m68k Linux BDM device driver. This driver heavily based
|
||||
on the work of Scott Howard (scott\@objsw.com), who wrote BD32, a DOS
|
||||
tool to access 683xx controllers via BDM. He made the driver available
|
||||
in source form, so I could use them. Scott is currently maintainer of
|
||||
the crossgcc mailing list (http://www.objsw.com/CrossGCC/).
|
||||
|
||||
Additionally Gunta Magna wrote a BDM backend for gdb-4.13. (Note: Eric
|
||||
credits M.Schraut falsly as the author of the GDB patches in the header
|
||||
files. This went through until Chris Johns's version for Coldfire).
|
||||
|
||||
The driver was only for BDM interfaces compatilble to AN1230, aka as PD
|
||||
interfaces. Scott supported also the ICD compatible interface, but due to
|
||||
lack of equipment at that time Gunta Magna did not include that.
|
||||
|
||||
Eric Norum used those sources to port it to NextStep. He did not like
|
||||
my way of interfacing driver and application, and designed a new
|
||||
interface. He also introduced an abstraction layer, enabling other
|
||||
applications than gdb to take advantage of the BDM driver. He also added
|
||||
support for 68360, which is different in detail from the 68332 version
|
||||
(MBAR support).
|
||||
|
||||
In 1996, Gunta Magna upgraded his driver to ICD by a compile time
|
||||
option, and fixed some errors. He also upgraded the gdb backend to
|
||||
gdb-4.16, introducing Eric's idea of the abstraction layer. Sources for
|
||||
that can be found at the ftp server of lpr.e-technik.tu-muechen.de
|
||||
|
||||
In 1997 Eric went Linux and ported his NextStep driver to Linux. He
|
||||
also wrote/ported his NextStep gdb backend, incorporating some of the
|
||||
ideas (and bugs) introduced in Gunta's 4.16-version. He also published a
|
||||
schematic stemming from the Motorola customer center here in Munich
|
||||
(bd32new) (See below).
|
||||
|
||||
In 1997 I upgraded my driver to simultaneously support ICD and PD
|
||||
interfaces. The selection is made by accessing different minor numbers.
|
||||
This version has been handed out to several testers (including Chris
|
||||
Johns), but has never been officially released.
|
||||
|
||||
Chris Johns used Eric's driver and added Coldfire support.
|
||||
|
||||
@c ---------------------------------------
|
||||
@node Build System, Layout, Overview, Top
|
||||
@chapter POD, Pins, Power
|
||||
|
||||
@cindex hardware
|
||||
|
||||
Various means exist to access a BDM port on a processor. This driver
|
||||
provides support for various host operating system, and adapator boards.
|
||||
|
||||
The driver support the IDC hardware. A circuit abd PAL equations are
|
||||
provided in the package.
|
||||
|
||||
The Coldfire support is via the P&E standard interface. You can find
|
||||
information about these adaptor from the P&E web site.
|
||||
|
||||
<more on CPU32 hardware>
|
||||
|
||||
Coldfire
|
||||
|
||||
The Coldfire has a 26pin header. The expanded connector is for the
|
||||
realtime trace. These signals are the PST or processor status
|
||||
signals. Four of these signals provide provide the status of the
|
||||
processor in realtime.
|
||||
|
||||
The 5206 and 5206e processor share the PST signals with the parallel
|
||||
port on Coldfire. Anr application that uses the Coldfire's parallel
|
||||
port, cannot relying on the PST for the realtime status of the
|
||||
processor. The P&E module provides a processor halted signal to the PC's
|
||||
parallel port based on the PST signals. The P&E Windows driver and DLL
|
||||
use this signal. Using this software with the P&E interface and a 5206
|
||||
variant of Coldfire requires the parallel port to left for the PST
|
||||
signals. The PST signals on the 5307 processor are not shared. They are
|
||||
free to be used for debugging.
|
||||
|
||||
This driver does not require the use of the PST signals. The parallel
|
||||
port on the 5206 processor can be used as a parallel port.
|
||||
|
||||
The 5206 and 5206e differ in Vcc voltage. The 5206 is a 5.0V processor
|
||||
while the 5206e is a 3.3V processor. You need to check your POD can
|
||||
handle your processors voltage. The 5206e can operate at 54MHz. The 5307
|
||||
operate at 70MHz. The processor clock is carried up the BDM cable to the
|
||||
POD. You need to insure the PLD on the POD is fast enough and the cable
|
||||
from the target to the POD is not too long. If the cable is too long or
|
||||
the PLD marginal the processor clock could be dragged out of shape
|
||||
causing various problems which can be hard to find.
|
||||
|
||||
Various people have reported problems when using the driver with 5307
|
||||
processors. Building the driver with the Makefile define @code{USE_PST}
|
||||
causes the problem to go away. The error is
|
||||
|
||||
@c ---------------------------------------
|
||||
@node Build System, Layout, Overview, Top
|
||||
@chapter The Driver
|
||||
|
||||
@cindex driver
|
||||
|
||||
Various means exist to access a BDM port on a processor. This driver
|
||||
provides support for various host operating system, and adapator boards.
|
||||
|
||||
The code which accesses the pod is
|
||||
|
||||
The driver supports different host operating systems.
|
||||
|
||||
@c ---------------------------------------
|
||||
@node Layout, Configurations, Build System, Top
|
||||
@chapter A Library for Applications
|
||||
|
||||
@cindex Library
|
||||
|
||||
The library provides an interface to the driver for user
|
||||
applications. GDB currently requires this library to build. Future
|
||||
release may have the library moved into the GDB patch allowing the BDM
|
||||
code reside in the GDB source tree.
|
||||
|
||||
The library also contains the client code for talking to the BDM server.
|
||||
|
||||
|
||||
@c ---------------------------------------
|
||||
@node Layout, Configurations, Build System, Top
|
||||
@chapter Testing
|
||||
|
||||
@cindex Testing
|
||||
|
||||
The driver should be tested with the `chk' program. It provides a
|
||||
reasonable test of the software, driver and hardware path to the target.
|
||||
|
||||
@c ---------------------------------------
|
||||
@node Layout, Configurations, Build System, Top
|
||||
@chapter GDB
|
||||
|
||||
@cindex GDB
|
||||
|
||||
This section covers building GDB and contains some info about using GDB
|
||||
with BDM.
|
||||
|
||||
@c ---------------------------------------
|
||||
@node Layout, Configurations, Build System, Top
|
||||
@chapter Server
|
||||
|
||||
@cindex Server
|
||||
|
||||
This section covers building and installing the GDB server.
|
||||
|
||||
Currently only a Unix version exists. It should operate on any platform
|
||||
the driver can be built for.
|
||||
|
||||
The BDM server operates from inetd. You need to add the following line
|
||||
to @file(/etc/services} :
|
||||
|
||||
@smallexample
|
||||
|
||||
bdm 6543/tcp # BDM server
|
||||
|
||||
@end smallexample
|
||||
|
||||
The port number @code{6543} was a random selection. If for any reason it
|
||||
is a bad or taken number, please let me know.
|
||||
|
||||
In the file @file{/etc/inetd.con} add the following line :
|
||||
|
||||
@smallexample
|
||||
|
||||
bdm stream tcp nowait cjohns /usr/local/sbin//bdmd bdmd
|
||||
|
||||
@end smallexample
|
||||
|
||||
I am running this server as me. If the BDM devices have global
|
||||
read/write enabled, then it should be ok to use the user @code{nobody},
|
||||
or something similar as the user.
|
||||
|
||||
The server has not been checked for security holes. If the
|
||||
|
||||
|
||||
@c ---------------------------------------
|
||||
@node Reporting Bugs
|
||||
@chapter Reporting Bugs
|
||||
@cindex bugs in @code{MRB}
|
||||
@cindex reporting bugs in @code{MRB}
|
||||
|
||||
Your bug reports play an essential role in making @code{MRB} reliable.
|
||||
|
||||
Reporting a bug may help you by bringing a solution to your problem, or
|
||||
it may not. But in any case the principal function of a bug report is
|
||||
to help the entire community by making the next version of @code{MRB}
|
||||
work better. Bug reports are your contribution to the maintenance of
|
||||
@code{MRB}.
|
||||
|
||||
In order for a bug report to serve its purpose, you must include the
|
||||
information that enables us to fix the bug.
|
||||
|
||||
@menu
|
||||
* Bug Criteria:: Have you found a bug?
|
||||
* Bug Reporting:: How to report bugs
|
||||
@end menu
|
||||
|
||||
@c ---------------------------------------
|
||||
@node Bug Criteria
|
||||
@section Have you found a bug?
|
||||
@cindex bug criteria
|
||||
|
||||
If you are not sure whether you have found a bug, here are some guidelines:
|
||||
|
||||
@itemize @bullet
|
||||
@item
|
||||
If the you select a particular configuration and @code{MRB} does not
|
||||
build. It should build if the configuration parameter selection make
|
||||
sense. For example building the networking code without configuring a
|
||||
network driver.
|
||||
|
||||
@item
|
||||
The standard targets which are contained in MRB do not run.
|
||||
|
||||
@item
|
||||
A new release of the GNU tools can break the current code.
|
||||
|
||||
@item
|
||||
Your suggestions for improvement of @code{MRB} are welcome.
|
||||
@end itemize
|
||||
|
||||
@c ---------------------------------------
|
||||
@node Bug Reporting
|
||||
@section How to report bugs
|
||||
@cindex bug reports
|
||||
@cindex @code{MRB} bugs, reporting
|
||||
|
||||
The fundamental principle of reporting bugs usefully is this:
|
||||
@strong{report all the facts}. If you are not sure whether to state a
|
||||
fact or leave it out, state it!
|
||||
|
||||
Often people omit facts because they think they know what causes the
|
||||
problem and assume that some details do not matter. Play it safe and
|
||||
give a specific, complete example. That is the easiest thing for you to
|
||||
do, and the most helpful.
|
||||
|
||||
Keep in mind that the purpose of a bug report is to enable us to fix the
|
||||
bug if it is new to us. Therefore, always write your bug reports on the
|
||||
assumption that the bug has not been reported previously.
|
||||
|
||||
Sometimes people give a few sketchy facts and ask, ``Does this ring a
|
||||
bell?'' Those bug reports are useless, and we urge everyone to
|
||||
@emph{refuse to respond to them} except to chide the sender to report
|
||||
bugs properly.
|
||||
|
||||
To enable us to fix the bug, you should include all these things:
|
||||
|
||||
@itemize @bullet
|
||||
@item
|
||||
The version of @code{MRB}.
|
||||
|
||||
Without this, we will not know whether there is any point in looking for
|
||||
the bug in the current version of @code{MRB}.
|
||||
|
||||
@item
|
||||
Any patches you may have applied to the @code{MRB} source.
|
||||
|
||||
@item
|
||||
The type of host machine you are using, and the operating system name
|
||||
and version number.
|
||||
|
||||
@item
|
||||
What compiler (and its version) was used to compile @code{MRB}
|
||||
--e.g. ``@code{gcc-2.7}''.
|
||||
|
||||
@item
|
||||
The target you are building. If this is a new target you are developing,
|
||||
you may need to provide some details of the changes you have made.
|
||||
|
||||
@item
|
||||
A description of what behavior you observe that you believe is
|
||||
incorrect.
|
||||
|
||||
@item
|
||||
If you wish to suggest changes to the @code{MRB} source, send us context
|
||||
diffs, as generated by @code{diff} with the @samp{-u}, @samp{-c}, or
|
||||
@samp{-p} option. Always send diffs from the old file to the new file.
|
||||
If you even discuss something in the @code{MRB} source, refer to it by
|
||||
context, not by line number.
|
||||
|
||||
The line numbers in our development sources will not match those in your
|
||||
sources. Your line numbers would convey no useful information to us.
|
||||
@end itemize
|
||||
|
||||
Here are some things that are not necessary:
|
||||
|
||||
@itemize @bullet
|
||||
@item
|
||||
A patch for the bug.
|
||||
|
||||
A patch for the bug does help us if it is a good one. But do not omit
|
||||
the necessary information, such as the test case, on the assumption that
|
||||
a patch is all we need. We might see problems with your patch and decide
|
||||
to fix the problem another way, or we might not understand it at all.
|
||||
|
||||
And if we cannot understand what bug you are trying to fix, or why your
|
||||
patch should be an improvement, we will not install it. A test case will
|
||||
help us to understand.
|
||||
@end itemize
|
||||
|
||||
@c ---------------------------------------
|
||||
@node Index
|
||||
@unnumbered Index
|
||||
|
||||
@printindex cp
|
||||
|
||||
@contents
|
||||
@bye
|
||||
|
||||
1544
gdb/patches/gdb-4.18-bdm-m68k.patch
Normal file
1544
gdb/patches/gdb-4.18-bdm-m68k.patch
Normal file
File diff suppressed because it is too large
Load Diff
1970
gdb/patches/gdb-5.0-bdm-m68k.patch
Normal file
1970
gdb/patches/gdb-5.0-bdm-m68k.patch
Normal file
File diff suppressed because it is too large
Load Diff
2016
gdb/patches/gdb-5.2.1-bdm-m68k.patch
Normal file
2016
gdb/patches/gdb-5.2.1-bdm-m68k.patch
Normal file
File diff suppressed because it is too large
Load Diff
2043
gdb/patches/gdb-5.3-bdm-m68k.patch
Normal file
2043
gdb/patches/gdb-5.3-bdm-m68k.patch
Normal file
File diff suppressed because it is too large
Load Diff
2044
gdb/patches/gdb-6.0-bdm-m68k.patch
Normal file
2044
gdb/patches/gdb-6.0-bdm-m68k.patch
Normal file
File diff suppressed because it is too large
Load Diff
2204
gdb/patches/gdb-6.1-bdm-m68k.patch
Normal file
2204
gdb/patches/gdb-6.1-bdm-m68k.patch
Normal file
File diff suppressed because it is too large
Load Diff
2504
gdb/patches/gdb-6.3-bdm-m68k.patch
Normal file
2504
gdb/patches/gdb-6.3-bdm-m68k.patch
Normal file
File diff suppressed because it is too large
Load Diff
55
gdb/patches/insight-5.0.patch
Normal file
55
gdb/patches/insight-5.0.patch
Normal file
@@ -0,0 +1,55 @@
|
||||
diff -urN insight-5.0.orig/gdb/gdbtk/library/targetselection.itb insight-5.0/gdb/gdbtk/library/targetselection.itb
|
||||
--- insight-5.0.orig/gdb/gdbtk/library/targetselection.itb Fri Feb 2 17:34:20 2001
|
||||
+++ insight-5.0/gdb/gdbtk/library/targetselection.itb Fri Feb 2 23:07:22 2001
|
||||
@@ -104,6 +104,20 @@
|
||||
set gdb_target(remotetcp,runlist) {1 1 0 1}
|
||||
set gdb_target(remotetcp,after_attaching) {}
|
||||
|
||||
+ # BDM
|
||||
+ set gdb_target(bdm,pretty-name) "BDM/Direct"
|
||||
+ set gdb_target(bdm,defbaud) "DIRECT"
|
||||
+ set gdb_target(bdm,baud-rates) {}
|
||||
+ set gdb_target(bdm,cmd) "bdm /dev/bdmcf0"
|
||||
+ set gdb_target(bdm,runlist) {1 1 0 1}
|
||||
+ set gdb_target(bdm,after_attaching) { setup-and-load }
|
||||
+ set gdb_target(bdmtcp,pretty-name) "BDM/TCP"
|
||||
+ set gdb_target(bdmtcp,defbaud) "TCP"
|
||||
+ set gdb_target(bdmtcp,baud-rates) {}
|
||||
+ set gdb_target(bdmtcp,cmd) "BDM tcpX"
|
||||
+ set gdb_target(bdmtcp,runlist) {1 1 0 1}
|
||||
+ set gdb_target(bdmtcp,after_attaching) { setup-and-load }
|
||||
+
|
||||
# ARM Angel
|
||||
set gdb_target(rdi,pretty-name) "ARM Angel/Serial"
|
||||
set gdb_target(rdi,defbaud) "9600"
|
||||
@@ -627,7 +641,20 @@
|
||||
pref define gdb/load/$t-verbose [pref get gdb/load/verbose]
|
||||
$f.fr.verb config -variable [pref varname gdb/load/$t-verbose]
|
||||
# Map the correct entries and comboboxes onto the screen
|
||||
- if {$gdb_target($t,defbaud) == "TCP"} {
|
||||
+ if {$gdb_target($t,defbaud) == "DIRECT"} {
|
||||
+ # we have a direct device target
|
||||
+ # map device
|
||||
+ if {$mapped1 != "$fr.host"} {
|
||||
+ grid forget $mapped1
|
||||
+ set mapped1 $fr.host
|
||||
+ grid $mapped1 -row 1 -column 1 -sticky w -padx 5 -pady 5
|
||||
+ }
|
||||
+ $fr.cbl configure -text "Device:"
|
||||
+ $fr.host config -textvariable [pref varname gdb/load/$t-device]
|
||||
+
|
||||
+ $mapped1 configure -state normal
|
||||
+# $mapped2 configure -state normal
|
||||
+ } elseif {$gdb_target($t,defbaud) == "TCP"} {
|
||||
# we have a tcp target
|
||||
# map host and porte
|
||||
if {$mapped1 != "$fr.host"} {
|
||||
@@ -769,7 +796,7 @@
|
||||
# ------------------------------------------------------------------
|
||||
body TargetSelection::change_baud {w {baud ""}} {
|
||||
if {$baud != ""} {
|
||||
- if {[string compare $baud "TCP"] != 0} {
|
||||
+ if {[string compare $baud "TCP"] != 0 && [string compare $baud "DIRECT"] != 0} {
|
||||
gdb_cmd "set remotebaud $baud"
|
||||
if {[catch {gdb_cmd "show remotebaud"} res]} {
|
||||
set newbaud 0
|
||||
56
gdb/patches/insight-5.2.1.patch
Normal file
56
gdb/patches/insight-5.2.1.patch
Normal file
@@ -0,0 +1,56 @@
|
||||
diff -urN insight-5.2.1.orig/gdb/gdbtk/library/targetselection.itb insight-5.2.1/gdb/gdbtk/library/targetselection.itb
|
||||
--- insight-5.2.1.orig/gdb/gdbtk/library/targetselection.itb 2002-02-12 21:05:14.000000000 +0100
|
||||
+++ insight-5.2.1/gdb/gdbtk/library/targetselection.itb 2003-06-14 00:48:01.000000000 +0200
|
||||
@@ -104,6 +104,20 @@
|
||||
set gdb_target(remotetcp,runlist) {1 1 0 1}
|
||||
set gdb_target(remotetcp,after_attaching) {}
|
||||
|
||||
+ # BDM
|
||||
+ set gdb_target(bdm,pretty-name) "BDM/Direct"
|
||||
+ set gdb_target(bdm,defbaud) "DIRECT"
|
||||
+ set gdb_target(bdm,baud-rates) {}
|
||||
+ set gdb_target(bdm,cmd) "bdm /dev/bdmcf0"
|
||||
+ set gdb_target(bdm,runlist) {1 1 0 1}
|
||||
+ set gdb_target(bdm,after_attaching) { setup-and-load }
|
||||
+ set gdb_target(bdmtcp,pretty-name) "BDM/TCP"
|
||||
+ set gdb_target(bdmtcp,defbaud) "TCP"
|
||||
+ set gdb_target(bdmtcp,baud-rates) {}
|
||||
+ set gdb_target(bdmtcp,cmd) "BDM tcpX"
|
||||
+ set gdb_target(bdmtcp,runlist) {1 1 0 1}
|
||||
+ set gdb_target(bdmtcp,after_attaching) { setup-and-load }
|
||||
+
|
||||
# ARM Angel
|
||||
set gdb_target(rdi,pretty-name) "ARM Angel/Serial"
|
||||
set gdb_target(rdi,defbaud) "9600"
|
||||
@@ -681,7 +695,20 @@
|
||||
pref define gdb/load/$t-verbose [pref get gdb/load/verbose]
|
||||
$f.fr.verb config -variable [pref varname gdb/load/$t-verbose]
|
||||
# Map the correct entries and comboboxes onto the screen
|
||||
- if {$gdb_target($t,defbaud) == "TCP"} {
|
||||
+ if {$gdb_target($t,defbaud) == "DIRECT"} {
|
||||
+ # we have a direct device target
|
||||
+ # map device
|
||||
+ if {$mapped1 != "$fr.host"} {
|
||||
+ grid forget $mapped1
|
||||
+ set mapped1 $fr.host
|
||||
+ grid $mapped1 -row 1 -column 1 -sticky w -padx 5 -pady 5
|
||||
+ }
|
||||
+ $fr.cbl configure -text "Device:"
|
||||
+ $fr.host config -textvariable [pref varname gdb/load/$t-device]
|
||||
+
|
||||
+ $mapped1 configure -state normal
|
||||
+# $mapped2 configure -state normal
|
||||
+ } elseif {$gdb_target($t,defbaud) == "TCP"} {
|
||||
# we have a tcp target
|
||||
# map host and porte
|
||||
if {$mapped1 != "$fr.host"} {
|
||||
@@ -833,7 +860,8 @@
|
||||
body TargetSelection::change_baud {w {baud ""}} {
|
||||
if {$baud != ""} {
|
||||
if {([string compare $baud "TCP"] != 0)
|
||||
- && ([string compare $baud "ETH"] != 0)} {
|
||||
+ && ([string compare $baud "ETH"] != 0)
|
||||
+ && ([string compare $baud "DIRECT"] != 0)} {
|
||||
gdb_cmd "set remotebaud $baud"
|
||||
if {[catch {gdb_cmd "show remotebaud"} res]} {
|
||||
set newbaud 0
|
||||
79
gdb/patches/insight-5.3.patch
Normal file
79
gdb/patches/insight-5.3.patch
Normal file
@@ -0,0 +1,79 @@
|
||||
diff -urN insight-5.3.orig/gdb/gdbtk/library/targetselection.itb insight-5.3/gdb/gdbtk/library/targetselection.itb
|
||||
--- insight-5.3.orig/gdb/gdbtk/library/targetselection.itb 2002-02-12 21:05:14.000000000 +0100
|
||||
+++ insight-5.3/gdb/gdbtk/library/targetselection.itb 2003-06-14 00:48:01.000000000 +0200
|
||||
@@ -104,6 +104,20 @@
|
||||
set gdb_target(remotetcp,runlist) {1 1 0 1}
|
||||
set gdb_target(remotetcp,after_attaching) {}
|
||||
|
||||
+ # BDM
|
||||
+ set gdb_target(bdm,pretty-name) "BDM/Direct"
|
||||
+ set gdb_target(bdm,defbaud) "DIRECT"
|
||||
+ set gdb_target(bdm,baud-rates) {}
|
||||
+ set gdb_target(bdm,cmd) "bdm /dev/bdmcf0"
|
||||
+ set gdb_target(bdm,runlist) {1 1 0 1}
|
||||
+ set gdb_target(bdm,after_attaching) { setup-and-load }
|
||||
+ set gdb_target(bdmtcp,pretty-name) "BDM/TCP"
|
||||
+ set gdb_target(bdmtcp,defbaud) "TCP"
|
||||
+ set gdb_target(bdmtcp,baud-rates) {}
|
||||
+ set gdb_target(bdmtcp,cmd) "BDM tcpX"
|
||||
+ set gdb_target(bdmtcp,runlist) {1 1 0 1}
|
||||
+ set gdb_target(bdmtcp,after_attaching) { setup-and-load }
|
||||
+
|
||||
# ARM Angel
|
||||
set gdb_target(rdi,pretty-name) "ARM Angel/Serial"
|
||||
set gdb_target(rdi,defbaud) "9600"
|
||||
@@ -681,7 +695,20 @@
|
||||
pref define gdb/load/$t-verbose [pref get gdb/load/verbose]
|
||||
$f.fr.verb config -variable [pref varname gdb/load/$t-verbose]
|
||||
# Map the correct entries and comboboxes onto the screen
|
||||
- if {$gdb_target($t,defbaud) == "TCP"} {
|
||||
+ if {$gdb_target($t,defbaud) == "DIRECT"} {
|
||||
+ # we have a direct device target
|
||||
+ # map device
|
||||
+ if {$mapped1 != "$fr.host"} {
|
||||
+ grid forget $mapped1
|
||||
+ set mapped1 $fr.host
|
||||
+ grid $mapped1 -row 1 -column 1 -sticky w -padx 5 -pady 5
|
||||
+ }
|
||||
+ $fr.cbl configure -text "Device:"
|
||||
+ $fr.host config -textvariable [pref varname gdb/load/$t-device]
|
||||
+
|
||||
+ $mapped1 configure -state normal
|
||||
+# $mapped2 configure -state normal
|
||||
+ } elseif {$gdb_target($t,defbaud) == "TCP"} {
|
||||
# we have a tcp target
|
||||
# map host and porte
|
||||
if {$mapped1 != "$fr.host"} {
|
||||
@@ -833,7 +860,8 @@
|
||||
body TargetSelection::change_baud {w {baud ""}} {
|
||||
if {$baud != ""} {
|
||||
if {([string compare $baud "TCP"] != 0)
|
||||
- && ([string compare $baud "ETH"] != 0)} {
|
||||
+ && ([string compare $baud "ETH"] != 0)
|
||||
+ && ([string compare $baud "DIRECT"] != 0)} {
|
||||
gdb_cmd "set remotebaud $baud"
|
||||
if {[catch {gdb_cmd "show remotebaud"} res]} {
|
||||
set newbaud 0
|
||||
diff -Nur insight-5.3.orig/gdb/gdbtk/generic/gdbtk-hooks.c insight-5.3/gdb/gdbtk/generic/gdbtk-hooks.c
|
||||
--- insight-5.3.orig/gdb/gdbtk/generic/gdbtk-hooks.c 2002-07-03 19:38:22.000000000 +0200
|
||||
+++ insight-5.3/gdb/gdbtk/generic/gdbtk-hooks.c 2003-09-05 14:02:42.000000000 +0200
|
||||
@@ -518,6 +518,10 @@
|
||||
gdbtk_call_command (struct cmd_list_element *cmdblk,
|
||||
char *arg, int from_tty)
|
||||
{
|
||||
+ struct cleanup *old_chain;
|
||||
+
|
||||
+ old_chain = make_cleanup (null_cleanup, 0);
|
||||
+
|
||||
running_now = 0;
|
||||
if (cmdblk->class == class_run || cmdblk->class == class_trace)
|
||||
{
|
||||
@@ -532,6 +536,8 @@
|
||||
}
|
||||
else
|
||||
cmd_func (cmdblk, arg, from_tty);
|
||||
+
|
||||
+ do_cleanups (old_chain);
|
||||
}
|
||||
|
||||
/* Called after a `set' command succeeds. Runs the Tcl hook
|
||||
56
gdb/patches/insight-6.0.patch
Normal file
56
gdb/patches/insight-6.0.patch
Normal file
@@ -0,0 +1,56 @@
|
||||
diff -Nru insight-5.3.92.orig/gdb/gdbtk/library/targetselection.itb insight-5.3.92/gdb/gdbtk/library/targetselection.itb
|
||||
--- insight-5.3.92.orig/gdb/gdbtk/library/targetselection.itb 2003-02-04 09:03:09.000000000 +0100
|
||||
+++ insight-5.3.92/gdb/gdbtk/library/targetselection.itb 2003-09-21 13:12:41.000000000 +0200
|
||||
@@ -104,6 +104,20 @@
|
||||
set gdb_target(remotetcp,runlist) {1 1 0 1}
|
||||
set gdb_target(remotetcp,after_attaching) {}
|
||||
|
||||
+ # BDM
|
||||
+ set gdb_target(bdm,pretty-name) "BDM/Direct"
|
||||
+ set gdb_target(bdm,defbaud) "DIRECT"
|
||||
+ set gdb_target(bdm,baud-rates) {}
|
||||
+ set gdb_target(bdm,cmd) "bdm /dev/bdmcf0"
|
||||
+ set gdb_target(bdm,runlist) {1 1 0 1}
|
||||
+ set gdb_target(bdm,after_attaching) { setup-and-load }
|
||||
+ set gdb_target(bdmtcp,pretty-name) "BDM/TCP"
|
||||
+ set gdb_target(bdmtcp,defbaud) "TCP"
|
||||
+ set gdb_target(bdmtcp,baud-rates) {}
|
||||
+ set gdb_target(bdmtcp,cmd) "BDM tcpX"
|
||||
+ set gdb_target(bdmtcp,runlist) {1 1 0 1}
|
||||
+ set gdb_target(bdmtcp,after_attaching) { setup-and-load }
|
||||
+
|
||||
# ARM Angel
|
||||
set gdb_target(rdi,pretty-name) "ARM Angel/Serial"
|
||||
set gdb_target(rdi,defbaud) "9600"
|
||||
@@ -694,7 +708,20 @@
|
||||
pref define gdb/load/$t-verbose [pref get gdb/load/verbose]
|
||||
$f.fr.verb config -variable [pref varname gdb/load/$t-verbose]
|
||||
# Map the correct entries and comboboxes onto the screen
|
||||
- if {$gdb_target($t,defbaud) == "TCP"} {
|
||||
+ if {$gdb_target($t,defbaud) == "DIRECT"} {
|
||||
+ # we have a direct device target
|
||||
+ # map device
|
||||
+ if {$mapped1 != "$fr.host"} {
|
||||
+ grid forget $mapped1
|
||||
+ set mapped1 $fr.host
|
||||
+ grid $mapped1 -row 1 -column 1 -sticky w -padx 5 -pady 5
|
||||
+ }
|
||||
+ $fr.cbl configure -text "Device:"
|
||||
+ $fr.host config -textvariable [pref varname gdb/load/$t-device]
|
||||
+
|
||||
+ $mapped1 configure -state normal
|
||||
+# $mapped2 configure -state normal
|
||||
+ } elseif {$gdb_target($t,defbaud) == "TCP"} {
|
||||
# we have a tcp target
|
||||
# map host and porte
|
||||
if {$mapped1 != "$fr.host"} {
|
||||
@@ -846,7 +873,8 @@
|
||||
itcl::body TargetSelection::change_baud {w {baud ""}} {
|
||||
if {$baud != ""} {
|
||||
if {([string compare $baud "TCP"] != 0)
|
||||
- && ([string compare $baud "ETH"] != 0)} {
|
||||
+ && ([string compare $baud "ETH"] != 0)
|
||||
+ && ([string compare $baud "DIRECT"] != 0)} {
|
||||
gdb_cmd "set remotebaud $baud"
|
||||
if {[catch {gdb_cmd "show remotebaud"} res]} {
|
||||
set newbaud 0
|
||||
127
gdb/scripts/5206.gdb
Normal file
127
gdb/scripts/5206.gdb
Normal file
@@ -0,0 +1,127 @@
|
||||
#
|
||||
# GDB Init script for the Coldfire 5206 processor.
|
||||
#
|
||||
# The main purpose of this script is to configure the
|
||||
# DRAM controller so code can be loaded.
|
||||
#
|
||||
#
|
||||
|
||||
define addresses
|
||||
|
||||
set $mbar = 0x10000001
|
||||
set $simr = $mbar - 1 + 0x003
|
||||
set $icr1 = $mbar - 1 + 0x014
|
||||
set $icr2 = $mbar - 1 + 0x015
|
||||
set $icr3 = $mbar - 1 + 0x016
|
||||
set $icr4 = $mbar - 1 + 0x017
|
||||
set $icr5 = $mbar - 1 + 0x018
|
||||
set $icr6 = $mbar - 1 + 0x019
|
||||
set $icr7 = $mbar - 1 + 0x01A
|
||||
set $icr8 = $mbar - 1 + 0x01B
|
||||
set $icr9 = $mbar - 1 + 0x01C
|
||||
set $icr10 = $mbar - 1 + 0x01D
|
||||
set $icr11 = $mbar - 1 + 0x01E
|
||||
set $icr12 = $mbar - 1 + 0x01F
|
||||
set $icr13 = $mbar - 1 + 0x020
|
||||
set $imr = $mbar - 1 + 0x036
|
||||
set $ipr = $mbar - 1 + 0x03A
|
||||
set $rsr = $mbar - 1 + 0x040
|
||||
set $sypcr = $mbar - 1 + 0x041
|
||||
set $swivr = $mbar - 1 + 0x042
|
||||
set $swsr = $mbar - 1 + 0x043
|
||||
set $dcrr = $mbar - 1 + 0x046
|
||||
set $dctr = $mbar - 1 + 0x04A
|
||||
set $dcar0 = $mbar - 1 + 0x04C
|
||||
set $dcmr0 = $mbar - 1 + 0x050
|
||||
set $dccr0 = $mbar - 1 + 0x057
|
||||
set $dcar1 = $mbar - 1 + 0x058
|
||||
set $dcmr1 = $mbar - 1 + 0x05C
|
||||
set $dccr1 = $mbar - 1 + 0x063
|
||||
set $csar0 = $mbar - 1 + 0x064
|
||||
set $csmr0 = $mbar - 1 + 0x068
|
||||
set $cscr0 = $mbar - 1 + 0x06E
|
||||
set $csar1 = $mbar - 1 + 0x070
|
||||
set $csmr1 = $mbar - 1 + 0x074
|
||||
set $cscr1 = $mbar - 1 + 0x07A
|
||||
set $csar2 = $mbar - 1 + 0x07C
|
||||
set $csmr2 = $mbar - 1 + 0x080
|
||||
set $cscr2 = $mbar - 1 + 0x086
|
||||
set $csar3 = $mbar - 1 + 0x088
|
||||
set $csmr3 = $mbar - 1 + 0x08C
|
||||
set $cscr3 = $mbar - 1 + 0x092
|
||||
set $csar4 = $mbar - 1 + 0x094
|
||||
set $csmr4 = $mbar - 1 + 0x098
|
||||
set $cscr4 = $mbar - 1 + 0x09E
|
||||
set $csar5 = $mbar - 1 + 0x0A0
|
||||
set $csmr5 = $mbar - 1 + 0x0A4
|
||||
set $cscr5 = $mbar - 1 + 0x0AA
|
||||
set $csar6 = $mbar - 1 + 0x0AC
|
||||
set $csmr6 = $mbar - 1 + 0x0B0
|
||||
set $cscr6 = $mbar - 1 + 0x0B6
|
||||
set $csar7 = $mbar - 1 + 0x0B8
|
||||
set $csmr7 = $mbar - 1 + 0x0BC
|
||||
set $cscr7 = $mbar - 1 + 0x0C2
|
||||
set $dmcr = $mbar - 1 + 0x0C6
|
||||
set $par = $mbar - 1 + 0x0CA
|
||||
set $tmr1 = $mbar - 1 + 0x100
|
||||
set $trr1 = $mbar - 1 + 0x104
|
||||
set $tcr1 = $mbar - 1 + 0x108
|
||||
set $tcn1 = $mbar - 1 + 0x10C
|
||||
set $ter1 = $mbar - 1 + 0x111
|
||||
set $tmr2 = $mbar - 1 + 0x120
|
||||
set $trr2 = $mbar - 1 + 0x124
|
||||
set $tcr2 = $mbar - 1 + 0x128
|
||||
set $tcn2 = $mbar - 1 + 0x12C
|
||||
set $ter2 = $mbar - 1 + 0x131
|
||||
|
||||
end
|
||||
|
||||
#
|
||||
# Setup CSAR0 for the FLASH ROM.
|
||||
#
|
||||
|
||||
define setup-cs
|
||||
|
||||
set *((short*) $csar0) = 0xffe0
|
||||
set *((short*) $csmr0) = 0x00030000
|
||||
set *((short*) $cscr0) = 0x0d83
|
||||
set *((short*) $csar1) = 0xffff
|
||||
set *((short*) $csmr1) = 0x0000001e
|
||||
set *((short*) $cscr1) = 0x0043
|
||||
set *((short*) $csar2) = 0x3000
|
||||
set *((short*) $csmr2) = 0x00000014
|
||||
set *((short*) $cscr2) = 0x0043
|
||||
set *((short*) $csar3) = 0x4000
|
||||
set *((short*) $csmr3) = 0x000f0000
|
||||
set *((short*) $cscr3) = 0x0083
|
||||
|
||||
end
|
||||
|
||||
#
|
||||
# Setup the DRAM controller.
|
||||
#
|
||||
|
||||
define setup-dram
|
||||
|
||||
set *((short*) $dcrr) = 24
|
||||
set *((short*) $dctr) = 0x0000
|
||||
set *((short*) $dcar0) = 0x0000
|
||||
set *((long*) $dcmr0) = 0x000e0000
|
||||
set *((char*) $dccr0) = 0x07
|
||||
set *((short*) $dcar1) = 0x0000
|
||||
set *((long*) $dcmr1) = 0x00000000
|
||||
set *((char*) $dccr1) = 0x00
|
||||
|
||||
end
|
||||
|
||||
#
|
||||
# Wake up the board
|
||||
#
|
||||
|
||||
defined initBoard
|
||||
|
||||
addresses
|
||||
setup-cs
|
||||
setup-dram
|
||||
|
||||
end
|
||||
15
gdb/scripts/Makefile
Normal file
15
gdb/scripts/Makefile
Normal file
@@ -0,0 +1,15 @@
|
||||
prefix = /usr/local/RTEMS
|
||||
|
||||
SCRIPTDIR = $(prefix)/lib/gdbScripts
|
||||
BINDIR = $(prefix)/bin
|
||||
|
||||
all:
|
||||
|
||||
install:
|
||||
-mkdir -p $(SCRIPTDIR)
|
||||
for i in *.gdb ; do sed -e "/===PREFIX===/s@@$(prefix)"@ $$i >$(SCRIPTDIR)/$$i ; done
|
||||
-mkdir -p $(BINDIR)
|
||||
sed -e "/===PREFIX===/s@@$(prefix)"@ m68k-rtems-gdb >$(BINDIR)/m68k-rtems-gdb
|
||||
chmod 755 $(BINDIR)/m68k-rtems-gdb
|
||||
|
||||
clean:
|
||||
43
gdb/scripts/RTEMS360.gdb
Normal file
43
gdb/scripts/RTEMS360.gdb
Normal file
@@ -0,0 +1,43 @@
|
||||
#
|
||||
# Prepare to download and run an RTEMS executable image
|
||||
#
|
||||
|
||||
#
|
||||
# Load BDM/CPU32 support
|
||||
#
|
||||
source ===PREFIX===/lib/gdbScripts/SAL68360.gdb
|
||||
source ===PREFIX===/lib/gdbScripts/showCPU32Exception.gdb
|
||||
|
||||
#
|
||||
# Connect to the BDM interface
|
||||
#
|
||||
target bdm /dev/bdmcpu320
|
||||
bdm_setdelay 0
|
||||
|
||||
#
|
||||
# Catch exceptions and display the exception stack
|
||||
#
|
||||
break _uhoh
|
||||
commands
|
||||
displayExceptionStack
|
||||
end
|
||||
|
||||
#
|
||||
# Regain control on fatal errors
|
||||
#
|
||||
break rtems_panic
|
||||
break _Internal_error_Occurred
|
||||
break rtems_fatal_error_occurred
|
||||
|
||||
#
|
||||
# Quit when the RTEMS executable finishes
|
||||
#
|
||||
break _mainDone
|
||||
commands
|
||||
quit
|
||||
end
|
||||
|
||||
#
|
||||
# Get the hardware to a known state
|
||||
#
|
||||
initBoard
|
||||
43
gdb/scripts/RTEMS5206.gdb
Normal file
43
gdb/scripts/RTEMS5206.gdb
Normal file
@@ -0,0 +1,43 @@
|
||||
#
|
||||
# Prepare to download and run an RTEMS executable image
|
||||
#
|
||||
|
||||
#
|
||||
# Load BDM/CF support
|
||||
#
|
||||
source ===PREFIX===/lib/gdbScripts/5206.gdb
|
||||
source ===PREFIX===/lib/gdbScripts/showCPU32Exception.gdb
|
||||
|
||||
#
|
||||
# Connect to the BDM interface
|
||||
#
|
||||
target bdm /dev/bdmcf0
|
||||
bdm_setdelay 0
|
||||
|
||||
#
|
||||
# Catch exceptions and display the exception stack
|
||||
#
|
||||
break _uhoh
|
||||
commands
|
||||
displayExceptionStack
|
||||
end
|
||||
|
||||
#
|
||||
# Regain control on fatal errors
|
||||
#
|
||||
break rtems_panic
|
||||
break _Internal_error_Occurred
|
||||
break rtems_fatal_error_occurred
|
||||
|
||||
#
|
||||
# Quit when the RTEMS executable finishes
|
||||
#
|
||||
break _mainDone
|
||||
commands
|
||||
quit
|
||||
end
|
||||
|
||||
#
|
||||
# Get the hardware to a known state
|
||||
#
|
||||
initBoard
|
||||
78
gdb/scripts/SAL68360.gdb
Normal file
78
gdb/scripts/SAL68360.gdb
Normal file
@@ -0,0 +1,78 @@
|
||||
#####################################################################
|
||||
# Board setup for SAL Communications Controller card #
|
||||
#####################################################################
|
||||
|
||||
define initBoard
|
||||
|
||||
bdm_reset
|
||||
|
||||
#
|
||||
# Step 4: Set up module base address register
|
||||
#
|
||||
set $dpram = 0x0e000000
|
||||
set $mbar = $dpram|0x101
|
||||
set $regb = $dpram+0x1000
|
||||
|
||||
#
|
||||
# I/O is to supervisor program space
|
||||
#
|
||||
set $dfc=5
|
||||
set $sfc=5
|
||||
|
||||
#
|
||||
# Step 7: Deal with clock synthesizer
|
||||
#
|
||||
set {unsigned char}($regb+0x000c) = 0x8f
|
||||
set {unsigned char}($regb+0x0010) = 0xd000
|
||||
set {unsigned short}($regb+0x0014) = 0x8000
|
||||
|
||||
#
|
||||
# Step 8: Initialize system protection
|
||||
#
|
||||
set {unsigned char}($regb+0x0022) = 0x7f
|
||||
|
||||
#
|
||||
# Step 9: Clear parameter RAM and reset communication processor module
|
||||
# Ignore this for now, since all we want to use is the memory controller
|
||||
#
|
||||
|
||||
#
|
||||
# Step 10: Write PEPAR
|
||||
#
|
||||
set {unsigned short}($regb+0x0016) = 0x0180
|
||||
|
||||
#
|
||||
# Step 11: Remap Chip Select 0 (CS0}
|
||||
#
|
||||
set {unsigned long}($regb+0x0040) = 0x17940120
|
||||
set {unsigned long}($regb+0x0054) = 0x4ff80004
|
||||
set {unsigned long}($regb+0x0050) = 0x0f000003
|
||||
|
||||
#
|
||||
# Step 12: Initialize the system RAM
|
||||
#
|
||||
set {unsigned long}($regb+0x0064) = 0x0f000001
|
||||
set {unsigned long}($regb+0x0060) = 0x00000001
|
||||
set $ramjnk={unsigned long}0@8
|
||||
|
||||
#
|
||||
# Determine RAM size
|
||||
#
|
||||
set {char}0 = 0
|
||||
if ({char}0x00801000 == 0)
|
||||
set {char}0 = 1
|
||||
if ({char}0x000801000 == 1)
|
||||
set {unsigned long}($regb+0x0040) = 0x178C0120
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
# Step 15: Set module configuration register
|
||||
#
|
||||
set {unsigned long}($regb+0x0000) = 0x00004c7f
|
||||
|
||||
end
|
||||
|
||||
define hook-run
|
||||
initBoard
|
||||
end
|
||||
3
gdb/scripts/m68k-rtems-gdb
Normal file
3
gdb/scripts/m68k-rtems-gdb
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
exec m68k-bdm-elf-gdb -x "===PREFIX===/lib/gdbScripts/RTEMS360.gdb" "$@"
|
||||
22
gdb/scripts/showCPU32Exception.gdb
Normal file
22
gdb/scripts/showCPU32Exception.gdb
Normal file
@@ -0,0 +1,22 @@
|
||||
#
|
||||
# Display an exception stack
|
||||
#
|
||||
define displayExceptionStack
|
||||
set $frsr = *(unsigned short *)$sp
|
||||
set $frpc = *(unsigned long *)((unsigned long)$sp + 2)
|
||||
set $frfvo = *(unsigned short *)((unsigned long)$sp + 6)
|
||||
set $frcode = $frfvo >> 12
|
||||
set $frvect = ($frfvo & 0xFFF) >> 2
|
||||
printf "EXCEPTION -- SR:0x%X PC:0x%X FRAME:0x%x VECTOR:%d\n", $frsr, $frpc, $frcode, $frvect
|
||||
if $frcode==0x2
|
||||
set $fripc = *(unsigned long *)((unsigned long)$sp + 0x8)
|
||||
set $frssw = *(unsigned short *)((unsigned long)$sp + 0x16)
|
||||
printf " INSTRUCTION PC:0x%X\n", $fripc,
|
||||
end
|
||||
if $frcode==0xC
|
||||
set $frfault = *(unsigned long *)((unsigned long)$sp + 0x8)
|
||||
set $fripc = *(unsigned long *)((unsigned long)$sp + 0x10)
|
||||
set $frssw = *(unsigned short *)((unsigned long)$sp + 0x16)
|
||||
printf " ADDRESS:0x%X INSTRUCTION PC:0x%X SSW:0x%X\n", $frfault, $fripc, $frssw
|
||||
end
|
||||
end
|
||||
28
m683xx/README
Normal file
28
m683xx/README
Normal file
@@ -0,0 +1,28 @@
|
||||
This directory contains M683xx specific BDM
|
||||
driver version and GDB utilities from the
|
||||
development branch with following history
|
||||
|
||||
* Scott Howard, original author of Motorola
|
||||
BDM library and utilities, Feb 93
|
||||
* M. Schraut, original author of BDM driver
|
||||
* Gunter Magin magin AT skil.camelot.de
|
||||
maintainer of BDM and GDB till 98
|
||||
* Pavel Pisa pisa AT cmp.felk.cvut.cz
|
||||
enhancements and maintaining this branch from May 98
|
||||
|
||||
The full documentation of this branch
|
||||
is at this moment at next URLs:
|
||||
|
||||
http://cmp.felk.cvut.cz/~pisa
|
||||
http://cmp.felk.cvut.cz/~pisa/m683xx/bdm_driver.html
|
||||
|
||||
This driver uses different API than Chris's tool-chain.
|
||||
Code is there to:
|
||||
|
||||
* provide support for people using this branch
|
||||
* archival purposes
|
||||
* as source for integration of same features
|
||||
(DEVFS, PARPORT) into Chris's driver.
|
||||
|
||||
Pavel Pisa pisa@cmp.felk.cvut.cz 2003
|
||||
|
||||
43
m683xx/README-5.3-bdm-683xx
Normal file
43
m683xx/README-5.3-bdm-683xx
Normal file
@@ -0,0 +1,43 @@
|
||||
Plain gdb and insight (that is the GUI extended gdb) can be built with
|
||||
just one build: download insight-5.3 instead of gdb-5.3. Then apply both,
|
||||
gdb-5.3-bdm-683xx-patch and insight-5.3-bdm-683xx-patch. This builds
|
||||
m68k-bdm-coff-gdb (this is plain gdb) and m68k-bdm-coff-insight (this is
|
||||
GUI-enabled gdb)
|
||||
|
||||
To get insight running I needed to put the following into my .gdbinit68 file:
|
||||
|
||||
set prompt (gdb-bdm)
|
||||
set hash 1
|
||||
bdm_log off
|
||||
bdm_setdelay 0
|
||||
bdm_autoreset on
|
||||
bdm_timetocomeup 0
|
||||
bdm_load_use_lma 1
|
||||
#target bdm /dev/pd_bdm0
|
||||
target bdm /dev/icd_bdm0
|
||||
bdm_debug_driver 0
|
||||
|
||||
# this macro is called by insight directly after attaching to target but
|
||||
# just before the processor is let to run.
|
||||
#
|
||||
define reset
|
||||
bdm_reset
|
||||
bdm_entry gdb_entry
|
||||
set $pc = gdb_entry
|
||||
set $vbr = __s_text
|
||||
set $sp = ((unsigned long *)$vbr)[0]
|
||||
#
|
||||
# insert breakpoints on positions that indicate big trouble.
|
||||
#
|
||||
delete
|
||||
break excpt_handl
|
||||
break halt_system
|
||||
break uninit_irq
|
||||
end
|
||||
|
||||
There is still a problem with insight: On start up insight sometimes get
|
||||
into an endless loop trying to read a cycle of stack frames. I don't know
|
||||
what triggers this loop, but when it happens once it is perfectly
|
||||
reproducable. Deleting ~/.gdbtkinit helps in this case, but I have no idea
|
||||
why it helps.
|
||||
|
||||
7
m683xx/bdm-driver/MAKEDEV
Normal file
7
m683xx/bdm-driver/MAKEDEV
Normal file
@@ -0,0 +1,7 @@
|
||||
cd /dev
|
||||
mknod -m666 pd_bdm0 c 53 0
|
||||
mknod -m666 pd_bdm1 c 53 1
|
||||
mknod -m666 pd_bdm2 c 53 2
|
||||
mknod -m666 icd_bdm0 c 53 4
|
||||
mknod -m666 icd_bdm1 c 53 5
|
||||
mknod -m666 icd_bdm2 c 53 6
|
||||
121
m683xx/bdm-driver/Makefile
Normal file
121
m683xx/bdm-driver/Makefile
Normal file
@@ -0,0 +1,121 @@
|
||||
#*******************************************************************
|
||||
# Motorola 683xx BDM Driver for Linux Kernel and GNU Debugger
|
||||
#
|
||||
# Makefile-mod - Makefile for regular compilation
|
||||
# through Linux kernel rules
|
||||
#
|
||||
# This file must be renamed or linked to Makefile
|
||||
#
|
||||
# (C) Copyright 1999 by Pavel Pisa
|
||||
#
|
||||
# The BDM driver is distributed under the Gnu General Public Licence.
|
||||
# See file COPYING for details.
|
||||
#*******************************************************************/
|
||||
|
||||
# Use "make MODULE_NAME=foobar" if you want to give the driver module
|
||||
# a different name. This might be usefull if you want to install both,
|
||||
# Chris's and Pavel's drivers at the same machine.
|
||||
MODULE_NAME=m683xx-bdm
|
||||
|
||||
# currently running kernel
|
||||
CURRENT=$(shell uname -r)
|
||||
KERNEL_NEW=$(shell if [ -d /lib/modules/$(CURRENT)/build ] ; \
|
||||
then echo yes ; else echo no ; fi )
|
||||
|
||||
# Where to look for kernel
|
||||
#KERNEL_LOCATION=/usr/src/linux
|
||||
#KERNEL_LOCATION=/usr/src/kernel/$(CURRENT)
|
||||
#KERNEL_LOCATION=/lib/modules/$(CURRENT)/build
|
||||
#KERNEL_LOCATION=/usr/src/linux-2.2.19
|
||||
#KERNEL_LOCATION=/usr/src/linux-2.5.60
|
||||
|
||||
ifndef KERNEL_LOCATION
|
||||
ifeq ($(KERNEL_NEW),yes)
|
||||
KERNEL_LOCATION=/lib/modules/$(CURRENT)/build
|
||||
MODULE_CHAR_LOC=/lib/modules/$(CURRENT)/kernel/drivers/char
|
||||
else
|
||||
KERNEL_LOCATION=/usr/src/linux
|
||||
MODULE_CHAR_LOC=/lib/modules/$(CURRENT)/misc
|
||||
endif
|
||||
endif
|
||||
|
||||
# Test for latest 2.5.xx and future 2.6.xx kernels
|
||||
KERNEL_VERSION := $(shell awk -F\" '/REL/ {print $$2}' \
|
||||
$(KERNEL_LOCATION)/include/linux/version.h | awk -F\- '{print $$1}')
|
||||
|
||||
ifeq ($(KERNEL_VERSION),)
|
||||
KERNEL_VERSION=$(shell grep UTS_RELEASE ${KERNEL_LOCATION}/include/linux/utsrelease.h | \
|
||||
sed 's/[^"]*"\(.*\)\{1\}"/\1/')
|
||||
endif
|
||||
|
||||
KERNEL_MODULE_V26 := $(shell echo $(KERNEL_VERSION) \
|
||||
| sed -n 's/^.*2\.[5-9]\..*$$/yes/p')
|
||||
|
||||
# Target object file if any
|
||||
O_TARGET :=
|
||||
# Regular object files
|
||||
O_OBJS = $(MODULE_NAME).o
|
||||
# Objects with exported symbols (-DEXPORT_SYMTAB)
|
||||
OX_OBJS =
|
||||
# Module objects
|
||||
M_OBJS = $(O_OBJS)
|
||||
# Module only objects with exported symbols (-DEXPORT_SYMTAB)
|
||||
MX_OBJS =
|
||||
# Kernel only objects
|
||||
L_OBJS =
|
||||
# Kernel only objects with exported symbols (-DEXPORT_SYMTAB)
|
||||
LX_OBJS =
|
||||
# Additional CFLAGS
|
||||
EXTRA_CFLAGS =
|
||||
|
||||
# Linux 2.4.2 build system needs next
|
||||
obj-m += $(O_OBJS)
|
||||
|
||||
ifndef KERNEL_MODULE_V26
|
||||
FINAL_MODULE_OBJS=$(obj-m)
|
||||
else
|
||||
FINAL_MODULE_OBJS=$(obj-m:%.o=%.ko)
|
||||
endif
|
||||
|
||||
all : make_this_module
|
||||
|
||||
install : install_this_module
|
||||
|
||||
$(MODULE_NAME).c: bdm.c bdm.h
|
||||
cp $< $@
|
||||
|
||||
make_this_module: $(MODULE_NAME).c
|
||||
DIR=`pwd`; (cd $(KERNEL_LOCATION); make SUBDIRS=$$DIR modules)
|
||||
|
||||
install_this_module: make_this_module
|
||||
su -c "mkdir -v -p $(MODULE_CHAR_LOC) && cp -v $(FINAL_MODULE_OBJS) $(MODULE_CHAR_LOC)"
|
||||
|
||||
clean:
|
||||
rm -f $(M_OBJS) $(MX_OBJS) *.ko .*.o.flags .*.o.cmd .*.ko.cmd .depend *~
|
||||
|
||||
# which interface do you want to use
|
||||
# now you can select both without problems
|
||||
INTERFACE+= -D PD_INTERFACE
|
||||
INTERFACE+= -D ICD_INTERFACE
|
||||
|
||||
# if you want to use ispGAL programming
|
||||
INTERFACE+= -DEFIICDISP
|
||||
|
||||
# last possible way to make system work when you have problems
|
||||
# with single step or stop
|
||||
# it tries to find 17 bit protocol boundary
|
||||
# after single step or stop
|
||||
BDM_DEFS += -D BDM_TRY_RESYNCHRO
|
||||
|
||||
# if you want a PARPORT compatible device, then
|
||||
# uncomment the following line
|
||||
BDM_DEFS += -DWITH_PARPORT_SUPPORT
|
||||
|
||||
|
||||
EXTRA_CFLAGS= $(INTERFACE) $(BDM_DEFS)
|
||||
|
||||
|
||||
ifndef KERNEL_MODULE_V26
|
||||
include $(KERNEL_LOCATION)/Rules.make
|
||||
endif
|
||||
|
||||
91
m683xx/bdm-driver/README
Normal file
91
m683xx/bdm-driver/README
Normal file
@@ -0,0 +1,91 @@
|
||||
This version of BDM driver is updated to be compatible with
|
||||
the most of existing kernel versions. Main focus has been oriented
|
||||
to 2.2.x and 2.4.x, but most of other unstable and stable kernels
|
||||
back to 1.3.x stone age should be supported.
|
||||
|
||||
Driver needs to find kernel sources to compile.
|
||||
You may need to edit "Makefile-mod" for some strange kernel
|
||||
sources locations. There is automatic location selection depending
|
||||
on current kernel version and "/lib/modules" structure.
|
||||
It select next kernel souces directory for older kernels
|
||||
|
||||
KERNEL_LOCATION=/usr/src/linux
|
||||
|
||||
it uses more reliable way of build process for
|
||||
new modules hierarchy
|
||||
|
||||
KERNEL_LOCATION=/lib/modules/$(CURRENT)/build
|
||||
|
||||
*** BDM driver autoloading ***
|
||||
|
||||
No longer su to root, insmod the module of choice, and then start the
|
||||
debugger as user-joe, but just start the debugger, and the necessary
|
||||
modules get loaded automatically.
|
||||
|
||||
What do you have to do?
|
||||
* You need to copy the device driver code to
|
||||
/lib/modules/<kernel-version>/misc
|
||||
for 2.4.0 kernels use
|
||||
/lib/modules/<kernel-version>/kernel/drivers/char
|
||||
* edit /etc/conf.modules
|
||||
(see my local /etc/conf.modules as an example)
|
||||
* do a "depmod -a".
|
||||
* Start "kerneld" at an early boot stage
|
||||
or enable "kmod" in kernel configuration in section
|
||||
"Loadable module support".
|
||||
|
||||
For more details on dynamic kernel module support, see the READMEs
|
||||
in the latest modules utilities. The current release is modutils-2.4.22.
|
||||
|
||||
*** IMPORTANT ***
|
||||
|
||||
The bdm driver checks if the required resources (here only the io-port
|
||||
addresses) are in use, e.g. by the lp device driver or a parallel port
|
||||
ethernet device. When everything is free, it reserves these resources, and
|
||||
releases them when closing the device. So no double access should be possible.
|
||||
|
||||
If BDM driver is compiled without PARPORT support, there could be problem
|
||||
with "parport", "parport_pc" and "lp" module stack resource reservation,
|
||||
which could compete with "m683xx-bdm" driver. Compile "lp" and "parport"
|
||||
as modules in such case and unload them before "m683xx-bdm".
|
||||
Opposite is true in the case of BDM driver with PARPORT support.
|
||||
You need "parport_pc" compiled into kernel or as module.
|
||||
|
||||
Possibilities reworded
|
||||
|
||||
A) You need to rmmod parport, if you have compiled BDM driver WITHOUT parport
|
||||
support. It can be done by next line added to "/etc/modules.conf"
|
||||
|
||||
pre-install bdm /sbin/modprobe -r lp parport_pc
|
||||
|
||||
B) If BDM driver is compiled WITH parport support, the "parport_pc" module
|
||||
have to be loaded before "bdm" one. It is loaded by boot process in the
|
||||
most cases but next line in "/etc/modules.conf" doe not hurt
|
||||
|
||||
below bdm parport_pc
|
||||
|
||||
** DEVFS support ***
|
||||
|
||||
Driver supports new "devfs" virtual device filesystem found in
|
||||
2.4.0 kernels. There are compiled-in next device names for those
|
||||
kenels "/dev/m683xx-bdm/pd0" and "/dev/m683xx-bdm/icd0" etc.
|
||||
|
||||
You can add next line to "/etc/devfs.conf"
|
||||
|
||||
LOOKUP m683xx-bdm MODLOAD
|
||||
|
||||
Next line helps to connect simple "/dev/bdm" name for right configuration
|
||||
|
||||
LOOKUP m683xx-bdm EXECUTE /bin/ln -s ${mntpnt}/m683xx-bdm/icd0 ${mntpnt}/m683xx-bdm
|
||||
|
||||
There are lines for "/dev/modules.conf" with aliases for different kernels
|
||||
|
||||
# m68k BDM
|
||||
alias /dev/bdm m683xx-bdm
|
||||
alias /dev/m683xx-bdm m683xx-bdm
|
||||
alias char-major-53 m683xx-bdm
|
||||
# the next line is required/usable for BDM driver compiled without
|
||||
# parport support. You might want to remove this line if you get errors
|
||||
# about unresolved symbols when the driver is loaded.
|
||||
pre-install m683xx-bdm /sbin/modprobe -r lp parport_pc
|
||||
|
||||
1967
m683xx/bdm-driver/bdm.c
Normal file
1967
m683xx/bdm-driver/bdm.c
Normal file
File diff suppressed because it is too large
Load Diff
126
m683xx/bdm-driver/bdm.h
Normal file
126
m683xx/bdm-driver/bdm.h
Normal file
@@ -0,0 +1,126 @@
|
||||
#ifndef LINUX_BDM_H
|
||||
#define LINUX_BDM_H
|
||||
/*
|
||||
* $Id: bdm.h,v 1.1 2003/06/04 01:31:31 ppisa Exp $
|
||||
*
|
||||
* Linux Device Driver for Public Domain BDM Interface
|
||||
* based on the PD driver package by Scott Howard, Feb 93
|
||||
* ported to Linux by M.Schraut
|
||||
* tested for kernel version 1.2.4
|
||||
* (C) 1995 Technische Universitaet Muenchen, Lehrstuhl fuer Prozessrechner
|
||||
|
||||
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, 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; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
#define BDM_MAJOR_NUMBER 53
|
||||
|
||||
/* error codes */
|
||||
#define BDM_FAULT_NOERROR 0 /* no error, no ret value */
|
||||
#define BDM_FAULT_UNKNOWN 610
|
||||
#define BDM_FAULT_POWER 611
|
||||
#define BDM_FAULT_CABLE 612
|
||||
#define BDM_FAULT_RESPONSE 613 /*NOT Ready */
|
||||
#define BDM_FAULT_RESET 614
|
||||
#define BDM_FAULT_PORT 615
|
||||
#define BDM_FAULT_BERR 616
|
||||
#define BDM_FAULT_NVC 617 /*no valid command */
|
||||
|
||||
/* Debug Levels */
|
||||
#define BDM_DEBUG_NONE 0
|
||||
#define BDM_DEBUG_SOME 1
|
||||
#define BDM_DEBUG_ALL 2
|
||||
|
||||
/* supported ioctls */
|
||||
#define BDM_INIT 0 /* no argument */
|
||||
#define BDM_DEINIT 1 /* no argument */
|
||||
#define BDM_RESET_CHIP 2 /* no argument */
|
||||
#define BDM_RESTART_CHIP 3 /* no argument */
|
||||
#define BDM_STOP_CHIP 4 /* no argument */
|
||||
#define BDM_STEP_CHIP 5 /* no argument */
|
||||
#define BDM_GET_STATUS 6 /* no argument */
|
||||
#define BDM_SPEED 7 /* arg = speed */
|
||||
#define BDM_RELEASE_CHIP 8 /* no argument */
|
||||
#define BDM_DEBUG_LEVEL 9 /* arg = level */
|
||||
#define BDM_GET_VERSION 10 /* arg = &int */
|
||||
#define BDM_SENSECABLE 11 /* arg =on/off */
|
||||
#define BDM_RESPW 12 /* arg = width */
|
||||
#define BDM_SETLED 13 /* arg = 0-off 1-on */
|
||||
#define BDM_ISPSET 50 /* arg = which pin + which level */
|
||||
#define BDM_ISPGET 51 /* no argument */
|
||||
|
||||
/* bits for efiicdbdm isp programming */
|
||||
#define BDM_ispSDI 1
|
||||
#define BDM_ispSCLK 2
|
||||
#define BDM_ispMODE 3
|
||||
#define BDM_ispISP 4
|
||||
#define BDM_isp_LEVEL 0x80
|
||||
|
||||
/* functional bits of ioctl BDM_GET_STATUS */
|
||||
#define BDM_TARGETRESET (1<<0) /* Target reset */
|
||||
#define BDM_TARGETSTOPPED (1<<2) /* Target (was already) stopped */
|
||||
#define BDM_TARGETPOWER (1<<3) /* Power failed */
|
||||
#define BDM_TARGETNC (1<<4) /* Target not Connected */
|
||||
|
||||
/* command codes for bdm interface */
|
||||
#define BDM_RREG_CMD 0x2180
|
||||
#define BDM_WREG_CMD 0x2080
|
||||
#define BDM_RSREG_CMD 0x2580
|
||||
#define BDM_WSREG_CMD 0x2480
|
||||
#define BDM_READ_CMD 0x1900
|
||||
#define BDM_WRITE_CMD 0x1800
|
||||
#define BDM_DUMP_CMD 0x1d00
|
||||
#define BDM_FILL_CMD 0x1c00
|
||||
#define BDM_GO_CMD 0x0c00
|
||||
#define BDM_CALL_CMD 0x0800
|
||||
#define BDM_RST_CMD 0x0400
|
||||
#define BDM_NOP_CMD 0x0000
|
||||
|
||||
/* system register for RSREG/WSREG */
|
||||
#define BDM_REG_RPC 0x0
|
||||
#define BDM_REG_PCC 0x1
|
||||
#define BDM_REG_SR 0xb
|
||||
#define BDM_REG_USP 0xc
|
||||
#define BDM_REG_SSP 0xd
|
||||
#define BDM_REG_SFC 0xe
|
||||
#define BDM_REG_DFC 0xf
|
||||
#define BDM_REG_ATEMP 0x8
|
||||
#define BDM_REG_FAR 0x9
|
||||
#define BDM_REG_VBR 0xa
|
||||
|
||||
/* system register for RREG/WREG */
|
||||
#define BDM_REG_D0 0x0
|
||||
#define BDM_REG_D1 0x1
|
||||
#define BDM_REG_D2 0x2
|
||||
#define BDM_REG_D3 0x3
|
||||
#define BDM_REG_D4 0x4
|
||||
#define BDM_REG_D5 0x5
|
||||
#define BDM_REG_D6 0x6
|
||||
#define BDM_REG_D7 0x7
|
||||
#define BDM_REG_A0 0x8
|
||||
#define BDM_REG_A1 0x9
|
||||
#define BDM_REG_A2 0xa
|
||||
#define BDM_REG_A3 0xb
|
||||
#define BDM_REG_A4 0xc
|
||||
#define BDM_REG_A5 0xd
|
||||
#define BDM_REG_A6 0xe
|
||||
#define BDM_REG_A7 0xf
|
||||
|
||||
/* op size for READ/WRITE */
|
||||
#define BDM_SIZE_BYTE 0x0000
|
||||
#define BDM_SIZE_WORD 0x0040
|
||||
#define BDM_SIZE_LONG 0x0080
|
||||
|
||||
#endif
|
||||
56
m683xx/bdm-driver/bdmlib.h
Normal file
56
m683xx/bdm-driver/bdmlib.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* $Id: bdmlib.h,v 1.1 2003/06/04 01:31:31 ppisa Exp $
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
typedef u_short bdmstatus;
|
||||
|
||||
extern unsigned int bdmlib_delay, bdmlib_respw;
|
||||
|
||||
extern int bdmlib_open(char *device);
|
||||
extern int bdmlib_close(int);
|
||||
extern int bdmlib_isopen(void);
|
||||
extern int bdmlib_ioctl(u_int code);
|
||||
extern int bdmlib_setioctl(u_int code, u_int val);
|
||||
extern bdmstatus bdmlib_getstatus(void);
|
||||
extern int bdmlib_write_var(caddr_t adr, u_short size, u_int val);
|
||||
extern int bdmlib_read_var(caddr_t adr, u_short size, void *val);
|
||||
extern int bdmlib_write_block(caddr_t adr, u_int size, u_char *block);
|
||||
extern int bdmlib_read_block(caddr_t adr, u_int size, u_char *block);
|
||||
extern int bdmlib_load(char *file, u_long *entry_pt);
|
||||
extern int bdmlib_do_load_binary(char *file_name, u_long *entry_pt);
|
||||
extern int bdmlib_do_load_macro(char *file_name, int is_begin_macro);
|
||||
extern int bdmlib_get_sys_reg(u_int, u_int *);
|
||||
extern int bdmlib_set_sys_reg(u_int, u_int);
|
||||
extern int bdmlib_get_reg(u_int, u_int *);
|
||||
extern int bdmlib_set_reg(u_int, u_int);
|
||||
extern int bdmlib_get_mbar(u_int, u_int *);
|
||||
extern int bdmlib_set_mbar(u_int, u_int);
|
||||
extern int bdmlib_go(void);
|
||||
extern char *bdmlib_geterror_str(int);
|
||||
extern char *bdmlib_getstatus_str(bdmstatus);
|
||||
extern int bdmlib_reset(void);
|
||||
extern void bdmlib_setdebug(int switch_on);
|
||||
extern int bdmlib_querydebug(void);
|
||||
extern void bdmlib_showpc(void);
|
||||
extern void bdmlib_log(const char *format, ...);
|
||||
extern void bdmlib_propeller(FILE * fp);
|
||||
extern int bdmlib_do_load_binary_section(char *file_name, char *sect_name);
|
||||
|
||||
/* some additional error codes beyond those of the driver */
|
||||
|
||||
#define BDM_ERR_NOT_OPEN -650
|
||||
#define BDM_ERR_ILL_IOCTL -651
|
||||
#define BDM_ERR_WRITE_FAIL -652
|
||||
#define BDM_ERR_READ_FAIL -653
|
||||
#define BDM_ERR_ILL_SIZE -654
|
||||
#define BDM_ERR_OPEN -655
|
||||
#define BDM_ERR_LOAD -656
|
||||
#define BDM_ERR_MACROFILE -657
|
||||
#define BDM_ERR_SECTION -658
|
||||
#define BDM_ERR_VERSION -659
|
||||
#define BDM_NO_ERROR 0
|
||||
|
||||
9
m683xx/bdm-driver/conf.modules
Normal file
9
m683xx/bdm-driver/conf.modules
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
alias char-major-9 st
|
||||
alias char-major-27 ftape
|
||||
# alias char-major-30 oldbdm
|
||||
# now obsolete
|
||||
alias char-major-53 m683xx-bdm
|
||||
alias sl0 slhc
|
||||
alias eth0 wd
|
||||
options wd irq=5 io=0x300
|
||||
436
m683xx/bdm-driver/k_compat.h
Normal file
436
m683xx/bdm-driver/k_compat.h
Normal file
@@ -0,0 +1,436 @@
|
||||
/*
|
||||
* k_compat.h 1.8 1995/12/03 01:26:43 (David Hinds)
|
||||
* 1998/07/12 modified by Pavel Pisa pisa@CMP.felk.cvut.cz
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_K_COMPAT_H
|
||||
#define _LINUX_K_COMPAT_H
|
||||
|
||||
#define VERSION(v,p,s) (((v)<<16)+(p<<8)+s)
|
||||
|
||||
#ifndef LINUX_VERSION_CODE
|
||||
#error LINUX_VERSION_CODE not defined
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE < VERSION(1,3,38))
|
||||
|
||||
#ifdef MODULE
|
||||
#include <linux/module.h>
|
||||
#if !defined(CONFIG_MODVERSIONS) && !defined(__NO_VERSION__)
|
||||
char kernel_version[] = UTS_RELEASE;
|
||||
#endif
|
||||
#else
|
||||
#define MOD_DEC_USE_COUNT
|
||||
#define MOD_INC_USE_COUNT
|
||||
#endif
|
||||
|
||||
#else /* 1.3.38 */
|
||||
|
||||
#if (LINUX_VERSION_CODE <= VERSION(2,5,60))
|
||||
#ifdef CONFIG_MODVERSIONS
|
||||
#define MODVERSIONS 1
|
||||
#if (LINUX_VERSION_CODE >= VERSION(1,3,40))
|
||||
#include <linux/modversions.h>
|
||||
#endif /* >=1.3.40 */
|
||||
#endif /* CONFIG_MODVERSIONS */
|
||||
#endif /* <=2.5.60 */
|
||||
|
||||
#include <linux/module.h>
|
||||
|
||||
#endif /* 1.3.38 */
|
||||
|
||||
#if (LINUX_VERSION_CODE < VERSION(2,5,50))
|
||||
#define kc_MOD_DEC_USE_COUNT MOD_DEC_USE_COUNT
|
||||
#define kc_MOD_INC_USE_COUNT MOD_INC_USE_COUNT
|
||||
#else /* 2.5.50 */
|
||||
#define kc_MOD_DEC_USE_COUNT
|
||||
#define kc_MOD_INC_USE_COUNT
|
||||
#endif /* 2.5.50 */
|
||||
|
||||
#if ((LINUX_VERSION_CODE < VERSION(2,2,0)) || (LINUX_VERSION_CODE >= VERSION(2,6,0)))
|
||||
#ifndef EXPORT_NO_SYMBOLS
|
||||
#define EXPORT_NO_SYMBOLS
|
||||
#endif /*EXPORT_NO_SYMBOLS*/
|
||||
#endif /* 2.2.0 */
|
||||
|
||||
/*** user memory access ***/
|
||||
|
||||
/* I do not know exactly all dates of changes */
|
||||
|
||||
#if (LINUX_VERSION_CODE < VERSION(2,1,5))
|
||||
#define kc_copy_from_user(dst,src,len) ({ \
|
||||
if(!(verify_area(VERIFY_READ, src, len))) \
|
||||
{memcpy_fromfs(dst,src,len);0;} else len; })
|
||||
#define kc_copy_to_user(dst,src,len) ({ \
|
||||
if(!(verify_area(VERIFY_WRITE, dst, len))) \
|
||||
{memcpy_tofs(dst,src,len);0;} else len; })
|
||||
#define kc_get_user_long(x,ptr) \
|
||||
(if(!verify_area(VERIFY_READ, (ptr), sizeof(long))) {(x)=get_fs_long((ptr));0;} else 1; })
|
||||
#define kc_get_user_word(x,ptr) \
|
||||
(if(!verify_area(VERIFY_READ, (ptr), sizeof(short))) {(x)=get_fs_word((ptr));0;} else 1; })
|
||||
#define kc_get_user_byte(x,ptr) \
|
||||
(if(!verify_area(VERIFY_READ, (ptr), sizeof(char))) {(x)=get_fs_byte((ptr));0;} else 1; })
|
||||
#define kc_put_user_long(x,ptr) \
|
||||
(if(!verify_area(VERIFY_WRITE, (ptr), sizeof(long))) {put_fs_long((x),(ptr));0;} else 1; })
|
||||
#define kc_put_user_word(x,ptr) \
|
||||
(if(!verify_area(VERIFY_WRITE, (ptr), sizeof(short))){put_fs_word((x),(ptr));0;} else 1; })
|
||||
#define kc_put_user_byte(x,ptr) \
|
||||
(if(!verify_area(VERIFY_WRITE, (ptr), sizeof(char))) {put_fs_byte((x),(ptr));0;} else 1; })
|
||||
#elif (LINUX_VERSION_CODE < VERSION(2,1,100)) /* may need correction */
|
||||
#include <asm/uaccess.h>
|
||||
#define kc_copy_from_user copy_from_user
|
||||
#define kc_copy_to_user copy_to_user
|
||||
#define kc_get_user(x,ptr) \
|
||||
(__get_user_check((x),(ptr),sizeof(*(ptr))))
|
||||
#define kc_put_user(x,ptr) \
|
||||
(__put_user_check((x),(ptr),sizeof(*(ptr))))
|
||||
#else /* >= 2.1.100 */
|
||||
#include <asm/uaccess.h>
|
||||
#define kc_copy_from_user copy_from_user
|
||||
#define kc_copy_to_user copy_to_user
|
||||
#define kc_get_user(x,ptr) \
|
||||
(get_user((x),(ptr)))
|
||||
#define kc_put_user(x,ptr) \
|
||||
(put_user((x),(ptr)))
|
||||
#endif /* < 2.1.100 */
|
||||
|
||||
#if (LINUX_VERSION_CODE >= VERSION(2,1,5))
|
||||
#define kc_get_user_long(x,ptr) (kc_get_user((x),(long*)(ptr)))
|
||||
#define kc_get_user_word(x,ptr) (kc_get_user((x),(unsigned short*)(ptr)))
|
||||
#define kc_get_user_byte(x,ptr) (kc_get_user((x),(unsigned char*)(ptr)))
|
||||
#define kc_put_user_long(x,ptr) (kc_put_user((x),(long *)(ptr)))
|
||||
#define kc_put_user_word(x,ptr) (kc_put_user((x),(unsigned short*)(ptr)))
|
||||
#define kc_put_user_byte(x,ptr) (kc_put_user((x),(unsigned char*)(ptr)))
|
||||
#endif /* >= 2.1.5 */
|
||||
|
||||
/*** resource manipulation changes ***/
|
||||
|
||||
#if (LINUX_VERSION_CODE >= VERSION(2,4,0))
|
||||
#define kc_request_region request_region
|
||||
#define kc_release_region release_region
|
||||
#else /* < 2.6.0 */
|
||||
#define kc_request_region(start,len,name) \
|
||||
({ unsigned long kc_t_start=(start), kc_t_len=(len); \
|
||||
int kc_t_res=!check_region(kc_t_start,kc_t_len); \
|
||||
if(kc_t_res) request_region(kc_t_start,kc_t_len,name); \
|
||||
kc_t_res; \
|
||||
})
|
||||
#define kc_release_region release_region
|
||||
#endif /* < 2.6.0 */
|
||||
|
||||
/*** bitops changes ***/
|
||||
|
||||
#if (LINUX_VERSION_CODE < VERSION(2,1,36)) /* may need correction */
|
||||
#define test_and_set_bit set_bit
|
||||
#endif
|
||||
|
||||
/*** interrupt related stuff ***/
|
||||
|
||||
#if (LINUX_VERSION_CODE < VERSION(2,1,36)) /* may need correction */
|
||||
#define kc_synchronize_irq(irqnum) do{cli();sti();}while(0)
|
||||
#elif (LINUX_VERSION_CODE < VERSION(2,5,33)) /* may need correction */
|
||||
#define kc_synchronize_irq(irqnum) synchronize_irq()
|
||||
#else /* >=2.5.33 */
|
||||
#define kc_synchronize_irq synchronize_irq
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE <= VERSION(2,5,67)) && !defined(IRQ_RETVAL)
|
||||
typedef void irqreturn_t;
|
||||
#define IRQ_NONE
|
||||
#define IRQ_HANDLED
|
||||
#define IRQ_RETVAL(x)
|
||||
#endif /* <=2.5.67 */
|
||||
|
||||
#if (LINUX_VERSION_CODE <= VERSION(2,6,18))
|
||||
#define KC_IRQ_HANDLER_ARGS(intno, dev_id) \
|
||||
int intno, void *dev_id, struct pt_regs *regs
|
||||
#else /* <=2.6.18 */
|
||||
#define KC_IRQ_HANDLER_ARGS(intno, dev_id) \
|
||||
int intno, void *dev_id
|
||||
#endif /* <=2.6.18 */
|
||||
|
||||
/*** timming related stuff ***/
|
||||
|
||||
#if (LINUX_VERSION_CODE < VERSION(2,1,100)) /* needs correction */
|
||||
#define schedule_timeout(timeout_jif) ({ \
|
||||
current->timeout = jiffies + (timeout_jif); \
|
||||
schedule(); \
|
||||
current->timeout = 0; \
|
||||
})
|
||||
|
||||
#ifndef set_current_state
|
||||
#define set_current_state(state_value) do { current->state = state_value; } while (0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE < VERSION(2,1,36)) /* needs correction */
|
||||
#define mod_timer(timer,expires) ({\
|
||||
del_timer(timer); \
|
||||
timer->expires=expires; \
|
||||
add_timer(timer); \
|
||||
})
|
||||
#endif
|
||||
|
||||
/*** file_operations changes ***/
|
||||
|
||||
#if (LINUX_VERSION_CODE < VERSION(2,1,5))
|
||||
#define CLOSERET void
|
||||
#define RWRET int
|
||||
#define RWCOUNT_T int
|
||||
#define RWINODE_P struct inode *inode,
|
||||
#define RWPPOS_P
|
||||
#define RWINODE inode
|
||||
#define KC_FOPS_FLUSH(ptr)
|
||||
#define kc_dev2minor MINOR
|
||||
#elif (LINUX_VERSION_CODE < VERSION(2,1,36))
|
||||
#define CLOSERET void
|
||||
#define RWRET long
|
||||
#define RWCOUNT_T unsigned long
|
||||
#define RWINODE_P struct inode *inode,
|
||||
#define RWPPOS_P
|
||||
#define RWINODE inode
|
||||
#define KC_FOPS_FLUSH(ptr)
|
||||
#define kc_dev2minor MINOR
|
||||
#elif (LINUX_VERSION_CODE < VERSION(2,1,76)) /* may need correction */
|
||||
#define CLOSERET int
|
||||
#define RWRET long
|
||||
#define RWCOUNT_T unsigned long
|
||||
#define RWINODE_P struct inode *inode,
|
||||
#define RWPPOS_P
|
||||
#define RWINODE inode
|
||||
#define KC_FOPS_FLUSH(ptr)
|
||||
#define kc_dev2minor MINOR
|
||||
#elif (LINUX_VERSION_CODE < VERSION(2,1,117)) /* may need correction */
|
||||
#define CLOSERET int
|
||||
#define RWRET ssize_t
|
||||
#define RWCOUNT_T size_t
|
||||
#define RWINODE_P
|
||||
#define RWPPOS_P ,loff_t *ppos
|
||||
#define RWINODE file->f_dentry->d_inode
|
||||
#define KC_FOPS_FLUSH(ptr)
|
||||
#define kc_dev2minor MINOR
|
||||
#elif ((LINUX_VERSION_CODE >= VERSION(2,5,7)) && (LINUX_VERSION_CODE < VERSION(2,6,0)))
|
||||
#define CLOSERET int
|
||||
#define RWRET ssize_t
|
||||
#define RWCOUNT_T size_t
|
||||
#define RWINODE_P
|
||||
#define RWPPOS_P ,loff_t *ppos
|
||||
#define RWINODE file->f_dentry->d_inode
|
||||
#define KC_FOPS_FLUSH(ptr) flush:(ptr),
|
||||
#define kc_dev2minor minor
|
||||
#else /* <2.5.7 >=2.6.0 */ /* may need correction */
|
||||
#define CLOSERET int
|
||||
#define RWRET ssize_t
|
||||
#define RWCOUNT_T size_t
|
||||
#define RWINODE_P
|
||||
#define RWPPOS_P ,loff_t *ppos
|
||||
#define RWINODE file->f_dentry->d_inode
|
||||
#define KC_FOPS_FLUSH(ptr) flush:(ptr),
|
||||
#define kc_dev2minor MINOR
|
||||
#endif /* 2.1.36 */
|
||||
|
||||
#if (LINUX_VERSION_CODE < VERSION(2,1,50)) /* may need correction */
|
||||
#define kc_poll_wait(file,address,wait) poll_wait(address,wait)
|
||||
#else /* >= 2.1.50 */
|
||||
#define kc_poll_wait poll_wait
|
||||
#endif /* 2.1.50 */
|
||||
|
||||
/* definition of standard parameters for read/write file functions */
|
||||
#define READ_PARAMETERS \
|
||||
RWINODE_P struct file *file, char *buf, RWCOUNT_T count RWPPOS_P
|
||||
|
||||
#define WRITE_PARAMETERS \
|
||||
RWINODE_P struct file *file, const char *buf, RWCOUNT_T count RWPPOS_P
|
||||
|
||||
#define LSEEK_PARAMETERS \
|
||||
RWINODE_P struct file *file, loff_t pos, int whence
|
||||
|
||||
#if (LINUX_VERSION_CODE < VERSION(2,2,0)) /* may need correction */
|
||||
#define KC_CHRDEV_FOPS_BEG(fops_var) \
|
||||
static struct file_operations fops_var =\
|
||||
{
|
||||
#define KC_CHRDEV_FOPS_END \
|
||||
}
|
||||
#define KC_FOPS_LSEEK(ptr) lseek:(ptr),
|
||||
#define KC_FOPS_RELEASE(ptr) close:(ptr),
|
||||
#elif (LINUX_VERSION_CODE < VERSION(2,4,0)) /* may need correction */
|
||||
#define KC_CHRDEV_FOPS_BEG(fops_var) \
|
||||
static struct file_operations fops_var =\
|
||||
{
|
||||
#define KC_CHRDEV_FOPS_END \
|
||||
}
|
||||
#define KC_FOPS_LSEEK(ptr) llseek:(ptr),
|
||||
#define KC_FOPS_RELEASE(ptr) release:(ptr),
|
||||
#else /* >= 2.4.0 */
|
||||
#define KC_CHRDEV_FOPS_BEG(fops_var) \
|
||||
static struct file_operations fops_var = {\
|
||||
owner:THIS_MODULE,
|
||||
#define KC_CHRDEV_FOPS_END \
|
||||
}
|
||||
#define KC_FOPS_LSEEK(ptr) llseek:(ptr),
|
||||
#define KC_FOPS_RELEASE(ptr) release:(ptr),
|
||||
#endif /* 2.4.0 */
|
||||
|
||||
/*** devices and drivers registration ***/
|
||||
|
||||
#if (LINUX_VERSION_CODE >= VERSION(2,5,41)) /* may need correction */
|
||||
#define devfs_register_chrdev register_chrdev
|
||||
#define devfs_unregister_chrdev unregister_chrdev
|
||||
#endif /* 2.5.40 */
|
||||
|
||||
#if (LINUX_VERSION_CODE >= VERSION(2,5,60)) /* may need correction */
|
||||
#define kc_devfs_handle_t char *
|
||||
#define kc_devfs_delete(handle) ({ devfs_remove(handle); kfree(handle); })
|
||||
|
||||
#define kc_devfs_new_cdev(dir_handle, dev_num, dev_mode, dev_ops, dev_info, dev_name) ({ \
|
||||
char *kc_t_name; \
|
||||
const char *kc_t_dev=(dev_name); \
|
||||
const char *kc_t_dir=(dir_handle); \
|
||||
const int kc_t_d=kc_t_dir?strlen(kc_t_dir)+1:0; \
|
||||
int kc_t_n=strlen(kc_t_dev)+1+kc_t_d; \
|
||||
if ((kc_t_name=kmalloc(kc_t_n,GFP_KERNEL))) { \
|
||||
if(kc_t_d) {memcpy(kc_t_name,kc_t_dir,kc_t_d-1); kc_t_name[kc_t_d-1]='/';} \
|
||||
strcpy(kc_t_name+kc_t_d,kc_t_dev); \
|
||||
if(devfs_mk_cdev((dev_num), (dev_mode), kc_t_name)<0) { \
|
||||
kfree(kc_t_name); \
|
||||
kc_t_name = NULL ; \
|
||||
} \
|
||||
} \
|
||||
kc_t_name; \
|
||||
})
|
||||
|
||||
#define kc_devfs_mk_dir devfs_mk_dir
|
||||
#else /* 2.5.60 */
|
||||
#define kc_devfs_handle_t devfs_handle_t
|
||||
#define kc_devfs_delete devfs_unregister
|
||||
|
||||
#define kc_devfs_new_cdev(dir_handle, dev_num, dev_mode, dev_ops, dev_info, dev_name) ({ \
|
||||
devfs_register((dir_handle), (dev_name), DEVFS_FL_DEFAULT, \
|
||||
MAJOR(dev_num), MINOR(dev_num), (dev_mode), (dev_ops), (dev_info)); \
|
||||
})
|
||||
|
||||
#define kc_devfs_mk_dir(dirname...) ({ \
|
||||
char kc_buf[64]; int kc_n; \
|
||||
kc_n = snprintf(buf, 64, ##dirname); \
|
||||
(kc_n >= 64 || !buf[0])? NULL: devfs_mk_dir(NULL, kc_buf, NULL); \
|
||||
})
|
||||
|
||||
#endif /* 2.5.60 */
|
||||
|
||||
#if (LINUX_VERSION_CODE <= VERSION(2,6,0))
|
||||
typedef struct {int dummy;} kc_class;
|
||||
#define kc_class_create(...) (NULL)
|
||||
#define kc_class_device_create(...)
|
||||
#define kc_class_device_destroy(...)
|
||||
#define kc_class_destroy(...)
|
||||
#else /* 2.6.0 */
|
||||
#define KC_WITH
|
||||
#include <linux/device.h>
|
||||
#if LINUX_VERSION_CODE >= VERSION(2,6,15)
|
||||
#define kc_class class
|
||||
#define kc_class_create class_create
|
||||
#define kc_class_device_create class_device_create
|
||||
#define kc_class_device_destroy class_device_destroy
|
||||
#define kc_class_destroy class_destroy
|
||||
#elif LINUX_VERSION_CODE >= VERSION(2,6,13)
|
||||
#define kc_class class
|
||||
#define kc_class_create class_create
|
||||
#define kc_class_device_create(cls, parent, devt, device, fmt...) \
|
||||
class_device_create(cls, devt, device, ##fmt)
|
||||
#define kc_class_device_destroy class_device_destroy
|
||||
#define kc_class_destroy class_destroy
|
||||
#else /* 2.6.0 ... 2.6.12 */
|
||||
#define kc_class class_simple
|
||||
#define kc_class_create class_simple_create
|
||||
#define kc_class_device_create(cls, parent, devt, device, fmt...) \
|
||||
class_simple_device_add(cls, devt, device, ##fmt)
|
||||
#define kc_class_device_destroy(a,b) class_simple_device_remove(b)
|
||||
#define kc_class_destroy class_simple_destroy
|
||||
#endif
|
||||
#define kc_pci_dev_to_dev(pdev) (&(pdev)->dev)
|
||||
#define kc_usb_dev_to_dev(pdev) (&(pdev)->dev)
|
||||
#endif
|
||||
|
||||
|
||||
/*** tasklet declaration and processing ***/
|
||||
|
||||
#if (LINUX_VERSION_CODE < VERSION(2,5,0)) /* may need correction */
|
||||
#define kc_tasklet_struct tq_struct
|
||||
#define kc_tasklet_data_type void *
|
||||
#define KC_DECLARE_TASKLET(_name, _func, _data) \
|
||||
struct tq_struct _name = { sync: 0, routine: _func, data: (void*)_data }
|
||||
|
||||
/* void tasklet_init(struct tasklet_struct *t, void (*func)(unsigned long), unsigned long data); */
|
||||
#define kc_tasklet_init(_tasklet, _func, _data) \
|
||||
do{ \
|
||||
/* (_tasklet)->next=NULL; */ \
|
||||
/* Above not needed for 2.2.x and buggy for 2.4.x */ \
|
||||
(_tasklet)->sync=0; \
|
||||
(_tasklet)->routine=_func; \
|
||||
(_tasklet)->data=(void*)_data; \
|
||||
}while(0)
|
||||
|
||||
/* void tasklet_schedule(struct tasklet_struct *t) */
|
||||
#define kc_tasklet_schedule(_tasklet) \
|
||||
do{ \
|
||||
queue_task(_tasklet,&tq_immediate); \
|
||||
mark_bh(IMMEDIATE_BH); \
|
||||
}while(0)
|
||||
|
||||
/* void tasklet_kill(struct tasklet_struct *t); */
|
||||
#define kc_tasklet_kill(_tasklet) \
|
||||
synchronize_irq()
|
||||
|
||||
#else /* 2.5.40 */
|
||||
/* struct tasklet_struct */
|
||||
#define kc_tasklet_struct tasklet_struct
|
||||
/* DECLARE_TASKLET(name, func, data) */
|
||||
#define kc_tasklet_data_type unsigned long
|
||||
#define KC_DECLARE_TASKLET DECLARE_TASKLET
|
||||
/* void tasklet_init(struct tasklet_struct *t, void (*func)(unsigned long), unsigned long data); */
|
||||
#define kc_tasklet_init tasklet_init
|
||||
/* void tasklet_schedule(struct tasklet_struct *t) */
|
||||
#define kc_tasklet_schedule tasklet_schedule
|
||||
/* void tasklet_kill(struct tasklet_struct *t); */
|
||||
#define kc_tasklet_kill tasklet_kill
|
||||
#endif /* 2.5.40 */
|
||||
|
||||
/*** scheduler changes ***/
|
||||
|
||||
#if (LINUX_VERSION_CODE < VERSION(2,3,0)) /* may need correction */
|
||||
#define kc_yield schedule
|
||||
#else /* 2.3.0 */
|
||||
#define kc_yield yield
|
||||
#endif /* 2.3.0 */
|
||||
|
||||
/*** PCI changes ***/
|
||||
|
||||
#if (LINUX_VERSION_CODE < VERSION(2,6,11)) /* may need correction */
|
||||
#define kc_pci_name(pdev) (pdev->slot_name)
|
||||
#else /* 2.6.11 */
|
||||
#define kc_pci_name pci_name
|
||||
#endif /* 2.6.11 */
|
||||
|
||||
/*** wait queues changes ***/
|
||||
|
||||
/* Next is not sctrictly correct, because of 2.3.0, 2.3.1, 2.3.2
|
||||
probably need next definitions */
|
||||
#if (LINUX_VERSION_CODE < VERSION(2,2,19)) /* may need correction */
|
||||
#define wait_queue_head_t struct wait_queue *
|
||||
#define wait_queue_t struct wait_queue
|
||||
#define init_waitqueue_head(queue_head) (*queue_head=NULL)
|
||||
#define init_waitqueue_entry(qentry,qtask) \
|
||||
(qentry->next=NULL,qentry->task=qtask)
|
||||
#define DECLARE_WAIT_QUEUE_HEAD(name) \
|
||||
struct wait_queue * name=NULL
|
||||
#define DECLARE_WAITQUEUE(wait, current) \
|
||||
struct wait_queue wait = { current, NULL }
|
||||
#define init_MUTEX(sem) (*sem=MUTEX)
|
||||
#define DECLARE_MUTEX(name) struct semaphore name=MUTEX
|
||||
#endif /* 2.2.19 */
|
||||
|
||||
#ifndef MODULE_LICENSE
|
||||
#define MODULE_LICENSE(dummy)
|
||||
#endif /* MODULE_LICENSE */
|
||||
|
||||
#endif /* _LINUX_K_COMPAT_H */
|
||||
33
m683xx/bdm-load/Makefile
Normal file
33
m683xx/bdm-load/Makefile
Normal file
@@ -0,0 +1,33 @@
|
||||
#TARGET_ARCH = -bi586-pc-linux-gnulibc1
|
||||
#CC = egcc
|
||||
|
||||
CFLAGS += -Wall -ggdb -O2
|
||||
CFLAGS += -Wstrict-prototypes
|
||||
CFLAGS += ${TARGET_ARCH}
|
||||
|
||||
#/* Select right place or libraries with configured m68k-coff support */
|
||||
LDLIBS += -lbfd
|
||||
#CFLAGS += -I ./gdblibs
|
||||
#LOCLIBS += ./gdblibs/libbfd.a ./gdblibs/libiberty.a
|
||||
#LDFLAGS += -lintl
|
||||
LDLIBS += -liberty
|
||||
LDFLAGS += ${TARGET_ARCH}
|
||||
|
||||
all : bdm-load bdm_test tpudb
|
||||
|
||||
dep:
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -w -E -M *.c $(MORE_C_FILES) > depend
|
||||
|
||||
depend:
|
||||
@touch depend
|
||||
|
||||
clean :
|
||||
rm -f *.o *.lo *~ *.a *.so *.so.* depend
|
||||
|
||||
bdm-load : bdm-load.o bdmlib.o bdmflash.o ${LOCLIBS}
|
||||
|
||||
bdm_test : bdm_test.o bdmlib.o ${LOCLIBS}
|
||||
|
||||
tpudb : tpudb.o bdmlib.o tpudis.o ${LOCLIBS}
|
||||
|
||||
-include depend
|
||||
188
m683xx/bdm-load/README
Normal file
188
m683xx/bdm-load/README
Normal file
@@ -0,0 +1,188 @@
|
||||
BDM-LOAD snapshot 2003-08-15
|
||||
|
||||
This is attempt to rewrite bdm-load utility for 683xx based
|
||||
embedded systems.
|
||||
|
||||
This code is in experimental and rewrite phase, it works for me,
|
||||
but there is no warranty that it is useful or safe for others.
|
||||
|
||||
Except "bdm-load" program, two test utilities are build.
|
||||
It is "bdm_test" program. It was my first experiment with
|
||||
interfacing BDM library with stand-alone program.
|
||||
The second project is to write free TPU debugger, but this
|
||||
code does not do anything useful yet.
|
||||
|
||||
INSTALL
|
||||
|
||||
To compile and install "bdm-load" you need:
|
||||
- mc683xx target system with BDM interface
|
||||
- GCC compiler for your Linux system.
|
||||
- BDM driver - latest version is attached into "bdm-load" archive
|
||||
- BFD object file handling library
|
||||
- some time and experience with Linux system and make utility
|
||||
|
||||
To be able load other formats than S-record and IntelHEX, you
|
||||
need to link with BFD library with m68kcoff and/or m68kelf
|
||||
targets. I have system wide BFD with all targets I use.
|
||||
I build my Linux binutils configured by next line in created
|
||||
source tree subdirectory i586-linux
|
||||
|
||||
---System wide multi binutils configuration-----------------------
|
||||
../configure \
|
||||
--with-ld --exec-prefix=/usr --prefix=/usr \
|
||||
--enable-shared --enable-commonbfdlib --verbose --with-mmap \
|
||||
--enable-targets=i586-pc-linux-gnulibc1,i386-a.out-linux,i386-coff,\
|
||||
m68k-linux-elf,m68k-coff,m68k-a.out-linux,h8300-hitachi-coff,\
|
||||
sparc-linux-elf,i586-win-pe,tic30-ti-coff,tic30-ti-aout
|
||||
------------------------------------------------------------------
|
||||
|
||||
You need not to rebuild your system wide BFD. You can statically link
|
||||
with "libbfd.a", "libiberty.a" and "bfd.h" taken, for example,
|
||||
from GDB build tree configured for m68k-coff. Configuration of GDB
|
||||
is bellow
|
||||
|
||||
---GDB for m683xx with BDM configuration--------------------------
|
||||
../configure --target=m68k-bdm-coff --enable-gdbtk --with-x --verbose \
|
||||
--enable-targets=m68k-linux-elf,m68k-coff,m68k-a.out-linux
|
||||
------------------------------------------------------------------
|
||||
|
||||
To compile statically copy three needed files to gdblibs subdirectory
|
||||
and change next lines in "Makefile" to form
|
||||
|
||||
CFLAGS += -I ./gdblibs
|
||||
#LDFLAGS += -lbfd -liberty
|
||||
LOCLIBS += ./gdblibs/libbfd.a ./gdblibs/libiberty.a
|
||||
|
||||
Prebuild version of "bdm-load" is attached to archive under name
|
||||
"bdm-load-i586-linux-static".
|
||||
|
||||
PROGRAMMERS NOTES
|
||||
|
||||
Sources of "bdm-load" are in next files
|
||||
|
||||
bdmlib.c,bdmlib.h library for communication with CPU32
|
||||
through BDM
|
||||
|
||||
bdmflash.c,bdmflash.h flash write and erase algorithms and
|
||||
flash areas write filter routines
|
||||
|
||||
bdm-load.c loader command line and interactive
|
||||
interface
|
||||
|
||||
It is necessary to add new entries into array flash_alg_infos_def
|
||||
in "bdmflash.c" file for every new flash programming algorithm.
|
||||
Flash types should be sorted from smallest to biggest.
|
||||
|
||||
RUNNING BDM-LOAD
|
||||
|
||||
Command line interface
|
||||
|
||||
Usage bdm-load [OPTIONS] file1 ...
|
||||
-h --help - this help information!
|
||||
-i --init-file=FILE - object file to initialize processor
|
||||
-r --reset - reset target CPU before other operations
|
||||
-c --check - check flash setup (needed for auto)
|
||||
-e --erase - erase flash
|
||||
-b --blankck - blank check of flash
|
||||
-l --load - download listed filenames
|
||||
--go[=address] - run target CPU from entry address
|
||||
-M --mbar=val - setup 68360 MBAR register
|
||||
-s --script - do actions and return
|
||||
-d --bdm-delay=d - sets BDM driver speed/delay
|
||||
-D --bdm-device - sets BDM device file
|
||||
-f --flash=TYPE@ADR - select flash
|
||||
For flash TYPE@ADR can be
|
||||
{<TYPE>|auto}[@{csboot|cs<x>|<start>{+<size>|-<end>}}]
|
||||
Examples
|
||||
auto@csboot amd29f400@0x800000-0x87ffff auto@0+0x80000
|
||||
If auto type or cs address is used, check must be
|
||||
specified to take effect.
|
||||
Known flash types/algorithms :
|
||||
amd29f010x2 amd29f040 amd29f400 amd29f800 at49f040x2 amd29f080x4
|
||||
|
||||
Possible commands in interactive mode :
|
||||
- run
|
||||
starts CPU32 execution at address taken from last downloaded
|
||||
object file. If no file is loaded, it starts at address
|
||||
fetched during last reset command.
|
||||
|
||||
- reset
|
||||
resets CPU32 and if no entry address is defined, PC address is
|
||||
remembered
|
||||
|
||||
- erase
|
||||
sets erase request and starts erase procedure
|
||||
|
||||
-load [<object-file>]
|
||||
sets load request and starts download of files from
|
||||
object file list.
|
||||
if <object-file> is specified, object file list is cleared
|
||||
and specified file is added on-to list
|
||||
|
||||
- exit/quit
|
||||
exit interactive mode and return to shell
|
||||
|
||||
- dump <address> <bytes>
|
||||
dumps memory contents from specified address.
|
||||
bytes specifies number of bytes to print.
|
||||
|
||||
- stat
|
||||
shows CPU32 state, does not require CPU32 to stop
|
||||
|
||||
- check
|
||||
checks flash memories at specified ranges,
|
||||
if auto type or "cs" address is specified for some
|
||||
flash, CS address is fetched and flash autodetection
|
||||
is run
|
||||
|
||||
- autoset
|
||||
same as check, but all flash types are revalidated
|
||||
|
||||
- stop
|
||||
stops CPU32 and clears all reset, erase, load and run
|
||||
requests
|
||||
|
||||
- make
|
||||
make in current directory is called
|
||||
|
||||
|
||||
The simplest way to initialize CPU32 chipselect subsystem
|
||||
and other SIM parameters is to provide "cpu32init" file
|
||||
in same directory as "bdm-load" is started from.
|
||||
The "cpu32init" file is processed at every reset of target.
|
||||
The syntax of the macro file is:
|
||||
|
||||
<cmd-letter> <num1> <num2> <num3>
|
||||
|
||||
The nums are either in hex (form 0x), in decimal (form 123) or in octal
|
||||
(form 0234)
|
||||
|
||||
The meaning of the nums depends on the command letter:
|
||||
|
||||
w or W means: (write)
|
||||
|
||||
write to address (num1) contents (num2) length is (num3) bytes. Only
|
||||
1, 2, 4 bytes are permitted.
|
||||
|
||||
z or Z means: (zap, zero)
|
||||
|
||||
fill memory area beginning at (num1) with byte value (num2) length
|
||||
(num3) bytes.
|
||||
|
||||
c or C means: (copy)
|
||||
|
||||
copy memory area from (num1) to (num2) with length (num3) bytes.
|
||||
|
||||
m or M is new command to set 68360 MBAR register.
|
||||
|
||||
the MBAR register is set to value of (num3)
|
||||
|
||||
Empty lines and lines with a leading '#' are ignored. See GDB-BDM
|
||||
patches for more information.
|
||||
|
||||
|
||||
For more questions contact
|
||||
|
||||
Pavel Pisa <pisa@cmp.felk.cvut.cz>
|
||||
|
||||
|
||||
903
m683xx/bdm-load/bdm-load.c
Normal file
903
m683xx/bdm-load/bdm-load.c
Normal file
@@ -0,0 +1,903 @@
|
||||
/*
|
||||
* Adapted from....
|
||||
*
|
||||
* Remote debugging interface for 683xx via Background Debug Mode
|
||||
* needs a driver, which controls the BDM interface.
|
||||
* written by G.Magin
|
||||
* (C) 1995 Technische Universitaet Muenchen, Lehrstuhl fuer Prozessrechner
|
||||
*
|
||||
* D.Jeff Dionne
|
||||
* (C) 1995, Dionne & Associates
|
||||
*
|
||||
* V0.2 Enhancements:
|
||||
* Added command line arguments
|
||||
* Rewritten flash programming functions for more flexability
|
||||
*
|
||||
* Andrew Dennison <adennison@swin.edu.au>
|
||||
* December 1995
|
||||
*
|
||||
* Modified by Pavel Pisa pisa@cmp.felk.cvut.cz 2000
|
||||
|
||||
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, 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; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
* NOTE:
|
||||
* This file is assumed to be runnable only on Linux/i386 because of
|
||||
* HW-restrictions: the driver is currently only available on i386-Linux
|
||||
* So byte-swapping and alignment is handled directly, violating the
|
||||
* GNU-coding standards. However, the "dirty spots" are restricted in this
|
||||
* file.
|
||||
*
|
||||
* If anybody wants to port to e.g. Sparc, byte-sex has to be handled in
|
||||
* a more general way.
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <getopt.h>
|
||||
|
||||
#include <bfd.h>
|
||||
#include "bdm.h"
|
||||
#include "bdmlib.h"
|
||||
#include "bdmflash.h"
|
||||
|
||||
/*
|
||||
* Global Types
|
||||
**************
|
||||
*/
|
||||
typedef caddr_t CORE_ADDR;
|
||||
|
||||
#define END_MACRO 0
|
||||
#define BEGIN_MACRO 1
|
||||
#define NO_SUFFIX_MACRO 2
|
||||
#define DEBUG_MESSAGES
|
||||
|
||||
#define swap_l(x) (x>>24) | ((x>>8)&0xff00) | ((x<<8)&0xff0000) | ((x&0xff)<<24)
|
||||
|
||||
#define AUTO_ADR_CSBOOT ((caddr_t)-100)
|
||||
#define AUTO_ADR_CSX ((caddr_t)-100+1)
|
||||
|
||||
typedef struct str_list_t{
|
||||
char **items;
|
||||
int count;
|
||||
int alloccnt;
|
||||
}str_list_t; /* to store list of filenames */
|
||||
|
||||
/*
|
||||
* Global Variables
|
||||
******************
|
||||
*/
|
||||
|
||||
char hashmark = 0; /* flag set by "set hash" */
|
||||
int bdm_autoreset = 0; /* automatic reset before load */
|
||||
int bdm_ttcu = 0; /* time to come up for init by rom */
|
||||
char *initname; /* need reimplement !!!!!!!!! */
|
||||
char *bdm_dev_name; /* device name */
|
||||
static char *entry_name=NULL;
|
||||
|
||||
int
|
||||
mem_dump (char *buf)
|
||||
{
|
||||
caddr_t adr;
|
||||
long len, l;
|
||||
int i, ret;
|
||||
u_char mem[16];
|
||||
char *dump_fname = NULL;
|
||||
FILE *dump_file = NULL;
|
||||
i = sscanf (buf, " %li %li %as", &l, &len, &dump_fname);
|
||||
if (i < 2)
|
||||
{
|
||||
printf ("use : dump address len [file]\n");
|
||||
return -1;
|
||||
}
|
||||
if(dump_fname && *dump_fname)
|
||||
{ dump_file=fopen(dump_fname,"wb");
|
||||
if(dump_file==NULL)
|
||||
{
|
||||
printf ("mem_dump : file \"%s\" open for write error\n", dump_fname);
|
||||
free(dump_fname);
|
||||
return -1;
|
||||
}
|
||||
free(dump_fname);
|
||||
}
|
||||
|
||||
adr = (caddr_t) l;
|
||||
while (len)
|
||||
{
|
||||
l = len > 16 ? 16 : len;
|
||||
ret = bdmlib_read_block (adr, l, mem);
|
||||
if (ret != l)
|
||||
{
|
||||
printf ("error to read 0x%lx len 0x%lx ret %d\n",
|
||||
(u_long) adr, l, ret);
|
||||
if(dump_file!=NULL)
|
||||
fclose(dump_file);
|
||||
return -2;
|
||||
}
|
||||
printf ("%06lx:", (u_long) adr);
|
||||
for (i = 0; i < l; i++)
|
||||
printf (" %02x", mem[i]);
|
||||
printf ("\n");
|
||||
if(dump_file!=NULL)
|
||||
fwrite(mem, l, 1, dump_file);
|
||||
len -= l;
|
||||
adr += l;
|
||||
}
|
||||
if(dump_file!=NULL)
|
||||
fclose(dump_file);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
mem_modify (char *buf)
|
||||
{
|
||||
int ret;
|
||||
char *p;
|
||||
long addr;
|
||||
long count=0;
|
||||
long capacity=0;
|
||||
u_char *data=NULL;
|
||||
u_char val;
|
||||
|
||||
while(*buf&&!isblank(*buf)) buf++;
|
||||
while(*buf&&isblank(*buf)) buf++;
|
||||
if(!*buf)
|
||||
{ usage_error:
|
||||
if(data) free(data);
|
||||
printf ("use : modify address byte1 byte2 ...\n");
|
||||
return -1;
|
||||
}
|
||||
addr=strtol(buf,&p,0);
|
||||
if(p==buf) goto usage_error;
|
||||
buf=p;
|
||||
capacity=128;
|
||||
data=malloc(capacity);
|
||||
while(*buf&&isblank(*buf)) buf++;
|
||||
while(*buf){
|
||||
val=strtol(buf,&p,0);
|
||||
if(p==buf) goto usage_error;
|
||||
buf=p;
|
||||
if(count>=capacity){
|
||||
capacity*=2;
|
||||
data=realloc(data,capacity);
|
||||
if(!data) goto usage_error;
|
||||
}
|
||||
data[count++]=val;
|
||||
while(*buf&&isblank(*buf)) buf++;
|
||||
}
|
||||
|
||||
ret=bdmlib_wrb_filt(bdmlib_bfilt, (caddr_t)addr, count, data);
|
||||
//if(ret!=count)
|
||||
printf("bdmlib_wrb_filt: addr=0x%08lx count=%ld return=%ld\n",
|
||||
(long)addr,(long)count,(long)ret);
|
||||
|
||||
if(data) free(data);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
cpu_get_rpc(u_int32_t *val)
|
||||
{
|
||||
int ret;
|
||||
u_int32_t rpc;
|
||||
if ((ret = bdmlib_get_sys_reg (BDM_REG_RPC, &rpc)) < 0)
|
||||
return ret;
|
||||
*val=swap_l(rpc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
cpu_stat (char *buf)
|
||||
{
|
||||
int ret;
|
||||
u_int32_t rpc;
|
||||
ret = bdmlib_getstatus ();
|
||||
printf ("MCU ");
|
||||
if (ret & BDM_TARGETRESET)
|
||||
printf ("Reset ");
|
||||
if (ret & BDM_TARGETSTOPPED)
|
||||
printf ("Stopped ");
|
||||
if (ret & BDM_TARGETPOWER)
|
||||
printf ("NoPower ");
|
||||
if (ret & BDM_TARGETNC)
|
||||
printf ("NoConnect ");
|
||||
printf ("\n");
|
||||
if (ret & BDM_TARGETSTOPPED)
|
||||
{
|
||||
if ((ret = cpu_get_rpc (&rpc)) < 0)
|
||||
return ret;
|
||||
printf ("RPC=%x\n",rpc);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
flash_check_one (bdmlib_bfilt_t *filt, int autoset)
|
||||
{
|
||||
flash_alg_info_t const *alg;
|
||||
caddr_t adr;
|
||||
flash_d_t readid[2];
|
||||
int ret;
|
||||
|
||||
alg = (flash_alg_info_t *) filt->info;
|
||||
adr = filt->begin_adr;
|
||||
|
||||
if(filt->flags&BDMLIB_FILT_AUTO)
|
||||
{
|
||||
autoset|=2;
|
||||
if(adr==filt->end_adr)
|
||||
autoset|=4;
|
||||
}
|
||||
|
||||
if ((autoset & 4)&&(adr>=AUTO_ADR_CSBOOT)&&(adr<=AUTO_ADR_CSBOOT+12))
|
||||
{
|
||||
u_int32_t csx_opt, csx_base, csx_size;
|
||||
caddr_t cpu32csopt_adr;
|
||||
cpu32csopt_adr=(caddr_t)0xfffa48+(adr-AUTO_ADR_CSBOOT)*4;
|
||||
if (bdmlib_read_var (cpu32csopt_adr, BDM_SIZE_LONG, &csx_opt) >= 0)
|
||||
{
|
||||
static u_int32_t csx_sizes[]={1<<11,1<<13,1<<14,1<<16,
|
||||
1<<17,1<<18,1<<19,1<<20};
|
||||
csx_base = (csx_opt >> 8) & 0xfff800;
|
||||
filt->begin_adr = (caddr_t) csx_base;
|
||||
csx_size = csx_sizes[(csx_opt >> 16) & 0x7];
|
||||
filt->end_adr = (caddr_t) (csx_base + csx_size - 1);
|
||||
if(adr==AUTO_ADR_CSBOOT)
|
||||
printf ("Flash addresses taken from CSBOOT\n");
|
||||
else
|
||||
printf ("Flash addresses taken from CS%d\n",
|
||||
(int)(adr-AUTO_ADR_CSX));
|
||||
printf ("Start %06lX End %06lX\n",
|
||||
(long) filt->begin_adr, (long) filt->end_adr);
|
||||
}
|
||||
}
|
||||
|
||||
adr = filt->begin_adr;
|
||||
|
||||
ret = bdmflash_check_id (alg, adr, readid);
|
||||
if((ret >= 0)&&(autoset&4)&&(filt->begin_adr==filt->end_adr))
|
||||
filt->end_adr=filt->begin_adr+alg->addr_mask;
|
||||
printf ("Flash@%06lX-%06lX ManID %08X DevID %08X\n",
|
||||
(long) adr, (long) filt->end_adr,
|
||||
(unsigned) readid[0], (unsigned) readid[1]);
|
||||
if (ret >= 0)
|
||||
{
|
||||
printf ("Flash ID is OK\nUsed algorithm %s\n", alg->alg_name);
|
||||
return 1;
|
||||
}
|
||||
if (!autoset & 2)
|
||||
{
|
||||
printf ("Flash parameters are incorrect !!!\n");
|
||||
return -1;
|
||||
}
|
||||
alg = bdmflash_alg_probe (adr);
|
||||
if (alg == NULL)
|
||||
{
|
||||
printf ("Flash parameters cannot be probed\n");
|
||||
return -1;
|
||||
}
|
||||
ret = bdmflash_check_id (alg, adr, readid);
|
||||
if (ret < 0)
|
||||
{
|
||||
printf ("Probed parameters are incorrect\n");
|
||||
return -1;
|
||||
}
|
||||
filt->info = (void *) alg;
|
||||
if(filt->begin_adr==filt->end_adr)
|
||||
filt->end_adr=filt->begin_adr+alg->addr_mask;
|
||||
printf ("Probed flash parameters\n");
|
||||
printf ("Flash@%06lX-%06lX ManID %04X DevID %04X\n",
|
||||
(long) filt->begin_adr, (long) filt->end_adr,
|
||||
(unsigned) readid[0], (unsigned) readid[1]);
|
||||
printf ("Used algorithm %s\n", alg->alg_name);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
flash_check(char *buf, int autoset)
|
||||
{
|
||||
int ret;
|
||||
bdmlib_bfilt_t *filt = bdmlib_bfilt;
|
||||
printf("\n");
|
||||
while(filt)
|
||||
{
|
||||
if(filt->flags&BDMLIB_FILT_FLASH)
|
||||
{
|
||||
ret=flash_check_one(filt,autoset);
|
||||
printf("\n");
|
||||
if(ret<0)
|
||||
return ret;
|
||||
}
|
||||
filt=filt->next;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
flash_erase(void)
|
||||
{
|
||||
int ret;
|
||||
bdmlib_bfilt_t *filt = bdmlib_bfilt;
|
||||
while(filt)
|
||||
{
|
||||
if(filt->flags&BDMLIB_FILT_FLASH)
|
||||
{
|
||||
ret=bdmflash_erase_filt (filt, (caddr_t) 0, 0);
|
||||
if(ret<0)
|
||||
return ret;
|
||||
}
|
||||
filt=filt->next;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
flash_blankck(void)
|
||||
{
|
||||
int ret,sum=0;
|
||||
bdmlib_bfilt_t *filt = bdmlib_bfilt;
|
||||
while(filt)
|
||||
{
|
||||
if(filt->flags&BDMLIB_FILT_FLASH)
|
||||
{
|
||||
ret=bdmflash_blankck_filt (filt, (caddr_t) 0, 0);
|
||||
if(ret<0)
|
||||
return ret;
|
||||
sum+=ret;
|
||||
}
|
||||
filt=filt->next;
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
/* bdmlib_propeller(stdout); */
|
||||
|
||||
int
|
||||
flash_setup(char *buf)
|
||||
{
|
||||
char *p,*r;
|
||||
int i;
|
||||
caddr_t begin_adr=(caddr_t)(0);
|
||||
caddr_t end_adr=(caddr_t)(0);
|
||||
char alg_name[32];
|
||||
flash_alg_info_t const *alg=NULL;
|
||||
bdmlib_bfilt_t *filt;
|
||||
|
||||
while(*buf&&isblank(*buf)) buf++;
|
||||
if((p=strchr(buf,'@'))!=NULL){/* '@' character in specification */
|
||||
i=p-buf;
|
||||
if(i>=sizeof(alg_name)-1)
|
||||
i=sizeof(alg_name)-1;
|
||||
strncpy(alg_name,buf,i);
|
||||
alg_name[i]=0;
|
||||
p++;
|
||||
if(!strncmp(p,"csboot",6)){ /* take address from CSBOOT */
|
||||
p+=6;
|
||||
end_adr=begin_adr=AUTO_ADR_CSBOOT;
|
||||
}else if(!strncmp(p,"cs",2)){
|
||||
p+=2;
|
||||
end_adr=begin_adr=AUTO_ADR_CSX+strtoul(p,&r,0);
|
||||
if((p==r)||(begin_adr>AUTO_ADR_CSX+11)){
|
||||
fprintf(stderr,"%s : bad chipselect format\n",buf);
|
||||
return -1;
|
||||
}
|
||||
p=r;
|
||||
}else{ /* take begin address after '@' */
|
||||
end_adr=begin_adr=(caddr_t)strtoul(p,&r,0);
|
||||
if(p==r){
|
||||
fprintf(stderr,"%s : bad begin address format\n",buf);
|
||||
return -1;
|
||||
}
|
||||
p=r;
|
||||
if(*p=='+'){ /* take end address from size */
|
||||
end_adr=begin_adr+strtoul(++p,&r,0)-1;
|
||||
if(p==r){
|
||||
fprintf(stderr,"%s : bad size format\n",buf);
|
||||
return -1;
|
||||
}
|
||||
p=r;
|
||||
} else if(*p=='-') { /* take absolute end address */
|
||||
end_adr=(caddr_t)strtoul(++p,&r,0);
|
||||
if(p==r){
|
||||
fprintf(stderr,"%s : bad end address format\n",buf);
|
||||
return -1;
|
||||
}
|
||||
p=r;
|
||||
}
|
||||
}
|
||||
while(*buf&&isblank(*buf)) buf++;
|
||||
if(*p){
|
||||
fprintf(stderr,"%s : extra characters in specification %s\n",buf,p);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
end_adr=begin_adr=AUTO_ADR_CSBOOT;
|
||||
strncpy(alg_name,buf,sizeof(alg_name)-1);
|
||||
}
|
||||
|
||||
if(strcmp(alg_name,"auto")){
|
||||
int alg_indx=0;
|
||||
do{
|
||||
alg=flash_alg_infos[alg_indx++];
|
||||
if(alg==NULL){
|
||||
fprintf(stderr,"%s : unknown flash type or algorithm\n",alg_name);
|
||||
return -1;
|
||||
}
|
||||
}while(strcmp(alg_name,alg->alg_name));
|
||||
}
|
||||
|
||||
filt=(bdmlib_bfilt_t*)malloc(sizeof(bdmlib_bfilt_t));
|
||||
if(filt==NULL){
|
||||
fprintf(stderr,"No memory for flash_setup\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
filt->flags=BDMLIB_FILT_FLASH;
|
||||
if(alg==NULL){
|
||||
filt->flags|=BDMLIB_FILT_AUTO;
|
||||
filt->info=flash_alg_infos[0];
|
||||
} else filt->info=(void *)alg;
|
||||
filt->begin_adr=begin_adr;
|
||||
filt->end_adr=end_adr;
|
||||
if(begin_adr==end_adr){
|
||||
filt->flags|=BDMLIB_FILT_AUTO;
|
||||
};
|
||||
filt->filt_id=1;
|
||||
filt->wrb_filt=&bdmflash_wrb_filt;
|
||||
|
||||
filt->next=bdmlib_bfilt;
|
||||
bdmlib_bfilt=filt;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
str_list_add(str_list_t *list, char *str)
|
||||
{
|
||||
char **p;
|
||||
int a;
|
||||
if(list->count>=list->alloccnt)
|
||||
{
|
||||
a=list->alloccnt+5;
|
||||
if(list->items==NULL)
|
||||
p=(char**)malloc(sizeof(char *)*a);
|
||||
else
|
||||
p=(char**)realloc(list->items,sizeof(char *)*a);
|
||||
if(p==NULL) return -1;
|
||||
list->items=p;
|
||||
list->alloccnt=a;
|
||||
}
|
||||
list->items[list->count++]=str;
|
||||
return list->count;
|
||||
}
|
||||
|
||||
void str_list_clear(str_list_t *list)
|
||||
{
|
||||
while(list->count--)
|
||||
{
|
||||
if(list->items[list->count]!=NULL)
|
||||
free(list->items[list->count]);
|
||||
}
|
||||
list->alloccnt=list->count=0;
|
||||
if(list->items!=NULL) free(list->items);
|
||||
list->items=NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Main Program
|
||||
**************
|
||||
*/
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
int done;
|
||||
int error;
|
||||
int ret;
|
||||
static int print_help = 0; /* Help */
|
||||
static int reset = 0; /* Reset target */
|
||||
static int check = 0; /* Check flash configuration */
|
||||
static int erase = 0; /* Erase flash */
|
||||
static int blankck = 0; /* Check, that flash is blank */
|
||||
static int load = 0; /* Load files to flash */
|
||||
static int run = 0; /* Run target from entry point */
|
||||
static int script = 0; /* Batch mode */
|
||||
static int bdm_delay = 0; /* Delay/speed for BDM driver */
|
||||
static int set_mbar_fl = 0; /* Set MBAR requested */
|
||||
static u_long mbar_val = 0;
|
||||
static u_long entry_pt=0;
|
||||
str_list_t files2load={0,}; /* List of filenames to load */
|
||||
int cmd;
|
||||
char buf[255];
|
||||
char *p;
|
||||
int i;
|
||||
|
||||
/* initialize global flash control variables */
|
||||
initname = strdup ("ram_init.srec"); /* default init file for EFI332 */
|
||||
|
||||
/* initialize name of bdm device */
|
||||
bdm_dev_name = strdup ("/dev/bdm");
|
||||
|
||||
/* start bdmlib debugging */
|
||||
bdmlib_setdebug (0);
|
||||
|
||||
/* Parse arguments and options. Taken from GDB. */
|
||||
{
|
||||
int c;
|
||||
/* When var field is 0, use flag field to record the equivalent
|
||||
short option (or arbitrary numbers starting at 10 for those
|
||||
with no equivalent). */
|
||||
static struct option long_options[] =
|
||||
{
|
||||
{"help", no_argument, &print_help, 1},
|
||||
{"h", no_argument, &print_help, 1},
|
||||
{"flash", required_argument, 0, 'f'},
|
||||
{"f", required_argument, 0, 'f'},
|
||||
{"init-file", required_argument, 0, 'i'},
|
||||
{"i", required_argument, 0, 'i'},
|
||||
{"reset", no_argument, &reset, 1},
|
||||
{"r", no_argument, &reset, 1},
|
||||
{"check", no_argument, &check, 1},
|
||||
{"c", no_argument, &check, 1},
|
||||
{"erase", no_argument, &erase, 1},
|
||||
{"e", no_argument, &erase, 1},
|
||||
{"blankck", no_argument, &blankck, 1},
|
||||
{"b", no_argument, &blankck, 1},
|
||||
{"load", no_argument, &load, 1},
|
||||
{"l", no_argument, &load, 1},
|
||||
{"go", optional_argument, NULL, 'g'},
|
||||
{"g", no_argument, &run, 1},
|
||||
{"mbar", required_argument, NULL, 'M'},
|
||||
{"M", required_argument, NULL, 'M'},
|
||||
{"script", no_argument, &script, 1},
|
||||
{"s", no_argument, &script, 1},
|
||||
{"bdm-delay", required_argument, 0, 'd'},
|
||||
{"d", required_argument, 0, 'd'},
|
||||
{"bdm-device", required_argument, 0, 'D'},
|
||||
{"D", required_argument, 0, 'D'},
|
||||
{0, no_argument, 0, 0}
|
||||
};
|
||||
|
||||
while (1)
|
||||
{
|
||||
int option_index;
|
||||
|
||||
c = getopt_long_only (argc, argv, "",
|
||||
long_options, &option_index);
|
||||
if (c == EOF)
|
||||
break;
|
||||
|
||||
/* Long option that takes an argument. */
|
||||
if (c == 0 && long_options[option_index].flag == 0)
|
||||
c = long_options[option_index].val;
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case 0:
|
||||
/* Long option that just sets a flag. */
|
||||
break;
|
||||
case 'f':
|
||||
/* Setup flash region */
|
||||
if(flash_setup(optarg)<0)
|
||||
exit(1);
|
||||
break;
|
||||
case 'g':
|
||||
/* Run target from default or optional entry point */
|
||||
run=1;
|
||||
if (optarg) {
|
||||
if (entry_name) free (entry_name);
|
||||
entry_name = strdup (optarg);
|
||||
}
|
||||
break;
|
||||
case 'M':
|
||||
/* Set MBAR register */
|
||||
mbar_val=strtoul(optarg,&p,0);
|
||||
set_mbar_fl=1;
|
||||
if(optarg==p){
|
||||
fprintf(stderr,"%s: bad numeric format for MBAR\n",argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
case 'D':
|
||||
if (bdm_dev_name)
|
||||
free (bdm_dev_name);
|
||||
bdm_dev_name = strdup (optarg);
|
||||
break;
|
||||
case 'i':
|
||||
/* Init File */
|
||||
if(initname)
|
||||
free(initname);
|
||||
initname = strdup (optarg);
|
||||
break;
|
||||
case 'd':
|
||||
/* BDM driver delay */
|
||||
bdm_delay=strtol(optarg,&p,0);
|
||||
if(optarg==p){
|
||||
fprintf(stderr,"%s: bad numeric format for BDM delay\n",argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
case '?':
|
||||
fprintf(stderr,
|
||||
"Use `%s --help' for a complete list of options.\n",
|
||||
argv[0]);
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(print_help)
|
||||
{
|
||||
printf ("Usage bdm-load [OPTIONS] file1 ...\n"
|
||||
"\t-h --help - this help information!\n"
|
||||
"\t-i --init-file=FILE - object file to initialize processor\n"
|
||||
"\t-r --reset - reset target CPU before other operations\n"
|
||||
"\t-c --check - check flash setup (needed for auto)\n"
|
||||
"\t-e --erase - erase flash\n"
|
||||
"\t-b --blankck - blank check of flash\n"
|
||||
"\t-l --load - download listed filenames\n"
|
||||
"\t --go[=address] - run target CPU from entry address\n"
|
||||
"\t-M --mbar=val - setup 68360 MBAR register\n"
|
||||
"\t-s --script - do actions and return\n"
|
||||
"\t-d --bdm-delay=d - sets BDM driver speed/delay\n"
|
||||
"\t-D --bdm-device - sets BDM device file\n"
|
||||
"\t-f --flash=TYPE@ADR - select flash\n"
|
||||
"For flash TYPE@ADR can be\n"
|
||||
" {<TYPE>|auto}[@{csboot|cs<x>|<start>{+<size>|-<end>}}]\n"
|
||||
"Examples\n"
|
||||
" auto@csboot amd29f400@0x800000-0x87ffff auto@0+0x80000\n"
|
||||
"If auto type or cs address is used, check must be\n"
|
||||
"specified to take effect.\n"
|
||||
"Known flash types/algorithms :\n");
|
||||
for(i=0;flash_alg_infos[i]!=NULL;i++)
|
||||
printf(" %s",flash_alg_infos[i]->alg_name);
|
||||
printf("\n\n");
|
||||
exit (0);
|
||||
}
|
||||
|
||||
while(optind<argc)
|
||||
str_list_add(&files2load,strdup(argv[optind++]));
|
||||
|
||||
#ifdef DEBUG_MESSAGES
|
||||
printf ("Init file is: %s\n", initname);
|
||||
for(i=0;i<files2load.count;i++){
|
||||
printf ("Object file : %s\n", files2load.items[i]);
|
||||
}
|
||||
printf ("Actions to do%s%s%s%s%s\n", (reset) ? " Reset" : "",
|
||||
(check) ? " Check" : "", (erase) ? " Erase" : "",
|
||||
(blankck) ? " Blankck" : "", (load) ? " Load" : "");
|
||||
#endif
|
||||
|
||||
|
||||
/* Connect to target */
|
||||
if((ret=bdmlib_open (bdm_dev_name)) != BDM_NO_ERROR) {
|
||||
printf("%s: Open \"%s\" reports %s\n",
|
||||
argv[0],bdm_dev_name,bdmlib_geterror_str(ret));
|
||||
exit(1);
|
||||
}
|
||||
if((ret=bdmlib_setioctl (BDM_SPEED, bdm_delay)) != BDM_NO_ERROR) {
|
||||
printf("%s: Set bdm_delay failed with error %s\n",
|
||||
argv[0],bdmlib_geterror_str(ret));
|
||||
exit(1);
|
||||
}
|
||||
hashmark = 1;
|
||||
if(set_mbar_fl) {
|
||||
printf ("MBAR setup to %08lX\n",mbar_val);
|
||||
if(bdmlib_set_mbar(mbar_val) != BDM_NO_ERROR) {
|
||||
printf("%s: MBAR setup failed with error %s\n",
|
||||
argv[0],bdmlib_geterror_str(ret));
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
if(files2load.count>0)
|
||||
bdmlib_do_load_macro (files2load.items[0], BEGIN_MACRO);
|
||||
|
||||
done = cmd = 0;
|
||||
|
||||
do
|
||||
{
|
||||
error = 0;
|
||||
if (reset)
|
||||
{
|
||||
/* bdmlib_init(); */
|
||||
if(bdmlib_reset()<0)
|
||||
{
|
||||
printf ("Reset Failed\n");
|
||||
error=4;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(cpu_stat(NULL)<0)
|
||||
{
|
||||
printf ("CPU Stat Failed\n");
|
||||
error=4;
|
||||
}
|
||||
else
|
||||
{
|
||||
u_int32_t rpc;
|
||||
reset = 0;
|
||||
if(entry_pt==0)
|
||||
{
|
||||
cpu_get_rpc (&rpc);
|
||||
entry_pt=rpc;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (check && !error)
|
||||
{
|
||||
if(flash_check(NULL,0)<0)
|
||||
{
|
||||
printf ("Flash Check Failed\n");
|
||||
error=3;
|
||||
}
|
||||
else
|
||||
check = 0;
|
||||
}
|
||||
|
||||
if (erase && !error)
|
||||
{
|
||||
printf ("Erasing Flash...");
|
||||
fflush (stdout);
|
||||
if (flash_erase() >= 0)
|
||||
{
|
||||
printf ("done.\n");
|
||||
erase = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("Erase Failed\n");
|
||||
error = 2;
|
||||
}
|
||||
}
|
||||
|
||||
if (blankck && !error)
|
||||
{
|
||||
int res;
|
||||
printf ("Flash blank check ...\n");
|
||||
res=flash_blankck();
|
||||
if(!res){
|
||||
printf("Flash blank check OK\n");
|
||||
blankck = 0;
|
||||
}else{
|
||||
error = 5;
|
||||
if(res<0) printf("Flash blank check FAILED\n");
|
||||
else printf("Flash is NOT erased\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (load && !error)
|
||||
{
|
||||
bdmlib_load_use_lma = 1;
|
||||
for(i=0;i<files2load.count;i++){
|
||||
printf("Loading file : %s\n",files2load.items[i]);
|
||||
fflush(stdout);
|
||||
if((ret=bdmlib_load(files2load.items[i], entry_name, &entry_pt))<0)
|
||||
{
|
||||
printf ("Load Failed %d\n", ret);
|
||||
error = 1; //break;
|
||||
}
|
||||
}
|
||||
if(!error) load = 0;
|
||||
bdmlib_load_use_lma = 0;
|
||||
}
|
||||
|
||||
if (run && !error)
|
||||
{
|
||||
printf ("starting at 0x%lx\n", entry_pt);
|
||||
bdmlib_set_sys_reg (BDM_REG_RPC, entry_pt);
|
||||
bdmlib_go ();
|
||||
run=0;
|
||||
}
|
||||
|
||||
if(script)
|
||||
exit(0);
|
||||
|
||||
printf ("bdm-load %d> ", ++cmd);
|
||||
fgets (buf, 250, stdin);
|
||||
|
||||
if (!strncmp (buf, "run", 3))
|
||||
{
|
||||
run = 1;
|
||||
}
|
||||
|
||||
if (!strncmp (buf, "reset", 5))
|
||||
{
|
||||
reset = 1;
|
||||
}
|
||||
|
||||
if (!strncmp (buf, "erase", 5))
|
||||
erase = 1;
|
||||
|
||||
if (!strncmp (buf, "blankck", 5))
|
||||
blankck = 1;
|
||||
|
||||
if (!strncmp (buf, "load", 4))
|
||||
{
|
||||
load = 1;
|
||||
if ((strlen (buf) > 5))
|
||||
{
|
||||
str_list_clear(&files2load);
|
||||
str_list_add(&files2load,strdup(&buf[5]));
|
||||
}
|
||||
}
|
||||
|
||||
if (!strncmp (buf, "exit", 4) || !strncmp (buf, "quit", 4))
|
||||
done = 1;
|
||||
|
||||
if (!strncmp (buf, "dump", 4))
|
||||
mem_dump (buf + 4);
|
||||
|
||||
if (!strncmp (buf, "modify", 3))
|
||||
mem_modify (buf + 3);
|
||||
|
||||
if (!strncmp (buf, "stat", 4))
|
||||
cpu_stat (buf + 4);
|
||||
|
||||
if (!strncmp (buf, "check", 5))
|
||||
flash_check (buf + 5, 0);
|
||||
|
||||
if (!strncmp (buf, "autoset", 5))
|
||||
flash_check (buf + 5, 0xff);
|
||||
|
||||
if (!strncmp (buf, "stop", 5))
|
||||
{
|
||||
bdmlib_ioctl(BDM_STOP_CHIP);
|
||||
reset=check=erase=blankck=load=run=0;
|
||||
}
|
||||
|
||||
if (!strncmp (buf, "make", 4))
|
||||
system (buf);
|
||||
|
||||
if (!strncmp (buf, "help", 4) || !strncmp (buf, "?", 1))
|
||||
{
|
||||
printf("Next commands are accepted :\n"\
|
||||
" run - enable full speed ran of target CPU\n"\
|
||||
" stop - stop target CPU\n"\
|
||||
" reset - reset target\n"\
|
||||
" erase - erase all configured FLASH chips\n"\
|
||||
" blankck - check blank state of chips\n"\
|
||||
" load - loand all object files specified\n"\
|
||||
" at command line to RAM or FLASH\n"\
|
||||
" using VMA addresses, name of file to\n"\
|
||||
" can be optionaly specified after \"load\"\n"\
|
||||
" dump <from> <len> - dump target memory\n"\
|
||||
" modify <from> <byte> ... - modify target memory (even flash)\n"\
|
||||
" state - print target status\n"\
|
||||
" check - check presence of configured chips\n"\
|
||||
" autoset - set FLASH chip types from their IDs\n"\
|
||||
" make <par> - call make command in current directory\n"\
|
||||
" quit - leave loader\n"\
|
||||
);
|
||||
}
|
||||
}
|
||||
while (!done);
|
||||
|
||||
str_list_clear(&files2load);
|
||||
|
||||
exit (0);
|
||||
}
|
||||
25
m683xx/bdm-load/bdm-load.lsm
Normal file
25
m683xx/bdm-load/bdm-load.lsm
Normal file
@@ -0,0 +1,25 @@
|
||||
Begin4
|
||||
Title: bdm-load
|
||||
Version: 030815
|
||||
Entered-date: 2003-08-15
|
||||
Description: Flash writer utility for 683xx target systems through
|
||||
Background Debug Mode interface for Motorola CPU32 and Linux
|
||||
Both Public Domain and ICD interfaces are supported.
|
||||
Code contains first experimental tests of GPLed TPU debugger
|
||||
project.
|
||||
* More info about related software and BDM driver at
|
||||
http://cmp.felk.cvut.cz/~pisa
|
||||
http://cmp.felk.cvut.cz/~pisa/m683xx/bdm_driver.html
|
||||
Keywords: debugger GDB m68k 68332 683xx BDM flash embedded TPU
|
||||
Author: jeff@uclinux.org (D.Jeff Dionne)
|
||||
adennison@swin.edu.au (Andrew Dennison)
|
||||
pisa@cvlinux.felk.cvut.cz (Pavel Pisa)
|
||||
Maintained-by: pisa@cvlinux.felk.cvut.cz (Pavel Pisa)
|
||||
Primary-site: metalab.unc.edu /pub/Linux/devel/debuggers
|
||||
210 kB bdm-load-030519.tar.gz
|
||||
Alternate-site: ftp.cygnus.com /pub/embedded
|
||||
210 kB bdm-load-030519.tar.gz
|
||||
Original-site: freeware.aus.sps.mot.com
|
||||
Platforms: Linux 2.0.xx, 2.2.yy, 2.4.zz ( last tested 2.5.69 )
|
||||
Copying-policy: GPL
|
||||
End
|
||||
115
m683xx/bdm-load/bdm.h
Normal file
115
m683xx/bdm-load/bdm.h
Normal file
@@ -0,0 +1,115 @@
|
||||
#ifndef LINUX_BDM_H
|
||||
#define LINUX_BDM_H
|
||||
/*
|
||||
* $Id: bdm.h,v 1.1 2003/06/04 01:31:32 ppisa Exp $
|
||||
*
|
||||
* Linux Device Driver for Public Domain BDM Interface
|
||||
* based on the PD driver package by Scott Howard, Feb 93
|
||||
* ported to Linux by M.Schraut
|
||||
* tested for kernel version 1.2.4
|
||||
* (C) 1995 Technische Universitaet Muenchen, Lehrstuhl fuer Prozessrechner
|
||||
|
||||
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, 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; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
#define BDM_MAJOR_NUMBER 53
|
||||
|
||||
/* error codes */
|
||||
#define BDM_FAULT_UNKNOWN -610 /*Error-definitions*/
|
||||
#define BDM_FAULT_POWER -611
|
||||
#define BDM_FAULT_CABLE -612
|
||||
#define BDM_FAULT_RESPONSE -613 /*NOT Ready */
|
||||
#define BDM_FAULT_RESET -614
|
||||
#define BDM_FAULT_PORT -615
|
||||
#define BDM_FAULT_BERR -616
|
||||
#define BDM_FAULT_NVC -617 /*no valid command */
|
||||
|
||||
/* Debug Levels */
|
||||
#define BDM_DEBUG_NONE 0
|
||||
#define BDM_DEBUG_SOME 1
|
||||
#define BDM_DEBUG_ALL 2
|
||||
|
||||
/* supported ioctls */
|
||||
#define BDM_INIT 0 /* no argument */
|
||||
#define BDM_DEINIT 1 /* no argument */
|
||||
#define BDM_RESET_CHIP 2 /* no argument */
|
||||
#define BDM_RESTART_CHIP 3 /* no argument */
|
||||
#define BDM_STOP_CHIP 4 /* no argument */
|
||||
#define BDM_STEP_CHIP 5 /* no argument */
|
||||
#define BDM_GET_STATUS 6 /* no argument */
|
||||
#define BDM_SPEED 7 /* arg = speed */
|
||||
#define BDM_RELEASE_CHIP 8 /* no argument */
|
||||
#define BDM_DEBUG_LEVEL 9 /* arg = level */
|
||||
#define BDM_GET_VERSION 10 /* arg = &int */
|
||||
#define BDM_SENSECABLE 11 /* arg =on/off */
|
||||
|
||||
#define BDM_NORETURN 0 /* no error, no ret value */
|
||||
/* functional bits of ioctl BDM_GET_STATUS */
|
||||
#define BDM_TARGETRESET (1<<0) /* Target reset */
|
||||
#define BDM_TARGETSTOPPED (1<<2) /* Target (was already) stopped */
|
||||
#define BDM_TARGETPOWER (1<<3) /* Power failed */
|
||||
#define BDM_TARGETNC (1<<4) /* Target not Connected */
|
||||
|
||||
/* command codes for bdm interface */
|
||||
#define BDM_RREG_CMD 0x2180
|
||||
#define BDM_WREG_CMD 0x2080
|
||||
#define BDM_RSREG_CMD 0x2580
|
||||
#define BDM_WSREG_CMD 0x2480
|
||||
#define BDM_READ_CMD 0x1900
|
||||
#define BDM_WRITE_CMD 0x1800
|
||||
#define BDM_DUMP_CMD 0x1d00
|
||||
#define BDM_FILL_CMD 0x1c00
|
||||
#define BDM_GO_CMD 0x0c00
|
||||
#define BDM_CALL_CMD 0x0800
|
||||
#define BDM_RST_CMD 0x0400
|
||||
#define BDM_NOP_CMD 0x0000
|
||||
|
||||
/* system register for RSREG/WSREG */
|
||||
#define BDM_REG_RPC 0x0
|
||||
#define BDM_REG_PCC 0x1
|
||||
#define BDM_REG_SR 0xb
|
||||
#define BDM_REG_USP 0xc
|
||||
#define BDM_REG_SSP 0xd
|
||||
#define BDM_REG_SFC 0xe
|
||||
#define BDM_REG_DFC 0xf
|
||||
#define BDM_REG_ATEMP 0x8
|
||||
#define BDM_REG_FAR 0x9
|
||||
#define BDM_REG_VBR 0xa
|
||||
|
||||
/* system register for RREG/WREG */
|
||||
#define BDM_REG_D0 0x0
|
||||
#define BDM_REG_D1 0x1
|
||||
#define BDM_REG_D2 0x2
|
||||
#define BDM_REG_D3 0x3
|
||||
#define BDM_REG_D4 0x4
|
||||
#define BDM_REG_D5 0x5
|
||||
#define BDM_REG_D6 0x6
|
||||
#define BDM_REG_D7 0x7
|
||||
#define BDM_REG_A0 0x8
|
||||
#define BDM_REG_A1 0x9
|
||||
#define BDM_REG_A2 0xa
|
||||
#define BDM_REG_A3 0xb
|
||||
#define BDM_REG_A4 0xc
|
||||
#define BDM_REG_A5 0xd
|
||||
#define BDM_REG_A6 0xe
|
||||
#define BDM_REG_A7 0xf
|
||||
|
||||
/* op size for READ/WRITE */
|
||||
#define BDM_SIZE_BYTE 0x0000
|
||||
#define BDM_SIZE_WORD 0x0040
|
||||
#define BDM_SIZE_LONG 0x0080
|
||||
|
||||
#endif
|
||||
272
m683xx/bdm-load/bdm_test.c
Normal file
272
m683xx/bdm-load/bdm_test.c
Normal file
@@ -0,0 +1,272 @@
|
||||
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include "bdm.h"
|
||||
#include "bdmlib.h"
|
||||
|
||||
char* TestSW(int argc,char *argv[],char swch);
|
||||
|
||||
#define swap_l(x) (x>>24) | ((x>>8)&0xff00) | ((x<<8)&0xff0000) | ((x&0xff)<<24)
|
||||
|
||||
/* for BDMLIB to work */
|
||||
char hashmark;
|
||||
int bdm_autoreset;
|
||||
int bdm_ttcu;
|
||||
|
||||
int bdm_step_chip()
|
||||
{
|
||||
int ret;
|
||||
u_int32_t rpc;
|
||||
|
||||
if (!bdmlib_isopen())
|
||||
return BDM_ERR_NOT_OPEN;
|
||||
|
||||
if (!(bdmlib_getstatus()&BDM_TARGETSTOPPED))
|
||||
if((ret=bdmlib_ioctl(BDM_STOP_CHIP)<0))
|
||||
{return ret;};
|
||||
|
||||
if((ret=bdmlib_get_sys_reg(BDM_REG_RPC, &rpc))<0) return ret;
|
||||
printf("RPC=%x\n",swap_l(rpc));
|
||||
ret=bdmlib_ioctl(BDM_STEP_CHIP);
|
||||
if((ret=bdmlib_get_sys_reg(BDM_REG_RPC, &rpc))<0) return ret;
|
||||
printf("RPC=%x\n",swap_l(rpc));
|
||||
return ret;
|
||||
}
|
||||
|
||||
int bdm_show_regs(void)
|
||||
{
|
||||
u_int reg;
|
||||
if (!bdmlib_isopen())
|
||||
return BDM_ERR_NOT_OPEN;
|
||||
|
||||
bdmlib_get_reg(BDM_REG_D0, ®);
|
||||
return 0;
|
||||
};
|
||||
|
||||
|
||||
int rd_test(void)
|
||||
{
|
||||
u_int16_t val;
|
||||
caddr_t adr=(caddr_t)0xFFAA;
|
||||
int counter=0;
|
||||
|
||||
if (!bdmlib_isopen())
|
||||
return BDM_ERR_NOT_OPEN;
|
||||
while(1){
|
||||
if(bdmlib_read_var(adr,BDM_SIZE_WORD,&val)<0)
|
||||
goto mem_op_error;
|
||||
//usleep(1);
|
||||
if(counter++>=10000){
|
||||
printf(".");
|
||||
fflush(stdout);
|
||||
counter=0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
mem_op_error:
|
||||
printf("Memory read error\n");
|
||||
return -1;
|
||||
};
|
||||
|
||||
int wr_test(void)
|
||||
{
|
||||
u_int16_t val=0xAAAA;
|
||||
caddr_t adr=(caddr_t)0xFFAA;
|
||||
int counter=0;
|
||||
|
||||
if (!bdmlib_isopen())
|
||||
return BDM_ERR_NOT_OPEN;
|
||||
while(1){
|
||||
if(bdmlib_write_var(adr,BDM_SIZE_WORD,val)<0)
|
||||
goto mem_op_error;
|
||||
//usleep(1);
|
||||
if(counter++>=10000){
|
||||
printf(".");
|
||||
fflush(stdout);
|
||||
counter=0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
mem_op_error:
|
||||
printf("Memory write error\n");
|
||||
return -1;
|
||||
};
|
||||
|
||||
|
||||
int step_test(void)
|
||||
{
|
||||
int counter=0;
|
||||
|
||||
if (!bdmlib_isopen())
|
||||
return BDM_ERR_NOT_OPEN;
|
||||
while(1){
|
||||
if(bdmlib_ioctl(BDM_STEP_CHIP)<0)
|
||||
goto step_op_error;
|
||||
usleep(1);
|
||||
if(counter++>=10000){
|
||||
printf(".");
|
||||
fflush(stdout);
|
||||
counter=0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
step_op_error:
|
||||
printf("Stepping error\n");
|
||||
return -1;
|
||||
};
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int quit_fl=0;
|
||||
int ret;
|
||||
char c;
|
||||
char *p;
|
||||
char file_name[100]="";
|
||||
char bdm_dev_name[100]="/dev/bdm";
|
||||
unsigned long entry_pt=0;
|
||||
|
||||
bdmlib_setdebug(1);
|
||||
if((p=TestSW(argc,argv,'D'))!=NULL)
|
||||
strncpy(bdm_dev_name,p,sizeof(bdm_dev_name));
|
||||
if((ret=bdmlib_open(bdm_dev_name))<0)
|
||||
{ printf("bdmlib_open : %s\n",bdmlib_geterror_str(ret)); return 1; };
|
||||
bdmlib_setioctl(BDM_SPEED,0);
|
||||
|
||||
if((p=TestSW(argc,argv,'F'))!=NULL)
|
||||
{
|
||||
strncpy(file_name,p,sizeof(file_name));
|
||||
bdmlib_setioctl(BDM_SPEED,100);
|
||||
bdmlib_reset();
|
||||
bdmlib_setioctl(BDM_SPEED,10);
|
||||
bdmlib_go();
|
||||
sleep(2);
|
||||
bdm_step_chip();
|
||||
ret=bdmlib_load(file_name, NULL, &entry_pt);
|
||||
if(ret<0) printf("bdmlib_load : %s\n",bdmlib_geterror_str(ret));
|
||||
bdmlib_set_sys_reg(BDM_REG_RPC, entry_pt);
|
||||
ret=bdmlib_go();
|
||||
};
|
||||
|
||||
do {
|
||||
c=getchar();
|
||||
|
||||
ret=bdmlib_getstatus();
|
||||
if(ret<0) printf("bdmlib_go : %s\n",bdmlib_geterror_str(ret));
|
||||
else {
|
||||
printf("MCU ");
|
||||
if(ret&BDM_TARGETRESET) printf("Reset ");
|
||||
if(ret&BDM_TARGETSTOPPED) printf("Stopped ");
|
||||
if(ret&BDM_TARGETPOWER) printf("NoPower ");
|
||||
if(ret&BDM_TARGETNC) printf("NoConnect ");
|
||||
printf("\n");
|
||||
};
|
||||
|
||||
c=toupper(c);
|
||||
|
||||
switch(c) {
|
||||
|
||||
case 'B':
|
||||
|
||||
case 'D':
|
||||
bdmlib_showpc();
|
||||
break;
|
||||
|
||||
case 'S':
|
||||
ret=bdm_step_chip();
|
||||
if(ret<0) printf("bdmlib_go : %s\n",bdmlib_geterror_str(ret));
|
||||
break;
|
||||
|
||||
case 'G':
|
||||
ret=bdmlib_go();
|
||||
if(ret<0) printf("bdmlib_go : %s\n",bdmlib_geterror_str(ret));
|
||||
break;
|
||||
|
||||
case 'R':
|
||||
bdmlib_setioctl(BDM_SPEED,100);
|
||||
ret=bdmlib_reset();
|
||||
bdmlib_setioctl(BDM_SPEED,0);
|
||||
if(ret<0) printf("bdmlib_reset : %s\n",bdmlib_geterror_str(ret));
|
||||
break;
|
||||
|
||||
case 'Q':
|
||||
quit_fl=1;
|
||||
break;
|
||||
|
||||
case 'X':
|
||||
wr_test();
|
||||
break;
|
||||
|
||||
case 'Y':
|
||||
rd_test();
|
||||
break;
|
||||
|
||||
case 'Z':
|
||||
step_test();
|
||||
break;
|
||||
|
||||
case 'L':
|
||||
printf("Enter file name : ");
|
||||
scanf("%s",file_name);
|
||||
printf("\n");
|
||||
ret=bdmlib_load(file_name, NULL, &entry_pt);
|
||||
if(ret<0) printf("bdmlib_load : %s\n",bdmlib_geterror_str(ret));
|
||||
else
|
||||
{printf("loaded OK, entrypoint %lx\n",entry_pt);
|
||||
if((ret=bdmlib_set_sys_reg(BDM_REG_RPC, entry_pt))<0)
|
||||
printf("set PC error : %s\n",bdmlib_geterror_str(ret));
|
||||
}
|
||||
break;
|
||||
|
||||
case '\n':
|
||||
break;
|
||||
|
||||
default:
|
||||
printf ("Help for BDM_TEST\n"
|
||||
"B: Begin Program Execution from Reset\n"
|
||||
"D: Dump Target MCU Registers\n"
|
||||
"H: Print This Help Summary\n"
|
||||
"L: Load S-Record or Object File into Target\n"
|
||||
"M: Memory Hex/ASCII Display\n"
|
||||
"R: Hardware Reset Target MCU\n"
|
||||
"S: Single Step Target MCU\n"
|
||||
"G: Go Full Speed Target MCU\n"
|
||||
"Q: Quit back to DOS\n");
|
||||
};
|
||||
|
||||
} while(!quit_fl);
|
||||
|
||||
bdmlib_close(1);
|
||||
|
||||
return(0);
|
||||
|
||||
};
|
||||
|
||||
|
||||
char* TestSW(int argc,char *argv[],char swch)
|
||||
{
|
||||
int i;
|
||||
char *p;
|
||||
for(i=1;i<argc;i++)
|
||||
if((argv[i][0]=='-')&&(toupper(argv[i][1])==swch))
|
||||
{
|
||||
p=argv[i]+2;
|
||||
while(((*p==' ')||(*p=='\t'))&&(*p)) p++;
|
||||
if((!*p)&&(i<argc)) if(argv[++i][0]!='-')
|
||||
{
|
||||
p=argv[i];
|
||||
while(((*p==' ')||(*p=='\t'))&&(*p)) p++;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
945
m683xx/bdm-load/bdmflash.c
Normal file
945
m683xx/bdm-load/bdmflash.c
Normal file
@@ -0,0 +1,945 @@
|
||||
/*******************************************************************
|
||||
Flash programming algorithms for use with BDM flash utility
|
||||
|
||||
bdmflash.c - test driver implementation
|
||||
|
||||
(C) Copyright 2000 by Pavel Pisa <pisa@waltz.felk.cvut.cz>
|
||||
|
||||
This souce is distributed under the Gnu General Public Licence.
|
||||
See file COPYING for details.
|
||||
|
||||
Source could be used under any other license for embeded systems,
|
||||
but in such case enhancements must be sent to original author.
|
||||
If some of contributors does not agree with above two lines,
|
||||
he can delete them and only GPL will apply.
|
||||
*******************************************************************/
|
||||
/*
|
||||
Revision history
|
||||
|
||||
2001-01-16 Added experimental support of single 8 bit flash memory
|
||||
based on Avi Cohen Stuart <astuart@baan.nl> changes
|
||||
|
||||
2001-07-10 Added support for amd_29f010 with x8x2 configuration
|
||||
based on John S. Gwynne <jsg@jsgpc.mrcday.com> changes
|
||||
Trying to solve x8x2 race condition with shortest
|
||||
possible code - needs more tests
|
||||
|
||||
2001-08-30 Added alg-info for at_49f040 with x8x2 configuration
|
||||
x8x2 configuration needs more testing, may be broken
|
||||
|
||||
2003-05-19 Added initial support for x32 memory configurations.
|
||||
The x16x2 and x8x4 should work as well. Changes were
|
||||
motivated by Andrei Smirnov <andrei.s@myrealbox.com>
|
||||
code, but his small update results in deeper code redesign.
|
||||
This could enable to support page writes for modern versions
|
||||
of FLASH memories in future.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include "bdm.h"
|
||||
#include "bdmlib.h"
|
||||
#include "bdmflash.h"
|
||||
|
||||
/* predefined flash algorithms metods */
|
||||
|
||||
int bdmflash_check_id_x32(const flash_alg_info_t *alg, void *addr, flash_d_t retid[2]);
|
||||
int bdmflash_prog_x32(const flash_alg_info_t *alg, void *addr, const void *data, long count);
|
||||
int bdmflash_erase_x32(const flash_alg_info_t *alg, void *addr, long size);
|
||||
|
||||
int bdmflash_check_id_x16(const flash_alg_info_t *alg, void *addr, flash_d_t retid[2]);
|
||||
int bdmflash_prog_x16(const flash_alg_info_t *alg, void *addr, const void *data, long count);
|
||||
int bdmflash_erase_x16(const flash_alg_info_t *alg, void *addr, long size);
|
||||
|
||||
int bdmflash_check_id_x8(const flash_alg_info_t *alg, void *addr, flash_d_t retid[2]);
|
||||
int bdmflash_prog_x8(const flash_alg_info_t *alg, void *addr, const void *data, long count);
|
||||
int bdmflash_erase_x8(const flash_alg_info_t *alg, void *addr, long size);
|
||||
|
||||
/* predefined flash types */
|
||||
|
||||
flash_alg_info_t amd_29f800_x16={
|
||||
check_id: bdmflash_check_id_x16,
|
||||
prog: bdmflash_prog_x16,
|
||||
erase: bdmflash_erase_x16,
|
||||
addr_mask: 0xfffff, /* 1MB */
|
||||
reg1_addr: 0x555*2,
|
||||
reg2_addr: 0x2aa*2,
|
||||
sec_size: 0x10000,
|
||||
width: FLASH_ALG_BITS_x16,
|
||||
cmd_unlock1:0xaa, /* reg1 */
|
||||
cmd_unlock2:0x55, /* reg2 */
|
||||
cmd_rdid: 0x90, /* reg1 */
|
||||
cmd_prog: 0xa0, /* reg1 */
|
||||
cmd_erase: 0x80, /* reg1 */
|
||||
cmd_reset: 0xf0, /* any */
|
||||
erase_all: 0x10, /* reg1 */
|
||||
erase_sec: 0x30, /* sector */
|
||||
fault_bit: 0x20,
|
||||
manid: 1,
|
||||
devid: 0x2258,
|
||||
alg_name: "amd29f800"
|
||||
};
|
||||
|
||||
flash_alg_info_t amd_29f400_x16={
|
||||
check_id: bdmflash_check_id_x16,
|
||||
prog: bdmflash_prog_x16,
|
||||
erase: bdmflash_erase_x16,
|
||||
addr_mask: 0x7ffff, /* 0.5MB */
|
||||
reg1_addr: 0x555*2,
|
||||
reg2_addr: 0x2aa*2,
|
||||
sec_size: 0x10000,
|
||||
width: FLASH_ALG_BITS_x16,
|
||||
cmd_unlock1:0xaa, /* reg1 */
|
||||
cmd_unlock2:0x55, /* reg2 */
|
||||
cmd_rdid: 0x90, /* reg1 */
|
||||
cmd_prog: 0xa0, /* reg1 */
|
||||
cmd_erase: 0x80, /* reg1 */
|
||||
cmd_reset: 0xf0, /* any */
|
||||
erase_all: 0x10, /* reg1 */
|
||||
erase_sec: 0x30, /* sector */
|
||||
fault_bit: 0x20,
|
||||
manid: 1,
|
||||
devid: 0x22ab,
|
||||
alg_name: "amd29f400"
|
||||
};
|
||||
|
||||
flash_alg_info_t amd_29f040_x8={
|
||||
check_id: bdmflash_check_id_x8,
|
||||
prog: bdmflash_prog_x8,
|
||||
erase: bdmflash_erase_x8,
|
||||
addr_mask: 0x7ffff, /* 0.5MB */
|
||||
reg1_addr: 0x555,
|
||||
reg2_addr: 0x2aa,
|
||||
sec_size: 0x10000,
|
||||
width: FLASH_ALG_BITS_x8,
|
||||
cmd_unlock1:0xaa, /* reg1 */
|
||||
cmd_unlock2:0x55, /* reg2 */
|
||||
cmd_rdid: 0x90, /* reg1 */
|
||||
cmd_prog: 0xa0, /* reg1 */
|
||||
cmd_erase: 0x80, /* reg1 */
|
||||
cmd_reset: 0xf0, /* any */
|
||||
erase_all: 0x10, /* reg1 */
|
||||
erase_sec: 0x30, /* sector */
|
||||
fault_bit: 0x20,
|
||||
manid: 1,
|
||||
devid: 0xa4,
|
||||
alg_name: "amd29f040"
|
||||
};
|
||||
|
||||
flash_alg_info_t amd_29f010_x8x2={
|
||||
check_id: bdmflash_check_id_x16,
|
||||
prog: bdmflash_prog_x16,
|
||||
erase: bdmflash_erase_x16,
|
||||
addr_mask: 0x3ffff, /* 2x128kB = 256kB */
|
||||
reg1_addr: 0x5555*2,
|
||||
reg2_addr: 0x2aaa*2,
|
||||
sec_size: 0x10000,
|
||||
width: FLASH_ALG_BITS_x8x2,
|
||||
cmd_unlock1:0xaaaa, /* reg1 */
|
||||
cmd_unlock2:0x5555, /* reg2 */
|
||||
cmd_rdid: 0x9090, /* reg1 */
|
||||
cmd_prog: 0xa0a0, /* reg1 */
|
||||
cmd_erase: 0x8080, /* reg1 */
|
||||
cmd_reset: 0xf0f0, /* any */
|
||||
erase_all: 0x1010, /* reg1 */
|
||||
erase_sec: 0x3030, /* sector */
|
||||
fault_bit: 0x2020,
|
||||
manid: 0x0101,
|
||||
devid: 0x2020,
|
||||
alg_name: "amd29f010x2"
|
||||
};
|
||||
|
||||
flash_alg_info_t at_49f040_x8x2={
|
||||
check_id: bdmflash_check_id_x16,
|
||||
prog: bdmflash_prog_x16,
|
||||
erase: bdmflash_erase_x16,
|
||||
addr_mask: 0xfffff, /* 2x0.5MB = 1MB */
|
||||
reg1_addr: 0x5555*2,
|
||||
reg2_addr: 0x2aaa*2,
|
||||
sec_size: 0x10000,
|
||||
width: FLASH_ALG_BITS_x8x2,
|
||||
cmd_unlock1:0xaaaa, /* reg1 */
|
||||
cmd_unlock2:0x5555, /* reg2 */
|
||||
cmd_rdid: 0x9090, /* reg1 */
|
||||
cmd_prog: 0xa0a0, /* reg1 */
|
||||
cmd_erase: 0x8080, /* reg1 */
|
||||
cmd_reset: 0xf0f0, /* any */
|
||||
erase_all: 0x1010, /* reg1 */
|
||||
erase_sec: 0x3030, /* sector */
|
||||
fault_bit: 0x2020,
|
||||
manid: 0x1F1F,
|
||||
devid: 0x1313,
|
||||
alg_name: "at49f040x2"
|
||||
};
|
||||
|
||||
#ifdef WITH_TARGET_BUS32
|
||||
|
||||
flash_alg_info_t amd_29f080_x8x4={
|
||||
check_id: bdmflash_check_id_x32,
|
||||
prog: bdmflash_prog_x32,
|
||||
erase: bdmflash_erase_x32,
|
||||
addr_mask: 0x3fffff, /* 4x1MB */
|
||||
reg1_addr: 0x555*4,
|
||||
reg2_addr: 0x2aa*4,
|
||||
sec_size: 0x10000,
|
||||
width: FLASH_ALG_BITS_x8x4,
|
||||
cmd_unlock1:0xaaaaaaaa, /* reg1 */
|
||||
cmd_unlock2:0x55555555, /* reg2 */
|
||||
cmd_rdid: 0x90909090, /* reg1 */
|
||||
cmd_prog: 0xa0a0a0a0, /* reg1 */
|
||||
cmd_erase: 0x80808080, /* reg1 */
|
||||
cmd_reset: 0xf0f0f0f0, /* any */
|
||||
erase_all: 0x10101010, /* reg1 */
|
||||
erase_sec: 0x30303030, /* sector */
|
||||
fault_bit: 0x20202020,
|
||||
manid: 0x01010101,
|
||||
devid: 0xd5d5d5d5,
|
||||
alg_name: "amd29f080x4"
|
||||
};
|
||||
|
||||
#endif /* WITH_TARGET_BUS32 */
|
||||
|
||||
/* please keep sorted by flash sizes, smallest first */
|
||||
flash_alg_info_t *flash_alg_infos_def[]={
|
||||
&amd_29f010_x8x2, /* 256 kB */
|
||||
&amd_29f040_x8, /* 512 kB */
|
||||
&amd_29f400_x16, /* 512 kB */
|
||||
&amd_29f800_x16, /* 1 MB */
|
||||
&at_49f040_x8x2, /* 1 MB */
|
||||
#ifdef WITH_TARGET_BUS32
|
||||
&amd_29f080_x8x4, /* 4 MB */
|
||||
#endif /* WITH_TARGET_BUS32 */
|
||||
NULL
|
||||
};
|
||||
|
||||
flash_alg_info_t **flash_alg_infos=flash_alg_infos_def;
|
||||
|
||||
#if 0
|
||||
#define FLASH_WR32(adr,val) (*(volatile u_int32_t*)(adr)=(val))
|
||||
#define FLASH_RD32(adr) (*(volatile u_int32_t*)(adr))
|
||||
#define FLASH_WR16(adr,val) (*(volatile u_int16_t*)(adr)=(val))
|
||||
#define FLASH_RD16(adr) (*(volatile u_int16_t*)(adr))
|
||||
#define FLASH_WR8(adr,val) (*(volatile u_int8_t*)(adr)=(val))
|
||||
#define FLASH_RD8(adr) (*(volatile u_int8_t*)(adr))
|
||||
#else
|
||||
#define FLASH_WR32(adr,val) \
|
||||
({ \
|
||||
if(bdmlib_write_var(adr,BDM_SIZE_LONG,val)<0) \
|
||||
goto mem_op_error; \
|
||||
val; \
|
||||
})
|
||||
#define FLASH_RD32(adr) \
|
||||
({ u_int32_t temp_val; \
|
||||
if(bdmlib_read_var(adr,BDM_SIZE_LONG,&temp_val)<0) \
|
||||
goto mem_op_error; \
|
||||
temp_val; \
|
||||
})
|
||||
#define FLASH_WR16(adr,val) \
|
||||
({ \
|
||||
if(bdmlib_write_var(adr,BDM_SIZE_WORD,val)<0) \
|
||||
goto mem_op_error; \
|
||||
val; \
|
||||
})
|
||||
#define FLASH_RD16(adr) \
|
||||
({ u_int16_t temp_val; \
|
||||
if(bdmlib_read_var(adr,BDM_SIZE_WORD,&temp_val)<0) \
|
||||
goto mem_op_error; \
|
||||
temp_val; \
|
||||
})
|
||||
#define FLASH_WR8(adr,val) \
|
||||
({ \
|
||||
if(bdmlib_write_var(adr,BDM_SIZE_BYTE,val)<0) \
|
||||
goto mem_op_error; \
|
||||
val; \
|
||||
})
|
||||
#define FLASH_RD8(adr) \
|
||||
({ u_int8_t temp_val; \
|
||||
if(bdmlib_read_var(adr,BDM_SIZE_BYTE,&temp_val)<0) \
|
||||
goto mem_op_error; \
|
||||
temp_val; \
|
||||
})
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
static
|
||||
int bdmflash_prepval_x16(u_int16_t *pval, void *addr, const void *data, long count)
|
||||
{
|
||||
if(!((long)addr&1) && (count>=2)){
|
||||
*pval=(((u_char*)data)[0]<<8)|(((u_char*)data)[1]);
|
||||
return 2;
|
||||
}
|
||||
if(!count) return count;
|
||||
if(!((long)addr&1)){
|
||||
*pval=(((u_char*)data)[0]<<8) | FLASH_RD8((u_char*)addr+1);
|
||||
}else{
|
||||
*pval=(FLASH_RD8((u_char*)addr-1)<<8) | (((u_char*)data)[0]);
|
||||
}
|
||||
return 1;
|
||||
|
||||
mem_op_error:
|
||||
return -4;
|
||||
}
|
||||
|
||||
#ifdef WITH_TARGET_BUS32
|
||||
static
|
||||
int bdmflash_prepval_x32(u_int32_t *pval, void *addr, const void *data, long count)
|
||||
{
|
||||
int offs=(long)addr&3;
|
||||
int rest=4-offs;
|
||||
u_int32_t val=0;
|
||||
if(!offs && (count>=4)){
|
||||
*pval=((u_int32_t)((u_char*)data)[0]<<24)|((u_int32_t)((u_char*)data)[1]<<16)|
|
||||
(((u_char*)data)[2]<<8)|(((u_char*)data)[3]);
|
||||
return 4;
|
||||
}
|
||||
if(!count) return count;
|
||||
if(count>rest) count=rest;
|
||||
while(offs){
|
||||
val<<=8;
|
||||
val|=FLASH_RD8((u_char*)addr-offs);
|
||||
offs--;
|
||||
}
|
||||
while(offs<count){
|
||||
val<<=8;
|
||||
val|=((u_char*)data)[offs];
|
||||
offs++;
|
||||
}
|
||||
while(offs<rest){
|
||||
val<<=8;
|
||||
val|=FLASH_RD8((u_char*)addr+offs);
|
||||
offs++;
|
||||
}
|
||||
*pval=val;
|
||||
return count;
|
||||
|
||||
mem_op_error:
|
||||
return -4;
|
||||
}
|
||||
#endif /* WITH_TARGET_BUS32 */
|
||||
|
||||
/*******************************************************************/
|
||||
/* routines for 16 bit wide Intel or AMD flash or two interleaved
|
||||
8 bit flashes */
|
||||
|
||||
int bdmflash_check_id_x16(const flash_alg_info_t *alg, void *addr, flash_d_t retid[2])
|
||||
{
|
||||
int ret=0;
|
||||
u_int16_t devid, manid;
|
||||
caddr_t a=(caddr_t)((u_int32_t)addr&~alg->addr_mask);
|
||||
/* reset */
|
||||
FLASH_WR16(a,alg->cmd_reset);
|
||||
/* security sequence */
|
||||
FLASH_WR16(a+alg->reg1_addr,alg->cmd_unlock1);
|
||||
if(alg->cmd_unlock2)
|
||||
FLASH_WR16(a+alg->reg2_addr,alg->cmd_unlock2);
|
||||
/* read manufacturer ID */
|
||||
FLASH_WR16(a+alg->reg1_addr,alg->cmd_rdid);
|
||||
manid=FLASH_RD16(a+0);
|
||||
if(manid!=alg->manid) ret=-1;
|
||||
/* reset */
|
||||
FLASH_WR16(a,alg->cmd_reset);
|
||||
/* security sequence */
|
||||
FLASH_WR16(a+alg->reg1_addr,alg->cmd_unlock1);
|
||||
if(alg->cmd_unlock2)
|
||||
FLASH_WR16(a+alg->reg2_addr,alg->cmd_unlock2);
|
||||
/* read device ID */
|
||||
FLASH_WR16(a+alg->reg1_addr,alg->cmd_rdid);
|
||||
devid=FLASH_RD16(a+2);
|
||||
if(devid!=alg->devid) ret=-1;
|
||||
/* reset */
|
||||
FLASH_WR16(a,alg->cmd_reset);
|
||||
if(retid)
|
||||
{retid[0]=manid;retid[1]=devid;};
|
||||
return ret;
|
||||
|
||||
mem_op_error:
|
||||
return -5;
|
||||
}
|
||||
|
||||
int bdmflash_prog_x16(const flash_alg_info_t *alg, void *addr, const void *data, long count)
|
||||
{
|
||||
int ret;
|
||||
u_int16_t old,new,fault,val;
|
||||
caddr_t a=(caddr_t)((u_int32_t)addr&~alg->addr_mask);
|
||||
ret=bdmflash_prepval_x16(&val,addr,data,count);
|
||||
if(ret<=0)
|
||||
return ret;
|
||||
addr=(void*)((long)addr&~1l);
|
||||
/* check if FLASH needs programming */
|
||||
if(1){
|
||||
old=FLASH_RD16(addr);
|
||||
if(old==val) return ret;
|
||||
}
|
||||
/* security sequence */
|
||||
FLASH_WR16(a+alg->reg1_addr,alg->cmd_unlock1);
|
||||
if(alg->cmd_unlock2)
|
||||
FLASH_WR16(a+alg->reg2_addr,alg->cmd_unlock2);
|
||||
/* program command */
|
||||
FLASH_WR16(a+alg->reg1_addr,alg->cmd_prog);
|
||||
FLASH_WR16(addr,val);
|
||||
/* wait for result */
|
||||
old=FLASH_RD16(addr);
|
||||
while((new=FLASH_RD16(addr))!=old){
|
||||
if((fault=old&new&alg->fault_bit)){
|
||||
old=new;
|
||||
/* check for some false fault at finish or race of x8x2 */
|
||||
if(!(old^=(new=FLASH_RD16(addr)))) break; /* finished now */
|
||||
else{
|
||||
/* one chip of x8x2 configuration can finish earlier */
|
||||
if(!(old&0x00ff)||(fault&0x00ff))
|
||||
if(!(old&0xff00)||(fault&0xff00))
|
||||
{ret=-2;break;}
|
||||
}
|
||||
}
|
||||
old=new;
|
||||
}
|
||||
/* reset */
|
||||
FLASH_WR16(a,alg->cmd_reset);
|
||||
if((FLASH_RD16(addr)!=val) && (ret>=0)) ret=-3;
|
||||
|
||||
return ret;
|
||||
|
||||
mem_op_error:
|
||||
return -5;
|
||||
}
|
||||
|
||||
int bdmflash_erase_x16(const flash_alg_info_t *alg, void *addr, long size)
|
||||
{
|
||||
u_int16_t old,new,fault;
|
||||
int ret=0;
|
||||
caddr_t a=(caddr_t)((u_int32_t)addr&~alg->addr_mask);
|
||||
/* reset */
|
||||
FLASH_WR16(a,alg->cmd_reset);
|
||||
/* security sequence */
|
||||
FLASH_WR16(a+alg->reg1_addr,alg->cmd_unlock1);
|
||||
if(alg->cmd_unlock2)
|
||||
FLASH_WR16(a+alg->reg2_addr,alg->cmd_unlock2);
|
||||
/* erase command */
|
||||
FLASH_WR16(a+alg->reg1_addr,alg->cmd_erase);
|
||||
/* security sequence */
|
||||
FLASH_WR16(a+alg->reg1_addr,alg->cmd_unlock1);
|
||||
if(alg->cmd_unlock2)
|
||||
FLASH_WR16(a+alg->reg2_addr,alg->cmd_unlock2);
|
||||
/* select erase range */
|
||||
a=addr;
|
||||
if(size==0)
|
||||
FLASH_WR16(a+alg->reg1_addr,alg->erase_all);
|
||||
else{
|
||||
FLASH_WR16(addr,alg->erase_sec);
|
||||
}
|
||||
/* wait for result */
|
||||
old=FLASH_RD16(addr);
|
||||
while((new=FLASH_RD16(addr))!=old){
|
||||
if((fault=old&new&alg->fault_bit)){
|
||||
old=new;
|
||||
/* check for some false fault at finish or race of x8x2 */
|
||||
if(!(old^=(new=FLASH_RD16(addr)))) break; /* finished now */
|
||||
else{
|
||||
/* one chip of x8x2 configuration can finish earlier */
|
||||
if(!(old&0x00ff)||(fault&0x00ff))
|
||||
if(!(old&0xff00)||(fault&0xff00))
|
||||
{ret=-2;break;}
|
||||
}
|
||||
}
|
||||
old=new;
|
||||
}
|
||||
/* reset */
|
||||
FLASH_WR16(a,alg->cmd_reset);
|
||||
if(FLASH_RD16(addr)!=0xffff) ret--;
|
||||
return ret;
|
||||
|
||||
mem_op_error:
|
||||
return -5;
|
||||
}
|
||||
|
||||
/*******************************************************************/
|
||||
/* routines for single 8 bit wide Intel or AMD flash */
|
||||
|
||||
int bdmflash_check_id_x8(const flash_alg_info_t *alg, void *addr,
|
||||
flash_d_t retid[2])
|
||||
{
|
||||
int ret=0;
|
||||
u_int16_t devid, manid;
|
||||
caddr_t a=(caddr_t)((u_int32_t)addr&~alg->addr_mask);
|
||||
/* reset */
|
||||
FLASH_WR8(a,alg->cmd_reset);
|
||||
/* security sequence */
|
||||
FLASH_WR8(a+alg->reg1_addr,alg->cmd_unlock1);
|
||||
if(alg->cmd_unlock2)
|
||||
FLASH_WR8(a+alg->reg2_addr,alg->cmd_unlock2);
|
||||
/* read manufacturer ID */
|
||||
FLASH_WR8(a+alg->reg1_addr,alg->cmd_rdid);
|
||||
manid=FLASH_RD8(a+0);
|
||||
if(manid!=alg->manid) ret=-1;
|
||||
/* reset */
|
||||
FLASH_WR8(a,alg->cmd_reset);
|
||||
/* security sequence */
|
||||
FLASH_WR8(a+alg->reg1_addr,alg->cmd_unlock1);
|
||||
if(alg->cmd_unlock2)
|
||||
FLASH_WR8(a+alg->reg2_addr,alg->cmd_unlock2);
|
||||
/* read device ID */
|
||||
FLASH_WR8(a+alg->reg1_addr,alg->cmd_rdid);
|
||||
devid=FLASH_RD8(a+1);
|
||||
if(devid!=alg->devid) ret=-1;
|
||||
/* reset */
|
||||
FLASH_WR8(a,alg->cmd_reset);
|
||||
if(retid)
|
||||
{retid[0]=manid;retid[1]=devid;};
|
||||
return ret;
|
||||
|
||||
mem_op_error:
|
||||
return -5;
|
||||
}
|
||||
|
||||
int bdmflash_prog_x8(const flash_alg_info_t *alg, void *addr, const void *data, long count)
|
||||
{
|
||||
int ret=1;
|
||||
u_int8_t old,new,val;
|
||||
caddr_t a=(caddr_t)((u_int32_t)addr&~alg->addr_mask);
|
||||
val=*(u_int8_t*)data;
|
||||
/* check if FLASH needs programming */
|
||||
if(1){
|
||||
old=FLASH_RD8(addr);
|
||||
if(old==val) return ret;
|
||||
}
|
||||
/* security sequence */
|
||||
FLASH_WR8(a+alg->reg1_addr,alg->cmd_unlock1);
|
||||
if(alg->cmd_unlock2)
|
||||
FLASH_WR8(a+alg->reg2_addr,alg->cmd_unlock2);
|
||||
/* program command */
|
||||
FLASH_WR8(a+alg->reg1_addr,alg->cmd_prog);
|
||||
FLASH_WR8(addr,val);
|
||||
/* wait for result */
|
||||
old=FLASH_RD8(addr);
|
||||
while((new=FLASH_RD8(addr))!=old){
|
||||
if((old&alg->fault_bit)&&(new&alg->fault_bit)){
|
||||
if((FLASH_RD8(addr))!=new) ret=-2;
|
||||
break;
|
||||
}
|
||||
old=new;
|
||||
}
|
||||
/* reset */
|
||||
FLASH_WR8(a,alg->cmd_reset);
|
||||
if((FLASH_RD8(addr)!=val) && (ret>=0)) ret=-3;
|
||||
return ret;
|
||||
|
||||
mem_op_error:
|
||||
return -5;
|
||||
}
|
||||
|
||||
int bdmflash_erase_x8(const flash_alg_info_t *alg, void *addr, long size)
|
||||
{
|
||||
u_int8_t old,new;
|
||||
int ret=0;
|
||||
caddr_t a=(caddr_t)((u_int32_t)addr&~alg->addr_mask);
|
||||
/* reset */
|
||||
FLASH_WR8(a,alg->cmd_reset);
|
||||
/* security sequence */
|
||||
FLASH_WR8(a+alg->reg1_addr,alg->cmd_unlock1);
|
||||
if(alg->cmd_unlock2)
|
||||
FLASH_WR8(a+alg->reg2_addr,alg->cmd_unlock2);
|
||||
/* erase command */
|
||||
FLASH_WR8(a+alg->reg1_addr,alg->cmd_erase);
|
||||
/* security sequence */
|
||||
FLASH_WR8(a+alg->reg1_addr,alg->cmd_unlock1);
|
||||
if(alg->cmd_unlock2)
|
||||
FLASH_WR8(a+alg->reg2_addr,alg->cmd_unlock2);
|
||||
/* select erase range */
|
||||
a=addr;
|
||||
if(size==0)
|
||||
FLASH_WR8(a+alg->reg1_addr,alg->erase_all);
|
||||
else{
|
||||
FLASH_WR8(addr,alg->erase_sec);
|
||||
}
|
||||
old=FLASH_RD8(addr);
|
||||
while((new=FLASH_RD8(addr))!=old){
|
||||
if((old&alg->fault_bit)&&(new&alg->fault_bit)){
|
||||
if((FLASH_RD8(addr))!=new) ret=-2;
|
||||
break;
|
||||
}
|
||||
old=new;
|
||||
}
|
||||
/* reset */
|
||||
FLASH_WR8(a,alg->cmd_reset);
|
||||
if(FLASH_RD16(addr)!=0xffff) ret--;
|
||||
return ret;
|
||||
|
||||
mem_op_error:
|
||||
return -5;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************/
|
||||
/* routines for two/four interleaved 16/8 bit wide Intel or AMD flashes */
|
||||
|
||||
#ifdef WITH_TARGET_BUS32
|
||||
|
||||
int bdmflash_check_id_x32(const flash_alg_info_t *alg, void *addr, flash_d_t retid[2])
|
||||
{
|
||||
int ret=0;
|
||||
u_int32_t devid, manid;
|
||||
caddr_t a=(caddr_t)((u_int32_t)addr&~alg->addr_mask);
|
||||
/* reset */
|
||||
FLASH_WR32(a,alg->cmd_reset);
|
||||
/* security sequence */
|
||||
FLASH_WR32(a+alg->reg1_addr,alg->cmd_unlock1);
|
||||
if(alg->cmd_unlock2)
|
||||
FLASH_WR32(a+alg->reg2_addr,alg->cmd_unlock2);
|
||||
/* read manufacturer ID */
|
||||
FLASH_WR32(a+alg->reg1_addr,alg->cmd_rdid);
|
||||
/* bank slecets swapped as i suspect (360DK only) !!!!!! */
|
||||
/*manid=FLASH_RD32(a+0xc); */
|
||||
manid=FLASH_RD32(a+0);
|
||||
if(manid!=alg->manid) ret=-1;
|
||||
/* reset */
|
||||
FLASH_WR32(a,alg->cmd_reset);
|
||||
/* security sequence */
|
||||
FLASH_WR32(a+alg->reg1_addr,alg->cmd_unlock1);
|
||||
if(alg->cmd_unlock2)
|
||||
FLASH_WR32(a+alg->reg2_addr,alg->cmd_unlock2);
|
||||
/* read device ID */
|
||||
FLASH_WR32(a+alg->reg1_addr,alg->cmd_rdid);
|
||||
devid=FLASH_RD32(a+4);
|
||||
if(devid!=alg->devid) ret=-1;
|
||||
/* reset */
|
||||
FLASH_WR32(a,alg->cmd_reset);
|
||||
if(retid)
|
||||
{retid[0]=manid;retid[1]=devid;};
|
||||
return ret;
|
||||
|
||||
mem_op_error:
|
||||
return -5;
|
||||
}
|
||||
|
||||
int bdmflash_prog_x32(const flash_alg_info_t *alg, void *addr, const void *data, long count)
|
||||
{
|
||||
int ret=4;
|
||||
u_int32_t old,new,fault,val;
|
||||
caddr_t a=(caddr_t)((u_int32_t)addr&~alg->addr_mask);
|
||||
ret=bdmflash_prepval_x32(&val,addr,data,count);
|
||||
if(ret<=0)
|
||||
return ret;
|
||||
addr=(void*)((long)addr&~3l);
|
||||
/* check if FLASH needs programming */
|
||||
if(1){
|
||||
old=FLASH_RD32(addr);
|
||||
if(old==val) return ret;
|
||||
}
|
||||
/* security sequence */
|
||||
FLASH_WR32(a+alg->reg1_addr,alg->cmd_unlock1);
|
||||
if(alg->cmd_unlock2)
|
||||
FLASH_WR32(a+alg->reg2_addr,alg->cmd_unlock2);
|
||||
/* program command */
|
||||
FLASH_WR32(a+alg->reg1_addr,alg->cmd_prog);
|
||||
FLASH_WR32(addr,val);
|
||||
/* wait for result */
|
||||
old=FLASH_RD32(addr);
|
||||
while((new=FLASH_RD32(addr))!=old){
|
||||
if((fault=old&new&alg->fault_bit)){
|
||||
old=new;
|
||||
/* check for some false fault at finish or race of x8x2 */
|
||||
if(!(old^=(new=FLASH_RD32(addr)))) break; /* finished now */
|
||||
else{
|
||||
/* one chip of x16x2 or x8x4 configuration can finish earlier */
|
||||
if(!(old&0x000000ff)||(fault&0x000000ff))
|
||||
if(!(old&0x0000ff00)||(fault&0x0000ff00))
|
||||
if(!(old&0x00ff0000)||(fault&0x00ff0000))
|
||||
if(!(old&0xff000000)||(fault&0xff000000))
|
||||
{ret=-2;break;}
|
||||
}
|
||||
}
|
||||
old=new;
|
||||
}
|
||||
/* reset */
|
||||
FLASH_WR32(a,alg->cmd_reset);
|
||||
if((FLASH_RD32(addr)!=val) && (ret>=0)) ret=-3;
|
||||
|
||||
return ret;
|
||||
|
||||
mem_op_error:
|
||||
return -5;
|
||||
}
|
||||
|
||||
|
||||
int bdmflash_erase_x32(const flash_alg_info_t *alg, void *addr, long size)
|
||||
{
|
||||
u_int32_t old,new,fault;
|
||||
int ret=0;
|
||||
caddr_t a=(caddr_t)((u_int32_t)addr&~alg->addr_mask);
|
||||
/* reset */
|
||||
FLASH_WR32(a,alg->cmd_reset);
|
||||
/* security sequence */
|
||||
FLASH_WR32(a+alg->reg1_addr,alg->cmd_unlock1);
|
||||
if(alg->cmd_unlock2)
|
||||
FLASH_WR32(a+alg->reg2_addr,alg->cmd_unlock2);
|
||||
/* erase command */
|
||||
FLASH_WR32(a+alg->reg1_addr,alg->cmd_erase);
|
||||
/* security sequence */
|
||||
FLASH_WR32(a+alg->reg1_addr,alg->cmd_unlock1);
|
||||
if(alg->cmd_unlock2)
|
||||
FLASH_WR32(a+alg->reg2_addr,alg->cmd_unlock2);
|
||||
/* select erase range */
|
||||
a=addr;
|
||||
if(size==0)
|
||||
FLASH_WR32(a+alg->reg1_addr,alg->erase_all);
|
||||
else{
|
||||
FLASH_WR32(addr,alg->erase_sec);
|
||||
}
|
||||
/* wait for result */
|
||||
old=FLASH_RD32(addr);
|
||||
while((new=FLASH_RD32(addr))!=old){
|
||||
if((fault=old&new&alg->fault_bit)){
|
||||
old=new;
|
||||
/* check for some false fault at finish or race of x16x2 or x8x4 */
|
||||
if(!(old^=(new=FLASH_RD32(addr)))) break; /* finished now */
|
||||
else{
|
||||
/* one chip of x16x2 or x8x4 configuration can finish earlier */
|
||||
if(!(old&0x000000ff)||(fault&0x000000ff))
|
||||
if(!(old&0x0000ff00)||(fault&0x0000ff00))
|
||||
if(!(old&0x00ff0000)||(fault&0x00ff0000))
|
||||
if(!(old&0xff000000)||(fault&0xff000000))
|
||||
{ret=-2;break;}
|
||||
}
|
||||
}
|
||||
old=new;
|
||||
}
|
||||
/* reset */
|
||||
FLASH_WR32(a,alg->cmd_reset);
|
||||
if(FLASH_RD32(addr)!=0xffffffff) ret--;
|
||||
return ret;
|
||||
|
||||
mem_op_error:
|
||||
return -5;
|
||||
}
|
||||
|
||||
|
||||
#endif /* WITH_TARGET_BUS32 */
|
||||
|
||||
/*******************************************************************/
|
||||
|
||||
/* flash type independent check_id */
|
||||
int bdmflash_check_id(const flash_alg_info_t *alg, void *addr, flash_d_t retid[2])
|
||||
{
|
||||
if(alg->check_id)
|
||||
return alg->check_id(alg, addr, retid);
|
||||
else
|
||||
return -10; /* we really need to define error constants in future */
|
||||
}
|
||||
|
||||
/* flash type independent program one location */
|
||||
int bdmflash_prog(const flash_alg_info_t *alg, void *addr, const void *data, long count)
|
||||
{
|
||||
if(alg->prog)
|
||||
return alg->prog(alg,addr,data,count);
|
||||
else
|
||||
return -10;
|
||||
}
|
||||
|
||||
/* flash type independent erase region */
|
||||
int bdmflash_erase(const flash_alg_info_t *alg, void *addr, long size)
|
||||
{
|
||||
if(alg->erase)
|
||||
return alg->erase(alg,addr,size);
|
||||
else
|
||||
return -10;
|
||||
}
|
||||
|
||||
const flash_alg_info_t *
|
||||
bdmflash_alg_from_id(flash_d_t id[2])
|
||||
{
|
||||
int i;
|
||||
const flash_alg_info_t *alg;
|
||||
for(i=0;(alg=flash_alg_infos_def[i])!=NULL;i++)
|
||||
if((alg->manid==id[0])&&(alg->devid==id[0]))
|
||||
return alg;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const flash_alg_info_t *
|
||||
bdmflash_alg_probe(caddr_t flash_adr)
|
||||
{
|
||||
int i;
|
||||
const flash_alg_info_t *alg,*alg1;
|
||||
flash_d_t testid[2];
|
||||
for(i=0;(alg=flash_alg_infos_def[i])!=NULL;i++){
|
||||
if(bdmflash_check_id(alg,flash_adr,testid)>=0)
|
||||
return alg;
|
||||
alg1=bdmflash_alg_from_id(testid);
|
||||
if(alg1!=NULL)
|
||||
if(bdmflash_check_id(alg1,flash_adr,testid)>=0)
|
||||
return alg1;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
bdmflash_wrb_filt(bdmlib_bfilt_t * filt, caddr_t in_adr,
|
||||
u_int size, u_char * bl_ptr)
|
||||
{
|
||||
int offs=0,res;
|
||||
flash_d_t val;
|
||||
const flash_alg_info_t *alg=(flash_alg_info_t*)filt->info;
|
||||
|
||||
#if 0
|
||||
if(alg->width!=FLASH_ALG_BITS_x8) {
|
||||
/* 16 bit wide flash write path */
|
||||
if((u_long)in_adr&1) {
|
||||
in_adr-=1;
|
||||
val=(FLASH_RD16(in_adr)&0xff00)|bl_ptr[offs];
|
||||
if((res=bdmflash_prog(alg, in_adr, val))<0) {
|
||||
fprintf(stderr, "flash byte write error %d at 0x%lx\n",
|
||||
res,(u_long)in_adr);
|
||||
return offs;
|
||||
}
|
||||
in_adr+=2;
|
||||
size-=1;
|
||||
offs+=1;
|
||||
}
|
||||
while(size>=2) {
|
||||
val=(bl_ptr[offs]<<8)|bl_ptr[offs+1];
|
||||
if((res=bdmflash_prog(alg, in_adr, val))<0) {
|
||||
fprintf(stderr, "flash write error %d at 0x%lx\n",
|
||||
res,(u_long)in_adr);
|
||||
return offs;
|
||||
}
|
||||
in_adr+=2;
|
||||
size-=2;
|
||||
offs+=2;
|
||||
}
|
||||
if(size) {
|
||||
val=(FLASH_RD16(in_adr)&0x00ff)|(bl_ptr[offs]<<8);
|
||||
if((res=bdmflash_prog(alg, in_adr, val))<0) {
|
||||
fprintf(stderr, "flash byte write error %d at 0x%lx\n",
|
||||
res,(u_long)in_adr);
|
||||
return offs;
|
||||
}
|
||||
size-=1;
|
||||
offs+=1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
while(size>=1) {
|
||||
val=bl_ptr[offs];
|
||||
if((res=bdmflash_prog(alg, in_adr, bl_ptr+offs, size))<=0) {
|
||||
fprintf(stderr, "flash write error %d at 0x%lx\n",
|
||||
res,(u_long)in_adr);
|
||||
return offs;
|
||||
}
|
||||
in_adr+=res;
|
||||
size-=res;
|
||||
offs+=res;
|
||||
}
|
||||
return offs;
|
||||
|
||||
#if 0
|
||||
mem_op_error:
|
||||
fprintf(stderr, "bdm memory access error\n");
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
bdmflash_erase_filt(bdmlib_bfilt_t * filt, caddr_t in_adr,
|
||||
u_int size)
|
||||
{
|
||||
int res=0;
|
||||
const flash_alg_info_t *alg=(flash_alg_info_t*)filt->info;
|
||||
if(!in_adr) in_adr=filt->begin_adr;
|
||||
|
||||
res=bdmflash_erase(alg, in_adr,size);
|
||||
if(res<0)
|
||||
fprintf(stderr, "flash erase error %d\n",res);
|
||||
return res;
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
/* slow version of blank check */
|
||||
int
|
||||
bdmflash_blankck_filt(bdmlib_bfilt_t * filt, caddr_t in_adr,
|
||||
u_int size)
|
||||
{
|
||||
int errors=0;
|
||||
if(!in_adr||!size){
|
||||
in_adr=filt->begin_adr;
|
||||
size=filt->end_adr-in_adr+1;
|
||||
}
|
||||
if(((long)in_adr&1)&&size){
|
||||
if(FLASH_RD8(in_adr)!=0xff){
|
||||
fprintf(stderr,"blank check error at 0x%06lX",(long)in_adr);
|
||||
errors++;
|
||||
}
|
||||
in_adr++; size--;
|
||||
}
|
||||
while(size>=2){
|
||||
if(FLASH_RD16(in_adr)!=0xffff){
|
||||
if(errors<5){
|
||||
if(errors) fprintf(stderr,",0x%06lX",(long)in_adr);
|
||||
else fprintf(stderr,"blank check error at 0x%06lX",(long)in_adr);
|
||||
}else if(errors==5) fprintf(stderr, " and more");
|
||||
errors++;
|
||||
}
|
||||
if(!((long)in_adr&0xfff)) bdmlib_propeller(stdout);
|
||||
in_adr+=2; size-=2;
|
||||
}
|
||||
if(size){
|
||||
if(FLASH_RD8(in_adr)!=0xff){
|
||||
if(errors) fprintf(stderr,",0x%06lX",(long)in_adr);
|
||||
else fprintf(stderr,"blank check error at 0x%06lX",(long)in_adr);
|
||||
errors++;
|
||||
}
|
||||
}
|
||||
if(errors) fprintf(stderr,"\n");
|
||||
|
||||
return errors;
|
||||
|
||||
mem_op_error:
|
||||
fprintf(stderr, "bdm memory access error\n");
|
||||
return -5;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
/* hopefully faster version of blank check */
|
||||
int
|
||||
bdmflash_blankck_filt(bdmlib_bfilt_t * filt, caddr_t in_adr,
|
||||
u_int size)
|
||||
{
|
||||
int errors=0, in_buf;
|
||||
u_char buf[1024], *p;
|
||||
if(!in_adr||!size){
|
||||
in_adr=filt->begin_adr;
|
||||
size=filt->end_adr-in_adr+1;
|
||||
}
|
||||
|
||||
while(size){
|
||||
if(size<sizeof(buf)) in_buf=size;
|
||||
else in_buf=sizeof(buf);
|
||||
|
||||
if(bdmlib_read_block(in_adr,in_buf,buf)!=in_buf)
|
||||
goto mem_op_error;
|
||||
|
||||
size-=in_buf;
|
||||
for(p=buf;in_buf--;in_adr++,p++){
|
||||
if(*p!=0xff){
|
||||
if(errors<10){
|
||||
if(errors) fprintf(stderr,",0x%06lX",(long)in_adr);
|
||||
else fprintf(stderr,"blank check error at 0x%06lX",(long)in_adr);
|
||||
}else if(errors==10) fprintf(stderr, " and more");
|
||||
errors++;
|
||||
}
|
||||
}
|
||||
bdmlib_propeller((u_long)in_adr, stdout);
|
||||
}
|
||||
|
||||
if(errors) fprintf(stderr,"\n");
|
||||
|
||||
return errors;
|
||||
|
||||
mem_op_error:
|
||||
fprintf(stderr, "\nbdm memory access error\n");
|
||||
return -5;
|
||||
}
|
||||
|
||||
#endif
|
||||
74
m683xx/bdm-load/bdmflash.h
Normal file
74
m683xx/bdm-load/bdmflash.h
Normal file
@@ -0,0 +1,74 @@
|
||||
#ifndef BDMFLASH_H
|
||||
#define BDMFLASH_H
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#define FLASH_ALG_BITS_x8 0
|
||||
#define FLASH_ALG_BITS_x16 2
|
||||
#define FLASH_ALG_BITS_x8x2 3
|
||||
#define FLASH_ALG_BITS_x32 4
|
||||
#define FLASH_ALG_BITS_x16x2 5
|
||||
#define FLASH_ALG_BITS_x8x4 7
|
||||
|
||||
#define WITH_TARGET_BUS32
|
||||
|
||||
#ifndef WITH_TARGET_BUS32
|
||||
typedef u_int16_t flash_d_t; /* Type able to store one flash location */
|
||||
#else /* WITH_TARGET_BUS32 */
|
||||
typedef u_int32_t flash_d_t; /* Type able to store one flash location */
|
||||
#endif /* WITH_TARGET_BUS32 */
|
||||
|
||||
/* Structure describing programming operations for flash type */
|
||||
typedef struct flash_alg_info {
|
||||
/* Sets retid to manufacturer and type ID, returns <0 in case of error */
|
||||
int (*check_id)(const struct flash_alg_info *alg, void *addr, flash_d_t retid[2]);
|
||||
/* Programs one location of flash and returns number of programmed bytes */
|
||||
int (*prog)(const struct flash_alg_info *alg, void *addr, const void *data, long count);
|
||||
/* Erase all sectors overlaped by region from addr of size bytes, size=0 => erase all */
|
||||
/* This version is capable only of full erase (size=0) and one sector (size=1) */
|
||||
int (*erase)(const struct flash_alg_info *alg, void *addr, long size);
|
||||
/* Numeric and string fields follows */
|
||||
u_int32_t addr_mask; /* Mask to take offset inside flash */
|
||||
u_int32_t reg1_addr; /* Flash control register 1 */
|
||||
u_int32_t reg2_addr; /* Flash control register 2 */
|
||||
u_int32_t sec_size; /* block size of bigger blocks */
|
||||
flash_d_t width; /* FLASH_ALG_BITS_x8 .. 8 bit data bus,
|
||||
FLASH_ALG_BITS_x16 .. 16 bit data,
|
||||
FLASH_ALG_BITS_x8x2 .. two interleaved 8 bit */
|
||||
flash_d_t cmd_unlock1;/* first byte of command sequence */
|
||||
flash_d_t cmd_unlock2;/* second byte of command sequence */
|
||||
flash_d_t cmd_rdid; /* read identifier */
|
||||
flash_d_t cmd_prog; /* program one loc */
|
||||
flash_d_t cmd_erase; /* erase command */
|
||||
flash_d_t cmd_reset; /* leave program mode */
|
||||
flash_d_t erase_all; /* erase all */
|
||||
flash_d_t erase_sec; /* erase sector */
|
||||
flash_d_t fault_bit; /* programing of location failed */
|
||||
flash_d_t manid; /* manufacturer ID */
|
||||
flash_d_t devid; /* device ID */
|
||||
char *alg_name; /* informative flash type name */
|
||||
} flash_alg_info_t;
|
||||
|
||||
int bdmflash_check_id(const flash_alg_info_t *alg, void *addr,
|
||||
flash_d_t retid[2]);
|
||||
|
||||
int bdmflash_prog(const flash_alg_info_t *alg, void *addr, const void *data, long count);
|
||||
|
||||
int bdmflash_erase(const flash_alg_info_t *alg, void *addr, long size);
|
||||
|
||||
flash_alg_info_t **flash_alg_infos;
|
||||
|
||||
const flash_alg_info_t *bdmflash_alg_from_id(flash_d_t id[2]);
|
||||
|
||||
const flash_alg_info_t *bdmflash_alg_probe(caddr_t flash_adr);
|
||||
|
||||
int bdmflash_wrb_filt(bdmlib_bfilt_t * filt, caddr_t in_adr,
|
||||
u_int size, u_char * bl_ptr);
|
||||
|
||||
int bdmflash_erase_filt(bdmlib_bfilt_t * filt, caddr_t in_adr, u_int size);
|
||||
|
||||
int bdmflash_blankck_filt(bdmlib_bfilt_t * filt, caddr_t in_adr, u_int size);
|
||||
|
||||
int bdmflash_check_id(const flash_alg_info_t *alg, void *addr, flash_d_t retid[2]);
|
||||
|
||||
#endif /* BDMFLASH_H */
|
||||
1701
m683xx/bdm-load/bdmlib.c
Normal file
1701
m683xx/bdm-load/bdmlib.c
Normal file
File diff suppressed because it is too large
Load Diff
83
m683xx/bdm-load/bdmlib.h
Normal file
83
m683xx/bdm-load/bdmlib.h
Normal file
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* $Id: bdmlib.h,v 1.2 2003/08/15 12:06:47 ppisa Exp $
|
||||
*/
|
||||
|
||||
#ifndef BDMLIB_H
|
||||
#define BDMLIB_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
typedef u_short bdmstatus;
|
||||
|
||||
extern int bdmlib_open(char *device);
|
||||
extern int bdmlib_close(int);
|
||||
extern int bdmlib_isopen(void);
|
||||
extern int bdmlib_ioctl(u_int code);
|
||||
extern int bdmlib_setioctl(u_int code, u_int val);
|
||||
extern bdmstatus bdmlib_getstatus(void);
|
||||
extern int bdmlib_write_var(caddr_t adr, u_short size, u_int val);
|
||||
extern int bdmlib_read_var(caddr_t adr, u_short size, void *val);
|
||||
extern int bdmlib_write_block(caddr_t adr, u_int size, u_char *block);
|
||||
extern int bdmlib_read_block(caddr_t adr, u_int size, u_char *block);
|
||||
extern int bdmlib_load(char *file, char *entry_name, u_long *entry_pt);
|
||||
extern int bdmlib_do_load_binary(char *file_name, char *entry_name,
|
||||
u_long *entry_pt);
|
||||
extern int bdmlib_do_load_macro(char *file_name, int is_begin_macro);
|
||||
extern int bdmlib_get_sys_reg(u_int, u_int *);
|
||||
extern int bdmlib_set_sys_reg(u_int, u_int);
|
||||
extern int bdmlib_get_reg(u_int, u_int *);
|
||||
extern int bdmlib_set_reg(u_int, u_int);
|
||||
extern int bdmlib_go(void);
|
||||
extern char *bdmlib_geterror_str(int);
|
||||
extern char *bdmlib_getstatus_str(bdmstatus);
|
||||
extern int bdmlib_set_mbar(u_long mbar_val);
|
||||
extern int bdmlib_reset(void);
|
||||
extern void bdmlib_setdebug(int switch_on);
|
||||
extern int bdmlib_querydebug(void);
|
||||
extern void bdmlib_showpc(void);
|
||||
extern void bdmlib_log(const char *format, ...);
|
||||
extern void bdmlib_propeller(u_long addr, FILE * fp);
|
||||
extern int bdmlib_do_load_binary_section(char *file_name, char *sect_name);
|
||||
|
||||
/* some additional error codes beyond those of the driver */
|
||||
|
||||
#define BDM_ERR_NOT_OPEN -650
|
||||
#define BDM_ERR_ILL_IOCTL -651
|
||||
#define BDM_ERR_WRITE_FAIL -652
|
||||
#define BDM_ERR_READ_FAIL -653
|
||||
#define BDM_ERR_ILL_SIZE -654
|
||||
#define BDM_ERR_OPEN -655
|
||||
#define BDM_ERR_LOAD -656
|
||||
#define BDM_ERR_MACROFILE -657
|
||||
#define BDM_ERR_SECTION -658
|
||||
#define BDM_ERR_VERSION -659
|
||||
#define BDM_NO_ERROR 0
|
||||
|
||||
/* support of filtered write for flash programming */
|
||||
|
||||
typedef struct bdmlib_bfilt{
|
||||
struct bdmlib_bfilt *next;
|
||||
caddr_t begin_adr;
|
||||
caddr_t end_adr;
|
||||
int filt_id;
|
||||
u_int flags;
|
||||
int (*wrb_filt)(struct bdmlib_bfilt *, caddr_t , u_int, u_char * );
|
||||
void *info;
|
||||
void *state;
|
||||
}bdmlib_bfilt_t;
|
||||
|
||||
#define BDMLIB_FILT_ERROR 0x08
|
||||
#define BDMLIB_FILT_ERASED 0x10
|
||||
#define BDMLIB_FILT_AUTO 0x20
|
||||
#define BDMLIB_FILT_FLASH 0x40
|
||||
|
||||
int bdmlib_load_use_lma; /* use LMA instead of VMA for load */
|
||||
bdmlib_bfilt_t * bdmlib_bfilt;
|
||||
|
||||
int
|
||||
bdmlib_wrb_filt(bdmlib_bfilt_t * bdmlib_bfilt, caddr_t in_adr,
|
||||
u_int size, u_char * bl_ptr);
|
||||
|
||||
#endif /* BDMLIB_H */
|
||||
65
m683xx/bdm-load/cpu32init
Normal file
65
m683xx/bdm-load/cpu32init
Normal file
@@ -0,0 +1,65 @@
|
||||
# initialization macro-file for MO_CPU1
|
||||
|
||||
# 0xFFFA00 - SIMCR - SIM Configuration Register
|
||||
w 0xfffa00 0x40cf 2
|
||||
|
||||
# 0xFFFA21 - SYPCR - System Protection Control Register
|
||||
w 0xfffa21 0x06 1
|
||||
|
||||
# 0xFFFA04 - SYNCR Clock Synthesizer Control Register
|
||||
w 0xfffa04 0xd408 2
|
||||
|
||||
# 0xFFFA17 - PEPAR - Port E Pin Assignment Register
|
||||
w 0xfffa17 0xf4 1
|
||||
|
||||
# 0xFFFA1F - PFPAR - Port F Pin Assignment Register
|
||||
w 0xfffa1f 0 1
|
||||
|
||||
# setup STANBY RAM at 0xFFD000
|
||||
w 0xFFFB40 0x8000 2
|
||||
w 0xFFFB44 0xFFD000 4
|
||||
w 0xFFFB40 0x0000 2
|
||||
|
||||
# setup TPU RAM at 0xFFE000
|
||||
w 0xFFFB00 0x8000 2
|
||||
w 0xFFFB04 0xFFE0 2
|
||||
w 0xFFFB00 0x0000 2
|
||||
|
||||
# 0xYFFA44 - CSPAR0 - Chip Select Pin Assignment Register 0
|
||||
w 0xfffa44 0x3bff 2
|
||||
|
||||
# 0xFFFA46 - CSPAR1 - Chip Select Pin Assignment Register 1
|
||||
w 0xfffa46 0x03a9 2
|
||||
|
||||
# BOOT ROM 0x800000 1MB RW UL - Boot FLASH
|
||||
w 0xfffa48 0x8007 2
|
||||
w 0xfffa4A 0x7830 2
|
||||
|
||||
# CS0 ROM 0x900000 1MB RW UL - 2nd FLASH
|
||||
w 0xfffa4c 0x9007 2
|
||||
w 0xfffa4e 0x7830 2
|
||||
|
||||
# CS2 RAM 0x000000 1MB RW UL - Main RAM first 1MB
|
||||
w 0xfffa54 0x0007 2
|
||||
w 0xfffa56 0x7830 2
|
||||
|
||||
# CS3 RAM 0x100000 1MB RW UL - Main RAM second 1MB
|
||||
w 0xfffa58 0x1007 2
|
||||
w 0xfffa5a 0x7830 2
|
||||
|
||||
# CS4 PER 0xf00000 512kB RW UL - CMOS RAM, RTC, other devices
|
||||
w 0xfffa5c 0xf006 2
|
||||
w 0xfffa5e 0x7cb0 2
|
||||
|
||||
# CS7 PER 0xf87000 2k RW UL - MO_PWR
|
||||
w 0xfffa68 0xf870 2
|
||||
w 0xfffa6a 0x7c70 2
|
||||
|
||||
# CS8 PER 0xf88000 2k RO UL - IRC
|
||||
w 0xfffa6c 0xf880 2
|
||||
w 0xfffa6e 0x7c70 2
|
||||
|
||||
# CS9 PER 0xf89000 2k WR UL - KBD
|
||||
w 0xfffa70 0xf890 2
|
||||
w 0xfffa72 0x7cf0 2
|
||||
|
||||
830
m683xx/bdm-load/tpudb.c
Normal file
830
m683xx/bdm-load/tpudb.c
Normal file
@@ -0,0 +1,830 @@
|
||||
/*******************************************************************
|
||||
TPUDB Project to Create Free Motorola 683xx TPU Debugger
|
||||
|
||||
tpudb.c - first test
|
||||
|
||||
(C) Copyright 2000 by Pavel Pisa - Original Author
|
||||
e-mail: pisa@cmp.felk.cvut.cz
|
||||
homepage: http://cmp.felk.cvut.cz/~pisa
|
||||
work: http://www.pikron.com/
|
||||
|
||||
This package can be copied and modified under
|
||||
GNU General Public License with all its conditions.
|
||||
See file GPL for details. Under this license nobody can
|
||||
distribute this work and any derived work without full source code
|
||||
for all modules compiled and linked into executable.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include <bfd.h>
|
||||
#include "bdm.h"
|
||||
#include "bdmlib.h"
|
||||
|
||||
#define __val2mfld(mask,val) (((mask)&~((mask)<<1))*(val)&(mask))
|
||||
#define __mfld2val(mask,val) (((val)&(mask))/((mask)&~((mask)<<1)))
|
||||
|
||||
#define val2mfld __val2mfld
|
||||
#define mfld2val __mfld2val
|
||||
|
||||
#if 0
|
||||
#define TPU_WR16(adr,val) (*(volatile u_int16_t*)(adr)=(val))
|
||||
#define TPU_RD16(adr) (*(volatile u_int16_t*)(adr))
|
||||
#else
|
||||
#define TPU_WR16(adr,val) \
|
||||
({ \
|
||||
if(bdmlib_write_var(adr,BDM_SIZE_WORD,val)<0) \
|
||||
goto mem_op_error; \
|
||||
val; \
|
||||
})
|
||||
#define TPU_RD16(adr) \
|
||||
({ u_int16_t temp_val; \
|
||||
if(bdmlib_read_var(adr,BDM_SIZE_WORD,&temp_val)<0) \
|
||||
goto mem_op_error; \
|
||||
temp_val; \
|
||||
})
|
||||
#endif
|
||||
|
||||
char hashmark=0; /* flag set by "set hash" */
|
||||
int bdm_autoreset=1; /* automatic reset before load */
|
||||
int bdm_ttcu=0; /* time to come up for init by rom */
|
||||
char initname[255]; /* need reimplement !!!!!!!!! */
|
||||
char bdm_dev_name[255]="/dev/bdm"; /* device name */
|
||||
|
||||
/* Numberring of TPU register */
|
||||
/* First part are aliases for main CPU accesible registers */
|
||||
#define TPUREG_TSTMSRA 0x0 /* Master Shift Register A */
|
||||
#define TPUREG_TSTMSRB 0x1 /* Master Shift Register B */
|
||||
#define TPUREG_TSTSC 0x2 /* Test Module Shift Count */
|
||||
#define TPU_TSTSCA 0xff00 /* Bits Shifted from TSTMSRA to Tested Module */
|
||||
#define TPU_TSTSCB 0x00ff /* Bits Shifted from Tested Module to TSTMSRB */
|
||||
#define TPUREG_TSTRC 0x3 /* Test Module Repetition Count */
|
||||
#define TPUREG_CREG 0x4 /* Test Submodule Control Register */
|
||||
#define TPU_TSTBUSY 0x8000 /* Test Submodule Busy Status Bit */
|
||||
#define TPU_TMARM 0x4000 /* Test Mode Armed Status Bit (latched /TSTME) */
|
||||
#define TPU_COMP 0x2000 /* Compare Status Bit */
|
||||
#define TPU_IMBTST 0x1000 /* Intermodule Bus Test (SCANA/SCANB) */
|
||||
#define TPU_CPUTR 0x0800 /* Scan to CPU Test Register */
|
||||
#define TPU_QBIT 0x0400 /* Quotient Bit at FREEZE/QUOT Pin */
|
||||
#define TPU_MUXEL 0x0200 /* Multiplexer Select Bit for MSRB from Int/Ext */
|
||||
#define TPU_ACUT 0x0010 /* Activate Circuit Under Test */
|
||||
#define TPU_SCONT 0x0008 /* Start Continuous Operation */
|
||||
#define TPU_SSHOP 0x0004 /* Start Shifting Operation */
|
||||
#define TPU_SATO 0x0002 /* Start Automatic Test Operation */
|
||||
#define TPU_EMT 0x0001 /* Enter test mode */
|
||||
#define TPUREG_DREG 0x5 /* Distributed Register */
|
||||
#define TPU_WAIT 0x0700 /* Wait Counter Preset 2-16 SCLK */
|
||||
#define TPU_MSRAHI 0x0e0 /* MSRA High Bits 18-16 */
|
||||
#define TPU_MSRAC 0x0010 /* Master Shift Register A Configuration */
|
||||
#define TPU_MSRBHI 0x00e /* MSRB High Bits 18-16 */
|
||||
#define TPU_MSRBC 0x0001 /* Master Shift Register B Configuration */
|
||||
#define TPUREG_MCR 0x6 /* TPU Module Configuration Register */
|
||||
#define TPU_STOP 0x8000 /* Low-Power Stop Mode Enable */
|
||||
#define TPU_TCR1P 0x6000 /* Timer Count Register 1 Prescaler Control */
|
||||
#define TPU_TCR2P 0x1800 /* Timer Count Register 2 Prescaler Control */
|
||||
#define TPU_EMU 0x0400 /* Emulation Control */
|
||||
#define TPU_T2CG 0x0200 /* TCR2 Clock/Gate Control */
|
||||
#define TPU_STF 0x0100 /* Stop Flag */
|
||||
#define TPU_SUPV 0x0080 /* Supervisor/Unrestricted */
|
||||
#define TPU_PSCK 0x0040 /* Prescaler Clock */
|
||||
#define TPU_IARB 0x000f /* Interrupt Arbitration ID */
|
||||
#define TPUREG_TCR 0x7 /* Test Configuration Register */
|
||||
#define TPU_INCAD 0x1000 /* Increment Address in uPC at ACUTL */
|
||||
#define TPU_TCR1C 0x0800 /* TCR1 Clock - TCR2 pin */
|
||||
#define TPU_ACUTR 0x0600 /* Activate Circuit Under Test Response 1, 0 */
|
||||
#define TPU_ACUTR_NONE 0 /* None */
|
||||
#define TPU_ACUTR_STEPTPU 1 /* Run ONE TPU microcycle */
|
||||
#define TPU_ACUTR_SHEOT 2 /* Scheduler End of Time Slot */
|
||||
#define TPU_SOSEL 0x0070 /* Scan-Out Select */
|
||||
#define TPU_SISEL 0x000e /* Scan-in Select */
|
||||
#define TPU_SxSEL_NONE 0 /* None */
|
||||
#define TPU_SxSEL_PC 1 /* uPC */
|
||||
#define TPU_SxSEL_IR 2 /* Microinstruction */
|
||||
#define TPU_SxSEL_BPLA 3 /* Branch PLA */
|
||||
#define TPU_SxSEL_PCBR 4 /* uPC Breakpoint */
|
||||
#define TPU_SxSEL_SPLA 5 /* Scheduler PLA */
|
||||
#define TPU_SxSEL_CHANBR 6 /* Channel Breakpoint */
|
||||
#define TPU_TMW 0x0001 /* Test Memory Map */
|
||||
#define TPUREG_DSCR 0x8 /* Development Support Control Register */
|
||||
#define TPU_HOT4 0x8000 /* Hang on T4 */
|
||||
#define TPU_BLC 0x0400 /* Branch Latch Control */
|
||||
#define TPU_CLKS 0x0200 /* Stop Clocks (to TCRs) */
|
||||
#define TPU_FRZ 0x0180 /* FREEZE Assertion Response */
|
||||
#define TPU_CCL 0x0040 /* Channel Conditions Latch */
|
||||
#define TPU_BMSK 0x003F /* Break cond mask */
|
||||
#define TPU_BP 0x0020 /* Break mPC == mPC breakpoint register */
|
||||
#define TPU_BC 0x0010 /* Break if CHAN start or set */
|
||||
#define TPU_BH 0x0008 /* Break if host service latch set */
|
||||
#define TPU_BL 0x0004 /* Break if link service latch set */
|
||||
#define TPU_BM 0x0002 /* Break if MRL set at beginning*/
|
||||
#define TPU_BT 0x0001 /* Break if TDL set at beginnibg */
|
||||
#define TPUREG_DSSR 0x9 /* Development Support Status Register */
|
||||
#define TPU_BKPT 0x0080 /* Breakpoint Asserted Flag */
|
||||
#define TPU_PCBK 0x0040 /* mPC Breakpoint Flag */
|
||||
#define TPU_CHBK 0x0020 /* Channel Register Breakpoint Flag */
|
||||
#define TPU_SRBK 0x0010 /* Service Request Breakpoint Flag */
|
||||
#define TPU_TPUF 0x0008 /* TPU FREEZE Flag */
|
||||
#define TPUREG_TICR 0xA /* TPU Interrupt Configuration Register */
|
||||
#define TPU_CIRL 0x0700 /* Channel Interrupt Request Level */
|
||||
#define TPU_CIBV 0x00f0 /* Bits [7:4] of Channel Interrupt Base Vector */
|
||||
#define TPUREG_CIER 0xB /* Channel Interrupt Enable Register */
|
||||
#define TPUREG_CFSR 0xC /* Channel Function Select Register 0 */
|
||||
#define TPUREG_HSQR 0xD /* Host Sequence Register 0 */
|
||||
#define TPUREG_HSRR 0xE /* Host Service Request Register 0 */
|
||||
#define TPUREG_CPR 0xF /* Channel Priority Register 0 */
|
||||
#define TPUREG_CISR 0x10 /* Channel Interrupt Status Register */
|
||||
#define TPUREG_LR 0x11 /* Link Register */
|
||||
#define TPUREG_SGLR 0x12 /* Service Grant Latch Register */
|
||||
#define TPUREG_DCNR 0x13 /* Decoded Channel Number Register */
|
||||
/* Registers not accesible from main CPU */
|
||||
#define TPUREG_P 0x14 /* Parameter Register (16-bit) */
|
||||
#define TPUREG_A 0x15 /* Accumulator (16-bit) */
|
||||
#define TPUREG_DIOB 0x16 /* Data I/O Buffer (16-bit) */
|
||||
#define TPUREG_SR 0x17 /* Shift Register (16-bit) */
|
||||
#define TPUREG_ERT 0x18 /* Event Temporary Register (16-b.) */
|
||||
#define TPUREG_CHAN 0x19 /* Channel Number (4-bit) */
|
||||
#define TPUREG_DEC 0x1A /* Decrementator Reg (4-bit) */
|
||||
#define TPUREG_TCR2 0x1B /* Timebase Register 2 (16-bit) */
|
||||
#define TPUREG_TCR1 0x1C /* Timebase Register 1 (16-bit) */
|
||||
#define TPUREG_PC 0x1D /* Microprogram Counter (9-bit) */
|
||||
#define TPUREG_IR 0x1E /* */
|
||||
#define TPUREG_BPLA 0x1F /* */
|
||||
#define TPUREG_SPLA 0x20 /* */
|
||||
#define TPUREG_PCBR 0x21 /* */
|
||||
#define TPUREG_CHANBR 0x22 /* */
|
||||
/* Aditional CPU Accessible Registers */
|
||||
#define TPUREG_DEBPAR 0x23 /* Parameter register at 0xFFFF00 for debugging */
|
||||
#define TRAMREG_CR 0x24 /* TPURAM Configuration Register */
|
||||
#define TRAM_STOP 0x8000 /* Low-Power Stop Mode Enable */
|
||||
#define TRAM_RASP 0x0080 /* TPURAM Array Space */
|
||||
#define TRAMREG_TST 0x25 /* TPURAM Test Register */
|
||||
#define TRAMREG_BAR 0x26 /* TPURAM Base Address and Status Register */
|
||||
#define TRAM_ADDR 0xfff0 /* TPURAM Array Base Address */
|
||||
#define TRAM_RAMDS 0x0001 /* RAM Array Disable */
|
||||
|
||||
#define TPUREG_MAX 0x26
|
||||
|
||||
/* Descriptor of TPU register access */
|
||||
typedef struct tpu_reg_des {
|
||||
int (*reg_rd)(struct tpu_reg_des *des, int indx);
|
||||
int (*reg_wr)(struct tpu_reg_des *des, int indx, int val);
|
||||
int adr;
|
||||
int adr1;
|
||||
int flags;
|
||||
int arr_len; /* array size, 0 .. no array */
|
||||
int bfld_bits; /* bitfield length, 0 .. no bitfields */
|
||||
int bfld_arr_len; /* bitfield array */
|
||||
}tpu_reg_des_t;
|
||||
|
||||
int tpu_mem_rd16(struct tpu_reg_des *des, int indx);
|
||||
int tpu_mem_wr16(struct tpu_reg_des *des, int indx, int val);
|
||||
int tpu_t1_rd(struct tpu_reg_des *des, int indx);
|
||||
int tpu_t1_wr(struct tpu_reg_des *des, int indx, int val);
|
||||
int tpu_t2_rd(struct tpu_reg_des *des, int indx);
|
||||
int tpu_t2_wr(struct tpu_reg_des *des, int indx, int val);
|
||||
int tpu_reg_rd(int reg, int indx);
|
||||
int tpu_reg_wr(int reg, int indx, int val);
|
||||
int tpu_reg_or(int reg, int indx, int val);
|
||||
int tpu_reg_and(int reg, int indx, int val);
|
||||
|
||||
#define TPUREG_FL_SH4 1 /* shift value by 4 bits */
|
||||
#define TPUREG_FL_PMOD 2 /* modification for reg P */
|
||||
#define TPUREG_FL_DIOB 4 /* modification for reg DIOB */
|
||||
|
||||
#define TPUREG_INDX_BFLD (0x1<<24) /* index for bitfields */
|
||||
|
||||
/* Descriptors of TPU register access */
|
||||
tpu_reg_des_t tpu_regs[]={
|
||||
/* CPU accessible */
|
||||
[TPUREG_TSTMSRA]= {reg_rd:tpu_mem_rd16,reg_wr:tpu_mem_wr16,adr:0xFFFA30,},
|
||||
[TPUREG_TSTMSRB]= {reg_rd:tpu_mem_rd16,reg_wr:tpu_mem_wr16,adr:0xFFFA32,},
|
||||
[TPUREG_TSTSC] = {reg_rd:tpu_mem_rd16,reg_wr:tpu_mem_wr16,adr:0xFFFA34,},
|
||||
[TPUREG_TSTRC] = {reg_rd:tpu_mem_rd16,reg_wr:tpu_mem_wr16,adr:0xFFFA36,},
|
||||
[TPUREG_CREG] = {reg_rd:tpu_mem_rd16,reg_wr:tpu_mem_wr16,adr:0xFFFA38,},
|
||||
[TPUREG_DREG] = {reg_rd:tpu_mem_rd16,reg_wr:tpu_mem_wr16,adr:0xFFFA3A,},
|
||||
[TPUREG_MCR] = {reg_rd:tpu_mem_rd16,reg_wr:tpu_mem_wr16,adr:0xFFFE00,},
|
||||
[TPUREG_TCR] = {reg_rd:tpu_mem_rd16,reg_wr:tpu_mem_wr16,adr:0xFFFE02,},
|
||||
[TPUREG_DSCR] = {reg_rd:tpu_mem_rd16,reg_wr:tpu_mem_wr16,adr:0xFFFE04,},
|
||||
[TPUREG_DSSR] = {reg_rd:tpu_mem_rd16,reg_wr:tpu_mem_wr16,adr:0xFFFE06,},
|
||||
[TPUREG_TICR] = {reg_rd:tpu_mem_rd16,reg_wr:tpu_mem_wr16,adr:0xFFFE08,},
|
||||
[TPUREG_CIER] = {reg_rd:tpu_mem_rd16,reg_wr:tpu_mem_wr16,adr:0xFFFE0A,
|
||||
arr_len:0,bfld_bits:1,bfld_arr_len:16,},
|
||||
[TPUREG_CFSR] = {reg_rd:tpu_mem_rd16,reg_wr:tpu_mem_wr16,adr:0xFFFE0C,
|
||||
arr_len:4,bfld_bits:4,bfld_arr_len:16,},
|
||||
[TPUREG_HSQR] = {reg_rd:tpu_mem_rd16,reg_wr:tpu_mem_wr16,adr:0xFFFE14,
|
||||
arr_len:2,bfld_bits:2,bfld_arr_len:16,},
|
||||
[TPUREG_HSRR] = {reg_rd:tpu_mem_rd16,reg_wr:tpu_mem_wr16,adr:0xFFFE18,
|
||||
arr_len:2,bfld_bits:2,bfld_arr_len:16,},
|
||||
[TPUREG_CPR] = {reg_rd:tpu_mem_rd16,reg_wr:tpu_mem_wr16,adr:0xFFFE1C,
|
||||
arr_len:2,bfld_bits:2,bfld_arr_len:16,},
|
||||
[TPUREG_CISR] = {reg_rd:tpu_mem_rd16,reg_wr:tpu_mem_wr16,adr:0xFFFE20,
|
||||
arr_len:0,bfld_bits:1,bfld_arr_len:16,},
|
||||
[TPUREG_LR] = {reg_rd:tpu_mem_rd16,reg_wr:tpu_mem_wr16,adr:0xFFFE22,},
|
||||
[TPUREG_SGLR] = {reg_rd:tpu_mem_rd16,reg_wr:tpu_mem_wr16,adr:0xFFFE24,},
|
||||
[TPUREG_DCNR] = {reg_rd:tpu_mem_rd16,reg_wr:tpu_mem_wr16,adr:0xFFFE26,},
|
||||
/* Special TPU - group 1 */
|
||||
/* internal TPU registers, ounly access possible through forced TPU microengine instructions */
|
||||
/* adr .. instruction for reg read, adr1 .. instruction for reg write */
|
||||
[TPUREG_P] = {reg_rd:tpu_t1_rd,reg_wr:tpu_t1_wr,adr:0x3fff,adr1:0x36ff,
|
||||
flags:TPUREG_FL_PMOD,},
|
||||
[TPUREG_A] = {reg_rd:tpu_t1_rd,reg_wr:tpu_t1_wr,adr:0x327f,adr1:0x361f},
|
||||
[TPUREG_DIOB] = {reg_rd:tpu_t1_rd,reg_wr:tpu_t1_wr,adr:0,adr1:0,
|
||||
flags:TPUREG_FL_DIOB,},
|
||||
[TPUREG_SR] = {reg_rd:tpu_t1_rd,reg_wr:tpu_t1_wr,adr:0x347f,adr1:0x363f},
|
||||
[TPUREG_ERT] = {reg_rd:tpu_t1_rd,reg_wr:tpu_t1_wr,adr:0x3c7f,adr1:0x365f},
|
||||
[TPUREG_CHAN] = {reg_rd:tpu_t1_rd,reg_wr:tpu_t1_wr,adr:0x267f,adr1:0x373f,
|
||||
flags:TPUREG_FL_SH4,},
|
||||
[TPUREG_DEC] = {reg_rd:tpu_t1_rd,reg_wr:tpu_t1_wr,adr:0x247f,adr1:0x375f},
|
||||
[TPUREG_TCR2] = {reg_rd:tpu_t1_rd,reg_wr:tpu_t1_wr,adr:0x387f,adr1:0x379f},
|
||||
[TPUREG_TCR1] = {reg_rd:tpu_t1_rd,reg_wr:tpu_t1_wr,adr:0x3a7f,adr1:0x37bf},
|
||||
/* Special TPU - group 2 */
|
||||
/* access through test subsystem serial scan lines */
|
||||
/* adr .. number of register bits, adr1 .. TPU scan line selection */
|
||||
[TPUREG_PC] = {reg_rd:tpu_t2_rd,reg_wr:tpu_t2_wr,adr: 9,adr1:TPU_SxSEL_PC},
|
||||
[TPUREG_IR] = {reg_rd:NULL,reg_wr:NULL,adr:0,adr1:0},
|
||||
[TPUREG_BPLA] = {reg_rd:tpu_t2_rd,reg_wr:tpu_t2_wr,adr:16,adr1:TPU_SxSEL_BPLA},
|
||||
[TPUREG_SPLA] = {reg_rd:tpu_t2_rd,reg_wr:tpu_t2_wr,adr:15,adr1:TPU_SxSEL_SPLA},
|
||||
[TPUREG_PCBR] = {reg_rd:tpu_t2_rd,reg_wr:tpu_t2_wr,adr: 9,adr1:TPU_SxSEL_PCBR},
|
||||
[TPUREG_CHANBR] = {reg_rd:tpu_t2_rd,reg_wr:tpu_t2_wr,adr: 4,adr1:TPU_SxSEL_CHANBR},
|
||||
/* One of parameter registers used for internal registers access */ /* was TPUREG_DEBUR */
|
||||
[TPUREG_DEBPAR] = {reg_rd:tpu_mem_rd16,reg_wr:tpu_mem_wr16,adr:0xFFFF00,},
|
||||
[TRAMREG_CR] = {reg_rd:tpu_mem_rd16,reg_wr:tpu_mem_wr16,adr:0xFFFB00,},
|
||||
[TRAMREG_TST] = {reg_rd:tpu_mem_rd16,reg_wr:tpu_mem_wr16,adr:0xFFFB02,},
|
||||
[TRAMREG_BAR] = {reg_rd:tpu_mem_rd16,reg_wr:tpu_mem_wr16,adr:0xFFFB04,},
|
||||
};
|
||||
|
||||
/**************************************************************************/
|
||||
/* Helper function for test register access */
|
||||
|
||||
static int use_fetched_reg;
|
||||
static u_int16_t fetched_dscr;
|
||||
static u_int16_t fetched_creg;
|
||||
static u_int16_t fetched_tcr;
|
||||
|
||||
static u_int16_t stored_diob;
|
||||
static u_int16_t stored_pc;
|
||||
static u_int16_t stored_debpar2; /* was strored_debur2 */
|
||||
static u_int32_t stored_ir; /* was strored_x1 */
|
||||
/* was strored_x2 */
|
||||
|
||||
static
|
||||
void test_shift_wait(unsigned creg)
|
||||
{
|
||||
int cnt=0x8000;
|
||||
tpu_reg_wr(TPUREG_CREG,0,creg|TPU_SSHOP); /* 4 */
|
||||
do{
|
||||
creg=tpu_reg_rd(TPUREG_CREG,0);
|
||||
if(!(creg&TPU_TSTBUSY)) return; /* 0x8000 */
|
||||
}while(cnt--);
|
||||
fprintf(stderr,"test_shift_wait : stalled busy condition\n");
|
||||
}
|
||||
|
||||
/* Write 32 Bit Instruction Register */
|
||||
static /* was test_shift_1 */
|
||||
void test_shift_irwr(u_int32_t new_ir )
|
||||
{
|
||||
u_int16_t dscr; /* [bp-6] */
|
||||
u_int16_t creg; /* si */
|
||||
u_int16_t tcr; /* di */
|
||||
|
||||
if (!use_fetched_reg){
|
||||
tpu_reg_wr(TPUREG_TSTMSRB,0,0);
|
||||
tpu_reg_wr(TPUREG_TSTRC,0,0);
|
||||
tpu_reg_wr(TPUREG_DREG,0,0);
|
||||
dscr=tpu_reg_rd(TPUREG_DSCR,0);
|
||||
creg=tpu_reg_rd(TPUREG_CREG,0);
|
||||
tcr=tpu_reg_rd(TPUREG_TCR,0);
|
||||
}else{
|
||||
creg=fetched_creg;
|
||||
tcr=fetched_tcr;
|
||||
dscr=fetched_dscr;
|
||||
}
|
||||
|
||||
creg=(creg|TPU_IMBTST)&~TPU_MUXEL; /*!!!!!!!!!!!*/
|
||||
tpu_reg_wr(TPUREG_CREG,0,creg);
|
||||
|
||||
if(!(dscr&TPU_HOT4)) /* ???????? */
|
||||
tpu_reg_wr(TPUREG_DSCR,0,dscr|TPU_HOT4);
|
||||
|
||||
tcr&=TPU_INCAD | TPU_TCR1C | TPU_TMW; /* 0x1801 */
|
||||
tpu_reg_wr(TPUREG_TCR,0,tcr | val2mfld(TPU_ACUTR,TPU_ACUTR_STEPTPU) |
|
||||
val2mfld(TPU_SISEL,TPU_SxSEL_IR)); /* 0x204 */
|
||||
tpu_reg_wr(TPUREG_TSTSC,0,0x1000);
|
||||
tpu_reg_wr(TPUREG_TSTMSRA,0,new_ir&0xffff);
|
||||
|
||||
test_shift_wait(creg); /* test shift */
|
||||
|
||||
tpu_reg_wr(TPUREG_TCR,0,tcr | val2mfld(TPU_ACUTR,TPU_ACUTR_STEPTPU) |
|
||||
val2mfld(TPU_SISEL,TPU_SxSEL_IR)); /* 0x204 */
|
||||
tpu_reg_wr(TPUREG_TSTSC,0,0x1000);
|
||||
tpu_reg_wr(TPUREG_TSTMSRA,0,(new_ir>>16)&0xffff);
|
||||
|
||||
test_shift_wait(creg); /* test shift */
|
||||
|
||||
if(!(dscr&TPU_HOT4)) /* ???????? */
|
||||
tpu_reg_wr(TPUREG_DSCR,0,dscr);
|
||||
}
|
||||
|
||||
/* Read 32 Bit Instruction Register */
|
||||
static /* was test_shift_2 */
|
||||
u_int32_t test_shift_irrd(void)
|
||||
{
|
||||
u_int16_t dscr; /* [bp-0a] */
|
||||
u_int16_t creg; /* si */
|
||||
u_int16_t tcr; /* di */
|
||||
u_int16_t ir_lo,ir_hi;
|
||||
|
||||
if (!use_fetched_reg){
|
||||
tpu_reg_wr(TPUREG_TSTMSRB,0,0);
|
||||
tpu_reg_wr(TPUREG_TSTRC,0,0);
|
||||
tpu_reg_wr(TPUREG_DREG,0,0);
|
||||
dscr=tpu_reg_rd(TPUREG_DSCR,0);
|
||||
creg=tpu_reg_rd(TPUREG_CREG,0);
|
||||
tcr=tpu_reg_rd(TPUREG_TCR,0);
|
||||
}else{
|
||||
creg=fetched_creg;
|
||||
tcr=fetched_tcr;
|
||||
dscr=fetched_dscr;
|
||||
}
|
||||
|
||||
creg=(creg|TPU_IMBTST)&~TPU_MUXEL; /*!!!!!!!!!!!*/
|
||||
tpu_reg_wr(TPUREG_CREG,0,creg);
|
||||
|
||||
if(!(dscr&TPU_HOT4)) /* ???????? */
|
||||
tpu_reg_wr(TPUREG_DSCR,0,dscr|TPU_HOT4);
|
||||
|
||||
tcr&=TPU_INCAD | TPU_TCR1C | TPU_TMW; /* 0x1801 */
|
||||
tpu_reg_wr(TPUREG_TCR,0,tcr | val2mfld(TPU_ACUTR,TPU_ACUTR_STEPTPU) |
|
||||
val2mfld(TPU_SOSEL,TPU_SxSEL_IR)); /* 0x220 */
|
||||
tpu_reg_wr(TPUREG_TSTSC,0,0x0010);
|
||||
|
||||
test_shift_wait(creg); /* test shift */
|
||||
|
||||
ir_lo=tpu_reg_rd(TPUREG_TSTMSRB,0);
|
||||
tpu_reg_wr(TPUREG_TCR,0,tcr | val2mfld(TPU_ACUTR,TPU_ACUTR_STEPTPU) |
|
||||
val2mfld(TPU_SOSEL,TPU_SxSEL_IR) |
|
||||
val2mfld(TPU_SISEL,TPU_SxSEL_IR)); /* 0x224 */
|
||||
tpu_reg_wr(TPUREG_TSTSC,0,0x1010);
|
||||
tpu_reg_wr(TPUREG_TSTMSRA,0,ir_lo);
|
||||
|
||||
test_shift_wait(creg); /* test shift */
|
||||
|
||||
ir_hi=tpu_reg_rd(TPUREG_TSTMSRB,0);
|
||||
tpu_reg_wr(TPUREG_TCR,0,tcr | val2mfld(TPU_ACUTR,TPU_ACUTR_STEPTPU) |
|
||||
val2mfld(TPU_SISEL,TPU_SxSEL_IR)); /* 0x204 */
|
||||
tpu_reg_wr(TPUREG_TSTSC,0,0x1000);
|
||||
tpu_reg_wr(TPUREG_TSTMSRA,0,ir_hi);
|
||||
|
||||
test_shift_wait(creg); /* test shift */
|
||||
|
||||
if(!(dscr&TPU_HOT4)) /* ???????? */
|
||||
tpu_reg_wr(TPUREG_DSCR,0,dscr);
|
||||
|
||||
return ir_lo|((u_int32_t)ir_hi<<16);
|
||||
}
|
||||
|
||||
static /* was test_shift_3 */
|
||||
int test_shift_regrd(int shiftcnt ,int sxsel)
|
||||
{
|
||||
u_int16_t dscr; /* [bp-8] */
|
||||
u_int16_t creg; /* si */
|
||||
u_int16_t tcr; /* di */
|
||||
u_int16_t ret;
|
||||
|
||||
if (!use_fetched_reg){
|
||||
tpu_reg_wr(TPUREG_TSTMSRB,0,0);
|
||||
tpu_reg_wr(TPUREG_TSTRC,0,0);
|
||||
tpu_reg_wr(TPUREG_DREG,0,0);
|
||||
dscr=tpu_reg_rd(TPUREG_DSCR,0);
|
||||
creg=tpu_reg_rd(TPUREG_CREG,0);
|
||||
tcr=tpu_reg_rd(TPUREG_TCR,0);
|
||||
}else{
|
||||
creg=fetched_creg;
|
||||
tcr=fetched_tcr;
|
||||
dscr=fetched_dscr;
|
||||
}
|
||||
|
||||
creg=(creg|TPU_IMBTST)&~TPU_MUXEL; /*!!!!!!!!!!!*/
|
||||
tpu_reg_wr(TPUREG_CREG,0,creg);
|
||||
|
||||
if(!(dscr&TPU_HOT4)) /* ???????? */
|
||||
tpu_reg_wr(TPUREG_DSCR,0,dscr|TPU_HOT4);
|
||||
|
||||
tcr&=TPU_INCAD | TPU_TCR1C | TPU_TMW; /* 0x1801 */
|
||||
tpu_reg_wr(TPUREG_TCR,0,tcr | val2mfld(TPU_ACUTR,TPU_ACUTR_STEPTPU) |
|
||||
val2mfld(TPU_SOSEL,sxsel)); /* (sxsel<<4)|0x200 */
|
||||
tpu_reg_wr(TPUREG_TSTSC,0,shiftcnt);
|
||||
|
||||
test_shift_wait(creg); /* test shift */
|
||||
|
||||
ret=tpu_reg_rd(TPUREG_TSTMSRB,0)>>(0x10-shiftcnt);
|
||||
tpu_reg_wr(TPUREG_TCR,0,tcr | val2mfld(TPU_ACUTR,TPU_ACUTR_STEPTPU) |
|
||||
val2mfld(TPU_SISEL,sxsel)); /* (sxsel<<1)|0x200 */
|
||||
tpu_reg_wr(TPUREG_TSTSC,0,shiftcnt<<8);
|
||||
tpu_reg_wr(TPUREG_TSTMSRA,0,ret);
|
||||
|
||||
test_shift_wait(creg); /* test shift */
|
||||
|
||||
if(!(dscr&TPU_HOT4)) /* ???????? */
|
||||
tpu_reg_wr(TPUREG_DSCR,0,dscr);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static /* was test_shift_4 */
|
||||
int test_shift_regwr(int shiftcnt, int sxsel, int val)
|
||||
{
|
||||
u_int16_t dscr; /* di */
|
||||
u_int16_t creg; /* si */
|
||||
u_int16_t tcr; /* [bp-6] */
|
||||
|
||||
if (!use_fetched_reg){
|
||||
tpu_reg_wr(TPUREG_TSTMSRB,0,0);
|
||||
tpu_reg_wr(TPUREG_TSTRC,0,0);
|
||||
tpu_reg_wr(TPUREG_DREG,0,0);
|
||||
dscr=tpu_reg_rd(TPUREG_DSCR,0);
|
||||
creg=tpu_reg_rd(TPUREG_CREG,0);
|
||||
tcr=tpu_reg_rd(TPUREG_TCR,0);
|
||||
}else{
|
||||
creg=fetched_creg;
|
||||
tcr=fetched_tcr;
|
||||
dscr=fetched_dscr;
|
||||
}
|
||||
|
||||
if(!(dscr&TPU_HOT4)) /* ???????? */
|
||||
tpu_reg_wr(TPUREG_DSCR,0,dscr|TPU_HOT4);
|
||||
|
||||
creg=(creg|TPU_IMBTST)&~TPU_MUXEL; /*!!!!!!!!!!!*/
|
||||
tpu_reg_wr(TPUREG_CREG,0,creg);
|
||||
tcr&=TPU_INCAD | TPU_TCR1C | TPU_TMW; /* 0x1801 */
|
||||
tpu_reg_wr(TPUREG_TCR,0,tcr | val2mfld(TPU_ACUTR,TPU_ACUTR_STEPTPU) |
|
||||
val2mfld(TPU_SISEL,sxsel)); /* (sxsel<<1)|0x200 */
|
||||
tpu_reg_wr(TPUREG_TSTSC,0,shiftcnt<<8);
|
||||
tpu_reg_wr(TPUREG_TSTMSRA,0,val);
|
||||
|
||||
test_shift_wait(creg); /* test shift */
|
||||
|
||||
if(!(dscr&TPU_HOT4)) /* ???????? */
|
||||
tpu_reg_wr(TPUREG_DSCR,0,dscr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static /* was test_pha_2 */
|
||||
void test_forced_inst(u_int32_t new_ir)
|
||||
{
|
||||
test_shift_irwr(new_ir);
|
||||
tpu_reg_or(TPUREG_CREG,0,TPU_ACUT);
|
||||
}
|
||||
|
||||
static /* was test_pha_1 */
|
||||
void test_store_ir(void)
|
||||
{
|
||||
stored_debpar2=tpu_reg_rd(TPUREG_DEBPAR,0);
|
||||
stored_pc=tpu_reg_rd(TPUREG_PC,0);
|
||||
stored_ir=test_shift_irrd();
|
||||
test_forced_inst(0x3ffffc03);
|
||||
stored_diob=tpu_reg_rd(TPUREG_DEBPAR,0);
|
||||
}
|
||||
|
||||
static /* was test_pha_3 */
|
||||
void test_restore_ir(void)
|
||||
{
|
||||
tpu_reg_wr(TPUREG_DEBPAR,0,stored_diob);
|
||||
test_forced_inst(0x1ffffc03);
|
||||
tpu_reg_wr(TPUREG_DEBPAR,0,stored_debpar2);
|
||||
tpu_reg_wr(TPUREG_PC,0,stored_pc);
|
||||
test_shift_irwr(stored_ir);
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/* Other supporting routines */
|
||||
|
||||
static u_int16_t test_dssrdscr_1; /* 0 => stop, 1 =>run */
|
||||
static u_int16_t test_dscr_arm;
|
||||
static u_int16_t test_dssr_bkpt;
|
||||
|
||||
int test_init_1(void)
|
||||
{
|
||||
u_int16_t creg; /* bp-2 */
|
||||
int cnt=0x1000;
|
||||
|
||||
tpu_reg_wr(TPUREG_CREG,0,TPU_MUXEL|TPU_EMT);
|
||||
creg=tpu_reg_rd(TPUREG_CREG,0);
|
||||
do{
|
||||
creg=tpu_reg_rd(TPUREG_CREG,0);
|
||||
}while(!(creg&TPU_EMT)&&(--cnt));
|
||||
tpu_reg_wr(TPUREG_CIER,0,0); /* disable interrupt generation */
|
||||
if(!cnt){
|
||||
fprintf(stderr,"test_init_1 : cannot enter test mode\n");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int test_init_2(void)
|
||||
{
|
||||
u_int16_t dssr; /* si */
|
||||
u_int16_t dscr; /* bx */
|
||||
dssr=tpu_reg_rd(TPUREG_DSSR,0);
|
||||
dscr=tpu_reg_rd(TPUREG_DSCR,0);
|
||||
if((dssr&TPU_BKPT)||(dscr&TPU_HOT4))
|
||||
test_dssrdscr_1=0;
|
||||
else
|
||||
test_dssrdscr_1=1;
|
||||
test_dscr_arm=dscr&TPU_BMSK;
|
||||
if (dssr&TPU_BKPT)
|
||||
test_dssr_bkpt=1;
|
||||
else
|
||||
test_dssr_bkpt=0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int tpu_halt(void)
|
||||
{
|
||||
int i;
|
||||
if(test_dssrdscr_1==0){
|
||||
/* already halted */
|
||||
/* return 0; */
|
||||
}
|
||||
tpu_reg_or(TPUREG_CREG,0,TPU_IMBTST); /* stop microengine */
|
||||
tpu_reg_wr(TPUREG_DSCR,0,TPU_HOT4|TPU_CLKS|test_dscr_arm);
|
||||
test_dssrdscr_1=0;
|
||||
/* old_cpr = CPR0,CPR1 */
|
||||
/* CPR0,CPR1 = 0 */
|
||||
for(i=0;i<5;i++){
|
||||
if(tpu_reg_rd(TPUREG_DSSR,0)&TPU_BKPT)
|
||||
tpu_reg_and(TPUREG_DSSR,0,~TPU_BKPT);
|
||||
tpu_reg_or(TPUREG_CREG,0,TPU_IMBTST|TPU_ACUT);
|
||||
}
|
||||
/* CPR0,CPR1 = old_cpr */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define TPU_UCODE_LEN 0x200
|
||||
|
||||
u_int32_t tpu_ucode_img[TPU_UCODE_LEN];
|
||||
|
||||
int tpu_ucode_read(int print)
|
||||
{
|
||||
int adr;
|
||||
u_int32_t ir;
|
||||
adr=0;
|
||||
|
||||
test_store_ir();
|
||||
|
||||
if(print)printf("reading microcode\n");
|
||||
tpu_reg_wr(TPUREG_PC,0,adr);
|
||||
for(;adr<TPU_UCODE_LEN;adr++){
|
||||
test_shift_irwr(0xffffffff);
|
||||
tpu_reg_or(TPUREG_CREG,0,TPU_ACUT);
|
||||
ir=test_shift_irrd();
|
||||
tpu_ucode_img[adr]=ir;
|
||||
if(print)printf(" %03X: %08lX\n",adr,(unsigned long)ir);
|
||||
}
|
||||
|
||||
test_restore_ir();
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************/
|
||||
/* Register read and write routines */
|
||||
|
||||
/* read TPU register - method 1 */
|
||||
int tpu_t1_rd(struct tpu_reg_des *des, int indx)
|
||||
{
|
||||
unsigned val;
|
||||
test_store_ir();
|
||||
if(des->flags&TPUREG_FL_DIOB){
|
||||
val=stored_diob; /* DIOB read */
|
||||
}else{
|
||||
if(des->flags&TPUREG_FL_PMOD)
|
||||
test_forced_inst(0xf403|(des->adr<<16)); /* P read */
|
||||
else
|
||||
test_forced_inst(0xfc03|(des->adr<<16)); /* rest */
|
||||
/* read value from mem 0xFFFF00 */
|
||||
val=tpu_reg_rd(TPUREG_DEBPAR,0);
|
||||
}
|
||||
test_restore_ir();
|
||||
if(des->flags&TPUREG_FL_SH4)
|
||||
val>>=4;
|
||||
return val;
|
||||
}
|
||||
|
||||
/* write TPU register - method 1 */
|
||||
int tpu_t1_wr(struct tpu_reg_des *des, int indx, int val)
|
||||
{
|
||||
int ret;
|
||||
test_store_ir();
|
||||
if(des->flags&TPUREG_FL_SH4)
|
||||
val<<=4;
|
||||
ret=tpu_reg_wr(TPUREG_DEBPAR,0,val);
|
||||
test_forced_inst(0x1ffffc03);
|
||||
if(des->flags&TPUREG_FL_DIOB){
|
||||
stored_diob=val; /* DIOB write */
|
||||
}else{
|
||||
test_forced_inst(0xffff|(des->adr1<<16)); /* rest */
|
||||
}
|
||||
test_restore_ir();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* read TPU register - method 2 */
|
||||
int tpu_t2_rd(struct tpu_reg_des *des, int indx)
|
||||
{
|
||||
return test_shift_regrd(des->adr,des->adr1);
|
||||
}
|
||||
|
||||
/* write TPU register - method 2 */
|
||||
int tpu_t2_wr(struct tpu_reg_des *des, int indx, int val)
|
||||
{
|
||||
return test_shift_regwr(des->adr,des->adr1,val);
|
||||
}
|
||||
|
||||
/* read 16 bit variable from main CPU address space */
|
||||
int tpu_mem_rd16(struct tpu_reg_des *des, int indx)
|
||||
{
|
||||
u_int16_t val;
|
||||
int adr=des->adr;
|
||||
if(indx){
|
||||
if(indx>=des->arr_len) return -1;
|
||||
adr+=2*indx;
|
||||
}
|
||||
val=TPU_RD16((caddr_t)adr);
|
||||
return val;
|
||||
|
||||
mem_op_error:
|
||||
fprintf(stderr,"tpu_mem_rd16 : read from address %06x error\n",adr);
|
||||
fflush(NULL);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* write 16 bit variable to main CPU address space */
|
||||
int tpu_mem_wr16(struct tpu_reg_des *des, int indx, int val)
|
||||
{
|
||||
int adr=des->adr;
|
||||
if(indx){
|
||||
if(indx>=des->arr_len) return -1;
|
||||
adr+=2*indx;
|
||||
}
|
||||
TPU_WR16((caddr_t)adr,val);
|
||||
return 0;
|
||||
|
||||
mem_op_error:
|
||||
fprintf(stderr,"tpu_mem_wr16 : write to address %06x error\n",adr);
|
||||
fflush(NULL);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Read TPU register */
|
||||
int tpu_reg_rd(int reg, int indx)
|
||||
{
|
||||
if((reg>TPUREG_MAX)||(tpu_regs[reg].reg_rd==NULL))
|
||||
return -1;
|
||||
return tpu_regs[reg].reg_rd(&tpu_regs[reg],indx);
|
||||
}
|
||||
|
||||
/* Write TPU register */
|
||||
int tpu_reg_wr(int reg, int indx, int val)
|
||||
{
|
||||
if((reg>TPUREG_MAX)||(tpu_regs[reg].reg_wr==NULL))
|
||||
return -1;
|
||||
return tpu_regs[reg].reg_wr(&tpu_regs[reg],indx,val);
|
||||
}
|
||||
|
||||
int tpu_reg_or(int reg, int indx, int val)
|
||||
{
|
||||
int reg_val;
|
||||
reg_val=tpu_reg_rd(reg,indx);
|
||||
reg_val|=val;
|
||||
tpu_reg_wr(reg,indx,reg_val);
|
||||
return reg_val;
|
||||
}
|
||||
|
||||
int tpu_reg_and(int reg, int indx, int val)
|
||||
{
|
||||
int reg_val;
|
||||
reg_val=tpu_reg_rd(reg,indx);
|
||||
reg_val&=val;
|
||||
tpu_reg_wr(reg,indx,reg_val);
|
||||
return reg_val;
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
|
||||
#define swap_l(x) (x>>24) | ((x>>8)&0xff00) | ((x<<8)&0xff0000) | ((x&0xff)<<24)
|
||||
|
||||
/* external TPU disassembler */
|
||||
void DisInst (unsigned long i, FILE * fp);
|
||||
|
||||
|
||||
int cpu_stat(void)
|
||||
{
|
||||
int ret;
|
||||
u_int rpc;
|
||||
|
||||
ret=bdmlib_getstatus();
|
||||
printf("MCU ");
|
||||
if(ret&BDM_TARGETRESET) printf("Reset ");
|
||||
if(ret&BDM_TARGETSTOPPED) printf("Stopped ");
|
||||
if(ret&BDM_TARGETPOWER) printf("NoPower ");
|
||||
if(ret&BDM_TARGETNC) printf("NoConnect ");
|
||||
printf("\n");
|
||||
if(ret&BDM_TARGETSTOPPED) {
|
||||
if((ret=bdmlib_get_sys_reg(BDM_REG_RPC, &rpc))<0) return ret;
|
||||
printf("RPC=0x%06x\n",swap_l(rpc));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int ret;
|
||||
|
||||
bdmlib_setdebug(1);
|
||||
if((ret=bdmlib_open(bdm_dev_name))<0)
|
||||
{ printf("bdmlib_open : %s\n",bdmlib_geterror_str(ret)); return 1; };
|
||||
bdmlib_setioctl(BDM_SPEED,0);
|
||||
if (!(bdmlib_getstatus() & BDM_TARGETSTOPPED))
|
||||
ret=bdmlib_ioctl(BDM_STOP_CHIP);
|
||||
|
||||
if(1){
|
||||
printf("We need to reset target for first run\n");
|
||||
if((ret=bdmlib_reset())<0){
|
||||
printf("Cannot reset target - exitting\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
if(cpu_stat()<0){
|
||||
printf("trying to reset !!!!!!!\n");
|
||||
ret=bdmlib_reset();
|
||||
cpu_stat();
|
||||
}
|
||||
|
||||
bdmlib_set_sys_reg(BDM_REG_DFC, 5);
|
||||
bdmlib_set_sys_reg(BDM_REG_SFC, 5);
|
||||
|
||||
ret=test_init_1();
|
||||
printf("test_init_1 returned %d\n",ret);
|
||||
ret=test_init_2();
|
||||
printf("test_init_2 returned %d\n",ret);
|
||||
printf("test_dssrdscr_1(run)=%d test_dscr_arm=0x%02x test_dssr_bkpt=%d\n",
|
||||
test_dssrdscr_1,test_dscr_arm,test_dssr_bkpt);
|
||||
|
||||
fflush(NULL);
|
||||
|
||||
// tpu_halt();
|
||||
|
||||
printf("DCNR %04X\n",tpu_reg_rd(TPUREG_DCNR,0));
|
||||
printf("DSCR %04X\n",tpu_reg_rd(TPUREG_DSCR,0));
|
||||
|
||||
// tpu_reg_or(TPUREG_CREG,0,TPU_IMBTST); /* stop microengine */
|
||||
// tpu_reg_or(TPUREG_DSCR,0,0x8200); /* ???????????? */
|
||||
|
||||
printf("P %04X DIOB %04X A %04X SR %04X DEC %01X\n"
|
||||
"ERT %04X TCR1 %04X TCR2 %04X PC %03X CHAN %01X\n",
|
||||
tpu_reg_rd(TPUREG_P,0),tpu_reg_rd(TPUREG_DIOB,0),
|
||||
tpu_reg_rd(TPUREG_A,0),tpu_reg_rd(TPUREG_SR,0),
|
||||
tpu_reg_rd(TPUREG_DEC,0),tpu_reg_rd(TPUREG_ERT,0),
|
||||
tpu_reg_rd(TPUREG_TCR1,0),tpu_reg_rd(TPUREG_TCR2,0),
|
||||
tpu_reg_rd(TPUREG_PC,0),tpu_reg_rd(TPUREG_CHAN,0));
|
||||
|
||||
if(0){
|
||||
printf("TCR2 %04X\n",tpu_reg_rd(TPUREG_TCR2,0));
|
||||
printf("TCR1 %04X\n",tpu_reg_rd(TPUREG_TCR1,0));
|
||||
printf("TCR2 %04X\n",tpu_reg_rd(TPUREG_TCR2,0));
|
||||
|
||||
tpu_reg_wr(TPUREG_P ,0,0xABCD);tpu_reg_wr(TPUREG_DIOB,0,0xEF01);
|
||||
tpu_reg_wr(TPUREG_A ,0,0x2345);tpu_reg_wr(TPUREG_SR ,0,0x6789);
|
||||
tpu_reg_wr(TPUREG_DEC ,0, 0xA);tpu_reg_wr(TPUREG_ERT ,0,0xBCDE);
|
||||
tpu_reg_wr(TPUREG_TCR1,0,0xF012);tpu_reg_wr(TPUREG_TCR2,0,0x3456);
|
||||
tpu_reg_wr(TPUREG_PC ,0, 0x789);tpu_reg_wr(TPUREG_CHAN,0, 0xB);
|
||||
}
|
||||
|
||||
{
|
||||
int i;
|
||||
tpu_ucode_read(0);
|
||||
|
||||
for(i=0;i<TPU_UCODE_LEN;i++){
|
||||
printf("%03x: %08x ",i,tpu_ucode_img[i]);
|
||||
DisInst (tpu_ucode_img[i],stdout);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
684
m683xx/bdm-load/tpudis.c
Normal file
684
m683xx/bdm-load/tpudis.c
Normal file
@@ -0,0 +1,684 @@
|
||||
/*******************************************************************
|
||||
|
||||
TPUDB Project to Create Free Motorola 683xx TPU Debugger
|
||||
|
||||
tpudis.c - TPU microcode disassembler
|
||||
|
||||
(C) Copyright 2000 by Wouter Vlothuizen - Original Author
|
||||
e-mail: wouter@vlothuizen.demon.nl
|
||||
|
||||
This package can be copied and modified under
|
||||
GNU General Public License with all its conditions.
|
||||
See file GPL for details. Under this license nobody can
|
||||
distribute this work and any derived work without full source code
|
||||
for all modules compiled and linked into executable.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
|
||||
static FILE *f;
|
||||
static unsigned long inst;
|
||||
|
||||
void
|
||||
Error (char *s)
|
||||
{
|
||||
fprintf (stderr, "\ntpudis: %s\n", s);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
|
||||
#define put(x) s=x
|
||||
#define I(h,l) ( (inst>>(l)) & (((1<<((h)+1-(l))))-1) )
|
||||
|
||||
void
|
||||
T1ABS (void)
|
||||
{
|
||||
char *s=NULL;
|
||||
|
||||
switch (I (28, 25))
|
||||
{
|
||||
case 0:
|
||||
put ("plow");
|
||||
break;
|
||||
case 1:
|
||||
put ("phi");
|
||||
break;
|
||||
case 2:
|
||||
put ("dec");
|
||||
break;
|
||||
case 3:
|
||||
put ("chan");
|
||||
break;
|
||||
case 4:
|
||||
put ("#0 special");
|
||||
break;
|
||||
case 5:
|
||||
put ("{Illegal T1ABS: 5}");
|
||||
break;
|
||||
case 6:
|
||||
put ("{Illegal T1ABS: 6}");
|
||||
break;
|
||||
case 7:
|
||||
put ("#0");
|
||||
break;
|
||||
case 8:
|
||||
put ("p");
|
||||
break;
|
||||
case 9:
|
||||
put ("a");
|
||||
break;
|
||||
case 10:
|
||||
put ("sr");
|
||||
break;
|
||||
case 11:
|
||||
put ("diob");
|
||||
break;
|
||||
case 12:
|
||||
put ("tcr1");
|
||||
break;
|
||||
case 13:
|
||||
put ("tcr2");
|
||||
break;
|
||||
case 14:
|
||||
put ("ert");
|
||||
break;
|
||||
case 15:
|
||||
put ("#0");
|
||||
break;
|
||||
default:
|
||||
Error ("T1ABS decoding error");
|
||||
}
|
||||
fprintf (f, "%s + ", s);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
T3ABD (void)
|
||||
{
|
||||
char *s=NULL;
|
||||
|
||||
switch (inst >> 21 & 0xF)
|
||||
{
|
||||
case 0:
|
||||
put ("a");
|
||||
break;
|
||||
case 1:
|
||||
put ("sr");
|
||||
break;
|
||||
case 2:
|
||||
put ("ert");
|
||||
break;
|
||||
case 3:
|
||||
put ("diob");
|
||||
break;
|
||||
case 4:
|
||||
put ("phi");
|
||||
break;
|
||||
case 5:
|
||||
put ("{Illegal T3ABD: 5}");
|
||||
break;
|
||||
case 6:
|
||||
put ("plow");
|
||||
break;
|
||||
case 7:
|
||||
put ("p");
|
||||
break;
|
||||
case 8:
|
||||
put ("link");
|
||||
break;
|
||||
case 9:
|
||||
put ("chan");
|
||||
break;
|
||||
case 10:
|
||||
put ("dec");
|
||||
break;
|
||||
case 11:
|
||||
put ("dec&chan");
|
||||
break;
|
||||
case 12:
|
||||
put ("tcr1");
|
||||
break;
|
||||
case 13:
|
||||
put ("tcr2");
|
||||
break;
|
||||
case 14:
|
||||
put ("{Illegal T3ABD: 14}");
|
||||
break;
|
||||
case 15:
|
||||
put ("Nil");
|
||||
break;
|
||||
default:
|
||||
Error ("T3ABD decoding error");
|
||||
}
|
||||
fprintf (f, "AU %s :=", s);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SHF (void)
|
||||
{
|
||||
char *s=NULL;
|
||||
|
||||
switch (inst >> 19 & 3)
|
||||
{
|
||||
case 0:
|
||||
s = "<<";
|
||||
break;
|
||||
case 1:
|
||||
s = ">>";
|
||||
break;
|
||||
case 2:
|
||||
s = "R>";
|
||||
break;
|
||||
case 3:
|
||||
s = "";
|
||||
break;
|
||||
default:
|
||||
Error ("SHF decoding error");
|
||||
}
|
||||
fprintf (f, "%s ", s);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
T1BBSetc (void)
|
||||
{
|
||||
char *s=NULL;
|
||||
|
||||
switch (inst >> 14 & 7)
|
||||
{
|
||||
case 0:
|
||||
s = "p";
|
||||
break;
|
||||
case 1:
|
||||
s = "a";
|
||||
break;
|
||||
case 2:
|
||||
s = "sr";
|
||||
break;
|
||||
case 3:
|
||||
s = "diob";
|
||||
break;
|
||||
case 7:
|
||||
s = "#0";
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
s = "{Illegal T1BBS}";
|
||||
break;
|
||||
default:
|
||||
Error ("T1BBS decoding error");
|
||||
}
|
||||
fprintf (f, "%s%s%s ",
|
||||
inst & (1L << 12) ? "" : "!", s, inst & (1L << 13) ? "" : " + 1");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SRCCCL (void)
|
||||
{
|
||||
if (~inst & (1L << 18))
|
||||
fprintf (f, ", ensr");
|
||||
if (~inst & (1L << 17))
|
||||
fprintf (f, ", cc");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
T1BBI (void)
|
||||
{
|
||||
fprintf (f, "#$%2lx", inst >> 9 & 0xFF);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DECEND (void)
|
||||
{
|
||||
char *s=NULL;
|
||||
|
||||
switch (inst & 3)
|
||||
{
|
||||
case 0:
|
||||
s = "DEC_RTS";
|
||||
break;
|
||||
case 1:
|
||||
s = "DEC_RPT";
|
||||
break;
|
||||
case 2:
|
||||
s = "end";
|
||||
break;
|
||||
case 3:
|
||||
return;
|
||||
default:
|
||||
Error ("DECEND decoding error");
|
||||
}
|
||||
fprintf (f, "%s", s);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
IOMetc (int rwPos)
|
||||
{
|
||||
char *fm=NULL;
|
||||
int aid=0;
|
||||
|
||||
switch (inst >> 9 & 7)
|
||||
{
|
||||
case 0:
|
||||
fm = "RAM p %s @prm%d ; ";
|
||||
aid = inst >> 2 & 7;
|
||||
break;
|
||||
case 1:
|
||||
fm = "RAM p %s by_diob ; ";
|
||||
break;
|
||||
case 2:
|
||||
fm = "RAM p %s @$%x ; ";
|
||||
aid = inst >> 2 & 0x7F;
|
||||
break;
|
||||
case 4:
|
||||
fm = "RAM diob %s @prm%d ; ";
|
||||
aid = inst >> 2 & 7;
|
||||
break;
|
||||
case 5:
|
||||
fm = "RAM diob %s by_diob ; ";
|
||||
break;
|
||||
case 6:
|
||||
fm = "RAM diob %s @$%x ; ";
|
||||
aid = inst >> 2 & 0x7F;
|
||||
break;
|
||||
case 3:
|
||||
case 7:
|
||||
return;
|
||||
default:
|
||||
Error ("IOM decoding error");
|
||||
|
||||
}
|
||||
fprintf (f, fm, inst & (1L << rwPos) ? "->" : "<-", aid);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
CJCetc (void)
|
||||
{
|
||||
char *s=NULL;
|
||||
|
||||
if (I (29, 16) == 0x3FFF)
|
||||
return;
|
||||
|
||||
switch (inst >> 26 & 0xF)
|
||||
{
|
||||
case 0:
|
||||
s = "LESS_THAN";
|
||||
break;
|
||||
case 1:
|
||||
s = "LOW_SAME";
|
||||
break;
|
||||
case 2:
|
||||
s = "V";
|
||||
break;
|
||||
case 3:
|
||||
s = "N";
|
||||
break;
|
||||
case 4:
|
||||
s = "C";
|
||||
break;
|
||||
case 5:
|
||||
s = "Z";
|
||||
break;
|
||||
case 6:
|
||||
s = "cflg1";
|
||||
break;
|
||||
case 7:
|
||||
s = "cflg0";
|
||||
break;
|
||||
case 8:
|
||||
s = "TDL";
|
||||
break;
|
||||
case 9:
|
||||
s = "MRL";
|
||||
break;
|
||||
case 10:
|
||||
s = "LSL";
|
||||
break;
|
||||
case 11:
|
||||
s = "SEQ1";
|
||||
break;
|
||||
case 12:
|
||||
s = "SEQ0";
|
||||
break;
|
||||
case 13:
|
||||
s = "PSL";
|
||||
break;
|
||||
case 14:
|
||||
s = "{Illegal branch}";
|
||||
break;
|
||||
case 15:
|
||||
s = "false";
|
||||
break;
|
||||
default:
|
||||
Error ("CJC decoding error");
|
||||
}
|
||||
fprintf (f, "if %s = %s then goto $%lx%s; ",
|
||||
s,
|
||||
inst & (1L << 8) ? "true" : "false",
|
||||
inst >> 16 & 0x1FF, inst & (1L << 25) ? "" : ", flsh");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
NMAetc (void)
|
||||
{
|
||||
char *s=NULL;
|
||||
|
||||
switch (inst >> 26 & 3)
|
||||
{
|
||||
case 0:
|
||||
s = "jmp";
|
||||
break;
|
||||
case 1:
|
||||
s = "jsr";
|
||||
break;
|
||||
case 2:
|
||||
s = "rts";
|
||||
break;
|
||||
case 3:
|
||||
return;
|
||||
default:
|
||||
Error ("NMA decoding error");
|
||||
}
|
||||
fprintf (f, "%s%s $%lx ; ", s, inst & (1L << 25) ? "" : " ,flsh",
|
||||
inst >> 16 & 0x1FF);
|
||||
}
|
||||
|
||||
void
|
||||
TBS (void)
|
||||
{
|
||||
char *s=NULL;
|
||||
|
||||
switch (I (15, 12))
|
||||
{
|
||||
case 0:
|
||||
s = "in_mtcr1_ctcr1";
|
||||
break;
|
||||
case 1:
|
||||
s = "in_mtcr2_ctcr1";
|
||||
break;
|
||||
case 2:
|
||||
s = "in_mtcr1_ctcr2";
|
||||
break;
|
||||
case 3:
|
||||
s = "in_mtcr2_ctcr2";
|
||||
break;
|
||||
case 4:
|
||||
s = "out_mtcr1_ctcr1";
|
||||
break;
|
||||
case 5:
|
||||
s = "out_mtcr2_ctcr1";
|
||||
break;
|
||||
case 6:
|
||||
s = "out_mtcr1_ctcr2";
|
||||
break;
|
||||
case 7:
|
||||
s = "out_mtcr2_ctcr2";
|
||||
break;
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
return;
|
||||
default:
|
||||
Error ("TBS decoding error");
|
||||
}
|
||||
fprintf (f, "tbs:=%s ", s);
|
||||
}
|
||||
|
||||
void
|
||||
ERWTDLMRL (void)
|
||||
{
|
||||
if (~inst & (1L << 29))
|
||||
fprintf (f, "write_mer ");
|
||||
if (~inst & (1L << 18))
|
||||
fprintf (f, "neg_tdl ");
|
||||
if (~inst & (1L << 17))
|
||||
fprintf (f, "neg_mrl ");
|
||||
}
|
||||
|
||||
void
|
||||
PSC (void)
|
||||
{
|
||||
char *s=NULL;
|
||||
|
||||
switch (I (7, 6))
|
||||
{
|
||||
case 0:
|
||||
s = "PAC";
|
||||
break;
|
||||
case 1:
|
||||
s = "high";
|
||||
break;
|
||||
case 2:
|
||||
s = "low";
|
||||
break;
|
||||
case 3:
|
||||
return;
|
||||
default:
|
||||
Error ("PSC decoding error");
|
||||
}
|
||||
fprintf (f, "pin:=%s ", s);
|
||||
}
|
||||
|
||||
void
|
||||
PAC (void)
|
||||
{
|
||||
char *s=NULL;
|
||||
|
||||
switch (I (11, 9))
|
||||
{
|
||||
case 0:
|
||||
s = "off";
|
||||
break;
|
||||
case 1:
|
||||
s = "high";
|
||||
break;
|
||||
case 2:
|
||||
s = "low";
|
||||
break;
|
||||
case 3:
|
||||
s = "h+l";
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
return;
|
||||
default:
|
||||
Error ("PAC decoding error");
|
||||
}
|
||||
fprintf (f, "pac:=%s ", s);
|
||||
}
|
||||
|
||||
void
|
||||
FLC (int pos) /* at position 5 or 15 */
|
||||
{
|
||||
char *s=NULL;
|
||||
|
||||
fprintf (f, "chan ");
|
||||
switch (I (pos, pos - 2))
|
||||
{
|
||||
case 0:
|
||||
s = "clr cflg0";
|
||||
break;
|
||||
case 1:
|
||||
s = "set cflg0";
|
||||
break;
|
||||
case 2:
|
||||
s = "clr cflg1";
|
||||
break;
|
||||
case 3:
|
||||
s = "set cflg1";
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
return;
|
||||
default:
|
||||
Error ("FLC decoding error");
|
||||
}
|
||||
fprintf (f, "%s ", s);
|
||||
}
|
||||
|
||||
void
|
||||
LSL (int pos) /* at position 8 or 12 */
|
||||
{
|
||||
if (~inst & (1L << pos))
|
||||
fprintf (f, "neg_lsr ");
|
||||
}
|
||||
|
||||
void
|
||||
CIR (void)
|
||||
{
|
||||
if (~inst & (1L << 2))
|
||||
fprintf (f, "pir ");
|
||||
}
|
||||
|
||||
void
|
||||
CCM (void)
|
||||
{
|
||||
if (~inst & (1L << 2))
|
||||
fprintf (f, "by_p ");
|
||||
}
|
||||
|
||||
void
|
||||
MTD (void)
|
||||
{
|
||||
char *s=NULL;
|
||||
|
||||
switch (I (1, 0))
|
||||
{
|
||||
case 0:
|
||||
s = "en";
|
||||
break;
|
||||
case 1:
|
||||
s = "ds";
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
return;
|
||||
default:
|
||||
Error ("MTD decoding error");
|
||||
}
|
||||
fprintf (f, "%ssr ", s);
|
||||
}
|
||||
|
||||
void
|
||||
sep (void)
|
||||
{
|
||||
fprintf (f, "; ");
|
||||
}
|
||||
|
||||
void
|
||||
DisInst (unsigned long i, FILE * fp)
|
||||
{
|
||||
f = fp;
|
||||
inst = i;
|
||||
|
||||
if (inst != 0xffffffff)
|
||||
switch (inst >> 30 & 3) /* type of instruction */
|
||||
{
|
||||
case 0: /* format 1 */
|
||||
T3ABD ();
|
||||
SHF ();
|
||||
T1ABS ();
|
||||
T1BBSetc ();
|
||||
SRCCCL ();
|
||||
sep ();
|
||||
IOMetc (29);
|
||||
DECEND ();
|
||||
break;
|
||||
case 1: /* format 2 */
|
||||
T3ABD ();
|
||||
SHF ();
|
||||
T1ABS ();
|
||||
T1BBSetc ();
|
||||
sep ();
|
||||
FLC (5);
|
||||
ERWTDLMRL ();
|
||||
PAC ();
|
||||
LSL (8);
|
||||
PSC ();
|
||||
CIR ();
|
||||
sep ();
|
||||
DECEND ();
|
||||
break;
|
||||
case 2: /* format 3 */
|
||||
CJCetc ();
|
||||
FLC (5);
|
||||
TBS ();
|
||||
PAC ();
|
||||
PSC ();
|
||||
CCM ();
|
||||
MTD ();
|
||||
break;
|
||||
case 3:
|
||||
if (inst & (1L << 29)) /* format 5 */
|
||||
{
|
||||
T3ABD ();
|
||||
SHF ();
|
||||
T1ABS ();
|
||||
T1BBI ();
|
||||
SRCCCL ();
|
||||
sep ();
|
||||
FLC (5);
|
||||
LSL (8);
|
||||
CIR ();
|
||||
sep ();
|
||||
}
|
||||
else /* format 4 */
|
||||
{
|
||||
NMAetc ();
|
||||
FLC (15);
|
||||
LSL (12);
|
||||
sep ();
|
||||
IOMetc (28);
|
||||
}
|
||||
DECEND ();
|
||||
break;
|
||||
default:
|
||||
Error ("format decoding error");
|
||||
}
|
||||
fprintf (f, "\n");
|
||||
}
|
||||
|
||||
#if 0
|
||||
void
|
||||
EntryPoint (unsigned int ep)
|
||||
{
|
||||
int pc;
|
||||
|
||||
pc = ep & 0x1FF;
|
||||
|
||||
if (ep >> 9 & 3 == 0)
|
||||
{
|
||||
fprintf (f, "Error in EntryPoint format\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf (f, "PreLoad=%d ME=%d PPD=%4s PC=$%03x\n",
|
||||
ep >> 13 & 7,
|
||||
ep & (1L << 12) ? 1 : 0, ep & (1L << 11) ? "DIOB" : "P", pc);
|
||||
epCnt[pc]++;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
28
m683xx/gdb-5.2.1-bdm-patches-pi1.lsm
Normal file
28
m683xx/gdb-5.2.1-bdm-patches-pi1.lsm
Normal file
@@ -0,0 +1,28 @@
|
||||
Begin4
|
||||
Title: gdb-5.2.1-bdm-patches
|
||||
Version: 1.8.3
|
||||
Entered-date: 2002-11-04
|
||||
Description: Background Debug Mode interface for Motorola CPU32 and Linux
|
||||
These are the patches for gdb-5.2.1 to enable remote debugging
|
||||
for a 683xx target with BDM under Linux and Linux kernel BDM
|
||||
driver sources.
|
||||
Patches are usable for insight-5.2.1 as well.
|
||||
Both Public Domain and ICD interfaces are supported.
|
||||
* More info can be found at
|
||||
http://cmp.felk.cvut.cz/~pisa/m683xx/bdm_driver.html
|
||||
* WWW access to patches
|
||||
http://cmp.felk.cvut.cz/~pisa/m683xx/
|
||||
Keywords: debugger GDB m68k 68332 683xx BDM ICE driver embedded
|
||||
Author: Scott_Howard-SCN088@email.mot.com
|
||||
Jeff@RyeHam.EE.Ryerson.Ca (D.Jeff Dionne)
|
||||
magin@skil.camelot.de (Gunter Magin)
|
||||
pisa@cvlinux.felk.cvut.cz (Pavel Pisa)
|
||||
Maintained-by: pisa@cvlinux.felk.cvut.cz (Pavel Pisa)
|
||||
Primary-site: metalab.unc.edu /pub/Linux/devel/debuggers
|
||||
320 kB gdb-5.2.1-bdm-patches-pi1.tar.gz
|
||||
Alternate-site: ftp.cygnus.com /pub/embedded
|
||||
320 kB gdb-5.2.1-bdm-patches-pi1.tar.gz
|
||||
Original-site: freeware.aus.sps.mot.com
|
||||
Platforms: Linux 2.0.xx, 2.2.yy, 2.4.zz ( last tested 2.4.7 )
|
||||
Copying-policy: GPL
|
||||
End
|
||||
4645
m683xx/gdb-5.2.1-bdm.patch-1
Normal file
4645
m683xx/gdb-5.2.1-bdm.patch-1
Normal file
File diff suppressed because it is too large
Load Diff
5240
m683xx/gdb-5.3-bdm-683xx-patch
Normal file
5240
m683xx/gdb-5.3-bdm-683xx-patch
Normal file
File diff suppressed because it is too large
Load Diff
41
m683xx/insight-5.3-bdm-683xx-patch
Normal file
41
m683xx/insight-5.3-bdm-683xx-patch
Normal file
@@ -0,0 +1,41 @@
|
||||
diff -Nurd insight-5.3.orig/gdb/gdbtk/generic/gdbtk-hooks.c insight-5.3.patched/gdb/gdbtk/generic/gdbtk-hooks.c
|
||||
--- insight-5.3.orig/gdb/gdbtk/generic/gdbtk-hooks.c 2002-07-03 19:38:22.000000000 +0200
|
||||
+++ insight-5.3.patched/gdb/gdbtk/generic/gdbtk-hooks.c 2003-09-05 14:02:42.000000000 +0200
|
||||
@@ -518,6 +518,10 @@
|
||||
gdbtk_call_command (struct cmd_list_element *cmdblk,
|
||||
char *arg, int from_tty)
|
||||
{
|
||||
+ struct cleanup *old_chain;
|
||||
+
|
||||
+ old_chain = make_cleanup (null_cleanup, 0);
|
||||
+
|
||||
running_now = 0;
|
||||
if (cmdblk->class == class_run || cmdblk->class == class_trace)
|
||||
{
|
||||
@@ -532,6 +536,8 @@
|
||||
}
|
||||
else
|
||||
cmd_func (cmdblk, arg, from_tty);
|
||||
+
|
||||
+ do_cleanups (old_chain);
|
||||
}
|
||||
|
||||
/* Called after a `set' command succeeds. Runs the Tcl hook
|
||||
diff -Nurd insight-5.3.orig/gdb/gdbtk/library/targetselection.itb insight-5.3.patched/gdb/gdbtk/library/targetselection.itb
|
||||
--- insight-5.3.orig/gdb/gdbtk/library/targetselection.itb 2002-02-12 21:05:14.000000000 +0100
|
||||
+++ insight-5.3.patched/gdb/gdbtk/library/targetselection.itb 2003-09-05 14:02:57.000000000 +0200
|
||||
@@ -261,6 +261,14 @@
|
||||
set gdb_target(vxworks,cmd) "vxworks ethX"
|
||||
set gdb_target(vxworks,runlist) { 1 0 1 1}
|
||||
set gdb_target(vxworks,after_attaching) { sym vxWorks.st }
|
||||
+
|
||||
+ # BDM
|
||||
+ set gdb_target(bdm,pretty-name) "BDM"
|
||||
+ set gdb_target(bdm,defbaud) ""
|
||||
+ set gdb_target(bdm,baud-rates) {}
|
||||
+ set gdb_target(bdm,cmd) "bdm /dev/icd_bdm0"
|
||||
+ set gdb_target(bdm,runlist) {1 0 1 0}
|
||||
+ set gdb_target(bdm,after_attaching) "reset"
|
||||
}
|
||||
|
||||
body TargetSelection::default_port {} {
|
||||
221
m683xx/scripts/profi360.gdb
Normal file
221
m683xx/scripts/profi360.gdb
Normal file
@@ -0,0 +1,221 @@
|
||||
# invoke by "source run376.gdb"
|
||||
|
||||
echo Setting bdm\n
|
||||
|
||||
file m.out
|
||||
|
||||
target bdm /dev/bdm
|
||||
#target bdm /dev/icd_bdm0
|
||||
#target bdm /dev/pd_bdm0
|
||||
|
||||
#===========================================================
|
||||
# sets chipselects and configuration
|
||||
|
||||
define set_CS_BR
|
||||
#$arg0 = BA31-BA11
|
||||
#$arg1 = Offset From REGB
|
||||
set *(unsigned int*)($ptr_REGB+$arg1) = ((unsigned int)$arg0)+1
|
||||
#p /ox *(unsigned int*)($ptr_REGB+$arg1)
|
||||
end
|
||||
|
||||
define set_CS_OR
|
||||
#$arg0 = AM27-AM11
|
||||
#$arg1 = Number Of Wait States
|
||||
#$arg2 = Sram Port Size
|
||||
#$arg3 = Offset From REGB
|
||||
set *(unsigned int*)($ptr_REGB+$arg3) = $arg0+(($arg1+1) << 28)+($arg2 << 1)
|
||||
#p /ox *(unsigned int*)($ptr_REGB+$arg3)
|
||||
end
|
||||
|
||||
define bdm_hw_init
|
||||
echo bdm_hw_init ...\n
|
||||
|
||||
set remotecache off
|
||||
bdm_timetocomeup 0
|
||||
bdm_autoreset off
|
||||
bdm_setdelay 70
|
||||
bdm_reset
|
||||
bdm_setdelay 0
|
||||
set $sfc=5
|
||||
set $dfc=5
|
||||
|
||||
|
||||
# system configuration
|
||||
|
||||
# MBAR Module Base Address Register
|
||||
# 31 30 13 12 11 10 9 8 1 0
|
||||
# BA31 BA30 .... BA13 0 0 0 AS8 AS7 ... AS0 V
|
||||
# BA = BaseAddress
|
||||
# AS = Address Space = Maskovani adresniho prostoru
|
||||
# V = data valid
|
||||
# set *(unsigned int *)0x0003ff00=0
|
||||
set $sfc=7
|
||||
set $dfc=7
|
||||
set $ptr_MBAR = (unsigned int *)0x0003ff00
|
||||
set *$ptr_MBAR = 0x0ffffe001
|
||||
set $ptr_DPRBASE = (unsigned char *)0x0ffffe000
|
||||
set $ptr_REGB = $ptr_DPRBASE + 0x1000
|
||||
set $sfc=5
|
||||
set $dfc=5
|
||||
|
||||
|
||||
#diody
|
||||
set $ptr_PADIR = (unsigned short *)($ptr_REGB + 0x550)
|
||||
set *$ptr_PADIR = 0xf000
|
||||
set $ptr_PAPAR = (unsigned short *)($ptr_REGB + 0x552)
|
||||
set *$ptr_PAPAR = 0
|
||||
set $ptr_PAODR = (unsigned short *)($ptr_REGB + 0x554)
|
||||
set *$ptr_PAODR = 0xffff
|
||||
set $ptr_PADAT = (unsigned short *)($ptr_REGB + 0x556)
|
||||
set *$ptr_PADAT = 0xefff
|
||||
|
||||
# MCR Module Configuration Register - urcuje, zda konfigurace SIM60 se muze cist/zapisovat kdykoli
|
||||
# 31 30 29 28 ... 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 0
|
||||
# BR040ID2-BR040ID0 - - BSTM ASTM FRZ1-FRZ0 BCLROID2-BCLOID0 SHEN1-SHEN0 SUPV BCLRISM2-BCLRISM0 IARB3-IARB0
|
||||
# nebo BCLRIID2-BCLRIID0
|
||||
# 0 0 0 - - 0 0 ? ?
|
||||
set *(unsigned int *)($ptr_REGB + 0x000) = 0x00006c7f
|
||||
#set *(unsigned int *)($ptr_REGB + 0x000) = 0x00006c71
|
||||
|
||||
#PEPAR config
|
||||
set *(unsigned short*)($ptr_REGB + 0x16) = 0x0080
|
||||
|
||||
#GMR
|
||||
set *(unsigned int *)($ptr_REGB + 0x40) = 0x00001100
|
||||
|
||||
#SYPCR
|
||||
set *($ptr_REGB + 0x22) = 0x03
|
||||
|
||||
#settings for chip selects
|
||||
|
||||
#set_CS_BR BaseAddress OffsetFromREGB
|
||||
#set_CS_OR AddressMask NumberOfWaitStates(0-14) SramPortSize OffsetFromREGB
|
||||
|
||||
#CS0 - BootFlash 1 MB - 16Bit
|
||||
set_CS_BR 0x0000000 0x50
|
||||
set_CS_OR 0xff00000 0 1 0x54
|
||||
|
||||
#CS1 - Flash 2MB - 32Bit
|
||||
set_CS_BR 0x0200000 0x60
|
||||
set_CS_OR 0xfe00000 0 0 0x64
|
||||
|
||||
#CS7 - SRAM 2 MB - 32Bit
|
||||
set_CS_BR 0x0400000 0xc0
|
||||
set_CS_OR 0xfe00000 0 0 0xc4
|
||||
|
||||
#CS6 - USB Chip - 8Bit
|
||||
set_CS_BR 0x0800000 0xb0
|
||||
set_CS_OR 0xf800000 0 2 0xb4
|
||||
|
||||
|
||||
|
||||
|
||||
# CPU registers
|
||||
|
||||
# SR=PS Status Register
|
||||
# 15 14 13 12 11 10 8 7 6 5 4 3 2 1 0
|
||||
# T1 T0 S 0 0 IP___ 0 0 0 X N Z V C
|
||||
# 0 0 1 0 0 1 1 1 0 0 0 U U U U U
|
||||
|
||||
bdm_setdelay 1
|
||||
|
||||
bdm_status
|
||||
|
||||
end
|
||||
#===========================================================
|
||||
|
||||
# sets well defined values into VBR
|
||||
define vbr_set_all
|
||||
set $vec_num=0
|
||||
set $vbr_val=(unsigned)$vbr
|
||||
while $vec_num<256
|
||||
set *(unsigned*)($vbr_val+$vec_num*4)=($vec_num*16)+0xf0000
|
||||
set $vec_num++
|
||||
end
|
||||
end
|
||||
|
||||
# Test writability of RAM location
|
||||
define bdm_test_ram_acc
|
||||
echo testing ...
|
||||
p /x $arg0
|
||||
set $ram_addr=(unsigned int)$arg0
|
||||
set $old_ram_val=*(int*)$ram_addr
|
||||
set *(int*)$ram_addr=0x12345678
|
||||
if *(int*)$ram_addr!=0x12345678
|
||||
echo Error1\n
|
||||
end
|
||||
set *(char*)$ram_addr=0xab
|
||||
if *(int*)$ram_addr!=0xab345678
|
||||
echo Error2\n
|
||||
end
|
||||
set *(char*)($ram_addr+1)=0xcd
|
||||
if *(int*)$ram_addr!=0xabcd5678
|
||||
echo Error3\n
|
||||
end
|
||||
set *(char*)($ram_addr+3)=0x01
|
||||
if *(int*)$ram_addr!=0xabcd5601
|
||||
echo Error4\n
|
||||
end
|
||||
set *(char*)($ram_addr+2)=0xef
|
||||
if *(int*)$ram_addr!=0xabcdef01
|
||||
echo Error5\n
|
||||
end
|
||||
set *(int*)$ram_addr=$old_ram_val
|
||||
end
|
||||
|
||||
# Read flash identification
|
||||
define bdm_read_flash_id
|
||||
set $flash_base=(int)$arg0&~0xffff
|
||||
output /x $flash_base
|
||||
echo \n
|
||||
set *(char*)($flash_base+0x555*2+1)=0xf0
|
||||
set *(char*)($flash_base+0x555*2+1)=0xaa
|
||||
set *(char*)($flash_base+0x2aa*2+1)=0x55
|
||||
set *(char*)($flash_base+0x555*2+1)=0x90
|
||||
p /x *(char*)($flash_base+0x00*2+1)
|
||||
set *(char*)($flash_base+0x555*2+1)=0xf0
|
||||
set *(char*)($flash_base+0x555*2+1)=0xaa
|
||||
set *(char*)($flash_base+0x2aa*2+1)=0x55
|
||||
set *(char*)($flash_base+0x555*2+1)=0x90
|
||||
p /x *(char*)($flash_base+0x01*2+1)
|
||||
end
|
||||
|
||||
define bdm_read_flash1_id
|
||||
bdm_read_flash_id 0x800000
|
||||
end
|
||||
|
||||
define bdm_read_flash2_id
|
||||
bdm_read_flash_id 0x900000
|
||||
end
|
||||
|
||||
define bdm_test_flash_write
|
||||
# set $flash_base=(int)$arg0 & ~0xfffff
|
||||
set $flash_base=(int)$arg0
|
||||
output /x $flash_base
|
||||
echo \n
|
||||
# set *(char*)($flash_base+0x5555*2+1)=0xf0
|
||||
# set *(short*)($flash_base+0x25554)=0xaaaa
|
||||
# set *(short*)($flash_base+0x02aaa)=0x5555
|
||||
# set *(short*)($flash_base+0x25554)=0xA0A0
|
||||
set *(short*)(0x825554)=0xf0f0
|
||||
set *(short*)(0x825554)=0xaaaa
|
||||
set *(short*)(0x802aaa)=0x5555
|
||||
set *(short*)(0x825554)=0xA0A0
|
||||
set *(short*)($arg0)=$arg1
|
||||
end
|
||||
|
||||
|
||||
bdm_hw_init
|
||||
|
||||
b do_trap_break
|
||||
b exception_hook_nop
|
||||
#b profi_rx_internal
|
||||
#b write
|
||||
#b smc_uart_tx
|
||||
#b smc_interrupt
|
||||
#b quicc_init
|
||||
|
||||
b main
|
||||
|
||||
#run
|
||||
|
||||
335
m683xx/scripts/run332.gdb
Normal file
335
m683xx/scripts/run332.gdb
Normal file
@@ -0,0 +1,335 @@
|
||||
# invoke by "source run376.gdb"
|
||||
|
||||
echo Setting bdm\n
|
||||
|
||||
#set prompt (gdb68)
|
||||
|
||||
file tst
|
||||
|
||||
target bdm /dev/bdm
|
||||
#target bdm /dev/icd_bdm0
|
||||
#target bdm /dev/pd_bdm0
|
||||
|
||||
#===========================================================
|
||||
# sets chipselects and configuration
|
||||
define bdm_hw_init
|
||||
echo bdm_hw_init ...\n
|
||||
|
||||
set remotecache off
|
||||
bdm_timetocomeup 0
|
||||
bdm_autoreset off
|
||||
bdm_setdelay 100
|
||||
bdm_reset
|
||||
bdm_setdelay 0
|
||||
set $sfc=5
|
||||
set $dfc=5
|
||||
|
||||
# system configuration
|
||||
|
||||
# 0xFFFA00 - SIMCR - SIM Configuration Register
|
||||
# 15 14 13 12 11 10 9 8 7 6 5 4 3 0
|
||||
# EXOFF FRZSW FRZBM 0 SLVEN 0 SHEN SUPV MM 0 0 IARB
|
||||
# 0 0 0 0 DATA11 0 0 0 1 1 0 0 1 1 1 1
|
||||
set *(short *)0xfffa00=0x42cf
|
||||
|
||||
# 0xFFFA21 - SYPCR - System Protection Control Register
|
||||
# 7 6 5 4 3 2 1 0
|
||||
# SWE SWP SWT HME BME BMT
|
||||
# 1 MODCLK 0 0 0 0 0 0
|
||||
set *(char *)0xfffa21=0x06
|
||||
|
||||
# 0xYFFA27 - SWSR - Software Service Register
|
||||
# write 0x55 0xAA for watchdog
|
||||
|
||||
# 0xFFFA04 - SYNCR Clock Synthesizer Control Register
|
||||
# 15 14 13 8 7 6 5 4 3 2 1 0
|
||||
# W X Y EDIV 0 0 SLIMP SLOCK RSTEN STSIM STEXT
|
||||
# 0 0 1 1 1 1 1 1 0 0 0 U U 0 0 0
|
||||
set *(short *)0xfffa04=0x7f00
|
||||
|
||||
# $YFFA17 - PEPAR - Port E Pin Assignment Register
|
||||
# 7 6 5 4 3 2 1 0
|
||||
# PEPA7 PEPA6 PEPA5 PEPA4 PEPA3 PEPA2 PEPA1 PEPA0
|
||||
# SIZ1 SIZ0 AS DS RMC AVEC DSACK1 DSACK0
|
||||
# 1 .. control signal, 0 .. port F
|
||||
# after reset determined by DATA8
|
||||
set *(char*)0xfffa17=0xf4
|
||||
|
||||
# 0xFFFA1F - PFPAR - Port F Pin Assignment Register
|
||||
# 7 6 5 4 3 2 1 0
|
||||
# PFPA7 PFPA6 PFPA5 PFPA4 PFPA3 PFPA2 PFPA1 PFPA0
|
||||
# INT7 INT6 INT5 INT4 INT3 INT2 INT1 MODCLK
|
||||
# 1 .. control signal, 0 .. port F
|
||||
# after reset determined by DATA9
|
||||
set *(char*)0xfffa1f=0
|
||||
|
||||
# Setup internal RAM
|
||||
|
||||
# setup TPU RAM at 0x8000
|
||||
# TRAMMCR
|
||||
set *(short *)0xFFFB00=0x8000
|
||||
# TRAMBAR
|
||||
set *(short *)0xFFFB04=0xFFE000>>8
|
||||
# TRAMMCR
|
||||
set *(short *)0xFFFB00=0
|
||||
|
||||
# 0xYFFA44 - CSPAR0 - Chip Select Pin Assignment Register 0
|
||||
# 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
|
||||
# 0 0 CSPA0[6] CSPA0[5] CSPA0[4] CSPA0[3] CSPA0[2] CSPA0[1] CSBOOT
|
||||
# 0 0 DATA2 1 DATA2 1 DATA2 1 DATA1 1 DATA1 1 DATA1 1 1 DATA0
|
||||
# CS5 CS4 CS3 CS2 CS1 CS0 CSBOOT
|
||||
# FC2 PC2 FC1 PC1 FC0 PC0 BGACK BG BR
|
||||
#
|
||||
# 00 Discrete Output
|
||||
# 01 Alternate Function
|
||||
# 10 Chip Select (8-Bit Port)
|
||||
# 11 Chip Select (16-Bit Port)
|
||||
#
|
||||
set *(short *)0xfffa44=0x3fff
|
||||
|
||||
|
||||
# 0xFFFA46 - CSPAR1 - Chip Select Pin Assignment Register 1
|
||||
# 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
|
||||
# 0 0 0 0 0 0 CSPA1[4] CSPA1[3] CSPA1[2] CSPA1[1] CSPA1[0]
|
||||
# 0 0 0 0 0 0 DATA7 1 DATA76 1 DATA75 1 DATA74 1 DATA73 1
|
||||
# CS10 CS9 CS8 CS7 CS6
|
||||
# A23 ECLK A22 PC6 A21 PC5 A20 PC4 A19 PC3
|
||||
#
|
||||
set *(short *)0xfffa46=0x03ff
|
||||
|
||||
#
|
||||
# Chip selects configuration
|
||||
#
|
||||
# 0xFFFA48 - CSBARBT - Chip-Select Base Address Register Boot ROM
|
||||
# 0xFFFA4C..0xFFFA74 - CSBAR[10:0] - Chip-Select Base Address Registers
|
||||
# 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0
|
||||
# A23 A22 A21 A20 A19 A18 A17 A16 A15 A14 A13 A12 A11 BLKSZ
|
||||
# reset 0x0003 for CSBARBT and 0x0000 for CSBAR[10:0]
|
||||
#
|
||||
# BLKSZ Size Address Lines Compared
|
||||
# 000 2k ADDR[23:11]
|
||||
# 001 8k ADDR[23:13]
|
||||
# 010 16k ADDR[23:14]
|
||||
# 011 64k ADDR[23:16]
|
||||
# 100 128k ADDR[23:17]
|
||||
# 101 256k ADDR[23:18]
|
||||
# 110 512k ADDR[23:19]
|
||||
# 111 1M ADDR[23:20]
|
||||
#
|
||||
#
|
||||
# 0xFFFA4A - CSORBT - Chip-Select Option Register Boot ROM
|
||||
# 0xFFFA4E..0xFFFA76 - CSOR[10:0] - Chip-Select Option Registers
|
||||
# 15 14 13 12 11 10 9 6 5 4 3 1 0
|
||||
# MODE BYTE R/W STRB DSACK SPACE IPL AVEC
|
||||
# 0 1 1 1 1 0 1 1 0 1 1 1 0 0 0 0 - for CSORBT
|
||||
#
|
||||
# BYTE 00 Disable, 01 Lower Byte, 10 Upper Byte, 11 Both Bytes
|
||||
# R/W 00 Reserved,01 Read Only, 10 Write Only, 11 Read/Write
|
||||
# SPACE 00 CPU, 01 User, 10 Supervisor, 11 Supervisor/User
|
||||
#
|
||||
set *(long *)0xfffa48=0x0e0468b0
|
||||
# BOOT ROM 0x0e0000 128k RO UL
|
||||
|
||||
set *(long *)0xfffa4c=0x0003503e
|
||||
# CS0 RAM 0x000000 64k WR U
|
||||
|
||||
set *(long *)0xfffa50=0x0003303e
|
||||
# CS1 RAM 0x000000 64k WR L
|
||||
|
||||
set *(long *)0xfffa54=0x0003683e
|
||||
# CS2 RAM 0x000000 64k RO UL
|
||||
|
||||
set *(long *)0xfffa58=0x00000000
|
||||
# CS3
|
||||
|
||||
set *(long *)0xfffa5C=0xfff8680f
|
||||
# CS4
|
||||
|
||||
set *(long *)0xfffa60=0xffe8783f
|
||||
# CS5
|
||||
|
||||
set *(long *)0xfffa64=0x100438f0
|
||||
# CS6 R/R 0x100000 128k RW L
|
||||
|
||||
set *(long *)0xfffa68=0x100458f0
|
||||
# CS7 R/R 0x100000 128k RW U
|
||||
|
||||
set *(long *)0xfffa6c=0x01036870
|
||||
# CS8 RAM 0x010000 64k RO UL
|
||||
|
||||
set *(long *)0xfffa70=0x01033030
|
||||
# CS9 RAM 0x010000 64k WR L
|
||||
|
||||
set *(long *)0xfffa74=0x01035030
|
||||
# CS10 RAM 0x010000 64k WR U
|
||||
|
||||
#
|
||||
# My change
|
||||
#
|
||||
set *(long *)0xfffa58=0x02036870
|
||||
# CS3 RAM 0x020000 64k RO UL
|
||||
|
||||
set *(long *)0xfffa64=0x02033030
|
||||
# CS6 RAM 0x020000 64k WR L
|
||||
|
||||
set *(long *)0xfffa68=0x02035030
|
||||
# CS7 RAM 0x020000 64k WR U
|
||||
|
||||
|
||||
# CPU registers
|
||||
|
||||
# SR=PS Status Register
|
||||
# 15 14 13 12 11 10 8 7 6 5 4 3 2 1 0
|
||||
# T1 T0 S 0 0 IP___ 0 0 0 X N Z V C
|
||||
# 0 0 1 0 0 1 1 1 0 0 0 U U U U U
|
||||
|
||||
bdm_status
|
||||
|
||||
end
|
||||
#===========================================================
|
||||
|
||||
# sets well defined values into VBR
|
||||
define vbr_set_all
|
||||
set $vec_num=0
|
||||
set $vbr_val=(unsigned)$vbr
|
||||
while $vec_num<256
|
||||
set *(unsigned*)($vbr_val+$vec_num*4)=($vec_num*16)+0xf0000
|
||||
set $vec_num++
|
||||
end
|
||||
end
|
||||
|
||||
# Test writability of RAM location
|
||||
define bdm_test_ram_acc
|
||||
echo testing ...
|
||||
p /x $arg0
|
||||
set $ram_addr=(unsigned int)$arg0
|
||||
set $old_ram_val=*(int*)$ram_addr
|
||||
set *(int*)$ram_addr=0x12345678
|
||||
if *(int*)$ram_addr!=0x12345678
|
||||
printf "Error1 %08X\n",*(int*)$ram_addr
|
||||
end
|
||||
set *(char*)$ram_addr=0xab
|
||||
if *(int*)$ram_addr!=0xab345678
|
||||
printf "Error2 %08X\n",*(int*)$ram_addr
|
||||
end
|
||||
set *(char*)($ram_addr+1)=0xcd
|
||||
if *(int*)$ram_addr!=0xabcd5678
|
||||
printf "Error3 %08X\n",*(int*)$ram_addr
|
||||
end
|
||||
set *(char*)($ram_addr+3)=0x01
|
||||
if *(int*)$ram_addr!=0xabcd5601
|
||||
printf "Error4 %08X\n",*(int*)$ram_addr
|
||||
end
|
||||
set *(char*)($ram_addr+2)=0xef
|
||||
if *(int*)$ram_addr!=0xabcdef01
|
||||
printf "Error5 %08X\n",*(int*)$ram_addr
|
||||
end
|
||||
set *(int*)$ram_addr=$old_ram_val
|
||||
end
|
||||
|
||||
# Read flash identification
|
||||
define bdm_read_flash_id
|
||||
set $flash_base=(int)$arg0&~0xffff
|
||||
output /x $flash_base
|
||||
echo \n
|
||||
set *(char*)($flash_base+0x555*2+1)=0xf0
|
||||
set *(char*)($flash_base+0x555*2+1)=0xaa
|
||||
set *(char*)($flash_base+0x2aa*2+1)=0x55
|
||||
set *(char*)($flash_base+0x555*2+1)=0x90
|
||||
p /x *(char*)($flash_base+0x00*2+1)
|
||||
set *(char*)($flash_base+0x555*2+1)=0xf0
|
||||
set *(char*)($flash_base+0x555*2+1)=0xaa
|
||||
set *(char*)($flash_base+0x2aa*2+1)=0x55
|
||||
set *(char*)($flash_base+0x555*2+1)=0x90
|
||||
p /x *(char*)($flash_base+0x01*2+1)
|
||||
end
|
||||
|
||||
define bdm_read_flash1_id
|
||||
bdm_read_flash_id 0x800000
|
||||
end
|
||||
|
||||
define bdm_read_flash2_id
|
||||
bdm_read_flash_id 0x900000
|
||||
end
|
||||
|
||||
define bdm_test_flash_write
|
||||
set $flash_base=(int)$arg0 & ~0xffff
|
||||
output /x $flash_base
|
||||
echo \n
|
||||
set *(char*)($flash_base+0x555*2+1)=0xf0
|
||||
set *(char*)($flash_base+0x555*2+1)=0xaa
|
||||
set *(char*)($flash_base+0x2aa*2+1)=0x55
|
||||
set *(char*)($flash_base+0x555*2+1)=0xA0
|
||||
set *(char*)($arg0)=$arg1
|
||||
end
|
||||
|
||||
define bdm_test_pwm0
|
||||
|
||||
#BIUMCR - BIU Module Configuration Register $YFF400
|
||||
set *(short*)0xfff400=*(short*)0xfff400&~0x8000
|
||||
#CPCR - CPSM Control Register $YFF408
|
||||
set *(short*)0xfff408=*(short*)0xfff408|8
|
||||
#PWM5SIC - PWM5 Status/Interrupt/Control Register $YFF428
|
||||
set *(short*)0xfff428=0x18
|
||||
#PWM5A1 - PWM5 Period Register $YFF42A
|
||||
set *(short*)0xfff42a=512
|
||||
#PWM5B1 - PWM5 Pulse Width Register $YFF42C
|
||||
set *(short*)0xfff42c=0
|
||||
|
||||
if $arg0==0
|
||||
set *(short*)0xf87000=0
|
||||
set $pwm_val=0
|
||||
else
|
||||
if $arg0>0
|
||||
set *(char*)0xf87000=1
|
||||
set $pwm_val=$arg0
|
||||
else
|
||||
set *(char*)0xf87000=2
|
||||
set $pwm_val=-($arg0)
|
||||
end
|
||||
end
|
||||
#DDRQA
|
||||
set *(short*)0xfff208=0x8000
|
||||
#PORTQA
|
||||
set *(short*)0xfff206=~0x8000
|
||||
|
||||
#PWM5B1 - PWM5 Pulse Width Register $YFF42C
|
||||
set *(short*)0xfff42c=$pwm_val
|
||||
|
||||
end
|
||||
|
||||
define bdm_test_usd_irc
|
||||
set $usd_irc_d=0xf88000
|
||||
set $usd_irc_c=0xf88001
|
||||
if $arg0!=0
|
||||
# Load Gate
|
||||
set *(unsigned char*)0xf88020=0
|
||||
# CMR
|
||||
set *(unsigned char*)$usd_irc_c=0x38
|
||||
# IOR
|
||||
set *(unsigned char*)$usd_irc_c=0x49
|
||||
# IDR
|
||||
set *(unsigned char*)$usd_irc_c=0x61
|
||||
# RLD - Reset BP, BT CT CPT S
|
||||
set *(unsigned char*)$usd_irc_c=0x05
|
||||
# DATA - PSC
|
||||
set *(unsigned char*)$usd_irc_d=0x02
|
||||
# RLD - Reset BP, PR0 -> PSC
|
||||
set *(unsigned char*)$usd_irc_c=0x1B
|
||||
end
|
||||
# RLD - Reset BP, CNTR -> OL
|
||||
set *(unsigned char*)$usd_irc_c=0x11
|
||||
|
||||
set $usd_irc_val=((int)(*(unsigned char*)$usd_irc_d))
|
||||
set $usd_irc_val+=((int)(*(unsigned char*)$usd_irc_d))<<8
|
||||
set $usd_irc_val+=((int)(*(unsigned char*)$usd_irc_d))<<16
|
||||
print /x $usd_irc_val
|
||||
|
||||
end
|
||||
|
||||
bdm_hw_init
|
||||
|
||||
#b main
|
||||
|
||||
#run
|
||||
|
||||
394
m683xx/scripts/run376.gdb
Normal file
394
m683xx/scripts/run376.gdb
Normal file
@@ -0,0 +1,394 @@
|
||||
# invoke by "source run376.gdb"
|
||||
|
||||
echo Setting bdm\n
|
||||
|
||||
#set prompt (gdb68)
|
||||
|
||||
file tst
|
||||
|
||||
# Linux
|
||||
target bdm /dev/bdm
|
||||
#target bdm /dev/m683xx-bdm/icd0
|
||||
#target bdm /dev/icd_bdm0
|
||||
#target bdm /dev/pd_bdm0
|
||||
|
||||
# Windows
|
||||
#target bdm bdm-cpu32-icd1
|
||||
|
||||
# Serial targets
|
||||
#target remote COM2
|
||||
#target remote /dev/ttyS1
|
||||
|
||||
# automatic resed of board before "run" command execution
|
||||
# depends on correct "cpu32init" file in current ditectory
|
||||
bdm_autoreset on
|
||||
|
||||
# confirmation of dangerous operations (kill, run, ..)
|
||||
set confirm on
|
||||
|
||||
#===========================================================
|
||||
# sets chipselects and configuration
|
||||
define bdm_hw_init
|
||||
echo bdm_hw_init ...\n
|
||||
|
||||
set remotecache off
|
||||
bdm_timetocomeup 0
|
||||
bdm_autoreset off
|
||||
bdm_setdelay 100
|
||||
bdm_reset
|
||||
bdm_setdelay 0
|
||||
set $sfc=5
|
||||
set $dfc=5
|
||||
|
||||
# system configuration
|
||||
|
||||
# 0xFFFA00 - SIMCR - SIM Configuration Register
|
||||
# 15 14 13 12 11 10 9 8 7 6 5 4 3 0
|
||||
# EXOFF FRZSW FRZBM 0 SLVEN 0 SHEN SUPV MM 0 0 IARB
|
||||
# 0 0 0 0 DATA11 0 0 0 1 1 0 0 1 1 1 1
|
||||
# set *(short *)0xfffa00=0x42cf
|
||||
set *(short *)0xfffa00=0x40cf
|
||||
|
||||
# 0xFFFA21 - SYPCR - System Protection Control Register
|
||||
# 7 6 5 4 3 2 1 0
|
||||
# SWE SWP SWT HME BME BMT
|
||||
# 1 MODCLK 0 0 0 0 0 0
|
||||
set *(char *)0xfffa21=0x06
|
||||
|
||||
# 0xYFFA27 - SWSR - Software Service Register
|
||||
# write 0x55 0xAA for watchdog
|
||||
|
||||
# 0xFFFA04 - SYNCR Clock Synthesizer Control Register
|
||||
# 15 14 13 8 7 6 5 4 3 2 1 0
|
||||
# W X Y EDIV 0 0 SLIMP SLOCK RSTEN STSIM STEXT
|
||||
# 0 0 1 1 1 1 1 1 0 0 0 U U 0 0 0
|
||||
#set *(short *)0xfffa04=0xd408
|
||||
# set 21 MHz system clock for ref 4 MHz
|
||||
|
||||
# $YFFA17 - PEPAR - Port E Pin Assignment Register
|
||||
# 7 6 5 4 3 2 1 0
|
||||
# PEPA7 PEPA6 PEPA5 PEPA4 PEPA3 PEPA2 PEPA1 PEPA0
|
||||
# SIZ1 SIZ0 AS DS RMC AVEC DSACK1 DSACK0
|
||||
# 1 .. control signal, 0 .. port F
|
||||
# after reset determined by DATA8
|
||||
set *(char*)0xfffa17=0xf4
|
||||
|
||||
# 0xFFFA1F - PFPAR - Port F Pin Assignment Register
|
||||
# 7 6 5 4 3 2 1 0
|
||||
# PFPA7 PFPA6 PFPA5 PFPA4 PFPA3 PFPA2 PFPA1 PFPA0
|
||||
# INT7 INT6 INT5 INT4 INT3 INT2 INT1 MODCLK
|
||||
# 1 .. control signal, 0 .. port F
|
||||
# after reset determined by DATA9
|
||||
set *(char*)0xfffa1f=0
|
||||
|
||||
# Setup internal RAM
|
||||
|
||||
# setup STANBY RAM at 0x8000
|
||||
# RAMMCR ... STOP
|
||||
set *(short *)0xFFFB40=0x8000
|
||||
# RAMBAH RAMBAL
|
||||
set *(int *)0xFFFB44=0xFFD000
|
||||
# RAMMCR ... ENABLE
|
||||
set *(short *)0xFFFB40=0
|
||||
|
||||
# setup TPU RAM at 0x8000
|
||||
# TRAMMCR
|
||||
set *(short *)0xFFFB00=0x8000
|
||||
# TRAMBAR
|
||||
set *(short *)0xFFFB04=0xFFE000>>8
|
||||
# TRAMMCR
|
||||
set *(short *)0xFFFB00=0
|
||||
|
||||
# 0xYFFA44 - CSPAR0 - Chip Select Pin Assignment Register 0
|
||||
# 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
|
||||
# 0 0 CSPA0[6] CSPA0[5] CSPA0[4] CSPA0[3] CSPA0[2] CSPA0[1] CSBOOT
|
||||
# 0 0 DATA2 1 DATA2 1 DATA2 1 DATA1 1 DATA1 1 DATA1 1 1 DATA0
|
||||
# CS5 CS4 CS3 CS2 CS1 CS0 CSBOOT
|
||||
# FC2 PC2 FC1 PC1 FC0 PC0 BGACK BG BR
|
||||
#
|
||||
# 00 Discrete Output
|
||||
# 01 Alternate Function
|
||||
# 10 Chip Select (8-Bit Port)
|
||||
# 11 Chip Select (16-Bit Port)
|
||||
#
|
||||
set *(short *)0xfffa44=0x3bff
|
||||
# CS4 8-bit rest 16-bit
|
||||
|
||||
|
||||
# 0xFFFA46 - CSPAR1 - Chip Select Pin Assignment Register 1
|
||||
# 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
|
||||
# 0 0 0 0 0 0 CSPA1[4] CSPA1[3] CSPA1[2] CSPA1[1] CSPA1[0]
|
||||
# 0 0 0 0 0 0 DATA7 1 DATA76 1 DATA75 1 DATA74 1 DATA73 1
|
||||
# CS10 CS9 CS8 CS7 CS6
|
||||
# A23 ECLK A22 PC6 A21 PC5 A20 PC4 A19 PC3
|
||||
#
|
||||
set *(short *)0xfffa46=0x03a9
|
||||
# CS7,CS8,CS9 8-bit CS10 16-bit and A19
|
||||
|
||||
#
|
||||
# Chip selects configuration
|
||||
#
|
||||
# 0xFFFA48 - CSBARBT - Chip-Select Base Address Register Boot ROM
|
||||
# 0xFFFA4C..0xFFFA74 - CSBAR[10:0] - Chip-Select Base Address Registers
|
||||
# 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0
|
||||
# A23 A22 A21 A20 A19 A18 A17 A16 A15 A14 A13 A12 A11 BLKSZ
|
||||
# reset 0x0003 for CSBARBT and 0x0000 for CSBAR[10:0]
|
||||
#
|
||||
# BLKSZ Size Address Lines Compared
|
||||
# 000 2k ADDR[23:11]
|
||||
# 001 8k ADDR[23:13]
|
||||
# 010 16k ADDR[23:14]
|
||||
# 011 64k ADDR[23:16]
|
||||
# 100 128k ADDR[23:17]
|
||||
# 101 256k ADDR[23:18]
|
||||
# 110 512k ADDR[23:19]
|
||||
# 111 1M ADDR[23:20]
|
||||
#
|
||||
#
|
||||
# 0xFFFA4A - CSORBT - Chip-Select Option Register Boot ROM
|
||||
# 0xFFFA4E..0xFFFA76 - CSOR[10:0] - Chip-Select Option Registers
|
||||
# 15 14 13 12 11 10 9 6 5 4 3 1 0
|
||||
# MODE BYTE R/W STRB DSACK SPACE IPL AVEC
|
||||
# 0 1 1 1 1 0 1 1 0 1 1 1 0 0 0 0 - for CSORBT
|
||||
#
|
||||
# BYTE 00 Disable, 01 Lower Byte, 10 Upper Byte, 11 Both Bytes
|
||||
# R/W 00 Reserved,01 Read Only, 10 Write Only, 11 Read/Write
|
||||
# SPACE 00 CPU, 01 User, 10 Supervisor, 11 Supervisor/User
|
||||
#
|
||||
set *(short *)0xfffa48=(0x800000>>8)&0xfff8 | 7
|
||||
set *(short *)0xfffa4a=(0<<15)|(3<<13)|(3<<11)|(0<<10)|(0<<6)|(3<<4)
|
||||
# BOOT ROM 0x800000 1MB RW UL
|
||||
|
||||
set *(short *)0xfffa4c=(0x900000>>8)&0xfff8 | 7
|
||||
set *(short *)0xfffa4e=(0<<15)|(3<<13)|(3<<11)|(0<<10)|(0<<6)|(3<<4)
|
||||
# CS0 ROM 0x900000 1MB RW UL
|
||||
|
||||
#set *(long *)0xfffa50=0x0003303e
|
||||
# CS1 RAM 0x000000 64k WR L
|
||||
|
||||
set *(short *)0xfffa54=(0x000000>>8)&0xfff8 | 7
|
||||
set *(short *)0xfffa56=(0<<15)|(3<<13)|(3<<11)|(0<<10)|(0<<6)|(3<<4)
|
||||
# CS2 RAM 0x000000 1MB RW UL - Main RAM first 1MB
|
||||
|
||||
#set *(short *)0xfffa58=(0x100000>>8)&0xfff8 | 7
|
||||
#set *(short *)0xfffa5A=(0<<15)|(3<<13)|(3<<11)|(0<<10)|(0<<6)|(3<<4)
|
||||
# CS3 RAM 0x100000 1MB RW UL - Main RAM second 1MB
|
||||
|
||||
set *(short *)0xfffa5c=(0xf00000>>8)&0xfff8 | 6
|
||||
set *(short *)0xfffa5e=(0<<15)|(3<<13)|(3<<11)|(1<<10)|(2<<6)|(3<<4)
|
||||
# CS4 PER 0xf00000 512kB RW UL - CMOS RAM, RTC, other devices
|
||||
|
||||
#set *(long *)0xfffa60=0xffe8783f
|
||||
# CS5
|
||||
|
||||
#set *(long *)0xfffa64=0x100438f0
|
||||
# CS6 R/R 0x100000 128k RW L
|
||||
|
||||
set *(short *)0xfffa68=(0xf87000>>8)&0xfff8 | 0
|
||||
set *(short *)0xfffa6a=(0<<15)|(3<<13)|(3<<11)|(1<<10)|(1<<6)|(3<<4)
|
||||
# CS7 PER 0xf87000 2k RW UL - MO_PWR
|
||||
|
||||
set *(short *)0xfffa6c=(0xf88000>>8)&0xfff8 | 0
|
||||
set *(short *)0xfffa6e=(0<<15)|(3<<13)|(3<<11)|(1<<10)|(1<<6)|(3<<4)
|
||||
# CS8 PER 0xf88000 2k RO UL - IRC
|
||||
|
||||
set *(short *)0xfffa70=(0xf89000>>8)&0xfff8 | 0
|
||||
set *(short *)0xfffa72=(0<<15)|(3<<13)|(3<<11)|(1<<10)|(3<<6)|(3<<4)
|
||||
# CS9 PER 0xf89000 2k WR UL - KBD
|
||||
|
||||
#set *(long *)0xfffa74=0x01035030
|
||||
# CS10 RAM 0x010000 64k WR U
|
||||
|
||||
#
|
||||
# My change
|
||||
#
|
||||
#set *(long *)0xfffa58=0x02036870
|
||||
# CS3 RAM 0x020000 64k RO UL
|
||||
|
||||
#set *(long *)0xfffa64=0x02033030
|
||||
# CS6 RAM 0x020000 64k WR L
|
||||
|
||||
#set *(long *)0xfffa68=0x02035030
|
||||
# CS7 RAM 0x020000 64k WR U
|
||||
|
||||
|
||||
# CPU registers
|
||||
|
||||
# SR=PS Status Register
|
||||
# 15 14 13 12 11 10 8 7 6 5 4 3 2 1 0
|
||||
# T1 T0 S 0 0 IP___ 0 0 0 X N Z V C
|
||||
# 0 0 1 0 0 1 1 1 0 0 0 U U U U U
|
||||
|
||||
bdm_status
|
||||
|
||||
end
|
||||
#===========================================================
|
||||
|
||||
# sets well defined values into VBR
|
||||
define vbr_set_all
|
||||
set $vec_num=0
|
||||
set $vbr_val=(unsigned)$vbr
|
||||
while $vec_num<256
|
||||
set *(unsigned*)($vbr_val+$vec_num*4)=($vec_num*16)+0xf0000
|
||||
set $vec_num++
|
||||
end
|
||||
end
|
||||
|
||||
# Test writability of RAM location
|
||||
define bdm_test_ram_acc
|
||||
echo testing ...
|
||||
p /x $arg0
|
||||
set $ram_addr=(unsigned int)$arg0
|
||||
set $old_ram_val0=*(int*)$ram_addr
|
||||
set $old_ram_val1=*(int*)($ram_addr+4)
|
||||
set *(int*)($ram_addr+3)=0xff234567
|
||||
set *(int*)$ram_addr=0x12345678
|
||||
if *(int*)$ram_addr!=0x12345678
|
||||
printf "Error1 %08X\n",*(int*)$ram_addr
|
||||
end
|
||||
set *(char*)$ram_addr=0xab
|
||||
if *(int*)$ram_addr!=0xab345678
|
||||
printf "Error2 %08X\n",*(int*)$ram_addr
|
||||
end
|
||||
set *(char*)($ram_addr+1)=0xcd
|
||||
if *(int*)$ram_addr!=0xabcd5678
|
||||
printf "Error3 %08X\n",*(int*)$ram_addr
|
||||
end
|
||||
set *(char*)($ram_addr+3)=0x01
|
||||
if *(int*)$ram_addr!=0xabcd5601
|
||||
printf "Error4 %08X\n",*(int*)$ram_addr
|
||||
end
|
||||
set *(char*)($ram_addr+2)=0xef
|
||||
if *(int*)$ram_addr!=0xabcdef01
|
||||
printf "Error5 %08X\n",*(int*)$ram_addr
|
||||
end
|
||||
if *(int*)$ram_addr!=0xabcdef01
|
||||
printf "Error5 %08X\n",*(int*)$ram_addr
|
||||
end
|
||||
if *(int*)($ram_addr+1)!=0xcdef0123
|
||||
printf "Error6 %08X\n",*(int*)$ram_addr
|
||||
end
|
||||
if *(int*)($ram_addr+2)!=0xef012345
|
||||
printf "Error7 %08X\n",*(int*)$ram_addr
|
||||
end
|
||||
if *(int*)($ram_addr+2)!=0xef012345
|
||||
printf "Error8 %08X\n",*(int*)$ram_addr
|
||||
end
|
||||
if *(int*)($ram_addr+3)!=0x01234567
|
||||
printf "Error9 %08X\n",*(int*)$ram_addr
|
||||
end
|
||||
set *(int*)$ram_addr=$old_ram_val0
|
||||
set *(int*)($ram_addr+4)=$old_ram_val1
|
||||
end
|
||||
|
||||
# Read flash identification
|
||||
define bdm_read_flash_id
|
||||
set $flash_base=(int)$arg0&~0xffff
|
||||
output /x $flash_base
|
||||
echo \n
|
||||
set *(char*)($flash_base+0x555*2+1)=0xf0
|
||||
set *(char*)($flash_base+0x555*2+1)=0xaa
|
||||
set *(char*)($flash_base+0x2aa*2+1)=0x55
|
||||
set *(char*)($flash_base+0x555*2+1)=0x90
|
||||
p /x *(char*)($flash_base+0x00*2+1)
|
||||
set *(char*)($flash_base+0x555*2+1)=0xf0
|
||||
set *(char*)($flash_base+0x555*2+1)=0xaa
|
||||
set *(char*)($flash_base+0x2aa*2+1)=0x55
|
||||
set *(char*)($flash_base+0x555*2+1)=0x90
|
||||
p /x *(char*)($flash_base+0x01*2+1)
|
||||
end
|
||||
|
||||
define bdm_read_flash1_id
|
||||
bdm_read_flash_id 0x800000
|
||||
end
|
||||
|
||||
define bdm_read_flash2_id
|
||||
bdm_read_flash_id 0x900000
|
||||
end
|
||||
|
||||
define bdm_test_flash_write
|
||||
set $flash_base=(int)$arg0 & ~0xffff
|
||||
output /x $flash_base
|
||||
echo \n
|
||||
set *(char*)($flash_base+0x555*2+1)=0xf0
|
||||
set *(char*)($flash_base+0x555*2+1)=0xaa
|
||||
set *(char*)($flash_base+0x2aa*2+1)=0x55
|
||||
set *(char*)($flash_base+0x555*2+1)=0xA0
|
||||
set *(char*)($arg0)=$arg1
|
||||
end
|
||||
|
||||
define bdm_test_pwm0
|
||||
|
||||
#BIUMCR - BIU Module Configuration Register $YFF400
|
||||
set *(short*)0xfff400=*(short*)0xfff400&~0x8000
|
||||
#CPCR - CPSM Control Register $YFF408
|
||||
set *(short*)0xfff408=*(short*)0xfff408|8
|
||||
#PWM5SIC - PWM5 Status/Interrupt/Control Register $YFF428
|
||||
set *(short*)0xfff428=0x18
|
||||
#PWM5A1 - PWM5 Period Register $YFF42A
|
||||
set *(short*)0xfff42a=512
|
||||
#PWM5B1 - PWM5 Pulse Width Register $YFF42C
|
||||
set *(short*)0xfff42c=0
|
||||
|
||||
if $arg0==0
|
||||
set *(short*)0xf87000=0
|
||||
set $pwm_val=0
|
||||
else
|
||||
if $arg0>0
|
||||
set *(char*)0xf87000=1
|
||||
set $pwm_val=$arg0
|
||||
else
|
||||
set *(char*)0xf87000=2
|
||||
set $pwm_val=-($arg0)
|
||||
end
|
||||
end
|
||||
#DDRQA
|
||||
set *(short*)0xfff208=0x8000
|
||||
#PORTQA
|
||||
set *(short*)0xfff206=~0x8000
|
||||
|
||||
#PWM5B1 - PWM5 Pulse Width Register $YFF42C
|
||||
set *(short*)0xfff42c=$pwm_val
|
||||
|
||||
end
|
||||
|
||||
define bdm_test_usd_irc
|
||||
set $usd_irc_d=0xf88000
|
||||
set $usd_irc_c=0xf88001
|
||||
if $arg0!=0
|
||||
# Load Gate
|
||||
set *(unsigned char*)0xf88020=0
|
||||
# CMR
|
||||
set *(unsigned char*)$usd_irc_c=0x38
|
||||
# IOR
|
||||
set *(unsigned char*)$usd_irc_c=0x49
|
||||
# IDR
|
||||
set *(unsigned char*)$usd_irc_c=0x61
|
||||
# RLD - Reset BP, BT CT CPT S
|
||||
set *(unsigned char*)$usd_irc_c=0x05
|
||||
# DATA - PSC
|
||||
set *(unsigned char*)$usd_irc_d=0x02
|
||||
# RLD - Reset BP, PR0 -> PSC
|
||||
set *(unsigned char*)$usd_irc_c=0x1B
|
||||
end
|
||||
# RLD - Reset BP, CNTR -> OL
|
||||
set *(unsigned char*)$usd_irc_c=0x11
|
||||
|
||||
set $usd_irc_val=((int)(*(unsigned char*)$usd_irc_d))
|
||||
set $usd_irc_val+=((int)(*(unsigned char*)$usd_irc_d))<<8
|
||||
set $usd_irc_val+=((int)(*(unsigned char*)$usd_irc_d))<<16
|
||||
print /x $usd_irc_val
|
||||
|
||||
end
|
||||
|
||||
define six
|
||||
si
|
||||
x /10i $pc
|
||||
end
|
||||
|
||||
bdm_hw_init
|
||||
|
||||
#b main
|
||||
|
||||
#run
|
||||
|
||||
8
m68k/.cvsignore
Normal file
8
m68k/.cvsignore
Normal file
@@ -0,0 +1,8 @@
|
||||
autom4te.cache
|
||||
configure
|
||||
config.h.in
|
||||
config.log
|
||||
config.status
|
||||
aclocal.m4
|
||||
Makefile.in
|
||||
Makefile
|
||||
62
m68k/BUGS
Normal file
62
m68k/BUGS
Normal file
@@ -0,0 +1,62 @@
|
||||
BUGS
|
||||
====
|
||||
|
||||
- Missing 5282 support (patch needed).
|
||||
|
||||
- Duplicated debug output on windows.
|
||||
|
||||
- PCI parallel ports with non-standard port-addresses not supported.
|
||||
|
||||
- Probing of different access methods (driver, ioperm, bdmd) with
|
||||
irritating error messages.
|
||||
This one and the PCI parallel ports above would probably best be resolved
|
||||
by a new naming sheme for the target devices.
|
||||
|
||||
- In insight-5.3, when "Run" button is hit, no bdm_reset is executed. This
|
||||
leads to the effect that _first_ "Run" works (since you can/should put
|
||||
bdm_reset into the setup-and-load macro). But the _second_ "Run" will
|
||||
fail since IRQs are left enabled and some registers are writeable only
|
||||
once after reset.
|
||||
|
||||
- Insight-6.0 don't work at all.
|
||||
|
||||
- The target is hardwired to /dev/bdmcf0 in insight.
|
||||
|
||||
- Parallel port on Elitegroup ECS K7S5A (sis735 chipset) motherboard seems not
|
||||
to work. The port pins are active only for a couple milliseconds after an
|
||||
edge of the strobe signal and set tri-state thereafter. The bdm adaptor
|
||||
requires that the pins have valid signals all the time. Tri-stating the pins
|
||||
result in loss of control over the adaptor/target.
|
||||
|
||||
- Dell Pentium III machines seem to not work. Not really sure why but clearing
|
||||
the parallel port register for the CF processors causes the parallel port to
|
||||
either initialise or reset and not work.
|
||||
|
||||
- Coldfire - support to detect version of the debug module for auto detection
|
||||
of the PST lines has problems if a BDM pod is not connected to the target or
|
||||
the target is not powered.
|
||||
|
||||
- The 5407 BDM hardware does not implement the SSI bit and the driver tries to
|
||||
use it. No idea why this bit was removed as it was just stupid. The work
|
||||
arounds for the driver are complex and not yet implemented.
|
||||
|
||||
- For m68k ELF systems you need to be careful about the binutils mix you use.
|
||||
Binutils of versions 2.9.5.* will not work with gdb-4.18 or earilier. You
|
||||
will get core dumps. Earilier version of gcc and binutils as used by the
|
||||
ucLinux project have some problems.
|
||||
|
||||
---------------------------
|
||||
|
||||
Reporting Them:
|
||||
|
||||
If you've got any questions/remarks about any of this, please contact the BDM
|
||||
project mailing list on the SourceForge web site:
|
||||
|
||||
http://sourceforge.net/projects/bdm/
|
||||
|
||||
It is a good idea to turn on the debug and look at the output. Keep
|
||||
the log as it might be useful for us to track the problem down.
|
||||
|
||||
A patch is also welcome.
|
||||
|
||||
---------------------------
|
||||
339
m68k/COPYING
Normal file
339
m68k/COPYING
Normal file
@@ -0,0 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
1174
m68k/ChangeLog
Normal file
1174
m68k/ChangeLog
Normal file
File diff suppressed because it is too large
Load Diff
234
m68k/INSTALL
Normal file
234
m68k/INSTALL
Normal file
@@ -0,0 +1,234 @@
|
||||
Installation Instructions
|
||||
*************************
|
||||
|
||||
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
|
||||
2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is free documentation; the Free Software Foundation gives
|
||||
unlimited permission to copy, distribute and modify it.
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
Briefly, the shell commands `./configure; make; make install' should
|
||||
configure, build, and install this package. The following
|
||||
more-detailed instructions are generic; see the `README' file for
|
||||
instructions specific to this package.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, and a
|
||||
file `config.log' containing compiler output (useful mainly for
|
||||
debugging `configure').
|
||||
|
||||
It can also use an optional file (typically called `config.cache'
|
||||
and enabled with `--cache-file=config.cache' or simply `-C') that saves
|
||||
the results of its tests to speed up reconfiguring. Caching is
|
||||
disabled by default to prevent problems with accidental use of stale
|
||||
cache files.
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If you are using the cache, and at
|
||||
some point `config.cache' contains results you don't want to keep, you
|
||||
may remove or edit it.
|
||||
|
||||
The file `configure.ac' (or `configure.in') is used to create
|
||||
`configure' by a program called `autoconf'. You need `configure.ac' if
|
||||
you want to change it or regenerate `configure' using a newer version
|
||||
of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system.
|
||||
|
||||
Running `configure' might take a while. While running, it prints
|
||||
some messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that the
|
||||
`configure' script does not know about. Run `./configure --help' for
|
||||
details on some of the pertinent environment variables.
|
||||
|
||||
You can give `configure' initial values for configuration parameters
|
||||
by setting variables in the command line or in the environment. Here
|
||||
is an example:
|
||||
|
||||
./configure CC=c99 CFLAGS=-g LIBS=-lposix
|
||||
|
||||
*Note Defining Variables::, for more details.
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you can use GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
With a non-GNU `make', it is safer to compile the package for one
|
||||
architecture at a time in the source code directory. After you have
|
||||
installed the package for one architecture, use `make distclean' before
|
||||
reconfiguring for another architecture.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' installs the package's commands under
|
||||
`/usr/local/bin', include files under `/usr/local/include', etc. You
|
||||
can specify an installation prefix other than `/usr/local' by giving
|
||||
`configure' the option `--prefix=PREFIX'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
|
||||
PREFIX as the prefix for installing programs and libraries.
|
||||
Documentation and other data files still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=DIR' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' cannot figure out automatically,
|
||||
but needs to determine by the type of machine the package will run on.
|
||||
Usually, assuming the package is built to be run on the _same_
|
||||
architectures, `configure' can figure that out, but if it prints a
|
||||
message saying it cannot guess the machine type, give it the
|
||||
`--build=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name which has the form:
|
||||
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
where SYSTEM can have one of these forms:
|
||||
|
||||
OS KERNEL-OS
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the machine type.
|
||||
|
||||
If you are _building_ compiler tools for cross-compiling, you should
|
||||
use the option `--target=TYPE' to select the type of system they will
|
||||
produce code for.
|
||||
|
||||
If you want to _use_ a cross compiler, that generates code for a
|
||||
platform different from the build platform, you should specify the
|
||||
"host" platform (i.e., that on which the generated programs will
|
||||
eventually be run) with `--host=TYPE'.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share, you
|
||||
can create a site shell script called `config.site' that gives default
|
||||
values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Defining Variables
|
||||
==================
|
||||
|
||||
Variables not defined in a site shell script can be set in the
|
||||
environment passed to `configure'. However, some packages may run
|
||||
configure again during the build, and the customized values of these
|
||||
variables may be lost. In order to avoid this problem, you should set
|
||||
them in the `configure' command line, using `VAR=value'. For example:
|
||||
|
||||
./configure CC=/usr/local2/bin/gcc
|
||||
|
||||
causes the specified `gcc' to be used as the C compiler (unless it is
|
||||
overridden in the site shell script).
|
||||
|
||||
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
|
||||
an Autoconf bug. Until the bug is fixed you can use this workaround:
|
||||
|
||||
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
|
||||
|
||||
`configure' Invocation
|
||||
======================
|
||||
|
||||
`configure' recognizes the following options to control how it operates.
|
||||
|
||||
`--help'
|
||||
`-h'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--version'
|
||||
`-V'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Enable the cache: use and save the results of the tests in FILE,
|
||||
traditionally `config.cache'. FILE defaults to `/dev/null' to
|
||||
disable caching.
|
||||
|
||||
`--config-cache'
|
||||
`-C'
|
||||
Alias for `--cache-file=config.cache'.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to `/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options. Run
|
||||
`configure --help' for more details.
|
||||
|
||||
57
m68k/Makefile.am
Normal file
57
m68k/Makefile.am
Normal file
@@ -0,0 +1,57 @@
|
||||
##
|
||||
## $Id: Makefile.am,v 1.8 2004/06/01 02:02:25 codewiz 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.
|
||||
##
|
||||
|
||||
CFLAGS = @CFLAGS@
|
||||
|
||||
SUBDIRS = @BDM_SUBDIRS@
|
||||
|
||||
EXTRA_DIST = \
|
||||
README.insight \
|
||||
BUGS \
|
||||
config/bootstrap \
|
||||
driver/freebsd/bdm \
|
||||
driver/freebsd/bdm.8 \
|
||||
driver/freebsd/freebsd-bdm.c \
|
||||
driver/freebsd/Makefile \
|
||||
driver/freebsd/README \
|
||||
driver/freebsd/setdef0.c \
|
||||
driver/freebsd/setdef1.c \
|
||||
driver/freebsd/unbdm \
|
||||
driver/freebsd/bus_if.h \
|
||||
driver/freebsd/device_if.h \
|
||||
driver/freebsd/isa_if.h \
|
||||
driver/freebsd/setdefs.h \
|
||||
driver/openbsd/Makefile \
|
||||
driver/openbsd/README \
|
||||
driver/openbsd/bdm-install.sh \
|
||||
driver/openbsd/openbsd-bdm.c \
|
||||
driver/linux/linux-bdm.c \
|
||||
driver/linux/Makefile \
|
||||
driver/linux-2.6/bdm.c \
|
||||
driver/linux-2.6/Makefile \
|
||||
driver/sco/Makefile \
|
||||
driver/sco/Master \
|
||||
driver/sco/Node \
|
||||
driver/sco/README \
|
||||
driver/sco/sco.c \
|
||||
driver/sco/Space.c \
|
||||
driver/sco/System \
|
||||
driver/win/win-bdm.c \
|
||||
driver/win/win-io.h
|
||||
|
||||
dist-hook:
|
||||
cp -R -p $(srcdir)/local_scripts $(distdir)
|
||||
rm -r -f `find $(distdir)/local_scripts -name CVS`
|
||||
cp -R -p $(srcdir)/../gdb $(distdir)
|
||||
rm -r -f `find $(distdir)/gdb -name CVS`
|
||||
cp -R -p $(srcdir)/../schematics $(distdir)
|
||||
rm -r -f `find $(distdir)/schematics -name CVS`
|
||||
|
||||
666
m68k/Makefile.in
Normal file
666
m68k/Makefile.in
Normal file
@@ -0,0 +1,666 @@
|
||||
# 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@
|
||||
subdir = .
|
||||
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
|
||||
$(top_srcdir)/configure COPYING ChangeLog INSTALL \
|
||||
config/compile config/config.guess config/config.sub \
|
||||
config/depcomp config/install-sh config/missing \
|
||||
config/mkinstalldirs config/ylwrap
|
||||
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)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno config.status.lineno
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
html-recursive info-recursive install-data-recursive \
|
||||
install-dvi-recursive install-exec-recursive \
|
||||
install-html-recursive install-info-recursive \
|
||||
install-pdf-recursive install-ps-recursive install-recursive \
|
||||
installcheck-recursive installdirs-recursive pdf-recursive \
|
||||
ps-recursive uninstall-recursive
|
||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||
distclean-recursive maintainer-clean-recursive
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
am__remove_distdir = \
|
||||
{ test ! -d $(distdir) \
|
||||
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -fr $(distdir); }; }
|
||||
DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 $(distdir).zip
|
||||
GZIP_ENV = --best
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
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@
|
||||
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@
|
||||
SUBDIRS = @BDM_SUBDIRS@
|
||||
EXTRA_DIST = \
|
||||
README.insight \
|
||||
BUGS \
|
||||
config/bootstrap \
|
||||
driver/freebsd/bdm \
|
||||
driver/freebsd/bdm.8 \
|
||||
driver/freebsd/freebsd-bdm.c \
|
||||
driver/freebsd/Makefile \
|
||||
driver/freebsd/README \
|
||||
driver/freebsd/setdef0.c \
|
||||
driver/freebsd/setdef1.c \
|
||||
driver/freebsd/unbdm \
|
||||
driver/freebsd/bus_if.h \
|
||||
driver/freebsd/device_if.h \
|
||||
driver/freebsd/isa_if.h \
|
||||
driver/freebsd/setdefs.h \
|
||||
driver/openbsd/Makefile \
|
||||
driver/openbsd/README \
|
||||
driver/openbsd/bdm-install.sh \
|
||||
driver/openbsd/openbsd-bdm.c \
|
||||
driver/linux/linux-bdm.c \
|
||||
driver/linux/Makefile \
|
||||
driver/linux-2.6/bdm.c \
|
||||
driver/linux-2.6/Makefile \
|
||||
driver/sco/Makefile \
|
||||
driver/sco/Master \
|
||||
driver/sco/Node \
|
||||
driver/sco/README \
|
||||
driver/sco/sco.c \
|
||||
driver/sco/Space.c \
|
||||
driver/sco/System \
|
||||
driver/win/win-bdm.c \
|
||||
driver/win/win-io.h
|
||||
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
am--refresh:
|
||||
@:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
|
||||
cd $(srcdir) && $(AUTOMAKE) --foreign \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
echo ' $(SHELL) ./config.status'; \
|
||||
$(SHELL) ./config.status;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
|
||||
config.h: stamp-h1
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h1; \
|
||||
$(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
|
||||
else :; fi
|
||||
|
||||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h1
|
||||
cd $(top_builddir) && $(SHELL) ./config.status config.h
|
||||
$(srcdir)/config.h.in: $(am__configure_deps)
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
rm -f stamp-h1
|
||||
touch $@
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h stamp-h1
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
$(RECURSIVE_CLEAN_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
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: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(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: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(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)
|
||||
$(am__remove_distdir)
|
||||
test -d $(distdir) || mkdir $(distdir)
|
||||
@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
|
||||
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d "$(distdir)/$$subdir" \
|
||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
distdir=`$(am__cd) $(distdir) && pwd`; \
|
||||
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
|
||||
(cd $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$top_distdir" \
|
||||
distdir="$$distdir/$$subdir" \
|
||||
am__remove_distdir=: \
|
||||
am__skip_length_check=: \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$(top_distdir)" distdir="$(distdir)" \
|
||||
dist-hook
|
||||
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
|
||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r $(distdir)
|
||||
dist-gzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
dist-bzip2: distdir
|
||||
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-tarZ: distdir
|
||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-shar: distdir
|
||||
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
|
||||
$(am__remove_distdir)
|
||||
dist-zip: distdir
|
||||
-rm -f $(distdir).zip
|
||||
zip -rq $(distdir).zip $(distdir)
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist dist-all: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
|
||||
-rm -f $(distdir).zip
|
||||
zip -rq $(distdir).zip $(distdir)
|
||||
$(am__remove_distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
case '$(DIST_ARCHIVES)' in \
|
||||
*.tar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.Z*) \
|
||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||
*.shar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
|
||||
*.zip*) \
|
||||
unzip $(distdir).zip ;;\
|
||||
esac
|
||||
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
||||
mkdir $(distdir)/_build
|
||||
mkdir $(distdir)/_inst
|
||||
chmod a-w $(distdir)
|
||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& cd $(distdir)/_build \
|
||||
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
||||
distuninstallcheck \
|
||||
&& chmod -R a-w "$$dc_install_base" \
|
||||
&& ({ \
|
||||
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
||||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
||||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
||||
&& rm -rf "$$dc_destdir" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist \
|
||||
&& rm -rf $(DIST_ARCHIVES) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
|
||||
$(am__remove_distdir)
|
||||
@(echo "$(distdir) archives ready for distribution: "; \
|
||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
||||
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
|
||||
distuninstallcheck:
|
||||
@cd $(distuninstallcheck_dir) \
|
||||
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
echo " (check DESTDIR support)"; \
|
||||
fi ; \
|
||||
$(distuninstallcheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
distcleancheck: distclean
|
||||
@if test '$(srcdir)' = . ; then \
|
||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
||||
$(distcleancheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile config.h
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
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-recursive
|
||||
|
||||
clean-am: clean-generic mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-recursive
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-recursive
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-recursive
|
||||
|
||||
install-ps: install-ps-recursive
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf $(top_srcdir)/autom4te.cache
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
|
||||
install-strip
|
||||
|
||||
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
||||
all all-am am--refresh check check-am clean clean-generic \
|
||||
ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
|
||||
dist-hook dist-shar dist-tarZ dist-zip distcheck distclean \
|
||||
distclean-generic distclean-hdr distclean-tags distcleancheck \
|
||||
distdir distuninstallcheck 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 installdirs-am maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
|
||||
pdf-am ps ps-am tags tags-recursive uninstall uninstall-am
|
||||
|
||||
|
||||
dist-hook:
|
||||
cp -R -p $(srcdir)/local_scripts $(distdir)
|
||||
rm -r -f `find $(distdir)/local_scripts -name CVS`
|
||||
cp -R -p $(srcdir)/../gdb $(distdir)
|
||||
rm -r -f `find $(distdir)/gdb -name CVS`
|
||||
cp -R -p $(srcdir)/../schematics $(distdir)
|
||||
rm -r -f `find $(distdir)/schematics -name CVS`
|
||||
# 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:
|
||||
909
m68k/README
Normal file
909
m68k/README
Normal file
@@ -0,0 +1,909 @@
|
||||
|
||||
BDM GDB DRIVER AND LIBRARY PACKAGE
|
||||
==================================
|
||||
|
||||
INTRODUCTION
|
||||
============
|
||||
|
||||
This package contains everything you need to know to be able to run GDB on
|
||||
Linux, FreeBSD, SCO Unix, and Windows and control a Motorola CPU32+ (68360) or
|
||||
Coldfire (V2/V3/V4) target through a standard PC parallel port or via a USB
|
||||
pod.
|
||||
|
||||
o The CPU32 interfaces supported are PD and the IDC interface. GDB
|
||||
should now operate with the CPU32 processor without error.
|
||||
|
||||
o The Coldfire interface is the TBLCF USB pod or P&E parallel port type
|
||||
interface.
|
||||
|
||||
o You can build Insight if you apply the Insight patch. See the
|
||||
Insight README in this directory.
|
||||
|
||||
o For WindowsNT or Window2000 you will need the GiveIO package. You
|
||||
are best to search the net for the GiveIO (giveio.sys) package. You
|
||||
will also need the INSTDRV.EXE file that is also available on the net.
|
||||
GiveIO has been test on Windows 2000 and Windows XP.
|
||||
|
||||
o For Unix users the library is built with I/O perm support by
|
||||
default. The same library allows an application to directly
|
||||
access the hardware or use an installed BDM kernel driver. On FreeBSD
|
||||
this the "/dev/io" support.
|
||||
|
||||
I/O Permission is a means of getting at the parallel port hardware
|
||||
without the need for a kernel driver. This BDM package still provides
|
||||
support to build a kernel driver, but you do not need to if you want to
|
||||
avoid kernel drivers. Some people wish to use kernel drivers and some do
|
||||
not.
|
||||
|
||||
If you wish to learn more about I/O Perm support please refer to the
|
||||
section at the end of the file.
|
||||
|
||||
You can disable I/O perm support by editing the Makefile. It is hoped
|
||||
autoconf support in the future will provide a better way to handle this.
|
||||
|
||||
o To support the TBLCF UDB pod you will need the libusb package. For Windows
|
||||
this means the LibUSB-Win32 package.
|
||||
|
||||
o Support for an initialisation script called '.m68kbdminit'. See the
|
||||
section on Initialisation Scripts.
|
||||
|
||||
The subdirectories contain:
|
||||
|
||||
config
|
||||
Autotools support files.
|
||||
|
||||
driver
|
||||
Source for a Linux, SCO, FreeBSD, I/O Perm, and Windows BDM device
|
||||
driver module.
|
||||
|
||||
gdbPatches
|
||||
Move to outside this tree. Please refer to the Sourceforge
|
||||
project for the patches.
|
||||
|
||||
gdbScripts
|
||||
Example GDB command scripts that show how to initialize and run
|
||||
a Motorola 68360 system using standard GDB commands.
|
||||
|
||||
gdbserver
|
||||
A GDB Remote protocol server. Needs GDB 6.7 or later.
|
||||
|
||||
lib
|
||||
User-level library routines for accessing the BDM device driver.
|
||||
|
||||
flashlib
|
||||
Library for flash support. This library currently supports host-only
|
||||
and host-assisted operation modes of 29Fxxx and 49Fxxx chips in
|
||||
any combination of bus_width=[1|2|4] and chip_width=[1|2|4]. It is
|
||||
already prepared for target-only operation mode and addition of different
|
||||
flash algorithms.
|
||||
|
||||
local_scripts
|
||||
Scripts to run on the host machine the driver is being installed
|
||||
on.
|
||||
|
||||
server
|
||||
The BDM server. This is a daemon which interfaces to the local BDM
|
||||
driver remotely. The BDM library can be built to support local and remote,
|
||||
just local or just remote access.
|
||||
|
||||
tblcf
|
||||
The TBLCF code from Daniel Malik. It include the various tools for managing
|
||||
the pod.
|
||||
|
||||
test
|
||||
Programs to test the BDM library and driver routines.
|
||||
|
||||
utils
|
||||
contains some utilities which might be useful.
|
||||
|
||||
README Files
|
||||
============
|
||||
|
||||
There are 4 README files which document the BDM package. They are:
|
||||
|
||||
o README
|
||||
This is the top level README file and the one you are currently readling.
|
||||
|
||||
o README.cvs
|
||||
If you use the code from CVS you should read this file. It explains how
|
||||
to bootstrap the package to create the configure script and Makefiles.
|
||||
|
||||
o README.bdmgdbserver
|
||||
This file documents the BDM GDB Server. It explains why you should use
|
||||
the BDM GDB Server to interface to GDB and how to build GDB.
|
||||
|
||||
o README.insight
|
||||
This is an old README and may be useful to anyone still wanting to
|
||||
use Insight as a GUI interface to GDB. A current Insight with a current
|
||||
GDB should work with the BDM GDB Server.
|
||||
|
||||
WINDOWS
|
||||
=======
|
||||
|
||||
Windows is supported on Windows 98, Windows 2000 and Windows XP. It may run on
|
||||
other version of Windows, but the ones listed have been tested. Windows 2000,
|
||||
Windows XP and beyond need to the GiveIO driver to gain direct access to the
|
||||
parallel port hardware if you are using a parallel port pod. A USB pod need the
|
||||
libusb software for Windows.
|
||||
|
||||
You can download the GiveIO package from the net plus you will need the
|
||||
INSTDRV.EXE program. To install GiveIO place the 'giveio.sys' and INSTDRV.EXE
|
||||
in a directory and log in as an Administrator or equivalent then:
|
||||
|
||||
c:\tmp> insdrv givio c:\tmp\giveio.sys
|
||||
|
||||
The package builds under Cygwin and MinGW.
|
||||
|
||||
The MinGW support provides you with a version that directly accesses the
|
||||
Windows APIs and does not need a Cygwin DLL. To build with MinGW you need to
|
||||
get the MinGW and MSYS packages from the MinGW web site:
|
||||
|
||||
http://www.mingw.org/
|
||||
|
||||
The MinGW package provides the compiler and MSYS provides a shell capable of
|
||||
running the configure script.
|
||||
|
||||
To build the TBLCF USB pod support you need to obtain the LibUsb-Win32 package
|
||||
from:
|
||||
|
||||
http://libusb-win32.sourceforge.net/
|
||||
|
||||
Click the Downloads link and move the Sourceforge download page then select the
|
||||
libusb-win32-device-bin package. I have tested with the 0.1.12 version. Unpack
|
||||
the tar file to a directory on your machine ready to use. Make sure you do not
|
||||
have any spaces in the path. Spaces cause problems with the autoconf test for
|
||||
the libusb library.
|
||||
|
||||
QUICK START
|
||||
===========
|
||||
|
||||
You have unpacked the package. Next to the top of the package create an empty
|
||||
directory and enter it, configure the package, make, then install.
|
||||
|
||||
$ tar xzf bdm-xx.tar.gz
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ ../gdb-bdm-xxx/m68k/configure
|
||||
$ make
|
||||
$ make install
|
||||
|
||||
Note: this process by default creates an IOPERM type parallel BDM driver and a
|
||||
TBLCF USB driver. If you wish to build a Linux kernel driver please follow the
|
||||
INSTALLATION directions.
|
||||
|
||||
INSTALLATION
|
||||
============
|
||||
|
||||
The Makefiles in all the subdirectories are set up to install their
|
||||
results in /usr/{bin,lib,.....}.
|
||||
|
||||
On FreeBSD remember to use `gmake' rather than `make'.
|
||||
|
||||
Notes:
|
||||
|
||||
1. For Windows move to Step 2 as the driver is built into the library. You
|
||||
may also need to add `CC=gcc' to make's command line.
|
||||
|
||||
2. For I/O Permission or USB users move to step 2 as the driver is built
|
||||
into the library.
|
||||
|
||||
3. Driver users will still have a library with I/O perm support unless the
|
||||
default of the library Makefile is manually changed.
|
||||
|
||||
4. You can specify a different `prefix' for the installation directory by
|
||||
running all the `make install' commands described below as:
|
||||
|
||||
$ make prefix=/some/directory install
|
||||
|
||||
Step 1 -- Compile and install the BDM device driver
|
||||
|
||||
If you do not wish to use a driver and just want the I/O perm support move to
|
||||
Step 2.
|
||||
|
||||
Make sure the kernel source code is installed under the /usr/src path.
|
||||
|
||||
Support for more than Linux has been added. You must enter the OS specific
|
||||
directory then enter the make command. We assume Linux for the remainder of
|
||||
this file.
|
||||
|
||||
If your Linux kernel has been configured for module versions you must
|
||||
uncomment the #MODVERSIONS=-DMODVERSIONS line in driver/linux Makefile. If
|
||||
the kernel is configured for module versions and you fail to uncomment this
|
||||
line the driver will install and work properly, but depmod will complain
|
||||
about unresolved symbols.
|
||||
|
||||
For Coldfire users the driver now looks for the debug module version and will
|
||||
use the PST signals if it detects a version 1 debug module. The debug version
|
||||
1 is found on the 5307.
|
||||
|
||||
Disable the TBLCF code with the configure option '--disable-tblcf'.
|
||||
|
||||
# cd driver/linux
|
||||
# make all install
|
||||
|
||||
You may get a bunch of error messages like:
|
||||
In file included from /usr/include/linux/fs.h:277,
|
||||
from linux-bdm.c:63:
|
||||
/usr/include/linux/hpfs_fs_i.h:5: parse error before `ino_t'
|
||||
/usr/include/linux/hpfs_fs_i.h:5: warning: no semicolon at \
|
||||
end of struct or union
|
||||
/usr/include/linux/hpfs_fs_i.h:12: parse error before `:'
|
||||
|
||||
If this happens, try adding `-I /usr/include' to the beginning of the CFLAGS
|
||||
definition in the Makefile in driver/linux.
|
||||
|
||||
A script is provided in `local_scripts' called MAKEDEV which create the
|
||||
special files needed for the CPU32 and Coldfire.
|
||||
|
||||
To make the special files by hand you can enter:
|
||||
|
||||
# mknod /dev/bdmcpu320 c 34 0
|
||||
^^ ^
|
||||
| |
|
||||
| +--Minor device number (see below).
|
||||
|
|
||||
+--This value must match the
|
||||
BDM_MAJOR_NUMBER in driver/bdm.h
|
||||
|
||||
To have the module module loaded by kerneld when needed
|
||||
adding to /etc/conf.modules the line:
|
||||
|
||||
alias char-major-34 bdm
|
||||
|
||||
To automaticially load the driver into the kernel every time
|
||||
you reboot you can add the line:
|
||||
|
||||
# /sbin/insmod bdm
|
||||
|
||||
to your startup script, such as /etc/rc.d/rc.local.
|
||||
|
||||
You will need to create the device names. The local script MAKEDEV can do
|
||||
this for you:
|
||||
|
||||
# ./local_scripts/MAKEDEV
|
||||
|
||||
Step 2 -- Compile and install the library and user programs
|
||||
|
||||
The package provides a configure script that you use to build the
|
||||
package. All testing I have performed is not to build in the source tree. For
|
||||
the default configuration just run the configure script:
|
||||
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ ../gdb-bdm-xx/m68k/configure
|
||||
|
||||
You will need to change the 'gdb-bdm-xx' to the name of the directory in the
|
||||
version of the package you have downloaded.
|
||||
|
||||
On Windows if building the TBLCF driver you need to provide the location of
|
||||
the libusb package. The details to download and obtain the libusb package for
|
||||
Windows is detail above. Provide the path to the top of the libusb package:
|
||||
|
||||
$ ../gdb-bdm-xx/m68k/configure \
|
||||
--with-usblib-dir="c:/work/libusb-win32-device-bin-0.1.12.1"
|
||||
|
||||
The above command is run inside the MSYS shell.
|
||||
|
||||
Once the package has configured itself you can make it:
|
||||
|
||||
$ make
|
||||
|
||||
To install you may need to obtain the appropriate permissions. Once you have:
|
||||
|
||||
$ make install
|
||||
|
||||
The library can be built to access a BDM driver locally via the kernel's
|
||||
driver interface, remotely via a TCP/IP socket interfacei, or with direct
|
||||
hardware access via the ioperm system call. You can have a library which
|
||||
supports all or a mix of interfaces. This allows you to build the
|
||||
library and therefore gdb on a host which does not support the driver
|
||||
interface.
|
||||
|
||||
On Windows 2000 install the GiveIO driver. This is detailed in the WINDOWS
|
||||
section earlier. To install the USB pod on Windows refer the TBLCF Pod
|
||||
section later.
|
||||
|
||||
The package supports a number of configuration options over and above the
|
||||
standard configure options such as '--prefix'. These are:
|
||||
|
||||
--enable-debug: Turn on compiler debug information
|
||||
On by default.
|
||||
|
||||
--enable-remote: Turn on the remote protocol and build it into
|
||||
the library. On by default.
|
||||
|
||||
--enable-ioperm: Turn on direct IOPERM hardware access. Enabled
|
||||
if the OS provides the ioperm() system call.
|
||||
|
||||
--enable-driver: Turn on driver access from the library. Enabled
|
||||
by default on systems that support it.
|
||||
|
||||
--enable-server: Turn on building the BDM server. On by default.
|
||||
|
||||
--enable-flashlib: Turn on building of the flashlib.
|
||||
|
||||
--enable-bdmctrl: Turn on building of the bdmctrl utility. Since there
|
||||
might be problems to locate bfd.h/libbfd.a which
|
||||
know how to handle target object files, building
|
||||
the bdmctrl utility is disabled unless you have
|
||||
specified the configure options --with-libbfd,
|
||||
--with-libiberty and --with-bfd-include-dir.
|
||||
|
||||
--enable-tblcf: Turn on building the TBLCF support. On by default.
|
||||
On Windows the --with-usblib-dir can be used to
|
||||
provide the location of the unpacked Win32 libusb
|
||||
package.
|
||||
|
||||
--with-libusb-dir Path, with no spaces to the libusb library if the
|
||||
library is not installed in the default location.
|
||||
|
||||
To turn off an option use '--disable-*' where '*' is one of the above.
|
||||
|
||||
Some host settings automatically disable some options:
|
||||
|
||||
Linux : All default settings.
|
||||
Cygwin: All default settings.
|
||||
MinGW : Server is not built.
|
||||
|
||||
The prefix defaults to the platform specific default. Please refer to your
|
||||
documentation for this default setting or just try and see what happens.
|
||||
|
||||
Note, the BDM library is now installed under the package directory of 'bdm'
|
||||
under the prefix. For example a prefix of '/usr/local' as found on Linux
|
||||
results in the library being under '/usr/local/lib/bdm/libBDM.a'.
|
||||
|
||||
The BDM package also supports cross-compiling. For example you can build
|
||||
for a mingw32 host on a Linux machine if you have a MinGW cross-compiler
|
||||
and runtime installed:
|
||||
|
||||
$ ../gdb-bdm-xx/m68k/configure --host=ming32 \
|
||||
--build=`./gdb-bdm-xx/m68k/config/config.guess`
|
||||
|
||||
Step 3 -- Installing the Server
|
||||
|
||||
You only need the BDM server if you intend to use the ioperm method of
|
||||
accessing the parallel port, or you wish to support remote access. If you
|
||||
wish to use a driver and your access is local to your development machine
|
||||
then this step may be skipped.
|
||||
|
||||
Before using the server, please make sure you understand the implications
|
||||
of such a setup. You probably want to restrict access to the bdmd port
|
||||
to trusted machines.
|
||||
|
||||
The BDM server allows a lab to contain your target hardware and you can
|
||||
access it from your development machine. The BDM server can support clients
|
||||
on different platforms. This means a Linux server can be accessed from MacOS
|
||||
or Windows clients.
|
||||
|
||||
The server runs from the xinetd or inetd daemon, and installs into
|
||||
the 'sbin' directory under the configure prefix when building the user
|
||||
programs in Step 2 above.
|
||||
|
||||
You need to edit the /etc/services file to add the port number bdmd
|
||||
uses. Add this line at the bottom of the /etc/services file:
|
||||
|
||||
bdm 6543/tcp # BDM server
|
||||
|
||||
The BDM remote library will check /etc/services to see if a port is
|
||||
provided. If not found the remote library will default to 6543.
|
||||
|
||||
It is recommended you add the entry to /etc/services and you check
|
||||
the client and server match.
|
||||
|
||||
For inetd users such as FreeBSD:
|
||||
|
||||
You need to edit the /etc/inetd.conf file. Add this line at the end of
|
||||
/etc/inetd.conf:
|
||||
|
||||
bdm stream tcp nowait root /usr/local/sbin/bdmd bdmd
|
||||
|
||||
You can specify any user including root. If you are wishing to use the
|
||||
ioperm support then the user must be root.
|
||||
|
||||
For xinetd users as root install the follow in a file called:
|
||||
|
||||
/etc/xinetd.d/bdm
|
||||
|
||||
service bdm
|
||||
{
|
||||
socket_type = stream
|
||||
port = 6543
|
||||
wait = no
|
||||
user = root
|
||||
server = /usr/sbin/bdmd
|
||||
server_args = -n
|
||||
log_on_failure += USERID
|
||||
disable = no
|
||||
}
|
||||
|
||||
then get xinetd to reload its configuration.
|
||||
|
||||
To test the bdmd server open a shell on the machine bdmd has been installed
|
||||
and condigured. At the shell prompt run telnet as follows:
|
||||
|
||||
$ telnet localhost bdm
|
||||
Trying 127.0.0.1...
|
||||
Connected to localhost.
|
||||
Escape character is '^]'.
|
||||
>> helo
|
||||
HELO 2 ted BDM server 1.0.0 ready.
|
||||
>> quit
|
||||
Connection closed by foreign host.
|
||||
$
|
||||
|
||||
The lines marked '>>' you type and press enter. Once the connected to
|
||||
localhost appears enter 'helo' and enter. The server should respond with
|
||||
version etc. To exit enter 'quit' then enter.
|
||||
|
||||
If is not working you are best to check your system log (/var/log/messages)
|
||||
to locate the reason xinetd is not starting the bdmd server. To debug an
|
||||
xinetd setup, as root do:
|
||||
|
||||
# kill -SIGUSR1 $(pidof xinetd)
|
||||
# less /var/run/xinetd.dump
|
||||
|
||||
The look for the BDM entry and check entry is correct. Here is an
|
||||
example:
|
||||
|
||||
Service = bdm
|
||||
State = Active
|
||||
Service configuration: bdm
|
||||
id = bdm
|
||||
flags = IPv4
|
||||
socket_type = stream
|
||||
Protocol (name,number) = (tcp,6)
|
||||
port = 6543
|
||||
Groups = no
|
||||
Bind = All addresses.
|
||||
Server = /usr/sbin/bdmd
|
||||
Server argv = bdmd -n
|
||||
Only from: All sites
|
||||
No access: No blocked sites
|
||||
Logging to syslog. Facility = authpriv, level = info
|
||||
Log_on_success flags = HOST PID
|
||||
Log_on_failure flags = HOST USERID
|
||||
running servers = 1
|
||||
retry servers = 0
|
||||
attempts = 0
|
||||
service fd = 5
|
||||
|
||||
Step 4 -- (Optional) Testing the driver.
|
||||
|
||||
It a good idea to build and run the test program called `bdm-chk' for
|
||||
Coldfire processors and 'bdm-cpu32-chk' for CPU32 processors. This will show
|
||||
the library built correctly, the driver loads and functions, and your
|
||||
hardware is connected correctly and functioning.
|
||||
|
||||
You will need to select the correct device for the Coldfire. The example
|
||||
below is for the CPU32 interface on LPT1. To test a CPU32 processor do:
|
||||
|
||||
$ cd test
|
||||
$ ./bdm-chk /dev/bdmcpu320
|
||||
|
||||
To test a Coldfire processor do:
|
||||
|
||||
$ ./bdm-chk /dev/bdmcf0
|
||||
|
||||
Note, the number at the end of the device path is the parallel
|
||||
port number your pod hardware is connected too. The device nodes
|
||||
start from 0, while the standard PC LPT ports number from 1. This
|
||||
means '/dev/bdmcf0' will look for a Coldfire processor on LPT1.
|
||||
|
||||
For a TBLCF USB pod on Linux you need to set up udev to create a symlink.
|
||||
The section 'TBLCF USB Support' details how to set up udev. The TBLCF tools
|
||||
tblcf-show returns the following for a single pod connected to a Linux box:
|
||||
|
||||
$ ./tblcf-show
|
||||
TBLCF Turbo BDM Light ColdFire Show
|
||||
|
||||
Found 1 device(s)
|
||||
1: 001-012
|
||||
|
||||
There is one pod and the name is '01-012' and udev links this to
|
||||
/dev/tblcf3. To run check using this pod:
|
||||
|
||||
$ ./bdm-chk /dev/tblcf3
|
||||
|
||||
Note, the name will change on Linux if you disconnect the pod and reconnect
|
||||
it. If want to lock a name down you can use udev.
|
||||
|
||||
To test using a BDM server on a remote host call 'foo':
|
||||
|
||||
$ /bdm-chk foo:/dev/bdmcpu320
|
||||
|
||||
Note, do not use the MSYS rxtv shell to test from. It currently transforms
|
||||
program arguments and the device path used in these example becomes
|
||||
something very different.
|
||||
|
||||
Step 5 -- Patch your GDB distribution
|
||||
Step 6 -- Compile and install the cross-GDB with BDM support
|
||||
|
||||
These step have been removed. We do not need to patch GDB any more. Use the
|
||||
m68k-bdm-gdbserver executable with GDB built from the FSF sources.
|
||||
|
||||
Please refer to README.bdmgdbserver for instructions on using the BDM GDB
|
||||
Server.
|
||||
|
||||
Step 7 -- (Optional) Install the GDB scripts
|
||||
|
||||
$ cd gdbScripts
|
||||
$ make install
|
||||
|
||||
You will have to change the scripts to match your CPU32(+) hardware.
|
||||
|
||||
Step 8 -- Build a BDM interface
|
||||
|
||||
See the Schematics directory for an example circuit.
|
||||
|
||||
Step 7 -- Try it out
|
||||
|
||||
This is left as an exercise for the reader.....
|
||||
|
||||
INITIALISATION SCRIPTS
|
||||
======================
|
||||
|
||||
The M68K BDM package supports initialisation scripts. The scripts are all
|
||||
called '.m68kbdminit' and read from 3 locations during the bdmOpen call. The
|
||||
locations are:
|
||||
|
||||
1. The current directory ($PWD)
|
||||
2. The user's home directory as specified by the "HOME" environment
|
||||
variable.
|
||||
3. A user define location as specified by the "M68K_BDM_INIT" environment
|
||||
variable.
|
||||
|
||||
The files are plain text files and are read into a character array on after
|
||||
another. The '#' is a comment character and line continuation using the '\' at
|
||||
the end of a line is supported.
|
||||
|
||||
The configurations supported are:
|
||||
|
||||
dev:
|
||||
"dev user-name device-name"
|
||||
|
||||
A line starting with 'dev' followed by white space defines a device mapping
|
||||
or renaming. The user-name is the name a user may use to reference a
|
||||
device. The device-name is the name required by the hardware to access the
|
||||
device. This can be used to map a difficult USB device name that libusb uses
|
||||
to a simpler user friendly name. This helps users because the naming of USB
|
||||
devices vary between host platforms. The device mapping also helps
|
||||
configuration control of debugging scripts. A common script can reference a
|
||||
name and each user in a team can place the actual device they use in the a
|
||||
user specific file in their home directory.
|
||||
|
||||
TBLCF USB SUPPORT
|
||||
=================
|
||||
|
||||
The TBLCF is the Turbo BDM Light Coldfire UDB Pod created by Daniel Malik back
|
||||
in 2006. This is a GPL design for both hardware and software. It uses a small
|
||||
microcontrolller and firmware in the pod and the open source libusb code to
|
||||
provide the low level USB support on various hosts.
|
||||
|
||||
The supported hosts are Linux, FreeBSD, and Windows. The specifics of the hosts
|
||||
make the set up different for each. The scripts support helps user isolate
|
||||
their host specifics. USB device names are helped by the 'dev' entry in the
|
||||
M68K BDM script files. These entries allow you to make a simpler entry for a
|
||||
more complex name. Use the' tblcf-show tool' to dump the names of the USB
|
||||
devices you need to pass to the BDM software. On Linux you may wish to use read
|
||||
the Linux section and use the udev interface.
|
||||
|
||||
The USB support in the BDM package checks the device name against the devices
|
||||
detected by libusb. Linux is an exception where special code is present to
|
||||
handle udev created sym-links. The code will partial match the device node
|
||||
against the libusb detected devices. For example if the libusb device node
|
||||
found on Windows is 'bus-0-\\.\libusb0-0002-0x0425-0x1001' then you could use
|
||||
'0002-0x0425-0x1001' to use the device.
|
||||
|
||||
If you are a CPU32 user and would like to look at supporting the CPU32
|
||||
processor with this pod please contact the BDM mailing list.
|
||||
|
||||
Linux
|
||||
-----
|
||||
|
||||
The USB pod is simple to support on Linux. Just plug it and check the kernel
|
||||
messages:
|
||||
|
||||
$ dmesg | tail
|
||||
usb 1-1.2: new low speed USB device using ehci_hcd and address 12
|
||||
usb 1-1.2: config 1 interface 0 altsetting 0 endpoint 0x82 is Bulk; ...
|
||||
usb 1-1.2: config 1 interface 0 altsetting 0 endpoint 0x2 is Bulk; ...
|
||||
usb 1-1.2: configuration #1 chosen from 1 choice
|
||||
usb 1-1.2: New USB device found, idVendor=0425, idProduct=1001
|
||||
usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=2
|
||||
usb 1-1.2: Product: Turbo BDM Light ColdFire v0.4
|
||||
usb 1-1.2: Manufacturer: Freescale
|
||||
usb 1-1.2: SerialNumber: Turbo BDM Light ColdFire v0.4
|
||||
|
||||
You can see the pod has connected with address 12. Run the 'tblcf-show' command
|
||||
to list the names of the pods as seen by libusb. If you disconnect the pod or
|
||||
power cycle the pod or system the address of the pod can change. For example a
|
||||
disconnect then reconnect moves the address onto the next number on my
|
||||
system. This make it difficult to create scripts that take care of this.
|
||||
|
||||
The solution is to use udev. This is a user land system present on current
|
||||
Linux systems that responds to and manages hot plug kernel events. The
|
||||
Wikipedia page on udev (http://en.wikipedia.org/wiki/Udev) provide a nice
|
||||
overview of udev.
|
||||
|
||||
Create a udev rule for the TBLCF pod to create a node in the 'dev'
|
||||
directory. You can customise the node name used to suite your specific
|
||||
needs. For me I have a single pod on my local Fedora Core 8 workstation and so
|
||||
a basic setup is all that is needed:
|
||||
|
||||
# cat /etc/udev/rules.d/91-tlbcf.rules
|
||||
SUBSYSTEM=="usb" ATTR{manufacturer}=="Freescale" \
|
||||
ATTR{idVendor}=="0425" ATTR{idProduct}=="1001" SYMLINK+="tblcf%n"
|
||||
|
||||
Note: there is a single line in the actual file.
|
||||
|
||||
When I plug in my pod udev creates '/dev/tblcf3'. This is:
|
||||
|
||||
# ls -las /dev/tblcf3
|
||||
0 lrwxrwxrwx 1 root root 15 2008-03-06 14:59 /dev/tblcf3 -> bus/usb/001/012
|
||||
|
||||
The USB support for Linux in the BDM package checks if the device node is a
|
||||
sym-link. If it is the link path is read and checked to see if the prefix is
|
||||
'bus/usb'. If it is the device is assumed to be a USB device and the trailing
|
||||
part of the path is the device name returned by libusb. The USB driver will
|
||||
attempt to open the device. This may fail if the user does not have
|
||||
permission. In this case the bdmd server on the local host is used. This is
|
||||
similar to the I/O Permission support.
|
||||
|
||||
With udev you can create device nodes with any name that suites. You can also
|
||||
add more attribute checks to create a specific node. This allows for the
|
||||
creation of nodes that match the function the pod is performing. In my example
|
||||
above the number in the dev file is based on the USB port on the work station.
|
||||
|
||||
The udev configuration required varys for different types of Linux. Please let
|
||||
me know of a configuration for your version of Linux and I will add it to the
|
||||
list.
|
||||
|
||||
Windows
|
||||
-------
|
||||
|
||||
Plugging the pod into a Windows machine brings up the standard Hardware found
|
||||
installer dialog box. I have only done this when an Administrator and I suspect
|
||||
you will need to be an Administrator because driver files are installed into
|
||||
the Windows directory.
|
||||
|
||||
You need to have the LibUsb-Win32 package unpacked some where on your
|
||||
machine. Typically you will have done this to build the BDM software and the
|
||||
package links the libusb library. The BDM package has a axbdm.inf file and you
|
||||
navigate the Hardware installer to say you have a disk then browse to select
|
||||
the axbdm.inf file. The installer will then start to install the drivers and if
|
||||
it cannot find the files it needs it will ask for them. This time navigate to
|
||||
the location of the LibUsb-Win32 files and select the ones asked for by the
|
||||
dialog box.
|
||||
|
||||
I created the axbdm.inf file for the AxBDM pod from Axiom I have. The
|
||||
LibUsb-Win32 package contains a program called inf-installer.exe. To use this
|
||||
program with the pod connected to the computer, run the program then select the
|
||||
pod and fill in the fields.
|
||||
|
||||
Once finished you can run the testlibusb-win.exe and it will show the TBLCF pod
|
||||
in the list of devices.
|
||||
|
||||
Run the tblcf-show program to get a list of detected pods. The returned name is
|
||||
not pretty but it seems to be unique to pod in a specific USB port. You need to
|
||||
use this name when using the BDM software:
|
||||
|
||||
> chk-bdm bus-0-\\.\libusb0-0002-0x0425-0x1001
|
||||
|
||||
It is not a nice name but this is what libusb returns. You can take this name
|
||||
and place in a .m68kbdminit file to make more user friendly:
|
||||
|
||||
dev bus-0-\\.\libusb0-0002-0x0425-0x1001 usb1
|
||||
|
||||
On Windows you may need to add a HOME environment variable. You can do this
|
||||
using the Control Panel's System entry. Open the System entry, select the
|
||||
Advanced tab, then the Environment Variables button and add to "User Variables"
|
||||
a "HOME" entry thats points to your home directory. On Windows this is
|
||||
typically your "My Documents" directory. Once set you can create a .m68kbdminit
|
||||
file in that directory and the M68K BDM tools will read that file when opening
|
||||
a BDM device.
|
||||
|
||||
When using GDB you need to escape the '\' character. The above device name in
|
||||
gdb and gdb scripts becomes:
|
||||
|
||||
bus-0-\\\\.\\libusb0-0002-0x0425-0x1001
|
||||
|
||||
I/O PERM SUPPORT
|
||||
================
|
||||
|
||||
The I/O Permission support is based around the 'ioperm' system call on Linux
|
||||
and the "/dev/io" I/O port access on FreeBSD. The calls allows a root executed
|
||||
program direct access to the I/O ports of a PC. Unix programs such as X windows
|
||||
use this call to gain control of the video card I/O ports without the need for
|
||||
a driver. The term "ioperm" refers to the ioperm call on Linux and the
|
||||
"/dev/io" interface on FreeBSD.
|
||||
|
||||
The support for the ioperm call has been added to the BDM package because it:
|
||||
|
||||
1. Allows a user to build a BDM application without installing kernel
|
||||
sources.
|
||||
|
||||
2. The BDM driver is included in the user land application rather than
|
||||
the kernel. A kernel upgrade or change does not require the building
|
||||
of the BDM driver.
|
||||
|
||||
3. Binary programs can be created and distributed removing the need for
|
||||
users to build a driver to use them.
|
||||
|
||||
4. Stops the kernel jitter seen when downloading.
|
||||
|
||||
The library that BDM applications link to by default now contains the ioperm
|
||||
call as well as the BDM driver code. If you link the default library to GDB it
|
||||
will contain the ioperm call. Having an application such as GDB make an ioperm
|
||||
call will fail unless GDB is executing as root. The ioperm call requires the
|
||||
program making the call be executing as root and executing GDB as root is not
|
||||
recommended and is actively discouraged.
|
||||
|
||||
The remote protocol that is also built by default into the BDM library provides
|
||||
an easy means to have GDB executing as a user and the BDM server executing as
|
||||
root. The BDM server being root can make the ioperm call and gain direct
|
||||
control of the parallel ports.
|
||||
|
||||
To use the ioperm call make sure you install the BDM server. See Step 3 of the
|
||||
INSTALLATION procedure above.
|
||||
|
||||
The ioperm support performs the following when opening the BDM port:
|
||||
|
||||
1. Issue the ioperm call. If it passes the direct I/O accessing of the
|
||||
parallel port is performed.
|
||||
|
||||
2. If the ioperm call fails, the kernel driver open is attempted. If
|
||||
is succeeds the kernel driver is used.
|
||||
|
||||
3. If the driver call fails an attempt to connect to a local BDM
|
||||
server is performed. Therefore if ioperm and driver opens fail the
|
||||
following check command:
|
||||
|
||||
$ ./chk /dev/bdmcf0
|
||||
|
||||
is transformed into the equivalent command line command of:
|
||||
|
||||
$ ./chk localhost:/dev/bdmcf0
|
||||
|
||||
where we are attempting to open LPT1 for a Coldfire target. The
|
||||
device entry at the end should be changed to suite your specific
|
||||
parallel port and processor.
|
||||
|
||||
A side effect of the current I/O perm implementation is the simulation of
|
||||
device nodes under the '/dev' tree. This design is copied from the Windows
|
||||
version of the BDM package. The Windows build is a kind of I/O perm driver
|
||||
where the GiveIO driver provides the Windows application direct access to the
|
||||
parallel port rather than the ioperm system call. The simulation of BDM device
|
||||
nodes under the '/dev' directory is used to keep the documentation consisent,
|
||||
and to allow GDB scripts or BDM programs a common way to operate on different
|
||||
platforms. The simulation means you will not find device nodes under a '/dev'
|
||||
tree. This can be confusing for experienced Unix users accustomed to finding
|
||||
device nodes in the '/dev' directory.
|
||||
|
||||
The I/O perm interface has about the same performance as the kernel
|
||||
module. This is based on limited testing. The kernel module should be a little
|
||||
faster for most block read/write operations. This is mostly due to the kernel
|
||||
being blocked while the bit bashing occurs. If you perform a large number of
|
||||
small BDM requests the performance will about the same for the ioperm direct
|
||||
accesses and the kernel driver.
|
||||
|
||||
The Library
|
||||
===========
|
||||
|
||||
The library provides a higher level interface to the driver without requiring
|
||||
you to make low level Linux driver calls.
|
||||
|
||||
The library interface consists of two parts:
|
||||
|
||||
1) The driver interface, and
|
||||
2) The remote protocol.
|
||||
|
||||
The driver interface make Unix driver calls via the open, close, read, write
|
||||
and ioctl system calls.
|
||||
|
||||
The library also contains the remote protocol that talks to the BDM
|
||||
server. This protocol is not the GDB remote protocol. It operates at a much
|
||||
lower level than the GDB remote protocol and is designed to support a server
|
||||
operating from xinetd or inetd. It also allows flash programming tools built
|
||||
with the BDM library to work remotely.
|
||||
|
||||
The library does not contain the download support anymore. The need to contain
|
||||
a specific BFD header file is broken. The GDB patch contains the code to
|
||||
perform a download to target.
|
||||
|
||||
Windows 9x,NT,2000
|
||||
==================
|
||||
|
||||
The library will build the driver in one pass. There is no driver needed for
|
||||
Windows 9x. This should allow GDB to be built. The Cygwin or MinGW packages are
|
||||
needed to build the library.
|
||||
|
||||
I have tested the package on Windows 98, Windows 2000 and Windows XP using
|
||||
MinGW. This is cross-compiled from Linux and also compiled under MinGW on
|
||||
Windows XP.
|
||||
|
||||
Cygwin should build and work, how-ever at the time of updating this file I
|
||||
could get Cygwin installed and working to test.
|
||||
|
||||
Setting the minor device number
|
||||
===============================
|
||||
|
||||
The minor device number (the second number in the mknod command) specifies
|
||||
the parallel port to which the BDM interface is connected and the type of
|
||||
the target CPU. The least signficant two bits of the minor device
|
||||
number specify the parallel port and the remaining bits specify the target
|
||||
CPU type:
|
||||
|
||||
7 6 5 4 3 2 1 0
|
||||
+----+----+----+----+----+----+----+----+
|
||||
| | | | | | | | |
|
||||
+----+----+----+----+----+----+----+----+
|
||||
\ / \ /
|
||||
\ / \ /
|
||||
\ / \ /
|
||||
------------+----------- -+-
|
||||
| |
|
||||
| |
|
||||
| +-- These two bits select the parallel
|
||||
| port to which the BDM interface is
|
||||
| connected: 00 - LPT1
|
||||
| 01 - LPT2
|
||||
| 10 - LPT3
|
||||
|
|
||||
+-- These six bits select the target CPU type:
|
||||
000000 - CPU32+ (PD adaptor)
|
||||
000001 - Coldfire
|
||||
000010 - CPU32+ (ICD adaptor)
|
||||
|
||||
Examples
|
||||
========
|
||||
1. Target processor is a Motorola MC68360 (CPU32+) connected to LPT1.
|
||||
Minor device number is 0.
|
||||
|
||||
2. Target processor is a Motorola MC68360 (CPU32+) connected to LPT2.
|
||||
Minor device number is 1.
|
||||
|
||||
3. Target processor is a Motorola MC5206(e) or MCF5307 (Coldfire) connected
|
||||
to LPT1. Minor device number is 4.
|
||||
|
||||
ACKNOWLEDGEMENTS
|
||||
================
|
||||
|
||||
Thanks very much to Motorola for making the parallel port BDM
|
||||
interface circuit freely available and to M. Schraut and G. Magin
|
||||
for providing the Linux driver and gdb modifications that got this
|
||||
all started.
|
||||
|
||||
For the Coldfire additions I would like thank Eric for the clean
|
||||
driver frame work, and David L Jenkins
|
||||
(David.l.jenkins@btinternet.com) for the orginal post to the Coldfire
|
||||
mailing list (ColdFire@WildRice.com) with the pin out and functions
|
||||
for the P&E interface. It is what started me doing this and a really
|
||||
great help. David Fiddes must be thanked for the testing and 5307
|
||||
reset bug. I would also like to thank Dave Morgan of Plessey Asia
|
||||
Pacific for the use of some test equipment which helped.
|
||||
|
||||
Thanks to David McCullough (davidm@stallion.oz.au) for the SCO
|
||||
support.
|
||||
|
||||
ICD fixes from Alexander Aganichev <AAganichev@hypercom.com>.
|
||||
|
||||
ICD performace fixed from Keith Outwater <vac4050@cae597.rsc.raytheon.com>.
|
||||
|
||||
NT and GiveIO support to Rick Haubenstricker <rickh@perceptron.com>.
|
||||
|
||||
Thanks to Sue Cozart and Joe Circello for answering question about
|
||||
the Coldfire's BDM hardware.
|
||||
|
||||
Additional thanks to Freescale for their continued support.
|
||||
|
||||
Thanks to Axiom Manufacturing for their support in adding the TBLCF support.
|
||||
|
||||
WHERE TO GET HELP
|
||||
=================
|
||||
|
||||
If you've got any questions about any of this, please contact the BDM project
|
||||
mailing list on the SourceForge web site:
|
||||
|
||||
http://sourceforge.net/projects/bdm/
|
||||
|
||||
We like to hear any success stories, as well as suggestions for improvements.
|
||||
282
m68k/README.bdmgdbserver
Normal file
282
m68k/README.bdmgdbserver
Normal file
@@ -0,0 +1,282 @@
|
||||
M68K BDM GDB Server
|
||||
Chris Johns
|
||||
3 Nov 2007
|
||||
|
||||
The 'gdbserver' directory contains a GDB Remote protocol server which provides
|
||||
BDM support for GDB for a range of Coldfire and CPU32 processors. The server
|
||||
called 'm68k-bdm-gdbserver' will have been installed when you installed the
|
||||
M68K BDM package. Make sure the installed server executable's path is in your
|
||||
environment's path variable.
|
||||
|
||||
The BDM GDB server support Linux and Windows using GDB's socket or pipe
|
||||
interfaces. The socket interface is the standard way GDB talks to a GDB remote
|
||||
server. The pipe mode is also supported. With the pipe mode GDB spawns the BDM
|
||||
GDB server and pipe the remote protocol to the new process.
|
||||
|
||||
The BDM GDB Server support the BDM library's direct or remote protocol mode of
|
||||
operation. If you use the BDM library remote protocol the actual hardware will
|
||||
be 2 processes away from GDB.
|
||||
|
||||
The GDB with the BDM GDB Server will break existing GDB scripts. All the
|
||||
features that the patched version had have been carried over to the BDM GDB
|
||||
Server with the added advantage of no patch to maintain plus a means to add
|
||||
support for new Coldfire processors simply with out the need to upgrade GDB.
|
||||
|
||||
GDB Patched verses GDB Remote
|
||||
|
||||
The old patched GDB and the newer GDB using the remote protocol will break
|
||||
existing BDM GDB scripts. All the features present in the patched GDB are
|
||||
present how-ever the commands to access the features have changed. There was
|
||||
no way to avoid this.
|
||||
|
||||
The BDM GDB Server using a remote GDB has many advantages. The advantages are:
|
||||
|
||||
- No need to patch GDB.
|
||||
- BDM fixes and updates with out the need to update GDB.
|
||||
- Simpler means of adding support for new Coldfire processors.
|
||||
|
||||
The hardware break and watch points are supported.
|
||||
|
||||
The registers shown by the standard 'info reg' command is now restricted to
|
||||
registers that are in normal use with-in a program. For example the 5235
|
||||
processor shows:
|
||||
|
||||
(gdb) info reg
|
||||
d0 0xcf206080 -819961728
|
||||
d1 0x15001080 352325760
|
||||
d2 0x19 25
|
||||
d3 0x3f6afffc 1063976956
|
||||
d4 0xffffedce -4658
|
||||
d5 0xff77af57 -8933545
|
||||
d6 0x5e0658c7 1577474247
|
||||
d7 0xf9f3dcff -101458689
|
||||
a0 0x0 0x0
|
||||
a1 0xffe254d4 0xffe254d4
|
||||
a2 0x79a7dae5 0x79a7dae5
|
||||
a3 0xf75e4dbf 0xf75e4dbf
|
||||
a4 0x637a 0x637a
|
||||
a5 0xf3df7b7f 0xf3df7b7f
|
||||
fp 0x627a 0x627a
|
||||
sp 0x627a 0x627a
|
||||
ps 0x2704 9988
|
||||
pc 0xffe254de 0xffe254de
|
||||
macsr 0x0 0
|
||||
mask 0xffffff9b -101
|
||||
acc0 0xef3b7df8 -281313800
|
||||
acc1 0xe50bdd7a -452207238
|
||||
acc2 0x3b7df47b 998110331
|
||||
acc3 0xdbb7cff8 -608710664
|
||||
accext01 0x3b7df87c 998111356
|
||||
accext32 0xc1e2f47b -1042090885
|
||||
|
||||
The full list of available registers are:
|
||||
|
||||
(gdb) info all-registers
|
||||
d0 0xcf206080 -819961728
|
||||
d1 0x15001080 352325760
|
||||
d2 0x19 25
|
||||
d3 0x3f6afffc 1063976956
|
||||
d4 0xffffedce -4658
|
||||
d5 0xff77af57 -8933545
|
||||
d6 0x5e0658c7 1577474247
|
||||
d7 0xf9f3dcff -101458689
|
||||
a0 0x0 0x0
|
||||
a1 0xffe254d4 0xffe254d4
|
||||
a2 0x79a7dae5 0x79a7dae5
|
||||
a3 0xf75e4dbf 0xf75e4dbf
|
||||
a4 0x637a 0x637a
|
||||
a5 0xf3df7b7f 0xf3df7b7f
|
||||
fp 0x627a 0x627a
|
||||
sp 0x627a 0x627a
|
||||
ps 0x2704 9988
|
||||
pc 0xffe254de 0xffe254de
|
||||
vbr 0x3f8 1016
|
||||
cacr 0x0 0
|
||||
acr0 0x16ed4064 384647268
|
||||
acr1 0xf1bd2080 -239263616
|
||||
rambar 0x20000020 536870944
|
||||
othera7 0xedfafefb -302317829
|
||||
csr 0x1000000 16777216
|
||||
xcsr 0x8400000 138412032
|
||||
aatr 0x5 5
|
||||
tdr 0x40000000 1073741824
|
||||
pbr 0x0 0
|
||||
pbmr 0x0 0
|
||||
abhr 0x0 0
|
||||
ablr 0x0 0
|
||||
dbr 0x0 0
|
||||
dbmr 0x0 0
|
||||
macsr 0x0 0
|
||||
mask 0xffffff9b -101
|
||||
acc0 0xef3b7df8 -281313800
|
||||
acc1 0xe50bdd7a -452207238
|
||||
acc2 0x3b7df47b 998110331
|
||||
acc3 0xdbb7cff8 -608710664
|
||||
accext01 0x3b7df87c 998111356
|
||||
accext32 0xc1e2f47b -1042090885
|
||||
|
||||
The special BDM command are available. These are accessed using the GDB
|
||||
'monitor' command. To get a list of available commands connect to the target
|
||||
then issue 'monitor bdm-help'.
|
||||
|
||||
Note: At this point in time some commands are missing. They will be added.
|
||||
|
||||
Building GDB
|
||||
|
||||
The BDM GDB Server requires GDB 6.7 or later built for a m68k-elf or similar
|
||||
target. The standard FSF sources are the only sources the BDM GDB Server is
|
||||
tested with. You do not need to patch GDB but you will need to insure the
|
||||
'expat' XML library is installed and GDB's configure script detecteds it
|
||||
correctly. Build and install GDB the normal way. For example:
|
||||
|
||||
$ tar jxf gdb-6.7.1.tar.bz2
|
||||
$ mkdir localhost
|
||||
$ cd localhost
|
||||
$ ../gdb-6.7.1/configure
|
||||
$ make all install
|
||||
|
||||
Connecting with GDB
|
||||
|
||||
Connect your pod to the PC and to your target hardware then power on the
|
||||
hardware. This example session is with the Axman 5235 board and using the
|
||||
remote target's pipe interface.
|
||||
|
||||
Test you BDM hardware and software configuration by running one of the test
|
||||
programs in the M68K BDM package.
|
||||
|
||||
Start GDB and obtain the standard GDB prompt.
|
||||
|
||||
$ m68k-elf-gdb
|
||||
GNU gdb 6.7
|
||||
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
|
||||
and "show warranty" for details.
|
||||
This GDB was configured as "--host=i686-pc-linux-gnu --target=m68k-elf".
|
||||
(gdb)
|
||||
|
||||
Connect to the target:
|
||||
|
||||
(gdb) target remote | m68k-bdm-gdbserver pipe /dev/bdmcf0
|
||||
Remote debugging using | m68k-bdm-gdbserver pipe /dev/bdmcf0
|
||||
trying kernel driver: /dev/bdmcf0
|
||||
trying bdm server: localhost:/dev/bdmcf0
|
||||
m68k-bdm: detected MCF5235
|
||||
m68k-bdm: architecture CF5235 connected to /dev/bdmcf0
|
||||
m68k-bdm: Coldfire debug module version is 0 (5206(e)/5235/5272/5282)
|
||||
Process /dev/bdmcf0 created; pid = 0
|
||||
Remote debugging using pipe
|
||||
0xffe254e2 in ?? ()
|
||||
(gdb)
|
||||
|
||||
The 'target remote |' command tells GDB to use the remote protocol via the
|
||||
pipe interface. GDB will then use the remainder of the command line to invoke
|
||||
the BDM GDB Server. The command line used is the simplest one that can be
|
||||
used. It is:
|
||||
|
||||
m68k-bdm-gdbserver pipe /dev/bdmcf0
|
||||
|
||||
The 'm68k-bdm-gdbserver' is required to be in your environment's path. You can also
|
||||
use a full path. The first parameter is the type of communications the GDB
|
||||
server is to use. In this case if the 'pipe' interface. It could be a
|
||||
socket and we will cover this later.
|
||||
|
||||
The BDM GDB Server can accept other command line options. They are:
|
||||
|
||||
m68k-bdm-gdbserver -vVhDd -t <time> <device>
|
||||
-v Verbose. More than one the more verbose.
|
||||
-V Version.
|
||||
-h This help.
|
||||
-D Driver debug level. More than one for more debug.
|
||||
-d BDM Library debug level. More than one for more debug.
|
||||
-t time Delay timing for the parallel ports.
|
||||
device The device to connect to such as /dev/bdmcf0.
|
||||
|
||||
These options are mostly development and testing options. The following steps
|
||||
instructions, shows assembler, set a hardware breakpoint then runs until the
|
||||
break point:
|
||||
|
||||
(gdb) display /i $pc
|
||||
1: x/i $pc
|
||||
0xffe254de: moveb %a0@(516),%d1
|
||||
(gdb) si
|
||||
0x00000404 in ?? ()
|
||||
1: x/i $pc
|
||||
0x404: jmp 0xffe25c04
|
||||
(gdb)
|
||||
0xffe25c04 in ?? ()
|
||||
1: x/i $pc
|
||||
0xffe25c04: movew #9984,%sr
|
||||
(gdb) x /20i $pc
|
||||
0xffe25c04: movew #9984,%sr
|
||||
0xffe25c08: movel #1073741825,%d0
|
||||
0xffe25c0e: movel %d0,0x40000000
|
||||
0xffe25c14: movel #536870945,%d0
|
||||
0xffe25c1a: movec %d0,%rambar1
|
||||
0xffe25c1e: movel #536870912,%d0
|
||||
0xffe25c24: addil #65536,%d0
|
||||
0xffe25c2a: moveal %d0,%sp
|
||||
0xffe25c2c: jsr 0xffe3ca08
|
||||
0xffe25c32: moveal #25530,%sp
|
||||
0xffe25c38: jmp 0xffe3d5f0
|
||||
0xffe25c3e: bras 0xffe25c3e
|
||||
0xffe25c40: nop
|
||||
0xffe25c42: nop
|
||||
0xffe25c44: halt
|
||||
0xffe25c46: nop
|
||||
0xffe25c48: movel #16777216,%d0
|
||||
0xffe25c4e: movec %d0,%cacr
|
||||
0xffe25c52: rts
|
||||
0xffe25c54: linkw %fp,#0
|
||||
(gdb) hb *0xffe3d5f0
|
||||
Hardware assisted breakpoint 1 at 0xffe3d5f0
|
||||
(gdb) c
|
||||
Continuing.
|
||||
|
||||
Breakpoint 1, 0xffe3d5f0 in ?? ()
|
||||
1: x/i $pc
|
||||
0xffe3d5f0: linkw %fp,#0
|
||||
(gdb) q
|
||||
The program is running. Exit anyway? (y or n) y
|
||||
gdb: Killing inferior
|
||||
$
|
||||
|
||||
BDM GDB Server Commands
|
||||
|
||||
The BDM GDB Server contains a number of commands. The current help is:
|
||||
|
||||
(gdb) monitor bdm-help
|
||||
m68k-bdm: monitor commands:
|
||||
bdm-help
|
||||
This help message.
|
||||
bdm-debug <level>
|
||||
Set the M68K BDM debug level.
|
||||
bdm-lib-debug <level>
|
||||
Set the BDM library debug level.
|
||||
bdm-driver-debug <level>
|
||||
Set the BDM driver debug level. This may result in a
|
||||
remote BDm server logging to syslog if this is enabled.
|
||||
bdm-ctl-get <reg>
|
||||
Get the control register where <reg> is a register value
|
||||
supported by the target. For example: bdm-ctl-get 0x801
|
||||
will return the VBR register for most Coldfire processors.
|
||||
bdm-ctl-set <reg <value>>
|
||||
Set the control reigster where <reg> is a register value
|
||||
supported by the target. For example: bdm-ctl-set 0x801 0
|
||||
bdm-dbg-get <reg>
|
||||
Get the debug register where <reg> is a register value
|
||||
supported by the target. For example: bdm-dbg-get 0x1
|
||||
will return the XCSR register on Coldfire with Debug B+.
|
||||
bdm-dbg-set <reg> <value>
|
||||
Set the debug reigster where <reg> is a register value
|
||||
supported by the target. For example: bdm-dbg-set 0x1 0
|
||||
|
||||
To get the VBR register you enter:
|
||||
|
||||
(gdb) monitor bdm-ctl-get 0x801
|
||||
m68k-bdm: control reg: 0x801 = 1016 (0x3f8)
|
||||
|
||||
To set the VBR register you enter:
|
||||
|
||||
(gdb) monitor bdm-ctl-set 0x801 0x12345678
|
||||
8
m68k/README.cvs
Normal file
8
m68k/README.cvs
Normal file
@@ -0,0 +1,8 @@
|
||||
If you've checked out the sources from CVS, you need
|
||||
recent versions of autoconf, automake and libtool.
|
||||
|
||||
To create configure, run the following command from
|
||||
the source directory:
|
||||
|
||||
config/bootstrap
|
||||
|
||||
73
m68k/README.insight
Normal file
73
m68k/README.insight
Normal file
@@ -0,0 +1,73 @@
|
||||
Insight Support
|
||||
|
||||
Chris Johns <ccj@acm.org>, 3rd Feb 2001.
|
||||
|
||||
Support has been added to allow Insight to run. The GDB backend and
|
||||
driver are working, how-ever the dialog box for target connection
|
||||
could do with more work. You can make connections, set break points,
|
||||
but I have not done any real debugging. The reason is I have been
|
||||
testing on Win9x and do not have any compilers setup. I also only ran
|
||||
Insight from a Cygwin bash prompt.
|
||||
|
||||
To build Insight, first apply the gdb patch to the Insight
|
||||
sources. This should apply cleanly. Then apply the Insight patch. The
|
||||
Insight patch add BDM support to the target dialog box. Insight is
|
||||
built the same way as GDB so the notes in the main README can be
|
||||
followed. Just apply two patches instead of the one.
|
||||
|
||||
You need to have a GDB init file which is loaded when you start
|
||||
Insight. This is the standard GDB script for booting your
|
||||
processor. It must contain a GDB command `setup-and-load'. The target
|
||||
dialog box should default to this, but more on the dialog box setup
|
||||
later. You can find an example for the Coldfire processor in :
|
||||
|
||||
gdbScripts/sfp.insight
|
||||
|
||||
The command `setup-and-load' command must configure enough of the
|
||||
processor so RAM is working and the code can be downloaded. You should
|
||||
also download the code using the load command and set the program
|
||||
counter.
|
||||
|
||||
I found on the Win9x that I could not get Insight to automatically
|
||||
load a command file. On Unix having a file called `.gdbinit' in the
|
||||
directory you start GDB works. The documentation for GDB states a file
|
||||
`gdb.ini' should work on Windows. It did not seem to work for me so I
|
||||
specified the command file to load on the command line. I suppose this
|
||||
can be hidden in a Windows shortcut. The command on Win9x is :
|
||||
|
||||
/insight-5.0-m68-bdm-elf/bin/m68k-bdm-elf --command=sfp.insight sfp.elf
|
||||
|
||||
The Target Selection dialog box has two entries for BDM, BDM/Direct
|
||||
and BDM/TCP.
|
||||
|
||||
Using BDM/Direct.
|
||||
|
||||
This target is used when the pod is directly connected to the machine
|
||||
you are running Insight on. Enter into the Device field the BDM device
|
||||
your pod is connected to, eg. /dev/bdmcf0. The Port field is present,
|
||||
and I do not know how to remove it so just ignore it.
|
||||
|
||||
Using BDM/TCP.
|
||||
|
||||
This target is used when the pod is remote from the computer running
|
||||
Insight. Entry into the Hostname the remote machine's name or IP
|
||||
address. In the Port field enter the BDM device, eg. /dev/bdmcf0.
|
||||
|
||||
The remainder of the dialog box fields should be set in the following
|
||||
manner :
|
||||
|
||||
Set breakpoint at `main' : Do not care, your choice.
|
||||
Set breakpoint at `exit' : Do not care, your choice.
|
||||
Set breakpoint at [ ] : Do not care, your choice.
|
||||
Display Download Dialog : Off, not checked.
|
||||
|
||||
More Options :
|
||||
Attach to Target : On, checked.
|
||||
Download Program : Off, not checked.
|
||||
Run Program : Off, not checked.
|
||||
Continue from Last Stop : Off, not checked. Not sure what this
|
||||
one is.
|
||||
Command to issue after attaching : setup-and-load
|
||||
|
||||
Please send me feed back on using Insight as I have no real data of
|
||||
how well it is being used.
|
||||
896
m68k/aclocal.m4
vendored
Normal file
896
m68k/aclocal.m4
vendored
Normal file
@@ -0,0 +1,896 @@
|
||||
# generated automatically by aclocal 1.10 -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
||||
# 2005, 2006 Free Software Foundation, Inc.
|
||||
# This file 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.
|
||||
|
||||
m4_if(m4_PACKAGE_VERSION, [2.61],,
|
||||
[m4_fatal([this file was generated for autoconf 2.61.
|
||||
You have another version of autoconf. If you want to use that,
|
||||
you should regenerate the build system entirely.], [63])])
|
||||
|
||||
# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# AM_AUTOMAKE_VERSION(VERSION)
|
||||
# ----------------------------
|
||||
# Automake X.Y traces this macro to ensure aclocal.m4 has been
|
||||
# generated from the m4 files accompanying Automake X.Y.
|
||||
# (This private macro should not be called outside this file.)
|
||||
AC_DEFUN([AM_AUTOMAKE_VERSION],
|
||||
[am__api_version='1.10'
|
||||
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
|
||||
dnl require some minimum version. Point them to the right macro.
|
||||
m4_if([$1], [1.10], [],
|
||||
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
|
||||
])
|
||||
|
||||
# _AM_AUTOCONF_VERSION(VERSION)
|
||||
# -----------------------------
|
||||
# aclocal traces this macro to find the Autoconf version.
|
||||
# This is a private macro too. Using m4_define simplifies
|
||||
# the logic in aclocal, which can simply ignore this definition.
|
||||
m4_define([_AM_AUTOCONF_VERSION], [])
|
||||
|
||||
# AM_SET_CURRENT_AUTOMAKE_VERSION
|
||||
# -------------------------------
|
||||
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
|
||||
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
|
||||
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
|
||||
[AM_AUTOMAKE_VERSION([1.10])dnl
|
||||
_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
|
||||
|
||||
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
|
||||
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
|
||||
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
|
||||
#
|
||||
# Of course, Automake must honor this variable whenever it calls a
|
||||
# tool from the auxiliary directory. The problem is that $srcdir (and
|
||||
# therefore $ac_aux_dir as well) can be either absolute or relative,
|
||||
# depending on how configure is run. This is pretty annoying, since
|
||||
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
|
||||
# source directory, any form will work fine, but in subdirectories a
|
||||
# relative path needs to be adjusted first.
|
||||
#
|
||||
# $ac_aux_dir/missing
|
||||
# fails when called from a subdirectory if $ac_aux_dir is relative
|
||||
# $top_srcdir/$ac_aux_dir/missing
|
||||
# fails if $ac_aux_dir is absolute,
|
||||
# fails when called from a subdirectory in a VPATH build with
|
||||
# a relative $ac_aux_dir
|
||||
#
|
||||
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
|
||||
# are both prefixed by $srcdir. In an in-source build this is usually
|
||||
# harmless because $srcdir is `.', but things will broke when you
|
||||
# start a VPATH build or use an absolute $srcdir.
|
||||
#
|
||||
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
|
||||
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
|
||||
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
|
||||
# and then we would define $MISSING as
|
||||
# MISSING="\${SHELL} $am_aux_dir/missing"
|
||||
# This will work as long as MISSING is not called from configure, because
|
||||
# unfortunately $(top_srcdir) has no meaning in configure.
|
||||
# However there are other variables, like CC, which are often used in
|
||||
# configure, and could therefore not use this "fixed" $ac_aux_dir.
|
||||
#
|
||||
# Another solution, used here, is to always expand $ac_aux_dir to an
|
||||
# absolute PATH. The drawback is that using absolute paths prevent a
|
||||
# configured tree to be moved without reconfiguration.
|
||||
|
||||
AC_DEFUN([AM_AUX_DIR_EXPAND],
|
||||
[dnl Rely on autoconf to set up CDPATH properly.
|
||||
AC_PREREQ([2.50])dnl
|
||||
# expand $ac_aux_dir to an absolute path
|
||||
am_aux_dir=`cd $ac_aux_dir && pwd`
|
||||
])
|
||||
|
||||
# AM_CONDITIONAL -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# serial 8
|
||||
|
||||
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
|
||||
# -------------------------------------
|
||||
# Define a conditional.
|
||||
AC_DEFUN([AM_CONDITIONAL],
|
||||
[AC_PREREQ(2.52)dnl
|
||||
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
|
||||
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
|
||||
AC_SUBST([$1_TRUE])dnl
|
||||
AC_SUBST([$1_FALSE])dnl
|
||||
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
|
||||
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
|
||||
if $2; then
|
||||
$1_TRUE=
|
||||
$1_FALSE='#'
|
||||
else
|
||||
$1_TRUE='#'
|
||||
$1_FALSE=
|
||||
fi
|
||||
AC_CONFIG_COMMANDS_PRE(
|
||||
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
|
||||
AC_MSG_ERROR([[conditional "$1" was never defined.
|
||||
Usually this means the macro was only invoked conditionally.]])
|
||||
fi])])
|
||||
|
||||
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# serial 9
|
||||
|
||||
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
|
||||
# written in clear, in which case automake, when reading aclocal.m4,
|
||||
# will think it sees a *use*, and therefore will trigger all it's
|
||||
# C support machinery. Also note that it means that autoscan, seeing
|
||||
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
|
||||
|
||||
|
||||
# _AM_DEPENDENCIES(NAME)
|
||||
# ----------------------
|
||||
# See how the compiler implements dependency checking.
|
||||
# NAME is "CC", "CXX", "GCJ", or "OBJC".
|
||||
# We try a few techniques and use that to set a single cache variable.
|
||||
#
|
||||
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
|
||||
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
|
||||
# dependency, and given that the user is not expected to run this macro,
|
||||
# just rely on AC_PROG_CC.
|
||||
AC_DEFUN([_AM_DEPENDENCIES],
|
||||
[AC_REQUIRE([AM_SET_DEPDIR])dnl
|
||||
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
|
||||
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
|
||||
AC_REQUIRE([AM_DEP_TRACK])dnl
|
||||
|
||||
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
|
||||
[$1], CXX, [depcc="$CXX" am_compiler_list=],
|
||||
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
|
||||
[$1], UPC, [depcc="$UPC" am_compiler_list=],
|
||||
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
|
||||
[depcc="$$1" am_compiler_list=])
|
||||
|
||||
AC_CACHE_CHECK([dependency style of $depcc],
|
||||
[am_cv_$1_dependencies_compiler_type],
|
||||
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
|
||||
# We make a subdir and do the tests there. Otherwise we can end up
|
||||
# making bogus files that we don't know about and never remove. For
|
||||
# instance it was reported that on HP-UX the gcc test will end up
|
||||
# making a dummy file named `D' -- because `-MD' means `put the output
|
||||
# in D'.
|
||||
mkdir conftest.dir
|
||||
# Copy depcomp to subdir because otherwise we won't find it if we're
|
||||
# using a relative directory.
|
||||
cp "$am_depcomp" conftest.dir
|
||||
cd conftest.dir
|
||||
# We will build objects and dependencies in a subdirectory because
|
||||
# it helps to detect inapplicable dependency modes. For instance
|
||||
# both Tru64's cc and ICC support -MD to output dependencies as a
|
||||
# side effect of compilation, but ICC will put the dependencies in
|
||||
# the current directory while Tru64 will put them in the object
|
||||
# directory.
|
||||
mkdir sub
|
||||
|
||||
am_cv_$1_dependencies_compiler_type=none
|
||||
if test "$am_compiler_list" = ""; then
|
||||
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
|
||||
fi
|
||||
for depmode in $am_compiler_list; do
|
||||
# Setup a source with many dependencies, because some compilers
|
||||
# like to wrap large dependency lists on column 80 (with \), and
|
||||
# we should not choose a depcomp mode which is confused by this.
|
||||
#
|
||||
# We need to recreate these files for each test, as the compiler may
|
||||
# overwrite some of them when testing with obscure command lines.
|
||||
# This happens at least with the AIX C compiler.
|
||||
: > sub/conftest.c
|
||||
for i in 1 2 3 4 5 6; do
|
||||
echo '#include "conftst'$i'.h"' >> sub/conftest.c
|
||||
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
|
||||
# Solaris 8's {/usr,}/bin/sh.
|
||||
touch sub/conftst$i.h
|
||||
done
|
||||
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
|
||||
|
||||
case $depmode in
|
||||
nosideeffect)
|
||||
# after this tag, mechanisms are not by side-effect, so they'll
|
||||
# only be used when explicitly requested
|
||||
if test "x$enable_dependency_tracking" = xyes; then
|
||||
continue
|
||||
else
|
||||
break
|
||||
fi
|
||||
;;
|
||||
none) break ;;
|
||||
esac
|
||||
# We check with `-c' and `-o' for the sake of the "dashmstdout"
|
||||
# mode. It turns out that the SunPro C++ compiler does not properly
|
||||
# handle `-M -o', and we need to detect this.
|
||||
if depmode=$depmode \
|
||||
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
|
||||
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
|
||||
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
|
||||
>/dev/null 2>conftest.err &&
|
||||
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
|
||||
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
|
||||
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
|
||||
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
|
||||
# icc doesn't choke on unknown options, it will just issue warnings
|
||||
# or remarks (even with -Werror). So we grep stderr for any message
|
||||
# that says an option was ignored or not supported.
|
||||
# When given -MP, icc 7.0 and 7.1 complain thusly:
|
||||
# icc: Command line warning: ignoring option '-M'; no argument required
|
||||
# The diagnosis changed in icc 8.0:
|
||||
# icc: Command line remark: option '-MP' not supported
|
||||
if (grep 'ignoring option' conftest.err ||
|
||||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
|
||||
am_cv_$1_dependencies_compiler_type=$depmode
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
cd ..
|
||||
rm -rf conftest.dir
|
||||
else
|
||||
am_cv_$1_dependencies_compiler_type=none
|
||||
fi
|
||||
])
|
||||
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
|
||||
AM_CONDITIONAL([am__fastdep$1], [
|
||||
test "x$enable_dependency_tracking" != xno \
|
||||
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
|
||||
])
|
||||
|
||||
|
||||
# AM_SET_DEPDIR
|
||||
# -------------
|
||||
# Choose a directory name for dependency files.
|
||||
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
|
||||
AC_DEFUN([AM_SET_DEPDIR],
|
||||
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
||||
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
|
||||
])
|
||||
|
||||
|
||||
# AM_DEP_TRACK
|
||||
# ------------
|
||||
AC_DEFUN([AM_DEP_TRACK],
|
||||
[AC_ARG_ENABLE(dependency-tracking,
|
||||
[ --disable-dependency-tracking speeds up one-time build
|
||||
--enable-dependency-tracking do not reject slow dependency extractors])
|
||||
if test "x$enable_dependency_tracking" != xno; then
|
||||
am_depcomp="$ac_aux_dir/depcomp"
|
||||
AMDEPBACKSLASH='\'
|
||||
fi
|
||||
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
|
||||
AC_SUBST([AMDEPBACKSLASH])dnl
|
||||
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
|
||||
])
|
||||
|
||||
# Generate code to set up dependency tracking. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
#serial 3
|
||||
|
||||
# _AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
# ------------------------------
|
||||
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[for mf in $CONFIG_FILES; do
|
||||
# Strip MF so we end up with the name of the file.
|
||||
mf=`echo "$mf" | sed -e 's/:.*$//'`
|
||||
# Check whether this is an Automake generated Makefile or not.
|
||||
# We used to match only the files named `Makefile.in', but
|
||||
# some people rename them; so instead we look at the file content.
|
||||
# Grep'ing the first line is not enough: some people post-process
|
||||
# each Makefile.in and add a new line on top of each file to say so.
|
||||
# Grep'ing the whole file is not good either: AIX grep has a line
|
||||
# limit of 2048, but all sed's we know have understand at least 4000.
|
||||
if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
|
||||
dirpart=`AS_DIRNAME("$mf")`
|
||||
else
|
||||
continue
|
||||
fi
|
||||
# Extract the definition of DEPDIR, am__include, and am__quote
|
||||
# from the Makefile without running `make'.
|
||||
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
|
||||
test -z "$DEPDIR" && continue
|
||||
am__include=`sed -n 's/^am__include = //p' < "$mf"`
|
||||
test -z "am__include" && continue
|
||||
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
|
||||
# When using ansi2knr, U may be empty or an underscore; expand it
|
||||
U=`sed -n 's/^U = //p' < "$mf"`
|
||||
# Find all dependency output files, they are included files with
|
||||
# $(DEPDIR) in their names. We invoke sed twice because it is the
|
||||
# simplest approach to changing $(DEPDIR) to its actual value in the
|
||||
# expansion.
|
||||
for file in `sed -n "
|
||||
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
|
||||
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
|
||||
# Make sure the directory exists.
|
||||
test -f "$dirpart/$file" && continue
|
||||
fdir=`AS_DIRNAME(["$file"])`
|
||||
AS_MKDIR_P([$dirpart/$fdir])
|
||||
# echo "creating $dirpart/$file"
|
||||
echo '# dummy' > "$dirpart/$file"
|
||||
done
|
||||
done
|
||||
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
|
||||
|
||||
# AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
# -----------------------------
|
||||
# This macro should only be invoked once -- use via AC_REQUIRE.
|
||||
#
|
||||
# This code is only required when automatic dependency tracking
|
||||
# is enabled. FIXME. This creates each `.P' file that we will
|
||||
# need in order to bootstrap the dependency handling code.
|
||||
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[AC_CONFIG_COMMANDS([depfiles],
|
||||
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
|
||||
])
|
||||
|
||||
# Do all the work for Automake. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
||||
# 2005, 2006 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# serial 12
|
||||
|
||||
# This macro actually does too much. Some checks are only needed if
|
||||
# your package does certain things. But this isn't really a big deal.
|
||||
|
||||
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
|
||||
# AM_INIT_AUTOMAKE([OPTIONS])
|
||||
# -----------------------------------------------
|
||||
# The call with PACKAGE and VERSION arguments is the old style
|
||||
# call (pre autoconf-2.50), which is being phased out. PACKAGE
|
||||
# and VERSION should now be passed to AC_INIT and removed from
|
||||
# the call to AM_INIT_AUTOMAKE.
|
||||
# We support both call styles for the transition. After
|
||||
# the next Automake release, Autoconf can make the AC_INIT
|
||||
# arguments mandatory, and then we can depend on a new Autoconf
|
||||
# release and drop the old call support.
|
||||
AC_DEFUN([AM_INIT_AUTOMAKE],
|
||||
[AC_PREREQ([2.60])dnl
|
||||
dnl Autoconf wants to disallow AM_ names. We explicitly allow
|
||||
dnl the ones we care about.
|
||||
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
|
||||
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
|
||||
AC_REQUIRE([AC_PROG_INSTALL])dnl
|
||||
if test "`cd $srcdir && pwd`" != "`pwd`"; then
|
||||
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
|
||||
# is not polluted with repeated "-I."
|
||||
AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
|
||||
# test to see if srcdir already configured
|
||||
if test -f $srcdir/config.status; then
|
||||
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
|
||||
fi
|
||||
fi
|
||||
|
||||
# test whether we have cygpath
|
||||
if test -z "$CYGPATH_W"; then
|
||||
if (cygpath --version) >/dev/null 2>/dev/null; then
|
||||
CYGPATH_W='cygpath -w'
|
||||
else
|
||||
CYGPATH_W=echo
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([CYGPATH_W])
|
||||
|
||||
# Define the identity of the package.
|
||||
dnl Distinguish between old-style and new-style calls.
|
||||
m4_ifval([$2],
|
||||
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
|
||||
AC_SUBST([PACKAGE], [$1])dnl
|
||||
AC_SUBST([VERSION], [$2])],
|
||||
[_AM_SET_OPTIONS([$1])dnl
|
||||
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
|
||||
m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
|
||||
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
|
||||
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
|
||||
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
|
||||
|
||||
_AM_IF_OPTION([no-define],,
|
||||
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
|
||||
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
|
||||
|
||||
# Some tools Automake needs.
|
||||
AC_REQUIRE([AM_SANITY_CHECK])dnl
|
||||
AC_REQUIRE([AC_ARG_PROGRAM])dnl
|
||||
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
|
||||
AM_MISSING_PROG(AUTOCONF, autoconf)
|
||||
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
|
||||
AM_MISSING_PROG(AUTOHEADER, autoheader)
|
||||
AM_MISSING_PROG(MAKEINFO, makeinfo)
|
||||
AM_PROG_INSTALL_SH
|
||||
AM_PROG_INSTALL_STRIP
|
||||
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
|
||||
# We need awk for the "check" target. The system "awk" is bad on
|
||||
# some platforms.
|
||||
AC_REQUIRE([AC_PROG_AWK])dnl
|
||||
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
|
||||
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
||||
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
|
||||
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
|
||||
[_AM_PROG_TAR([v7])])])
|
||||
_AM_IF_OPTION([no-dependencies],,
|
||||
[AC_PROVIDE_IFELSE([AC_PROG_CC],
|
||||
[_AM_DEPENDENCIES(CC)],
|
||||
[define([AC_PROG_CC],
|
||||
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
|
||||
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
||||
[_AM_DEPENDENCIES(CXX)],
|
||||
[define([AC_PROG_CXX],
|
||||
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
|
||||
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
|
||||
[_AM_DEPENDENCIES(OBJC)],
|
||||
[define([AC_PROG_OBJC],
|
||||
defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
# When config.status generates a header, we must update the stamp-h file.
|
||||
# This file resides in the same directory as the config header
|
||||
# that is generated. The stamp files are numbered to have different names.
|
||||
|
||||
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
|
||||
# loop where config.status creates the headers, so we can generate
|
||||
# our stamp files there.
|
||||
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
|
||||
[# Compute $1's index in $config_headers.
|
||||
_am_stamp_count=1
|
||||
for _am_header in $config_headers :; do
|
||||
case $_am_header in
|
||||
$1 | $1:* )
|
||||
break ;;
|
||||
* )
|
||||
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
|
||||
esac
|
||||
done
|
||||
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# AM_PROG_INSTALL_SH
|
||||
# ------------------
|
||||
# Define $install_sh.
|
||||
AC_DEFUN([AM_PROG_INSTALL_SH],
|
||||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
|
||||
AC_SUBST(install_sh)])
|
||||
|
||||
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# serial 2
|
||||
|
||||
# Check whether the underlying file-system supports filenames
|
||||
# with a leading dot. For instance MS-DOS doesn't.
|
||||
AC_DEFUN([AM_SET_LEADING_DOT],
|
||||
[rm -rf .tst 2>/dev/null
|
||||
mkdir .tst 2>/dev/null
|
||||
if test -d .tst; then
|
||||
am__leading_dot=.
|
||||
else
|
||||
am__leading_dot=_
|
||||
fi
|
||||
rmdir .tst 2>/dev/null
|
||||
AC_SUBST([am__leading_dot])])
|
||||
|
||||
# Check to see how 'make' treats includes. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# serial 3
|
||||
|
||||
# AM_MAKE_INCLUDE()
|
||||
# -----------------
|
||||
# Check to see how make treats includes.
|
||||
AC_DEFUN([AM_MAKE_INCLUDE],
|
||||
[am_make=${MAKE-make}
|
||||
cat > confinc << 'END'
|
||||
am__doit:
|
||||
@echo done
|
||||
.PHONY: am__doit
|
||||
END
|
||||
# If we don't find an include directive, just comment out the code.
|
||||
AC_MSG_CHECKING([for style of include used by $am_make])
|
||||
am__include="#"
|
||||
am__quote=
|
||||
_am_result=none
|
||||
# First try GNU make style include.
|
||||
echo "include confinc" > confmf
|
||||
# We grep out `Entering directory' and `Leaving directory'
|
||||
# messages which can occur if `w' ends up in MAKEFLAGS.
|
||||
# In particular we don't look at `^make:' because GNU make might
|
||||
# be invoked under some other name (usually "gmake"), in which
|
||||
# case it prints its new name instead of `make'.
|
||||
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
|
||||
am__include=include
|
||||
am__quote=
|
||||
_am_result=GNU
|
||||
fi
|
||||
# Now try BSD make style include.
|
||||
if test "$am__include" = "#"; then
|
||||
echo '.include "confinc"' > confmf
|
||||
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
|
||||
am__include=.include
|
||||
am__quote="\""
|
||||
_am_result=BSD
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([am__include])
|
||||
AC_SUBST([am__quote])
|
||||
AC_MSG_RESULT([$_am_result])
|
||||
rm -f confinc confmf
|
||||
])
|
||||
|
||||
# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# serial 5
|
||||
|
||||
# AM_PROG_CC_C_O
|
||||
# --------------
|
||||
# Like AC_PROG_CC_C_O, but changed for automake.
|
||||
AC_DEFUN([AM_PROG_CC_C_O],
|
||||
[AC_REQUIRE([AC_PROG_CC_C_O])dnl
|
||||
AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
AC_REQUIRE_AUX_FILE([compile])dnl
|
||||
# FIXME: we rely on the cache variable name because
|
||||
# there is no other way.
|
||||
set dummy $CC
|
||||
ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
|
||||
if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
|
||||
# Losing compiler, so override with the script.
|
||||
# FIXME: It is wrong to rewrite CC.
|
||||
# But if we don't then we get into trouble of one sort or another.
|
||||
# A longer-term fix would be to have automake use am__CC in this case,
|
||||
# and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
|
||||
CC="$am_aux_dir/compile $CC"
|
||||
fi
|
||||
dnl Make sure AC_PROG_CC is never called again, or it will override our
|
||||
dnl setting of CC.
|
||||
m4_define([AC_PROG_CC],
|
||||
[m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
|
||||
])
|
||||
|
||||
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# serial 5
|
||||
|
||||
# AM_MISSING_PROG(NAME, PROGRAM)
|
||||
# ------------------------------
|
||||
AC_DEFUN([AM_MISSING_PROG],
|
||||
[AC_REQUIRE([AM_MISSING_HAS_RUN])
|
||||
$1=${$1-"${am_missing_run}$2"}
|
||||
AC_SUBST($1)])
|
||||
|
||||
|
||||
# AM_MISSING_HAS_RUN
|
||||
# ------------------
|
||||
# Define MISSING if not defined so far and test if it supports --run.
|
||||
# If it does, set am_missing_run to use it, otherwise, to nothing.
|
||||
AC_DEFUN([AM_MISSING_HAS_RUN],
|
||||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
AC_REQUIRE_AUX_FILE([missing])dnl
|
||||
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
|
||||
# Use eval to expand $SHELL
|
||||
if eval "$MISSING --run true"; then
|
||||
am_missing_run="$MISSING --run "
|
||||
else
|
||||
am_missing_run=
|
||||
AC_MSG_WARN([`missing' script is too old or missing])
|
||||
fi
|
||||
])
|
||||
|
||||
# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# AM_PROG_MKDIR_P
|
||||
# ---------------
|
||||
# Check for `mkdir -p'.
|
||||
AC_DEFUN([AM_PROG_MKDIR_P],
|
||||
[AC_PREREQ([2.60])dnl
|
||||
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
|
||||
dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
|
||||
dnl while keeping a definition of mkdir_p for backward compatibility.
|
||||
dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
|
||||
dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
|
||||
dnl Makefile.ins that do not define MKDIR_P, so we do our own
|
||||
dnl adjustment using top_builddir (which is defined more often than
|
||||
dnl MKDIR_P).
|
||||
AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
|
||||
case $mkdir_p in
|
||||
[[\\/$]]* | ?:[[\\/]]*) ;;
|
||||
*/*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
|
||||
esac
|
||||
])
|
||||
|
||||
# Helper functions for option handling. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# serial 3
|
||||
|
||||
# _AM_MANGLE_OPTION(NAME)
|
||||
# -----------------------
|
||||
AC_DEFUN([_AM_MANGLE_OPTION],
|
||||
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
|
||||
|
||||
# _AM_SET_OPTION(NAME)
|
||||
# ------------------------------
|
||||
# Set option NAME. Presently that only means defining a flag for this option.
|
||||
AC_DEFUN([_AM_SET_OPTION],
|
||||
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
|
||||
|
||||
# _AM_SET_OPTIONS(OPTIONS)
|
||||
# ----------------------------------
|
||||
# OPTIONS is a space-separated list of Automake options.
|
||||
AC_DEFUN([_AM_SET_OPTIONS],
|
||||
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
|
||||
|
||||
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
|
||||
# -------------------------------------------
|
||||
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
|
||||
AC_DEFUN([_AM_IF_OPTION],
|
||||
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
|
||||
|
||||
# Check to make sure that the build environment is sane. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# serial 4
|
||||
|
||||
# AM_SANITY_CHECK
|
||||
# ---------------
|
||||
AC_DEFUN([AM_SANITY_CHECK],
|
||||
[AC_MSG_CHECKING([whether build environment is sane])
|
||||
# Just in case
|
||||
sleep 1
|
||||
echo timestamp > conftest.file
|
||||
# Do `set' in a subshell so we don't clobber the current shell's
|
||||
# arguments. Must try -L first in case configure is actually a
|
||||
# symlink; some systems play weird games with the mod time of symlinks
|
||||
# (eg FreeBSD returns the mod time of the symlink's containing
|
||||
# directory).
|
||||
if (
|
||||
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
|
||||
if test "$[*]" = "X"; then
|
||||
# -L didn't work.
|
||||
set X `ls -t $srcdir/configure conftest.file`
|
||||
fi
|
||||
rm -f conftest.file
|
||||
if test "$[*]" != "X $srcdir/configure conftest.file" \
|
||||
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
|
||||
|
||||
# If neither matched, then we have a broken ls. This can happen
|
||||
# if, for instance, CONFIG_SHELL is bash and it inherits a
|
||||
# broken ls alias from the environment. This has actually
|
||||
# happened. Such a system could not be considered "sane".
|
||||
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
||||
alias in your environment])
|
||||
fi
|
||||
|
||||
test "$[2]" = conftest.file
|
||||
)
|
||||
then
|
||||
# Ok.
|
||||
:
|
||||
else
|
||||
AC_MSG_ERROR([newly created file is older than distributed files!
|
||||
Check your system clock])
|
||||
fi
|
||||
AC_MSG_RESULT(yes)])
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# AM_PROG_INSTALL_STRIP
|
||||
# ---------------------
|
||||
# One issue with vendor `install' (even GNU) is that you can't
|
||||
# specify the program used to strip binaries. This is especially
|
||||
# annoying in cross-compiling environments, where the build's strip
|
||||
# is unlikely to handle the host's binaries.
|
||||
# Fortunately install-sh will honor a STRIPPROG variable, so we
|
||||
# always use install-sh in `make install-strip', and initialize
|
||||
# STRIPPROG with the value of the STRIP variable (set by the user).
|
||||
AC_DEFUN([AM_PROG_INSTALL_STRIP],
|
||||
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
|
||||
# Installed binaries are usually stripped using `strip' when the user
|
||||
# run `make install-strip'. However `strip' might not be the right
|
||||
# tool to use in cross-compilation environments, therefore Automake
|
||||
# will honor the `STRIP' environment variable to overrule this program.
|
||||
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
|
||||
if test "$cross_compiling" != no; then
|
||||
AC_CHECK_TOOL([STRIP], [strip], :)
|
||||
fi
|
||||
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
|
||||
AC_SUBST([INSTALL_STRIP_PROGRAM])])
|
||||
|
||||
# Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# _AM_SUBST_NOTMAKE(VARIABLE)
|
||||
# ---------------------------
|
||||
# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
|
||||
# This macro is traced by Automake.
|
||||
AC_DEFUN([_AM_SUBST_NOTMAKE])
|
||||
|
||||
# Check how to create a tarball. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# serial 2
|
||||
|
||||
# _AM_PROG_TAR(FORMAT)
|
||||
# --------------------
|
||||
# Check how to create a tarball in format FORMAT.
|
||||
# FORMAT should be one of `v7', `ustar', or `pax'.
|
||||
#
|
||||
# Substitute a variable $(am__tar) that is a command
|
||||
# writing to stdout a FORMAT-tarball containing the directory
|
||||
# $tardir.
|
||||
# tardir=directory && $(am__tar) > result.tar
|
||||
#
|
||||
# Substitute a variable $(am__untar) that extract such
|
||||
# a tarball read from stdin.
|
||||
# $(am__untar) < result.tar
|
||||
AC_DEFUN([_AM_PROG_TAR],
|
||||
[# Always define AMTAR for backward compatibility.
|
||||
AM_MISSING_PROG([AMTAR], [tar])
|
||||
m4_if([$1], [v7],
|
||||
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
|
||||
[m4_case([$1], [ustar],, [pax],,
|
||||
[m4_fatal([Unknown tar format])])
|
||||
AC_MSG_CHECKING([how to create a $1 tar archive])
|
||||
# Loop over all known methods to create a tar archive until one works.
|
||||
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
|
||||
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
|
||||
# Do not fold the above two line into one, because Tru64 sh and
|
||||
# Solaris sh will not grok spaces in the rhs of `-'.
|
||||
for _am_tool in $_am_tools
|
||||
do
|
||||
case $_am_tool in
|
||||
gnutar)
|
||||
for _am_tar in tar gnutar gtar;
|
||||
do
|
||||
AM_RUN_LOG([$_am_tar --version]) && break
|
||||
done
|
||||
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
|
||||
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
|
||||
am__untar="$_am_tar -xf -"
|
||||
;;
|
||||
plaintar)
|
||||
# Must skip GNU tar: if it does not support --format= it doesn't create
|
||||
# ustar tarball either.
|
||||
(tar --version) >/dev/null 2>&1 && continue
|
||||
am__tar='tar chf - "$$tardir"'
|
||||
am__tar_='tar chf - "$tardir"'
|
||||
am__untar='tar xf -'
|
||||
;;
|
||||
pax)
|
||||
am__tar='pax -L -x $1 -w "$$tardir"'
|
||||
am__tar_='pax -L -x $1 -w "$tardir"'
|
||||
am__untar='pax -r'
|
||||
;;
|
||||
cpio)
|
||||
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
|
||||
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
|
||||
am__untar='cpio -i -H $1 -d'
|
||||
;;
|
||||
none)
|
||||
am__tar=false
|
||||
am__tar_=false
|
||||
am__untar=false
|
||||
;;
|
||||
esac
|
||||
|
||||
# If the value was cached, stop now. We just wanted to have am__tar
|
||||
# and am__untar set.
|
||||
test -n "${am_cv_prog_tar_$1}" && break
|
||||
|
||||
# tar/untar a dummy directory, and stop if the command works
|
||||
rm -rf conftest.dir
|
||||
mkdir conftest.dir
|
||||
echo GrepMe > conftest.dir/file
|
||||
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
|
||||
rm -rf conftest.dir
|
||||
if test -s conftest.tar; then
|
||||
AM_RUN_LOG([$am__untar <conftest.tar])
|
||||
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
|
||||
fi
|
||||
done
|
||||
rm -rf conftest.dir
|
||||
|
||||
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
|
||||
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
|
||||
AC_SUBST([am__tar])
|
||||
AC_SUBST([am__untar])
|
||||
]) # _AM_PROG_TAR
|
||||
|
||||
9817
m68k/autom4te.cache/output.0
Normal file
9817
m68k/autom4te.cache/output.0
Normal file
File diff suppressed because it is too large
Load Diff
9817
m68k/autom4te.cache/output.1
Normal file
9817
m68k/autom4te.cache/output.1
Normal file
File diff suppressed because it is too large
Load Diff
131
m68k/autom4te.cache/requests
Normal file
131
m68k/autom4te.cache/requests
Normal file
@@ -0,0 +1,131 @@
|
||||
# This file was generated.
|
||||
# It contains the lists of macros which have been traced.
|
||||
# It can be safely removed.
|
||||
|
||||
@request = (
|
||||
bless( [
|
||||
'0',
|
||||
1,
|
||||
[
|
||||
'/usr/share/autoconf'
|
||||
],
|
||||
[
|
||||
'/usr/share/autoconf/autoconf/autoconf.m4f',
|
||||
'/usr/share/aclocal-1.10/amversion.m4',
|
||||
'/usr/share/aclocal-1.10/auxdir.m4',
|
||||
'/usr/share/aclocal-1.10/cond.m4',
|
||||
'/usr/share/aclocal-1.10/depend.m4',
|
||||
'/usr/share/aclocal-1.10/depout.m4',
|
||||
'/usr/share/aclocal-1.10/init.m4',
|
||||
'/usr/share/aclocal-1.10/install-sh.m4',
|
||||
'/usr/share/aclocal-1.10/lead-dot.m4',
|
||||
'/usr/share/aclocal-1.10/make.m4',
|
||||
'/usr/share/aclocal-1.10/minuso.m4',
|
||||
'/usr/share/aclocal-1.10/missing.m4',
|
||||
'/usr/share/aclocal-1.10/mkdirp.m4',
|
||||
'/usr/share/aclocal-1.10/options.m4',
|
||||
'/usr/share/aclocal-1.10/runlog.m4',
|
||||
'/usr/share/aclocal-1.10/sanity.m4',
|
||||
'/usr/share/aclocal-1.10/strip.m4',
|
||||
'/usr/share/aclocal-1.10/substnot.m4',
|
||||
'/usr/share/aclocal-1.10/tar.m4',
|
||||
'configure.ac'
|
||||
],
|
||||
{
|
||||
'm4_pattern_forbid' => 1,
|
||||
'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1,
|
||||
'_AM_SET_OPTION' => 1,
|
||||
'AC_DEFUN' => 1,
|
||||
'AM_PROG_MKDIR_P' => 1,
|
||||
'AM_INIT_AUTOMAKE' => 1,
|
||||
'AM_AUTOMAKE_VERSION' => 1,
|
||||
'AM_MISSING_HAS_RUN' => 1,
|
||||
'AM_MISSING_PROG' => 1,
|
||||
'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
|
||||
'AC_DEFUN_ONCE' => 1,
|
||||
'AM_PROG_INSTALL_STRIP' => 1,
|
||||
'_m4_warn' => 1,
|
||||
'AM_SANITY_CHECK' => 1,
|
||||
'include' => 1,
|
||||
'_AM_PROG_TAR' => 1,
|
||||
'AM_AUX_DIR_EXPAND' => 1,
|
||||
'AM_DEP_TRACK' => 1,
|
||||
'_AM_SET_OPTIONS' => 1,
|
||||
'AM_RUN_LOG' => 1,
|
||||
'_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
|
||||
'_AM_IF_OPTION' => 1,
|
||||
'_AM_SUBST_NOTMAKE' => 1,
|
||||
'_AM_AUTOCONF_VERSION' => 1,
|
||||
'AM_PROG_CC_C_O' => 1,
|
||||
'm4_pattern_allow' => 1,
|
||||
'_AM_MANGLE_OPTION' => 1,
|
||||
'AM_SET_LEADING_DOT' => 1,
|
||||
'AM_CONDITIONAL' => 1,
|
||||
'AM_SET_DEPDIR' => 1,
|
||||
'_AM_DEPENDENCIES' => 1,
|
||||
'm4_include' => 1,
|
||||
'AM_PROG_INSTALL_SH' => 1,
|
||||
'_AC_AM_CONFIG_HEADER_HOOK' => 1,
|
||||
'AU_DEFUN' => 1,
|
||||
'AM_MAKE_INCLUDE' => 1
|
||||
}
|
||||
], 'Autom4te::Request' ),
|
||||
bless( [
|
||||
'1',
|
||||
1,
|
||||
[
|
||||
'/usr/share/autoconf'
|
||||
],
|
||||
[
|
||||
'/usr/share/autoconf/autoconf/autoconf.m4f',
|
||||
'aclocal.m4',
|
||||
'configure.ac'
|
||||
],
|
||||
{
|
||||
'AM_PROG_F77_C_O' => 1,
|
||||
'_LT_AC_TAGCONFIG' => 1,
|
||||
'm4_pattern_forbid' => 1,
|
||||
'AC_INIT' => 1,
|
||||
'AC_CANONICAL_TARGET' => 1,
|
||||
'AC_CONFIG_LIBOBJ_DIR' => 1,
|
||||
'AC_SUBST' => 1,
|
||||
'AC_CANONICAL_HOST' => 1,
|
||||
'AC_FC_SRCEXT' => 1,
|
||||
'AC_PROG_LIBTOOL' => 1,
|
||||
'AM_INIT_AUTOMAKE' => 1,
|
||||
'AC_CONFIG_SUBDIRS' => 1,
|
||||
'AM_AUTOMAKE_VERSION' => 1,
|
||||
'LT_CONFIG_LTDL_DIR' => 1,
|
||||
'AC_REQUIRE_AUX_FILE' => 1,
|
||||
'AC_CONFIG_LINKS' => 1,
|
||||
'LT_SUPPORTED_TAG' => 1,
|
||||
'm4_sinclude' => 1,
|
||||
'AM_MAINTAINER_MODE' => 1,
|
||||
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
|
||||
'_m4_warn' => 1,
|
||||
'AM_PROG_CXX_C_O' => 1,
|
||||
'AM_ENABLE_MULTILIB' => 1,
|
||||
'AC_CONFIG_FILES' => 1,
|
||||
'include' => 1,
|
||||
'LT_INIT' => 1,
|
||||
'AM_GNU_GETTEXT' => 1,
|
||||
'AC_LIBSOURCE' => 1,
|
||||
'AM_PROG_FC_C_O' => 1,
|
||||
'AC_CANONICAL_BUILD' => 1,
|
||||
'AC_FC_FREEFORM' => 1,
|
||||
'AH_OUTPUT' => 1,
|
||||
'_AM_SUBST_NOTMAKE' => 1,
|
||||
'AC_CONFIG_AUX_DIR' => 1,
|
||||
'm4_pattern_allow' => 1,
|
||||
'AM_PROG_CC_C_O' => 1,
|
||||
'sinclude' => 1,
|
||||
'AM_CONDITIONAL' => 1,
|
||||
'AC_CANONICAL_SYSTEM' => 1,
|
||||
'AC_CONFIG_HEADERS' => 1,
|
||||
'AC_DEFINE_TRACE_LITERAL' => 1,
|
||||
'm4_include' => 1,
|
||||
'AC_SUBST_TRACE' => 1
|
||||
}
|
||||
], 'Autom4te::Request' )
|
||||
);
|
||||
|
||||
792
m68k/autom4te.cache/traces.0
Normal file
792
m68k/autom4te.cache/traces.0
Normal file
@@ -0,0 +1,792 @@
|
||||
m4trace:/usr/share/aclocal-1.10/amversion.m4:14: -1- AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10'
|
||||
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
|
||||
dnl require some minimum version. Point them to the right macro.
|
||||
m4_if([$1], [1.10], [],
|
||||
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
|
||||
])
|
||||
m4trace:/usr/share/aclocal-1.10/amversion.m4:33: -1- AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.10])dnl
|
||||
_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
|
||||
m4trace:/usr/share/aclocal-1.10/auxdir.m4:47: -1- AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly.
|
||||
AC_PREREQ([2.50])dnl
|
||||
# expand $ac_aux_dir to an absolute path
|
||||
am_aux_dir=`cd $ac_aux_dir && pwd`
|
||||
])
|
||||
m4trace:/usr/share/aclocal-1.10/cond.m4:15: -1- AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl
|
||||
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
|
||||
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
|
||||
AC_SUBST([$1_TRUE])dnl
|
||||
AC_SUBST([$1_FALSE])dnl
|
||||
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
|
||||
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
|
||||
if $2; then
|
||||
$1_TRUE=
|
||||
$1_FALSE='#'
|
||||
else
|
||||
$1_TRUE='#'
|
||||
$1_FALSE=
|
||||
fi
|
||||
AC_CONFIG_COMMANDS_PRE(
|
||||
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
|
||||
AC_MSG_ERROR([[conditional "$1" was never defined.
|
||||
Usually this means the macro was only invoked conditionally.]])
|
||||
fi])])
|
||||
m4trace:/usr/share/aclocal-1.10/depend.m4:28: -1- AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl
|
||||
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
|
||||
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
|
||||
AC_REQUIRE([AM_DEP_TRACK])dnl
|
||||
|
||||
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
|
||||
[$1], CXX, [depcc="$CXX" am_compiler_list=],
|
||||
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
|
||||
[$1], UPC, [depcc="$UPC" am_compiler_list=],
|
||||
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
|
||||
[depcc="$$1" am_compiler_list=])
|
||||
|
||||
AC_CACHE_CHECK([dependency style of $depcc],
|
||||
[am_cv_$1_dependencies_compiler_type],
|
||||
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
|
||||
# We make a subdir and do the tests there. Otherwise we can end up
|
||||
# making bogus files that we don't know about and never remove. For
|
||||
# instance it was reported that on HP-UX the gcc test will end up
|
||||
# making a dummy file named `D' -- because `-MD' means `put the output
|
||||
# in D'.
|
||||
mkdir conftest.dir
|
||||
# Copy depcomp to subdir because otherwise we won't find it if we're
|
||||
# using a relative directory.
|
||||
cp "$am_depcomp" conftest.dir
|
||||
cd conftest.dir
|
||||
# We will build objects and dependencies in a subdirectory because
|
||||
# it helps to detect inapplicable dependency modes. For instance
|
||||
# both Tru64's cc and ICC support -MD to output dependencies as a
|
||||
# side effect of compilation, but ICC will put the dependencies in
|
||||
# the current directory while Tru64 will put them in the object
|
||||
# directory.
|
||||
mkdir sub
|
||||
|
||||
am_cv_$1_dependencies_compiler_type=none
|
||||
if test "$am_compiler_list" = ""; then
|
||||
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
|
||||
fi
|
||||
for depmode in $am_compiler_list; do
|
||||
# Setup a source with many dependencies, because some compilers
|
||||
# like to wrap large dependency lists on column 80 (with \), and
|
||||
# we should not choose a depcomp mode which is confused by this.
|
||||
#
|
||||
# We need to recreate these files for each test, as the compiler may
|
||||
# overwrite some of them when testing with obscure command lines.
|
||||
# This happens at least with the AIX C compiler.
|
||||
: > sub/conftest.c
|
||||
for i in 1 2 3 4 5 6; do
|
||||
echo '#include "conftst'$i'.h"' >> sub/conftest.c
|
||||
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
|
||||
# Solaris 8's {/usr,}/bin/sh.
|
||||
touch sub/conftst$i.h
|
||||
done
|
||||
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
|
||||
|
||||
case $depmode in
|
||||
nosideeffect)
|
||||
# after this tag, mechanisms are not by side-effect, so they'll
|
||||
# only be used when explicitly requested
|
||||
if test "x$enable_dependency_tracking" = xyes; then
|
||||
continue
|
||||
else
|
||||
break
|
||||
fi
|
||||
;;
|
||||
none) break ;;
|
||||
esac
|
||||
# We check with `-c' and `-o' for the sake of the "dashmstdout"
|
||||
# mode. It turns out that the SunPro C++ compiler does not properly
|
||||
# handle `-M -o', and we need to detect this.
|
||||
if depmode=$depmode \
|
||||
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
|
||||
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
|
||||
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
|
||||
>/dev/null 2>conftest.err &&
|
||||
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
|
||||
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
|
||||
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
|
||||
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
|
||||
# icc doesn't choke on unknown options, it will just issue warnings
|
||||
# or remarks (even with -Werror). So we grep stderr for any message
|
||||
# that says an option was ignored or not supported.
|
||||
# When given -MP, icc 7.0 and 7.1 complain thusly:
|
||||
# icc: Command line warning: ignoring option '-M'; no argument required
|
||||
# The diagnosis changed in icc 8.0:
|
||||
# icc: Command line remark: option '-MP' not supported
|
||||
if (grep 'ignoring option' conftest.err ||
|
||||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
|
||||
am_cv_$1_dependencies_compiler_type=$depmode
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
cd ..
|
||||
rm -rf conftest.dir
|
||||
else
|
||||
am_cv_$1_dependencies_compiler_type=none
|
||||
fi
|
||||
])
|
||||
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
|
||||
AM_CONDITIONAL([am__fastdep$1], [
|
||||
test "x$enable_dependency_tracking" != xno \
|
||||
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
|
||||
])
|
||||
m4trace:/usr/share/aclocal-1.10/depend.m4:139: -1- AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
||||
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
|
||||
])
|
||||
m4trace:/usr/share/aclocal-1.10/depend.m4:147: -1- AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking,
|
||||
[ --disable-dependency-tracking speeds up one-time build
|
||||
--enable-dependency-tracking do not reject slow dependency extractors])
|
||||
if test "x$enable_dependency_tracking" != xno; then
|
||||
am_depcomp="$ac_aux_dir/depcomp"
|
||||
AMDEPBACKSLASH='\'
|
||||
fi
|
||||
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
|
||||
AC_SUBST([AMDEPBACKSLASH])dnl
|
||||
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
|
||||
])
|
||||
m4trace:/usr/share/aclocal-1.10/depout.m4:14: -1- AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do
|
||||
# Strip MF so we end up with the name of the file.
|
||||
mf=`echo "$mf" | sed -e 's/:.*$//'`
|
||||
# Check whether this is an Automake generated Makefile or not.
|
||||
# We used to match only the files named `Makefile.in', but
|
||||
# some people rename them; so instead we look at the file content.
|
||||
# Grep'ing the first line is not enough: some people post-process
|
||||
# each Makefile.in and add a new line on top of each file to say so.
|
||||
# Grep'ing the whole file is not good either: AIX grep has a line
|
||||
# limit of 2048, but all sed's we know have understand at least 4000.
|
||||
if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
|
||||
dirpart=`AS_DIRNAME("$mf")`
|
||||
else
|
||||
continue
|
||||
fi
|
||||
# Extract the definition of DEPDIR, am__include, and am__quote
|
||||
# from the Makefile without running `make'.
|
||||
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
|
||||
test -z "$DEPDIR" && continue
|
||||
am__include=`sed -n 's/^am__include = //p' < "$mf"`
|
||||
test -z "am__include" && continue
|
||||
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
|
||||
# When using ansi2knr, U may be empty or an underscore; expand it
|
||||
U=`sed -n 's/^U = //p' < "$mf"`
|
||||
# Find all dependency output files, they are included files with
|
||||
# $(DEPDIR) in their names. We invoke sed twice because it is the
|
||||
# simplest approach to changing $(DEPDIR) to its actual value in the
|
||||
# expansion.
|
||||
for file in `sed -n "
|
||||
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
|
||||
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
|
||||
# Make sure the directory exists.
|
||||
test -f "$dirpart/$file" && continue
|
||||
fdir=`AS_DIRNAME(["$file"])`
|
||||
AS_MKDIR_P([$dirpart/$fdir])
|
||||
# echo "creating $dirpart/$file"
|
||||
echo '# dummy' > "$dirpart/$file"
|
||||
done
|
||||
done
|
||||
])
|
||||
m4trace:/usr/share/aclocal-1.10/depout.m4:64: -1- AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles],
|
||||
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
|
||||
])
|
||||
m4trace:/usr/share/aclocal-1.10/init.m4:26: -1- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.60])dnl
|
||||
dnl Autoconf wants to disallow AM_ names. We explicitly allow
|
||||
dnl the ones we care about.
|
||||
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
|
||||
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
|
||||
AC_REQUIRE([AC_PROG_INSTALL])dnl
|
||||
if test "`cd $srcdir && pwd`" != "`pwd`"; then
|
||||
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
|
||||
# is not polluted with repeated "-I."
|
||||
AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
|
||||
# test to see if srcdir already configured
|
||||
if test -f $srcdir/config.status; then
|
||||
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
|
||||
fi
|
||||
fi
|
||||
|
||||
# test whether we have cygpath
|
||||
if test -z "$CYGPATH_W"; then
|
||||
if (cygpath --version) >/dev/null 2>/dev/null; then
|
||||
CYGPATH_W='cygpath -w'
|
||||
else
|
||||
CYGPATH_W=echo
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([CYGPATH_W])
|
||||
|
||||
# Define the identity of the package.
|
||||
dnl Distinguish between old-style and new-style calls.
|
||||
m4_ifval([$2],
|
||||
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
|
||||
AC_SUBST([PACKAGE], [$1])dnl
|
||||
AC_SUBST([VERSION], [$2])],
|
||||
[_AM_SET_OPTIONS([$1])dnl
|
||||
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
|
||||
m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
|
||||
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
|
||||
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
|
||||
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
|
||||
|
||||
_AM_IF_OPTION([no-define],,
|
||||
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
|
||||
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
|
||||
|
||||
# Some tools Automake needs.
|
||||
AC_REQUIRE([AM_SANITY_CHECK])dnl
|
||||
AC_REQUIRE([AC_ARG_PROGRAM])dnl
|
||||
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
|
||||
AM_MISSING_PROG(AUTOCONF, autoconf)
|
||||
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
|
||||
AM_MISSING_PROG(AUTOHEADER, autoheader)
|
||||
AM_MISSING_PROG(MAKEINFO, makeinfo)
|
||||
AM_PROG_INSTALL_SH
|
||||
AM_PROG_INSTALL_STRIP
|
||||
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
|
||||
# We need awk for the "check" target. The system "awk" is bad on
|
||||
# some platforms.
|
||||
AC_REQUIRE([AC_PROG_AWK])dnl
|
||||
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
|
||||
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
||||
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
|
||||
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
|
||||
[_AM_PROG_TAR([v7])])])
|
||||
_AM_IF_OPTION([no-dependencies],,
|
||||
[AC_PROVIDE_IFELSE([AC_PROG_CC],
|
||||
[_AM_DEPENDENCIES(CC)],
|
||||
[define([AC_PROG_CC],
|
||||
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
|
||||
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
||||
[_AM_DEPENDENCIES(CXX)],
|
||||
[define([AC_PROG_CXX],
|
||||
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
|
||||
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
|
||||
[_AM_DEPENDENCIES(OBJC)],
|
||||
[define([AC_PROG_OBJC],
|
||||
defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
|
||||
])
|
||||
])
|
||||
m4trace:/usr/share/aclocal-1.10/init.m4:113: -1- AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers.
|
||||
_am_stamp_count=1
|
||||
for _am_header in $config_headers :; do
|
||||
case $_am_header in
|
||||
$1 | $1:* )
|
||||
break ;;
|
||||
* )
|
||||
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
|
||||
esac
|
||||
done
|
||||
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
|
||||
m4trace:/usr/share/aclocal-1.10/install-sh.m4:11: -1- AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
|
||||
AC_SUBST(install_sh)])
|
||||
m4trace:/usr/share/aclocal-1.10/lead-dot.m4:12: -1- AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null
|
||||
mkdir .tst 2>/dev/null
|
||||
if test -d .tst; then
|
||||
am__leading_dot=.
|
||||
else
|
||||
am__leading_dot=_
|
||||
fi
|
||||
rmdir .tst 2>/dev/null
|
||||
AC_SUBST([am__leading_dot])])
|
||||
m4trace:/usr/share/aclocal-1.10/make.m4:14: -1- AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make}
|
||||
cat > confinc << 'END'
|
||||
am__doit:
|
||||
@echo done
|
||||
.PHONY: am__doit
|
||||
END
|
||||
# If we don't find an include directive, just comment out the code.
|
||||
AC_MSG_CHECKING([for style of include used by $am_make])
|
||||
am__include="#"
|
||||
am__quote=
|
||||
_am_result=none
|
||||
# First try GNU make style include.
|
||||
echo "include confinc" > confmf
|
||||
# We grep out `Entering directory' and `Leaving directory'
|
||||
# messages which can occur if `w' ends up in MAKEFLAGS.
|
||||
# In particular we don't look at `^make:' because GNU make might
|
||||
# be invoked under some other name (usually "gmake"), in which
|
||||
# case it prints its new name instead of `make'.
|
||||
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
|
||||
am__include=include
|
||||
am__quote=
|
||||
_am_result=GNU
|
||||
fi
|
||||
# Now try BSD make style include.
|
||||
if test "$am__include" = "#"; then
|
||||
echo '.include "confinc"' > confmf
|
||||
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
|
||||
am__include=.include
|
||||
am__quote="\""
|
||||
_am_result=BSD
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([am__include])
|
||||
AC_SUBST([am__quote])
|
||||
AC_MSG_RESULT([$_am_result])
|
||||
rm -f confinc confmf
|
||||
])
|
||||
m4trace:/usr/share/aclocal-1.10/minuso.m4:14: -1- AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl
|
||||
AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
AC_REQUIRE_AUX_FILE([compile])dnl
|
||||
# FIXME: we rely on the cache variable name because
|
||||
# there is no other way.
|
||||
set dummy $CC
|
||||
ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
|
||||
if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
|
||||
# Losing compiler, so override with the script.
|
||||
# FIXME: It is wrong to rewrite CC.
|
||||
# But if we don't then we get into trouble of one sort or another.
|
||||
# A longer-term fix would be to have automake use am__CC in this case,
|
||||
# and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
|
||||
CC="$am_aux_dir/compile $CC"
|
||||
fi
|
||||
dnl Make sure AC_PROG_CC is never called again, or it will override our
|
||||
dnl setting of CC.
|
||||
m4_define([AC_PROG_CC],
|
||||
[m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
|
||||
])
|
||||
m4trace:/usr/share/aclocal-1.10/missing.m4:14: -1- AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN])
|
||||
$1=${$1-"${am_missing_run}$2"}
|
||||
AC_SUBST($1)])
|
||||
m4trace:/usr/share/aclocal-1.10/missing.m4:24: -1- AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
AC_REQUIRE_AUX_FILE([missing])dnl
|
||||
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
|
||||
# Use eval to expand $SHELL
|
||||
if eval "$MISSING --run true"; then
|
||||
am_missing_run="$MISSING --run "
|
||||
else
|
||||
am_missing_run=
|
||||
AC_MSG_WARN([`missing' script is too old or missing])
|
||||
fi
|
||||
])
|
||||
m4trace:/usr/share/aclocal-1.10/mkdirp.m4:11: -1- AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl
|
||||
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
|
||||
dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
|
||||
dnl while keeping a definition of mkdir_p for backward compatibility.
|
||||
dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
|
||||
dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
|
||||
dnl Makefile.ins that do not define MKDIR_P, so we do our own
|
||||
dnl adjustment using top_builddir (which is defined more often than
|
||||
dnl MKDIR_P).
|
||||
AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
|
||||
case $mkdir_p in
|
||||
[[\\/$]]* | ?:[[\\/]]*) ;;
|
||||
*/*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
|
||||
esac
|
||||
])
|
||||
m4trace:/usr/share/aclocal-1.10/options.m4:13: -1- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
|
||||
m4trace:/usr/share/aclocal-1.10/options.m4:19: -1- AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
|
||||
m4trace:/usr/share/aclocal-1.10/options.m4:25: -1- AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
|
||||
m4trace:/usr/share/aclocal-1.10/options.m4:31: -1- AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
|
||||
m4trace:/usr/share/aclocal-1.10/runlog.m4:12: -1- AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
|
||||
($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
|
||||
(exit $ac_status); }])
|
||||
m4trace:/usr/share/aclocal-1.10/sanity.m4:14: -1- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane])
|
||||
# Just in case
|
||||
sleep 1
|
||||
echo timestamp > conftest.file
|
||||
# Do `set' in a subshell so we don't clobber the current shell's
|
||||
# arguments. Must try -L first in case configure is actually a
|
||||
# symlink; some systems play weird games with the mod time of symlinks
|
||||
# (eg FreeBSD returns the mod time of the symlink's containing
|
||||
# directory).
|
||||
if (
|
||||
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
|
||||
if test "$[*]" = "X"; then
|
||||
# -L didn't work.
|
||||
set X `ls -t $srcdir/configure conftest.file`
|
||||
fi
|
||||
rm -f conftest.file
|
||||
if test "$[*]" != "X $srcdir/configure conftest.file" \
|
||||
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
|
||||
|
||||
# If neither matched, then we have a broken ls. This can happen
|
||||
# if, for instance, CONFIG_SHELL is bash and it inherits a
|
||||
# broken ls alias from the environment. This has actually
|
||||
# happened. Such a system could not be considered "sane".
|
||||
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
||||
alias in your environment])
|
||||
fi
|
||||
|
||||
test "$[2]" = conftest.file
|
||||
)
|
||||
then
|
||||
# Ok.
|
||||
:
|
||||
else
|
||||
AC_MSG_ERROR([newly created file is older than distributed files!
|
||||
Check your system clock])
|
||||
fi
|
||||
AC_MSG_RESULT(yes)])
|
||||
m4trace:/usr/share/aclocal-1.10/strip.m4:17: -1- AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
|
||||
# Installed binaries are usually stripped using `strip' when the user
|
||||
# run `make install-strip'. However `strip' might not be the right
|
||||
# tool to use in cross-compilation environments, therefore Automake
|
||||
# will honor the `STRIP' environment variable to overrule this program.
|
||||
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
|
||||
if test "$cross_compiling" != no; then
|
||||
AC_CHECK_TOOL([STRIP], [strip], :)
|
||||
fi
|
||||
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
|
||||
AC_SUBST([INSTALL_STRIP_PROGRAM])])
|
||||
m4trace:/usr/share/aclocal-1.10/substnot.m4:12: -1- AC_DEFUN([_AM_SUBST_NOTMAKE])
|
||||
m4trace:/usr/share/aclocal-1.10/tar.m4:24: -1- AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility.
|
||||
AM_MISSING_PROG([AMTAR], [tar])
|
||||
m4_if([$1], [v7],
|
||||
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
|
||||
[m4_case([$1], [ustar],, [pax],,
|
||||
[m4_fatal([Unknown tar format])])
|
||||
AC_MSG_CHECKING([how to create a $1 tar archive])
|
||||
# Loop over all known methods to create a tar archive until one works.
|
||||
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
|
||||
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
|
||||
# Do not fold the above two line into one, because Tru64 sh and
|
||||
# Solaris sh will not grok spaces in the rhs of `-'.
|
||||
for _am_tool in $_am_tools
|
||||
do
|
||||
case $_am_tool in
|
||||
gnutar)
|
||||
for _am_tar in tar gnutar gtar;
|
||||
do
|
||||
AM_RUN_LOG([$_am_tar --version]) && break
|
||||
done
|
||||
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
|
||||
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
|
||||
am__untar="$_am_tar -xf -"
|
||||
;;
|
||||
plaintar)
|
||||
# Must skip GNU tar: if it does not support --format= it doesn't create
|
||||
# ustar tarball either.
|
||||
(tar --version) >/dev/null 2>&1 && continue
|
||||
am__tar='tar chf - "$$tardir"'
|
||||
am__tar_='tar chf - "$tardir"'
|
||||
am__untar='tar xf -'
|
||||
;;
|
||||
pax)
|
||||
am__tar='pax -L -x $1 -w "$$tardir"'
|
||||
am__tar_='pax -L -x $1 -w "$tardir"'
|
||||
am__untar='pax -r'
|
||||
;;
|
||||
cpio)
|
||||
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
|
||||
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
|
||||
am__untar='cpio -i -H $1 -d'
|
||||
;;
|
||||
none)
|
||||
am__tar=false
|
||||
am__tar_=false
|
||||
am__untar=false
|
||||
;;
|
||||
esac
|
||||
|
||||
# If the value was cached, stop now. We just wanted to have am__tar
|
||||
# and am__untar set.
|
||||
test -n "${am_cv_prog_tar_$1}" && break
|
||||
|
||||
# tar/untar a dummy directory, and stop if the command works
|
||||
rm -rf conftest.dir
|
||||
mkdir conftest.dir
|
||||
echo GrepMe > conftest.dir/file
|
||||
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
|
||||
rm -rf conftest.dir
|
||||
if test -s conftest.tar; then
|
||||
AM_RUN_LOG([$am__untar <conftest.tar])
|
||||
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
|
||||
fi
|
||||
done
|
||||
rm -rf conftest.dir
|
||||
|
||||
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
|
||||
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
|
||||
AC_SUBST([am__tar])
|
||||
AC_SUBST([am__untar])
|
||||
])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_forbid([^_?A[CHUM]_])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_forbid([_AC_])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^AS_FLAGS$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_forbid([^_?m4_])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_forbid([^dnl$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_forbid([^_?AS_])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^SHELL$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^PATH_SEPARATOR$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE_NAME$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE_VERSION$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE_STRING$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^exec_prefix$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^prefix$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^program_transform_name$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^bindir$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^sbindir$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^libexecdir$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^datarootdir$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^datadir$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^sysconfdir$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^sharedstatedir$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^localstatedir$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^includedir$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^oldincludedir$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^docdir$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^infodir$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^htmldir$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^dvidir$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^pdfdir$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^psdir$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^libdir$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^localedir$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^mandir$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE_NAME$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE_VERSION$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE_STRING$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^DEFS$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^ECHO_C$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^ECHO_N$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^ECHO_T$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^LIBS$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^build_alias$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^host_alias$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^target_alias$])
|
||||
m4trace:configure.ac:15: -1- m4_pattern_allow([^build$])
|
||||
m4trace:configure.ac:15: -1- m4_pattern_allow([^build_cpu$])
|
||||
m4trace:configure.ac:15: -1- m4_pattern_allow([^build_vendor$])
|
||||
m4trace:configure.ac:15: -1- m4_pattern_allow([^build_os$])
|
||||
m4trace:configure.ac:15: -1- m4_pattern_allow([^host$])
|
||||
m4trace:configure.ac:15: -1- m4_pattern_allow([^host_cpu$])
|
||||
m4trace:configure.ac:15: -1- m4_pattern_allow([^host_vendor$])
|
||||
m4trace:configure.ac:15: -1- m4_pattern_allow([^host_os$])
|
||||
m4trace:configure.ac:15: -1- m4_pattern_allow([^target$])
|
||||
m4trace:configure.ac:15: -1- m4_pattern_allow([^target_cpu$])
|
||||
m4trace:configure.ac:15: -1- m4_pattern_allow([^target_vendor$])
|
||||
m4trace:configure.ac:15: -1- m4_pattern_allow([^target_os$])
|
||||
m4trace:configure.ac:16: -1- AM_INIT_AUTOMAKE([-Wall -Wno-portability -Wno-unsupported dist-bzip2 dist-zip])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$])
|
||||
m4trace:configure.ac:16: -1- AM_SET_CURRENT_AUTOMAKE_VERSION
|
||||
m4trace:configure.ac:16: -1- AM_AUTOMAKE_VERSION([1.10])
|
||||
m4trace:configure.ac:16: -1- _AM_AUTOCONF_VERSION([2.61])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^INSTALL_PROGRAM$])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^INSTALL_SCRIPT$])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^INSTALL_DATA$])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^am__isrc$])
|
||||
m4trace:configure.ac:16: -1- _AM_SUBST_NOTMAKE([am__isrc])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^CYGPATH_W$])
|
||||
m4trace:configure.ac:16: -1- _AM_SET_OPTIONS([-Wall -Wno-portability -Wno-unsupported dist-bzip2 dist-zip])
|
||||
m4trace:configure.ac:16: -1- _AM_SET_OPTION([-Wall])
|
||||
m4trace:configure.ac:16: -2- _AM_MANGLE_OPTION([-Wall])
|
||||
m4trace:configure.ac:16: -1- _AM_SET_OPTION([-Wno-portability])
|
||||
m4trace:configure.ac:16: -2- _AM_MANGLE_OPTION([-Wno-portability])
|
||||
m4trace:configure.ac:16: -1- _AM_SET_OPTION([-Wno-unsupported])
|
||||
m4trace:configure.ac:16: -2- _AM_MANGLE_OPTION([-Wno-unsupported])
|
||||
m4trace:configure.ac:16: -1- _AM_SET_OPTION([dist-bzip2])
|
||||
m4trace:configure.ac:16: -2- _AM_MANGLE_OPTION([dist-bzip2])
|
||||
m4trace:configure.ac:16: -1- _AM_SET_OPTION([dist-zip])
|
||||
m4trace:configure.ac:16: -2- _AM_MANGLE_OPTION([dist-zip])
|
||||
m4trace:configure.ac:16: -1- _m4_warn([obsolete], [The macro `AC_FOREACH' is obsolete.
|
||||
You should run autoupdate.], [../../lib/autoconf/general.m4:196: AC_FOREACH is expanded from...
|
||||
/usr/share/aclocal-1.10/options.m4:25: _AM_SET_OPTIONS is expanded from...
|
||||
/usr/share/aclocal-1.10/init.m4:26: AM_INIT_AUTOMAKE is expanded from...
|
||||
configure.ac:16: the top level])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^PACKAGE$])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^VERSION$])
|
||||
m4trace:configure.ac:16: -1- _AM_IF_OPTION([no-define], [], [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
|
||||
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
|
||||
m4trace:configure.ac:16: -2- _AM_MANGLE_OPTION([no-define])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^PACKAGE$])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^VERSION$])
|
||||
m4trace:configure.ac:16: -1- AM_SANITY_CHECK
|
||||
m4trace:configure.ac:16: -1- AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
|
||||
m4trace:configure.ac:16: -1- AM_MISSING_HAS_RUN
|
||||
m4trace:configure.ac:16: -1- AM_AUX_DIR_EXPAND
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^ACLOCAL$])
|
||||
m4trace:configure.ac:16: -1- AM_MISSING_PROG([AUTOCONF], [autoconf])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^AUTOCONF$])
|
||||
m4trace:configure.ac:16: -1- AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^AUTOMAKE$])
|
||||
m4trace:configure.ac:16: -1- AM_MISSING_PROG([AUTOHEADER], [autoheader])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^AUTOHEADER$])
|
||||
m4trace:configure.ac:16: -1- AM_MISSING_PROG([MAKEINFO], [makeinfo])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^MAKEINFO$])
|
||||
m4trace:configure.ac:16: -1- AM_PROG_INSTALL_SH
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^install_sh$])
|
||||
m4trace:configure.ac:16: -1- AM_PROG_INSTALL_STRIP
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^STRIP$])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$])
|
||||
m4trace:configure.ac:16: -1- AM_PROG_MKDIR_P
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^mkdir_p$])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^AWK$])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^SET_MAKE$])
|
||||
m4trace:configure.ac:16: -1- AM_SET_LEADING_DOT
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^am__leading_dot$])
|
||||
m4trace:configure.ac:16: -1- _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
|
||||
[_AM_PROG_TAR([v7])])])
|
||||
m4trace:configure.ac:16: -2- _AM_MANGLE_OPTION([tar-ustar])
|
||||
m4trace:configure.ac:16: -1- _AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])
|
||||
m4trace:configure.ac:16: -2- _AM_MANGLE_OPTION([tar-pax])
|
||||
m4trace:configure.ac:16: -1- _AM_PROG_TAR([v7])
|
||||
m4trace:configure.ac:16: -1- AM_MISSING_PROG([AMTAR], [tar])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^AMTAR$])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^am__tar$])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^am__untar$])
|
||||
m4trace:configure.ac:16: -1- _AM_IF_OPTION([no-dependencies], [], [AC_PROVIDE_IFELSE([AC_PROG_CC],
|
||||
[_AM_DEPENDENCIES(CC)],
|
||||
[define([AC_PROG_CC],
|
||||
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
|
||||
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
||||
[_AM_DEPENDENCIES(CXX)],
|
||||
[define([AC_PROG_CXX],
|
||||
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
|
||||
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
|
||||
[_AM_DEPENDENCIES(OBJC)],
|
||||
[define([AC_PROG_OBJC],
|
||||
defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
|
||||
])
|
||||
m4trace:configure.ac:16: -2- _AM_MANGLE_OPTION([no-dependencies])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^CC$])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^CFLAGS$])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^LDFLAGS$])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^LIBS$])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^CPPFLAGS$])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^CC$])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^CC$])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^CC$])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^CC$])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^ac_ct_CC$])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^EXEEXT$])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^OBJEXT$])
|
||||
m4trace:configure.ac:20: -1- _AM_DEPENDENCIES([CC])
|
||||
m4trace:configure.ac:20: -1- AM_SET_DEPDIR
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^DEPDIR$])
|
||||
m4trace:configure.ac:20: -1- AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
m4trace:configure.ac:20: -1- AM_MAKE_INCLUDE
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^am__include$])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^am__quote$])
|
||||
m4trace:configure.ac:20: -1- AM_DEP_TRACK
|
||||
m4trace:configure.ac:20: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^AMDEP_TRUE$])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^AMDEP_FALSE$])
|
||||
m4trace:configure.ac:20: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE])
|
||||
m4trace:configure.ac:20: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^AMDEPBACKSLASH$])
|
||||
m4trace:configure.ac:20: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^CCDEPMODE$])
|
||||
m4trace:configure.ac:20: -1- AM_CONDITIONAL([am__fastdepCC], [
|
||||
test "x$enable_dependency_tracking" != xno \
|
||||
&& test "$am_cv_CC_dependencies_compiler_type" = gcc3])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^am__fastdepCC_TRUE$])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^am__fastdepCC_FALSE$])
|
||||
m4trace:configure.ac:20: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE])
|
||||
m4trace:configure.ac:20: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE])
|
||||
m4trace:configure.ac:21: -1- m4_pattern_allow([^RANLIB$])
|
||||
m4trace:configure.ac:22: -1- m4_pattern_allow([^INSTALL_PROGRAM$])
|
||||
m4trace:configure.ac:22: -1- m4_pattern_allow([^INSTALL_SCRIPT$])
|
||||
m4trace:configure.ac:22: -1- m4_pattern_allow([^INSTALL_DATA$])
|
||||
m4trace:configure.ac:23: -1- m4_pattern_allow([^LEX$])
|
||||
m4trace:configure.ac:23: -1- m4_pattern_allow([^LEX_OUTPUT_ROOT$])
|
||||
m4trace:configure.ac:23: -1- m4_pattern_allow([^LEXLIB$])
|
||||
m4trace:configure.ac:23: -1- m4_pattern_allow([^YYTEXT_POINTER$])
|
||||
m4trace:configure.ac:29: -1- m4_pattern_allow([^CC$])
|
||||
m4trace:configure.ac:30: -1- m4_pattern_allow([^CC$])
|
||||
m4trace:configure.ac:31: -1- m4_pattern_allow([^CFLAGS$])
|
||||
m4trace:configure.ac:33: -1- m4_pattern_allow([^AR$])
|
||||
m4trace:configure.ac:34: -1- m4_pattern_allow([^AR$])
|
||||
m4trace:configure.ac:35: -1- m4_pattern_allow([^AS$])
|
||||
m4trace:configure.ac:36: -1- m4_pattern_allow([^AS$])
|
||||
m4trace:configure.ac:37: -1- m4_pattern_allow([^RANLIB$])
|
||||
m4trace:configure.ac:38: -1- m4_pattern_allow([^RANLIB$])
|
||||
m4trace:configure.ac:39: -1- m4_pattern_allow([^LD$])
|
||||
m4trace:configure.ac:40: -1- m4_pattern_allow([^LD$])
|
||||
m4trace:configure.ac:42: -1- AM_PROG_CC_C_O
|
||||
m4trace:configure.ac:42: -1- m4_pattern_allow([^NO_MINUS_C_MINUS_O$])
|
||||
m4trace:configure.ac:47: -1- m4_pattern_allow([^CPP$])
|
||||
m4trace:configure.ac:47: -1- m4_pattern_allow([^CPPFLAGS$])
|
||||
m4trace:configure.ac:47: -1- m4_pattern_allow([^CPP$])
|
||||
m4trace:configure.ac:47: -1- m4_pattern_allow([^GREP$])
|
||||
m4trace:configure.ac:47: -1- m4_pattern_allow([^GREP$])
|
||||
m4trace:configure.ac:47: -1- m4_pattern_allow([^EGREP$])
|
||||
m4trace:configure.ac:47: -1- m4_pattern_allow([^EGREP$])
|
||||
m4trace:configure.ac:47: -1- m4_pattern_allow([^STDC_HEADERS$])
|
||||
m4trace:configure.ac:63: -1- m4_pattern_allow([^HAVE_DECL_STRERROR$])
|
||||
m4trace:configure.ac:63: -1- m4_pattern_allow([^HAVE_DECL_STRERROR$])
|
||||
m4trace:configure.ac:63: -1- m4_pattern_allow([^HAVE_DECL_PERROR$])
|
||||
m4trace:configure.ac:63: -1- m4_pattern_allow([^HAVE_DECL_PERROR$])
|
||||
m4trace:configure.ac:64: -1- m4_pattern_allow([^HAVE_SOCKLEN_T$])
|
||||
m4trace:configure.ac:91: -1- AM_CONDITIONAL([BDM_REMOTE], [test x$bdm_remote = xtrue])
|
||||
m4trace:configure.ac:91: -1- m4_pattern_allow([^BDM_REMOTE_TRUE$])
|
||||
m4trace:configure.ac:91: -1- m4_pattern_allow([^BDM_REMOTE_FALSE$])
|
||||
m4trace:configure.ac:91: -1- _AM_SUBST_NOTMAKE([BDM_REMOTE_TRUE])
|
||||
m4trace:configure.ac:91: -1- _AM_SUBST_NOTMAKE([BDM_REMOTE_FALSE])
|
||||
m4trace:configure.ac:132: -1- AM_CONDITIONAL([BDM_IOPERM], [test x$bdm_ioperm = xtrue])
|
||||
m4trace:configure.ac:132: -1- m4_pattern_allow([^BDM_IOPERM_TRUE$])
|
||||
m4trace:configure.ac:132: -1- m4_pattern_allow([^BDM_IOPERM_FALSE$])
|
||||
m4trace:configure.ac:132: -1- _AM_SUBST_NOTMAKE([BDM_IOPERM_TRUE])
|
||||
m4trace:configure.ac:132: -1- _AM_SUBST_NOTMAKE([BDM_IOPERM_FALSE])
|
||||
m4trace:configure.ac:161: -1- AM_CONDITIONAL([BDM_DRIVER], [test x$bdm_driver = xtrue])
|
||||
m4trace:configure.ac:161: -1- m4_pattern_allow([^BDM_DRIVER_TRUE$])
|
||||
m4trace:configure.ac:161: -1- m4_pattern_allow([^BDM_DRIVER_FALSE$])
|
||||
m4trace:configure.ac:161: -1- _AM_SUBST_NOTMAKE([BDM_DRIVER_TRUE])
|
||||
m4trace:configure.ac:161: -1- _AM_SUBST_NOTMAKE([BDM_DRIVER_FALSE])
|
||||
m4trace:configure.ac:181: -1- AM_CONDITIONAL([BDMCTRL], [test x$bdm_bdmctrl = xtrue])
|
||||
m4trace:configure.ac:181: -1- m4_pattern_allow([^BDMCTRL_TRUE$])
|
||||
m4trace:configure.ac:181: -1- m4_pattern_allow([^BDMCTRL_FALSE$])
|
||||
m4trace:configure.ac:181: -1- _AM_SUBST_NOTMAKE([BDMCTRL_TRUE])
|
||||
m4trace:configure.ac:181: -1- _AM_SUBST_NOTMAKE([BDMCTRL_FALSE])
|
||||
m4trace:configure.ac:192: -1- AM_CONDITIONAL([BDMFLASHLIB], [test x$bdm_flashlib = xtrue])
|
||||
m4trace:configure.ac:192: -1- m4_pattern_allow([^BDMFLASHLIB_TRUE$])
|
||||
m4trace:configure.ac:192: -1- m4_pattern_allow([^BDMFLASHLIB_FALSE$])
|
||||
m4trace:configure.ac:192: -1- _AM_SUBST_NOTMAKE([BDMFLASHLIB_TRUE])
|
||||
m4trace:configure.ac:192: -1- _AM_SUBST_NOTMAKE([BDMFLASHLIB_FALSE])
|
||||
m4trace:configure.ac:212: -1- AM_CONDITIONAL([BDMFLASH], [test x$bdm_bdmflash = xtrue])
|
||||
m4trace:configure.ac:212: -1- m4_pattern_allow([^BDMFLASH_TRUE$])
|
||||
m4trace:configure.ac:212: -1- m4_pattern_allow([^BDMFLASH_FALSE$])
|
||||
m4trace:configure.ac:212: -1- _AM_SUBST_NOTMAKE([BDMFLASH_TRUE])
|
||||
m4trace:configure.ac:212: -1- _AM_SUBST_NOTMAKE([BDMFLASH_FALSE])
|
||||
m4trace:configure.ac:215: -1- AM_CONDITIONAL([BDMMON], [test x$bdm_bdmmon = xtrue])
|
||||
m4trace:configure.ac:215: -1- m4_pattern_allow([^BDMMON_TRUE$])
|
||||
m4trace:configure.ac:215: -1- m4_pattern_allow([^BDMMON_FALSE$])
|
||||
m4trace:configure.ac:215: -1- _AM_SUBST_NOTMAKE([BDMMON_TRUE])
|
||||
m4trace:configure.ac:215: -1- _AM_SUBST_NOTMAKE([BDMMON_FALSE])
|
||||
m4trace:configure.ac:226: -1- AM_CONDITIONAL([GDBSERVER], [test x$bdm_gdbserver = xtrue])
|
||||
m4trace:configure.ac:226: -1- m4_pattern_allow([^GDBSERVER_TRUE$])
|
||||
m4trace:configure.ac:226: -1- m4_pattern_allow([^GDBSERVER_FALSE$])
|
||||
m4trace:configure.ac:226: -1- _AM_SUBST_NOTMAKE([GDBSERVER_TRUE])
|
||||
m4trace:configure.ac:226: -1- _AM_SUBST_NOTMAKE([GDBSERVER_FALSE])
|
||||
m4trace:configure.ac:256: -1- m4_pattern_allow([^HAVE_LIBUSB$])
|
||||
m4trace:configure.ac:265: -1- AM_CONDITIONAL([TBLCF_USB], [test x$bdm_tblcf = xtrue])
|
||||
m4trace:configure.ac:265: -1- m4_pattern_allow([^TBLCF_USB_TRUE$])
|
||||
m4trace:configure.ac:265: -1- m4_pattern_allow([^TBLCF_USB_FALSE$])
|
||||
m4trace:configure.ac:265: -1- _AM_SUBST_NOTMAKE([TBLCF_USB_TRUE])
|
||||
m4trace:configure.ac:265: -1- _AM_SUBST_NOTMAKE([TBLCF_USB_FALSE])
|
||||
m4trace:configure.ac:267: -1- AM_CONDITIONAL([LIBUSB_PATH], [test $ac_libusb_include_dir != NONE])
|
||||
m4trace:configure.ac:267: -1- m4_pattern_allow([^LIBUSB_PATH_TRUE$])
|
||||
m4trace:configure.ac:267: -1- m4_pattern_allow([^LIBUSB_PATH_FALSE$])
|
||||
m4trace:configure.ac:267: -1- _AM_SUBST_NOTMAKE([LIBUSB_PATH_TRUE])
|
||||
m4trace:configure.ac:267: -1- _AM_SUBST_NOTMAKE([LIBUSB_PATH_FALSE])
|
||||
m4trace:configure.ac:268: -1- m4_pattern_allow([^LIBUSB_INCLUDE_DIR$])
|
||||
m4trace:configure.ac:269: -1- m4_pattern_allow([^LIBUSB_LIB_DIR$])
|
||||
m4trace:configure.ac:286: -1- AM_CONDITIONAL([WIN32], [test x$bdm_win32 = xtrue])
|
||||
m4trace:configure.ac:286: -1- m4_pattern_allow([^WIN32_TRUE$])
|
||||
m4trace:configure.ac:286: -1- m4_pattern_allow([^WIN32_FALSE$])
|
||||
m4trace:configure.ac:286: -1- _AM_SUBST_NOTMAKE([WIN32_TRUE])
|
||||
m4trace:configure.ac:286: -1- _AM_SUBST_NOTMAKE([WIN32_FALSE])
|
||||
m4trace:configure.ac:299: -1- m4_pattern_allow([^BDM_SUBDIRS$])
|
||||
m4trace:configure.ac:304: -1- m4_pattern_allow([^subdirs$])
|
||||
m4trace:configure.ac:310: -1- m4_pattern_allow([^flash_plugin_cc$])
|
||||
m4trace:configure.ac:314: -1- AM_CONDITIONAL([BUILD_FLASH_PLUGINS], [test x${flash_plugin_cc} != xnone])
|
||||
m4trace:configure.ac:314: -1- m4_pattern_allow([^BUILD_FLASH_PLUGINS_TRUE$])
|
||||
m4trace:configure.ac:314: -1- m4_pattern_allow([^BUILD_FLASH_PLUGINS_FALSE$])
|
||||
m4trace:configure.ac:314: -1- _AM_SUBST_NOTMAKE([BUILD_FLASH_PLUGINS_TRUE])
|
||||
m4trace:configure.ac:314: -1- _AM_SUBST_NOTMAKE([BUILD_FLASH_PLUGINS_FALSE])
|
||||
m4trace:configure.ac:315: -1- m4_pattern_allow([^FLASH_PLUGIN_GCC$])
|
||||
m4trace:configure.ac:331: -1- m4_pattern_allow([^LIB@&t@OBJS$])
|
||||
m4trace:configure.ac:331: -1- m4_pattern_allow([^LTLIBOBJS$])
|
||||
m4trace:configure.ac:331: -1- _AC_AM_CONFIG_HEADER_HOOK([$ac_file])
|
||||
m4trace:configure.ac:331: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
657
m68k/autom4te.cache/traces.1
Normal file
657
m68k/autom4te.cache/traces.1
Normal file
@@ -0,0 +1,657 @@
|
||||
m4trace:configure.ac:13: -1- AC_INIT([m68k-bdm], [1.4.0], [bdm-devel@lists.sourceforge.net])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_forbid([^_?A[CHUM]_])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_forbid([_AC_])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^AS_FLAGS$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_forbid([^_?m4_])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_forbid([^dnl$])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_forbid([^_?AS_])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([SHELL])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^SHELL$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([PATH_SEPARATOR])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([PATH_SEPARATOR])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^PATH_SEPARATOR$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([PACKAGE_NAME])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE_NAME$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([PACKAGE_TARNAME])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([PACKAGE_VERSION])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE_VERSION$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([PACKAGE_STRING])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE_STRING$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([exec_prefix], [NONE])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([exec_prefix])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^exec_prefix$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([prefix], [NONE])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([prefix])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^prefix$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([program_transform_name], [s,x,x,])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([program_transform_name])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^program_transform_name$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([bindir], ['${exec_prefix}/bin'])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([bindir])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^bindir$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin'])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([sbindir])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^sbindir$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec'])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([libexecdir])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^libexecdir$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([datarootdir], ['${prefix}/share'])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([datarootdir])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^datarootdir$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([datadir], ['${datarootdir}'])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([datadir])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^datadir$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([sysconfdir], ['${prefix}/etc'])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([sysconfdir])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^sysconfdir$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([sharedstatedir], ['${prefix}/com'])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([sharedstatedir])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^sharedstatedir$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([localstatedir], ['${prefix}/var'])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([localstatedir])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^localstatedir$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([includedir], ['${prefix}/include'])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([includedir])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^includedir$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([oldincludedir], ['/usr/include'])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([oldincludedir])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^oldincludedir$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME],
|
||||
['${datarootdir}/doc/${PACKAGE_TARNAME}'],
|
||||
['${datarootdir}/doc/${PACKAGE}'])])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([docdir])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^docdir$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([infodir], ['${datarootdir}/info'])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([infodir])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^infodir$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([htmldir], ['${docdir}'])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([htmldir])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^htmldir$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([dvidir], ['${docdir}'])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([dvidir])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^dvidir$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([pdfdir], ['${docdir}'])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([pdfdir])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^pdfdir$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([psdir], ['${docdir}'])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([psdir])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^psdir$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([libdir], ['${exec_prefix}/lib'])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([libdir])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^libdir$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([localedir], ['${datarootdir}/locale'])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([localedir])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^localedir$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([mandir], ['${datarootdir}/man'])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([mandir])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^mandir$])
|
||||
m4trace:configure.ac:13: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE_NAME$])
|
||||
m4trace:configure.ac:13: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME])
|
||||
m4trace:configure.ac:13: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
|
||||
m4trace:configure.ac:13: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME])
|
||||
m4trace:configure.ac:13: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE_VERSION$])
|
||||
m4trace:configure.ac:13: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION])
|
||||
m4trace:configure.ac:13: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE_STRING$])
|
||||
m4trace:configure.ac:13: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING])
|
||||
m4trace:configure.ac:13: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
|
||||
m4trace:configure.ac:13: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([DEFS])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([DEFS])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^DEFS$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([ECHO_C])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([ECHO_C])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^ECHO_C$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([ECHO_N])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([ECHO_N])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^ECHO_N$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([ECHO_T])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([ECHO_T])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^ECHO_T$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([LIBS])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([LIBS])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^LIBS$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([build_alias])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([build_alias])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^build_alias$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([host_alias])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([host_alias])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^host_alias$])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST([target_alias])
|
||||
m4trace:configure.ac:13: -1- AC_SUBST_TRACE([target_alias])
|
||||
m4trace:configure.ac:13: -1- m4_pattern_allow([^target_alias$])
|
||||
m4trace:configure.ac:14: -1- AC_CONFIG_AUX_DIR([config])
|
||||
m4trace:configure.ac:15: -1- AC_CANONICAL_TARGET([])
|
||||
m4trace:configure.ac:15: -1- AC_CANONICAL_HOST
|
||||
m4trace:configure.ac:15: -1- AC_CANONICAL_BUILD
|
||||
m4trace:configure.ac:15: -1- AC_REQUIRE_AUX_FILE([config.sub])
|
||||
m4trace:configure.ac:15: -1- AC_REQUIRE_AUX_FILE([config.guess])
|
||||
m4trace:configure.ac:15: -1- AC_SUBST([build], [$ac_cv_build])
|
||||
m4trace:configure.ac:15: -1- AC_SUBST_TRACE([build])
|
||||
m4trace:configure.ac:15: -1- m4_pattern_allow([^build$])
|
||||
m4trace:configure.ac:15: -1- AC_SUBST([build_cpu], [$[1]])
|
||||
m4trace:configure.ac:15: -1- AC_SUBST_TRACE([build_cpu])
|
||||
m4trace:configure.ac:15: -1- m4_pattern_allow([^build_cpu$])
|
||||
m4trace:configure.ac:15: -1- AC_SUBST([build_vendor], [$[2]])
|
||||
m4trace:configure.ac:15: -1- AC_SUBST_TRACE([build_vendor])
|
||||
m4trace:configure.ac:15: -1- m4_pattern_allow([^build_vendor$])
|
||||
m4trace:configure.ac:15: -1- AC_SUBST([build_os])
|
||||
m4trace:configure.ac:15: -1- AC_SUBST_TRACE([build_os])
|
||||
m4trace:configure.ac:15: -1- m4_pattern_allow([^build_os$])
|
||||
m4trace:configure.ac:15: -1- AC_SUBST([host], [$ac_cv_host])
|
||||
m4trace:configure.ac:15: -1- AC_SUBST_TRACE([host])
|
||||
m4trace:configure.ac:15: -1- m4_pattern_allow([^host$])
|
||||
m4trace:configure.ac:15: -1- AC_SUBST([host_cpu], [$[1]])
|
||||
m4trace:configure.ac:15: -1- AC_SUBST_TRACE([host_cpu])
|
||||
m4trace:configure.ac:15: -1- m4_pattern_allow([^host_cpu$])
|
||||
m4trace:configure.ac:15: -1- AC_SUBST([host_vendor], [$[2]])
|
||||
m4trace:configure.ac:15: -1- AC_SUBST_TRACE([host_vendor])
|
||||
m4trace:configure.ac:15: -1- m4_pattern_allow([^host_vendor$])
|
||||
m4trace:configure.ac:15: -1- AC_SUBST([host_os])
|
||||
m4trace:configure.ac:15: -1- AC_SUBST_TRACE([host_os])
|
||||
m4trace:configure.ac:15: -1- m4_pattern_allow([^host_os$])
|
||||
m4trace:configure.ac:15: -1- AC_SUBST([target], [$ac_cv_target])
|
||||
m4trace:configure.ac:15: -1- AC_SUBST_TRACE([target])
|
||||
m4trace:configure.ac:15: -1- m4_pattern_allow([^target$])
|
||||
m4trace:configure.ac:15: -1- AC_SUBST([target_cpu], [$[1]])
|
||||
m4trace:configure.ac:15: -1- AC_SUBST_TRACE([target_cpu])
|
||||
m4trace:configure.ac:15: -1- m4_pattern_allow([^target_cpu$])
|
||||
m4trace:configure.ac:15: -1- AC_SUBST([target_vendor], [$[2]])
|
||||
m4trace:configure.ac:15: -1- AC_SUBST_TRACE([target_vendor])
|
||||
m4trace:configure.ac:15: -1- m4_pattern_allow([^target_vendor$])
|
||||
m4trace:configure.ac:15: -1- AC_SUBST([target_os])
|
||||
m4trace:configure.ac:15: -1- AC_SUBST_TRACE([target_os])
|
||||
m4trace:configure.ac:15: -1- m4_pattern_allow([^target_os$])
|
||||
m4trace:configure.ac:16: -1- AM_INIT_AUTOMAKE([-Wall -Wno-portability -Wno-unsupported dist-bzip2 dist-zip])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$])
|
||||
m4trace:configure.ac:16: -1- AM_AUTOMAKE_VERSION([1.10])
|
||||
m4trace:configure.ac:16: -1- AC_REQUIRE_AUX_FILE([install-sh])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([INSTALL_PROGRAM])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([INSTALL_PROGRAM])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^INSTALL_PROGRAM$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([INSTALL_SCRIPT])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([INSTALL_SCRIPT])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^INSTALL_SCRIPT$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([INSTALL_DATA])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([INSTALL_DATA])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^INSTALL_DATA$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([am__isrc], [' -I$(srcdir)'])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([am__isrc])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^am__isrc$])
|
||||
m4trace:configure.ac:16: -1- _AM_SUBST_NOTMAKE([am__isrc])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([CYGPATH_W])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([CYGPATH_W])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^CYGPATH_W$])
|
||||
m4trace:configure.ac:16: -1- _m4_warn([obsolete], [The macro `AC_FOREACH' is obsolete.
|
||||
You should run autoupdate.], [../../lib/autoconf/general.m4:196: AC_FOREACH is expanded from...
|
||||
aclocal.m4:700: _AM_SET_OPTIONS is expanded from...
|
||||
aclocal.m4:393: AM_INIT_AUTOMAKE is expanded from...
|
||||
configure.ac:16: the top level])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([PACKAGE])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^PACKAGE$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([VERSION])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^VERSION$])
|
||||
m4trace:configure.ac:16: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^PACKAGE$])
|
||||
m4trace:configure.ac:16: -1- AH_OUTPUT([PACKAGE], [/* Name of package */
|
||||
#undef PACKAGE])
|
||||
m4trace:configure.ac:16: -1- AC_DEFINE_TRACE_LITERAL([VERSION])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^VERSION$])
|
||||
m4trace:configure.ac:16: -1- AH_OUTPUT([VERSION], [/* Version number of package */
|
||||
#undef VERSION])
|
||||
m4trace:configure.ac:16: -1- AC_REQUIRE_AUX_FILE([missing])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([ACLOCAL])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([ACLOCAL])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^ACLOCAL$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([AUTOCONF])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([AUTOCONF])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^AUTOCONF$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([AUTOMAKE])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([AUTOMAKE])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^AUTOMAKE$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([AUTOHEADER])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([AUTOHEADER])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^AUTOHEADER$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([MAKEINFO])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([MAKEINFO])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^MAKEINFO$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([install_sh])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([install_sh])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^install_sh$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([STRIP])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([STRIP])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^STRIP$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([INSTALL_STRIP_PROGRAM])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([INSTALL_STRIP_PROGRAM])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$])
|
||||
m4trace:configure.ac:16: -1- AC_REQUIRE_AUX_FILE([install-sh])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([mkdir_p], ["$MKDIR_P"])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([mkdir_p])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^mkdir_p$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([AWK])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([AWK])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^AWK$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([SET_MAKE])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([SET_MAKE])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^SET_MAKE$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([am__leading_dot])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([am__leading_dot])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^am__leading_dot$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([AMTAR])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([AMTAR])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^AMTAR$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([am__tar])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([am__tar])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^am__tar$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([am__untar])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([am__untar])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^am__untar$])
|
||||
m4trace:configure.ac:18: -1- AC_CONFIG_HEADERS([config.h:config.h.in])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST([CC])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([CC])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^CC$])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST([CFLAGS])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([CFLAGS])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^CFLAGS$])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST([LDFLAGS])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([LDFLAGS])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^LDFLAGS$])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST([LIBS])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([LIBS])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^LIBS$])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST([CPPFLAGS])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([CPPFLAGS])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^CPPFLAGS$])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST([CC])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([CC])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^CC$])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST([CC])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([CC])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^CC$])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST([CC])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([CC])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^CC$])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST([CC])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([CC])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^CC$])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST([ac_ct_CC])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([ac_ct_CC])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^ac_ct_CC$])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([EXEEXT])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^EXEEXT$])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST([OBJEXT], [$ac_cv_objext])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([OBJEXT])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^OBJEXT$])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([DEPDIR])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^DEPDIR$])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST([am__include])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([am__include])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^am__include$])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST([am__quote])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([am__quote])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^am__quote$])
|
||||
m4trace:configure.ac:20: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST([AMDEP_TRUE])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([AMDEP_TRUE])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^AMDEP_TRUE$])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST([AMDEP_FALSE])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([AMDEP_FALSE])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^AMDEP_FALSE$])
|
||||
m4trace:configure.ac:20: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE])
|
||||
m4trace:configure.ac:20: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST([AMDEPBACKSLASH])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([AMDEPBACKSLASH])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^AMDEPBACKSLASH$])
|
||||
m4trace:configure.ac:20: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([CCDEPMODE])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^CCDEPMODE$])
|
||||
m4trace:configure.ac:20: -1- AM_CONDITIONAL([am__fastdepCC], [
|
||||
test "x$enable_dependency_tracking" != xno \
|
||||
&& test "$am_cv_CC_dependencies_compiler_type" = gcc3])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST([am__fastdepCC_TRUE])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^am__fastdepCC_TRUE$])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST([am__fastdepCC_FALSE])
|
||||
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE])
|
||||
m4trace:configure.ac:20: -1- m4_pattern_allow([^am__fastdepCC_FALSE$])
|
||||
m4trace:configure.ac:20: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE])
|
||||
m4trace:configure.ac:20: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE])
|
||||
m4trace:configure.ac:21: -1- AC_SUBST([RANLIB])
|
||||
m4trace:configure.ac:21: -1- AC_SUBST_TRACE([RANLIB])
|
||||
m4trace:configure.ac:21: -1- m4_pattern_allow([^RANLIB$])
|
||||
m4trace:configure.ac:22: -1- AC_REQUIRE_AUX_FILE([install-sh])
|
||||
m4trace:configure.ac:22: -1- AC_SUBST([INSTALL_PROGRAM])
|
||||
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([INSTALL_PROGRAM])
|
||||
m4trace:configure.ac:22: -1- m4_pattern_allow([^INSTALL_PROGRAM$])
|
||||
m4trace:configure.ac:22: -1- AC_SUBST([INSTALL_SCRIPT])
|
||||
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([INSTALL_SCRIPT])
|
||||
m4trace:configure.ac:22: -1- m4_pattern_allow([^INSTALL_SCRIPT$])
|
||||
m4trace:configure.ac:22: -1- AC_SUBST([INSTALL_DATA])
|
||||
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([INSTALL_DATA])
|
||||
m4trace:configure.ac:22: -1- m4_pattern_allow([^INSTALL_DATA$])
|
||||
m4trace:configure.ac:23: -1- AC_SUBST([LEX])
|
||||
m4trace:configure.ac:23: -1- AC_SUBST_TRACE([LEX])
|
||||
m4trace:configure.ac:23: -1- m4_pattern_allow([^LEX$])
|
||||
m4trace:configure.ac:23: -1- AC_SUBST([LEX_OUTPUT_ROOT], [$ac_cv_prog_lex_root])
|
||||
m4trace:configure.ac:23: -1- AC_SUBST_TRACE([LEX_OUTPUT_ROOT])
|
||||
m4trace:configure.ac:23: -1- m4_pattern_allow([^LEX_OUTPUT_ROOT$])
|
||||
m4trace:configure.ac:23: -1- AC_SUBST([LEXLIB])
|
||||
m4trace:configure.ac:23: -1- AC_SUBST_TRACE([LEXLIB])
|
||||
m4trace:configure.ac:23: -1- m4_pattern_allow([^LEXLIB$])
|
||||
m4trace:configure.ac:23: -1- AC_DEFINE_TRACE_LITERAL([YYTEXT_POINTER])
|
||||
m4trace:configure.ac:23: -1- m4_pattern_allow([^YYTEXT_POINTER$])
|
||||
m4trace:configure.ac:23: -1- AH_OUTPUT([YYTEXT_POINTER], [/* Define to 1 if `lex\' declares `yytext\' as a `char *\' by default, not a
|
||||
`char[]\'. */
|
||||
#undef YYTEXT_POINTER])
|
||||
m4trace:configure.ac:29: -1- AC_SUBST([CC])
|
||||
m4trace:configure.ac:29: -1- AC_SUBST_TRACE([CC])
|
||||
m4trace:configure.ac:29: -1- m4_pattern_allow([^CC$])
|
||||
m4trace:configure.ac:30: -1- AC_SUBST([CC])
|
||||
m4trace:configure.ac:30: -1- AC_SUBST_TRACE([CC])
|
||||
m4trace:configure.ac:30: -1- m4_pattern_allow([^CC$])
|
||||
m4trace:configure.ac:31: -1- AC_SUBST([CFLAGS])
|
||||
m4trace:configure.ac:31: -1- AC_SUBST_TRACE([CFLAGS])
|
||||
m4trace:configure.ac:31: -1- m4_pattern_allow([^CFLAGS$])
|
||||
m4trace:configure.ac:33: -1- AC_SUBST([AR])
|
||||
m4trace:configure.ac:33: -1- AC_SUBST_TRACE([AR])
|
||||
m4trace:configure.ac:33: -1- m4_pattern_allow([^AR$])
|
||||
m4trace:configure.ac:34: -1- AC_SUBST([AR])
|
||||
m4trace:configure.ac:34: -1- AC_SUBST_TRACE([AR])
|
||||
m4trace:configure.ac:34: -1- m4_pattern_allow([^AR$])
|
||||
m4trace:configure.ac:35: -1- AC_SUBST([AS])
|
||||
m4trace:configure.ac:35: -1- AC_SUBST_TRACE([AS])
|
||||
m4trace:configure.ac:35: -1- m4_pattern_allow([^AS$])
|
||||
m4trace:configure.ac:36: -1- AC_SUBST([AS])
|
||||
m4trace:configure.ac:36: -1- AC_SUBST_TRACE([AS])
|
||||
m4trace:configure.ac:36: -1- m4_pattern_allow([^AS$])
|
||||
m4trace:configure.ac:37: -1- AC_SUBST([RANLIB])
|
||||
m4trace:configure.ac:37: -1- AC_SUBST_TRACE([RANLIB])
|
||||
m4trace:configure.ac:37: -1- m4_pattern_allow([^RANLIB$])
|
||||
m4trace:configure.ac:38: -1- AC_SUBST([RANLIB])
|
||||
m4trace:configure.ac:38: -1- AC_SUBST_TRACE([RANLIB])
|
||||
m4trace:configure.ac:38: -1- m4_pattern_allow([^RANLIB$])
|
||||
m4trace:configure.ac:39: -1- AC_SUBST([LD])
|
||||
m4trace:configure.ac:39: -1- AC_SUBST_TRACE([LD])
|
||||
m4trace:configure.ac:39: -1- m4_pattern_allow([^LD$])
|
||||
m4trace:configure.ac:40: -1- AC_SUBST([LD])
|
||||
m4trace:configure.ac:40: -1- AC_SUBST_TRACE([LD])
|
||||
m4trace:configure.ac:40: -1- m4_pattern_allow([^LD$])
|
||||
m4trace:configure.ac:42: -1- AM_PROG_CC_C_O
|
||||
m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([NO_MINUS_C_MINUS_O])
|
||||
m4trace:configure.ac:42: -1- m4_pattern_allow([^NO_MINUS_C_MINUS_O$])
|
||||
m4trace:configure.ac:42: -1- AH_OUTPUT([NO_MINUS_C_MINUS_O], [/* Define to 1 if your C compiler doesn\'t accept -c and -o together. */
|
||||
#undef NO_MINUS_C_MINUS_O])
|
||||
m4trace:configure.ac:42: -1- AC_REQUIRE_AUX_FILE([compile])
|
||||
m4trace:configure.ac:47: -1- AC_SUBST([CPP])
|
||||
m4trace:configure.ac:47: -1- AC_SUBST_TRACE([CPP])
|
||||
m4trace:configure.ac:47: -1- m4_pattern_allow([^CPP$])
|
||||
m4trace:configure.ac:47: -1- AC_SUBST([CPPFLAGS])
|
||||
m4trace:configure.ac:47: -1- AC_SUBST_TRACE([CPPFLAGS])
|
||||
m4trace:configure.ac:47: -1- m4_pattern_allow([^CPPFLAGS$])
|
||||
m4trace:configure.ac:47: -1- AC_SUBST([CPP])
|
||||
m4trace:configure.ac:47: -1- AC_SUBST_TRACE([CPP])
|
||||
m4trace:configure.ac:47: -1- m4_pattern_allow([^CPP$])
|
||||
m4trace:configure.ac:47: -1- AC_SUBST([GREP])
|
||||
m4trace:configure.ac:47: -1- AC_SUBST_TRACE([GREP])
|
||||
m4trace:configure.ac:47: -1- m4_pattern_allow([^GREP$])
|
||||
m4trace:configure.ac:47: -1- AC_SUBST([GREP])
|
||||
m4trace:configure.ac:47: -1- AC_SUBST_TRACE([GREP])
|
||||
m4trace:configure.ac:47: -1- m4_pattern_allow([^GREP$])
|
||||
m4trace:configure.ac:47: -1- AC_SUBST([EGREP])
|
||||
m4trace:configure.ac:47: -1- AC_SUBST_TRACE([EGREP])
|
||||
m4trace:configure.ac:47: -1- m4_pattern_allow([^EGREP$])
|
||||
m4trace:configure.ac:47: -1- AC_SUBST([EGREP])
|
||||
m4trace:configure.ac:47: -1- AC_SUBST_TRACE([EGREP])
|
||||
m4trace:configure.ac:47: -1- m4_pattern_allow([^EGREP$])
|
||||
m4trace:configure.ac:47: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS])
|
||||
m4trace:configure.ac:47: -1- m4_pattern_allow([^STDC_HEADERS$])
|
||||
m4trace:configure.ac:47: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS])
|
||||
m4trace:configure.ac:48: -1- AH_OUTPUT([HAVE_SYS_IOCTL_H], [/* Define to 1 if you have the <sys/ioctl.h> header file. */
|
||||
#undef HAVE_SYS_IOCTL_H])
|
||||
m4trace:configure.ac:48: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H])
|
||||
m4trace:configure.ac:48: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H])
|
||||
m4trace:configure.ac:48: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H])
|
||||
m4trace:configure.ac:48: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H])
|
||||
m4trace:configure.ac:48: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H])
|
||||
m4trace:configure.ac:48: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H])
|
||||
m4trace:configure.ac:48: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H])
|
||||
m4trace:configure.ac:48: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H])
|
||||
m4trace:configure.ac:48: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H])
|
||||
m4trace:configure.ac:49: -1- AH_OUTPUT([HAVE_SYS_FILE_H], [/* Define to 1 if you have the <sys/file.h> header file. */
|
||||
#undef HAVE_SYS_FILE_H])
|
||||
m4trace:configure.ac:50: -1- AH_OUTPUT([HAVE_NETINET_IN_H], [/* Define to 1 if you have the <netinet/in.h> header file. */
|
||||
#undef HAVE_NETINET_IN_H])
|
||||
m4trace:configure.ac:51: -1- AH_OUTPUT([HAVE_SYS_SOCKET_H], [/* Define to 1 if you have the <sys/socket.h> header file. */
|
||||
#undef HAVE_SYS_SOCKET_H])
|
||||
m4trace:configure.ac:52: -1- AH_OUTPUT([HAVE_NETDB_H], [/* Define to 1 if you have the <netdb.h> header file. */
|
||||
#undef HAVE_NETDB_H])
|
||||
m4trace:configure.ac:53: -1- AH_OUTPUT([HAVE_NETINET_TCP_H], [/* Define to 1 if you have the <netinet/tcp.h> header file. */
|
||||
#undef HAVE_NETINET_TCP_H])
|
||||
m4trace:configure.ac:54: -1- AH_OUTPUT([HAVE_SYS_IOCTL_H], [/* Define to 1 if you have the <sys/ioctl.h> header file. */
|
||||
#undef HAVE_SYS_IOCTL_H])
|
||||
m4trace:configure.ac:55: -1- AH_OUTPUT([HAVE_SIGNAL_H], [/* Define to 1 if you have the <signal.h> header file. */
|
||||
#undef HAVE_SIGNAL_H])
|
||||
m4trace:configure.ac:56: -1- AH_OUTPUT([HAVE_FCNTL_H], [/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H])
|
||||
m4trace:configure.ac:57: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H])
|
||||
m4trace:configure.ac:58: -1- AH_OUTPUT([HAVE_ARPA_INET_H], [/* Define to 1 if you have the <arpa/inet.h> header file. */
|
||||
#undef HAVE_ARPA_INET_H])
|
||||
m4trace:configure.ac:59: -1- AH_OUTPUT([HAVE_ERRNO_H], [/* Define to 1 if you have the <errno.h> header file. */
|
||||
#undef HAVE_ERRNO_H])
|
||||
m4trace:configure.ac:60: -1- AH_OUTPUT([HAVE_TERMIOS_H], [/* Define to 1 if you have the <termios.h> header file. */
|
||||
#undef HAVE_TERMIOS_H])
|
||||
m4trace:configure.ac:61: -1- AH_OUTPUT([HAVE_TERMIO_H], [/* Define to 1 if you have the <termio.h> header file. */
|
||||
#undef HAVE_TERMIO_H])
|
||||
m4trace:configure.ac:62: -1- AH_OUTPUT([HAVE_SGTTY_H], [/* Define to 1 if you have the <sgtty.h> header file. */
|
||||
#undef HAVE_SGTTY_H])
|
||||
m4trace:configure.ac:63: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_STRERROR])
|
||||
m4trace:configure.ac:63: -1- m4_pattern_allow([^HAVE_DECL_STRERROR$])
|
||||
m4trace:configure.ac:63: -1- AH_OUTPUT([HAVE_DECL_STRERROR], [/* Define to 1 if you have the declaration of `strerror\', and to 0 if you
|
||||
don\'t. */
|
||||
#undef HAVE_DECL_STRERROR])
|
||||
m4trace:configure.ac:63: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_STRERROR])
|
||||
m4trace:configure.ac:63: -1- m4_pattern_allow([^HAVE_DECL_STRERROR$])
|
||||
m4trace:configure.ac:63: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_PERROR])
|
||||
m4trace:configure.ac:63: -1- m4_pattern_allow([^HAVE_DECL_PERROR$])
|
||||
m4trace:configure.ac:63: -1- AH_OUTPUT([HAVE_DECL_PERROR], [/* Define to 1 if you have the declaration of `perror\', and to 0 if you don\'t.
|
||||
*/
|
||||
#undef HAVE_DECL_PERROR])
|
||||
m4trace:configure.ac:63: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DECL_PERROR])
|
||||
m4trace:configure.ac:63: -1- m4_pattern_allow([^HAVE_DECL_PERROR$])
|
||||
m4trace:configure.ac:64: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SOCKLEN_T])
|
||||
m4trace:configure.ac:64: -1- m4_pattern_allow([^HAVE_SOCKLEN_T$])
|
||||
m4trace:configure.ac:64: -1- AH_OUTPUT([HAVE_SOCKLEN_T], [/* Define to 1 if the system has the type `socklen_t\'. */
|
||||
#undef HAVE_SOCKLEN_T])
|
||||
m4trace:configure.ac:91: -1- AM_CONDITIONAL([BDM_REMOTE], [test x$bdm_remote = xtrue])
|
||||
m4trace:configure.ac:91: -1- AC_SUBST([BDM_REMOTE_TRUE])
|
||||
m4trace:configure.ac:91: -1- AC_SUBST_TRACE([BDM_REMOTE_TRUE])
|
||||
m4trace:configure.ac:91: -1- m4_pattern_allow([^BDM_REMOTE_TRUE$])
|
||||
m4trace:configure.ac:91: -1- AC_SUBST([BDM_REMOTE_FALSE])
|
||||
m4trace:configure.ac:91: -1- AC_SUBST_TRACE([BDM_REMOTE_FALSE])
|
||||
m4trace:configure.ac:91: -1- m4_pattern_allow([^BDM_REMOTE_FALSE$])
|
||||
m4trace:configure.ac:91: -1- _AM_SUBST_NOTMAKE([BDM_REMOTE_TRUE])
|
||||
m4trace:configure.ac:91: -1- _AM_SUBST_NOTMAKE([BDM_REMOTE_FALSE])
|
||||
m4trace:configure.ac:93: -1- AH_OUTPUT([HAVE_IOPERM], [/* Define to 1 if you have the `ioperm\' function. */
|
||||
#undef HAVE_IOPERM])
|
||||
m4trace:configure.ac:132: -1- AM_CONDITIONAL([BDM_IOPERM], [test x$bdm_ioperm = xtrue])
|
||||
m4trace:configure.ac:132: -1- AC_SUBST([BDM_IOPERM_TRUE])
|
||||
m4trace:configure.ac:132: -1- AC_SUBST_TRACE([BDM_IOPERM_TRUE])
|
||||
m4trace:configure.ac:132: -1- m4_pattern_allow([^BDM_IOPERM_TRUE$])
|
||||
m4trace:configure.ac:132: -1- AC_SUBST([BDM_IOPERM_FALSE])
|
||||
m4trace:configure.ac:132: -1- AC_SUBST_TRACE([BDM_IOPERM_FALSE])
|
||||
m4trace:configure.ac:132: -1- m4_pattern_allow([^BDM_IOPERM_FALSE$])
|
||||
m4trace:configure.ac:132: -1- _AM_SUBST_NOTMAKE([BDM_IOPERM_TRUE])
|
||||
m4trace:configure.ac:132: -1- _AM_SUBST_NOTMAKE([BDM_IOPERM_FALSE])
|
||||
m4trace:configure.ac:161: -1- AM_CONDITIONAL([BDM_DRIVER], [test x$bdm_driver = xtrue])
|
||||
m4trace:configure.ac:161: -1- AC_SUBST([BDM_DRIVER_TRUE])
|
||||
m4trace:configure.ac:161: -1- AC_SUBST_TRACE([BDM_DRIVER_TRUE])
|
||||
m4trace:configure.ac:161: -1- m4_pattern_allow([^BDM_DRIVER_TRUE$])
|
||||
m4trace:configure.ac:161: -1- AC_SUBST([BDM_DRIVER_FALSE])
|
||||
m4trace:configure.ac:161: -1- AC_SUBST_TRACE([BDM_DRIVER_FALSE])
|
||||
m4trace:configure.ac:161: -1- m4_pattern_allow([^BDM_DRIVER_FALSE$])
|
||||
m4trace:configure.ac:161: -1- _AM_SUBST_NOTMAKE([BDM_DRIVER_TRUE])
|
||||
m4trace:configure.ac:161: -1- _AM_SUBST_NOTMAKE([BDM_DRIVER_FALSE])
|
||||
m4trace:configure.ac:181: -1- AM_CONDITIONAL([BDMCTRL], [test x$bdm_bdmctrl = xtrue])
|
||||
m4trace:configure.ac:181: -1- AC_SUBST([BDMCTRL_TRUE])
|
||||
m4trace:configure.ac:181: -1- AC_SUBST_TRACE([BDMCTRL_TRUE])
|
||||
m4trace:configure.ac:181: -1- m4_pattern_allow([^BDMCTRL_TRUE$])
|
||||
m4trace:configure.ac:181: -1- AC_SUBST([BDMCTRL_FALSE])
|
||||
m4trace:configure.ac:181: -1- AC_SUBST_TRACE([BDMCTRL_FALSE])
|
||||
m4trace:configure.ac:181: -1- m4_pattern_allow([^BDMCTRL_FALSE$])
|
||||
m4trace:configure.ac:181: -1- _AM_SUBST_NOTMAKE([BDMCTRL_TRUE])
|
||||
m4trace:configure.ac:181: -1- _AM_SUBST_NOTMAKE([BDMCTRL_FALSE])
|
||||
m4trace:configure.ac:192: -1- AM_CONDITIONAL([BDMFLASHLIB], [test x$bdm_flashlib = xtrue])
|
||||
m4trace:configure.ac:192: -1- AC_SUBST([BDMFLASHLIB_TRUE])
|
||||
m4trace:configure.ac:192: -1- AC_SUBST_TRACE([BDMFLASHLIB_TRUE])
|
||||
m4trace:configure.ac:192: -1- m4_pattern_allow([^BDMFLASHLIB_TRUE$])
|
||||
m4trace:configure.ac:192: -1- AC_SUBST([BDMFLASHLIB_FALSE])
|
||||
m4trace:configure.ac:192: -1- AC_SUBST_TRACE([BDMFLASHLIB_FALSE])
|
||||
m4trace:configure.ac:192: -1- m4_pattern_allow([^BDMFLASHLIB_FALSE$])
|
||||
m4trace:configure.ac:192: -1- _AM_SUBST_NOTMAKE([BDMFLASHLIB_TRUE])
|
||||
m4trace:configure.ac:192: -1- _AM_SUBST_NOTMAKE([BDMFLASHLIB_FALSE])
|
||||
m4trace:configure.ac:212: -1- AM_CONDITIONAL([BDMFLASH], [test x$bdm_bdmflash = xtrue])
|
||||
m4trace:configure.ac:212: -1- AC_SUBST([BDMFLASH_TRUE])
|
||||
m4trace:configure.ac:212: -1- AC_SUBST_TRACE([BDMFLASH_TRUE])
|
||||
m4trace:configure.ac:212: -1- m4_pattern_allow([^BDMFLASH_TRUE$])
|
||||
m4trace:configure.ac:212: -1- AC_SUBST([BDMFLASH_FALSE])
|
||||
m4trace:configure.ac:212: -1- AC_SUBST_TRACE([BDMFLASH_FALSE])
|
||||
m4trace:configure.ac:212: -1- m4_pattern_allow([^BDMFLASH_FALSE$])
|
||||
m4trace:configure.ac:212: -1- _AM_SUBST_NOTMAKE([BDMFLASH_TRUE])
|
||||
m4trace:configure.ac:212: -1- _AM_SUBST_NOTMAKE([BDMFLASH_FALSE])
|
||||
m4trace:configure.ac:215: -1- AM_CONDITIONAL([BDMMON], [test x$bdm_bdmmon = xtrue])
|
||||
m4trace:configure.ac:215: -1- AC_SUBST([BDMMON_TRUE])
|
||||
m4trace:configure.ac:215: -1- AC_SUBST_TRACE([BDMMON_TRUE])
|
||||
m4trace:configure.ac:215: -1- m4_pattern_allow([^BDMMON_TRUE$])
|
||||
m4trace:configure.ac:215: -1- AC_SUBST([BDMMON_FALSE])
|
||||
m4trace:configure.ac:215: -1- AC_SUBST_TRACE([BDMMON_FALSE])
|
||||
m4trace:configure.ac:215: -1- m4_pattern_allow([^BDMMON_FALSE$])
|
||||
m4trace:configure.ac:215: -1- _AM_SUBST_NOTMAKE([BDMMON_TRUE])
|
||||
m4trace:configure.ac:215: -1- _AM_SUBST_NOTMAKE([BDMMON_FALSE])
|
||||
m4trace:configure.ac:226: -1- AM_CONDITIONAL([GDBSERVER], [test x$bdm_gdbserver = xtrue])
|
||||
m4trace:configure.ac:226: -1- AC_SUBST([GDBSERVER_TRUE])
|
||||
m4trace:configure.ac:226: -1- AC_SUBST_TRACE([GDBSERVER_TRUE])
|
||||
m4trace:configure.ac:226: -1- m4_pattern_allow([^GDBSERVER_TRUE$])
|
||||
m4trace:configure.ac:226: -1- AC_SUBST([GDBSERVER_FALSE])
|
||||
m4trace:configure.ac:226: -1- AC_SUBST_TRACE([GDBSERVER_FALSE])
|
||||
m4trace:configure.ac:226: -1- m4_pattern_allow([^GDBSERVER_FALSE$])
|
||||
m4trace:configure.ac:226: -1- _AM_SUBST_NOTMAKE([GDBSERVER_TRUE])
|
||||
m4trace:configure.ac:226: -1- _AM_SUBST_NOTMAKE([GDBSERVER_FALSE])
|
||||
m4trace:configure.ac:256: -1- AH_OUTPUT([HAVE_LIBUSB], [/* Define to 1 if you have the `usb\' library (-lusb). */
|
||||
#undef HAVE_LIBUSB])
|
||||
m4trace:configure.ac:256: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBUSB])
|
||||
m4trace:configure.ac:256: -1- m4_pattern_allow([^HAVE_LIBUSB$])
|
||||
m4trace:configure.ac:265: -1- AM_CONDITIONAL([TBLCF_USB], [test x$bdm_tblcf = xtrue])
|
||||
m4trace:configure.ac:265: -1- AC_SUBST([TBLCF_USB_TRUE])
|
||||
m4trace:configure.ac:265: -1- AC_SUBST_TRACE([TBLCF_USB_TRUE])
|
||||
m4trace:configure.ac:265: -1- m4_pattern_allow([^TBLCF_USB_TRUE$])
|
||||
m4trace:configure.ac:265: -1- AC_SUBST([TBLCF_USB_FALSE])
|
||||
m4trace:configure.ac:265: -1- AC_SUBST_TRACE([TBLCF_USB_FALSE])
|
||||
m4trace:configure.ac:265: -1- m4_pattern_allow([^TBLCF_USB_FALSE$])
|
||||
m4trace:configure.ac:265: -1- _AM_SUBST_NOTMAKE([TBLCF_USB_TRUE])
|
||||
m4trace:configure.ac:265: -1- _AM_SUBST_NOTMAKE([TBLCF_USB_FALSE])
|
||||
m4trace:configure.ac:267: -1- AM_CONDITIONAL([LIBUSB_PATH], [test $ac_libusb_include_dir != NONE])
|
||||
m4trace:configure.ac:267: -1- AC_SUBST([LIBUSB_PATH_TRUE])
|
||||
m4trace:configure.ac:267: -1- AC_SUBST_TRACE([LIBUSB_PATH_TRUE])
|
||||
m4trace:configure.ac:267: -1- m4_pattern_allow([^LIBUSB_PATH_TRUE$])
|
||||
m4trace:configure.ac:267: -1- AC_SUBST([LIBUSB_PATH_FALSE])
|
||||
m4trace:configure.ac:267: -1- AC_SUBST_TRACE([LIBUSB_PATH_FALSE])
|
||||
m4trace:configure.ac:267: -1- m4_pattern_allow([^LIBUSB_PATH_FALSE$])
|
||||
m4trace:configure.ac:267: -1- _AM_SUBST_NOTMAKE([LIBUSB_PATH_TRUE])
|
||||
m4trace:configure.ac:267: -1- _AM_SUBST_NOTMAKE([LIBUSB_PATH_FALSE])
|
||||
m4trace:configure.ac:268: -1- AC_SUBST([LIBUSB_INCLUDE_DIR], ["${ac_libusb_include_dir}"])
|
||||
m4trace:configure.ac:268: -1- AC_SUBST_TRACE([LIBUSB_INCLUDE_DIR])
|
||||
m4trace:configure.ac:268: -1- m4_pattern_allow([^LIBUSB_INCLUDE_DIR$])
|
||||
m4trace:configure.ac:269: -1- AC_SUBST([LIBUSB_LIB_DIR], ["${ac_libusb_lib_dir}"])
|
||||
m4trace:configure.ac:269: -1- AC_SUBST_TRACE([LIBUSB_LIB_DIR])
|
||||
m4trace:configure.ac:269: -1- m4_pattern_allow([^LIBUSB_LIB_DIR$])
|
||||
m4trace:configure.ac:286: -1- AM_CONDITIONAL([WIN32], [test x$bdm_win32 = xtrue])
|
||||
m4trace:configure.ac:286: -1- AC_SUBST([WIN32_TRUE])
|
||||
m4trace:configure.ac:286: -1- AC_SUBST_TRACE([WIN32_TRUE])
|
||||
m4trace:configure.ac:286: -1- m4_pattern_allow([^WIN32_TRUE$])
|
||||
m4trace:configure.ac:286: -1- AC_SUBST([WIN32_FALSE])
|
||||
m4trace:configure.ac:286: -1- AC_SUBST_TRACE([WIN32_FALSE])
|
||||
m4trace:configure.ac:286: -1- m4_pattern_allow([^WIN32_FALSE$])
|
||||
m4trace:configure.ac:286: -1- _AM_SUBST_NOTMAKE([WIN32_TRUE])
|
||||
m4trace:configure.ac:286: -1- _AM_SUBST_NOTMAKE([WIN32_FALSE])
|
||||
m4trace:configure.ac:299: -1- AC_SUBST([BDM_SUBDIRS], [${bdm_subdirs}])
|
||||
m4trace:configure.ac:299: -1- AC_SUBST_TRACE([BDM_SUBDIRS])
|
||||
m4trace:configure.ac:299: -1- m4_pattern_allow([^BDM_SUBDIRS$])
|
||||
m4trace:configure.ac:304: -1- AC_CONFIG_SUBDIRS([libelf])
|
||||
m4trace:configure.ac:304: -1- AC_SUBST([subdirs], ["$subdirs m4_normalize([libelf])"])
|
||||
m4trace:configure.ac:304: -1- AC_SUBST_TRACE([subdirs])
|
||||
m4trace:configure.ac:304: -1- m4_pattern_allow([^subdirs$])
|
||||
m4trace:configure.ac:310: -1- AC_SUBST([flash_plugin_cc])
|
||||
m4trace:configure.ac:310: -1- AC_SUBST_TRACE([flash_plugin_cc])
|
||||
m4trace:configure.ac:310: -1- m4_pattern_allow([^flash_plugin_cc$])
|
||||
m4trace:configure.ac:314: -1- AM_CONDITIONAL([BUILD_FLASH_PLUGINS], [test x${flash_plugin_cc} != xnone])
|
||||
m4trace:configure.ac:314: -1- AC_SUBST([BUILD_FLASH_PLUGINS_TRUE])
|
||||
m4trace:configure.ac:314: -1- AC_SUBST_TRACE([BUILD_FLASH_PLUGINS_TRUE])
|
||||
m4trace:configure.ac:314: -1- m4_pattern_allow([^BUILD_FLASH_PLUGINS_TRUE$])
|
||||
m4trace:configure.ac:314: -1- AC_SUBST([BUILD_FLASH_PLUGINS_FALSE])
|
||||
m4trace:configure.ac:314: -1- AC_SUBST_TRACE([BUILD_FLASH_PLUGINS_FALSE])
|
||||
m4trace:configure.ac:314: -1- m4_pattern_allow([^BUILD_FLASH_PLUGINS_FALSE$])
|
||||
m4trace:configure.ac:314: -1- _AM_SUBST_NOTMAKE([BUILD_FLASH_PLUGINS_TRUE])
|
||||
m4trace:configure.ac:314: -1- _AM_SUBST_NOTMAKE([BUILD_FLASH_PLUGINS_FALSE])
|
||||
m4trace:configure.ac:315: -1- AC_SUBST([FLASH_PLUGIN_GCC], [${flash_plugin_cc}])
|
||||
m4trace:configure.ac:315: -1- AC_SUBST_TRACE([FLASH_PLUGIN_GCC])
|
||||
m4trace:configure.ac:315: -1- m4_pattern_allow([^FLASH_PLUGIN_GCC$])
|
||||
m4trace:configure.ac:321: -1- AC_CONFIG_FILES([Makefile \
|
||||
flashlib/Makefile \
|
||||
lib/Makefile \
|
||||
tblcf/Makefile \
|
||||
server/Makefile \
|
||||
gdbserver/Makefile \
|
||||
test/Makefile \
|
||||
bdmabstraction/Makefile \
|
||||
utils/Makefile])
|
||||
m4trace:configure.ac:331: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
|
||||
m4trace:configure.ac:331: -1- AC_SUBST_TRACE([LIB@&t@OBJS])
|
||||
m4trace:configure.ac:331: -1- m4_pattern_allow([^LIB@&t@OBJS$])
|
||||
m4trace:configure.ac:331: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
|
||||
m4trace:configure.ac:331: -1- AC_SUBST_TRACE([LTLIBOBJS])
|
||||
m4trace:configure.ac:331: -1- m4_pattern_allow([^LTLIBOBJS$])
|
||||
m4trace:configure.ac:331: -1- AC_SUBST_TRACE([top_builddir])
|
||||
m4trace:configure.ac:331: -1- AC_SUBST_TRACE([srcdir])
|
||||
m4trace:configure.ac:331: -1- AC_SUBST_TRACE([abs_srcdir])
|
||||
m4trace:configure.ac:331: -1- AC_SUBST_TRACE([top_srcdir])
|
||||
m4trace:configure.ac:331: -1- AC_SUBST_TRACE([abs_top_srcdir])
|
||||
m4trace:configure.ac:331: -1- AC_SUBST_TRACE([builddir])
|
||||
m4trace:configure.ac:331: -1- AC_SUBST_TRACE([abs_builddir])
|
||||
m4trace:configure.ac:331: -1- AC_SUBST_TRACE([abs_top_builddir])
|
||||
m4trace:configure.ac:331: -1- AC_SUBST_TRACE([INSTALL])
|
||||
m4trace:configure.ac:331: -1- AC_SUBST_TRACE([MKDIR_P])
|
||||
5
m68k/bdmabstraction/.cvsignore
Normal file
5
m68k/bdmabstraction/.cvsignore
Normal file
@@ -0,0 +1,5 @@
|
||||
.deps
|
||||
Makefile.in
|
||||
Makefile
|
||||
libbdmabstraction.a
|
||||
*.o
|
||||
70
m68k/bdmabstraction/BDMDriver.h
Normal file
70
m68k/bdmabstraction/BDMDriver.h
Normal file
@@ -0,0 +1,70 @@
|
||||
#ifndef BDMDriver_Included_M
|
||||
#define BDMDriver_Included_M
|
||||
|
||||
/* @#Copyright (c) 2000, Brett Wuth. */
|
||||
/* @#License:
|
||||
* 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, 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; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* File: BDMDriver.h
|
||||
* Purpose: Control which Linux BDM driver is used.
|
||||
* Author: Brett Wuth
|
||||
* Created: 2000-03-27
|
||||
*
|
||||
* Initials:
|
||||
* BCW - Brett Wuth
|
||||
* @#[ContactWuth:
|
||||
* Phone: +1 403 627-2460
|
||||
* E-mail: support@castrov.cuug.ab.ca, wuth@acm.org]
|
||||
*
|
||||
* HISTORY:
|
||||
* $Log: BDMDriver.h,v $
|
||||
* Revision 1.1 2003/12/29 22:18:49 codewiz
|
||||
* Move tools/bdm_abstraction to m68k/bdmabstraction and autoconfiscate.
|
||||
*
|
||||
* Revision 1.1 2003/06/03 15:42:03 codewiz
|
||||
* Import userland tools from bdm-fiedler
|
||||
*
|
||||
* Revision 1.2 2000/04/20 04:56:22 wuth
|
||||
* GPL. Abstract flash interface.
|
||||
*
|
||||
* Revision 1.1 2000/03/28 20:24:41 wuth
|
||||
* Break out flash code into separate executable. Make run under Chris Johns BDM driver.
|
||||
*
|
||||
* @#[BasedOnTemplate: template.h version 2]
|
||||
*/
|
||||
|
||||
#define BDMDriverFiedler_M (1)
|
||||
#define BDMDriverJohns_M (2)
|
||||
|
||||
#define BDMDriverVersion_M BDMDriverJohns_M
|
||||
|
||||
#if BDMDriverVersion_M == BDMDriverFiedler_M
|
||||
#include <bdmcf.h>
|
||||
#define _COMPILING_
|
||||
# include <bdmops.h>
|
||||
#undef _COMPILING_
|
||||
#elif BDMDriverVersion_M == BDMDriverJohns_M
|
||||
#include <BDMlib.h>
|
||||
#else
|
||||
# error "BDMDriverVersion_M not set to known value"
|
||||
#endif
|
||||
|
||||
#endif /* BDMDriver_Included_M */
|
||||
/*** Emacs configuration ***/
|
||||
/* Local Variables: */
|
||||
/* mode:C */
|
||||
/* End: */
|
||||
/*EOF*/
|
||||
323
m68k/bdmabstraction/BDMFlash.c
Normal file
323
m68k/bdmabstraction/BDMFlash.c
Normal file
@@ -0,0 +1,323 @@
|
||||
/* @#Copyright:
|
||||
* Copyright (c) 1999, Rolf Fiedler.
|
||||
* Copyright (c) 1999-2000, Brett Wuth.
|
||||
*/
|
||||
/* @#License:
|
||||
* 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, 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; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* File: BDMFlash.c
|
||||
* Purpose: Flash Driver through BDM
|
||||
* Author: Rolf Fiedler, Brett Wuth
|
||||
* Created: 2000-03-27
|
||||
*
|
||||
* Initials:
|
||||
* BCW - Brett Wuth
|
||||
* @#[ContactWuth:
|
||||
* Phone: +1 403 627-2460
|
||||
* E-mail: support@castrov.cuug.ab.ca, wuth@acm.org]
|
||||
*
|
||||
* HISTORY:
|
||||
* $Log: BDMFlash.c,v $
|
||||
* Revision 1.2 2005/10/24 01:37:25 cjohns
|
||||
* Fixed includes for building in Windows with MinGW.
|
||||
*
|
||||
* Revision 1.1 2003/12/29 22:18:49 codewiz
|
||||
* Move tools/bdm_abstraction to m68k/bdmabstraction and autoconfiscate.
|
||||
*
|
||||
* Revision 1.2 2003/07/04 22:33:01 codewiz
|
||||
* Applied SST block-erase patch.
|
||||
*
|
||||
* Revision 1.1 2003/06/03 15:42:04 codewiz
|
||||
* Import userland tools from bdm-fiedler
|
||||
*
|
||||
* Revision 1.5 2000/08/03 06:29:18 wuth
|
||||
* MultiProject Sync; Support Micron-style flash; Report flash model
|
||||
*
|
||||
* Revision 1.4 2000/07/25 13:51:09 wuth
|
||||
* Working sector erase. Better error reports.
|
||||
*
|
||||
* Revision 1.3 2000/07/14 18:38:55 wuth
|
||||
* Flash error status; Fix sector erase support; Command line sector erase
|
||||
*
|
||||
* Revision 1.2 2000/04/20 04:56:23 wuth
|
||||
* GPL. Abstract flash interface.
|
||||
*
|
||||
* Revision 1.1 2000/03/28 20:24:41 wuth
|
||||
* Break out flash code into separate executable. Make run under Chris Johns BDM driver.
|
||||
*
|
||||
* Based on revision Wuth1 of bdm-fiedler/debug/bdm_abstraction/bdmops.c.
|
||||
* @#[BasedOnTemplate: template.c version 2]
|
||||
*/
|
||||
|
||||
#include <BDMFlash.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <BDMTargetAddress.h>
|
||||
#include <Debug.h>
|
||||
#include <Flash.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h> /* size_t */
|
||||
|
||||
#if defined (__WIN32__) && !defined (__CYGWIN__)
|
||||
#include <winsock.h>
|
||||
#else
|
||||
#include <netinet/in.h> /* ntohl, ntohl */
|
||||
#endif
|
||||
|
||||
typedef struct BDMFlash_s
|
||||
{
|
||||
int Device; /* file descriptor of BDM device */
|
||||
unsigned long Base; /* start of flash in BDM's address space */
|
||||
} BDMFlash_t;
|
||||
|
||||
|
||||
static
|
||||
FlashError_t
|
||||
BDMFlashByteRead( void *UserData, unsigned long Location, unsigned char /*out*/ *Byte )
|
||||
{
|
||||
BDMFlash_t *BDMFlash = (BDMFlash_t *)UserData;
|
||||
int Val;
|
||||
|
||||
if ((Val = BDMTargetByteRead( BDMFlash->Device, BDMFlash->Base + Location )) < 0)
|
||||
return (FlashErrorReadAccess_c);
|
||||
|
||||
*Byte = (unsigned char) Val;
|
||||
return (FlashErrorOkay_c);
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
FlashError_t
|
||||
BDMFlashWordRead( void *UserData, unsigned long Location, unsigned short /*out*/ *Word )
|
||||
{
|
||||
BDMFlash_t *BDMFlash = (BDMFlash_t *)UserData;
|
||||
int Val;
|
||||
|
||||
if ((Val = BDMTargetWordRead( BDMFlash->Device, BDMFlash->Base + Location )) < 0)
|
||||
return (FlashErrorReadAccess_c);
|
||||
|
||||
*Word = (unsigned short) Val;
|
||||
return (FlashErrorOkay_c);
|
||||
}
|
||||
|
||||
|
||||
#if 0 /*BDMTargetLongRead not yet implemented*/
|
||||
static
|
||||
FlashError_t
|
||||
BDMFlashLongRead( void *UserData, unsigned long Location, unsigned long /*out*/ *Long )
|
||||
{
|
||||
BDMFlash_t *BDMFlash = (BDMFlash_t *)UserData;
|
||||
long Val;
|
||||
|
||||
if ((Val = BDMTargetLongRead( BDMFlash->Device, BDMFlash->Base + Location )) < 0)
|
||||
return (FlashErrorRead_c);
|
||||
|
||||
*Long = hlton( (unsigned long) Val );
|
||||
return (FlashErrorOkay_c);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static
|
||||
FlashError_t
|
||||
BDMFlashByteWrite( void *UserData, unsigned long Location, unsigned char Byte )
|
||||
{
|
||||
BDMFlash_t *BDMFlash = (BDMFlash_t *)UserData;
|
||||
|
||||
if (BDMTargetByteWrite( BDMFlash->Device, BDMFlash->Base + Location, Byte ) != 0)
|
||||
return (FlashErrorWriteAccess_c);
|
||||
|
||||
return (FlashErrorOkay_c);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static
|
||||
FlashError_t
|
||||
BDMFlashWordWrite( void *UserData, unsigned long Location, unsigned short Word )
|
||||
{
|
||||
BDMFlash_t *BDMFlash = (BDMFlash_t *)UserData;
|
||||
|
||||
if (BDMTargetWordWrite( BDMFlash->Device, BDMFlash->Base + Location, Word ) != 0)
|
||||
return (FlashErrorWriteAccess_c);
|
||||
return (FlashErrorOkay_c);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static
|
||||
FlashError_t
|
||||
BDMFlashLongWrite( void *UserData, unsigned long Location, unsigned long Long )
|
||||
{
|
||||
BDMFlash_t *BDMFlash = (BDMFlash_t *)UserData;
|
||||
|
||||
if (BDMTargetLongWrite( BDMFlash->Device, BDMFlash->Base + Location, Long ) != 0)
|
||||
return (FlashErrorWriteAccess_c);
|
||||
return (FlashErrorOkay_c);
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
FlashError_t
|
||||
BDMFlashElementRead( void *UserData,
|
||||
unsigned long Location,
|
||||
unsigned int BytesWide, /* what type of read */
|
||||
void /*out*/ *Element )
|
||||
{
|
||||
FlashError_t Error;
|
||||
|
||||
switch (BytesWide)
|
||||
{
|
||||
case 1:
|
||||
Error = BDMFlashByteRead( UserData, Location, Element );
|
||||
break;
|
||||
case 2:
|
||||
Error = BDMFlashWordRead( UserData, Location, Element );
|
||||
|
||||
/* BDM functions give us the number in host-order, but we want
|
||||
* to pass it up in network order because that's the byte order
|
||||
* that the data was originally in as seen under 68K
|
||||
* architecture */
|
||||
*(unsigned short *)Element = htons( *(unsigned short *)Element );
|
||||
break;
|
||||
case 4: /* not yet implemented */
|
||||
default:
|
||||
return (FlashErrorWidth_c);
|
||||
}
|
||||
return (Error);
|
||||
}
|
||||
|
||||
static
|
||||
FlashError_t
|
||||
BDMFlashElementWrite( void *UserData,
|
||||
unsigned long Location,
|
||||
unsigned int BytesWide, /* what type of write */
|
||||
void const *Element )
|
||||
{
|
||||
FlashError_t Error;
|
||||
|
||||
switch (BytesWide)
|
||||
{
|
||||
case 1:
|
||||
Error = BDMFlashByteWrite( UserData, Location, *(unsigned char *)Element );
|
||||
break;
|
||||
case 2:
|
||||
/* We want the value to be written in the same sequence as we
|
||||
* receive it. The writer (the ColdFire/BDM core) uses network
|
||||
* order. Therefore the byte order we're receiving it is also
|
||||
* network order. The BDM functions take values in host order.
|
||||
* Therefore we need to convert from network order to host
|
||||
* order. */
|
||||
Error = BDMFlashWordWrite( UserData, Location, ntohs( *(unsigned short *)Element ) );
|
||||
break;
|
||||
case 4:
|
||||
Error = BDMFlashLongWrite( UserData, Location, ntohl( *(unsigned long *)Element ) );
|
||||
break;
|
||||
default:
|
||||
return (FlashErrorWidth_c);
|
||||
}
|
||||
return (Error);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static Flash_t Flash;
|
||||
static BDMFlash_t BDMFlash;
|
||||
|
||||
/* configure for arrangement of flash */
|
||||
FlashError_t
|
||||
BDMFlashConfigSet( int fd,
|
||||
unsigned int Base,
|
||||
unsigned int Chips,
|
||||
unsigned int Bytes )
|
||||
{
|
||||
FlashError_t Error;
|
||||
|
||||
PRINTD( "Base = %u, Chips = %u, Bytes = %u\n", Base, Chips, Bytes );
|
||||
BDMFlash.Device = fd;
|
||||
BDMFlash.Base = Base;
|
||||
|
||||
Error = FlashInit( &Flash,
|
||||
&BDMFlash,
|
||||
BDMFlashElementRead,
|
||||
BDMFlashElementWrite,
|
||||
Bytes,
|
||||
1, /* BDM in Big-Endian */
|
||||
Chips );
|
||||
return (Error);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* store into flash */
|
||||
FlashError_t
|
||||
BDMFlashWrite( unsigned int addr, unsigned char *mem, size_t count)
|
||||
{
|
||||
return (FlashWrite( &Flash,
|
||||
addr,
|
||||
mem,
|
||||
count ));
|
||||
}
|
||||
|
||||
/* erase flash */
|
||||
FlashError_t
|
||||
BDMFlashErase( void )
|
||||
{
|
||||
return (FlashErase( &Flash ));
|
||||
}
|
||||
|
||||
|
||||
FlashError_t
|
||||
BDMFlashProbe( FlashStyle_t /*out*/ *Style )
|
||||
{
|
||||
*Style = Flash.Style;
|
||||
return (FlashErrorOkay_c);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* erase flash, addr is base of a sector of a byte-wide flash */
|
||||
FlashError_t
|
||||
BDMFlashEraseSector( unsigned int addr )
|
||||
{
|
||||
return (FlashEraseSector( &Flash,
|
||||
addr /* base of sector of byte-wide flash */ ));
|
||||
}
|
||||
|
||||
/* erase flash, addr is base of a block of a byte-wide flash */
|
||||
FlashError_t
|
||||
BDMFlashEraseBlock( unsigned int addr )
|
||||
{
|
||||
return (FlashEraseBlock( &Flash,
|
||||
addr /* base of sector of byte-wide flash */ ));
|
||||
}
|
||||
|
||||
FlashError_t
|
||||
BDMFlashIDRead( FlashID_t /*out*/ *ID )
|
||||
{
|
||||
return (FlashIDRead( &Flash, ID ));
|
||||
}
|
||||
|
||||
FlashError_t
|
||||
BDMFlashDetect( FlashInfo_t const * /*out*/ *FlashInfo )
|
||||
{
|
||||
return (FlashDetect( &Flash, FlashInfo ));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*EOF*/
|
||||
117
m68k/bdmabstraction/BDMFlash.h
Normal file
117
m68k/bdmabstraction/BDMFlash.h
Normal file
@@ -0,0 +1,117 @@
|
||||
#ifndef BDMFlash_Included_M
|
||||
#define BDMFlash_Included_M
|
||||
|
||||
/* @#Copyright (c) 2000, Brett Wuth. */
|
||||
/* @#License:
|
||||
* 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, 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; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* File: BDMFlash.h
|
||||
* Purpose: Flash Driver through BDM
|
||||
* Author: Brett Wuth
|
||||
* Created: 2000-03-27
|
||||
*
|
||||
* Initials:
|
||||
* BCW - Brett Wuth
|
||||
* @#[ContactWuth:
|
||||
* Phone: +1 403 627-2460
|
||||
* E-mail: support@castrov.cuug.ab.ca, wuth@acm.org]
|
||||
*
|
||||
* HISTORY:
|
||||
* $Log: BDMFlash.h,v $
|
||||
* Revision 1.2 2008/06/16 12:57:49 cjohns
|
||||
* 2008-06-16 Chris Johns <cjohns@users.sourceforge.net>
|
||||
*
|
||||
* * packages/.cvsignore, packages/gpl.txt, packages/m68k-bdm.nsi:
|
||||
* New.
|
||||
*
|
||||
* * flashlib/elf-utils.h: Add elf_handle_init decl.
|
||||
*
|
||||
* * utils/Makefile.am: Add warnings flags.
|
||||
*
|
||||
* * bdmabstraction/BDMFlash.h, utils/bdmctrl.c, utils/bdmflash.c:
|
||||
* Fix warnings.
|
||||
*
|
||||
* Revision 1.1 2003/12/29 22:18:49 codewiz
|
||||
* Move tools/bdm_abstraction to m68k/bdmabstraction and autoconfiscate.
|
||||
*
|
||||
* Revision 1.2 2003/07/04 22:33:01 codewiz
|
||||
* Applied SST block-erase patch.
|
||||
*
|
||||
* Revision 1.1 2003/06/03 15:42:04 codewiz
|
||||
* Import userland tools from bdm-fiedler
|
||||
*
|
||||
* Revision 1.5 2000/08/03 06:29:18 wuth
|
||||
* MultiProject Sync; Support Micron-style flash; Report flash model
|
||||
*
|
||||
* Revision 1.4 2000/07/25 13:51:09 wuth
|
||||
* Working sector erase. Better error reports.
|
||||
*
|
||||
* Revision 1.3 2000/07/14 18:38:55 wuth
|
||||
* Flash error status; Fix sector erase support; Command line sector erase
|
||||
*
|
||||
* Revision 1.2 2000/04/20 04:56:23 wuth
|
||||
* GPL. Abstract flash interface.
|
||||
*
|
||||
* Revision 1.1 2000/03/28 20:24:41 wuth
|
||||
* Break out flash code into separate executable. Make run under Chris Johns BDM driver.
|
||||
*
|
||||
* @#[BasedOnTemplate: template.h version 2]
|
||||
*/
|
||||
|
||||
#include <Flash.h>
|
||||
#include <stdlib.h> /* size_t */
|
||||
|
||||
#include <BDMTargetAddress.h>
|
||||
|
||||
/* configure for arrangement of flash */
|
||||
FlashError_t
|
||||
BDMFlashConfigSet( int fd,
|
||||
unsigned int Base,
|
||||
unsigned int Chips,
|
||||
unsigned int Bytes );
|
||||
|
||||
/* store into flash */
|
||||
FlashError_t
|
||||
BDMFlashWrite( unsigned int addr, unsigned char *mem, size_t count);
|
||||
|
||||
/* erase flash */
|
||||
FlashError_t
|
||||
BDMFlashErase( void );
|
||||
|
||||
FlashError_t
|
||||
BDMFlashProbe( FlashStyle_t /*out*/ *Style );
|
||||
|
||||
/* erase flash, addr is base of a sector of a byte-wide flash */
|
||||
FlashError_t
|
||||
BDMFlashEraseSector( unsigned int addr );
|
||||
|
||||
/* erase flash, addr is base of a block of a byte-wide flash */
|
||||
FlashError_t
|
||||
BDMFlashEraseBlock( unsigned int addr );
|
||||
|
||||
FlashError_t
|
||||
BDMFlashIDRead( FlashID_t /*out*/ *ID );
|
||||
|
||||
|
||||
FlashError_t
|
||||
BDMFlashDetect( FlashInfo_t const * /*out*/ *FlashInfo );
|
||||
|
||||
#endif /* BDMFlash_Included_M */
|
||||
/*** Emacs configuration ***/
|
||||
/* Local Variables: */
|
||||
/* mode:C */
|
||||
/* End: */
|
||||
/*EOF*/
|
||||
411
m68k/bdmabstraction/BDMTargetAddress.c
Normal file
411
m68k/bdmabstraction/BDMTargetAddress.c
Normal file
@@ -0,0 +1,411 @@
|
||||
/* @#Copyright:
|
||||
* Copyright (c) 1997, Rolf Fiedler.
|
||||
* Copyright (c) 1999-2000, Brett Wuth.
|
||||
*/
|
||||
/* @#License:
|
||||
* 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, 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; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* File: BDMTargetAddress.c
|
||||
* Purpose: Abstract manipulation of target address space through BDM.
|
||||
* Author: Rolf Fiedler, Brett Wuth
|
||||
* Created: 2000-03-27
|
||||
*
|
||||
* Initials:
|
||||
* BCW - Brett Wuth
|
||||
* @#[ContactWuth:
|
||||
* Phone: +1 403 627-2460
|
||||
* E-mail: support@castrov.cuug.ab.ca, wuth@acm.org]
|
||||
*
|
||||
* HISTORY:
|
||||
* $Log: BDMTargetAddress.c,v $
|
||||
* Revision 1.3 2008/06/16 00:01:21 cjohns
|
||||
* 2008-06-08 Chris Johns <cjohns@users.sourceforge.net>
|
||||
*
|
||||
* * libelf/COPYING.LIB, libelf/ChangeLog, libelf/INSTALL,
|
||||
* libelf/MANIFEST, libelf/Makefile.in, libelf/README,
|
||||
* libelf/VERSION, libelf/acconfig.h, libelf/aclocal.m4,
|
||||
* libelf/config.guess, libelf/config.h.in, libelf/config.sub,
|
||||
* libelf/configure, libelf/configure.in, libelf/install-sh,
|
||||
* libelf/libelf.pc.in, libelf/mkinstalldirs, libelf/stamp-h.in,
|
||||
* libelf/lib/32.fsize.c, libelf/lib/32.getehdr.c,
|
||||
* libelf/lib/32.getphdr.c, libelf/lib/32.getshdr.c,
|
||||
* libelf/lib/32.newehdr.c, libelf/lib/32.newphdr.c,
|
||||
* libelf/lib/32.xlatetof.c, libelf/lib/64.xlatetof.c,
|
||||
* libelf/lib/Makefile.in, libelf/lib/Makefile.w32,
|
||||
* libelf/lib/assert.c, libelf/lib/begin.c, libelf/lib/build.bat,
|
||||
* libelf/lib/byteswap.h, libelf/lib/checksum.c, libelf/lib/cntl.c,
|
||||
* libelf/lib/config.h.w32, libelf/lib/cook.c, libelf/lib/data.c,
|
||||
* libelf/lib/elf_repl.h, libelf/lib/end.c, libelf/lib/errmsg.c,
|
||||
* libelf/lib/errno.c, libelf/lib/errors.h, libelf/lib/ext_types.h,
|
||||
* libelf/lib/fill.c, libelf/lib/flag.c, libelf/lib/gelf.h,
|
||||
* libelf/lib/gelfehdr.c, libelf/lib/gelfphdr.c,
|
||||
* libelf/lib/gelfshdr.c, libelf/lib/gelftrans.c,
|
||||
* libelf/lib/getarhdr.c, libelf/lib/getarsym.c,
|
||||
* libelf/lib/getbase.c, libelf/lib/getdata.c, libelf/lib/getident.c,
|
||||
* libelf/lib/getscn.c, libelf/lib/hash.c, libelf/lib/input.c,
|
||||
* libelf/lib/kind.c, libelf/lib/libelf.def, libelf/lib/libelf.h,
|
||||
* libelf/lib/memset.c, libelf/lib/ndxscn.c, libelf/lib/newdata.c,
|
||||
* libelf/lib/newscn.c, libelf/lib/next.c, libelf/lib/nextscn.c,
|
||||
* libelf/lib/nlist.c, libelf/lib/nlist.h, libelf/lib/opt.delscn.c,
|
||||
* libelf/lib/private.h, libelf/lib/rand.c, libelf/lib/rawdata.c,
|
||||
* libelf/lib/rawfile.c, libelf/lib/strptr.c, libelf/lib/swap64.c,
|
||||
* libelf/lib/sys_elf.h.in, libelf/lib/sys_elf.h.w32,
|
||||
* libelf/lib/update.c, libelf/lib/verdef.h,
|
||||
* libelf/lib/verdef_32_tof.c, libelf/lib/verdef_32_tom.c,
|
||||
* libelf/lib/verdef_64_tof.c, libelf/lib/verdef_64_tom.c,
|
||||
* libelf/lib/verneed.h, libelf/lib/version.c, libelf/lib/x.elfext.c,
|
||||
* libelf/lib/x.movscn.c, libelf/lib/x.remscn.c,
|
||||
* libelf/po/Makefile.in, libelf/po/de.gmo, libelf/po/de.msg,
|
||||
* libelf/po/de.po, libelf/po/gmo2msg.c, libelf/po/libelf.pot,
|
||||
* libelf/po/stamp-po: Merge libelf into the BDM package.
|
||||
*
|
||||
* * configure.ac, utils/Makefile.am, utils/bdmctrl.c,
|
||||
* flashlib/Makefile.am, flashlib/bdmfilt.c, flashlib/bdmfilt.h,
|
||||
* flashlib/bdmflash.c, flashlib/bdmflash.h, flashlib/flash29.c,
|
||||
* flashlib/flash_filter.c, flashlib/flash_filter.h: Remove all BFD
|
||||
* references and change to ELF file support.
|
||||
*
|
||||
* * flashlib/elf-utils.c, flashlib/elf-utils.h: New.
|
||||
*
|
||||
* * driver/bdm.h, driver/bdm-tblcf.c: Add the TBLCF interface
|
||||
* number.
|
||||
*
|
||||
* * bdmabstraction/BDMTargetAddress.c: Add a long write call.
|
||||
*
|
||||
* * gdbserver/Makefile.am: Fix the XML to C regen rule.
|
||||
*
|
||||
* 2008-06-08 Matthew Riek <matthew.riek@ibiscomputer.com.au>
|
||||
*
|
||||
* * flashlib/flashcfm.c, flashlib/flashcfm.h,
|
||||
* flashlib/compile_flashcfm, utils/mcf52235.test.
|
||||
*
|
||||
* Revision 1.2 2005/10/24 01:37:25 cjohns
|
||||
* Fixed includes for building in Windows with MinGW.
|
||||
*
|
||||
* Revision 1.1 2003/12/29 22:18:49 codewiz
|
||||
* Move tools/bdm_abstraction to m68k/bdmabstraction and autoconfiscate.
|
||||
*
|
||||
* Revision 1.1 2003/06/03 15:42:04 codewiz
|
||||
* Import userland tools from bdm-fiedler
|
||||
*
|
||||
* Revision 1.4 2000/09/19 00:28:29 wuth
|
||||
* cleanly use Fiedler's bdm driver; bdm_mon detects flash errors
|
||||
*
|
||||
* Revision 1.3 2000/07/25 13:51:09 wuth
|
||||
* Working sector erase. Better error reports.
|
||||
*
|
||||
* Revision 1.2 2000/04/20 04:56:23 wuth
|
||||
* GPL. Abstract flash interface.
|
||||
*
|
||||
* Revision 1.1 2000/03/28 20:24:41 wuth
|
||||
* Break out flash code into separate executable. Make run under Chris Johns BDM driver.
|
||||
*
|
||||
* Based on revision Wuth1 of bdm-fiedler/debug/bdm_abstraction/bdmops.c.
|
||||
* @#[BasedOnTemplate: template.c version 2]
|
||||
*/
|
||||
|
||||
#include <BDMTargetAddress.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <BDMDriver.h>
|
||||
#include <Debug.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define PRINTDTRACE() PRINTD( __FILE__ "(%d)\n", __LINE__ )
|
||||
|
||||
/* Write byte into target address space through BDM */
|
||||
int /* 0 if success, or error code */
|
||||
BDMTargetByteWrite( int fd, unsigned int addr, unsigned char byte )
|
||||
{
|
||||
#if BDMDriverVersion_M == BDMDriverFiedler_M
|
||||
unsigned long word[5];
|
||||
unsigned long poll;
|
||||
int ret;
|
||||
|
||||
word[0]=BDM_WRITE_CMD | BDM_SIZE_BYTE;
|
||||
word[1]=(addr>>16);
|
||||
word[2]=addr & 0xffff;
|
||||
word[3]=byte;
|
||||
word[4]=BDM_NOP_CMD;
|
||||
ret=bdm_ioctl(fd, BDM_XCHG_DATA_IOC(word), (unsigned long)&word);
|
||||
if(ret<0)
|
||||
{
|
||||
PRINTDTRACE();
|
||||
return ret;
|
||||
}
|
||||
if(word[4]==BDM_BERR) {
|
||||
/* get BDM_NOT_READY after BERR */
|
||||
unsigned long poll;
|
||||
poll = BDM_NOP_CMD;
|
||||
bdm_ioctl(fd, BDM_XCHG_DATA_IOC(poll), (unsigned long)&poll);
|
||||
PRINTDTRACE();
|
||||
return BDM_FAULT_BERR;
|
||||
}
|
||||
if(word[4]==BDM_ILLEGAL)
|
||||
{
|
||||
PRINTDTRACE();
|
||||
return BDM_FAULT_NVC;
|
||||
}
|
||||
poll=word[4];
|
||||
while(poll==BDM_NOTREADY) {
|
||||
poll = BDM_NOP_CMD;
|
||||
ret=bdm_ioctl(fd, BDM_XCHG_DATA_IOC(poll), (unsigned long)&poll);
|
||||
if(ret<0)
|
||||
{
|
||||
PRINTDTRACE();
|
||||
return ret;
|
||||
}
|
||||
if(poll==BDM_BERR) {
|
||||
/* get BDM_NOT_READY after BERR */
|
||||
unsigned long poll;
|
||||
poll = BDM_NOP_CMD;
|
||||
bdm_ioctl(fd, BDM_XCHG_DATA_IOC(poll), (unsigned long)&poll);
|
||||
PRINTDTRACE();
|
||||
return BDM_FAULT_BERR;
|
||||
}
|
||||
if(poll==BDM_ILLEGAL)
|
||||
{
|
||||
PRINTDTRACE();
|
||||
return BDM_FAULT_NVC;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
#else
|
||||
int Ret = bdmWriteByte( addr, byte );
|
||||
if (Ret)
|
||||
PRINTDTRACE();
|
||||
return (Ret);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Write word into target address space through BDM */
|
||||
int /* 0 if success, or error code */
|
||||
BDMTargetWordWrite( int fd, unsigned int addr, unsigned short word )
|
||||
{
|
||||
#if BDMDriverVersion_M == BDMDriverFiedler_M
|
||||
unsigned long words[5];
|
||||
unsigned long poll;
|
||||
int ret;
|
||||
|
||||
words[0]=BDM_WRITE_CMD | BDM_SIZE_WORD;
|
||||
words[1]=(addr>>16);
|
||||
words[2]=addr & 0xffff;
|
||||
words[3]=word;
|
||||
words[4]=BDM_NOP_CMD;
|
||||
ret=bdm_ioctl(fd, BDM_XCHG_DATA_IOC(words), (unsigned long)&words);
|
||||
if(ret<0)
|
||||
{
|
||||
PRINTDTRACE();
|
||||
return ret;
|
||||
}
|
||||
if(words[4]==BDM_BERR) {
|
||||
/* get BDM_NOT_READY after BERR */
|
||||
unsigned long poll;
|
||||
poll = BDM_NOP_CMD;
|
||||
bdm_ioctl(fd, BDM_XCHG_DATA_IOC(poll), (unsigned long)&poll);
|
||||
PRINTDTRACE();
|
||||
return BDM_FAULT_BERR;
|
||||
}
|
||||
if(words[4]==BDM_ILLEGAL)
|
||||
{
|
||||
PRINTDTRACE();
|
||||
return BDM_FAULT_NVC;
|
||||
}
|
||||
poll=words[4];
|
||||
while(poll==BDM_NOTREADY) {
|
||||
poll = BDM_NOP_CMD;
|
||||
ret=bdm_ioctl(fd, BDM_XCHG_DATA_IOC(poll), (unsigned long)&poll);
|
||||
if(ret<0)
|
||||
{
|
||||
PRINTDTRACE();
|
||||
return ret;
|
||||
}
|
||||
if(poll==BDM_BERR) {
|
||||
/* get BDM_NOT_READY after BERR */
|
||||
unsigned long poll;
|
||||
poll = BDM_NOP_CMD;
|
||||
bdm_ioctl(fd, BDM_XCHG_DATA_IOC(poll), (unsigned long)&poll);
|
||||
PRINTDTRACE();
|
||||
return BDM_FAULT_BERR;
|
||||
}
|
||||
if(poll==BDM_ILLEGAL)
|
||||
{
|
||||
PRINTDTRACE();
|
||||
return BDM_FAULT_NVC;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
#else
|
||||
int Ret = bdmWriteWord( addr, word );
|
||||
if (Ret)
|
||||
PRINTDTRACE();
|
||||
return (Ret);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Write long into target address space through BDM */
|
||||
int /* 0 if success, or error code */
|
||||
BDMTargetLongWrite( int fd, unsigned int addr, unsigned long Long )
|
||||
{
|
||||
#if BDMDriverVersion_M == BDMDriverFiedler_M
|
||||
assert( 0 ); /* not implemented */
|
||||
#else
|
||||
int Ret = bdmWriteLongWord( addr, Long );
|
||||
if (Ret)
|
||||
PRINTDTRACE();
|
||||
return (Ret);
|
||||
#endif
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* Read byte into target address space through BDM */
|
||||
int /* <0 if error, else byte */
|
||||
BDMTargetByteRead( int fd, unsigned int addr )
|
||||
{
|
||||
#if BDMDriverVersion_M == BDMDriverFiedler_M
|
||||
unsigned long word[4];
|
||||
unsigned long poll;
|
||||
int ret;
|
||||
|
||||
word[0]=BDM_READ_CMD | BDM_SIZE_BYTE;
|
||||
word[1]=(addr>>16) & 0xffff;
|
||||
word[2]=addr & 0xffff;
|
||||
word[3]=BDM_NOP_CMD;
|
||||
ret=bdm_ioctl(fd, BDM_XCHG_DATA_IOC(word), (unsigned long)&word);
|
||||
if(ret<0)
|
||||
{
|
||||
PRINTDTRACE();
|
||||
return ret;
|
||||
}
|
||||
if(word[3]==BDM_BERR) {
|
||||
/* get BDM_NOT_READY after BERR */
|
||||
unsigned long poll;
|
||||
poll = BDM_NOP_CMD;
|
||||
bdm_ioctl(fd, BDM_XCHG_DATA_IOC(poll), (unsigned long)&poll);
|
||||
PRINTDTRACE();
|
||||
return BDM_FAULT_BERR;
|
||||
}
|
||||
if(word[3]==BDM_ILLEGAL)
|
||||
{
|
||||
PRINTDTRACE();
|
||||
return BDM_FAULT_NVC;
|
||||
}
|
||||
poll=word[3];
|
||||
while(poll==BDM_NOTREADY) {
|
||||
poll = BDM_NOP_CMD;
|
||||
ret=bdm_ioctl(fd, BDM_XCHG_DATA_IOC(poll), (unsigned long)&poll);
|
||||
if(ret<0)
|
||||
{
|
||||
PRINTDTRACE();
|
||||
return ret;
|
||||
}
|
||||
if(poll==BDM_BERR) {
|
||||
/* get BDM_NOT_READY after BERR */
|
||||
unsigned long poll;
|
||||
poll = BDM_NOP_CMD;
|
||||
bdm_ioctl(fd, BDM_XCHG_DATA_IOC(poll), (unsigned long)&poll);
|
||||
PRINTDTRACE();
|
||||
return BDM_FAULT_BERR;
|
||||
}
|
||||
if(poll==BDM_ILLEGAL)
|
||||
{
|
||||
PRINTDTRACE();
|
||||
return BDM_FAULT_NVC;
|
||||
}
|
||||
}
|
||||
return poll & 0xff;
|
||||
#else
|
||||
unsigned char Byte;
|
||||
|
||||
if (bdmReadByte( addr, &Byte ) != 0)
|
||||
{
|
||||
PRINTDTRACE();
|
||||
return (-1);
|
||||
}
|
||||
return Byte;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Read word into target address space through BDM */
|
||||
int /* <0 if error, else word */
|
||||
BDMTargetWordRead( int fd, unsigned int addr )
|
||||
{
|
||||
#if BDMDriverVersion_M == BDMDriverFiedler_M
|
||||
unsigned long words[4];
|
||||
unsigned long poll;
|
||||
int ret;
|
||||
|
||||
words[0]=BDM_READ_CMD | BDM_SIZE_WORD;
|
||||
words[1]=(addr>>16) & 0xffff;
|
||||
words[2]=addr & 0xffff;
|
||||
words[3]=BDM_NOP_CMD;
|
||||
ret=bdm_ioctl(fd, BDM_XCHG_DATA_IOC(words), (unsigned long)&words);
|
||||
if(ret<0)
|
||||
{
|
||||
PRINTDTRACE();
|
||||
return ret;
|
||||
}
|
||||
if(words[3]==BDM_BERR) {
|
||||
/* get BDM_NOT_READY after BERR */
|
||||
unsigned long poll;
|
||||
poll = BDM_NOP_CMD;
|
||||
bdm_ioctl(fd, BDM_XCHG_DATA_IOC(poll), (unsigned long)&poll);
|
||||
PRINTDTRACE();
|
||||
return BDM_FAULT_BERR;
|
||||
}
|
||||
if(words[3]==BDM_ILLEGAL)
|
||||
{
|
||||
PRINTDTRACE();
|
||||
return BDM_FAULT_NVC;
|
||||
}
|
||||
poll=words[3];
|
||||
while(poll==BDM_NOTREADY) {
|
||||
poll = BDM_NOP_CMD;
|
||||
ret=bdm_ioctl(fd, BDM_XCHG_DATA_IOC(poll), (unsigned long)&poll);
|
||||
if(ret<0)
|
||||
{
|
||||
PRINTDTRACE();
|
||||
return ret;
|
||||
}
|
||||
if(poll==BDM_BERR) {
|
||||
/* get BDM_NOT_READY after BERR */
|
||||
unsigned long poll;
|
||||
poll = BDM_NOP_CMD;
|
||||
bdm_ioctl(fd, BDM_XCHG_DATA_IOC(poll), (unsigned long)&poll);
|
||||
PRINTDTRACE();
|
||||
return BDM_FAULT_BERR;
|
||||
}
|
||||
if(poll==BDM_ILLEGAL)
|
||||
{
|
||||
PRINTDTRACE();
|
||||
return BDM_FAULT_NVC;
|
||||
}
|
||||
}
|
||||
return poll & 0xffff;
|
||||
#else
|
||||
unsigned short Word;
|
||||
|
||||
if (bdmReadWord( addr, &Word ) != 0)
|
||||
{
|
||||
PRINTDTRACE();
|
||||
return (-1);
|
||||
}
|
||||
return (Word);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*EOF*/
|
||||
75
m68k/bdmabstraction/BDMTargetAddress.h
Normal file
75
m68k/bdmabstraction/BDMTargetAddress.h
Normal file
@@ -0,0 +1,75 @@
|
||||
#ifndef BDMTargetAddress_Included_M
|
||||
#define BDMTargetAddress_Included_M
|
||||
|
||||
/* @#Copyright (c) 2000, Brett Wuth. */
|
||||
/* @#License:
|
||||
* 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, 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; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* File: BDMTargetAddress.h
|
||||
* Purpose: Abstract manipulation of target address space through BDM.
|
||||
* Author: Brett Wuth
|
||||
* Created: 2000-03-27
|
||||
*
|
||||
* Initials:
|
||||
* BCW - Brett Wuth
|
||||
* @#[ContactWuth:
|
||||
* Phone: +1 403 627-2460
|
||||
* E-mail: support@castrov.cuug.ab.ca, wuth@acm.org]
|
||||
*
|
||||
* HISTORY:
|
||||
* $Log: BDMTargetAddress.h,v $
|
||||
* Revision 1.1 2003/12/29 22:18:49 codewiz
|
||||
* Move tools/bdm_abstraction to m68k/bdmabstraction and autoconfiscate.
|
||||
*
|
||||
* Revision 1.1 2003/06/03 15:42:04 codewiz
|
||||
* Import userland tools from bdm-fiedler
|
||||
*
|
||||
* Revision 1.2 2000/04/20 04:56:23 wuth
|
||||
* GPL. Abstract flash interface.
|
||||
*
|
||||
* Revision 1.1 2000/03/28 20:24:41 wuth
|
||||
* Break out flash code into separate executable. Make run under Chris Johns BDM driver.
|
||||
*
|
||||
* @#[BasedOnTemplate: template.h version 2]
|
||||
*/
|
||||
|
||||
/* Write byte into target address space through BDM */
|
||||
int /* 0 if success, or error code */
|
||||
BDMTargetByteWrite( int fd, unsigned int addr, unsigned char byte );
|
||||
|
||||
/* Write word into target address space through BDM */
|
||||
int /* 0 if success, or error code */
|
||||
BDMTargetWordWrite( int fd, unsigned int addr, unsigned short word );
|
||||
|
||||
/* Write long into target address space through BDM */
|
||||
int /* 0 if success, or error code */
|
||||
BDMTargetLongWrite( int fd, unsigned int addr, unsigned long Long );
|
||||
|
||||
/* Read byte into target address space through BDM */
|
||||
int /* 0 if success, or error code */
|
||||
BDMTargetByteRead( int fd, unsigned int addr );
|
||||
|
||||
/* Read word into target address space through BDM */
|
||||
int /* 0 if success, or error code */
|
||||
BDMTargetWordRead( int fd, unsigned int addr );
|
||||
|
||||
|
||||
#endif /* BDMTargetAddress_Included_M */
|
||||
/*** Emacs configuration ***/
|
||||
/* Local Variables: */
|
||||
/* mode:C */
|
||||
/* End: */
|
||||
/*EOF*/
|
||||
64
m68k/bdmabstraction/Debug.h
Normal file
64
m68k/bdmabstraction/Debug.h
Normal file
@@ -0,0 +1,64 @@
|
||||
#ifndef Debug_Included_M
|
||||
#define Debug_Included_M
|
||||
|
||||
/* @#Copyright (c) 2000, Brett Wuth. */
|
||||
/* @#License:
|
||||
* 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, 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; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* File: Debug.h
|
||||
* Purpose:
|
||||
* Author: Brett Wuth
|
||||
* Created:
|
||||
*
|
||||
* Initials:
|
||||
* BCW - Brett Wuth
|
||||
* @#[ContactWuth:
|
||||
* Phone: +1 403 627-2460
|
||||
* E-mail: support@castrov.cuug.ab.ca, wuth@acm.org]
|
||||
*
|
||||
* HISTORY:
|
||||
* $Log: Debug.h,v $
|
||||
* Revision 1.1 2003/12/29 22:18:49 codewiz
|
||||
* Move tools/bdm_abstraction to m68k/bdmabstraction and autoconfiscate.
|
||||
*
|
||||
* Revision 1.1 2003/06/03 15:42:04 codewiz
|
||||
* Import userland tools from bdm-fiedler
|
||||
*
|
||||
* Revision 1.2 2000/04/20 04:56:23 wuth
|
||||
* GPL. Abstract flash interface.
|
||||
*
|
||||
* Revision 1.1 2000/03/28 20:24:41 wuth
|
||||
* Break out flash code into separate executable. Make run under Chris Johns BDM driver.
|
||||
*
|
||||
* @#[BasedOnTemplate: template.h version 2]
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/* #define DEBUG */
|
||||
|
||||
#ifdef DEBUG
|
||||
#define PRINTD(args...) printf(##args)
|
||||
#else
|
||||
#define PRINTD(args...)
|
||||
#endif
|
||||
|
||||
#endif /* Debug_Included_M */
|
||||
/*** Emacs configuration ***/
|
||||
/* Local Variables: */
|
||||
/* mode:C */
|
||||
/* End: */
|
||||
/*EOF*/
|
||||
1586
m68k/bdmabstraction/Flash.c
Normal file
1586
m68k/bdmabstraction/Flash.c
Normal file
File diff suppressed because it is too large
Load Diff
258
m68k/bdmabstraction/Flash.h
Normal file
258
m68k/bdmabstraction/Flash.h
Normal file
@@ -0,0 +1,258 @@
|
||||
#ifndef Flash_Included_M
|
||||
#define Flash_Included_M
|
||||
|
||||
/* @#Copyright:
|
||||
* Copyright (c) 1999, Rolf Fiedler.
|
||||
* Copyright (c) 1999-2000, Brett Wuth.
|
||||
*/
|
||||
/* @#License:
|
||||
* 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, 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; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* File: Flash.h
|
||||
* Purpose: Algorithm for manipulating flash independent of access
|
||||
* method.
|
||||
* Author: Brett Wuth
|
||||
* Created: 2000-04-15
|
||||
*
|
||||
* Initials:
|
||||
* BCW - Brett Wuth
|
||||
* @#[ContactWuth:
|
||||
* Phone: (403) 627-2460
|
||||
* E-mail: support@castrov.cuug.ab.ca, wuth@acm.org]
|
||||
*
|
||||
* #@[MultiProject:
|
||||
* MultiProject@castrov.cuug.ab.ca Flash Flash.h
|
||||
* MultiProject@castrov.cuug.ab.ca CVSROOT=:ext:wuth@hulk.adomo.com:/home/cvs linux-development/bdm-fiedler debug/bdm_abstraction/Flash.h
|
||||
* MultiProject@castrov.cuug.ab.ca CVSROOT=:ext:wuth@hulk.adomo.com:/home/cvs linux-development/ThinClientFlashWrite Flash.h
|
||||
*
|
||||
* This file is shared among multiple projects. The normal way to so
|
||||
* is to create a separate project and have this project depend on it,
|
||||
* perhaps linking to a library. But for whatever reason this project
|
||||
* requires the file to be included with it.
|
||||
*
|
||||
* To keep your copy of this file in sync with the other copies add
|
||||
* your e-mail address, the project name and file path to the list
|
||||
* above. E-mail a copy of the file to the first address in the list
|
||||
* now and whenever there are changes.]
|
||||
*
|
||||
* HISTORY:
|
||||
* $Log: Flash.h,v $
|
||||
* Revision 1.1 2003/12/29 22:18:49 codewiz
|
||||
* Move tools/bdm_abstraction to m68k/bdmabstraction and autoconfiscate.
|
||||
*
|
||||
* Revision 1.2 2003/07/04 22:33:01 codewiz
|
||||
* Applied SST block-erase patch.
|
||||
*
|
||||
* Revision 1.1 2003/06/03 15:42:04 codewiz
|
||||
* Import userland tools from bdm-fiedler
|
||||
*
|
||||
* Revision 1.4 2000/08/03 06:29:18 wuth
|
||||
* MultiProject Sync; Support Micron-style flash; Report flash model
|
||||
*
|
||||
* Revision 1.3 2000/07/25 13:51:09 wuth
|
||||
* Working sector erase. Better error reports.
|
||||
*
|
||||
* Revision 1.2 2000/07/14 18:38:55 wuth
|
||||
* Flash error status; Fix sector erase support; Command line sector erase
|
||||
*
|
||||
* Revision 1.1 2000/04/20 04:56:23 wuth
|
||||
* GPL. Abstract flash interface.
|
||||
*
|
||||
* @#[BasedOnTemplate: template.h version 2]
|
||||
*/
|
||||
|
||||
#include <stdlib.h> /* size_t */
|
||||
|
||||
typedef enum FlashError_en {
|
||||
FlashErrorOkay_c, /* no error */
|
||||
FlashErrorReadAccess_c, /* can't read flash */
|
||||
FlashErrorWriteAccess_c, /* can't write to flash */
|
||||
|
||||
FlashErrorTimeOut_c, /* flash's internal program timed out */
|
||||
FlashErrorEraseFail_c, /* flash's internal erase program failed */
|
||||
FlashErrorWriteFail_c, /* flash's internal write program failed */
|
||||
FlashErrorProtected_c, /* flash is protected from modification */
|
||||
|
||||
/* flash produced contents that are unexpected */
|
||||
FlashErrorUnexpected_c,
|
||||
|
||||
/* the specified width of the flash is invalid or not supported */
|
||||
FlashErrorWidth_c,
|
||||
|
||||
/* the style of flash is not supported */
|
||||
FlashErrorStyle_c,
|
||||
|
||||
FlashErrorCount_c /* number of Flash Errors */
|
||||
} FlashError_t;
|
||||
|
||||
|
||||
extern char const *FlashErrorDescriptionEnglish[FlashErrorCount_c];
|
||||
|
||||
|
||||
typedef enum FlashStyle_en {
|
||||
FlashStyleUndefined_c,
|
||||
FlashStyleAMD_c,
|
||||
FlashStyleMicron_c,
|
||||
FlashStyleCount_c /* number of Flash Styles */
|
||||
} FlashStyle_t;
|
||||
|
||||
extern char const *FlashStyleName[FlashStyleCount_c];
|
||||
|
||||
|
||||
typedef unsigned short FlashID_t;
|
||||
|
||||
|
||||
typedef enum FlashManufacturer_en {
|
||||
FlashManufacturerAMD_c = 0x01,
|
||||
FlashManufacturerFujitsu_c = 0x04,
|
||||
FlashManufacturerSGSThomson_c = 0x20,
|
||||
FlashManufacturerAtmel_c = 0x1F,
|
||||
FlashManufacturerMicron_c = 0x89,
|
||||
FlashManufacturerTexasInstruments_c = 0x97,
|
||||
FlashManufacturerHyundai_c = 0xAD,
|
||||
FlashManufacturerSST_c = 0xBF,
|
||||
} FlashManufacturer_t;
|
||||
|
||||
|
||||
char const *
|
||||
FlashManufacturerName( FlashManufacturer_t Manufacturer );
|
||||
|
||||
|
||||
typedef
|
||||
FlashError_t
|
||||
(*FlashElementReadFunc_t)( void *UserData,
|
||||
unsigned long Location,
|
||||
unsigned int BytesWide, /* what type of read */
|
||||
void /*out*/ *Element );
|
||||
|
||||
typedef
|
||||
FlashError_t
|
||||
(*FlashElementWriteFunc_t)( void *UserData,
|
||||
unsigned long Location,
|
||||
unsigned int BytesWide, /* what type of write */
|
||||
void const *Element );
|
||||
|
||||
|
||||
/* Parameters passed to flash routines.
|
||||
* This is object-based coding to reduce the proliferation
|
||||
* of arguments passed to each function.
|
||||
*/
|
||||
typedef struct Flash_s {
|
||||
/* Pointer to data which is used by generic Read and Write
|
||||
* functions. The actual data is of a type specific to the
|
||||
* particular functions defined. */
|
||||
void *UserData;
|
||||
|
||||
/* Generic function read a single element out of the array of
|
||||
* interlaced flash chips. The size of an element is defined by
|
||||
* ChipWidthBytes. */
|
||||
FlashElementReadFunc_t Read;
|
||||
|
||||
/* Generic function read a single element out of the array of
|
||||
* interlaced flash chips. The size of an element is defined by
|
||||
* ChipWidthBytes. */
|
||||
FlashElementWriteFunc_t Write;
|
||||
|
||||
/* The number of bytes written or read in a single access */
|
||||
unsigned int ChipWidthBytes;
|
||||
|
||||
/* Whether the hardware accessing the flash is big-endian or
|
||||
* little-endian. This is not necessarily the endianness of the CPU
|
||||
* on which this code is executing, because the generic Read and
|
||||
* Write functions may fetch the data through some other machine.
|
||||
* Such happens when an Intel-based computer manipulates the flash
|
||||
* through a BDM cable connected to a Motorola CPU. The flash
|
||||
* provides status information on the least significant bits. */
|
||||
int/*Bool*/ BigEndian;
|
||||
|
||||
|
||||
/* The number of flash chips of the same type which are interleaved.
|
||||
* For instance, if ChipWidthBytes == 2, one chip may provide bytes
|
||||
* 0, 1, 4, 5, 8, 9, etc. And another chip provides bytes 2, 3, 6,
|
||||
* 7, 10, 11, etc. */
|
||||
unsigned int NumParallelChips;
|
||||
|
||||
/* The general type of the flash. Different styles have radically
|
||||
* different algorithms for burning and erasing. */
|
||||
FlashStyle_t Style;
|
||||
} Flash_t;
|
||||
|
||||
|
||||
/* Initialiaze the Flash structure */
|
||||
FlashError_t
|
||||
FlashInit( Flash_t /*out*/ *Flash,
|
||||
void *UserData,
|
||||
FlashElementReadFunc_t Read,
|
||||
FlashElementWriteFunc_t Write,
|
||||
unsigned int ChipWidthBytes,
|
||||
int/*Bool*/ BigEndian,
|
||||
unsigned int NumParallelChips );
|
||||
|
||||
|
||||
/* store into flash */
|
||||
FlashError_t
|
||||
FlashWrite( Flash_t const *Flash,
|
||||
unsigned long Location,
|
||||
void const *Data,
|
||||
size_t Size /*actual rounded up by ChipWidthBytes*/ );
|
||||
|
||||
/* erase the whole flash */
|
||||
FlashError_t
|
||||
FlashErase( Flash_t const *Flash );
|
||||
|
||||
/* erase one sector of the flash */
|
||||
FlashError_t
|
||||
FlashEraseSector( Flash_t const *Flash,
|
||||
unsigned long OffsetInFlash /* sector identified by offset */ );
|
||||
|
||||
/* erase one block of the flash */
|
||||
FlashError_t
|
||||
FlashEraseBlock( Flash_t const *Flash,
|
||||
unsigned long OffsetInFlash /* sector identified by offset */ );
|
||||
|
||||
typedef struct FlashInfo_s {
|
||||
FlashID_t ID;
|
||||
unsigned long Size;
|
||||
unsigned long loend; /* start of range of sectors all the same size */
|
||||
unsigned long hiend; /* end of range of sectors all the same size */
|
||||
unsigned long sec_size; /* size of sectors which are all the same size */
|
||||
char const *Model;
|
||||
} FlashInfo_t;
|
||||
|
||||
|
||||
|
||||
/*sets Flash->Style */
|
||||
FlashError_t
|
||||
FlashProbe( Flash_t *Flash );
|
||||
|
||||
|
||||
/* leaves flash in Array Read mode */
|
||||
FlashError_t
|
||||
FlashIDRead( Flash_t const *Flash,
|
||||
FlashID_t /*out*/ *ID );
|
||||
|
||||
|
||||
FlashError_t
|
||||
FlashDetect( Flash_t const *Flash,
|
||||
FlashInfo_t const * /*out*/ *FlashInfo );
|
||||
|
||||
|
||||
#endif /* Flash_Included_M */
|
||||
/*** Emacs configuration ***/
|
||||
/* Local Variables: */
|
||||
/* mode:C */
|
||||
/* End: */
|
||||
/*EOF*/
|
||||
29
m68k/bdmabstraction/Makefile.am
Normal file
29
m68k/bdmabstraction/Makefile.am
Normal file
@@ -0,0 +1,29 @@
|
||||
##
|
||||
## $Id: Makefile.am,v 1.3 2004/01/08 20:37:25 codewiz 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$(top_srcdir)/driver -I$(top_srcdir)/lib
|
||||
|
||||
noinst_LIBRARIES = libbdmabstraction.a
|
||||
|
||||
libbdmabstraction_a_SOURCES = \
|
||||
BDMTargetAddress.c \
|
||||
BDMFlash.c \
|
||||
bdmops.c \
|
||||
Flash.c
|
||||
|
||||
noinst_HEADERS = \
|
||||
bdmcf.h \
|
||||
BDMDriver.h \
|
||||
BDMFlash.h \
|
||||
bdmops.h \
|
||||
BDMTargetAddress.h \
|
||||
Debug.h \
|
||||
Flash.h
|
||||
435
m68k/bdmabstraction/Makefile.in
Normal file
435
m68k/bdmabstraction/Makefile.in
Normal file
@@ -0,0 +1,435 @@
|
||||
# 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@
|
||||
subdir = bdmabstraction
|
||||
DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in
|
||||
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 =
|
||||
LIBRARIES = $(noinst_LIBRARIES)
|
||||
ARFLAGS = cru
|
||||
libbdmabstraction_a_AR = $(AR) $(ARFLAGS)
|
||||
libbdmabstraction_a_LIBADD =
|
||||
am_libbdmabstraction_a_OBJECTS = BDMTargetAddress.$(OBJEXT) \
|
||||
BDMFlash.$(OBJEXT) bdmops.$(OBJEXT) Flash.$(OBJEXT)
|
||||
libbdmabstraction_a_OBJECTS = $(am_libbdmabstraction_a_OBJECTS)
|
||||
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 = $(libbdmabstraction_a_SOURCES)
|
||||
DIST_SOURCES = $(libbdmabstraction_a_SOURCES)
|
||||
HEADERS = $(noinst_HEADERS)
|
||||
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@
|
||||
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$(top_srcdir)/driver -I$(top_srcdir)/lib
|
||||
noinst_LIBRARIES = libbdmabstraction.a
|
||||
libbdmabstraction_a_SOURCES = \
|
||||
BDMTargetAddress.c \
|
||||
BDMFlash.c \
|
||||
bdmops.c \
|
||||
Flash.c
|
||||
|
||||
noinst_HEADERS = \
|
||||
bdmcf.h \
|
||||
BDMDriver.h \
|
||||
BDMFlash.h \
|
||||
bdmops.h \
|
||||
BDMTargetAddress.h \
|
||||
Debug.h \
|
||||
Flash.h
|
||||
|
||||
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 bdmabstraction/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign bdmabstraction/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
|
||||
|
||||
clean-noinstLIBRARIES:
|
||||
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||
libbdmabstraction.a: $(libbdmabstraction_a_OBJECTS) $(libbdmabstraction_a_DEPENDENCIES)
|
||||
-rm -f libbdmabstraction.a
|
||||
$(libbdmabstraction_a_AR) libbdmabstraction.a $(libbdmabstraction_a_OBJECTS) $(libbdmabstraction_a_LIBADD)
|
||||
$(RANLIB) libbdmabstraction.a
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BDMFlash.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BDMTargetAddress.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Flash.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bdmops.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 $(LIBRARIES) $(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:
|
||||
$(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-generic clean-noinstLIBRARIES 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-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:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-noinstLIBRARIES ctags distclean distclean-compile \
|
||||
distclean-generic 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 pdf pdf-am ps ps-am tags 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:
|
||||
274
m68k/bdmabstraction/bdmcf.h
Normal file
274
m68k/bdmabstraction/bdmcf.h
Normal file
@@ -0,0 +1,274 @@
|
||||
#ifndef LINUX_BDM_H
|
||||
#define LINUX_BDM_H
|
||||
|
||||
#include <linux/ioctl.h>
|
||||
/*
|
||||
* $Id: bdmcf.h,v 1.1 2003/12/29 22:18:49 codewiz Exp $
|
||||
*
|
||||
* Linux Device Driver for P&E Microcomputer Systems Coldfire Cable
|
||||
* (c) 1997 Rolf Fiedler
|
||||
*
|
||||
* this header file is used to interface to a kernel driver and to
|
||||
* a user-mode lpt driver (using #ifdef USER_MODE)
|
||||
* therefore it contains prototypes of usermode functions
|
||||
*
|
||||
* based on code from and using (roughly) the same API as the
|
||||
*
|
||||
* Linux Device Driver for Public Domain BDM Interface
|
||||
* based on the PD driver package by Scott Howard, Feb 93
|
||||
* ported to Linux by M.Schraut
|
||||
* tested for kernel version 1.2.4
|
||||
* (C) 1995 Technische Universitaet Muenchen, Lehrstuhl fuer Prozessrechner
|
||||
*
|
||||
* 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, 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; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* the interface of the kernel mode driver as of June 10th, 1997
|
||||
*
|
||||
* there are a number of ioctl's for all non-speed-critial bdm operations
|
||||
* these operations allow to reset, restart, stop, step and run the chip,
|
||||
* to exchange data with the bdm interface, and to set the clocking speed
|
||||
* and debug-level.
|
||||
*
|
||||
* the download of code and the reading back of memory are considered
|
||||
* speed critical, due to the fact that download times should be minimized
|
||||
* therefore these two operations are supported by the BDM fill and dump
|
||||
* commands. these commands are issued automatically by read and write
|
||||
* system calls on the bdm driver
|
||||
*/
|
||||
|
||||
#define BDM_MAJOR_NUMBER 30
|
||||
|
||||
/* error codes */
|
||||
#define BDM_FAULT_UNKNOWN -610 /*Error-definitions*/
|
||||
#define BDM_FAULT_POWER -611 /* target has no power */
|
||||
#define BDM_FAULT_CABLE -612 /* target is not connected */
|
||||
#define BDM_FAULT_RESPONSE -613 /* NOT Ready */
|
||||
#define BDM_FAULT_RESET -614 /* target is held in reset */
|
||||
#define BDM_FAULT_PORT -615 /* can not gain permission to access port */
|
||||
#define BDM_FAULT_BERR -616 /* access led to a bus error */
|
||||
#define BDM_FAULT_NVC -617 /* no valid command */
|
||||
|
||||
/* Debug Levels */
|
||||
#define BDM_DEBUG_NONE 0
|
||||
#define BDM_DEBUG_SOME 1
|
||||
#define BDM_DEBUG_ALL 2
|
||||
|
||||
/* supported ioctls */
|
||||
#define BDM_IOCTL_TYPE 0xaa
|
||||
enum BDM_IOCTLS {
|
||||
BDM_INIT, /* no argument */
|
||||
BDM_DEINIT, /* no argument */
|
||||
BDM_RESET_CHIP, /* no argument */
|
||||
BDM_RESTART_CHIP, /* no argument */
|
||||
BDM_STOP_CHIP, /* no argument */
|
||||
BDM_STEP_CHIP, /* no argument */
|
||||
BDM_RUN_CHIP, /* no argument */
|
||||
BDM_GET_STATUS, /* no argument */
|
||||
BDM_XCHG_DATA, /* argument - int[], rw variable size */
|
||||
BDM_DEBUG_LEVEL /* arg = level */
|
||||
};
|
||||
|
||||
#define BDM_INIT_IOC _IO(BDM_IOCTL_TYPE,BDM_INIT)
|
||||
#define BDM_DEINIT_IOC _IO(BDM_IOCTL_TYPE,BDM_DEINIT)
|
||||
#define BDM_RESET_CHIP_IOC _IO(BDM_IOCTL_TYPE,BDM_RESET_CHIP)
|
||||
#define BDM_RESTART_CHIP_IOC _IO(BDM_IOCTL_TYPE,BDM_RESTART_CHIP)
|
||||
#define BDM_STOP_CHIP_IOC _IO(BDM_IOCTL_TYPE,BDM_STOP_CHIP)
|
||||
#define BDM_STEP_CHIP_IOC _IO(BDM_IOCTL_TYPE,BDM_STEP_CHIP)
|
||||
#define BDM_RUN_CHIP_IOC _IO(BDM_IOCTL_TYPE,BDM_RUN_CHIP)
|
||||
#define BDM_GET_STATUS_IOC _IO(BDM_IOCTL_TYPE,BDM_GET_STATUS)
|
||||
#define BDM_XCHG_DATA_IOC(size) _IOWR(BDM_IOCTL_TYPE,BDM_XCHG_DATA,size)
|
||||
#define BDM_DEBUG_LEVEL_IOC _IO(BDM_IOCTL_TYPE,BDM_DEBUG_LEVEL)
|
||||
|
||||
/* return codes of get status (or'ed) */
|
||||
#define BDM_NORETURN 0 /* no error, no ret value */
|
||||
/* functional bits of ioctl BDM_GET_STATUS */
|
||||
#define BDM_TARGETRESET (1<<0) /* Target reset */
|
||||
#define BDM_TARGETHALT (1<<1) /* Target halt */
|
||||
#define BDM_TARGETSTOPPED (1<<2) /* Target (was already) stopped */
|
||||
#define BDM_TARGETPOWER (1<<3) /* Power failed */
|
||||
#define BDM_TARGETNC (1<<4) /* Target not Connected */
|
||||
#define BDM_FROZEN (1<<5) /* Target (was running before)stopped*/
|
||||
|
||||
/* it's determined by hardware from now on */
|
||||
/* command codes for bdm interface */
|
||||
#define BDM_RREG_CMD 0x2180
|
||||
#define BDM_WREG_CMD 0x2080
|
||||
#define BDM_READ_CMD 0x1900
|
||||
#define BDM_WRITE_CMD 0x1800
|
||||
#define BDM_DUMP_CMD 0x1d00
|
||||
#define BDM_FILL_CMD 0x1c00
|
||||
#define BDM_GO_CMD 0x0c00
|
||||
#define BDM_NOP_CMD 0x0000
|
||||
/* coldfire doesn't support BDM_RSREG_CMD/BDM_WSREG_CMD */
|
||||
/* coldfire doesn't support BDM_CALL_CMD/BDM_RTS_CMD */
|
||||
/* added for coldfire */
|
||||
#define BDM_RCREG_CMD 0x2980
|
||||
#define BDM_WCREG_CMD 0x2880
|
||||
#define BDM_RDMREG_CMD 0x2d80
|
||||
#define BDM_WDMREG_CMD 0x2c80
|
||||
|
||||
/* RCREG/WCREG */
|
||||
#define BDM_REG_CACR 0x002
|
||||
#define BDM_REG_ACR0 0x004
|
||||
#define BDM_REG_ACR1 0x005
|
||||
#define BDM_REG_VBR 0x801
|
||||
#define BDM_REG_SR 0x80e
|
||||
#define BDM_REG_RPC 0x80f
|
||||
#define BDM_REG_RAMBAR 0xc04
|
||||
#define BDM_REG_MBAR 0xc0f
|
||||
|
||||
/* RDMREG/WDMREG */
|
||||
#define BDM_REG_CSR 0x0 /* Configuration/Status */
|
||||
#define BDM_REG_RSRVD1 0x1
|
||||
#define BDM_REG_RSRVD2 0x2
|
||||
#define BDM_REG_RSRVD3 0x3
|
||||
#define BDM_REG_RSRVD4 0x4
|
||||
#define BDM_REG_RSRVD5 0x5
|
||||
#define BDM_REG_AATR 0x6 /* Address ATtribute breakpoint Register */
|
||||
#define BDM_REG_TDR 0x7 /* Trigger Definition Register */
|
||||
#define BDM_REG_PBR 0x8 /* Pc Breakpoint Register */
|
||||
#define BDM_REG_PBMR 0x9 /* Pc Breakpoint Mask Register */
|
||||
#define BDM_REG_RSRVD6 0xa
|
||||
#define BDM_REG_RSRVD7 0xb
|
||||
#define BDM_REG_ABHR 0xc /* Address Breakpoint H Register */
|
||||
#define BDM_REG_ABLR 0xd /* Address Breakpoint L Register */
|
||||
#define BDM_REG_DBR 0xe /* Data Breakpoint Register */
|
||||
#define BDM_REG_DBMR 0xf /* Data Breakpoint Mask Register */
|
||||
|
||||
/* system register for RREG/WREG */
|
||||
#define BDM_REG_D0 0x0
|
||||
#define BDM_REG_D1 0x1
|
||||
#define BDM_REG_D2 0x2
|
||||
#define BDM_REG_D3 0x3
|
||||
#define BDM_REG_D4 0x4
|
||||
#define BDM_REG_D5 0x5
|
||||
#define BDM_REG_D6 0x6
|
||||
#define BDM_REG_D7 0x7
|
||||
#define BDM_REG_A0 0x8
|
||||
#define BDM_REG_A1 0x9
|
||||
#define BDM_REG_A2 0xa
|
||||
#define BDM_REG_A3 0xb
|
||||
#define BDM_REG_A4 0xc
|
||||
#define BDM_REG_A5 0xd
|
||||
#define BDM_REG_A6 0xe
|
||||
#define BDM_REG_A7 0xf
|
||||
|
||||
/* op size for READ/WRITE */
|
||||
#define BDM_SIZE_BYTE 0x0000
|
||||
#define BDM_SIZE_WORD 0x0040
|
||||
#define BDM_SIZE_LONG 0x0080
|
||||
|
||||
/* coldfire has trace capability */
|
||||
/* processor status while trace */
|
||||
#define BDM_PST_CONTINUE 0x0
|
||||
#define BDM_PST_BEGIN 0x1
|
||||
#define BDM_PST_RESERVED 0x2
|
||||
#define BDM_PST_USERMODE 0x3
|
||||
#define BDM_PST_PULSE 0x4
|
||||
#define BDM_PST_BRANCH 0x5
|
||||
#define BDM_PST_RESERVED2 0x6
|
||||
#define BDM_PST_RTE 0x7
|
||||
#define BDM_PST_DDATA1 0x8
|
||||
#define BDM_PST_DDATA2 0x9
|
||||
#define BDM_PST_DDATA3 0xa
|
||||
#define BDM_PST_DDATA4 0xb
|
||||
#define BDM_PST_EXCEPTION 0xc
|
||||
#define BDM_PST_EMULATOR 0xd
|
||||
#define BDM_PST_STOPPED 0xe
|
||||
#define BDM_PST_HALTED 0xf
|
||||
|
||||
/* responses from chip */
|
||||
/* bdm messages */
|
||||
#define BDM_VALID 0x00000 /* not a message, but data transfer */
|
||||
#define BDM_COMPLETE 0x0ffff
|
||||
#define BDM_NOTREADY 0x10000
|
||||
#define BDM_BERR 0x10001
|
||||
#define BDM_ILLEGAL 0x1ffff
|
||||
|
||||
/* debug module register definitions */
|
||||
/* AATR */
|
||||
#define BDM_AATR_RM (1<<15) /* Read/Write mask */
|
||||
#define BDM_AATR_SZM (3<<13) /* SiZe Mask */
|
||||
#define BDM_AATR_TTM (3<<11) /* Transfer Type Mask */
|
||||
#define BDM_AATR_TMM (7<<8) /* Transfer Modifier Mask */
|
||||
#define BDM_AATR_R (1<<7) /* Read/write */
|
||||
#define BDM_AATR_SZ (3<<5) /* SiZe */
|
||||
#define BDM_AATR_TT (3<<3) /* Tranfer Type */
|
||||
#define BDM_AATR_TM (7<<0) /* Transfer Modifier */
|
||||
/* TDR */
|
||||
#define BDM_TDR_TRC (3<<30) /* Trigger Response Control */
|
||||
#define BDM_TDR_TRC_DATA (0<<30) /* Trigger Response Control */
|
||||
#define BDM_TDR_TRC_HALT (1<<30) /* Trigger Response Control */
|
||||
#define BDM_TDR_TRC_DEBG (2<<30) /* Trigger Response Control */
|
||||
#define BDM_TDR_EBL2 (1<<29) /* Enable Breakpoint Level */
|
||||
#define BDM_TDR_EDLW2 (1<<28) /* Enable Data BP for LongWord */
|
||||
#define BDM_TDR_EDWL2 (1<<27) /* Enable Data BP for Word (Upper) */
|
||||
#define BDM_TDR_EDWU2 (1<<26) /* Enable Data BP for Word (Lower) */
|
||||
#define BDM_TDR_EDLL2 (1<<25) /* Enable Data BP for byte (LL) */
|
||||
#define BDM_TDR_EDLM2 (1<<24) /* Enable Data BP for byte (LM) */
|
||||
#define BDM_TDR_EDUM2 (1<<23) /* Enable Data BP for byte (UM) */
|
||||
#define BDM_TDR_EDUU2 (1<<22) /* Enable Data BP for byte (UU) */
|
||||
#define BDM_TDR_DI2 (1<<21) /* Data breakpoint invert */
|
||||
#define BDM_TDR_EAI2 (1<<20) /* Enable Address breakpoint inverted */
|
||||
#define BDM_TDR_EAR2 (1<<19) /* Enable Address breakpoint Range */
|
||||
#define BDM_TDR_EAL2 (1<<18) /* Enable Address breakpoint Low */
|
||||
#define BDM_TDR_EPC2 (1<<17) /* Enable PC breakpoint */
|
||||
#define BDM_TDR_PCI2 (1<<16) /* PC breakpoint Invert */
|
||||
#define BDM_TDR_EBL1 (1<<13) /* Enable Breakpoint Level */
|
||||
#define BDM_TDR_EDLW1 (1<<12) /* Enable Data BP for LongWord */
|
||||
#define BDM_TDR_EDWL1 (1<<11) /* Enable Data BP for Word (Upper) */
|
||||
#define BDM_TDR_EDWU1 (1<<10) /* Enable Data BP for Word (Lower) */
|
||||
#define BDM_TDR_EDLL1 (1<<9) /* Enable Data BP for byte (LL) */
|
||||
#define BDM_TDR_EDLM1 (1<<8) /* Enable Data BP for byte (LM) */
|
||||
#define BDM_TDR_EDUM1 (1<<7) /* Enable Data BP for byte (UM) */
|
||||
#define BDM_TDR_EDUU1 (1<<6) /* Enable Data BP for byte (UU) */
|
||||
#define BDM_TDR_DI1 (1<<5) /* Data breakpoint invert */
|
||||
#define BDM_TDR_EAI1 (1<<4) /* Enable Address breakpoint inverted */
|
||||
#define BDM_TDR_EAR1 (1<<3) /* Enable Address breakpoint Range */
|
||||
#define BDM_TDR_EAL1 (1<<2) /* Enable Address breakpoint Low */
|
||||
#define BDM_TDR_EPC1 (1<<1) /* Enable PC breakpoint */
|
||||
#define BDM_TDR_PCI1 (1<<0) /* PC breakpoint Invert */
|
||||
/* CSR */
|
||||
#define BDM_CSR_STATUS (15<<28) /* breakpoint status */
|
||||
# define BDM_CSR_STAT_NOBP 0
|
||||
# define BDM_CSR_STAT_WAIT1 1
|
||||
# define BDM_CSR_STAT_TRIGG1 2
|
||||
# define BDM_CSR_STAT_WAIT2 5
|
||||
# define BDM_CSR_STAT_TRIGG2 6
|
||||
#define BDM_CSR_FOF (1<<27) /* Fault-On-Fault */
|
||||
#define BDM_CSR_TRG (1<<26) /* hardware breakpoint TRiGger */
|
||||
#define BDM_CSR_HALT (1<<25) /* processor HALT */
|
||||
#define BDM_CSR_BKPT (1<<24) /* BreaKPoinT assert */
|
||||
#define BDM_CSR_IPW (1<<16) /* Inhibit Processor Writes to dbg reg. */
|
||||
#define BDM_CSR_MAP (1<<15) /* MAP processor accesses in emu mode */
|
||||
#define BDM_CSR_TRC (1<<14) /* emulation mode on TRaCe exception */
|
||||
#define BDM_CSR_EMU (1<<13) /* force EMUlation mode */
|
||||
#define BDM_CSR_DDC (3<<11) /* Debug Data Control */
|
||||
#define BDM_CSR_UHE (1<<10) /* User Halt Enable */
|
||||
#define BDM_CSR_BTB (3<<8) /* Branch Target Bytes */
|
||||
#define BDM_CSR_NPL (1<<6) /* NonPipelined Mode */
|
||||
#define BDM_CSR_IPI (1<<5) /* Ignore Pending Interrupts */
|
||||
#define BDM_CSR_SSM (1<<4) /* Single Step Mode */
|
||||
|
||||
#ifdef USERMODE
|
||||
int bdm_open(int minor, int flags);
|
||||
int bdm_ioctl(int minor, unsigned int request, unsigned long arg);
|
||||
int bdm_read(int minor, unsigned char *p, int count);
|
||||
int bdm_write(int minor, const unsigned char *p, int count);
|
||||
void bdm_close(int minor);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
792
m68k/bdmabstraction/bdmops.c
Normal file
792
m68k/bdmabstraction/bdmops.c
Normal file
@@ -0,0 +1,792 @@
|
||||
/* @#Copyright
|
||||
* Copyright (c) 1997, Rolf Fiedler.
|
||||
* Copyright (c) 1999-2000, Brett Wuth.
|
||||
*/
|
||||
/* @#License:
|
||||
* 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, 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; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* File: bdmops.c (BDM Operations)
|
||||
* Purpose:
|
||||
* Author: Rolf Fiedler
|
||||
* Created:
|
||||
*
|
||||
* Initials:
|
||||
* BCW - Brett Wuth
|
||||
* @#[ContactWuth:
|
||||
* Phone: +1 403 627-2460
|
||||
* E-mail: support@castrov.cuug.ab.ca, wuth@acm.org]
|
||||
*
|
||||
* this is an abstraction layer to have a general target programming interface
|
||||
* so the programmer doesn't have to bother with motorola's bdm commands.
|
||||
*
|
||||
* applications only include bdmops.h and call the functions below
|
||||
*
|
||||
* HISTORY:
|
||||
* $Log: bdmops.c,v $
|
||||
* Revision 1.2 2005/10/24 01:37:25 cjohns
|
||||
* Fixed includes for building in Windows with MinGW.
|
||||
*
|
||||
* Revision 1.1 2003/12/29 22:18:49 codewiz
|
||||
* Move tools/bdm_abstraction to m68k/bdmabstraction and autoconfiscate.
|
||||
*
|
||||
* Revision 1.2 2003/07/04 22:33:01 codewiz
|
||||
* Applied SST block-erase patch.
|
||||
*
|
||||
* Revision 1.1 2003/06/03 15:42:04 codewiz
|
||||
* Import userland tools from bdm-fiedler
|
||||
*
|
||||
* Revision 1.6 2000/09/19 00:28:29 wuth
|
||||
* cleanly use Fiedler's bdm driver; bdm_mon detects flash errors
|
||||
*
|
||||
* Revision 1.5 2000/07/25 13:51:09 wuth
|
||||
* Working sector erase. Better error reports.
|
||||
*
|
||||
* Revision 1.4 2000/04/20 04:56:23 wuth
|
||||
* GPL. Abstract flash interface.
|
||||
*
|
||||
* Revision 1.3 2000/03/28 20:24:41 wuth
|
||||
* Break out flash code into separate executable. Make run under Chris Johns BDM driver.
|
||||
*
|
||||
* Revision 1.2 1999/07/05 22:09:50 wuth
|
||||
* Abort if can't sync BDM. Work with Am29F800 flash.
|
||||
* @#[BasedOnTemplate: template.c version 2]
|
||||
*/
|
||||
|
||||
#define _COMPILING_
|
||||
# include "bdmops.h"
|
||||
#undef _COMPILING_
|
||||
|
||||
#include <assert.h>
|
||||
#include "BDMDriver.h"
|
||||
#include "Debug.h"
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#if defined (__WIN32__) && !defined (__CYGWIN__)
|
||||
#include <winsock.h>
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* query status
|
||||
*/
|
||||
static unsigned long target_status=0;
|
||||
|
||||
#if BDMDriverVersion_M == BDMDriverFiedler_M
|
||||
static int fd;
|
||||
|
||||
static void bdm_update_status(unsigned long x)
|
||||
{
|
||||
x &= CSR_FOF | CSR_TRG | CSR_HALT | CSR_BKPT; /* these bits ain't sticky */
|
||||
target_status |= x;
|
||||
}
|
||||
|
||||
static int bdm_read_status(void)
|
||||
{
|
||||
unsigned long x;
|
||||
|
||||
if(bdm_read_reg(REG_CSR, &x)) return -1;
|
||||
bdm_update_status(x);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* general file handling
|
||||
*/
|
||||
/* open bdm-driver */
|
||||
int /* <0 if error, BDMHandle otherwise */
|
||||
bdm_init(const char *path)
|
||||
{
|
||||
#if BDMDriverVersion_M == BDMDriverFiedler_M
|
||||
unsigned long tdr, csr;
|
||||
|
||||
#ifdef USERMODE
|
||||
fd=path[strlen(path)-1]-'0'; /* this is so ugly! works with /dev/bdm[0-9]*/
|
||||
if(fd>3 || fd<0) return -1;
|
||||
fd=bdm_open(fd, O_RDWR);
|
||||
if(fd<0) return fd;
|
||||
#else
|
||||
fd=bdm_open(path, O_RDWR);
|
||||
if(fd<0) return fd;
|
||||
#endif
|
||||
bdm_clear_status();
|
||||
tdr = BDM_TDR_TRC_HALT; /* trigger response is halt */
|
||||
if(bdm_write_reg(REG_TDR, &tdr)) return -1;
|
||||
csr = BDM_CSR_UHE; /* user halt enable */
|
||||
if(bdm_write_reg(REG_CSR, &csr)) return -1;
|
||||
return fd;
|
||||
#else
|
||||
int fd=bdmOpen( path );
|
||||
return (fd);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* close driver */
|
||||
void bdm_release(int port)
|
||||
{
|
||||
#if BDMDriverVersion_M == BDMDriverFiedler_M
|
||||
bdm_close(fd);
|
||||
#else
|
||||
bdmClose();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* bdm control functions
|
||||
*/
|
||||
/* bring chip to running state */
|
||||
void bdm_run(void)
|
||||
{
|
||||
#if BDMDriverVersion_M == BDMDriverFiedler_M
|
||||
bdm_ioctl(fd, BDM_RUN_CHIP_IOC, 0);
|
||||
bdm_clear_status();
|
||||
#else
|
||||
/* not implemented */
|
||||
#endif
|
||||
}
|
||||
|
||||
/* bring chip to stopped state */
|
||||
void bdm_stop(void)
|
||||
{
|
||||
#if BDMDriverVersion_M == BDMDriverFiedler_M
|
||||
bdm_ioctl(fd, BDM_STOP_CHIP_IOC, 0);
|
||||
bdm_read_status();
|
||||
#else
|
||||
/* not implemented */
|
||||
#endif
|
||||
}
|
||||
|
||||
/* step chip on instruction */
|
||||
void bdm_step(void)
|
||||
{
|
||||
#if BDMDriverVersion_M == BDMDriverFiedler_M
|
||||
bdm_ioctl(fd, BDM_STEP_CHIP_IOC, 0);
|
||||
bdm_read_status();
|
||||
#else
|
||||
/* not implemented */
|
||||
#endif
|
||||
}
|
||||
|
||||
/* reset chip and hold in reset state */
|
||||
void bdm_reset(void)
|
||||
{
|
||||
#if BDMDriverVersion_M == BDMDriverFiedler_M
|
||||
bdm_ioctl(fd, BDM_RESET_CHIP_IOC, 0);
|
||||
bdm_clear_status();
|
||||
bdm_read_status();
|
||||
#else
|
||||
/* not implemented */
|
||||
#endif
|
||||
}
|
||||
|
||||
/* restart from reset to running state */
|
||||
void bdm_restart(void)
|
||||
{
|
||||
#if BDMDriverVersion_M == BDMDriverFiedler_M
|
||||
bdm_ioctl(fd, BDM_RESTART_CHIP_IOC, 0);
|
||||
bdm_read_status();
|
||||
#else
|
||||
/* not implemented */
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* data transfer to/from target
|
||||
*/
|
||||
int regs_log2phys(CF_REGS which)
|
||||
{
|
||||
int i;
|
||||
struct regs {
|
||||
int logical;
|
||||
int physical;
|
||||
} regs[]= {
|
||||
{REG_D0, BDM_REG_D0},
|
||||
{REG_D1, BDM_REG_D1},
|
||||
{REG_D2, BDM_REG_D2},
|
||||
{REG_D3, BDM_REG_D3},
|
||||
{REG_D4, BDM_REG_D4},
|
||||
{REG_D5, BDM_REG_D5},
|
||||
{REG_D6, BDM_REG_D6},
|
||||
{REG_D7, BDM_REG_D7},
|
||||
{REG_A0, BDM_REG_A0},
|
||||
{REG_A1, BDM_REG_A1},
|
||||
{REG_A2, BDM_REG_A2},
|
||||
{REG_A3, BDM_REG_A3},
|
||||
{REG_A4, BDM_REG_A4},
|
||||
{REG_A5, BDM_REG_A5},
|
||||
{REG_A6, BDM_REG_A6},
|
||||
{REG_A7, BDM_REG_A7},
|
||||
/* debug registers */
|
||||
{REG_CSR, BDM_REG_CSR},
|
||||
{REG_AATR, BDM_REG_AATR},
|
||||
{REG_TDR, BDM_REG_TDR},
|
||||
{REG_PBR, BDM_REG_PBR},
|
||||
{REG_PBMR, BDM_REG_PBMR},
|
||||
{REG_ABHR, BDM_REG_ABHR},
|
||||
{REG_ABLR, BDM_REG_ABLR},
|
||||
{REG_DBR, BDM_REG_DBR},
|
||||
{REG_DBMR, BDM_REG_DBMR},
|
||||
/* configuration registers */
|
||||
{REG_CACR, BDM_REG_CACR},
|
||||
{REG_ACR0, BDM_REG_ACR0},
|
||||
{REG_ACR1, BDM_REG_ACR1},
|
||||
{REG_VBR, BDM_REG_VBR},
|
||||
{REG_SR, BDM_REG_SR},
|
||||
{REG_RPC, BDM_REG_RPC},
|
||||
{REG_RAMBAR, BDM_REG_RAMBAR},
|
||||
{REG_MBAR, BDM_REG_MBAR},
|
||||
{0xffff,0}
|
||||
};
|
||||
for(i=0; regs[i].logical!=0xffff; i++) {
|
||||
if(regs[i].logical == which) return regs[i].physical;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/* read a register from the chip */
|
||||
int bdm_read_reg(CF_REGS which, unsigned long *value)
|
||||
{
|
||||
#if BDMDriverVersion_M == BDMDriverFiedler_M
|
||||
int i;
|
||||
|
||||
if(which <= MAX_USER_REGS) {
|
||||
unsigned long word[3];
|
||||
which=regs_log2phys(which);
|
||||
word[0]=BDM_RREG_CMD | which;
|
||||
word[1]=BDM_NOP_CMD;
|
||||
word[2]=BDM_NOP_CMD;
|
||||
i=bdm_ioctl(fd, BDM_XCHG_DATA_IOC(word), (unsigned long)&word);
|
||||
if(i<0)
|
||||
return i;
|
||||
if(word[1]==BDM_BERR) {
|
||||
/* get BDM_NOT_READY after BERR */
|
||||
unsigned long poll;
|
||||
poll = BDM_NOP_CMD;
|
||||
bdm_ioctl(fd, BDM_XCHG_DATA_IOC(poll), (unsigned long)&poll);
|
||||
return -1;
|
||||
}
|
||||
*value = ((word[1] & 0xffff) << 16) | (word[2] & 0xffff);
|
||||
return 0;
|
||||
}
|
||||
if(which <= MAX_CONFIG_REGS) {
|
||||
unsigned long word[5];
|
||||
which=regs_log2phys(which);
|
||||
word[0]=BDM_RCREG_CMD;
|
||||
word[1]=0;
|
||||
word[2]=which;
|
||||
word[3]=BDM_NOP_CMD;
|
||||
word[4]=BDM_NOP_CMD;
|
||||
i=bdm_ioctl(fd, BDM_XCHG_DATA_IOC(word), (unsigned long)&word);
|
||||
if(i<0)
|
||||
return i;
|
||||
if(word[4]==BDM_BERR) {
|
||||
/* get BDM_NOT_READY after BERR */
|
||||
unsigned long poll;
|
||||
poll = BDM_NOP_CMD;
|
||||
bdm_ioctl(fd, BDM_XCHG_DATA_IOC(poll), (unsigned long)&poll);
|
||||
return -1;
|
||||
}
|
||||
word[0]=word[4];
|
||||
while(word[0]==BDM_NOTREADY) {
|
||||
unsigned long poll = BDM_NOP_CMD;
|
||||
i=bdm_ioctl(fd, BDM_XCHG_DATA_IOC(poll), (unsigned long)&poll);
|
||||
if(i<0)
|
||||
return i;
|
||||
if(poll==BDM_BERR) {
|
||||
/* get BDM_NOT_READY after BERR */
|
||||
unsigned long poll;
|
||||
poll = BDM_NOP_CMD;
|
||||
bdm_ioctl(fd, BDM_XCHG_DATA_IOC(poll), (unsigned long)&poll);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
*value = ((word[3] & 0xffff) << 16) | (word[4] & 0xffff);
|
||||
return 0;
|
||||
}
|
||||
if(which <= MAX_DEBUG_REGS) {
|
||||
unsigned long word[3];
|
||||
which=regs_log2phys(which);
|
||||
word[0]=BDM_RDMREG_CMD | which;
|
||||
word[1]=BDM_NOP_CMD;
|
||||
word[2]=BDM_NOP_CMD;
|
||||
i=bdm_ioctl(fd, BDM_XCHG_DATA_IOC(word), (unsigned long)&word);
|
||||
if(i<0)
|
||||
return i;
|
||||
if(word[1]==BDM_ILLEGAL)
|
||||
return -1;
|
||||
*value = ((word[1] & 0xffff) << 16) | (word[2] & 0xffff);
|
||||
if(which == REG_CSR) {
|
||||
bdm_update_status(*value);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
#else
|
||||
/* not implemented */
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* write a register in the chip */
|
||||
int bdm_write_reg(CF_REGS which, unsigned long *value)
|
||||
{
|
||||
#if BDMDriverVersion_M == BDMDriverFiedler_M
|
||||
int i;
|
||||
|
||||
if(which <= MAX_USER_REGS) {
|
||||
unsigned long word[4];
|
||||
which=regs_log2phys(which);
|
||||
word[0]=BDM_WREG_CMD | which;
|
||||
word[1]=(*value >> 16) & 0xffff;
|
||||
word[2]=*value & 0xffff;
|
||||
word[3]=BDM_NOP_CMD;
|
||||
i=bdm_ioctl(fd, BDM_XCHG_DATA_IOC(word), (unsigned long)&word);
|
||||
if(i<0)
|
||||
return i;
|
||||
if(word[1]==BDM_BERR) {
|
||||
/* get BDM_NOT_READY after BERR */
|
||||
unsigned long poll;
|
||||
poll = BDM_NOP_CMD;
|
||||
bdm_ioctl(fd, BDM_XCHG_DATA_IOC(poll), (unsigned long)&poll);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
if(which <= MAX_CONFIG_REGS) {
|
||||
unsigned long word[6];
|
||||
which=regs_log2phys(which);
|
||||
word[0]=BDM_WCREG_CMD;
|
||||
word[1]=0;
|
||||
word[2]=which;
|
||||
word[3]=(*value >> 16) & 0xffff;
|
||||
word[4]=*value & 0xffff;
|
||||
word[5]=BDM_NOP_CMD;
|
||||
i=bdm_ioctl(fd, BDM_XCHG_DATA_IOC(word), (unsigned long)&word);
|
||||
if(i<0)
|
||||
return i;
|
||||
if(word[5]==BDM_BERR) {
|
||||
/* get BDM_NOT_READY after BERR */
|
||||
unsigned long poll;
|
||||
poll = BDM_NOP_CMD;
|
||||
bdm_ioctl(fd, BDM_XCHG_DATA_IOC(poll), (unsigned long)&poll);
|
||||
return -1;
|
||||
}
|
||||
word[0]=word[5];
|
||||
while(word[0]==BDM_NOTREADY) {
|
||||
unsigned long poll = BDM_NOP_CMD;
|
||||
i=bdm_ioctl(fd, BDM_XCHG_DATA_IOC(poll), (unsigned long)&poll);
|
||||
if(i<0)
|
||||
return i;
|
||||
if(poll==BDM_BERR) {
|
||||
/* get BDM_NOT_READY after BERR */
|
||||
unsigned long poll;
|
||||
poll = BDM_NOP_CMD;
|
||||
bdm_ioctl(fd, BDM_XCHG_DATA_IOC(poll), (unsigned long)&poll);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
if(which <= MAX_DEBUG_REGS) {
|
||||
unsigned long word[4];
|
||||
which=regs_log2phys(which);
|
||||
word[0]=BDM_WDMREG_CMD | which;
|
||||
word[1]=(*value >> 16) & 0xffff;
|
||||
word[2]=*value & 0xffff;
|
||||
word[3]=BDM_NOP_CMD;
|
||||
i=bdm_ioctl(fd, BDM_XCHG_DATA_IOC(word), (unsigned long)&word);
|
||||
if(i<0)
|
||||
return i;
|
||||
if(word[1]==BDM_ILLEGAL)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
#else
|
||||
/* not implemented */
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* read a block of memory, alignment doesn't matter anymore */
|
||||
int bdm_read_mem(unsigned int addr, unsigned char *mem, int count)
|
||||
{
|
||||
#if BDMDriverVersion_M == BDMDriverFiedler_M
|
||||
unsigned long word[4], poll;
|
||||
int read_bytes=0, ret;
|
||||
int i;
|
||||
|
||||
if(!count) return 0;
|
||||
|
||||
/* align to long word boundary from target's point of view */
|
||||
i=4-(addr&3);
|
||||
for(; i>0 && count>0; i--) {
|
||||
word[0]=BDM_READ_CMD | BDM_SIZE_BYTE;
|
||||
word[1]=(addr>>16) & 0xffff;
|
||||
word[2]=addr & 0xffff;
|
||||
word[3]=BDM_NOP_CMD;
|
||||
ret=bdm_ioctl(fd, BDM_XCHG_DATA_IOC(word), (unsigned long)&word);
|
||||
if(ret<0)
|
||||
return ret;
|
||||
if(word[3]==BDM_BERR) {
|
||||
/* get BDM_NOT_READY after BERR */
|
||||
unsigned long poll;
|
||||
poll = BDM_NOP_CMD;
|
||||
bdm_ioctl(fd, BDM_XCHG_DATA_IOC(poll), (unsigned long)&poll);
|
||||
return BDM_FAULT_BERR;
|
||||
}
|
||||
if(word[3]==BDM_ILLEGAL)
|
||||
return BDM_FAULT_NVC;
|
||||
poll=word[3];
|
||||
while(poll==BDM_NOTREADY) {
|
||||
poll = BDM_NOP_CMD;
|
||||
ret=bdm_ioctl(fd, BDM_XCHG_DATA_IOC(poll), (unsigned long)&poll);
|
||||
if(ret<0)
|
||||
return ret;
|
||||
if(poll==BDM_BERR) {
|
||||
/* get BDM_NOT_READY after BERR */
|
||||
unsigned long poll;
|
||||
poll = BDM_NOP_CMD;
|
||||
bdm_ioctl(fd, BDM_XCHG_DATA_IOC(poll), (unsigned long)&poll);
|
||||
return BDM_FAULT_BERR;
|
||||
}
|
||||
if(poll==BDM_ILLEGAL)
|
||||
return BDM_FAULT_NVC;
|
||||
}
|
||||
read_bytes++;
|
||||
count--;
|
||||
addr++;
|
||||
*mem++=(unsigned char)(0xff & poll);
|
||||
}
|
||||
if(count>4) {
|
||||
ret = bdm_read(fd, mem, count & ~3);
|
||||
}
|
||||
if(ret < 0) return ret;
|
||||
read_bytes+=ret;
|
||||
count-=ret;
|
||||
addr+=ret;
|
||||
mem+=ret;
|
||||
|
||||
while(count>0) {
|
||||
word[0]=BDM_READ_CMD | BDM_SIZE_BYTE;
|
||||
word[1]=(addr>>16) & 0xffff;
|
||||
word[2]=addr & 0xffff;
|
||||
word[3]=BDM_NOP_CMD;
|
||||
ret=bdm_ioctl(fd, BDM_XCHG_DATA_IOC(word), (unsigned long)&word);
|
||||
if(ret<0)
|
||||
return ret;
|
||||
if(word[3]==BDM_BERR) {
|
||||
/* get BDM_NOT_READY after BERR */
|
||||
unsigned long poll;
|
||||
poll = BDM_NOP_CMD;
|
||||
bdm_ioctl(fd, BDM_XCHG_DATA_IOC(poll), (unsigned long)&poll);
|
||||
return BDM_FAULT_BERR;
|
||||
}
|
||||
if(word[3]==BDM_ILLEGAL)
|
||||
return BDM_FAULT_NVC;
|
||||
poll=word[3];
|
||||
while(poll==BDM_NOTREADY) {
|
||||
poll = BDM_NOP_CMD;
|
||||
ret=bdm_ioctl(fd, BDM_XCHG_DATA_IOC(poll), (unsigned long)&poll);
|
||||
if(ret<0)
|
||||
return ret;
|
||||
if(poll==BDM_BERR) {
|
||||
/* get BDM_NOT_READY after BERR */
|
||||
unsigned long poll;
|
||||
poll = BDM_NOP_CMD;
|
||||
bdm_ioctl(fd, BDM_XCHG_DATA_IOC(poll), (unsigned long)&poll);
|
||||
return BDM_FAULT_BERR;
|
||||
}
|
||||
if(poll==BDM_ILLEGAL)
|
||||
return BDM_FAULT_NVC;
|
||||
}
|
||||
read_bytes++;
|
||||
count--;
|
||||
addr++;
|
||||
*mem++=(unsigned char)(0xff & poll);
|
||||
}
|
||||
return read_bytes;
|
||||
#else
|
||||
/* not implemented */
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if BDMDriverVersion_M == BDMDriverFiedler_M
|
||||
static int perform_byte_write(int fd, unsigned int addr, unsigned char *mem)
|
||||
{
|
||||
#if BDMDriverVersion_M == BDMDriverFiedler_M
|
||||
unsigned long word[5];
|
||||
int ret;
|
||||
|
||||
word[0]=BDM_WRITE_CMD | BDM_SIZE_BYTE;
|
||||
word[1]=(addr>>16) & 0xffff;
|
||||
word[2]=addr & 0xffff;
|
||||
word[3]=*mem;
|
||||
word[4]=BDM_NOP_CMD;
|
||||
ret=bdm_ioctl(fd, BDM_XCHG_DATA_IOC(word), (unsigned long)&word);
|
||||
if(ret<0) {
|
||||
PRINTD("error in bdm_ioctl (0x%08x): %d\n", addr, ret);
|
||||
return ret;
|
||||
}
|
||||
if(word[4]==BDM_BERR) {
|
||||
/* get BDM_NOT_READY after BERR */
|
||||
PRINTD("bus error in bdm_ioctl (0x%08x): %d\n", addr, ret);
|
||||
return BDM_FAULT_BERR;
|
||||
}
|
||||
if(word[4]==BDM_ILLEGAL) {
|
||||
/* get BDM_NOT_READY after ILLEGAL */
|
||||
PRINTD("illegal cmd in bdm_ioctl (0x%08x): %d\n", addr, ret);
|
||||
return BDM_FAULT_NVC;
|
||||
}
|
||||
while(1) {
|
||||
word[4] = BDM_NOP_CMD;
|
||||
ret=bdm_ioctl(fd, BDM_XCHG_DATA_IOC(word[4]), (unsigned long)&word[4]);
|
||||
if(ret<0) {
|
||||
PRINTD("error in bdm_ioctl poll (0x%08x): %d\n", addr, ret);
|
||||
return ret;
|
||||
}
|
||||
switch(word[4]) {
|
||||
case BDM_BERR:
|
||||
/* get BDM_NOT_READY after BERR */
|
||||
PRINTD("bus error in bdm_ioctl poll (0x%08x): %d\n", addr, ret);
|
||||
return BDM_FAULT_BERR;
|
||||
case BDM_ILLEGAL:
|
||||
PRINTD("illegal cmd in bdm_ioctl poll (0x%08x): %d\n", addr, ret);
|
||||
return BDM_FAULT_NVC;
|
||||
case BDM_COMPLETE:
|
||||
return 0; /* we've done it ! */
|
||||
case BDM_NOTREADY:
|
||||
break;
|
||||
default:
|
||||
PRINTD("undefined reponse from target (0x%08x): %d\n", addr, ret);
|
||||
return BDM_FAULT_BERR;
|
||||
}
|
||||
}
|
||||
#else
|
||||
/* not implemented */
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/* write a block of memory, alignment doesn't matter anymore */
|
||||
int bdm_write_mem(unsigned int addr, unsigned char *mem, int count)
|
||||
{
|
||||
#if BDMDriverVersion_M == BDMDriverFiedler_M
|
||||
int written=0, ret;
|
||||
int i;
|
||||
|
||||
if(!count) return 0;
|
||||
|
||||
PRINTD("entering write_mem...");
|
||||
/* align to long word boundary from target's point of view */
|
||||
i=4-(addr&3); /* perform at least one write to set address */
|
||||
for(; i && count; i--) {
|
||||
PRINTD("alignment loop and AATR setup: %d\n", i);
|
||||
ret=perform_byte_write(fd, addr, mem);
|
||||
if(ret<0) return ret;
|
||||
mem++;
|
||||
written++;
|
||||
count--;
|
||||
addr++;
|
||||
}
|
||||
if(count>4) {
|
||||
ret = bdm_write(fd, mem, count & ~3);
|
||||
}
|
||||
if(ret < 0) {
|
||||
PRINTD("error in bdm_write: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
written+=ret;
|
||||
count-=ret;
|
||||
addr+=ret;
|
||||
mem+=ret;
|
||||
PRINTD("write syscall wrote %d (%x) bytes.\n", ret, ret);
|
||||
|
||||
while(count>0) {
|
||||
ret=perform_byte_write(fd, addr, mem);
|
||||
if(ret<0) return ret;
|
||||
mem++;
|
||||
written++;
|
||||
count--;
|
||||
addr++;
|
||||
}
|
||||
PRINTD("bdm_write_mem finished, %d bytes written\n", written);
|
||||
return written;
|
||||
#else
|
||||
/* not implemented */
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
void bdm_clear_status(void)
|
||||
{
|
||||
target_status = 0;
|
||||
}
|
||||
|
||||
int bdm_query_status(void)
|
||||
{
|
||||
#if BDMDriverVersion_M == BDMDriverFiedler_M
|
||||
unsigned long x, y /* , z */;
|
||||
|
||||
y=0;
|
||||
x = bdm_ioctl(fd, BDM_GET_STATUS_IOC, 0);
|
||||
if(x & BDM_TARGETRESET) y |= BDM_STAT_RESET;
|
||||
if(x & BDM_TARGETHALT) y |= BDM_STAT_PSTHALT;
|
||||
if(x & BDM_TARGETSTOPPED);
|
||||
if(x & BDM_TARGETPOWER) return BDM_STAT_NOPWR;
|
||||
if(x & BDM_TARGETNC) return BDM_STAT_NC;
|
||||
|
||||
if(bdm_read_reg(REG_CSR, &x)) return -1;
|
||||
printf("CSR=%08lx\n", x);
|
||||
/* z = x & 0x10; USER HALT ENABLE */
|
||||
/* y = x >> 28; it's better to translate */
|
||||
x |= target_status;
|
||||
if(x & CSR_BKPT) y |= BDM_STAT_BKPT;
|
||||
if(x & CSR_HALT) y |= BDM_STAT_HALT;
|
||||
if(x & CSR_TRG) y |= BDM_STAT_TRG;
|
||||
if(x & CSR_FOF) y |= BDM_STAT_FOF;
|
||||
if(x & CSR_SSM) y |= BDM_STAT_SSM;
|
||||
switch(x>>28) {
|
||||
case CSR_STAT_WAIT1:
|
||||
y |= BDM_STAT_WAIT1;
|
||||
break;
|
||||
case CSR_STAT_TRIG1:
|
||||
y |= BDM_STAT_TRIG1;
|
||||
break;
|
||||
case CSR_STAT_WAIT2:
|
||||
y |= BDM_STAT_WAIT2;
|
||||
break;
|
||||
case CSR_STAT_TRIG2:
|
||||
y |= BDM_STAT_TRIG2;
|
||||
break;
|
||||
}
|
||||
return y;
|
||||
#else
|
||||
/* not implemented */
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* wait for stopped target
|
||||
*/
|
||||
int bdm_wait(void)
|
||||
{
|
||||
#if BDMDriverVersion_M == BDMDriverFiedler_M
|
||||
unsigned long x;
|
||||
|
||||
while(1) {
|
||||
usleep(100000);
|
||||
x = bdm_ioctl(fd, BDM_GET_STATUS_IOC, 0);
|
||||
if(x & BDM_TARGETRESET) return BDM_STAT_RESET;
|
||||
if(x & BDM_TARGETHALT) return BDM_STAT_PSTHALT;
|
||||
if(x & BDM_TARGETSTOPPED) return BDM_STAT_HALT;
|
||||
if(x & BDM_TARGETPOWER) return BDM_STAT_NOPWR;
|
||||
if(x & BDM_TARGETNC) return BDM_STAT_NC;
|
||||
}
|
||||
#else
|
||||
/* not implemented */
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static unsigned long tdr = 0; /* shadow trigger definition register */
|
||||
/*
|
||||
* breakpoint control
|
||||
*/
|
||||
int bdm_set_pc_bp(unsigned long addr, unsigned long mask)
|
||||
{
|
||||
bdm_stop();
|
||||
if(bdm_write_reg(REG_PBR, &addr)) return -1;
|
||||
if(bdm_write_reg(REG_PBMR, &mask)) return -1;
|
||||
tdr = (1 << 30) | (~(3<<30) & tdr); /* trigger response is halt */
|
||||
tdr |= 1 << 29; /* enable second level trigger breakpoints */
|
||||
tdr |= 1 << 13; /* enable first level trigger breakpoints */
|
||||
tdr |= 1 << 1; /* enable PC breakpoint */
|
||||
tdr &= ~1; /* clear PC breakpoint invert */
|
||||
if(bdm_write_reg(REG_TDR, &tdr)) return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bdm_clear_pc_bp(void)
|
||||
{
|
||||
bdm_stop();
|
||||
tdr &= ~(1 << 1); /* disable PC breakpoint */
|
||||
if(bdm_write_reg(REG_TDR, &tdr)) return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bdm_set_addr_bp(unsigned long from_addr, unsigned long to_addr)
|
||||
{
|
||||
unsigned long tmp=0xff05;
|
||||
|
||||
bdm_stop();
|
||||
if(bdm_write_reg(REG_ABLR, &from_addr)) return -1;
|
||||
if(bdm_write_reg(REG_ABHR, &to_addr)) return -1;
|
||||
if(bdm_write_reg(REG_AATR, &tmp)) return -1; /* match everything */
|
||||
tdr = (1 << 30) | (~(3<<30) & tdr); /* trigger response is halt */
|
||||
tdr &= ~(1 << 29); /* disable second level trigger breakpoints */
|
||||
tdr |= 1 << 13; /* enable first level trigger breakpoints */
|
||||
tdr = (tdr & ~(7<<2)) | (2 << 2);
|
||||
/* enable address range breakpoint */
|
||||
if(bdm_write_reg(REG_TDR, &tdr)) return -1;
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
int bdm_clear_addr_bp(void)
|
||||
{
|
||||
bdm_stop();
|
||||
tdr = (tdr & ~(7<<2)) | (0 << 2);
|
||||
/* disable address range breakpoint */
|
||||
if(bdm_write_reg(REG_TDR, &tdr)) return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bdm_set_data_bp(unsigned long value, unsigned long mask)
|
||||
{
|
||||
bdm_stop();
|
||||
bdm_write_reg(REG_DBR, &value);
|
||||
bdm_write_reg(REG_DBMR, &mask);
|
||||
tdr = (1 << 30) | (~(3<<30) & tdr); /* trigger response is halt */
|
||||
tdr &= ~(1 << 29); /* disable second level trigger breakpoints */
|
||||
tdr |= 1 << 13; /* enable first level trigger breakpoints */
|
||||
tdr = (tdr & ~(0xff<<5)) | (0x80 << 5);
|
||||
/* enable data breakpoint for long word */
|
||||
if(bdm_write_reg(REG_TDR, &tdr)) return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bdm_clear_data_bp(void)
|
||||
{
|
||||
bdm_stop();
|
||||
tdr = (tdr & ~(0xff<<5)) | (0x00 << 5);
|
||||
/* disable data breakpoint */
|
||||
if(bdm_write_reg(REG_TDR, &tdr)) return -1;
|
||||
return 0;
|
||||
}
|
||||
246
m68k/bdmabstraction/bdmops.h
Normal file
246
m68k/bdmabstraction/bdmops.h
Normal file
@@ -0,0 +1,246 @@
|
||||
#ifndef _BDMOPS_H_
|
||||
#define _BDMOPS_H_
|
||||
|
||||
/*
|
||||
* bdm abstraction for coldfire processors
|
||||
*
|
||||
* 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, 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; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
typedef enum CF_REGS {
|
||||
/* user registers */
|
||||
REG_D0,
|
||||
REG_D1,
|
||||
REG_D2,
|
||||
REG_D3,
|
||||
REG_D4,
|
||||
REG_D5,
|
||||
REG_D6,
|
||||
REG_D7,
|
||||
REG_A0,
|
||||
REG_A1,
|
||||
REG_A2,
|
||||
REG_A3,
|
||||
REG_A4,
|
||||
REG_A5,
|
||||
REG_A6,
|
||||
REG_A7,
|
||||
MAX_USER_REGS=REG_A7,
|
||||
/* RCREG/WCREG */
|
||||
REG_CACR,
|
||||
REG_ACR0,
|
||||
REG_ACR1,
|
||||
REG_VBR,
|
||||
REG_SR,
|
||||
REG_RPC,
|
||||
REG_RAMBAR,
|
||||
REG_MBAR,
|
||||
MAX_CONFIG_REGS=REG_MBAR,
|
||||
/* RDMREG/WDMREG */
|
||||
REG_CSR,
|
||||
REG_AATR,
|
||||
REG_TDR,
|
||||
REG_PBR,
|
||||
REG_PBMR,
|
||||
REG_ABHR,
|
||||
REG_ABLR,
|
||||
REG_DBR,
|
||||
REG_DBMR,
|
||||
MAX_DEBUG_REGS=REG_DBMR,
|
||||
MAX_REGS
|
||||
} CF_REGS;
|
||||
|
||||
#ifdef REG_NAMES
|
||||
struct reg_names {
|
||||
CF_REGS id;
|
||||
const char name[8];
|
||||
} reg_names[]={
|
||||
/* user registers */
|
||||
{ REG_D0, "D0"},
|
||||
{ REG_D1, "D1"},
|
||||
{ REG_D2, "D2"},
|
||||
{ REG_D3, "D3"},
|
||||
{ REG_D4, "D4"},
|
||||
{ REG_D5, "D5"},
|
||||
{ REG_D6, "D6"},
|
||||
{ REG_D7, "D7"},
|
||||
{ REG_A0, "A0"},
|
||||
{ REG_A1, "A1"},
|
||||
{ REG_A2, "A2"},
|
||||
{ REG_A3, "A3"},
|
||||
{ REG_A4, "A4"},
|
||||
{ REG_A5, "A5"},
|
||||
{ REG_A6, "A6"},
|
||||
{ REG_A7, "A7"},
|
||||
/* RCREG/WCREG */
|
||||
{ REG_CACR, "CACR"},
|
||||
{ REG_ACR0, "ACR0"},
|
||||
{ REG_ACR1, "ACR1"},
|
||||
{ REG_VBR, "VBR"},
|
||||
{ REG_SR, "SR"},
|
||||
{ REG_RPC, "RPC"},
|
||||
{ REG_RAMBAR, "RAMBAR"},
|
||||
{ REG_MBAR, "MBAR"},
|
||||
/* RDMREG/WDMREG */
|
||||
{ REG_CSR, "CSR"},
|
||||
{ REG_AATR, "AATR"},
|
||||
{ REG_TDR, "TDR"},
|
||||
{ REG_PBR, "PBR"},
|
||||
{ REG_PBMR, "PBMR"},
|
||||
{ REG_ABHR, "ABHR"},
|
||||
{ REG_ABLR, "ABLR"},
|
||||
{ REG_DBR, "DBR"},
|
||||
{ REG_DBMR, "DBMR"},
|
||||
{ 0xffff, ""}
|
||||
};
|
||||
#endif
|
||||
|
||||
/* debug module register definitions */
|
||||
/* AATR */
|
||||
#define AATR_RM (1<<15) /* Read/Write mask */
|
||||
#define AATR_SZM (3<<13) /* SiZe Mask */
|
||||
#define AATR_TTM (3<<11) /* Transfer Type Mask */
|
||||
#define AATR_TMM (7<<8) /* Transfer Modifier Mask */
|
||||
#define AATR_R (1<<7) /* Read/write */
|
||||
#define AATR_SZ (3<<5) /* SiZe */
|
||||
#define AATR_TT (3<<3) /* Tranfer Type */
|
||||
#define AATR_TM (7<<0) /* Transfer Modifier */
|
||||
/* TDR */
|
||||
#define TDR_TRC (3<<30) /* Trigger Response Control */
|
||||
#define TDR_EBL2 (1<<29) /* Enable Breakpoint Level */
|
||||
#define TDR_EDLW2 (1<<28) /* Enable Data BP for LongWord */
|
||||
#define TDR_EDWL2 (1<<27) /* Enable Data BP for Word (Upper) */
|
||||
#define TDR_EDWU2 (1<<26) /* Enable Data BP for Word (Lower) */
|
||||
#define TDR_EDLL2 (1<<25) /* Enable Data BP for byte (LL) */
|
||||
#define TDR_EDLM2 (1<<24) /* Enable Data BP for byte (LM) */
|
||||
#define TDR_EDUM2 (1<<23) /* Enable Data BP for byte (UM) */
|
||||
#define TDR_EDUU2 (1<<22) /* Enable Data BP for byte (UU) */
|
||||
#define TDR_DI2 (1<<21) /* Data breakpoint invert */
|
||||
#define TDR_EAI2 (1<<20) /* Enable Address breakpoint inverted */
|
||||
#define TDR_EAR2 (1<<19) /* Enable Address breakpoint Range */
|
||||
#define TDR_EAL2 (1<<18) /* Enable Address breakpoint Low */
|
||||
#define TDR_EPC2 (1<<17) /* Enable PC breakpoint */
|
||||
#define TDR_PCI2 (1<<16) /* PC breakpoint Invert */
|
||||
#define TDR_EBL1 (1<<13) /* Enable Breakpoint Level */
|
||||
#define TDR_EDLW1 (1<<12) /* Enable Data BP for LongWord */
|
||||
#define TDR_EDWL1 (1<<11) /* Enable Data BP for Word (Upper) */
|
||||
#define TDR_EDWU1 (1<<10) /* Enable Data BP for Word (Lower) */
|
||||
#define TDR_EDLL1 (1<<9) /* Enable Data BP for byte (LL) */
|
||||
#define TDR_EDLM1 (1<<8) /* Enable Data BP for byte (LM) */
|
||||
#define TDR_EDUM1 (1<<7) /* Enable Data BP for byte (UM) */
|
||||
#define TDR_EDUU1 (1<<6) /* Enable Data BP for byte (UU) */
|
||||
#define TDR_DI1 (1<<5) /* Data breakpoint invert */
|
||||
#define TDR_EAI1 (1<<4) /* Enable Address breakpoint inverted */
|
||||
#define TDR_EAR1 (1<<3) /* Enable Address breakpoint Range */
|
||||
#define TDR_EAL1 (1<<2) /* Enable Address breakpoint Low */
|
||||
#define TDR_EPC1 (1<<1) /* Enable PC breakpoint */
|
||||
#define TDR_PCI1 (1<<0) /* PC breakpoint Invert */
|
||||
/* CSR */
|
||||
#define CSR_STATUS (15<<28) /* breakpoint status */
|
||||
# define CSR_STAT_NOBP 0
|
||||
# define CSR_STAT_WAIT1 1
|
||||
# define CSR_STAT_TRIG1 2
|
||||
# define CSR_STAT_WAIT2 5
|
||||
# define CSR_STAT_TRIG2 6
|
||||
#define CSR_FOF (1<<27) /* Fault-On-Fault */
|
||||
#define CSR_TRG (1<<26) /* hardware breakpoint TRiGger */
|
||||
#define CSR_HALT (1<<25) /* processor HALT */
|
||||
#define CSR_BKPT (1<<24) /* BreaKPoinT assert */
|
||||
#define CSR_IPW (1<<16) /* Inhibit Processor Writes to dbg reg. */
|
||||
#define CSR_MAP (1<<15) /* MAP processor accesses in emu mode */
|
||||
#define CSR_TRC (1<<14) /* emulation mode on TRaCe exception */
|
||||
#define CSR_EMU (1<<13) /* force EMUlation mode */
|
||||
#define CSR_DDC (3<<11) /* Debug Data Control */
|
||||
#define CSR_UHE (1<<10) /* User Halt Enable */
|
||||
#define CSR_BTB (3<<8) /* Branch Target Bytes */
|
||||
#define CSR_NPL (1<<6) /* NonPipelined Mode */
|
||||
#define CSR_IPI (1<<5) /* Ignore Pending Interrupts */
|
||||
#define CSR_SSM (1<<4) /* Single Step Mode */
|
||||
|
||||
/*
|
||||
* this is an abstraction layer to have a general target programming interface
|
||||
* so the programmer doesn't have to bother with motorola's bdm commands.
|
||||
*
|
||||
* applications only include bdmops.h and call the functions below
|
||||
*/
|
||||
|
||||
/* open bdm-driver */
|
||||
int /* <0 if error, BDMHandle otherwise */
|
||||
bdm_init(const char *path);
|
||||
/* close driver */
|
||||
void bdm_release(int port);
|
||||
/* bring chip to running state */
|
||||
void bdm_run(void);
|
||||
/* bring chip to stopped state */
|
||||
void bdm_stop(void);
|
||||
/* step chip on instruction */
|
||||
void bdm_step(void);
|
||||
/* reset chip and hold in reset state */
|
||||
void bdm_reset(void);
|
||||
/* restart from reset to running state */
|
||||
void bdm_restart(void);
|
||||
/* read a register from the chip */
|
||||
int bdm_read_reg(CF_REGS which, unsigned long *value);
|
||||
/* write a register in the chip */
|
||||
int bdm_write_reg(CF_REGS which, unsigned long *value);
|
||||
/* read a block of memory, alignment doesn't matter anymore */
|
||||
int bdm_read_mem(unsigned int addr, unsigned char *mem, int count);
|
||||
/* write a block of memory, alignment doesn't matter anymore */
|
||||
int bdm_write_mem(unsigned int addr, unsigned char *mem, int count);
|
||||
/* set program counter break point */
|
||||
int bdm_set_pc_bp(unsigned long addr, unsigned long mask);
|
||||
int bdm_clear_pc_bp(void);
|
||||
/* set program counter break point */
|
||||
int bdm_set_addr_bp(unsigned long from_addr, unsigned long to_addr);
|
||||
int bdm_clear_addr_bp(void);
|
||||
/* set program counter break point */
|
||||
int bdm_set_data_bp(unsigned long value, unsigned long mask);
|
||||
int bdm_clear_daat_bp(void);
|
||||
/* bdm query status */
|
||||
void bdm_clear_status(void);
|
||||
int bdm_query_status(void);
|
||||
#define BDM_STAT_BKPT (1<<0)
|
||||
#define BDM_STAT_HALT (1<<1)
|
||||
#define BDM_STAT_TRG (1<<2)
|
||||
#define BDM_STAT_FOF (1<<3)
|
||||
#define BDM_STAT_SSM (1<<4)
|
||||
#define BDM_STAT_WAIT1 (1<<5)
|
||||
#define BDM_STAT_TRIG1 (1<<6)
|
||||
#define BDM_STAT_WAIT2 (1<<7)
|
||||
#define BDM_STAT_TRIG2 (1<<8)
|
||||
#define BDM_STAT_RESET (1<<9)
|
||||
#define BDM_STAT_NOPWR (1<<10)
|
||||
#define BDM_STAT_PSTHALT (1<<11)
|
||||
#define BDM_STAT_NC (1<<12)
|
||||
/* bdm wait for stopped target */
|
||||
int bdm_wait(void);
|
||||
|
||||
#ifdef _COMPILING_
|
||||
# ifdef USERMODE
|
||||
int bdm_open(int minor, int flags);
|
||||
int bdm_ioctl(int minor, unsigned int request, unsigned long arg);
|
||||
int bdm_read(int minor, unsigned char *p, int count);
|
||||
int bdm_write(int minor, const unsigned char *p, int count);
|
||||
void bdm_close(int minor);
|
||||
# else
|
||||
# define bdm_open open
|
||||
# define bdm_ioctl ioctl
|
||||
# define bdm_read read
|
||||
# define bdm_write write
|
||||
# define bdm_close close
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
115
m68k/config.h.in
Normal file
115
m68k/config.h.in
Normal file
@@ -0,0 +1,115 @@
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define to 1 if you have the <arpa/inet.h> header file. */
|
||||
#undef HAVE_ARPA_INET_H
|
||||
|
||||
/* Define to 1 if you have the declaration of `perror', and to 0 if you don't.
|
||||
*/
|
||||
#undef HAVE_DECL_PERROR
|
||||
|
||||
/* Define to 1 if you have the declaration of `strerror', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_STRERROR
|
||||
|
||||
/* Define to 1 if you have the <errno.h> header file. */
|
||||
#undef HAVE_ERRNO_H
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the `ioperm' function. */
|
||||
#undef HAVE_IOPERM
|
||||
|
||||
/* Define to 1 if you have the `usb' library (-lusb). */
|
||||
#undef HAVE_LIBUSB
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the <netdb.h> header file. */
|
||||
#undef HAVE_NETDB_H
|
||||
|
||||
/* Define to 1 if you have the <netinet/in.h> header file. */
|
||||
#undef HAVE_NETINET_IN_H
|
||||
|
||||
/* Define to 1 if you have the <netinet/tcp.h> header file. */
|
||||
#undef HAVE_NETINET_TCP_H
|
||||
|
||||
/* Define to 1 if you have the <sgtty.h> header file. */
|
||||
#undef HAVE_SGTTY_H
|
||||
|
||||
/* Define to 1 if you have the <signal.h> header file. */
|
||||
#undef HAVE_SIGNAL_H
|
||||
|
||||
/* Define to 1 if the system has the type `socklen_t'. */
|
||||
#undef HAVE_SOCKLEN_T
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the <sys/file.h> header file. */
|
||||
#undef HAVE_SYS_FILE_H
|
||||
|
||||
/* Define to 1 if you have the <sys/ioctl.h> header file. */
|
||||
#undef HAVE_SYS_IOCTL_H
|
||||
|
||||
/* Define to 1 if you have the <sys/socket.h> header file. */
|
||||
#undef HAVE_SYS_SOCKET_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <termios.h> header file. */
|
||||
#undef HAVE_TERMIOS_H
|
||||
|
||||
/* Define to 1 if you have the <termio.h> header file. */
|
||||
#undef HAVE_TERMIO_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
|
||||
#undef NO_MINUS_C_MINUS_O
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
|
||||
`char[]'. */
|
||||
#undef YYTEXT_POINTER
|
||||
2
m68k/config/.cvsignore
Normal file
2
m68k/config/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
compile
|
||||
ylwrap
|
||||
93
m68k/config/ax_cflags_warn_all.m4
Normal file
93
m68k/config/ax_cflags_warn_all.m4
Normal file
@@ -0,0 +1,93 @@
|
||||
dnl @synopsis AX_CFLAGS_WARN_ALL [(shellvar)]
|
||||
dnl
|
||||
dnl Try to find a compiler option that enables most reasonable warnings.
|
||||
dnl This macro is directly derived from VL_PROG_CC_WARNINGS which is
|
||||
dnl split up into two AX_CFLAGS_WARN_ALL and AX_CFLAGS_WARN_ALL_ANSI
|
||||
dnl
|
||||
dnl For the GNU CC compiler it will be -Wall (and -ansi -pedantic)
|
||||
dnl The result is added to the shellvar being CFLAGS by default.
|
||||
dnl
|
||||
dnl Currently this macro knows about GCC, Solaris C compiler,
|
||||
dnl Digital Unix C compiler, C for AIX Compiler, HP-UX C compiler,
|
||||
dnl IRIX C compiler, NEC SX-5 (Super-UX 10) C compiler, and Cray J90
|
||||
dnl (Unicos 10.0.0.8) C compiler.
|
||||
dnl
|
||||
dnl @version $Id: ax_cflags_warn_all.m4,v 1.1 2004/01/08 20:34:22 codewiz Exp $
|
||||
dnl @author Guido Draheim <guidod@gmx.de>
|
||||
dnl
|
||||
AC_DEFUN([AX_CFLAGS_WARN_ALL],
|
||||
[AC_MSG_CHECKING(m4_ifval($1,$1,CFLAGS) for maximum warnings)
|
||||
AC_CACHE_VAL(ac_cv_cflags_warn_all,
|
||||
[ac_cv_cflags_warn_all="no, unknown"
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_C
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
for ac_arg dnl
|
||||
in "-pedantic % -Wall" dnl GCC
|
||||
"-xstrconst % -v" dnl Solaris C
|
||||
"-std1 % -verbose -w0 -warnprotos" dnl Digital Unix
|
||||
"-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
|
||||
"-ansi -ansiE % -fullwarn" dnl IRIX
|
||||
"+ESlit % +w1" dnl HP-UX C
|
||||
"-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
|
||||
"-h conform % -h msglevel 2" dnl Cray C (Unicos)
|
||||
#
|
||||
do CFLAGS="$ac_save_CFLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
|
||||
AC_TRY_COMPILE([],[return 0;],
|
||||
[ac_cv_cflags_warn_all=`echo $ac_arg | sed -e 's,.*% *,,'`
|
||||
break])
|
||||
done
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
AC_LANG_RESTORE
|
||||
])
|
||||
case ".$ac_cv_cflags_warn_all" in
|
||||
.|.no,*) AC_MSG_RESULT($ac_cv_cflags_warn_all) ;;
|
||||
*) m4_ifval($1,$1,CFLAGS)="$m4_ifval($1,$1,CFLAGS) dnl
|
||||
$ac_cv_cflags_warn_all"
|
||||
AC_MSG_RESULT($ac_cv_cflags_warn_all) ;;
|
||||
esac])
|
||||
|
||||
dnl the only difference - the LANG selection... and the default FLAGS
|
||||
|
||||
AC_DEFUN([AX_CXXFLAGS_WARN_ALL],
|
||||
[AC_MSG_CHECKING(m4_ifval($1,$1,CXXFLAGS) for maximum warnings)
|
||||
AC_CACHE_VAL(ac_cv_cxxflags_warn_all,
|
||||
[ac_cv_cxxflags_warn_all="no, unknown"
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_CXX
|
||||
ac_save_CXXFLAGS="$CXXFLAGS"
|
||||
for ac_arg dnl
|
||||
in "-pedantic % -Wall" dnl GCC
|
||||
"-xstrconst % -v" dnl Solaris C
|
||||
"-std1 % -verbose -w0 -warnprotos" dnl Digital Unix
|
||||
"-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
|
||||
"-ansi -ansiE % -fullwarn" dnl IRIX
|
||||
"+ESlit % +w1" dnl HP-UX C
|
||||
"-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
|
||||
"-h conform % -h msglevel 2" dnl Cray C (Unicos)
|
||||
#
|
||||
do CXXFLAGS="$ac_save_CXXFLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
|
||||
AC_TRY_COMPILE([],[return 0;],
|
||||
[ac_cv_cxxflags_warn_all=`echo $ac_arg | sed -e 's,.*% *,,'`
|
||||
break])
|
||||
done
|
||||
CXXFLAGS="$ac_save_CXXFLAGS"
|
||||
AC_LANG_RESTORE
|
||||
])
|
||||
case ".$ac_cv_cxxflags_warn_all" in
|
||||
.|.no,*) AC_MSG_RESULT($ac_cv_cxxflags_warn_all) ;;
|
||||
*) m4_ifval($1,$1,CXXFLAGS)="$m4_ifval($1,$1,CXXFLAGS) dnl
|
||||
$ac_cv_cxxflags_warn_all"
|
||||
AC_MSG_RESULT($ac_cv_cxxflags_warn_all) ;;
|
||||
esac])
|
||||
|
||||
dnl implementation tactics:
|
||||
dnl the for-argument contains a list of options. The first part of
|
||||
dnl these does only exist to detect the compiler - usually it is
|
||||
dnl a global option to enable -ansi or -extrawarnings. All other
|
||||
dnl compilers will fail about it. That was needed since a lot of
|
||||
dnl compilers will give false positives for some option-syntax
|
||||
dnl like -Woption or -Xoption as they think of it is a pass-through
|
||||
dnl to later compile stages or something. The "%" is used as a
|
||||
dnl delimimiter. A non-option comment can be given after "%%" marks.
|
||||
|
||||
43
m68k/config/bootstrap
Executable file
43
m68k/config/bootstrap
Executable file
@@ -0,0 +1,43 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# $Id: bootstrap,v 1.8 2008/09/19 07:17:29 cjohns Exp $
|
||||
#
|
||||
# Copyright (c) 2002, Cybertec Pty Ltd.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Bootstrap the auto* stuff.
|
||||
#
|
||||
|
||||
configure_list=`find . -name configure.ac | sed -e "s/^\.\///g"`
|
||||
|
||||
if [ ! -d config ]; then
|
||||
mkdir config || \
|
||||
{ echo "error: cannot make a config directory" >&2
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi
|
||||
|
||||
|
||||
am_version=$(automake --version 2>&1 | head -n 1 | awk '{ print $4 }' | sed -e 's/\.//')
|
||||
if test $am_version -lt 17;
|
||||
then
|
||||
echo "Automake 1.7 or higher is required! Aborting...";
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
for c in $configure_list
|
||||
do
|
||||
echo "Processing $c"
|
||||
|
||||
config=`echo $c | sed -e "s/[^\/]*\//..\//g" -e "s/configure.ac/config/g"`
|
||||
|
||||
curr_pwd=$(pwd)
|
||||
cd `dirname $c`
|
||||
|
||||
aclocal -I config
|
||||
grep -q "AC_CONFIG_HEADERS" configure.ac && autoheader
|
||||
automake -Wno-portability -Wno-unsupported --foreign --add-missing --copy
|
||||
autoconf --warnings=all -Wno-portability
|
||||
autoheader
|
||||
|
||||
cd $curr_pwd
|
||||
done
|
||||
142
m68k/config/compile
Executable file
142
m68k/config/compile
Executable file
@@ -0,0 +1,142 @@
|
||||
#! /bin/sh
|
||||
# Wrapper for compilers which do not understand `-c -o'.
|
||||
|
||||
scriptversion=2005-05-14.22
|
||||
|
||||
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||
#
|
||||
# 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, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: compile [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Wrapper for compilers which do not understand `-c -o'.
|
||||
Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
|
||||
arguments, and rename the output as expected.
|
||||
|
||||
If you are trying to build a whole package this is not the
|
||||
right script to run: please start by reading the file `INSTALL'.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "compile $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
ofile=
|
||||
cfile=
|
||||
eat=
|
||||
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as `compile cc -o foo foo.c'.
|
||||
# So we strip `-o arg' only if arg is an object.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.obj)
|
||||
ofile=$2
|
||||
;;
|
||||
*)
|
||||
set x "$@" -o "$2"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*.c)
|
||||
cfile=$1
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
if test -z "$ofile" || test -z "$cfile"; then
|
||||
# If no `-o' option was seen then we might have been invoked from a
|
||||
# pattern rule where we don't need one. That is ok -- this is a
|
||||
# normal compilation that the losing compiler can handle. If no
|
||||
# `.c' file was seen then we are probably linking. That is also
|
||||
# ok.
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
# Name of file we expect compiler to create.
|
||||
cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
|
||||
|
||||
# Create the lock directory.
|
||||
# Note: use `[/.-]' here to ensure that we don't use the same name
|
||||
# that we are using for the .o file. Also, base the name on the expected
|
||||
# object file name, since that is what matters with a parallel build.
|
||||
lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
|
||||
while true; do
|
||||
if mkdir "$lockdir" >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
# FIXME: race condition here if user kills between mkdir and trap.
|
||||
trap "rmdir '$lockdir'; exit 1" 1 2 15
|
||||
|
||||
# Run the compile.
|
||||
"$@"
|
||||
ret=$?
|
||||
|
||||
if test -f "$cofile"; then
|
||||
mv "$cofile" "$ofile"
|
||||
elif test -f "${cofile}bj"; then
|
||||
mv "${cofile}bj" "$ofile"
|
||||
fi
|
||||
|
||||
rmdir "$lockdir"
|
||||
exit $ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
||||
1500
m68k/config/config.guess
vendored
Executable file
1500
m68k/config/config.guess
vendored
Executable file
File diff suppressed because it is too large
Load Diff
1616
m68k/config/config.sub
vendored
Executable file
1616
m68k/config/config.sub
vendored
Executable file
File diff suppressed because it is too large
Load Diff
584
m68k/config/depcomp
Executable file
584
m68k/config/depcomp
Executable file
@@ -0,0 +1,584 @@
|
||||
#! /bin/sh
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
|
||||
scriptversion=2006-10-15.18
|
||||
|
||||
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# 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, 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., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Run PROGRAMS ARGS to compile a file, generating dependencies
|
||||
as side-effects.
|
||||
|
||||
Environment variables:
|
||||
depmode Dependency tracking mode.
|
||||
source Source file read by `PROGRAMS ARGS'.
|
||||
object Object file output by `PROGRAMS ARGS'.
|
||||
DEPDIR directory where to store dependencies.
|
||||
depfile Dependency file to output.
|
||||
tmpdepfile Temporary file to use when outputing dependencies.
|
||||
libtool Whether libtool is used (yes/no).
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "depcomp $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
|
||||
depfile=${depfile-`echo "$object" |
|
||||
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
|
||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||
|
||||
rm -f "$tmpdepfile"
|
||||
|
||||
# Some modes work just like other modes, but use different flags. We
|
||||
# parameterize here, but still list the modes in the big case below,
|
||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||
# here, because this file can only contain one case statement.
|
||||
if test "$depmode" = hp; then
|
||||
# HP compiler uses -M and no extra arg.
|
||||
gccflag=-M
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
if test "$depmode" = dashXmstdout; then
|
||||
# This is just like dashmstdout with a different argument.
|
||||
dashmflag=-xM
|
||||
depmode=dashmstdout
|
||||
fi
|
||||
|
||||
case "$depmode" in
|
||||
gcc3)
|
||||
## gcc 3 implements dependency tracking that does exactly what
|
||||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
||||
## it if -MD -MP comes after the -MF stuff. Hmm.
|
||||
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
|
||||
## the command line argument order; so add the flags where they
|
||||
## appear in depend2.am. Note that the slowdown incurred here
|
||||
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
|
||||
*) set fnord "$@" "$arg" ;;
|
||||
esac
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
done
|
||||
"$@"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
mv "$tmpdepfile" "$depfile"
|
||||
;;
|
||||
|
||||
gcc)
|
||||
## There are various ways to get dependency output from gcc. Here's
|
||||
## why we pick this rather obscure method:
|
||||
## - Don't want to use -MD because we'd like the dependencies to end
|
||||
## up in a subdir. Having to rename by hand is ugly.
|
||||
## (We might end up doing this anyway to support other compilers.)
|
||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||
## -MM, not -M (despite what the docs say).
|
||||
## - Using -M directly means running the compiler twice (even worse
|
||||
## than renaming).
|
||||
if test -z "$gccflag"; then
|
||||
gccflag=-MD,
|
||||
fi
|
||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
||||
## The second -e expression handles DOS-style file names with drive letters.
|
||||
sed -e 's/^[^:]*: / /' \
|
||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
||||
## This next piece of magic avoids the `deleted header file' problem.
|
||||
## The problem is that when a header file which appears in a .P file
|
||||
## is deleted, the dependency causes make to die (because there is
|
||||
## typically no way to rebuild the header). We avoid this by adding
|
||||
## dummy dependencies for each header file. Too bad gcc doesn't do
|
||||
## this for us directly.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" |
|
||||
## Some versions of gcc put a space before the `:'. On the theory
|
||||
## that the space means something, we add a space to the output as
|
||||
## well.
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
sgi)
|
||||
if test "$libtool" = yes; then
|
||||
"$@" "-Wp,-MDupdate,$tmpdepfile"
|
||||
else
|
||||
"$@" -MDupdate "$tmpdepfile"
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
|
||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||
echo "$object : \\" > "$depfile"
|
||||
|
||||
# Clip off the initial element (the dependent). Don't try to be
|
||||
# clever and replace this with sed code, as IRIX sed won't handle
|
||||
# lines with more than a fixed number of characters (4096 in
|
||||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
||||
# the IRIX cc adds comments like `#:fec' to the end of the
|
||||
# dependency line.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
|
||||
tr '
|
||||
' ' ' >> $depfile
|
||||
echo >> $depfile
|
||||
|
||||
# The second pass generates a dummy entry for each header file.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> $depfile
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
aix)
|
||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||
# in a .u file. In older versions, this file always lives in the
|
||||
# current directory. Also, the AIX compiler puts `$object:' at the
|
||||
# start of each line; $object doesn't have directory information.
|
||||
# Version 6 uses the directory in both cases.
|
||||
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
|
||||
tmpdepfile="$stripped.u"
|
||||
if test "$libtool" = yes; then
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
"$@" -M
|
||||
fi
|
||||
stat=$?
|
||||
|
||||
if test -f "$tmpdepfile"; then :
|
||||
else
|
||||
stripped=`echo "$stripped" | sed 's,^.*/,,'`
|
||||
tmpdepfile="$stripped.u"
|
||||
fi
|
||||
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
if test -f "$tmpdepfile"; then
|
||||
outname="$stripped.o"
|
||||
# Each line is of the form `foo.o: dependent.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
icc)
|
||||
# Intel's C compiler understands `-MD -MF file'. However on
|
||||
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
|
||||
# ICC 7.0 will fill foo.d with something like
|
||||
# foo.o: sub/foo.c
|
||||
# foo.o: sub/foo.h
|
||||
# which is wrong. We want:
|
||||
# sub/foo.o: sub/foo.c
|
||||
# sub/foo.o: sub/foo.h
|
||||
# sub/foo.c:
|
||||
# sub/foo.h:
|
||||
# ICC 7.1 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using \ :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each line is of the form `foo.o: dependent.h',
|
||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
|
||||
sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp2)
|
||||
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
|
||||
# compilers, which have integrated preprocessors. The correct option
|
||||
# to use with these is +Maked; it writes dependencies to a file named
|
||||
# 'foo.d', which lands next to the object file, wherever that
|
||||
# happens to be.
|
||||
# Much of this is similar to the tru64 case; see comments there.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir.libs/$base.d
|
||||
"$@" -Wc,+Maked
|
||||
else
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
"$@" +Maked
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
|
||||
# Add `dependent.h:' lines.
|
||||
sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile" "$tmpdepfile2"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in `foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
|
||||
if test "$libtool" = yes; then
|
||||
# With Tru64 cc, shared objects can also be used to make a
|
||||
# static library. This mechanism is used in libtool 1.4 series to
|
||||
# handle both shared and static libraries in a single compilation.
|
||||
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
|
||||
#
|
||||
# With libtool 1.5 this exception was removed, and libtool now
|
||||
# generates 2 separate objects for the 2 libraries. These two
|
||||
# compilations output dependencies in $dir.libs/$base.o.d and
|
||||
# in $dir$base.o.d. We have to check for both files, because
|
||||
# one of the two compilations can be disabled. We should prefer
|
||||
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||
# the former would cause a distcleancheck panic.
|
||||
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
|
||||
tmpdepfile2=$dir$base.o.d # libtool 1.5
|
||||
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
|
||||
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
tmpdepfile1=$dir$base.o.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
tmpdepfile3=$dir$base.d
|
||||
tmpdepfile4=$dir$base.d
|
||||
"$@" -MD
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||
# That's a tab and a space in the [].
|
||||
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
#nosideeffect)
|
||||
# This comment above is used by automake to tell side-effect
|
||||
# dependency tracking mechanisms from slower ones.
|
||||
|
||||
dashmstdout)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
# Require at least two characters before searching for `:'
|
||||
# in the target name. This is to cope with DOS-style filenames:
|
||||
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
|
||||
"$@" $dashmflag |
|
||||
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
dashXmstdout)
|
||||
# This case only exists to satisfy depend.m4. It is never actually
|
||||
# run, as this mode is specially recognized in the preamble.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
makedepend)
|
||||
"$@" || exit $?
|
||||
# Remove any Libtool call
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
# X makedepend
|
||||
shift
|
||||
cleared=no
|
||||
for arg in "$@"; do
|
||||
case $cleared in
|
||||
no)
|
||||
set ""; shift
|
||||
cleared=yes ;;
|
||||
esac
|
||||
case "$arg" in
|
||||
-D*|-I*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
# Strip any option that makedepend may not understand. Remove
|
||||
# the object too, otherwise makedepend will parse it as a source file.
|
||||
-*|$object)
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
esac
|
||||
done
|
||||
obj_suffix="`echo $object | sed 's/^.*\././'`"
|
||||
touch "$tmpdepfile"
|
||||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
sed '1,2d' "$tmpdepfile" | tr ' ' '
|
||||
' | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||
;;
|
||||
|
||||
cpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
"$@" -E |
|
||||
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||
sed '$ s: \\$::' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
cat < "$tmpdepfile" >> "$depfile"
|
||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvisualcpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
"$@" || exit $?
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case "$arg" in
|
||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@" -E |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
|
||||
echo " " >> "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
none)
|
||||
exec "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown depmode $depmode" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
||||
507
m68k/config/install-sh
Executable file
507
m68k/config/install-sh
Executable file
@@ -0,0 +1,507 @@
|
||||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2006-10-14.15
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch.
|
||||
|
||||
nl='
|
||||
'
|
||||
IFS=" "" $nl"
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
if test -z "$doit"; then
|
||||
doit_exec=exec
|
||||
else
|
||||
doit_exec=$doit
|
||||
fi
|
||||
|
||||
# Put in absolute file names if you don't have them in your path;
|
||||
# or use environment vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
posix_glob=
|
||||
posix_mkdir=
|
||||
|
||||
# Desired mode of installed file.
|
||||
mode=0755
|
||||
|
||||
chmodcmd=$chmodprog
|
||||
chowncmd=
|
||||
chgrpcmd=
|
||||
stripcmd=
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
dstarg=
|
||||
no_target_directory=
|
||||
|
||||
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||
or: $0 [OPTION]... -d DIRECTORIES...
|
||||
|
||||
In the 1st form, copy SRCFILE to DSTFILE.
|
||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||
In the 4th, create DIRECTORIES.
|
||||
|
||||
Options:
|
||||
-c (ignored)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-s $stripprog installed files.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
|
||||
"
|
||||
|
||||
while test $# -ne 0; do
|
||||
case $1 in
|
||||
-c) shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) mode=$2
|
||||
shift
|
||||
shift
|
||||
case $mode in
|
||||
*' '* | *' '* | *'
|
||||
'* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd=$stripprog
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t) dstarg=$2
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-T) no_target_directory=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
--) shift
|
||||
break;;
|
||||
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
|
||||
*) break;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
|
||||
# When -d is used, all remaining arguments are directories to create.
|
||||
# When -t is used, the destination is already specified.
|
||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||
for arg
|
||||
do
|
||||
if test -n "$dstarg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dstarg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dstarg=$arg
|
||||
done
|
||||
fi
|
||||
|
||||
if test $# -eq 0; then
|
||||
if test -z "$dir_arg"; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
# It's OK to call `install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
trap '(exit $?); exit' 1 2 13 15
|
||||
|
||||
# Set umask so as not to create temps with too-generous modes.
|
||||
# However, 'strip' requires both read and write access to temps.
|
||||
case $mode in
|
||||
# Optimize common cases.
|
||||
*644) cp_umask=133;;
|
||||
*755) cp_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw='% 200'
|
||||
fi
|
||||
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||
*)
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw=,u+rw
|
||||
fi
|
||||
cp_umask=$mode$u_plus_rw;;
|
||||
esac
|
||||
fi
|
||||
|
||||
for src
|
||||
do
|
||||
# Protect names starting with `-'.
|
||||
case $src in
|
||||
-*) src=./$src ;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
dst=$src
|
||||
dstdir=$dst
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
if test ! -f "$src" && test ! -d "$src"; then
|
||||
echo "$0: $src does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$dstarg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dst=$dstarg
|
||||
# Protect names starting with `-'.
|
||||
case $dst in
|
||||
-*) dst=./$dst ;;
|
||||
esac
|
||||
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
if test -d "$dst"; then
|
||||
if test -n "$no_target_directory"; then
|
||||
echo "$0: $dstarg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dstdir=$dst
|
||||
dst=$dstdir/`basename "$src"`
|
||||
dstdir_status=0
|
||||
else
|
||||
# Prefer dirname, but fall back on a substitute if dirname fails.
|
||||
dstdir=`
|
||||
(dirname "$dst") 2>/dev/null ||
|
||||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||
X"$dst" : 'X\(//\)[^/]' \| \
|
||||
X"$dst" : 'X\(//\)$' \| \
|
||||
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
||||
echo X"$dst" |
|
||||
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)[^/].*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\).*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
s/.*/./; q'
|
||||
`
|
||||
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
obsolete_mkdir_used=false
|
||||
|
||||
if test $dstdir_status != 0; then
|
||||
case $posix_mkdir in
|
||||
'')
|
||||
# Create intermediate dirs using mode 755 as modified by the umask.
|
||||
# This is like FreeBSD 'install' as of 1997-10-28.
|
||||
umask=`umask`
|
||||
case $stripcmd.$umask in
|
||||
# Optimize common cases.
|
||||
*[2367][2367]) mkdir_umask=$umask;;
|
||||
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
mkdir_umask=`expr $umask + 22 \
|
||||
- $umask % 100 % 40 + $umask % 20 \
|
||||
- $umask % 10 % 4 + $umask % 2
|
||||
`;;
|
||||
*) mkdir_umask=$umask,go-w;;
|
||||
esac
|
||||
|
||||
# With -d, create the new directory with the user-specified mode.
|
||||
# Otherwise, rely on $mkdir_umask.
|
||||
if test -n "$dir_arg"; then
|
||||
mkdir_mode=-m$mode
|
||||
else
|
||||
mkdir_mode=
|
||||
fi
|
||||
|
||||
posix_mkdir=false
|
||||
case $umask in
|
||||
*[123567][0-7][0-7])
|
||||
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
||||
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
||||
;;
|
||||
*)
|
||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
|
||||
|
||||
if (umask $mkdir_umask &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
|
||||
then
|
||||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibilities with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writeable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
d????-?r-*) different_mode=700;;
|
||||
d????-?--*) different_mode=755;;
|
||||
*) false;;
|
||||
esac &&
|
||||
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
|
||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||
}
|
||||
}
|
||||
then posix_mkdir=:
|
||||
fi
|
||||
rmdir "$tmpdir/d" "$tmpdir"
|
||||
else
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
|
||||
fi
|
||||
trap '' 0;;
|
||||
esac;;
|
||||
esac
|
||||
|
||||
if
|
||||
$posix_mkdir && (
|
||||
umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||
)
|
||||
then :
|
||||
else
|
||||
|
||||
# The umask is ridiculous, or mkdir does not conform to POSIX,
|
||||
# or it failed possibly due to a race condition. Create the
|
||||
# directory the slow way, step by step, checking for races as we go.
|
||||
|
||||
case $dstdir in
|
||||
/*) prefix=/ ;;
|
||||
-*) prefix=./ ;;
|
||||
*) prefix= ;;
|
||||
esac
|
||||
|
||||
case $posix_glob in
|
||||
'')
|
||||
if (set -f) 2>/dev/null; then
|
||||
posix_glob=true
|
||||
else
|
||||
posix_glob=false
|
||||
fi ;;
|
||||
esac
|
||||
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
$posix_glob && set -f
|
||||
set fnord $dstdir
|
||||
shift
|
||||
$posix_glob && set +f
|
||||
IFS=$oIFS
|
||||
|
||||
prefixes=
|
||||
|
||||
for d
|
||||
do
|
||||
test -z "$d" && continue
|
||||
|
||||
prefix=$prefix$d
|
||||
if test -d "$prefix"; then
|
||||
prefixes=
|
||||
else
|
||||
if $posix_mkdir; then
|
||||
(umask=$mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||
# Don't fail if two instances are running concurrently.
|
||||
test -d "$prefix" || exit 1
|
||||
else
|
||||
case $prefix in
|
||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||
*) qprefix=$prefix;;
|
||||
esac
|
||||
prefixes="$prefixes '$qprefix'"
|
||||
fi
|
||||
fi
|
||||
prefix=$prefix/
|
||||
done
|
||||
|
||||
if test -n "$prefixes"; then
|
||||
# Don't fail if two instances are running concurrently.
|
||||
(umask $mkdir_umask &&
|
||||
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||
test -d "$dstdir" || exit 1
|
||||
obsolete_mkdir_used=true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
||||
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
||||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
||||
else
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=$dstdir/_inst.$$_
|
||||
rmtmp=$dstdir/_rm.$$_
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
|
||||
# Copy the file name to the temp name.
|
||||
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||
#
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
|
||||
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
|
||||
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
|
||||
&& { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
{ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
|
||||
|| {
|
||||
# The rename failed, perhaps because mv can't rename something else
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
if test -f "$dst"; then
|
||||
$doit $rmcmd -f "$dst" 2>/dev/null \
|
||||
|| { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
|
||||
&& { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
|
||||
|| {
|
||||
echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
else
|
||||
:
|
||||
fi
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
}
|
||||
} || exit 1
|
||||
|
||||
trap '' 0
|
||||
fi
|
||||
done
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
||||
367
m68k/config/missing
Executable file
367
m68k/config/missing
Executable file
@@ -0,0 +1,367 @@
|
||||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
|
||||
scriptversion=2006-05-10.23
|
||||
|
||||
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
|
||||
# Free Software Foundation, Inc.
|
||||
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# 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, 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., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
run=:
|
||||
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
|
||||
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
|
||||
|
||||
# In the cases where this matters, `missing' is being run in the
|
||||
# srcdir already.
|
||||
if test -f configure.ac; then
|
||||
configure_ac=configure.ac
|
||||
else
|
||||
configure_ac=configure.in
|
||||
fi
|
||||
|
||||
msg="missing on your system"
|
||||
|
||||
case $1 in
|
||||
--run)
|
||||
# Try to run requested program, and just exit if it succeeds.
|
||||
run=
|
||||
shift
|
||||
"$@" && exit 0
|
||||
# Exit code 63 means version mismatch. This often happens
|
||||
# when the user try to use an ancient version of a tool on
|
||||
# a file that requires a minimum version. In this case we
|
||||
# we should proceed has if the program had been absent, or
|
||||
# if --run hadn't been passed.
|
||||
if test $? = 63; then
|
||||
run=:
|
||||
msg="probably too old"
|
||||
fi
|
||||
;;
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||
error status if there is no known handling for PROGRAM.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
--run try to run the given command, and emulate it if it fails
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal touch file \`aclocal.m4'
|
||||
autoconf touch file \`configure'
|
||||
autoheader touch file \`config.h.in'
|
||||
autom4te touch the output file, or create a stub one
|
||||
automake touch all \`Makefile.in' files
|
||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
flex create \`lex.yy.c', if possible, from existing .c
|
||||
help2man touch the output file
|
||||
lex create \`lex.yy.c', if possible, from existing .c
|
||||
makeinfo touch the output file
|
||||
tar try tar, gnutar, gtar, then tar without non-portable flags
|
||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
|
||||
Send bug reports to <bug-automake@gnu.org>."
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||
echo "missing $scriptversion (GNU Automake)"
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: Unknown \`$1' option"
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# Now exit if we have it, but it failed. Also exit now if we
|
||||
# don't have it and --version was passed (most likely to detect
|
||||
# the program).
|
||||
case $1 in
|
||||
lex|yacc)
|
||||
# Not GNU programs, they don't have --version.
|
||||
;;
|
||||
|
||||
tar)
|
||||
if test -n "$run"; then
|
||||
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
# Could not run --version or --help. This is probably someone
|
||||
# running `$TOOL --version' or `$TOOL --help' to check whether
|
||||
# $TOOL exists and not knowing $TOOL uses missing.
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# If it does not exist, or fails to run (possibly an outdated version),
|
||||
# try to emulate it.
|
||||
case $1 in
|
||||
aclocal*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`${configure_ac}'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case $f in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
autom4te)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, but is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them.
|
||||
You can get \`$1' as part of \`Autoconf' from any GNU
|
||||
archive site."
|
||||
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo "#! /bin/sh"
|
||||
echo "# Created by GNU Automake missing as a replacement of"
|
||||
echo "# $ $@"
|
||||
echo "exit 0"
|
||||
chmod +x $file
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
bison|yacc)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' $msg. You should only need it if
|
||||
you modified a \`.y' file. You may need the \`Bison' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Bison' from any GNU archive site."
|
||||
rm -f y.tab.c y.tab.h
|
||||
if test $# -ne 1; then
|
||||
eval LASTARG="\${$#}"
|
||||
case $LASTARG in
|
||||
*.y)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" y.tab.c
|
||||
fi
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" y.tab.h
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test ! -f y.tab.h; then
|
||||
echo >y.tab.h
|
||||
fi
|
||||
if test ! -f y.tab.c; then
|
||||
echo 'main() { return 0; }' >y.tab.c
|
||||
fi
|
||||
;;
|
||||
|
||||
lex|flex)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.l' file. You may need the \`Flex' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Flex' from any GNU archive site."
|
||||
rm -f lex.yy.c
|
||||
if test $# -ne 1; then
|
||||
eval LASTARG="\${$#}"
|
||||
case $LASTARG in
|
||||
*.l)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" lex.yy.c
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test ! -f lex.yy.c; then
|
||||
echo 'main() { return 0; }' >lex.yy.c
|
||||
fi
|
||||
;;
|
||||
|
||||
help2man)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a dependency of a manual page. You may need the
|
||||
\`Help2man' package in order for those modifications to take
|
||||
effect. You can get \`Help2man' from any GNU archive site."
|
||||
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo ".ab help2man is required to generate this page"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
makeinfo)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
# The file to touch is that specified with -o ...
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -z "$file"; then
|
||||
# ... or it is the one specified with @setfilename ...
|
||||
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '
|
||||
/^@setfilename/{
|
||||
s/.* \([^ ]*\) *$/\1/
|
||||
p
|
||||
q
|
||||
}' $infile`
|
||||
# ... or it is derived from the source name (dir/f.texi becomes f.info)
|
||||
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
|
||||
fi
|
||||
# If the file does not exist, the user really needs makeinfo;
|
||||
# let's fail without touching anything.
|
||||
test -f $file || exit 1
|
||||
touch $file
|
||||
;;
|
||||
|
||||
tar)
|
||||
shift
|
||||
|
||||
# We have already tried tar in the generic part.
|
||||
# Look for gnutar/gtar before invocation to avoid ugly error
|
||||
# messages.
|
||||
if (gnutar --version > /dev/null 2>&1); then
|
||||
gnutar "$@" && exit 0
|
||||
fi
|
||||
if (gtar --version > /dev/null 2>&1); then
|
||||
gtar "$@" && exit 0
|
||||
fi
|
||||
firstarg="$1"
|
||||
if shift; then
|
||||
case $firstarg in
|
||||
*o*)
|
||||
firstarg=`echo "$firstarg" | sed s/o//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
case $firstarg in
|
||||
*h*)
|
||||
firstarg=`echo "$firstarg" | sed s/h//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
||||
You may want to install GNU tar or Free paxutils, or check the
|
||||
command line arguments."
|
||||
exit 1
|
||||
;;
|
||||
|
||||
*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them. Check the \`README' file,
|
||||
it often tells you about the needed prerequisites for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing \`$1' program."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
||||
161
m68k/config/mkinstalldirs
Executable file
161
m68k/config/mkinstalldirs
Executable file
@@ -0,0 +1,161 @@
|
||||
#! /bin/sh
|
||||
# mkinstalldirs --- make directory hierarchy
|
||||
|
||||
scriptversion=2006-05-11.19
|
||||
|
||||
# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
|
||||
# Created: 1993-05-16
|
||||
# Public domain.
|
||||
#
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
nl='
|
||||
'
|
||||
IFS=" "" $nl"
|
||||
errstatus=0
|
||||
dirmode=
|
||||
|
||||
usage="\
|
||||
Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
|
||||
|
||||
Create each directory DIR (with mode MODE, if specified), including all
|
||||
leading file name components.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>."
|
||||
|
||||
# process command line arguments
|
||||
while test $# -gt 0 ; do
|
||||
case $1 in
|
||||
-h | --help | --h*) # -h for help
|
||||
echo "$usage"
|
||||
exit $?
|
||||
;;
|
||||
-m) # -m PERM arg
|
||||
shift
|
||||
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
|
||||
dirmode=$1
|
||||
shift
|
||||
;;
|
||||
--version)
|
||||
echo "$0 $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
--) # stop option processing
|
||||
shift
|
||||
break
|
||||
;;
|
||||
-*) # unknown option
|
||||
echo "$usage" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
*) # first non-opt arg
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
for file
|
||||
do
|
||||
if test -d "$file"; then
|
||||
shift
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
case $# in
|
||||
0) exit 0 ;;
|
||||
esac
|
||||
|
||||
# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
|
||||
# mkdir -p a/c at the same time, both will detect that a is missing,
|
||||
# one will create a, then the other will try to create a and die with
|
||||
# a "File exists" error. This is a problem when calling mkinstalldirs
|
||||
# from a parallel make. We use --version in the probe to restrict
|
||||
# ourselves to GNU mkdir, which is thread-safe.
|
||||
case $dirmode in
|
||||
'')
|
||||
if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
|
||||
echo "mkdir -p -- $*"
|
||||
exec mkdir -p -- "$@"
|
||||
else
|
||||
# On NextStep and OpenStep, the `mkdir' command does not
|
||||
# recognize any option. It will interpret all options as
|
||||
# directories to create, and then abort because `.' already
|
||||
# exists.
|
||||
test -d ./-p && rmdir ./-p
|
||||
test -d ./--version && rmdir ./--version
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
|
||||
test ! -d ./--version; then
|
||||
echo "mkdir -m $dirmode -p -- $*"
|
||||
exec mkdir -m "$dirmode" -p -- "$@"
|
||||
else
|
||||
# Clean up after NextStep and OpenStep mkdir.
|
||||
for d in ./-m ./-p ./--version "./$dirmode";
|
||||
do
|
||||
test -d $d && rmdir $d
|
||||
done
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
for file
|
||||
do
|
||||
case $file in
|
||||
/*) pathcomp=/ ;;
|
||||
*) pathcomp= ;;
|
||||
esac
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
set fnord $file
|
||||
shift
|
||||
IFS=$oIFS
|
||||
|
||||
for d
|
||||
do
|
||||
test "x$d" = x && continue
|
||||
|
||||
pathcomp=$pathcomp$d
|
||||
case $pathcomp in
|
||||
-*) pathcomp=./$pathcomp ;;
|
||||
esac
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
echo "mkdir $pathcomp"
|
||||
|
||||
mkdir "$pathcomp" || lasterr=$?
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
errstatus=$lasterr
|
||||
else
|
||||
if test ! -z "$dirmode"; then
|
||||
echo "chmod $dirmode $pathcomp"
|
||||
lasterr=
|
||||
chmod "$dirmode" "$pathcomp" || lasterr=$?
|
||||
|
||||
if test ! -z "$lasterr"; then
|
||||
errstatus=$lasterr
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
pathcomp=$pathcomp/
|
||||
done
|
||||
done
|
||||
|
||||
exit $errstatus
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
||||
223
m68k/config/ylwrap
Executable file
223
m68k/config/ylwrap
Executable file
@@ -0,0 +1,223 @@
|
||||
#! /bin/sh
|
||||
# ylwrap - wrapper for lex/yacc invocations.
|
||||
|
||||
scriptversion=2005-05-14.22
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||
#
|
||||
# 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, 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., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
case "$1" in
|
||||
'')
|
||||
echo "$0: No files given. Try \`$0 --help' for more information." 1>&2
|
||||
exit 1
|
||||
;;
|
||||
--basedir)
|
||||
basedir=$2
|
||||
shift 2
|
||||
;;
|
||||
-h|--h*)
|
||||
cat <<\EOF
|
||||
Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]...
|
||||
|
||||
Wrapper for lex/yacc invocations, renaming files as desired.
|
||||
|
||||
INPUT is the input file
|
||||
OUTPUT is one file PROG generates
|
||||
DESIRED is the file we actually want instead of OUTPUT
|
||||
PROGRAM is program to run
|
||||
ARGS are passed to PROG
|
||||
|
||||
Any number of OUTPUT,DESIRED pairs may be used.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v|--v*)
|
||||
echo "ylwrap $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
# The input.
|
||||
input="$1"
|
||||
shift
|
||||
case "$input" in
|
||||
[\\/]* | ?:[\\/]*)
|
||||
# Absolute path; do nothing.
|
||||
;;
|
||||
*)
|
||||
# Relative path. Make it absolute.
|
||||
input="`pwd`/$input"
|
||||
;;
|
||||
esac
|
||||
|
||||
pairlist=
|
||||
while test "$#" -ne 0; do
|
||||
if test "$1" = "--"; then
|
||||
shift
|
||||
break
|
||||
fi
|
||||
pairlist="$pairlist $1"
|
||||
shift
|
||||
done
|
||||
|
||||
# The program to run.
|
||||
prog="$1"
|
||||
shift
|
||||
# Make any relative path in $prog absolute.
|
||||
case "$prog" in
|
||||
[\\/]* | ?:[\\/]*) ;;
|
||||
*[\\/]*) prog="`pwd`/$prog" ;;
|
||||
esac
|
||||
|
||||
# FIXME: add hostname here for parallel makes that run commands on
|
||||
# other machines. But that might take us over the 14-char limit.
|
||||
dirname=ylwrap$$
|
||||
trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15
|
||||
mkdir $dirname || exit 1
|
||||
|
||||
cd $dirname
|
||||
|
||||
case $# in
|
||||
0) $prog "$input" ;;
|
||||
*) $prog "$@" "$input" ;;
|
||||
esac
|
||||
ret=$?
|
||||
|
||||
if test $ret -eq 0; then
|
||||
set X $pairlist
|
||||
shift
|
||||
first=yes
|
||||
# Since DOS filename conventions don't allow two dots,
|
||||
# the DOS version of Bison writes out y_tab.c instead of y.tab.c
|
||||
# and y_tab.h instead of y.tab.h. Test to see if this is the case.
|
||||
y_tab_nodot="no"
|
||||
if test -f y_tab.c || test -f y_tab.h; then
|
||||
y_tab_nodot="yes"
|
||||
fi
|
||||
|
||||
# The directory holding the input.
|
||||
input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'`
|
||||
# Quote $INPUT_DIR so we can use it in a regexp.
|
||||
# FIXME: really we should care about more than `.' and `\'.
|
||||
input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'`
|
||||
|
||||
while test "$#" -ne 0; do
|
||||
from="$1"
|
||||
# Handle y_tab.c and y_tab.h output by DOS
|
||||
if test $y_tab_nodot = "yes"; then
|
||||
if test $from = "y.tab.c"; then
|
||||
from="y_tab.c"
|
||||
else
|
||||
if test $from = "y.tab.h"; then
|
||||
from="y_tab.h"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test -f "$from"; then
|
||||
# If $2 is an absolute path name, then just use that,
|
||||
# otherwise prepend `../'.
|
||||
case "$2" in
|
||||
[\\/]* | ?:[\\/]*) target="$2";;
|
||||
*) target="../$2";;
|
||||
esac
|
||||
|
||||
# We do not want to overwrite a header file if it hasn't
|
||||
# changed. This avoid useless recompilations. However the
|
||||
# parser itself (the first file) should always be updated,
|
||||
# because it is the destination of the .y.c rule in the
|
||||
# Makefile. Divert the output of all other files to a temporary
|
||||
# file so we can compare them to existing versions.
|
||||
if test $first = no; then
|
||||
realtarget="$target"
|
||||
target="tmp-`echo $target | sed s/.*[\\/]//g`"
|
||||
fi
|
||||
# Edit out `#line' or `#' directives.
|
||||
#
|
||||
# We don't want the resulting debug information to point at
|
||||
# an absolute srcdir; it is better for it to just mention the
|
||||
# .y file with no path.
|
||||
#
|
||||
# We want to use the real output file name, not yy.lex.c for
|
||||
# instance.
|
||||
#
|
||||
# We want the include guards to be adjusted too.
|
||||
FROM=`echo "$from" | sed \
|
||||
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
|
||||
-e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
|
||||
TARGET=`echo "$2" | sed \
|
||||
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
|
||||
-e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
|
||||
|
||||
sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \
|
||||
-e "s,$FROM,$TARGET," "$from" >"$target" || ret=$?
|
||||
|
||||
# Check whether header files must be updated.
|
||||
if test $first = no; then
|
||||
if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
|
||||
echo "$2" is unchanged
|
||||
rm -f "$target"
|
||||
else
|
||||
echo updating "$2"
|
||||
mv -f "$target" "$realtarget"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
# A missing file is only an error for the first file. This
|
||||
# is a blatant hack to let us support using "yacc -d". If -d
|
||||
# is not specified, we don't want an error when the header
|
||||
# file is "missing".
|
||||
if test $first = yes; then
|
||||
ret=1
|
||||
fi
|
||||
fi
|
||||
shift
|
||||
shift
|
||||
first=no
|
||||
done
|
||||
else
|
||||
ret=$?
|
||||
fi
|
||||
|
||||
# Remove the directory.
|
||||
cd ..
|
||||
rm -rf $dirname
|
||||
|
||||
exit $ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
||||
9817
m68k/configure
vendored
Executable file
9817
m68k/configure
vendored
Executable file
File diff suppressed because it is too large
Load Diff
331
m68k/configure.ac
Normal file
331
m68k/configure.ac
Normal file
@@ -0,0 +1,331 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl
|
||||
dnl Use the config/bootstrap file to generate the configure.
|
||||
dnl
|
||||
dnl This file is part of a free BDM package
|
||||
dnl
|
||||
dnl This program is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
dnl GNU General Public License for more details.
|
||||
|
||||
AC_PREREQ(2.59)
|
||||
AC_INIT([m68k-bdm],[1.4.0],[bdm-devel@lists.sourceforge.net])
|
||||
AC_CONFIG_AUX_DIR(config)
|
||||
AC_CANONICAL_TARGET([])
|
||||
AM_INIT_AUTOMAKE([-Wall -Wno-portability -Wno-unsupported dist-bzip2 dist-zip])
|
||||
|
||||
AC_CONFIG_HEADERS(config.h:config.h.in)
|
||||
|
||||
AC_PROG_CC
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LEX()
|
||||
|
||||
dnl bernie: we should fix all warnings before enabling this
|
||||
dnl AX_CFLAGS_WARN_ALL
|
||||
|
||||
CFLAGS=${CFLAGS-"-Wall -O2 -g"}
|
||||
AC_CHECK_TOOL(CC, gcc, gcc)
|
||||
AC_SUBST(CC)
|
||||
AC_SUBST(CFLAGS)
|
||||
|
||||
AC_CHECK_TOOL(AR, ar, ar)
|
||||
AC_SUBST(AR)
|
||||
AC_CHECK_TOOL(AS, as, as)
|
||||
AC_SUBST(AS)
|
||||
AC_CHECK_TOOL(RANLIB, ranlib, ranlib)
|
||||
AC_SUBST(RANLIB)
|
||||
AC_CHECK_TOOL(LD, ld, ld)
|
||||
AC_SUBST(LD)
|
||||
|
||||
AM_PROG_CC_C_O
|
||||
|
||||
dnl
|
||||
dnl Used in the gdbserver.
|
||||
dnl
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(sys/ioctl.h)
|
||||
AC_CHECK_HEADERS(sys/file.h)
|
||||
AC_CHECK_HEADERS(netinet/in.h)
|
||||
AC_CHECK_HEADERS(sys/socket.h)
|
||||
AC_CHECK_HEADERS(netdb.h)
|
||||
AC_CHECK_HEADERS(netinet/tcp.h)
|
||||
AC_CHECK_HEADERS(sys/ioctl.h)
|
||||
AC_CHECK_HEADERS(signal.h)
|
||||
AC_CHECK_HEADERS(fcntl.h)
|
||||
AC_CHECK_HEADERS(unistd.h)
|
||||
AC_CHECK_HEADERS(arpa/inet.h)
|
||||
AC_CHECK_HEADERS(errno.h)
|
||||
AC_CHECK_HEADERS(termios.h)
|
||||
AC_CHECK_HEADERS(termio.h)
|
||||
AC_CHECK_HEADERS(sgtty.h)
|
||||
AC_CHECK_DECLS([strerror, perror])
|
||||
AC_CHECK_TYPES(socklen_t, [], [],
|
||||
[#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl Handle our configuration options.
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(debug,
|
||||
[ --enable-debug Turn on debug information (enabled)],
|
||||
[case "${enableval}" in
|
||||
yes) debug=true ;;
|
||||
no) debug=false ;;
|
||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
|
||||
esac],
|
||||
[debug=true])
|
||||
|
||||
AC_ARG_ENABLE(remote,
|
||||
[ --enable-remote Turn on the remote protocol (enabled)],
|
||||
[case "${enableval}" in
|
||||
yes) bdm_remote=true ;;
|
||||
no) bdm_remote=false ;;
|
||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-remote) ;;
|
||||
esac],
|
||||
[bdm_remote=true])
|
||||
|
||||
AM_CONDITIONAL(BDM_REMOTE, test x$bdm_remote = xtrue)
|
||||
|
||||
AC_CHECK_FUNCS(ioperm)
|
||||
|
||||
case ${host} in
|
||||
*freebsd*)
|
||||
ac_ioperm=yes
|
||||
;;
|
||||
*)
|
||||
if test "$ac_cv_func_ioperm" = yes; then
|
||||
ac_ioperm=yes
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_MSG_CHECKING([direct ioperm hardware access])
|
||||
AC_ARG_ENABLE(ioperm,
|
||||
[ --enable-ioperm Turn on direct ioperm hardware access (autodetected)],
|
||||
[case "${enableval}" in
|
||||
yes)
|
||||
AC_MSG_RESULT([yes (enabled by user)])
|
||||
bdm_ioperm=true
|
||||
;;
|
||||
no)
|
||||
AC_MSG_RESULT([no (disabled by user)])
|
||||
bdm_ioperm=false
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR(bad value ${enableval} for --enable-ioperm)
|
||||
;;
|
||||
esac],
|
||||
[
|
||||
if test "$ac_ioperm" = yes; then
|
||||
AC_MSG_RESULT([yes (autodetected)])
|
||||
bdm_ioperm=true
|
||||
else
|
||||
AC_MSG_RESULT([no (autodetected)])
|
||||
bdm_ioperm=false
|
||||
fi
|
||||
])
|
||||
|
||||
AM_CONDITIONAL(BDM_IOPERM, test x$bdm_ioperm = xtrue)
|
||||
|
||||
AC_MSG_CHECKING([for kernel driver support])
|
||||
AC_ARG_ENABLE(driver,
|
||||
[ --enable-driver Turn on driver support (autodetected)],
|
||||
[case "${enableval}" in
|
||||
yes)
|
||||
AC_MSG_RESULT([yes (enabled by user)])
|
||||
bdm_driver=true
|
||||
;;
|
||||
no)
|
||||
AC_MSG_RESULT([no (disabled by user)])
|
||||
bdm_driver=false
|
||||
;;
|
||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-driver) ;;
|
||||
esac],
|
||||
[
|
||||
case "$target_os" in
|
||||
darwin*)
|
||||
AC_MSG_RESULT([no (autodetected)])
|
||||
bdm_driver=false
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([yes (autodetected)])
|
||||
bdm_driver=true
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
AM_CONDITIONAL(BDM_DRIVER, test x$bdm_driver = xtrue)
|
||||
|
||||
AC_ARG_ENABLE(server,
|
||||
[ --enable-server Turn on server support (enabled)],
|
||||
[case "${enableval}" in
|
||||
yes) bdm_server=true ;;
|
||||
no) bdm_server=false ;;
|
||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-server) ;;
|
||||
esac],
|
||||
[bdm_server=true])
|
||||
|
||||
AC_ARG_ENABLE(bdmctrl,
|
||||
[ --enable-bdmctrl Turn on bdmctrl support (disabled)],
|
||||
[case "${enableval}" in
|
||||
yes) bdm_bdmctrl=true ;;
|
||||
no) bdm_bdmctrl=false ;;
|
||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-bdmctrl) ;;
|
||||
esac],
|
||||
[bdm_bdmctrl=true])
|
||||
|
||||
AM_CONDITIONAL(BDMCTRL, test x$bdm_bdmctrl = xtrue)
|
||||
|
||||
AC_ARG_ENABLE(flashlib,
|
||||
[ --enable-flashlib Turn on flashlib support (enabled)],
|
||||
[case "${enableval}" in
|
||||
yes) bdm_flashlib=true ;;
|
||||
no) bdm_flashlib=false ;;
|
||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-flashlib) ;;
|
||||
esac],
|
||||
[bdm_flashlib=true])
|
||||
|
||||
AM_CONDITIONAL(BDMFLASHLIB, test x$bdm_flashlib = xtrue)
|
||||
|
||||
AC_ARG_ENABLE(bdmflash,
|
||||
[ --enable-bdmflash Build the bdmflash utility (enabled)],
|
||||
[case "${enableval}" in
|
||||
yes) bdm_bdmflash=true ;;
|
||||
no) bdm_bdmflash=false ;;
|
||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-bdmflash) ;;
|
||||
esac],
|
||||
[bdm_bdmflash=true])
|
||||
|
||||
AC_ARG_ENABLE(bdmmon,
|
||||
[ --enable-bdmmon Build the bdmmon utility (enabled)],
|
||||
[case "${enableval}" in
|
||||
yes) bdm_bdmmon=true ;;
|
||||
no) bdm_bdmmon=false ;;
|
||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-bdmmon) ;;
|
||||
esac],
|
||||
[bdm_bdmmon=true])
|
||||
|
||||
AM_CONDITIONAL(BDMFLASH, test x$bdm_bdmflash = xtrue)
|
||||
|
||||
AS_IF([test x$LEX != xflex], [bdm_bdmmon=false])
|
||||
AM_CONDITIONAL(BDMMON, test x$bdm_bdmmon = xtrue)
|
||||
|
||||
AC_ARG_ENABLE(gdbserver,
|
||||
[ --enable-gdbserver Build the GDB Remote Server (enabled)],
|
||||
[case "${enableval}" in
|
||||
yes) bdm_gdbserver=true ;;
|
||||
no) bdm_gdbserver=false ;;
|
||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-gdbserver) ;;
|
||||
esac],
|
||||
[bdm_gdbserver=true])
|
||||
|
||||
AM_CONDITIONAL(GDBSERVER, test x$bdm_gdbserver = xtrue)
|
||||
|
||||
AC_ARG_ENABLE(tblcf,
|
||||
[ --enable-tblcf Build the Turbo BDM Light Coldfire USB driver (enabled)],
|
||||
[case "${enableval}" in
|
||||
yes) bdm_tblcf=true ;;
|
||||
no) bdm_tblcf=false ;;
|
||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-tblcf) ;;
|
||||
esac],
|
||||
[bdm_tblcf=true])
|
||||
|
||||
case ${host} in
|
||||
*mingw*)
|
||||
ac_libusb_include_dir_part=include
|
||||
ac_libusb_lib_dir=lib/gcc
|
||||
;;
|
||||
*)
|
||||
ac_libusb_include_dir_part=include
|
||||
ac_libusb_lib_dir=lib
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_ARG_WITH(libusb-dir,
|
||||
[ --with-libusb-dir=DIR path for libusb package ($ac_libusb_include_dir_part/usb.h, $ac_libusb_lib_dir/libusb.a)],
|
||||
[ ac_libusb_include_dir=$withval/$ac_libusb_include_dir_part
|
||||
ac_libusb_lib_dir=$withval/$ac_libusb_lib_dir ],
|
||||
[ ac_libusb_include_dir=NONE
|
||||
ac_libusb_lib_dir=NONE ]
|
||||
)
|
||||
|
||||
AS_IF([test x$bdm_tblcf = xtrue],
|
||||
[AS_IF([test "$ac_libusb_include_dir" != "NONE"],
|
||||
[ac_tmp_ldflags=${LDFLAGS}
|
||||
LDFLAGS="$LDFLAGS -L $ac_libusb_lib_dir"])
|
||||
AC_CHECK_LIB(usb, usb_init, ,
|
||||
[AC_MSG_ERROR([Could not find libusb. Try --with-libusb-dir.])])
|
||||
AS_IF([test "$ac_libusb_include_dir" != "NONE"],
|
||||
[LDFLAGS=$ac_tmp_ldflags])])
|
||||
|
||||
AM_CONDITIONAL(TBLCF_USB, test x$bdm_tblcf = xtrue)
|
||||
|
||||
AM_CONDITIONAL(LIBUSB_PATH, test $ac_libusb_include_dir != NONE)
|
||||
AC_SUBST(LIBUSB_INCLUDE_DIR, "${ac_libusb_include_dir}")
|
||||
AC_SUBST(LIBUSB_LIB_DIR, "${ac_libusb_lib_dir}")
|
||||
|
||||
dnl
|
||||
dnl If on a Win32 target such as MinGW do not build
|
||||
dnl the server.
|
||||
dnl
|
||||
|
||||
case ${host} in
|
||||
*mingw*)
|
||||
bdm_win32=true
|
||||
bdm_server=false
|
||||
;;
|
||||
*)
|
||||
bdm_win32=false
|
||||
;;
|
||||
esac
|
||||
|
||||
AM_CONDITIONAL(WIN32, test x$bdm_win32 = xtrue)
|
||||
|
||||
dnl
|
||||
dnl Collect list of subdirectories to build
|
||||
dnl
|
||||
bdm_subdirs="lib"
|
||||
AS_IF([test x$bdm_tblcf = xtrue], bdm_subdirs="${bdm_subdirs} tblcf")
|
||||
AS_IF([test x$bdm_server = xtrue], bdm_subdirs="${bdm_subdirs} server")
|
||||
AS_IF([test x$bdm_flashlib = xtrue], bdm_subdirs="${bdm_subdirs} flashlib")
|
||||
AS_IF([test x$bdm_bdmflash = xtrue -o x$bdm_bdmmon = xtrue],
|
||||
bdm_subdirs="${bdm_subdirs} bdmabstraction")
|
||||
AS_IF([test x$bdm_gdbserver = xtrue], bdm_subdirs="${bdm_subdirs} gdbserver")
|
||||
bdm_subdirs="libelf ${bdm_subdirs} test utils"
|
||||
AC_SUBST(BDM_SUBDIRS, ${bdm_subdirs})
|
||||
|
||||
dnl
|
||||
dnl Configure libelf
|
||||
dnl
|
||||
AC_CONFIG_SUBDIRS(libelf)
|
||||
|
||||
dnl
|
||||
dnl Check if a m68k GCC compiler is present and can be used.
|
||||
dnl
|
||||
|
||||
AC_PATH_PROGS([flash_plugin_cc],
|
||||
[m68k-elf-gcc m68k-rtems4.9-gcc m68k-rtems4.8-gcc],
|
||||
[none],
|
||||
[/usr/local/bin:/opt/rtems-4.9/bin:/opt/rtems-4.8/bin])
|
||||
AM_CONDITIONAL(BUILD_FLASH_PLUGINS, test x${flash_plugin_cc} != xnone)
|
||||
AC_SUBST(FLASH_PLUGIN_GCC, ${flash_plugin_cc})
|
||||
|
||||
dnl
|
||||
dnl Output the Makefiles and config.h.
|
||||
dnl
|
||||
|
||||
AC_CONFIG_FILES(Makefile \
|
||||
flashlib/Makefile \
|
||||
lib/Makefile \
|
||||
tblcf/Makefile \
|
||||
server/Makefile \
|
||||
gdbserver/Makefile \
|
||||
test/Makefile \
|
||||
bdmabstraction/Makefile \
|
||||
utils/Makefile)
|
||||
|
||||
AC_OUTPUT
|
||||
224
m68k/driver/ChangeLog
Normal file
224
m68k/driver/ChangeLog
Normal file
@@ -0,0 +1,224 @@
|
||||
2004-04-24 Bernardo Innocenti <bernie@develer.com>
|
||||
|
||||
* bdm.c: Fix CPU32 with ICD cable. Contributed by Aaron J. Grier
|
||||
<aaron@frye.com>.
|
||||
|
||||
2004-04-18 Bernardo Innocenti <bernie@develer.com>
|
||||
|
||||
* openbsd/openbsd-bdm.c: Add OpenBSD driver derived from the FreeBSD
|
||||
driver by an unknown author. Contributed by Aaron J. Grier
|
||||
<aaron@frye.com>.
|
||||
|
||||
2001-12-12 Chris Johns <cjohns@ybertec.com.au>
|
||||
|
||||
* bdm.c: ICD step fix from Thomas Andrews (tandrews@mindspring.co.za).
|
||||
|
||||
2001-04-15 Chris Johns <cjohns@cybertec.com.au>
|
||||
|
||||
* bdm.c: Merged Keith Outwater performance changes into the driver.
|
||||
|
||||
2000-11-15 Chris Johns <ccj@acm.org>
|
||||
|
||||
* bdm.h:
|
||||
The driver ver, cpu type and if type ioctls were the wrong size.
|
||||
|
||||
* bdm.h: New version.
|
||||
|
||||
* bdm.c: Changes to support FreeBSD's memcpy in kernel type operations.
|
||||
Fixed a bug with return of error codes in the ioctl handler.
|
||||
|
||||
2000-09-02 Chris Johns <ccj@acm.org>
|
||||
|
||||
* bdm.c: ICD fixes from Alexander Aganichev <aaganichev@hypercom.com>.
|
||||
|
||||
* bdm.h: New version.
|
||||
Fixed ICD spelling. Patch from Alexander Aganichev <aaganichev@hypercom.com>.
|
||||
|
||||
2000-08-31 Chris Johns <ccj@acm.org>
|
||||
|
||||
* bdm.h: New version.
|
||||
|
||||
22000-08-03 Chris Johns <ccj@acm.org>
|
||||
|
||||
* bdm.h: New minor version number.
|
||||
|
||||
* bdm.c:
|
||||
Changed the CF ctrl port init value to 0x00. This value is correct.
|
||||
Merged an IDC patch from Adam Kropelin <akropel1@rochester.rr.com>.
|
||||
|
||||
2000-06-27 Chris Johns <ccj@acm.org>
|
||||
|
||||
* bdm.c: Changed the control register default value to 0x0f which
|
||||
allowed the driver to work on a DELL 500MHz Pentium III
|
||||
machine.
|
||||
|
||||
2000-06-25 Chris Johns <ccj@acm.org>
|
||||
|
||||
* bdm.h: New version for the CF long reset.
|
||||
|
||||
* bdm.c:
|
||||
Slowed the reset down on the Coldfire. The PLL needs time to up.
|
||||
|
||||
2000-05-31 Chris Johns <ccj@acm.org>
|
||||
|
||||
* bdm.c, bdm.h: Support for IDC added.
|
||||
|
||||
2000-05-27 Chris Johns <ccj@acm.org>
|
||||
|
||||
* bdm.c: Change all bdm* functions to bdmDev* to stop clashes
|
||||
Win9x builds.
|
||||
|
||||
2000-05-18 Chris Johns <ccj@acm.org>
|
||||
|
||||
* bdm.h: Error bits as shifted values.
|
||||
New version.
|
||||
|
||||
2000-05-17 Chris Johns <ccj@acm.org>
|
||||
|
||||
* bdm.c: Moved Coldfire variables in struct BDM for multi port support.
|
||||
Added Coldfire debug module version detection and then
|
||||
selection of PST support based on it. Ver B uses PST (5307).
|
||||
Longer reset delays.
|
||||
Removed setting the DSI signal to 0 on each bit.
|
||||
Added support to detect false halt conditions by attempting
|
||||
to read the PC twice. If you can the target has halted.
|
||||
The cache is invalidated only if it is enabled.
|
||||
Debug trace clean ups.
|
||||
|
||||
2000-03-30 Chris Johns <ccj@acm.org>
|
||||
|
||||
* bdm.h: Added the timeout error code. This is used by the remote
|
||||
interface.
|
||||
|
||||
* bdm.c: Changed the delay in the hardware init for the CPU32.
|
||||
|
||||
2000-03-30 Chris Johns <ccj@acm.org>
|
||||
|
||||
* Makefile: Added the USE_PST support. Moved to clean OS structure.
|
||||
|
||||
* linux-bdm.c: New file.
|
||||
|
||||
12000-03-30 Chris Johns <ccj@acm.org>
|
||||
|
||||
* bdm.h: Added the timeout error code. This is used by the remote
|
||||
interface.
|
||||
|
||||
* bdm.c: Changed the delay in the hardware init for the CPU32.
|
||||
|
||||
1999-10-23 Chris Johns <ccj@acm.org>
|
||||
|
||||
* bdm.c:
|
||||
Remved the Linux specific parts to allow easier OS integration.
|
||||
|
||||
* bdm.h: Merged in the SCO changes.
|
||||
|
||||
1999-05-25 source <ccj@acm.org>
|
||||
|
||||
* Makefile:
|
||||
It seems that depmod complains about unresolved symbols even
|
||||
when the driver loads and works properly. I don't know what's
|
||||
changed in Linux to cause this, but for now just get rid of
|
||||
the depmod.
|
||||
|
||||
1999-03-18 Chris Johns <ccj@acm.org>
|
||||
|
||||
* bdm.c: Add support for 2.2.xx kernels.
|
||||
|
||||
Fri Jan 15 05:43:55 1999 Chris Johns <ccj@acm.org>
|
||||
|
||||
* bdm.c:
|
||||
Added Coldfire support to invalidate the cache when get status detects
|
||||
a change of state from running to stopped, or when go or step commands
|
||||
are issued.
|
||||
|
||||
Sat Jan 9 03:04:03 1999 Chris Johns <ccj@acm.org>
|
||||
|
||||
* bdm.c: Remove the `sti()' calls in the `bdm_sleep' function.
|
||||
|
||||
Tue Jan 5 07:39:40 1999 Chris Johns <ccj@acm.org>
|
||||
|
||||
* bdm.h, bdm.c: Merged David Fiddes 5307 bkpt signal hold patch.
|
||||
|
||||
Sat Dec 12 04:23:28 1998 Chris Johns <ccj@acm.org>
|
||||
|
||||
* bdm.c: Fixed the region control logic in open.
|
||||
Fixed printing csr.
|
||||
Extended some of the timeouts in the CF driver.
|
||||
Fixed some incorrect labels.
|
||||
Fixed a lock up bug after a bus error.
|
||||
|
||||
* bdm.h: New version.
|
||||
|
||||
* Makefile: Fixed the modversions.
|
||||
|
||||
Sat Oct 31 05:06:15 1998 Chris Johns <ccj@acm.org>
|
||||
|
||||
* Makefile: Always over-write the installed header and lib.
|
||||
|
||||
* bdm.c: Fixed tabs, and forced the SR to be 16bit.
|
||||
|
||||
Sun Oct 18 04:38:00 1998 Chris Johns <ccj@acm.org>
|
||||
|
||||
* bdm.c: Added support for generating a bus if no repsonse is
|
||||
always being returned from the BDM module.
|
||||
|
||||
Wed Oct 14 14:32:04 1998 Chris Johns <ccj@acm.org>
|
||||
|
||||
* bdm.c: Mask pending interrupts in single-step mode.
|
||||
Fixed the status handling. It now uses the csr register. It is cached
|
||||
to handle the fact the status bits are set for only one read.
|
||||
|
||||
Wed Oct 14 10:55:33 1998 Chris Johns <ccj@acm.org>
|
||||
|
||||
* bdm.c:
|
||||
Added support for the Coldfire BDM and P&E interface. This has only
|
||||
been tested inthe 5206.
|
||||
|
||||
* bdm.h: Added support for the Coldfire BDM.
|
||||
|
||||
* Makefile: Changed the prefix to the default of /usr.
|
||||
|
||||
Fri Oct 31 20:58:23 1997 eric <eric@skatter.usask.ca>
|
||||
|
||||
* Makefile: Fit into RTEMS distribution.
|
||||
|
||||
Thu Aug 21 15:38:28 1997 eric <eric@skatter.usask.ca>
|
||||
|
||||
* bdm.c: Fix up error on minor device check in bdm_open.
|
||||
Remove erroneous comment in init_module.
|
||||
Improve log messages in init_module.
|
||||
|
||||
Wed Jun 11 16:59:06 1997 eric <eric@skatter.usask.ca>
|
||||
|
||||
* bdm.c:
|
||||
Removed code which sent an extra BDM_FILL_CMD for word or byte values.
|
||||
Cleaned up some formatting.
|
||||
|
||||
Wed Feb 19 17:15:06 1997 eric <eric@skatter.usask.ca>
|
||||
|
||||
* bdm.c, bdm.h: Add `set debug level' ioctl.
|
||||
|
||||
Fri Feb 7 15:10:49 1997 eric <eric@skatter.usask.ca>
|
||||
|
||||
* Makefile: Add a single `prefix'.
|
||||
Make directories if necessary when installing.
|
||||
|
||||
* bdm.c: Clean up some debugging messages.
|
||||
|
||||
Thu Feb 6 22:08:52 1997 eric <eric@skatter.usask.ca>
|
||||
|
||||
* Makefile: Add module installation to install target.
|
||||
|
||||
* bdm.c: Don't release ports that have been stolen from another driver.
|
||||
|
||||
* bdm.c:
|
||||
Install driver even if I/O ports are claimed by some other driver.
|
||||
I don't really like doing this, but the alternative would be to
|
||||
require that the parallel port (LP) driver be unloaded before
|
||||
the BDM driver could be loaded.
|
||||
|
||||
* bdm.c: More init_module message cleanup.
|
||||
|
||||
* bdm.c: Fix up init_module message.
|
||||
|
||||
* Makefile, bdm.c, bdm.h: Initial revision
|
||||
1108
m68k/driver/bdm-cf-pe.c
Normal file
1108
m68k/driver/bdm-cf-pe.c
Normal file
File diff suppressed because it is too large
Load Diff
946
m68k/driver/bdm-cpu32.c
Normal file
946
m68k/driver/bdm-cpu32.c
Normal file
@@ -0,0 +1,946 @@
|
||||
/*
|
||||
* Motorola Background Debug Mode Driver
|
||||
* Copyright (C) 1995 W. Eric Norum
|
||||
* Copyright (C) 1998-2008 Chris Johns
|
||||
*
|
||||
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* W. Eric Norum
|
||||
* Saskatchewan Accelerator Laboratory
|
||||
* University of Saskatchewan
|
||||
* 107 North Road
|
||||
* Saskatoon, Saskatchewan, CANADA
|
||||
* S7N 5C6
|
||||
*
|
||||
* eric@skatter.usask.ca
|
||||
*
|
||||
* Coldfire support by:
|
||||
* Chris Johns
|
||||
* chris@contemporary.net.au
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* PD (Eric's) CPU32 Interface
|
||||
*
|
||||
* Parallel port bit assignments
|
||||
*
|
||||
* Status register (bits 0-2 not used):
|
||||
* +---+---+---+---+---+---+---+---+
|
||||
* | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
||||
* +---+---+---+---+---+---+---+---+
|
||||
* | | | | |
|
||||
* | | | | +--- Target FREEZE line
|
||||
* | | | | 1 - Target is in background mode
|
||||
* | | | | 0 - Target is not background mode
|
||||
* | | | |
|
||||
* | | | +------- Not used
|
||||
* | | |
|
||||
* | | +----------- Serial data from target
|
||||
* | | 1 - `0' from target
|
||||
* | | 0 - `1' from target
|
||||
* | |
|
||||
* | +--------------- Target power
|
||||
* | 1 - Target power is ON
|
||||
* | 0 - Target power is OFF
|
||||
* |
|
||||
* +------------------- Target connected
|
||||
* 1 - Target is connected
|
||||
* 0 - Target is not connected
|
||||
*
|
||||
* Control register (bits 4-7 not used):
|
||||
* +---+---+---+---+
|
||||
* | 3 | 2 | 1 | 0 |
|
||||
* +---+---+---+---+
|
||||
* | | | |
|
||||
* | | | +--- Target BKPT* /DSCLK line
|
||||
* | | | Write 1 - Drive BKPT* /DSCLK line LOW
|
||||
* | | | Write 0 - Allow BKPT* /DSCLK line to go HIGH
|
||||
* | | | Allow flip-flop to control BKPT* /DSCLK line
|
||||
* | | |
|
||||
* | | +------- Target RESET* line
|
||||
* | | Write 1 - Force RESET* LOW
|
||||
* | | Write 0 - Allow monitoring of RESET*
|
||||
* | | Read 1 - RESET* is LOW
|
||||
* | | Read 0 - RESET* is HIGH
|
||||
* | |
|
||||
* | +----------- Serial data to target
|
||||
* | Write 0 - Send `0' to target
|
||||
* | Write 1 - Send `1' to target
|
||||
* |
|
||||
* +--------------- Control single-step flip-flop
|
||||
* Write 1 - Clear flip-flop
|
||||
* BKPT* /DSCLK is controlled by bit 0.
|
||||
* Write 0 - Allow flip-flop operation
|
||||
* Falling edge of IFETCH* /DSI clocks a `1'
|
||||
* into the flip-flop and drive BKPT* /DSCLK
|
||||
* LOW, causing a breakpoint.
|
||||
*/
|
||||
#define CPU32_PD_SR_CONNECTED (0x80)
|
||||
#define CPU32_PD_SR_POWERED (0x40)
|
||||
#define CPU32_PD_SR_DATA_BAR (0x20)
|
||||
#define CPU32_PD_SR_FROZEN (0x08)
|
||||
|
||||
#define CPU32_PD_CR_NOT_SINGLESTEP (0x08)
|
||||
#define CPU32_PD_CR_DATA (0x04)
|
||||
#define CPU32_PD_CR_FORCE_RESET (0x02)
|
||||
#define CPU32_PD_CR_RESET_STATUS (0x02)
|
||||
#define CPU32_PD_CR_CLOCKBAR_BKPT (0x01)
|
||||
|
||||
/*
|
||||
* ICD interface.
|
||||
*
|
||||
* Parallel port bit assignments
|
||||
*
|
||||
* Status register
|
||||
* +---+---+---+---+---+---+---+---+
|
||||
* | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
||||
* +---+---+---+---+---+---+---+---+
|
||||
* | | | | |
|
||||
* | | | | +--- Not used
|
||||
* | | | +------- Not used
|
||||
* | | +----------- Not used
|
||||
* | |
|
||||
* | +--------------- Target FREEZE line
|
||||
* | 1 - Target is in background mode
|
||||
* | 0 - Target is not background mode
|
||||
* |
|
||||
* +------------------- Serial data from target
|
||||
* 1 - `0' from target
|
||||
* 0 - `1' from target
|
||||
*
|
||||
* Data register
|
||||
* +---+---+---+---+---+---+---+---+
|
||||
* | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
||||
* +---+---+---+---+---+---+---+---+
|
||||
* | | | | | | | |
|
||||
* | | | | | | | +--- Serial data to target
|
||||
* | | | | | | | Write 1: Send 1 to target
|
||||
* | | | | | | | Write 0: Send 0 to target
|
||||
* | | | | | | | Signal gets to target, if OE is 1
|
||||
* | | | | | | | and target is in FREEZE mode
|
||||
* | | | | | | |
|
||||
* | | | | | | +------- Clock
|
||||
* | | | | | | if target in freeze mode, then:
|
||||
* | | | | | | Write 1: drive BKPT* /DSCLK 1
|
||||
* | | | | | | Write 0: drive BKPT* /DSCLK 0
|
||||
* | | | | | |
|
||||
* | | | | | +----------- BREAK
|
||||
* | | | | | if target not in freeze mode, then:
|
||||
* | | | | | Write 0: drive BKPT* /DSCLK 0
|
||||
* | | | | | line determines single stepping
|
||||
* | | | | | on leaving BGND mode:
|
||||
* | | | | | Write 0: do single step
|
||||
* | | | | | Write 1: continue normally
|
||||
* | | | | |
|
||||
* | | | | +--------------- RESET
|
||||
* | | | | Write 0: pull reset low
|
||||
* | | | | Write 1: release reset line
|
||||
* | | | |
|
||||
* | | | +--- OE
|
||||
* | | | Write 0 - DSI is tristated
|
||||
* | | | Write 1 - DSI pin is forced to level of serial data
|
||||
* | | |
|
||||
* | | +------- LED
|
||||
* | | Write 1 - turn on LED
|
||||
* | | Write 0 - turn off LED
|
||||
* | |
|
||||
* | +----------- ERROR
|
||||
* | Write 0 - BERR output is tristated
|
||||
* | Write 1 - BERR is pulled low
|
||||
* |
|
||||
* +--------------- spare
|
||||
*/
|
||||
|
||||
#define CPU32_ICD_DSI (1 << 0) /* data shift input Host->MCU */
|
||||
#define CPU32_ICD_DSCLK (1 << 1) /* data shift clock / breakpoint pin */
|
||||
#define CPU32_ICD_STEP_OUT (1 << 2) /* set low to force breakpoint */
|
||||
#define CPU32_ICD_RST_OUT (1 << 3) /* set low to force reset on MCU */
|
||||
#define CPU32_ICD_OE (1 << 4) /* set to a 1 to enable DSI */
|
||||
#define CPU32_ICD_FORCE_BERR (1 << 6) /* set to a 1 to force BERR on target */
|
||||
#define CPU32_ICD_FREEZE (1 << 6) /* */
|
||||
#define CPU32_ICD_DSO (1 << 7) /* */
|
||||
|
||||
/*
|
||||
************************************************************************
|
||||
* CPU32 for PD/ICD interface support routines *
|
||||
************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
* CPU32 system register mapping. See bdm.h for the user values.
|
||||
*/
|
||||
|
||||
static int cpu32_sysreg_map[BDM_REG_VBR + 1] =
|
||||
{ 0x0, /* BDM_REG_RPC */
|
||||
0x1, /* BDM_REG_PCC */
|
||||
0xb, /* BDM_REG_SR */
|
||||
0xc, /* BDM_REG_USP */
|
||||
0xd, /* BDM_REG_SSP */
|
||||
0xe, /* BDM_REG_SFC */
|
||||
0xf, /* BDM_REG_DFC */
|
||||
0x8, /* BDM_REG_ATEMP */
|
||||
0x9, /* BDM_REG_FAR */
|
||||
0xa /* BDM_REG_VBR */
|
||||
};
|
||||
|
||||
/* need by cpu32_read_sysreg() */
|
||||
static int cpu32_write_sysreg (struct BDM *self, struct BDMioctl *ioc, int mode);
|
||||
static int cpu32_icd_stop_chip (struct BDM *self);
|
||||
|
||||
/*
|
||||
* Clock a word to/from the target
|
||||
*/
|
||||
|
||||
static int
|
||||
cpu32_serial_clock (struct BDM *self, unsigned short wval, int holdback)
|
||||
{
|
||||
return (self->serial_clock) (self, wval, holdback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get target status
|
||||
*/
|
||||
static int
|
||||
cpu32_pd_get_status (struct BDM *self)
|
||||
{
|
||||
unsigned char sr = inb (self->statusPort);
|
||||
int ret;
|
||||
|
||||
if (!(sr & CPU32_PD_SR_CONNECTED))
|
||||
ret = BDM_TARGETNC;
|
||||
else if (!(sr & CPU32_PD_SR_POWERED))
|
||||
ret = BDM_TARGETPOWER;
|
||||
else
|
||||
ret = (sr & CPU32_PD_SR_FROZEN ? BDM_TARGETSTOPPED : 0) |
|
||||
(inb (self->controlPort) & CPU32_PD_CR_RESET_STATUS ? BDM_TARGETRESET : 0);
|
||||
if (self->debugFlag > 1)
|
||||
PRINTF (" cpu32_pd_get_status -- Status Port:0x%02x Status:0x%04x\n",
|
||||
sr, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Hardware initialization
|
||||
*/
|
||||
static int
|
||||
cpu32_pd_init_hardware (struct BDM *self)
|
||||
{
|
||||
int status;
|
||||
|
||||
/*
|
||||
* Force breakpoint
|
||||
*/
|
||||
outb (CPU32_PD_CR_NOT_SINGLESTEP | CPU32_PD_CR_CLOCKBAR_BKPT, self->controlPort);
|
||||
udelay (100);
|
||||
outb (CPU32_PD_CR_FORCE_RESET | CPU32_PD_CR_CLOCKBAR_BKPT, self->controlPort);
|
||||
bdm_sleep (HZ / 100);
|
||||
outb (CPU32_PD_CR_CLOCKBAR_BKPT, self->controlPort);
|
||||
udelay (10);
|
||||
outb (CPU32_PD_CR_NOT_SINGLESTEP | CPU32_PD_CR_CLOCKBAR_BKPT, self->controlPort);
|
||||
udelay (100);
|
||||
status = cpu32_pd_get_status (self);
|
||||
if (self->debugFlag)
|
||||
PRINTF (" cpu32_pd_init_hardware: status:0x%02x control port:0x%02x\n",
|
||||
status, inb (self->controlPort));
|
||||
return status;
|
||||
}
|
||||
|
||||
/*
|
||||
* Clock a word to/from the target
|
||||
*/
|
||||
static int
|
||||
cpu32_pd_serial_clock (struct BDM *self, unsigned short wval, int holdback)
|
||||
{
|
||||
unsigned long shiftRegister;
|
||||
unsigned char dataBit;
|
||||
unsigned int counter;
|
||||
unsigned int status = cpu32_pd_get_status (self);
|
||||
|
||||
if (status & BDM_TARGETRESET)
|
||||
return BDM_FAULT_RESET;
|
||||
if (status & BDM_TARGETNC)
|
||||
return BDM_FAULT_CABLE;
|
||||
if (status & BDM_TARGETPOWER)
|
||||
return BDM_FAULT_POWER;
|
||||
shiftRegister = wval;
|
||||
counter = 17 - holdback;
|
||||
while (counter--) {
|
||||
dataBit = ((shiftRegister & 0x10000) ? CPU32_PD_CR_DATA : 0);
|
||||
shiftRegister <<= 1;
|
||||
outb (dataBit | CPU32_PD_CR_NOT_SINGLESTEP | CPU32_PD_CR_CLOCKBAR_BKPT,
|
||||
self->controlPort);
|
||||
bdm_delay (self->delayTimer + 1);
|
||||
if ((inb (self->statusPort) & CPU32_PD_SR_DATA_BAR) == 0)
|
||||
shiftRegister |= 1;
|
||||
outb (dataBit | CPU32_PD_CR_NOT_SINGLESTEP, self->controlPort);
|
||||
bdm_delay ((self->delayTimer >> 1) + 1);
|
||||
}
|
||||
self->readValue = shiftRegister & 0x1FFFF;
|
||||
if (self->debugFlag)
|
||||
PRINTF (" cpu32_pd_serial_clock -- send 0x%05x receive 0x%05x\n",
|
||||
wval, self->readValue);
|
||||
if (self->readValue & 0x10000) {
|
||||
if (self->readValue == 0x10001)
|
||||
return BDM_FAULT_BERR;
|
||||
else if (self->readValue != 0x10000)
|
||||
return BDM_FAULT_NVC;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Restart chip and stop on first instruction fetch
|
||||
*/
|
||||
static int
|
||||
cpu32_pd_restart_chip (struct BDM *self)
|
||||
{
|
||||
int check;
|
||||
|
||||
if (self->debugFlag)
|
||||
PRINTF (" cpu32_pd_restart_chip\n");
|
||||
outb (CPU32_PD_CR_FORCE_RESET | CPU32_PD_CR_CLOCKBAR_BKPT, self->controlPort);
|
||||
udelay (10);
|
||||
outb (CPU32_PD_CR_CLOCKBAR_BKPT, self->controlPort);
|
||||
udelay (10);
|
||||
outb (CPU32_PD_CR_NOT_SINGLESTEP | CPU32_PD_CR_CLOCKBAR_BKPT, self->controlPort);
|
||||
for (check = 0 ; check < 1000 ; check++) {
|
||||
if (inb (self->statusPort) & CPU32_PD_SR_FROZEN)
|
||||
return 0;
|
||||
}
|
||||
return BDM_FAULT_RESPONSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Restart chip and disable background debugging mode
|
||||
*/
|
||||
static int
|
||||
cpu32_pd_release_chip (struct BDM *self)
|
||||
{
|
||||
if (self->debugFlag)
|
||||
PRINTF (" cpu32_pd_release_chip\n");
|
||||
outb (CPU32_PD_CR_NOT_SINGLESTEP | CPU32_PD_CR_FORCE_RESET, self->controlPort);
|
||||
udelay (10);
|
||||
outb (CPU32_PD_CR_NOT_SINGLESTEP, self->controlPort);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Restart chip, enable background debugging mode, halt on first fetch
|
||||
*
|
||||
* The software from the Motorola BBS tries to have the target
|
||||
* chip begin execution, but that doesn't work very reliably.
|
||||
* The RESETH* line rises rather slowly, so sometimes the BKPT* / DSCLK
|
||||
* would be seen low, and sometimes it wouldn't.
|
||||
*/
|
||||
static int
|
||||
cpu32_pd_reset_chip (struct BDM *self)
|
||||
{
|
||||
if (self->debugFlag)
|
||||
PRINTF (" cpu32_pd_reset_chip\n");
|
||||
outb (CPU32_PD_CR_CLOCKBAR_BKPT | CPU32_PD_CR_FORCE_RESET,
|
||||
self->controlPort);
|
||||
udelay (10);
|
||||
outb (CPU32_PD_CR_CLOCKBAR_BKPT, self->controlPort);
|
||||
udelay (10);
|
||||
outb (CPU32_PD_CR_CLOCKBAR_BKPT | CPU32_PD_CR_NOT_SINGLESTEP,
|
||||
self->controlPort);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Force the target into background debugging mode
|
||||
*/
|
||||
static int
|
||||
cpu32_pd_stop_chip (struct BDM *self)
|
||||
{
|
||||
int check;
|
||||
|
||||
if (self->debugFlag)
|
||||
PRINTF (" cpu32_pd_stop_chip\n");
|
||||
if (inb (self->statusPort) & CPU32_PD_SR_FROZEN)
|
||||
return 0;
|
||||
outb (CPU32_PD_CR_NOT_SINGLESTEP | CPU32_PD_CR_CLOCKBAR_BKPT,
|
||||
self->controlPort);
|
||||
for (check = 0 ; check < 1000 ; check++) {
|
||||
if (inb (self->statusPort) & CPU32_PD_SR_FROZEN)
|
||||
return 0;
|
||||
}
|
||||
return BDM_FAULT_RESPONSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Make the target execute a single instruction and
|
||||
* reenter background debugging mode
|
||||
*/
|
||||
static int
|
||||
cpu32_pd_step_chip (struct BDM *self)
|
||||
{
|
||||
int check;
|
||||
unsigned char dataBit;
|
||||
int err;
|
||||
|
||||
if (self->debugFlag)
|
||||
PRINTF (" cpu32_pd_step_chip\n");
|
||||
err = cpu32_serial_clock (self, BDM_GO_CMD, 1);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
/*
|
||||
* Send the last bit of the command
|
||||
*/
|
||||
dataBit = (BDM_GO_CMD & 0x1) ? CPU32_PD_CR_DATA : 0;
|
||||
outb (dataBit | CPU32_PD_CR_NOT_SINGLESTEP | CPU32_PD_CR_CLOCKBAR_BKPT,
|
||||
self->controlPort);
|
||||
bdm_delay (self->delayTimer + 1);
|
||||
|
||||
/*
|
||||
* Enable single-step
|
||||
*/
|
||||
outb (dataBit | CPU32_PD_CR_CLOCKBAR_BKPT, self->controlPort);
|
||||
bdm_delay (1);
|
||||
outb (dataBit, self->controlPort);
|
||||
|
||||
/*
|
||||
* Wait for step to complete
|
||||
* The software from the Motorola BBS doesn't do this, but
|
||||
* omitting the `outb' operation leaves a race condition the
|
||||
* next time cpu32_serial_clock is called.
|
||||
*
|
||||
* The first output operation in bdmSerialClock sends
|
||||
* `dataBit | CPU32_CR_NOT_SINGLESTEP | CPU32_CR_CLOCKBAR_BKPT' to the
|
||||
* control port. If the flip flop in the external circuit
|
||||
* clears before the `CPU32_CR_CLOCKBAR_BKPT' pin of the '132 goes
|
||||
* low, there is a narrow glitch on the BKPT* / DSCLK pin, which
|
||||
* clocks a garbage bit into the target chip.
|
||||
*/
|
||||
for (check = 0 ; check < 1000 ; check++) {
|
||||
if (inb (self->statusPort) & CPU32_PD_SR_FROZEN) {
|
||||
outb (CPU32_PD_CR_CLOCKBAR_BKPT, self->controlPort);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return BDM_FAULT_RESPONSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get target status
|
||||
*/
|
||||
static int
|
||||
cpu32_icd_get_status (struct BDM *self)
|
||||
{
|
||||
unsigned char sr = inb (self->statusPort);
|
||||
int ret;
|
||||
|
||||
ret = sr & CPU32_ICD_FREEZE ? BDM_TARGETSTOPPED : 0;
|
||||
if (self->debugFlag > 1)
|
||||
PRINTF (" cpu32_icd_get_status -- Status Port:0x%02x Status:0x%04x\n",
|
||||
sr, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Hardware initialization
|
||||
*/
|
||||
static int
|
||||
cpu32_icd_init_hardware (struct BDM *self)
|
||||
{
|
||||
int status;
|
||||
|
||||
/*
|
||||
* Force breakpoint
|
||||
*/
|
||||
outb (CPU32_ICD_STEP_OUT | CPU32_ICD_DSCLK | CPU32_ICD_RST_OUT, self->dataPort);
|
||||
udelay (10);
|
||||
status = cpu32_icd_get_status (self);
|
||||
if (self->debugFlag)
|
||||
PRINTF (" cpu32_icd_init_hardware: status:0x%02x, data port:0x%02x\n",
|
||||
status, inb (self->dataPort));
|
||||
return status;
|
||||
}
|
||||
|
||||
/*
|
||||
* Clock a word to/from the target
|
||||
*/
|
||||
static int
|
||||
cpu32_icd_serial_clock (struct BDM *self, unsigned short wval, int holdback)
|
||||
{
|
||||
unsigned long shiftRegister;
|
||||
unsigned char dataBit;
|
||||
unsigned int counter;
|
||||
unsigned int status = cpu32_icd_get_status (self);
|
||||
|
||||
if (status & BDM_TARGETRESET)
|
||||
return BDM_FAULT_RESET;
|
||||
if (status & BDM_TARGETNC)
|
||||
return BDM_FAULT_CABLE;
|
||||
if (status & BDM_TARGETPOWER)
|
||||
return BDM_FAULT_POWER;
|
||||
if(!(status & BDM_TARGETSTOPPED)) {
|
||||
if (self->debugFlag)
|
||||
PRINTF (" cpu32_icd_serial_clock -- stop target first\n");
|
||||
if (cpu32_icd_stop_chip (self) == BDM_FAULT_RESPONSE) {
|
||||
if (self->debugFlag)
|
||||
PRINTF (" cpu32_icd_serial_clock -- can\'t stop it\n");
|
||||
return BDM_FAULT_RESPONSE;
|
||||
}
|
||||
}
|
||||
shiftRegister = wval;
|
||||
counter = 17 - holdback;
|
||||
while (counter--) {
|
||||
dataBit = ((shiftRegister & 0x10000) ? CPU32_ICD_DSI : 0);
|
||||
shiftRegister <<= 1;
|
||||
outb (dataBit | CPU32_ICD_RST_OUT | CPU32_ICD_OE | CPU32_ICD_STEP_OUT,
|
||||
self->dataPort);
|
||||
bdm_delay (self->delayTimer + 1);
|
||||
if ((inb (self->statusPort) & CPU32_ICD_DSO) == 0)
|
||||
shiftRegister |= 1;
|
||||
outb (dataBit | CPU32_ICD_RST_OUT | CPU32_ICD_OE | CPU32_ICD_STEP_OUT | CPU32_ICD_DSCLK,
|
||||
self->dataPort);
|
||||
bdm_delay ((self->delayTimer >> 1) + 1);
|
||||
}
|
||||
if (holdback == 0) {
|
||||
outb (CPU32_ICD_RST_OUT | CPU32_ICD_STEP_OUT | CPU32_ICD_DSCLK,
|
||||
self->dataPort);
|
||||
bdm_delay (self->delayTimer + 1);
|
||||
}
|
||||
outb (CPU32_ICD_RST_OUT | CPU32_ICD_STEP_OUT | CPU32_ICD_DSCLK,
|
||||
self->dataPort);
|
||||
self->readValue = shiftRegister & 0x1FFFF;
|
||||
if (self->debugFlag)
|
||||
PRINTF (" cpu32_icd_serial_clock -- send 0x%05x, receive 0x%05x\n",
|
||||
wval, self->readValue);
|
||||
if (self->readValue & 0x10000) {
|
||||
if (self->readValue == 0x10001)
|
||||
return BDM_FAULT_BERR;
|
||||
else if (self->readValue != 0x10000)
|
||||
return BDM_FAULT_NVC;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Force the target into background debugging mode
|
||||
*/
|
||||
static int
|
||||
cpu32_icd_stop_chip (struct BDM *self)
|
||||
{
|
||||
int check;
|
||||
int pass;
|
||||
|
||||
if (self->debugFlag)
|
||||
PRINTF (" cpu32_icd_stop_chip: ");
|
||||
/* if FREEZE is already high, we're stopped and we're done here */
|
||||
if (inb (self->statusPort) & CPU32_ICD_FREEZE) {
|
||||
if (self->debugFlag)
|
||||
PRINTF ("already stopped\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* try multiple times... */
|
||||
for (pass = 0; pass < 14; pass++) {
|
||||
|
||||
/* even times, simply assert DSCLK and RESET */
|
||||
if (pass%2 == 0) {
|
||||
outb (CPU32_ICD_DSCLK | CPU32_ICD_RST_OUT, self->dataPort);
|
||||
}
|
||||
/* odd times, yank BERR as well, in case the target is wedged */
|
||||
else {
|
||||
outb (CPU32_ICD_DSCLK | CPU32_ICD_RST_OUT | CPU32_ICD_FORCE_BERR,
|
||||
self->dataPort);
|
||||
}
|
||||
|
||||
/* now hang around and wait for the freeze line to come up
|
||||
* XXX we're depending on a nop loop for timing? arrrgh!
|
||||
*/
|
||||
for (check = 0 ; check < (1000 + ((pass+1)%2) * 9000) ; check++) {
|
||||
if (inb (self->statusPort) & CPU32_ICD_FREEZE) {
|
||||
/* if freeze line is high we're OK
|
||||
* XXX let reset go too?
|
||||
*/
|
||||
if (self->debugFlag)
|
||||
PRINTF("stopped after %d bdm_delays\n", check);
|
||||
outb (CPU32_ICD_RST_OUT, self->dataPort);
|
||||
return 0;
|
||||
}
|
||||
bdm_delay (10);
|
||||
}
|
||||
|
||||
}
|
||||
/* we've failed... */
|
||||
outb (CPU32_ICD_RST_OUT, self->dataPort);
|
||||
if (self->debugFlag)
|
||||
PRINTF("failed!\n");
|
||||
return BDM_FAULT_RESPONSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Restart chip and stop on first instruction fetch
|
||||
*/
|
||||
static int
|
||||
cpu32_icd_restart_chip (struct BDM *self)
|
||||
{
|
||||
if (self->debugFlag)
|
||||
PRINTF (" cpu32_icd_restart_chip\n");
|
||||
outb (CPU32_ICD_DSCLK, self->dataPort);
|
||||
udelay (1);
|
||||
return cpu32_icd_stop_chip (self);
|
||||
}
|
||||
|
||||
/*
|
||||
* Restart chip and disable background debugging mode
|
||||
*/
|
||||
static int
|
||||
cpu32_icd_release_chip (struct BDM *self)
|
||||
{
|
||||
if (self->debugFlag)
|
||||
PRINTF (" cpu32_icd_release_chip\n");
|
||||
outb (CPU32_ICD_DSCLK | CPU32_ICD_STEP_OUT, self->dataPort);
|
||||
udelay (10);
|
||||
outb (CPU32_ICD_DSCLK | CPU32_ICD_RST_OUT | CPU32_ICD_STEP_OUT, self->dataPort);
|
||||
udelay (10);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Restart chip, enable background debugging mode, halt on first fetch
|
||||
*
|
||||
* The software from the Motorola BBS tries to have the target
|
||||
* chip begin execution, but that doesn't work very reliably.
|
||||
* The RESETH* line rises rather slowly, so sometimes the BKPT* / DSCLK
|
||||
* would be seen low, and sometimes it wouldn't.
|
||||
*/
|
||||
static int
|
||||
cpu32_icd_reset_chip (struct BDM *self)
|
||||
{
|
||||
if (self->debugFlag)
|
||||
PRINTF (" cpu32_icd_reset_chip\n");
|
||||
|
||||
/*
|
||||
* Assert RESET*, BKPT*, and BREAK*
|
||||
*/
|
||||
outb (0, self->dataPort);
|
||||
udelay (100);
|
||||
|
||||
/*
|
||||
* Deassert RESET (CPU must see BKPT* asserted at rising edge of RESET*)
|
||||
* Leaving BKPT* and BREAK* asserted gets us ready for first data txfer
|
||||
* as per Figure 7-8 in CPU32RM/AD
|
||||
*/
|
||||
outb (CPU32_ICD_RST_OUT, self->dataPort);
|
||||
udelay (100);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Make the target execute a single instruction and
|
||||
* reenter background debugging mode
|
||||
*/
|
||||
static int
|
||||
cpu32_icd_step_chip (struct BDM *self)
|
||||
{
|
||||
unsigned char dataBit;
|
||||
int err;
|
||||
|
||||
if (self->debugFlag)
|
||||
PRINTF (" cpu32_step_chip\n");
|
||||
err = cpu32_serial_clock (self, BDM_GO_CMD, 1);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
/*
|
||||
* Send the last bit of the command
|
||||
*/
|
||||
dataBit = (BDM_GO_CMD & 0x1) ? CPU32_ICD_DSI : 0;
|
||||
outb (dataBit | CPU32_ICD_OE | CPU32_ICD_STEP_OUT | CPU32_ICD_RST_OUT,
|
||||
self->dataPort);
|
||||
bdm_delay (self->delayTimer + 1);
|
||||
outb (dataBit | CPU32_ICD_OE | CPU32_ICD_RST_OUT, self->dataPort);
|
||||
bdm_delay (1);
|
||||
/* Raise CPU32_ICD_DSCLK before dropping CPU32_ICD_OEA */
|
||||
outb (CPU32_ICD_DSCLK | CPU32_ICD_OE | CPU32_ICD_RST_OUT, self->dataPort);
|
||||
bdm_delay (1);
|
||||
outb (CPU32_ICD_DSCLK | CPU32_ICD_RST_OUT, self->dataPort);
|
||||
|
||||
return cpu32_icd_stop_chip (self);
|
||||
}
|
||||
|
||||
/*
|
||||
* Read system register
|
||||
*/
|
||||
|
||||
static int
|
||||
cpu32_read_sysreg (struct BDM *self, struct BDMioctl *ioc, int mode)
|
||||
{
|
||||
int err, cmd;
|
||||
unsigned short msw, lsw;
|
||||
|
||||
/*
|
||||
* CPU32 MBAR require sfc support, make it look like
|
||||
* a register.
|
||||
*/
|
||||
if (ioc->address == BDM_REG_MBAR) {
|
||||
struct BDMioctl mbar_ioc;
|
||||
unsigned long sfc;
|
||||
|
||||
mbar_ioc.address = BDM_REG_SFC;
|
||||
if ((err = cpu32_read_sysreg (self, &mbar_ioc,
|
||||
BDM_SYS_REG_MODE_MAPPED)) < 0)
|
||||
return err;
|
||||
sfc = mbar_ioc.value;
|
||||
mbar_ioc.address = BDM_REG_SFC;
|
||||
mbar_ioc.value = 7;
|
||||
if ((err = cpu32_write_sysreg (self, &mbar_ioc,
|
||||
BDM_SYS_REG_MODE_MAPPED)) < 0)
|
||||
return err;
|
||||
mbar_ioc.address = 0x3FF00;
|
||||
if ((err = bdmDrvReadLongWord (self, &mbar_ioc)) < 0)
|
||||
return err;
|
||||
ioc->value = mbar_ioc.value;
|
||||
mbar_ioc.address = BDM_REG_SFC;
|
||||
mbar_ioc.value = sfc;
|
||||
if ((err = cpu32_write_sysreg (self, &mbar_ioc,
|
||||
BDM_SYS_REG_MODE_MAPPED)) < 0)
|
||||
return err;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (ioc->address > BDM_REG_VBR)
|
||||
return BDM_FAULT_NVC;
|
||||
|
||||
if (mode != BDM_SYS_REG_MODE_MAPPED)
|
||||
cmd = ioc->address & 0xffff;
|
||||
else
|
||||
cmd = cpu32_sysreg_map[ioc->address];
|
||||
|
||||
if (cmd == -1) {
|
||||
ioc->value = 0;
|
||||
if (self->debugFlag)
|
||||
PRINTF (" cpu32_read_sysreg - Reg(%d):0x%x is not mapped; ignored\n",
|
||||
mode, ioc->address);
|
||||
return 0;
|
||||
}
|
||||
|
||||
cmd |= BDM_RSREG_CMD;
|
||||
|
||||
if (((err = cpu32_serial_clock (self, cmd, 0)) != 0) ||
|
||||
((err = bdmBitBashFetchWord (self, &msw)) != 0) ||
|
||||
((err = bdmBitBashFetchWord (self, &lsw)) != 0))
|
||||
return err;
|
||||
ioc->value = (msw << 16) | lsw;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Write system register
|
||||
*/
|
||||
static int
|
||||
cpu32_write_sysreg (struct BDM *self, struct BDMioctl *ioc, int mode)
|
||||
{
|
||||
int err, cmd;
|
||||
|
||||
/*
|
||||
* CPU32 MBAR require dfc support, make it look like
|
||||
* a register.
|
||||
*/
|
||||
if (ioc->address == BDM_REG_MBAR) {
|
||||
struct BDMioctl mbar_ioc;
|
||||
unsigned long dfc;
|
||||
|
||||
mbar_ioc.address = BDM_REG_DFC;
|
||||
if ((err = cpu32_read_sysreg (self, &mbar_ioc,
|
||||
BDM_SYS_REG_MODE_MAPPED)) < 0)
|
||||
return err;
|
||||
dfc = mbar_ioc.value;
|
||||
mbar_ioc.address = BDM_REG_DFC;
|
||||
mbar_ioc.value = 7;
|
||||
if ((err = cpu32_write_sysreg (self, &mbar_ioc,
|
||||
BDM_SYS_REG_MODE_MAPPED)) < 0)
|
||||
return err;
|
||||
mbar_ioc.address = 0x3FF00;
|
||||
mbar_ioc.value = ioc->value;
|
||||
if ((err = bdmDrvWriteLongWord (self, &mbar_ioc)) < 0)
|
||||
return err;
|
||||
mbar_ioc.address = BDM_REG_DFC;
|
||||
mbar_ioc.value = dfc;
|
||||
if ((err = cpu32_write_sysreg (self, &mbar_ioc,
|
||||
BDM_SYS_REG_MODE_MAPPED)) < 0)
|
||||
return err;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (ioc->address > BDM_REG_VBR)
|
||||
return BDM_FAULT_NVC;
|
||||
|
||||
if (mode != BDM_SYS_REG_MODE_MAPPED)
|
||||
cmd = ioc->address & 0xffff;
|
||||
else
|
||||
cmd = cpu32_sysreg_map[ioc->address];
|
||||
|
||||
cmd = BDM_WSREG_CMD;
|
||||
|
||||
if (((err = cpu32_serial_clock (self, cmd, 0)) != 0) ||
|
||||
((err = cpu32_serial_clock (self, ioc->value >> 16, 0)) != 0) ||
|
||||
((err = cpu32_serial_clock (self, ioc->value, 0)) != 0))
|
||||
return err;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Generate a bus error for the ICD interface
|
||||
*/
|
||||
|
||||
static int
|
||||
cpu32_icd_gen_bus_error (struct BDM *self)
|
||||
{
|
||||
if (self->debugFlag)
|
||||
PRINTF(" cpu32_icd_gen_bus_error\n");
|
||||
|
||||
outb (CPU32_ICD_FORCE_BERR | CPU32_ICD_RST_OUT, self->dataPort);
|
||||
udelay (400);
|
||||
outb (CPU32_ICD_RST_OUT, self->dataPort);
|
||||
|
||||
return BDM_FAULT_BERR;
|
||||
}
|
||||
|
||||
/*
|
||||
* Generate a bus error as the access has failed. This is
|
||||
* not supported on the CPU32 with PD interface.
|
||||
* (the 7-chip PD interface generates it automatically in hardware
|
||||
*/
|
||||
static int
|
||||
cpu32_gen_bus_error (struct BDM *self)
|
||||
{
|
||||
if (self->debugFlag > 1)
|
||||
PRINTF(" cpu32_gen_bus_error\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Restart target execution
|
||||
*/
|
||||
static int
|
||||
cpu32_run_chip (struct BDM *self)
|
||||
{
|
||||
return cpu32_serial_clock (self, BDM_GO_CMD, 0);
|
||||
}
|
||||
|
||||
#ifdef BDM_BIT_BASH_PORT
|
||||
|
||||
/*
|
||||
* Bit Bash the BDM port. No status checks. I assume you know what is happening at
|
||||
* a low level with the BDM hardware if you are using this interface.
|
||||
*/
|
||||
static int
|
||||
cpu32_bit_bash (struct BDM *self, unsigned short mask, unsigned short bits)
|
||||
{
|
||||
unsigned char ctrl_port = 0;
|
||||
|
||||
if (self->debugFlag)
|
||||
PRINTF (" cpu32_bit_bash: mask=%04x, bits=%04x\n", mask, bits);
|
||||
|
||||
self->bit_bash_bits &= ~mask;
|
||||
self->bit_bash_bits |= bits;
|
||||
|
||||
if (self->bit_bash_bits & BDM_BB_RESET)
|
||||
ctrl_port |= CPU32_CR_FORCE_RESET;
|
||||
|
||||
if ((self->bit_bash_bits & BDM_BB_BKPT) == 0)
|
||||
ctrl_port |= CPU32_CR_CLOCKBAR_BKPT;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Initialise the BDM structure for a CPU32
|
||||
*/
|
||||
static int
|
||||
cpu32_pd_init_self (struct BDM *self)
|
||||
{
|
||||
int reg;
|
||||
|
||||
self->processor = BDM_CPU32;
|
||||
self->interface = BDM_CPU32_ERIC;
|
||||
|
||||
self->get_status = cpu32_pd_get_status;
|
||||
self->init_hardware = cpu32_pd_init_hardware;
|
||||
self->serial_clock = cpu32_pd_serial_clock;
|
||||
self->gen_bus_error = cpu32_gen_bus_error;
|
||||
self->read_sysreg = cpu32_read_sysreg;
|
||||
self->write_sysreg = cpu32_write_sysreg;
|
||||
self->restart_chip = cpu32_pd_restart_chip;
|
||||
self->release_chip = cpu32_pd_release_chip;
|
||||
self->reset_chip = cpu32_pd_reset_chip;
|
||||
self->stop_chip = cpu32_pd_stop_chip;
|
||||
self->run_chip = cpu32_run_chip;
|
||||
self->step_chip = cpu32_pd_step_chip;
|
||||
|
||||
#ifdef BDM_BIT_BASH_PORT
|
||||
self->bit_bash = cpu32_bit_bash;
|
||||
self->bit_bash_bits = 0;
|
||||
#endif
|
||||
|
||||
for (reg = 0; reg < BDM_MAX_SYSREG; reg++)
|
||||
self->shadow_sysreg[reg] = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
cpu32_icd_init_self (struct BDM *self)
|
||||
{
|
||||
int reg;
|
||||
|
||||
self->processor = BDM_CPU32;
|
||||
self->interface = BDM_CPU32_ICD;
|
||||
|
||||
self->get_status = cpu32_icd_get_status;
|
||||
self->init_hardware = cpu32_icd_init_hardware;
|
||||
self->serial_clock = cpu32_icd_serial_clock;
|
||||
self->gen_bus_error = cpu32_icd_gen_bus_error;
|
||||
self->restart_chip = cpu32_icd_restart_chip;
|
||||
self->release_chip = cpu32_icd_release_chip;
|
||||
self->reset_chip = cpu32_icd_reset_chip;
|
||||
self->stop_chip = cpu32_icd_stop_chip;
|
||||
self->run_chip = cpu32_run_chip;
|
||||
self->step_chip = cpu32_icd_step_chip;
|
||||
self->fill_buf = bdmBitBashFillBuf;
|
||||
self->send_buf = bdmBitBashSendBuf;
|
||||
self->read_sysreg = cpu32_read_sysreg;
|
||||
self->read_proreg = bdmBitBashReadProcessorRegister;
|
||||
self->read_long_word = bdmBitBashReadLongWord;
|
||||
self->read_word = bdmBitBashReadWord;
|
||||
self->read_byte = bdmBitBashReadByte;
|
||||
self->write_sysreg = cpu32_write_sysreg;
|
||||
self->write_proreg = bdmBitBashWriteProcessorRegister;
|
||||
self->write_long_word = bdmBitBashWriteLongWord;
|
||||
self->write_word = bdmBitBashWriteWord;
|
||||
self->write_byte = bdmBitBashWriteByte;
|
||||
|
||||
#ifdef BDM_BIT_BASH_PORT
|
||||
self->bit_bash = cpu32_bit_bash;
|
||||
self->bit_bash_bits = 0;
|
||||
#endif
|
||||
|
||||
for (reg = 0; reg < BDM_MAX_SYSREG; reg++)
|
||||
self->shadow_sysreg[reg] = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user